From 81b8150a6bc2c427d85481d869a789c2781571cb Mon Sep 17 00:00:00 2001 From: GreaseMonkey Date: Tue, 21 Nov 2023 19:25:26 +1300 Subject: [PATCH] (S)VGA: Increment CRTC address just before it needs to be used This gives more likely behaviour when one loads more often than the address is incremented. The behaviour matches an Intel GMA 4500MHD (2008) which is the earliest hardware I'm able to test right now. --- src/video/vid_svga_render.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/video/vid_svga_render.c b/src/video/vid_svga_render.c index afeddef85..b9330f4c0 100644 --- a/src/video/vid_svga_render.c +++ b/src/video/vid_svga_render.c @@ -569,14 +569,12 @@ svga_render_indexed_gfx(svga_t *svga, bool highres, bool combine8bits) load_counter = 0; } - if (incr_counter == 0) { - svga->ma += 4; - // DISCREPANCY TODO FIXME 2/4bpp used vram_mask, 8bpp used vram_display_mask --GM - svga->ma &= svga->vram_display_mask; - } incr_counter += 1; if (incr_counter >= incevery) { incr_counter = 0; + svga->ma += 4; + // DISCREPANCY TODO FIXME 2/4bpp used vram_mask, 8bpp used vram_display_mask --GM + svga->ma &= svga->vram_display_mask; } //