summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/exidy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/exidy.cpp')
-rw-r--r--src/mame/video/exidy.cpp50
1 files changed, 23 insertions, 27 deletions
diff --git a/src/mame/video/exidy.cpp b/src/mame/video/exidy.cpp
index 8c7146a847d..2df9ef5470d 100644
--- a/src/mame/video/exidy.cpp
+++ b/src/mame/video/exidy.cpp
@@ -134,12 +134,10 @@ void exidy_state::draw_background()
for (offs = 0; offs < 0x400; offs++)
{
- uint8_t cy;
- pen_t on_pen_1, on_pen_2;
-
uint8_t y = offs >> 5 << 3;
- uint8_t code = m_videoram[offs];
+ uint8_t const code = m_videoram[offs];
+ pen_t on_pen_1, on_pen_2;
if (m_is_2bpp)
{
on_pen_1 = 4 + ((code >> 6) & 0x02);
@@ -151,9 +149,8 @@ void exidy_state::draw_background()
on_pen_2 = off_pen; /* unused */
}
- for (cy = 0; cy < 8; cy++)
+ for (uint8_t cy = 0; cy < 8; cy++)
{
- int i;
uint8_t x = offs << 3;
if (m_is_2bpp)
@@ -161,16 +158,16 @@ void exidy_state::draw_background()
uint8_t data1 = m_characterram[0x000 | (code << 3) | cy];
uint8_t data2 = m_characterram[0x800 | (code << 3) | cy];
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
if (data1 & 0x80)
- m_background_bitmap.pix16(y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1;
+ m_background_bitmap.pix(y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1;
else
- m_background_bitmap.pix16(y, x) = off_pen;
+ m_background_bitmap.pix(y, x) = off_pen;
- x = x + 1;
- data1 = data1 << 1;
- data2 = data2 << 1;
+ x++;
+ data1 <<= 1;
+ data2 <<= 1;
}
}
/* 1bpp */
@@ -178,16 +175,16 @@ void exidy_state::draw_background()
{
uint8_t data = m_characterram[(code << 3) | cy];
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
- m_background_bitmap.pix16(y, x) = (data & 0x80) ? on_pen_1 : off_pen;
+ m_background_bitmap.pix(y, x) = (data & 0x80) ? on_pen_1 : off_pen;
- x = x + 1;
- data = data << 1;
+ x++;
+ data <<= 1;
}
}
- y = y + 1;
+ y++;
}
}
}
@@ -282,7 +279,6 @@ void exidy_state::check_collision()
const rectangle clip(0, 15, 0, 15);
int org_1_x = 0, org_1_y = 0;
int org_2_x = 0, org_2_y = 0;
- int sx, sy;
int count = 0;
/* if there is nothing to detect, bail */
@@ -312,27 +308,27 @@ void exidy_state::check_collision()
m_motion_object_2_clip.fill(0xff, clip);
if (sprite_1_enabled())
{
- sx = org_2_x - org_1_x;
- sy = org_2_y - org_1_y;
+ int sx = org_2_x - org_1_x;
+ int sy = org_2_y - org_1_y;
m_gfxdecode->gfx(0)->transpen(m_motion_object_2_clip,clip,
((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
0, 0, sx, sy, 0);
}
/* scan for collisions */
- for (sy = 0; sy < 16; sy++)
- for (sx = 0; sx < 16; sx++)
+ for (int sy = 0; sy < 16; sy++)
+ for (int sx = 0; sx < 16; sx++)
{
- if (m_motion_object_1_vid.pix16(sy, sx) != 0xff)
+ if (m_motion_object_1_vid.pix(sy, sx) != 0xff)
{
uint8_t current_collision_mask = 0;
/* check for background collision (M1CHAR) */
- if (m_background_bitmap.pix16(org_1_y + sy, org_1_x + sx) != 0)
+ if (m_background_bitmap.pix(org_1_y + sy, org_1_x + sx) != 0)
current_collision_mask |= 0x04;
/* check for motion object collision (M1M2) */
- if (m_motion_object_2_clip.pix16(sy, sx) != 0xff)
+ if (m_motion_object_2_clip.pix(sy, sx) != 0xff)
current_collision_mask |= 0x10;
/* if we got one, trigger an interrupt */
@@ -340,10 +336,10 @@ void exidy_state::check_collision()
timer_set(m_screen->time_until_pos(org_1_x + sx, org_1_y + sy), TIMER_COLLISION_IRQ, current_collision_mask);
}
- if (m_motion_object_2_vid.pix16(sy, sx) != 0xff)
+ if (m_motion_object_2_vid.pix(sy, sx) != 0xff)
{
/* check for background collision (M2CHAR) */
- if (m_background_bitmap.pix16(org_2_y + sy, org_2_x + sx) != 0)
+ if (m_background_bitmap.pix(org_2_y + sy, org_2_x + sx) != 0)
if ((m_collision_mask & 0x08) && (count++ < 128))
timer_set(m_screen->time_until_pos(org_2_x + sx, org_2_y + sy), TIMER_COLLISION_IRQ, 0x08);
}