diff options
Diffstat (limited to 'src/devices/machine/spg2xx_video.cpp')
-rw-r--r-- | src/devices/machine/spg2xx_video.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp index 3625e8e5bfe..72dde8f2c1c 100644 --- a/src/devices/machine/spg2xx_video.cpp +++ b/src/devices/machine/spg2xx_video.cpp @@ -213,19 +213,30 @@ void spg2xx_video_device::draw_bitmap(const rectangle& cliprect, uint32_t scanli if ((scanline < 0) || (scanline >= 240)) return; - address_space& space = m_cpu->space(AS_PROGRAM); - const int linewidth = 320 / 2; - int sourcebase = 0x3f0000; // this is correct for Texas Hold'em - TODO: get from a register? + address_space &space = m_cpu->space(AS_PROGRAM); + + uint32_t tilemap = regs[4]; + uint32_t palette_map = regs[5]; - sourcebase++; // why is this needed? - int bitmapline = scanline - 20; // should be from scrolly? + //printf("draw bitmap bases %04x %04x\n", tilemap, palette_map); - // at least for Texas Hold'em there is only enough memory for this size bitmap, and other reads would be outside of memory and generate excessive logging - // maybe we just need to silence logging instead tho? - if ((bitmapline < 0) || (bitmapline >= 200)) - return; + uint32_t yscroll = regs[1]; + + int realline = (scanline + yscroll) & 0xff; + + + uint16_t tile = space.read_word(tilemap + realline); + uint16_t palette = 0; + + //if (!tile) + // continue; + + palette = space.read_word(palette_map + realline / 2); + if (scanline & 1) + palette >>= 8; - sourcebase += bitmapline * linewidth; + //const int linewidth = 320 / 2; + int sourcebase = tile | (palette << 16); // this is correct for Texas Hold'em - TODO: get from a register? uint32_t* dest = &m_screenbuf[320 * scanline]; |