diff options
Diffstat (limited to 'src/mame/video/galaxia.cpp')
-rw-r--r-- | src/mame/video/galaxia.cpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/src/mame/video/galaxia.cpp b/src/mame/video/galaxia.cpp index 5a6377f8062..2b4d8506769 100644 --- a/src/mame/video/galaxia.cpp +++ b/src/mame/video/galaxia.cpp @@ -110,8 +110,6 @@ VIDEO_START_MEMBER(galaxia_state,astrowar) uint32_t galaxia_state::screen_update_galaxia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int x, y; - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); bitmap_ind16 const &s2636_2_bitmap = m_s2636[2]->update(cliprect); @@ -120,12 +118,12 @@ uint32_t galaxia_state::screen_update_galaxia(screen_device &screen, bitmap_ind1 cvs_update_stars(bitmap, cliprect, STAR_PEN, 1); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - for (y = cliprect.top(); y <= cliprect.bottom(); y++) + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { - for (x = cliprect.left(); x <= cliprect.right(); x++) + for (int x = cliprect.left(); x <= cliprect.right(); x++) { - bool bullet = m_bullet_ram[y] && x == (m_bullet_ram[y] ^ 0xff); - bool background = (bitmap.pix16(y, x) & 3) != 0; + bool const bullet = m_bullet_ram[y] && x == (m_bullet_ram[y] ^ 0xff); + bool const background = (bitmap.pix(y, x) & 3) != 0; // draw bullets (guesswork) if (bullet) @@ -134,16 +132,16 @@ uint32_t galaxia_state::screen_update_galaxia(screen_device &screen, bitmap_ind1 if (background) m_collision_register |= 0x80; // bullet size/color/priority is guessed - bitmap.pix16(y, x) = BULLET_PEN; - if (x) bitmap.pix16(y, x-1) = BULLET_PEN; + bitmap.pix(y, x) = BULLET_PEN; + if (x) bitmap.pix(y, x-1) = BULLET_PEN; } // copy the S2636 images into the main bitmap and check collision - int pixel0 = s2636_0_bitmap.pix16(y, x); - int pixel1 = s2636_1_bitmap.pix16(y, x); - int pixel2 = s2636_2_bitmap.pix16(y, x); + int const pixel0 = s2636_0_bitmap.pix(y, x); + int const pixel1 = s2636_1_bitmap.pix(y, x); + int const pixel2 = s2636_2_bitmap.pix(y, x); - int pixel = pixel0 | pixel1 | pixel2; + int const pixel = pixel0 | pixel1 | pixel2; if (S2636_IS_PIXEL_DRAWN(pixel)) { @@ -164,7 +162,7 @@ uint32_t galaxia_state::screen_update_galaxia(screen_device &screen, bitmap_ind1 if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x40; } - bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; + bitmap.pix(y, x) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; } } } @@ -176,8 +174,6 @@ uint32_t galaxia_state::screen_update_galaxia(screen_device &screen, bitmap_ind1 uint32_t galaxia_state::screen_update_astrowar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // astrowar has only one S2636 - int x, y; - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); bitmap.fill(0, cliprect); @@ -185,43 +181,43 @@ uint32_t galaxia_state::screen_update_astrowar(screen_device &screen, bitmap_ind m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); copybitmap(m_temp_bitmap, bitmap, 0, 0, 0, 0, cliprect); - for (y = cliprect.top(); y <= cliprect.bottom(); y++) + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { // draw bullets (guesswork) if (m_bullet_ram[y]) { - uint8_t pos = m_bullet_ram[y] ^ 0xff; + uint8_t const pos = m_bullet_ram[y] ^ 0xff; // background vs. bullet collision detection - if (m_temp_bitmap.pix16(y, pos) & 1) + if (m_temp_bitmap.pix(y, pos) & 1) m_collision_register |= 0x02; // bullet size/color/priority is guessed - bitmap.pix16(y, pos) = BULLET_PEN; - if (pos) bitmap.pix16(y, pos-1) = BULLET_PEN; + bitmap.pix(y, pos) = BULLET_PEN; + if (pos) bitmap.pix(y, pos-1) = BULLET_PEN; } - for (x = cliprect.left(); x <= cliprect.right(); x++) + for (int x = cliprect.left(); x <= cliprect.right(); x++) { // NOTE: similar to zac2650.c, the sprite chip runs at a different frequency than the background generator // the exact timing ratio is unknown, so we'll have to do with guesswork - float s_ratio = 256.0f / 196.0f; + float const s_ratio = 256.0f / 196.0f; - float sx = x * s_ratio; + float const sx = x * s_ratio; if (int(sx + 0.5f) > cliprect.right()) break; // copy the S2636 bitmap into the main bitmap and check collision - int pixel = s2636_0_bitmap.pix16(y, x); + int const pixel = s2636_0_bitmap.pix(y, x); if (S2636_IS_PIXEL_DRAWN(pixel)) { // S2636 vs. background collision detection - if ((m_temp_bitmap.pix16(y, int(sx)) | m_temp_bitmap.pix16(y, int(sx + 0.5f))) & 1) + if ((m_temp_bitmap.pix(y, int(sx)) | m_temp_bitmap.pix(y, int(sx + 0.5f))) & 1) m_collision_register |= 0x01; - bitmap.pix16(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; - bitmap.pix16(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; + bitmap.pix(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; + bitmap.pix(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; } } } |