trunk/src/mess/video/x68k.c
| r30773 | r30774 | |
| 23 | 23 | 2 tilemapped layers - can be 8x8 or 16x16, 16 colours per tile, max 256 colours overall |
| 24 | 24 | 1 sprite layer - up to 128 16x16 sprites, 16 colours per sprite, maximum 16 sprites per scanline (not yet implemented). |
| 25 | 25 | |
| 26 | Questions: What do the other bits in m_video.reg[2] do? |
| 27 | How is the intensity applied during blending if at all? |
| 28 | Black appears to be opaque only at priority 2 but not 3, is that right? |
| 29 | How is the gfx layer cleared in pacland and text layer in akumajo? |
| 30 | Are the gfx layers blended from the bottom up or all at once? |
| 31 | |
| 26 | 32 | */ |
| 27 | 33 | |
| 28 | 34 | #include "emu.h" |
| 35 | |
| 29 | 36 | #include "machine/mc68901.h" |
| 30 | 37 | #include "includes/x68k.h" |
| 31 | 38 | #include "machine/ram.h" |
| 32 | 39 | |
| 33 | 40 | |
| 41 | rgb_t x68k_state::GGGGGRRRRRBBBBBI_decoder(UINT32 raw) |
| 42 | { |
| 43 | UINT8 i = raw & 1; |
| 44 | UINT8 r = pal6bit(((raw >> 5) & 0x3e) | i); |
| 45 | UINT8 g = pal6bit(((raw >> 10) & 0x3e) | i); |
| 46 | UINT8 b = pal6bit(((raw >> 0) & 0x3e) | i); |
| 47 | return rgb_t(r, g, b); |
| 48 | } |
| 34 | 49 | |
| 35 | | |
| 36 | 50 | inline void x68k_state::x68k_plot_pixel(bitmap_rgb32 &bitmap, int x, int y, UINT32 color) |
| 37 | 51 | { |
| 38 | 52 | bitmap.pix32(y, x) = (UINT16)color; |
| r30773 | r30774 | |
| 720 | 734 | + (((m_tvram[loc+0x20000] >> bit) & 0x01) ? 4 : 0) |
| 721 | 735 | + (((m_tvram[loc+0x30000] >> bit) & 0x01) ? 8 : 0); |
| 722 | 736 | // Colour 0 is displayable if the text layer is at the priority level 2 |
| 723 | | if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || (m_video.text_pri == 2)) |
| 737 | if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || ((m_video.reg[1] & 0x0c00) == 0x0800)) |
| 724 | 738 | bitmap.pix32(line, pixel) = m_pcgpalette->pen(colour); |
| 725 | 739 | bit--; |
| 726 | 740 | if(bit < 0) |
| r30773 | r30774 | |
| 847 | 861 | { |
| 848 | 862 | if(ret) |
| 849 | 863 | { |
| 850 | | if(blend) |
| 864 | if(blend && bitmap.pix16(scanline, pixel)) |
| 851 | 865 | bitmap.pix16(scanline, pixel) = ((bitmap.pix16(scanline, pixel) >> 1) & 0x7bde) + ((pal[colour] >> 1) & 0x7bde) + 1; |
| 852 | 866 | else |
| 853 | | bitmap.pix16(scanline, pixel) = pal[colour] & 0xfffe; |
| 867 | bitmap.pix16(scanline, pixel) = (pal[colour] & 0xfffe) + blend; |
| 854 | 868 | } |
| 855 | 869 | else |
| 856 | 870 | bitmap.pix16(scanline, pixel) = colour; |
| r30773 | r30774 | |
| 909 | 923 | { |
| 910 | 924 | colour = m_gfxbitmap->pix16(scanline, pixel); |
| 911 | 925 | if(colour || (m_video.gfx_pri == 2)) |
| 912 | | bitmap.pix32(scanline, pixel) = pal555(colour, 6, 11, 1); |
| 926 | bitmap.pix32(scanline, pixel) = GGGGGRRRRRBBBBBI_decoder(colour); |
| 913 | 927 | } |
| 914 | 928 | else if(gfxblend) |
| 915 | 929 | { |
| r30773 | r30774 | |
| 1208 | 1222 | for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++) |
| 1209 | 1223 | { |
| 1210 | 1224 | UINT8 colour = m_pcgbitmap->pix16(scanline, pixel) & 0xff; |
| 1211 | | if(colour && (m_pcgpalette->pen(colour) & 0xffffff)) |
| 1225 | if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || ((m_video.reg[1] & 0x3000) == 0x2000)) |
| 1212 | 1226 | bitmap.pix32(scanline, pixel) = m_pcgpalette->pen(colour); |
| 1213 | 1227 | } |
| 1214 | 1228 | } |
trunk/src/mess/drivers/x68k.c
| r30773 | r30774 | |
| 1722 | 1722 | MCFG_GFXDECODE_ADD("gfxdecode", "pcgpalette", empty) |
| 1723 | 1723 | |
| 1724 | 1724 | MCFG_PALETTE_ADD("gfxpalette", 256) |
| 1725 | | MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx) |
| 1725 | palette_device::static_set_format(*device, raw_to_rgb_converter(2, &x68k_state::GGGGGRRRRRBBBBBI_decoder)); |
| 1726 | 1726 | MCFG_PALETTE_ADD("pcgpalette", 256) |
| 1727 | | MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx) |
| 1727 | palette_device::static_set_format(*device, raw_to_rgb_converter(2, &x68k_state::GGGGGRRRRRBBBBBI_decoder)); |
| 1728 | 1728 | |
| 1729 | 1729 | MCFG_VIDEO_START_OVERRIDE(x68k_state, x68000 ) |
| 1730 | 1730 | |