diff options
Diffstat (limited to 'src/mame/video/topspeed.cpp')
-rw-r--r-- | src/mame/video/topspeed.cpp | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/src/mame/video/topspeed.cpp b/src/mame/video/topspeed.cpp index e8a1382a7cb..912e357f4fb 100644 --- a/src/mame/video/topspeed.cpp +++ b/src/mame/video/topspeed.cpp @@ -130,37 +130,31 @@ Maybe the second area for each layer contains colscroll ? ********************************************************************************/ -void topspeed_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +void topspeed_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint16_t *spriteram = m_spriteram; - int offs, map_offset, x, y, curx, cury, sprite_chunk; - uint16_t *spritemap = m_spritemap; - uint16_t data, tilenum, code, color; - uint8_t flipx, flipy, priority, bad_chunks; - uint8_t j, k, px, py, zx, zy, zoomx, zoomy; - static const int primasks[2] = { 0xff00, 0xfffc }; /* Sprites are over bottom layer or under top layer */ + static const u32 primasks[2] = { 0xff00, 0xfffc }; /* Sprites are over bottom layer or under top layer */ /* Most of spriteram is not used by the 68000: rest is scratch space for the h/w perhaps ? */ - for (offs = 0; offs < m_spriteram.bytes() / 2; offs += 4) + for (int offs = 0; offs < m_spriteram.bytes() / 2; offs += 4) { - data = spriteram[offs + 2]; - - tilenum = spriteram[offs + 3] & 0xff; - color = (spriteram[offs + 3] & 0xff00) >> 8; - flipx = (data & 0x4000) >> 14; - flipy = (spriteram[offs + 1] & 0x8000) >> 15; - x = data & 0x1ff; - y = spriteram[offs] & 0x1ff; - zoomx = (spriteram[offs + 1]& 0x7f); - zoomy = (spriteram[offs] & 0xfe00) >> 9; - priority = (data & 0x8000) >> 15; + const u16 data = m_spriteram[offs + 2]; + + const int tilenum = m_spriteram[offs + 3] & 0xff; + const u32 color = (m_spriteram[offs + 3] & 0xff00) >> 8; + const int flipx = (data & 0x4000) >> 14; + const int flipy = (m_spriteram[offs + 1] & 0x8000) >> 15; + int x = data & 0x1ff; + int y = m_spriteram[offs] & 0x1ff; + int zoomx = (m_spriteram[offs + 1]& 0x7f); + int zoomy = (m_spriteram[offs] & 0xfe00) >> 9; + const int priority = (data & 0x8000) >> 15; // unknown = (data & 0x2000) >> 13; /* End of sprite list */ if (y == 0x180) break; - map_offset = tilenum << 7; + const int map_offset = tilenum << 7; zoomx += 1; zoomy += 1; @@ -171,18 +165,18 @@ void topspeed_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, if (x > 0x140) x -= 0x200; if (y > 0x140) y -= 0x200; - bad_chunks = 0; + int bad_chunks = 0; - for (sprite_chunk = 0; sprite_chunk < 128; sprite_chunk++) + for (int sprite_chunk = 0; sprite_chunk < 128; sprite_chunk++) { - k = sprite_chunk % 8; /* 8 sprite chunks per row */ - j = sprite_chunk / 8; /* 16 rows */ + const int k = sprite_chunk % 8; /* 8 sprite chunks per row */ + const int j = sprite_chunk / 8; /* 16 rows */ /* pick tiles back to front for x and y flips */ - px = (flipx) ? (7 - k) : (k); - py = (flipy) ? (15 - j) : (j); + const int px = (flipx) ? (7 - k) : (k); + const int py = (flipy) ? (15 - j) : (j); - code = spritemap[map_offset + (py << 3) + px]; + const u16 code = m_spritemap[map_offset + (py << 3) + px]; if (code & 0x8000) { @@ -190,18 +184,18 @@ void topspeed_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, continue; } - curx = x + ((k * zoomx) / 8); - cury = y + ((j * zoomy) / 16); + const int curx = x + ((k * zoomx) / 8); + const int cury = y + ((j * zoomy) / 16); - zx = x + (((k + 1) * zoomx) / 8) - curx; - zy = y + (((j + 1) * zoomy) / 16) - cury; + const int zx = x + (((k + 1) * zoomx) / 8) - curx; + const int zy = y + (((j + 1) * zoomy) / 16) - cury; m_gfxdecode->gfx(0)->prio_zoom_transpen(bitmap,cliprect, code, color, flipx,flipy, curx,cury, - zx<<12,zy<<13, + zx << 12,zy << 13, screen.priority(),primasks[priority],0); } @@ -213,9 +207,9 @@ void topspeed_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, /***************************************************************************/ -uint32_t topspeed_state::screen_update_topspeed(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 topspeed_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t layer[4]; + u8 layer[4]; #ifdef MAME_DEBUG if (machine().input().code_pressed_once (KEYCODE_V)) |