diff options
Diffstat (limited to 'src/mame/video/tigeroad.cpp')
-rw-r--r-- | src/mame/video/tigeroad.cpp | 66 |
1 files changed, 30 insertions, 36 deletions
diff --git a/src/mame/video/tigeroad.cpp b/src/mame/video/tigeroad.cpp index ec39168588c..647355588dc 100644 --- a/src/mame/video/tigeroad.cpp +++ b/src/mame/video/tigeroad.cpp @@ -4,53 +4,46 @@ #include "includes/tigeroad.h" -void tigeroad_state::tigeroad_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tigeroad_state::videoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_videoram[offset]); m_fg_tilemap->mark_tile_dirty(offset); } -void tigeroad_state::tigeroad_videoctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tigeroad_state::videoctrl_w(u8 data) { - int bank; + // bit 1 flips screen - if (ACCESSING_BITS_8_15) + if (flip_screen() != (data & 0x02)) { - data = (data >> 8) & 0xff; - - /* bit 1 flips screen */ - - if (flip_screen() != (data & 0x02)) - { - flip_screen_set(data & 0x02); - machine().tilemap().mark_all_dirty(); - } + flip_screen_set(data & 0x02); + machine().tilemap().mark_all_dirty(); + } - /* bit 2 selects bg char bank */ + // bit 2 selects bg char bank - bank = (data & 0x04) >> 2; + u8 bank = (data & 0x04) >> 2; - if (m_bgcharbank != bank) - { - m_bgcharbank = bank; - m_bg_tilemap->mark_all_dirty(); - } + if (m_bgcharbank != bank) + { + m_bgcharbank = bank; + m_bg_tilemap->mark_all_dirty(); + } - /* bits 4-5 are coin lockouts */ - if (m_has_coinlock) - { - machine().bookkeeping().coin_lockout_w(0, !(data & 0x10)); - machine().bookkeeping().coin_lockout_w(1, !(data & 0x20)); - } + // bits 4-5 are coin lockouts + if (m_has_coinlock) + { + machine().bookkeeping().coin_lockout_w(0, !(data & 0x10)); + machine().bookkeeping().coin_lockout_w(1, !(data & 0x20)); + } - /* bits 6-7 are coin counters */ + // bits 6-7 are coin counters - machine().bookkeeping().coin_counter_w(0, data & 0x40); - machine().bookkeeping().coin_counter_w(1, data & 0x80); - } + machine().bookkeeping().coin_counter_w(0, data & 0x40); + machine().bookkeeping().coin_counter_w(1, data & 0x80); } -void tigeroad_state::tigeroad_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tigeroad_state::scroll_w(offs_t offset, u16 data, u16 mem_mask) { int scroll = 0; @@ -71,7 +64,7 @@ void tigeroad_state::tigeroad_scroll_w(offs_t offset, uint16_t data, uint16_t me TILE_GET_INFO_MEMBER(tigeroad_state::get_bg_tile_info) { - uint8_t *tilerom = memregion("bgmap")->base(); + u8 *tilerom = memregion("bgmap")->base(); int data = tilerom[tile_index]; int attr = tilerom[tile_index + 1]; @@ -85,8 +78,7 @@ TILE_GET_INFO_MEMBER(tigeroad_state::get_bg_tile_info) TILE_GET_INFO_MEMBER(tigeroad_state::get_fg_tile_info) { - uint16_t *videoram = m_videoram; - int data = videoram[tile_index]; + int data = m_videoram[tile_index]; int attr = data >> 8; int code = (data & 0xff) + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5); int color = attr & 0x0f; @@ -97,7 +89,7 @@ TILE_GET_INFO_MEMBER(tigeroad_state::get_fg_tile_info) TILEMAP_MAPPER_MEMBER(tigeroad_state::tigeroad_tilemap_scan) { - /* logical (col,row) -> memory offset */ + // logical (col,row) -> memory offset return 2 * (col % 8) + 16 * ((127 - row) % 8) + 128 * (col / 8) + 2048 * ((127 - row) / 8); } @@ -115,9 +107,11 @@ void tigeroad_state::video_start() m_bg_tilemap->set_transmask(1, 0x1ff, 0xfe00); m_fg_tilemap->set_transparent_pen(3); + + save_item(NAME(m_bgcharbank)); } -uint32_t tigeroad_state::screen_update_tigeroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 tigeroad_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), m_spriteram->bytes(), flip_screen(), true); |