From 79874ad3d5967827d2c6e527d0734c4fd811bdbe Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 9 Jan 2024 17:38:54 +0100 Subject: [PATCH] EGA and (S)VGA: Removed a leftover if block around overscan Y, fixes garbage overscan Y values causing crashes. --- src/video/vid_ega.c | 8 +++----- src/video/vid_svga.c | 16 ++++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index 9aa2574d9..670d88e61 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -543,12 +543,10 @@ ega_recalctimings(ega_t *ega) } } - if (enable_overscan) { - overscan_y = (ega->rowcount + 1) << 1; + overscan_y = (ega->rowcount + 1) << 1; - if (overscan_y < 16) - overscan_y = 16; - } + if (overscan_y < 16) + overscan_y = 16; overscan_x = (ega->seqregs[1] & 1) ? 16 : 18; diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 12c549765..f90c3f74e 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -92,12 +92,10 @@ svga_set_override(svga_t *svga, int val) if (!val) { /* Override turned off, restore overscan X and Y per the CRTC. */ - if (enable_overscan) { - svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; + svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; - if (svga->monitor->mon_overscan_y < 16) - svga->monitor->mon_overscan_y = 16; - } + if (svga->monitor->mon_overscan_y < 16) + svga->monitor->mon_overscan_y = 16; svga->monitor->mon_overscan_x = (svga->seqregs[1] & 1) ? 16 : 18; @@ -711,12 +709,10 @@ svga_recalctimings(svga_t *svga) svga->linedbl = svga->crtc[9] & 0x80; svga->char_width = (svga->seqregs[1] & 1) ? 8 : 9; - if (enable_overscan) { - svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; + svga->monitor->mon_overscan_y = (svga->rowcount + 1) << 1; - if (svga->monitor->mon_overscan_y < 16) - svga->monitor->mon_overscan_y = 16; - } + if (svga->monitor->mon_overscan_y < 16) + svga->monitor->mon_overscan_y = 16; if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { svga->monitor->mon_overscan_x = (svga->seqregs[1] & 1) ? 16 : 18;