From 74d88ec6bb0639d5a492985e0ddee29321ff7ec7 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Sun, 8 Aug 2021 13:24:11 +0200 Subject: [PATCH] Fixed display start address on S3 pre-ViRGE and ViRGE cards upon recalculation of its timings plus when the banking register is enabled, this also fixes the flickering of Quake while having Commander Keen working without glitches. --- src/video/vid_s3.c | 2 ++ src/video/vid_s3_virge.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 1730358ff..8d24ac201 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -2423,6 +2423,8 @@ s3_out(uint16_t addr, uint8_t val, void *p) if ((svga->crtcreg == 0xc) || (svga->crtcreg == 0xd)) { svga->fullchange = 3; svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5); + if ((((svga->crtc[0x67] & 0xc) != 0xc) && (s3->chip >= S3_TRIO64V)) || (s3->chip < S3_TRIO64V)) + svga->ma_latch |= (s3->ma_ext << 16); } else { svga->fullchange = changeframecount; svga_recalctimings(svga); diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 156947652..eaaa55ebd 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -586,6 +586,8 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) if ((svga->crtcreg == 0xc) || (svga->crtcreg == 0xd)) { svga->fullchange = 3; svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5); + if ((svga->crtc[0x67] & 0xc) != 0xc) + svga->ma_latch |= (virge->ma_ext << 16); } else { svga->fullchange = changeframecount; svga_recalctimings(svga);