diff options
Diffstat (limited to 'src/mame/video/harddriv.cpp')
-rw-r--r-- | src/mame/video/harddriv.cpp | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/src/mame/video/harddriv.cpp b/src/mame/video/harddriv.cpp index b8277e1d88d..a1281fb14ec 100644 --- a/src/mame/video/harddriv.cpp +++ b/src/mame/video/harddriv.cpp @@ -86,7 +86,7 @@ void harddriv_state::init_video() } /* init VRAM pointers */ - m_vram_mask = m_gsp_vram.bytes() - 1; + m_vram_mask = m_gsp_vram.bytes()/2 - 1; } @@ -103,9 +103,9 @@ TMS340X0_TO_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_write_to_shiftreg) if (address >= 0x02000000 && address <= 0x020fffff) { address -= 0x02000000; - address >>= m_gsp_multisync; + address >>= m_gsp_multisync + 1; address &= m_vram_mask; - address &= ~((512*8 >> m_gsp_multisync) - 1); + address &= ~((256*8 >> m_gsp_multisync) - 1); m_gsp_shiftreg_source = &m_gsp_vram[address]; } @@ -113,9 +113,9 @@ TMS340X0_TO_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_write_to_shiftreg) else if (address >= 0xff800000 && address <= 0xffffffff) { address -= 0xff800000; - address /= 8; + address /= 16; address &= m_vram_mask; - address &= ~511; + address &= ~255; m_gsp_shiftreg_source = &m_gsp_vram[address]; } else @@ -132,9 +132,9 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_read_from_shiftreg) if (address >= 0x02000000 && address <= 0x020fffff) { address -= 0x02000000; - address >>= m_gsp_multisync; + address >>= m_gsp_multisync + 1; address &= m_vram_mask; - address &= ~((512*8 >> m_gsp_multisync) - 1); + address &= ~((256*8 >> m_gsp_multisync) - 1); memmove(&m_gsp_vram[address], m_gsp_shiftreg_source, 512*8 >> m_gsp_multisync); } @@ -142,9 +142,9 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(harddriv_state::hdgsp_read_from_shiftreg) else if (address >= 0xff800000 && address <= 0xffffffff) { address -= 0xff800000; - address /= 8; + address /= 16; address &= m_vram_mask; - address &= ~511; + address &= ~255; memmove(&m_gsp_vram[address], m_gsp_shiftreg_source, 512); } else @@ -270,7 +270,7 @@ uint16_t harddriv_state::hdgsp_vram_2bpp_r() void harddriv_state::hdgsp_vram_1bpp_w (offs_t offset, uint16_t data) { - uint32_t *dest = (uint32_t *)&m_gsp_vram[offset * 16]; + uint32_t *dest = (uint32_t *)&m_gsp_vram[offset * 8]; uint32_t *mask = &m_mask_table[data * 4]; uint32_t color = m_gsp_control_lo[0] & 0xff; uint32_t curmask; @@ -298,7 +298,7 @@ void harddriv_state::hdgsp_vram_1bpp_w (offs_t offset, uint16_t data) void harddriv_state::hdgsp_vram_2bpp_w(offs_t offset, uint16_t data) { - uint32_t *dest = (uint32_t *)&m_gsp_vram[offset * 8]; + uint32_t *dest = (uint32_t *)&m_gsp_vram[offset * 4]; uint32_t *mask = &m_mask_table[data * 2]; uint32_t color = m_gsp_control_lo[0]; uint32_t curmask; @@ -410,13 +410,22 @@ static void display_speedups(void) TMS340X0_SCANLINE_IND16_CB_MEMBER(harddriv_state::scanline_driver) { if (!m_gsp_vram) return; - uint8_t const *const vram_base = &m_gsp_vram[(params->rowaddr << 12) & m_vram_mask]; + uint16_t const *const vram_base = &m_gsp_vram[(params->rowaddr << 11) & m_vram_mask]; uint16_t *const dest = &bitmap.pix(scanline); int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 4) - 15 + (m_gfx_finescroll & 0x0f); for (int x = params->heblnk; x < params->hsblnk; x++) - dest[x] = m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0xfff)]; + { + int coloridx = coladdr++ & 0xfff; + uint8_t color; + if(coloridx & 1) + color = vram_base[coloridx >> 1] >> 8; + else + color = vram_base[coloridx >> 1]; + + dest[x] = m_gfx_palettebank * 256 + color; + } if (scanline == screen.visible_area().bottom()) display_speedups(); @@ -426,13 +435,21 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(harddriv_state::scanline_driver) TMS340X0_SCANLINE_IND16_CB_MEMBER(harddriv_state::scanline_multisync) { if (!m_gsp_vram) return; - uint8_t const *const vram_base = &m_gsp_vram[(params->rowaddr << 11) & m_vram_mask]; + uint16_t const *const vram_base = &m_gsp_vram[(params->rowaddr << 10) & m_vram_mask]; uint16_t *const dest = &bitmap.pix(scanline); int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 3) - 7 + (m_gfx_finescroll & 0x07); for (int x = params->heblnk; x < params->hsblnk; x++) - dest[x] = m_gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0x7ff)]; + { + int coloridx = coladdr++ & 0x7ff; + uint8_t color; + if(coloridx & 1) + color = vram_base[coloridx >> 1] >> 8; + else + color = vram_base[coloridx >> 1]; + dest[x] = m_gfx_palettebank * 256 + color; + } if (scanline == screen.visible_area().bottom()) display_speedups(); |