summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/sm7238.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/sm7238.cpp')
-rw-r--r--src/mame/drivers/sm7238.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp
index 636ad4e0c7b..037dbee0c1f 100644
--- a/src/mame/drivers/sm7238.cpp
+++ b/src/mame/drivers/sm7238.cpp
@@ -228,30 +228,30 @@ void sm7238_state::recompute_parameters()
uint32_t sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint8_t y, ra, gfx, fg, bg, attr, ctl1, ctl2 = 0;
- uint16_t chr, chraddr, sy = 0, ma = 0, x = 0;
- bool double_width = false, double_height = false, bottom_half = false;
- bool blink((m_screen->frame_number() % 30) > 14); // XXX guess
-
if (!BIT(m_video.control, 3))
{
bitmap.fill(0);
return 0;
}
- for (y = 0; y < 26; y++)
+ uint8_t ctl2 = 0;
+ uint16_t sy = 0, ma = 0;
+ bool double_width = false, double_height = false, bottom_half = false;
+ bool blink((m_screen->frame_number() % 30) > 14); // XXX guess
+
+ for (uint8_t y = 0; y < 26; y++)
{
- for (ra = 0; ra < 10; ra++)
+ for (uint8_t ra = 0; ra < 10; ra++)
{
if (y == 1 && ctl2 && ra < ctl2)
continue;
- uint16_t *p = &bitmap.pix16(sy++, 0);
+ uint16_t *p = &bitmap.pix(sy++, 0);
- for (x = ma; x < ma + m_video.stride; x++)
+ for (uint16_t x = ma; x < ma + m_video.stride; x++)
{
- chr = m_p_videoram[x] << 4;
- attr = m_p_videoram[x + 0x1000];
+ uint16_t chr = m_p_videoram[x] << 4;
+ uint8_t const attr = m_p_videoram[x + 0x1000];
// alternate font 1
if (BIT(attr, 6))
@@ -259,9 +259,10 @@ uint32_t sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
chr += 0x1000;
}
- bg = 0;
- fg = 1;
+ uint8_t bg = 0;
+ uint8_t fg = 1;
+ uint16_t chraddr;
if (double_height)
{
chraddr = chr | (bottom_half ? (5 + (ra >> 1)) : (ra >> 1));
@@ -272,6 +273,7 @@ uint32_t sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
}
// alternate font 2 (downloadable font) -- only in models .05 and .06
+ uint8_t gfx;
if (BIT(attr, 7) && m_p_charram[chr + 15])
{
gfx = m_p_charram[chraddr] ^ 255;
@@ -318,7 +320,7 @@ uint32_t sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
if (double_width) x++;
}
}
- ctl1 = m_p_videoram[ma + 0x1000 + m_video.stride];
+ uint8_t const ctl1 = m_p_videoram[ma + 0x1000 + m_video.stride];
double_width = BIT(ctl1, 6);
double_height = BIT(ctl1, 7);
bottom_half = BIT(ctl1, 5);