From 6c3f61fa841b46f7d3dce077266dff7b9fe8698d Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Thu, 16 Dec 2010 01:58:27 +0000 Subject: [PATCH] Added preliminary row select effect in Irem M107, fixes for good the start-up transitioning in Fire Barrel [Angelo Salese, David Haywood] --- src/mame/video/m107.c | 46 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c index 81303c5b2ab..d1bdd67a193 100644 --- a/src/mame/video/m107.c +++ b/src/mame/video/m107.c @@ -265,6 +265,7 @@ static void m107_update_scroll_positions(void) { pf_layer_info *layer = &pf_layer[laynum]; + #if 0 if (m107_control[0x08 + laynum] & 0x02) { const UINT16 *scrolldata = m107_vram_data + (0xe800 + 0x400 * laynum) / 2; @@ -273,7 +274,8 @@ static void m107_update_scroll_positions(void) for (i = 0; i < 512; i++) tilemap_set_scrollx(layer->tmap, i, scrolldata[i] + m107_control[1 + 2 * laynum]); } - else if (m107_control[0x08 + laynum] & 0x01) //used by World PK Soccer goal scrolling and Fire Barrel sea wave effect (stage 2) / canyon parallax effect (stage 6) + #endif + if (m107_control[0x08 + laynum] & 0x01) //used by World PK Soccer goal scrolling and Fire Barrel sea wave effect (stage 2) / canyon parallax effect (stage 6) { const UINT16 *scrolldata = m107_vram_data + (0xe000 + 0x200 * laynum) / 2; @@ -295,6 +297,14 @@ static void m107_update_scroll_positions(void) static void m107_screenrefresh(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { + int line; + rectangle clip; + const rectangle &visarea = machine->primary_screen->visible_area(); + clip.min_x = visarea.min_x; + clip.max_x = visarea.max_x; + clip.min_y = visarea.min_y; + clip.max_y = visarea.max_y; + if ((~m107_control[0x0b] >> 7) & 1) { tilemap_draw(bitmap, cliprect, pf_layer[3].tmap, 0, 0); @@ -307,11 +317,41 @@ static void m107_screenrefresh(running_machine *machine, bitmap_t *bitmap, const tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, 1, 0); tilemap_draw(bitmap, cliprect, pf_layer[1].tmap, 0, 0); - tilemap_draw(bitmap, cliprect, pf_layer[0].tmap, 0, 0); + if (m107_control[0x08 + 0] & 0x02) + { + for (line = cliprect->min_y; line < cliprect->max_y;line++) + { + const UINT16 *scrolldata = m107_vram_data + (0xe800 + 0x400 * 0) / 2; + clip.min_y = clip.max_y = line; + + tilemap_set_scrollx(pf_layer[0].tmap,0, m107_control[1 + 2 * 0] + scrolldata[line]); + tilemap_set_scrolly(pf_layer[0].tmap,0, m107_control[0 + 2 * 0] + scrolldata[line]); + + tilemap_draw(bitmap, &clip, pf_layer[0].tmap, 0, 0); + + } + + } + else + tilemap_draw(bitmap, cliprect, pf_layer[0].tmap, 0, 0); draw_sprites(machine, bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, pf_layer[1].tmap, 1, 0); - tilemap_draw(bitmap, cliprect, pf_layer[0].tmap, 1, 0); + if (m107_control[0x08 + 0] & 0x02) + { + for (line = cliprect->min_y; line < cliprect->max_y;line++) + { + const UINT16 *scrolldata = m107_vram_data + (0xe800 + 0x400 * 0) / 2; + clip.min_y = clip.max_y = line; + + tilemap_set_scrollx(pf_layer[0].tmap,0, m107_control[1 + 2 * 0] + scrolldata[line]); + tilemap_set_scrolly(pf_layer[0].tmap,0, m107_control[0 + 2 * 0] + scrolldata[line]); + + tilemap_draw(bitmap, &clip, pf_layer[0].tmap, 1, 0); + } + } + else + tilemap_draw(bitmap, cliprect, pf_layer[0].tmap, 1, 0); draw_sprites(machine, bitmap, cliprect, 1);