diff --git a/src/mame/video/pc080sn.c b/src/mame/video/pc080sn.c index 077b17dd1ec..8c5d969d9c6 100644 --- a/src/mame/video/pc080sn.c +++ b/src/mame/video/pc080sn.c @@ -377,10 +377,9 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 & UINT16 a, color; int sx, x_index; - int i, y, y_index, src_y_index, row_index; + int y_index, src_y_index, row_index; int flip = 0; - int machine_flip = 0; /* for ROT 180 ? */ int min_x = cliprect.min_x; int max_x = cliprect.max_x; @@ -400,12 +399,7 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 & y_index = 0; } - if (!machine_flip) - y = min_y; - else - y = max_y; - - do + for (int y = min_y; y <= max_y; y++) { src_y_index = y_index & 0x1ff; /* tilemaps are 512 px up/down */ row_index = (src_y_index - m_bgscrolly[layer]) & 0x1ff; @@ -419,7 +413,7 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 & if (flags & TILEMAP_DRAW_OPAQUE) { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { a = src16[x_index & width_mask]; #ifdef TOPSPEED_ROAD_COLORS @@ -431,7 +425,7 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 & } else { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { if (tsrc[x_index & width_mask]) { @@ -449,13 +443,7 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 & taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); y_index++; - - if (!machine_flip) - y++; - else - y--; } - while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); } void pc080sn_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) diff --git a/src/mame/video/tc0080vco.c b/src/mame/video/tc0080vco.c index 9083f894f9b..dca7dd0657c 100644 --- a/src/mame/video/tc0080vco.c +++ b/src/mame/video/tc0080vco.c @@ -439,11 +439,10 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi int sx, zoomx, zoomy; int dx, ex, dy, ey; - int i, y, y_index, src_y_index, row_index; + int y_index, src_y_index, row_index; int x_index, x_step; int flip = m_flipscreen; - int machine_flip = 0; /* for ROT 180 ? */ int min_x = cliprect.min_x; int max_x = cliprect.max_x; @@ -501,12 +500,7 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi y_index = ((-m_scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); } - if (!machine_flip) - y = min_y; - else - y = max_y; - - do + for (int y = min_y; y <= max_y; y++) { src_y_index = (y_index >> 16) & 0x3ff; /* tilemaps are 1024 px up/down */ @@ -525,7 +519,7 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi if (flags & TILEMAP_DRAW_OPAQUE) { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { *dst16++ = src16[(x_index >> 16) & width_mask]; x_index += x_step; @@ -533,7 +527,7 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi } else { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { if (tsrc[(x_index >> 16) & width_mask]) *dst16++ = src16[(x_index >> 16) & width_mask]; @@ -546,13 +540,7 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, screen.priority(), priority); y_index += zoomy; - - if (!machine_flip) - y++; - else - y--; } - while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); } } diff --git a/src/mame/video/tc0480scp.c b/src/mame/video/tc0480scp.c index e9f030e0e5e..0eacfe5a0ef 100644 --- a/src/mame/video/tc0480scp.c +++ b/src/mame/video/tc0480scp.c @@ -717,7 +717,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap(); bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap(); int flip = m_pri_reg & 0x40; - int i, y, y_index, src_y_index, row_index; + int y_index, src_y_index, row_index; int x_index, x_step; UINT16 screen_width = 512; //cliprect.width(); @@ -745,9 +745,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c y_index -= (m_y_offset - min_y) * zoomy; } - y = min_y; - - do + for (int y = min_y; y <= max_y; y++) { src_y_index = (y_index >> 16) & 0x1ff; @@ -766,7 +764,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c if (flags & TILEMAP_DRAW_OPAQUE) { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { *dst16++ = src16[(x_index >> 16) & width_mask]; x_index += x_step; @@ -774,7 +772,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c } else { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { if (tsrc[(x_index >> 16) & width_mask]) *dst16++ = src16[(x_index >> 16) & width_mask]; @@ -787,10 +785,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); y_index += zoomy; - y++; } - while (y <= max_y); - } } @@ -838,7 +833,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co UINT16 *dst16, *src16; UINT8 *tsrc; - int i, y, y_index, src_y_index, row_index, row_zoom; + int y_index, src_y_index, row_index, row_zoom; int sx, x_index, x_step; UINT32 zoomx, zoomy; UINT16 scanline[512]; @@ -876,9 +871,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co y_index -= (m_y_offset - min_y) * zoomy; } - y = min_y; - - do + for (int y = min_y; y <= max_y; y++) { if (!flipscreen) src_y_index = ((y_index>>16) + m_bgcolumn_ram[layer][(y - m_y_offset) & 0x1ff]) & 0x1ff; @@ -917,7 +910,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co if (flags & TILEMAP_DRAW_OPAQUE) { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { *dst16++ = src16[(x_index >> 16) & width_mask]; x_index += x_step; @@ -925,7 +918,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co } else { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { if (tsrc[(x_index >> 16) & width_mask]) *dst16++ = src16[(x_index >> 16) & width_mask]; @@ -938,9 +931,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); y_index += zoomy; - y++; } - while (y<=max_y); } diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c index 0bb5e3e5424..d9aa942eede 100644 --- a/src/mame/video/wgp.c +++ b/src/mame/video/wgp.c @@ -514,7 +514,7 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, UINT16 *dst16,*src16; UINT8 *tsrc; - int i, y, y_index, src_y_index, row_index, row_zoom; + int y_index, src_y_index, row_index, row_zoom; /* I have a fairly strong feeling these should be UINT32's, x_index is falling through from max +ve to max -ve quite a lot in this routine */ @@ -524,7 +524,6 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, UINT16 scanline[512]; UINT16 row_colbank, row_scroll; int flipscreen = 0; /* n/a */ - int machine_flip = 0; /* for ROT 180 ? */ UINT16 screen_width = cliprect.width(); UINT16 min_y = cliprect.min_y; @@ -558,12 +557,7 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, y_index = 0; } - if (!machine_flip) - y = min_y; - else - y = max_y; - - do + for (int y = min_y; y <= max_y; y++) { int a; @@ -598,7 +592,7 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, if (flags & TILEMAP_DRAW_OPAQUE) { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; x_index += x_step; @@ -606,7 +600,7 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, } else { - for (i = 0; i < screen_width; i++) + for (int i = 0; i < screen_width; i++) { if (tsrc[(x_index >> 16) & width_mask]) *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; @@ -619,10 +613,7 @@ void wgp_state::wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); y_index += zoomy; - if (!machine_flip) y++; else y--; } - while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); - }