diff options
Diffstat (limited to 'src/mame/video/dogfgt.cpp')
-rw-r--r-- | src/mame/video/dogfgt.cpp | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/src/mame/video/dogfgt.cpp b/src/mame/video/dogfgt.cpp index 8ebd43e5b9c..b248a46454e 100644 --- a/src/mame/video/dogfgt.cpp +++ b/src/mame/video/dogfgt.cpp @@ -16,10 +16,9 @@ PALETTE_INIT_MEMBER(dogfgt_state, dogfgt) { const uint8_t *color_prom = memregion("proms")->base(); - int i; /* first 16 colors are RAM */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) { int bit0, bit1, bit2, r, g, b; @@ -84,12 +83,12 @@ void dogfgt_state::video_start() ***************************************************************************/ -WRITE8_MEMBER(dogfgt_state::dogfgt_plane_select_w) +WRITE8_MEMBER(dogfgt_state::plane_select_w) { m_bm_plane = data; } -READ8_MEMBER(dogfgt_state::dogfgt_bitmapram_r) +READ8_MEMBER(dogfgt_state::bitmapram_r) { if (m_bm_plane > 2) { @@ -102,19 +101,17 @@ READ8_MEMBER(dogfgt_state::dogfgt_bitmapram_r) WRITE8_MEMBER(dogfgt_state::internal_bitmapram_w) { - int x, y, subx; - m_bitmapram[offset] = data; offset &= (BITMAPRAM_SIZE / 3 - 1); - x = 8 * (offset / 256); - y = offset % 256; + int x = 8 * (offset / 256); + int y = offset % 256; - for (subx = 0; subx < 8; subx++) + for (int subx = 0; subx < 8; subx++) { - int i, color = 0; + int color = 0; - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) color |= ((m_bitmapram[offset + BITMAPRAM_SIZE / 3 * i] >> subx) & 1) << i; if (flip_screen()) @@ -124,7 +121,7 @@ WRITE8_MEMBER(dogfgt_state::internal_bitmapram_w) } } -WRITE8_MEMBER(dogfgt_state::dogfgt_bitmapram_w) +WRITE8_MEMBER(dogfgt_state::bitmapram_w) { if (m_bm_plane > 2) { @@ -135,20 +132,20 @@ WRITE8_MEMBER(dogfgt_state::dogfgt_bitmapram_w) internal_bitmapram_w(space, offset + BITMAPRAM_SIZE / 3 * m_bm_plane, data); } -WRITE8_MEMBER(dogfgt_state::dogfgt_bgvideoram_w) +WRITE8_MEMBER(dogfgt_state::bgvideoram_w) { m_bgvideoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); } -WRITE8_MEMBER(dogfgt_state::dogfgt_scroll_w) +WRITE8_MEMBER(dogfgt_state::scroll_w) { m_scroll[offset] = data; m_bg_tilemap->set_scrollx(0, m_scroll[0] + 256 * m_scroll[1] + 256); m_bg_tilemap->set_scrolly(0, m_scroll[2] + 256 * m_scroll[3]); } -WRITE8_MEMBER(dogfgt_state::dogfgt_1800_w) +WRITE8_MEMBER(dogfgt_state::_1800_w) { /* bits 0 and 1 are probably text color (not verified because PROM is missing) */ m_pixcolor = ((data & 0x01) << 1) | ((data & 0x02) >> 1); @@ -173,18 +170,14 @@ WRITE8_MEMBER(dogfgt_state::dogfgt_1800_w) void dogfgt_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ) { - int offs; - - for (offs = 0; offs < m_spriteram.bytes(); offs += 4) + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) { if (m_spriteram[offs] & 0x01) { - int sx, sy, flipx, flipy; - - sx = m_spriteram[offs + 3]; - sy = (240 - m_spriteram[offs + 2]) & 0xff; - flipx = m_spriteram[offs] & 0x04; - flipy = m_spriteram[offs] & 0x02; + int sx = m_spriteram[offs + 3]; + int sy = (240 - m_spriteram[offs + 2]) & 0xff; + int flipx = m_spriteram[offs] & 0x04; + int flipy = m_spriteram[offs] & 0x02; if (flip_screen()) { sx = 240 - sx; @@ -203,10 +196,8 @@ void dogfgt_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect } -uint32_t dogfgt_state::screen_update_dogfgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dogfgt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int offs; - if (m_lastflip != flip_screen() || m_lastpixcolor != m_pixcolor) { address_space &space = m_maincpu->space(AS_PROGRAM); @@ -214,7 +205,7 @@ uint32_t dogfgt_state::screen_update_dogfgt(screen_device &screen, bitmap_ind16 m_lastflip = flip_screen(); m_lastpixcolor = m_pixcolor; - for (offs = 0; offs < BITMAPRAM_SIZE; offs++) + for (int offs = 0; offs < BITMAPRAM_SIZE; offs++) internal_bitmapram_w(space, offs, m_bitmapram[offs]); } |