trunk/src/mame/drivers/dwarfd.c
| r30669 | r30670 | |
| 581 | 581 | for(i=0;i<8;i+=2) |
| 582 | 582 | { |
| 583 | 583 | UINT8 pixel = (pixels >> (i * 2)) & 0xf; |
| 584 | | bitmap.pix32(y, x + i) = palette[pixel & 0xe]; |
| 585 | | bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : (pixel & 0xe)]; |
| 584 | UINT8 value = (pixel >> 1) | (rvv << 3) | (vsp << 4); |
| 585 | bitmap.pix32(y, x + i) = palette[value]; |
| 586 | bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : value]; |
| 586 | 587 | } |
| 587 | 588 | } |
| 588 | 589 | |
| r30669 | r30670 | |
| 596 | 597 | //if(!linecount) |
| 597 | 598 | // logerror("%d %d %02x %02x %02x %02x %02x %02x %02x\n", x/8, y/8, charcode, lineattr, lten, rvv, vsp, gpa, hlgt); |
| 598 | 599 | |
| 599 | | if(vsp) |
| 600 | | pixels ^= 0xeeee; // FIXME: What is this really supposed to do? |
| 601 | | |
| 602 | 600 | for(i=0;i<8;i+=2) |
| 603 | 601 | { |
| 604 | 602 | UINT8 pixel = (pixels >> (i * 2)) & 0xf; |
| 605 | | bitmap.pix32(y, x + i) = palette[pixel & 0xe]; |
| 606 | | bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : (pixel & 0xe)]; |
| 603 | UINT8 value = (pixel >> 1) | (rvv << 3) | (vsp << 4); |
| 604 | bitmap.pix32(y, x + i) = palette[value]; |
| 605 | bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : value]; |
| 607 | 606 | } |
| 608 | 607 | } |
| 609 | 608 | |
| r30669 | r30670 | |
| 722 | 721 | { |
| 723 | 722 | int i; |
| 724 | 723 | |
| 725 | | for (i = 0; i < 256; i++) |
| 724 | for (i = 0; i < 32; i++) |
| 726 | 725 | { |
| 727 | 726 | int r = machine().rand()|0x80; |
| 728 | 727 | int g = machine().rand()|0x80; |
| 729 | 728 | int b = machine().rand()|0x80; |
| 730 | | if (i == 0) r = g = b = 0; |
| 731 | | |
| 732 | 729 | palette.set_pen_color(i,rgb_t(r,g,b)); |
| 733 | 730 | } |
| 734 | | palette.set_pen_color(8, rgb_t(255, 255, 0)); |
| 735 | | palette.set_pen_color(12, rgb_t(127, 127, 255)); |
| 736 | | palette.set_pen_color(4, rgb_t(0, 255, 0)); |
| 737 | | palette.set_pen_color(6, rgb_t(255, 0, 0)); |
| 731 | palette.set_pen_color(0, rgb_t(0, 0, 0)); |
| 732 | palette.set_pen_color(1, rgb_t(255, 0, 0)); |
| 733 | palette.set_pen_color(2, rgb_t(0, 255, 0)); |
| 734 | palette.set_pen_color(3, rgb_t(255, 0, 0)); |
| 735 | palette.set_pen_color(4, rgb_t(255, 255, 0)); |
| 736 | palette.set_pen_color(6, rgb_t(255, 255, 255)); |
| 737 | palette.set_pen_color(7, rgb_t(0, 0, 0)); |
| 738 | palette.set_pen_color(8, rgb_t(0, 0, 0)); |
| 739 | palette.set_pen_color(9, rgb_t(0, 0, 0)); |
| 740 | palette.set_pen_color(12, rgb_t(255, 255, 0)); |
| 741 | palette.set_pen_color(14, rgb_t(255, 255, 255)); |
| 742 | palette.set_pen_color(16, rgb_t(0, 0, 0)); |
| 743 | palette.set_pen_color(20, rgb_t(0, 0, 255)); |
| 738 | 744 | } |
| 739 | 745 | |
| 740 | 746 | void dwarfd_state::machine_start() |
| r30669 | r30670 | |
| 770 | 776 | MCFG_I8275_DRQ_CALLBACK(WRITELINE(dwarfd_state, drq_w)) |
| 771 | 777 | |
| 772 | 778 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", dwarfd) |
| 773 | | MCFG_PALETTE_ADD("palette", 0x100) |
| 779 | MCFG_PALETTE_ADD("palette", 32) |
| 774 | 780 | MCFG_PALETTE_INIT_OWNER(dwarfd_state, dwarfd) |
| 775 | 781 | |
| 776 | 782 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r30669 | r30670 | |
| 999 | 1005 | { |
| 1000 | 1006 | if (src[i] & 0x10) |
| 1001 | 1007 | { |
| 1002 | | src[i] = src[i] & 0xe0; |
| 1008 | src[i] = (src[i] & 0xe0) >> 1; |
| 1003 | 1009 | // src[i] |= ((src[(i + 1) & 0x7fff] & 0xe0) >> 4); |
| 1004 | 1010 | |
| 1005 | 1011 | } |
| 1006 | 1012 | else |
| 1007 | 1013 | { |
| 1008 | | src[i] = src[i] & 0xe0; |
| 1014 | src[i] = (src[i] & 0xe0) >> 1; |
| 1009 | 1015 | src[i] |= (src[i] >> 4); |
| 1010 | 1016 | |
| 1011 | 1017 | } |