diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2012-09-17 15:00:31 +0000 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2012-09-17 15:00:31 +0000 |
commit | 5ddbca3e7a2327786fd92cc7443dd84257ba889a (patch) | |
tree | f6eb4b827714a8658ea246336342b03d6d7938e0 /src/mame/video/system1.c | |
parent | f27b07d0822f4ff52b95a1a0143f3c2313ea02ce (diff) |
Modernized screen update calls (no whatsnew)
Diffstat (limited to 'src/mame/video/system1.c')
-rw-r--r-- | src/mame/video/system1.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c index 0e1427c41ed..4565f3f591f 100644 --- a/src/mame/video/system1.c +++ b/src/mame/video/system1.c @@ -558,27 +558,26 @@ static void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, con * *************************************/ -SCREEN_UPDATE_IND16( system1 ) +UINT32 system1_state::screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - system1_state *state = screen.machine().driver_data<system1_state>(); - UINT8 *videoram = state->m_videoram; + UINT8 *videoram = m_videoram; bitmap_ind16 *bgpixmaps[4]; int bgrowscroll[32]; int xscroll, yscroll; int y; /* all 4 background pages are the same, fixed to page 0 */ - bgpixmaps[0] = bgpixmaps[1] = bgpixmaps[2] = bgpixmaps[3] = &state->m_tilemap_page[0]->pixmap(); + bgpixmaps[0] = bgpixmaps[1] = bgpixmaps[2] = bgpixmaps[3] = &m_tilemap_page[0]->pixmap(); /* foreground is fixed to page 1 */ - bitmap_ind16 &fgpixmap = state->m_tilemap_page[1]->pixmap(); + bitmap_ind16 &fgpixmap = m_tilemap_page[1]->pixmap(); /* get fixed scroll offsets */ xscroll = (INT16)((videoram[0xffc] | (videoram[0xffd] << 8)) + 28); yscroll = videoram[0xfbd]; /* adjust for flipping */ - if (state->flip_screen()) + if (flip_screen()) { xscroll = 640 - (xscroll & 0x1ff); yscroll = 764 - (yscroll & 0x1ff); @@ -594,10 +593,9 @@ SCREEN_UPDATE_IND16( system1 ) } -SCREEN_UPDATE_IND16( system2 ) +UINT32 system1_state::screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - system1_state *state = screen.machine().driver_data<system1_state>(); - UINT8 *videoram = state->m_videoram; + UINT8 *videoram = m_videoram; bitmap_ind16 *bgpixmaps[4]; int rowscroll[32]; int xscroll, yscroll; @@ -605,16 +603,16 @@ SCREEN_UPDATE_IND16( system2 ) int y; /* 4 independent background pages */ - bgpixmaps[0] = &state->m_tilemap_page[videoram[0x740] & 7]->pixmap(); - bgpixmaps[1] = &state->m_tilemap_page[videoram[0x742] & 7]->pixmap(); - bgpixmaps[2] = &state->m_tilemap_page[videoram[0x744] & 7]->pixmap(); - bgpixmaps[3] = &state->m_tilemap_page[videoram[0x746] & 7]->pixmap(); + bgpixmaps[0] = &m_tilemap_page[videoram[0x740] & 7]->pixmap(); + bgpixmaps[1] = &m_tilemap_page[videoram[0x742] & 7]->pixmap(); + bgpixmaps[2] = &m_tilemap_page[videoram[0x744] & 7]->pixmap(); + bgpixmaps[3] = &m_tilemap_page[videoram[0x746] & 7]->pixmap(); /* foreground is fixed to page 0 */ - bitmap_ind16 &fgpixmap = state->m_tilemap_page[0]->pixmap(); + bitmap_ind16 &fgpixmap = m_tilemap_page[0]->pixmap(); /* get scroll offsets */ - if (!state->flip_screen()) + if (!flip_screen()) { xscroll = ((videoram[0x7c0] | (videoram[0x7c1] << 8)) & 0x1ff) - 512 + 10; yscroll = videoram[0x7ba]; @@ -637,10 +635,9 @@ SCREEN_UPDATE_IND16( system2 ) } -SCREEN_UPDATE_IND16( system2_rowscroll ) +UINT32 system1_state::screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - system1_state *state = screen.machine().driver_data<system1_state>(); - UINT8 *videoram = state->m_videoram; + UINT8 *videoram = m_videoram; bitmap_ind16 *bgpixmaps[4]; int rowscroll[32]; int yscroll; @@ -648,16 +645,16 @@ SCREEN_UPDATE_IND16( system2_rowscroll ) int y; /* 4 independent background pages */ - bgpixmaps[0] = &state->m_tilemap_page[videoram[0x740] & 7]->pixmap(); - bgpixmaps[1] = &state->m_tilemap_page[videoram[0x742] & 7]->pixmap(); - bgpixmaps[2] = &state->m_tilemap_page[videoram[0x744] & 7]->pixmap(); - bgpixmaps[3] = &state->m_tilemap_page[videoram[0x746] & 7]->pixmap(); + bgpixmaps[0] = &m_tilemap_page[videoram[0x740] & 7]->pixmap(); + bgpixmaps[1] = &m_tilemap_page[videoram[0x742] & 7]->pixmap(); + bgpixmaps[2] = &m_tilemap_page[videoram[0x744] & 7]->pixmap(); + bgpixmaps[3] = &m_tilemap_page[videoram[0x746] & 7]->pixmap(); /* foreground is fixed to page 0 */ - bitmap_ind16 &fgpixmap = state->m_tilemap_page[0]->pixmap(); + bitmap_ind16 &fgpixmap = m_tilemap_page[0]->pixmap(); /* get scroll offsets */ - if (!state->flip_screen()) + if (!flip_screen()) { for (y = 0; y < 32; y++) rowscroll[y] = ((videoram[0x7c0 + y * 2] | (videoram[0x7c1 + y * 2] << 8)) & 0x1ff) - 512 + 10; |