diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c index 7d9311e0556..9e97e878c6f 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -99,7 +99,7 @@ public: DECLARE_WRITE16_MEMBER(ttchamp_mem_w); UINT16 m_videoram0[0x10000 / 2]; - UINT16 m_videoram1[0x10000 / 2]; +// UINT16 m_videoram1[0x10000 / 2]; UINT16 m_videoram2[0x10000 / 2]; @@ -141,18 +141,23 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 static const int xxx=320,yyy=204; bitmap.fill(m_palette->black_pen()); - + UINT8 *videoramfg; + UINT8* videorambg; + count=0; - UINT8 *videoram = (UINT8*)m_videoram0; + videorambg = (UINT8*)m_videoram0; + videoramfg = (UINT8*)m_videoram2; + for (y=0;yset_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); } @@ -216,7 +241,7 @@ READ16_MEMBER(ttchamp_state::ttchamp_mem_r) if ((m_port10&0xf) == 0x00) vram = m_videoram0; else if ((m_port10&0xf) == 0x01) - vram = m_videoram1; + vram = m_videoram2; else if ((m_port10&0xf) == 0x03) vram = m_videoram2; else @@ -251,7 +276,7 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) if ((m_port10&0xf) == 0x00) vram = m_videoram0; else if ((m_port10&0xf) == 0x01) - vram = m_videoram1; + vram = m_videoram2; else if ((m_port10&0xf) == 0x03) vram = m_videoram2; else @@ -272,8 +297,6 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) { // printf("%06x: spider_blitter_w %08x %04x %04x (init2) (width?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); m_spriteswidth = offset & 0xff; - if (m_spriteswidth == 0) - m_spriteswidth = 80; m_spritesinit = 0; @@ -303,22 +326,30 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) for (int i = 0; i < m_spriteswidth; i++) { - UINT8 data; - - data = (src[(m_spritesaddr * 2) + 1]); - - if (data) - vram[offset] = (vram[offset] & 0x00ff) | data << 8; + if ((m_port10 & 0xf) == 0x01) // this is set when moving objects are cleared, although not screen clears? + { + vram[offset] = 0x0000; + offset++; + } + else + { + UINT8 data; + + data = (src[(m_spritesaddr * 2) + 1]); + + if (data) + vram[offset] = (vram[offset] & 0x00ff) | data << 8; - data = src[(m_spritesaddr*2)]; - - if (data) - vram[offset] = (vram[offset] & 0xff00) | data; + data = src[(m_spritesaddr * 2)]; + + if (data) + vram[offset] = (vram[offset] & 0xff00) | data; - m_spritesaddr ++; - offset++; + m_spritesaddr++; + offset++; + } offset &= 0x7fff; } @@ -356,6 +387,14 @@ WRITE16_MEMBER(ttchamp_state::port10_w) WRITE16_MEMBER(ttchamp_state::port20_w) { printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); + // seems to somehow be tied to layer clear + // might also depend on layer selected with 0x10 tho? written after it + for (int i = 0; i < 0x8000; i++) + { + // m_videoram0[i] = 0x0000; + m_videoram2[i] = 0x0000; + } + } WRITE16_MEMBER(ttchamp_state::port62_w)