diff options
Diffstat (limited to 'src/devices/machine/spg2xx_video.cpp')
-rw-r--r-- | src/devices/machine/spg2xx_video.cpp | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp index 45f3c5e9ee5..942b31d4dab 100644 --- a/src/devices/machine/spg2xx_video.cpp +++ b/src/devices/machine/spg2xx_video.cpp @@ -225,6 +225,7 @@ void spg2xx_video_device::draw_bitmap(const rectangle& cliprect, uint32_t scanli //printf("draw bitmap bases %04x %04x\n", tilemap, palette_map); + //uint32_t xscroll = regs[0]; uint32_t yscroll = regs[1]; int realline = (scanline + yscroll) & 0xff; @@ -243,30 +244,47 @@ void spg2xx_video_device::draw_bitmap(const rectangle& cliprect, uint32_t scanli palette &= 0x00ff; //const int linewidth = 320 / 2; - int sourcebase = tile | (palette << 16); // this is correct for Texas Hold'em - TODO: get from a register? + int sourcebase = tile | (palette << 16); uint32_t* dest = &m_screenbuf[320 * scanline]; - for (int i = 0; i < 320 / 2; i++) - { - uint8_t palette_entry; - uint16_t color; - const uint16_t data = space.read_word(sourcebase + i); - - palette_entry = (data & 0x00ff); - color = m_paletteram[palette_entry]; + uint32_t ctrl = regs[3]; - if (!(color & 0x8000)) + if (ctrl & 0x80) // HiColor mode (rad_digi) + { + for (int i = 0; i < 320; i++) { - dest[(i * 2)+0] = m_rgb555_to_rgb888[color & 0x7fff]; + const uint16_t data = space.read_word(sourcebase + i); + + if (!(data & 0x8000)) + { + dest[i] = m_rgb555_to_rgb888[data & 0x7fff]; + } } + } + else + { + for (int i = 0; i < 320 / 2; i++) + { + uint8_t palette_entry; + uint16_t color; + const uint16_t data = space.read_word(sourcebase + i); - palette_entry = (data & 0xff00) >> 8; - color = m_paletteram[palette_entry]; + palette_entry = (data & 0x00ff); + color = m_paletteram[palette_entry]; - if (!(color & 0x8000)) - { - dest[(i * 2)+1] = m_rgb555_to_rgb888[color & 0x7fff]; + if (!(color & 0x8000)) + { + dest[(i * 2) + 0] = m_rgb555_to_rgb888[color & 0x7fff]; + } + + palette_entry = (data & 0xff00) >> 8; + color = m_paletteram[palette_entry]; + + if (!(color & 0x8000)) + { + dest[(i * 2) + 1] = m_rgb555_to_rgb888[color & 0x7fff]; + } } } } @@ -317,21 +335,22 @@ void spg2xx_video_device::draw_page(const rectangle &cliprect, uint32_t scanline uint32_t yy = ((tile_h * y0 - yscroll + 0x10) & 0xff) - 0x10; uint32_t xx = (tile_w * x0 - xscroll) & 0x1ff; uint16_t tile = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(tilemap) : space.read_word(tilemap + tile_address); - uint16_t palette = 0; if (!tile) continue; - palette = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(palette_map) : space.read_word(palette_map + tile_address / 2); - if (x0 & 1) - palette >>= 8; - else - palette &= 0x00ff; - uint32_t tileattr = attr; uint32_t tilectrl = ctrl; if ((ctrl & 2) == 0) { // -(1) bld(1) flip(2) pal(4) + + uint16_t palette = (ctrl & PAGE_WALLPAPER_MASK) ? space.read_word(palette_map) : space.read_word(palette_map + tile_address / 2); + if (x0 & 1) + palette >>= 8; + else + palette &= 0x00ff; + + tileattr &= ~0x000c; tileattr |= (palette >> 2) & 0x000c; // flip |