diff options
Diffstat (limited to 'src/mame/drivers/bfcobra.cpp')
-rw-r--r-- | src/mame/drivers/bfcobra.cpp | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp index ccbefc4235f..c960664c5f8 100644 --- a/src/mame/drivers/bfcobra.cpp +++ b/src/mame/drivers/bfcobra.cpp @@ -415,20 +415,16 @@ void bfcobra_state::video_start() uint32_t bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int x, y; - uint8_t *src; - uint32_t *dest; - uint32_t offset; - uint8_t *hirescol; - uint8_t *lorescol; - /* Select screen has to be programmed into two registers */ /* No idea what happens if the registers are different */ + uint32_t offset; if (m_flip_8 & 0x40 && m_flip_22 & 0x40) offset = 0x10000; else offset = 0; + uint8_t const *hirescol; + uint8_t const *lorescol; if(m_videomode & 0x20) { hirescol = m_col3bit; @@ -445,16 +441,16 @@ uint32_t bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb3 lorescol = m_col8bit; } - for (y = cliprect.top(); y <= cliprect.bottom(); ++y) + for (int y = cliprect.top(); y <= cliprect.bottom(); ++y) { uint16_t y_offset = (y + m_v_scroll) * 256; - src = &m_video_ram[offset + y_offset]; - dest = &bitmap.pix32(y); + uint8_t const *const src = &m_video_ram[offset + y_offset]; + uint32_t *dest = &bitmap.pix(y); - for (x = cliprect.left(); x <= cliprect.right() / 2; ++x) + for (int x = cliprect.left(); x <= cliprect.right() / 2; ++x) { - uint8_t x_offset = x + m_h_scroll; - uint8_t pen = *(src + x_offset); + uint8_t const x_offset = x + m_h_scroll; + uint8_t const pen = *(src + x_offset); if ( ( m_videomode & 0x81 ) == 1 || (m_videomode & 0x80 && pen & 0x80) ) { @@ -2323,21 +2319,16 @@ void bfcobjam_state::chipset_w(offs_t offset, uint8_t data) uint32_t bfcobjam_state::screen_update_bfcobjam(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int x, y; - uint8_t *src; - uint32_t *dest; - uint32_t offset; - uint8_t *hirescol; - uint8_t *lorescol; - - /* Select screen has to be programmed into two registers */ /* No idea what happens if the registers are different */ + uint32_t offset; if (m_flip_8 & 0x40 && m_flip_22 & 0x40) offset = 0x10000; else offset = 0; + uint8_t const *hirescol; + uint8_t const *lorescol; if(m_videomode & 0x20) { hirescol = m_col3bit; @@ -2354,16 +2345,16 @@ uint32_t bfcobjam_state::screen_update_bfcobjam(screen_device &screen, bitmap_rg lorescol = m_col8bit; } - for (y = cliprect.top(); y <= cliprect.bottom(); ++y) + for (int y = cliprect.top(); y <= cliprect.bottom(); ++y) { - uint16_t y_offset = (y + m_v_scroll) * 256; - src = &m_video_ram[offset + y_offset]; - dest = &bitmap.pix32(y); + uint16_t const y_offset = (y + m_v_scroll) * 256; + uint8_t const *const src = &m_video_ram[offset + y_offset]; + uint32_t *dest = &bitmap.pix(y); - for (x = cliprect.left(); x <= cliprect.right() / 2; ++x) + for (int x = cliprect.left(); x <= cliprect.right() / 2; ++x) { - uint8_t x_offset = x + m_h_scroll; - uint8_t pen = *(src + x_offset); + uint8_t const x_offset = x + m_h_scroll; + uint8_t const pen = *(src + x_offset); if ( ( m_videomode & 0x81 ) == 1 || (m_videomode & 0x80 && pen & 0x80) ) { |