diff options
Diffstat (limited to 'src/mame/video/astrocde.cpp')
-rw-r--r-- | src/mame/video/astrocde.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp index 43bb3cb1a97..d89d431a2e6 100644 --- a/src/mame/video/astrocde.cpp +++ b/src/mame/video/astrocde.cpp @@ -256,11 +256,10 @@ void astrocde_state::init_savestate() uint32_t astrocde_state::screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *videoram = m_videoram; + uint8_t const *const videoram = m_videoram; uint32_t sparklebase = 0; const int colormask = (m_video_config & AC_MONITOR_BW) ? 0 : 0x1f0; int xystep = 2 - m_video_mode; - int y; /* compute the starting point of sparkle for the current frame */ int width = screen.width(); @@ -270,13 +269,12 @@ uint32_t astrocde_state::screen_update_astrocde(screen_device &screen, bitmap_in sparklebase = (screen.frame_number() * (uint64_t)(width * height)) % RNG_PERIOD; /* iterate over scanlines */ - for (y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *dest = &bitmap.pix16(y); + uint16_t *dest = &bitmap.pix(y); int effy = mame_vpos_to_astrocade_vpos(y); uint16_t offset = (effy / xystep) * (80 / xystep); uint32_t sparkleoffs = 0, staroffs = 0; - int x; /* compute the star and sparkle offset at the start of this line */ if (m_video_config & AC_STARS) @@ -288,23 +286,20 @@ uint32_t astrocde_state::screen_update_astrocde(screen_device &screen, bitmap_in } /* iterate over groups of 4 pixels */ - for (x = 0; x < 456/4; x += xystep) + for (int x = 0; x < 456/4; x += xystep) { int effx = x - HORZ_OFFSET/4; const uint8_t *colorbase = &m_colors[(effx < m_colorsplit) ? 4 : 0]; - uint8_t data; - int xx; /* select either video data or background data */ - data = (effx >= 0 && effx < 80 && effy >= 0 && effy < m_vblank) ? videoram[offset++] : m_bgdata; + uint8_t data = (effx >= 0 && effx < 80 && effy >= 0 && effy < m_vblank) ? videoram[offset++] : m_bgdata; /* iterate over the 4 pixels */ - for (xx = 0; xx < 4; xx++) + for (int xx = 0; xx < 4; xx++) { uint8_t pixdata = (data >> 6) & 3; int colordata = colorbase[pixdata] << 1; int luma = colordata & 0x0f; - rgb_t color; /* handle stars/sparkle */ if (m_video_config & AC_STARS) @@ -324,7 +319,7 @@ uint32_t astrocde_state::screen_update_astrocde(screen_device &screen, bitmap_in if (++sparkleoffs >= RNG_PERIOD) sparkleoffs = 0; } - color = (colordata & colormask) | luma; + rgb_t const color = (colordata & colormask) | luma; /* store the final color to the destination and shift */ *dest++ = color; @@ -341,20 +336,17 @@ uint32_t astrocde_state::screen_update_astrocde(screen_device &screen, bitmap_in uint32_t astrocde_state::screen_update_profpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int y; - /* iterate over scanlines */ - for (y = cliprect.min_y; y <= cliprect.max_y; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { int effy = mame_vpos_to_astrocade_vpos(y); - uint16_t *dest = &bitmap.pix16(y); + uint16_t *dest = &bitmap.pix(y); uint16_t offset = m_profpac_vispage * 0x4000 + effy * 80; - int x; /* star with black */ /* iterate over groups of 4 pixels */ - for (x = 0; x < 456/4; x++) + for (int x = 0; x < 456/4; x++) { int effx = x - HORZ_OFFSET/4; |