From f61049755c082bdcfcf1ac8f5d5f1bdd2651b511 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 20 Apr 2018 05:10:39 +0200 Subject: [PATCH] stvvdp2.cpp: fix RBG0 cache map range, fixes Head On graphics update in Sega Memorial Collection 1 [Angelo Salese] --- src/devices/video/stvvdp2.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp index 82046b250c6..d6849470b92 100644 --- a/src/devices/video/stvvdp2.cpp +++ b/src/devices/video/stvvdp2.cpp @@ -4194,12 +4194,18 @@ void saturn_state::stv_vdp2_draw_basic_tilemap(bitmap_rgb32 &bitmap, const recta // store map information stv_vdp2_layer_data_placement.map_offset_min = 0x7fffffff; stv_vdp2_layer_data_placement.map_offset_max = 0x00000000; + for (i = 0; i < stv2_current_tilemap.map_count; i++) { + uint32_t max_base; + if ( base[i] < stv_vdp2_layer_data_placement.map_offset_min ) stv_vdp2_layer_data_placement.map_offset_min = base[i]; - if ( base[i] > stv_vdp2_layer_data_placement.map_offset_max ) - stv_vdp2_layer_data_placement.map_offset_max = base[i]; + + // Head On in Sega Memorial Collection 1 cares (uses RBG0 with all map regs equal to 0x20) + max_base = (base[i] + plsize_bytes/4); + if ( max_base > stv_vdp2_layer_data_placement.map_offset_max ) + stv_vdp2_layer_data_placement.map_offset_max = max_base; }