From 54b2f4237d1a304542bf12772ea14fa3ead16553 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Mon, 30 Jun 2025 19:51:35 +0200 Subject: [PATCH] Adjust the timings of the 8514/A and compatibles (June 30th, 2025) --- src/video/vid_8514a.c | 3 ++- src/video/vid_ati_mach8.c | 14 ++++++++------ src/video/vid_svga.c | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index b1e38fef7..c8191a876 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -3819,7 +3819,7 @@ ibm8514_recalctimings(svga_t *svga) } else { if (dev->on) { dev->hdisp = (dev->hdisped + 1) << 3; - dev->h_total = (dev->htotal + 1) << 3; + dev->h_total = dev->htotal + 1; if (dev->h_total == 1) /*Default to 1024x768 87hz 8514/A htotal timings if it goes to 0.*/ dev->h_total = 0x9e; @@ -3854,6 +3854,7 @@ ibm8514_recalctimings(svga_t *svga) dev->h_disp = dev->hdisp; dev->dispend = dev->vdisp; + dev->h_disp_time = dev->hdisp >> 3; if (dev->accel.advfunc_cntl & 0x04) svga->clock_8514 = (cpuclock * (double) (1ULL << 32)) / 44900000.0; diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index c5cb2ccca..df8965caf 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -2707,9 +2707,9 @@ mach_set_resolution(mach_t *mach, svga_t *svga) { ibm8514_t *dev = (ibm8514_t *) svga->dev8514; - dev->h_total = (dev->htotal + 1) << 3; + dev->h_total = (dev->htotal + 1); if (dev->h_total == 8) /*Default to 1024x768 87hz 8514/A htotal timings if it goes to 0.*/ - dev->h_total = 0x9e << 3; + dev->h_total = 0x9e; dev->hdisp = (dev->hdisped + 1) << 3; @@ -2730,7 +2730,7 @@ mach_set_resolution(mach_t *mach, svga_t *svga) switch (mach->shadow_set & 0x03) { case 0x01: if (!(dev->accel.advfunc_cntl & 0x04)) { - dev->h_total = 0x64 << 3; + dev->h_total = 0x64; dev->hdisp = 640; dev->vdisp = 480; dev->v_total = 0x0419; @@ -2739,7 +2739,7 @@ mach_set_resolution(mach_t *mach, svga_t *svga) break; case 0x02: if (dev->accel.advfunc_cntl & 0x04) { - dev->h_total = 0x9e << 3; + dev->h_total = 0x9e; dev->hdisp = 1024; dev->vdisp = 768; dev->v_total = 0x0669; @@ -2754,7 +2754,7 @@ mach_set_resolution(mach_t *mach, svga_t *svga) } else if ((dev->disp_cntl >> 5) == 2) { /*Reset 8514/A to defaults if needed.*/ if (dev->accel.advfunc_cntl & 0x04) { if (dev->hdisp == 640) { - dev->h_total = 0x9e << 3; + dev->h_total = 0x9e; dev->hdisp = 1024; dev->vdisp = 768; dev->v_total = 0x0669; @@ -2763,7 +2763,7 @@ mach_set_resolution(mach_t *mach, svga_t *svga) } } else { if (dev->hdisp == 1024) { - dev->h_total = 0x64 << 3; + dev->h_total = 0x64; dev->hdisp = 640; dev->vdisp = 480; dev->v_total = 0x0419; @@ -2926,6 +2926,8 @@ mach_recalctimings(svga_t *svga) else if (dev->h_disp == 640) dev->dispend = 480; + dev->h_disp_time = dev->hdisp >> 3; + svga->clock_8514 = (cpuclock * (double) (1ULL << 32)) / svga->getclock((mach->accel.clock_sel >> 2) & 0x0f, svga->clock_gen); if (mach->accel.clock_sel & 0x40) svga->clock_8514 *= 2; diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 5f2d2d89c..8ed71645e 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1031,7 +1031,7 @@ svga_recalctimings(svga_t *svga) svga->y_add = svga->vtotal - svga->vblankend - 1; svga->monitor->mon_overscan_y = svga->y_add + abs(svga->vblankstart - svga->dispend); - if ((svga->dispend >= 2048) || (svga->y_add < 0)) { + if ((dev->dispend >= 2048) || (svga->y_add < 0)) { svga->y_add = 0; svga->monitor->mon_overscan_y = 0; } @@ -1094,7 +1094,7 @@ svga_recalctimings(svga_t *svga) if (ibm8514_active && (svga->dev8514 != NULL)) { if (dev->on) { disptime8514 = dev->h_total; - _dispontime8514 = dev->h_disp; + _dispontime8514 = dev->h_disp_time; svga_log("HTOTAL=%d, HDISP=%d.\n", dev->h_total, dev->h_disp); } }