(S)VGA: Do some compensation when calculating the overscan, fixes #5688.

This commit is contained in:
Miran Grča
2025-06-18 10:45:56 +02:00
committed by GitHub
parent 97c893b908
commit 8e32c97339

View File

@@ -956,14 +956,18 @@ svga_recalctimings(svga_t *svga)
svga->hdisp -= (svga->hblank_sub * svga->dots_per_clock);
svga->left_overscan = svga->x_add = (svga->htotal - adj_dot - 1) * svga->dots_per_clock;
svga->monitor->mon_overscan_x = svga->x_add + (svga->hblankstart * svga->dots_per_clock) - hd;
svga->monitor->mon_overscan_x = svga->x_add + (svga->hblankstart * svga->dots_per_clock) - hd + svga->dots_per_clock;
/* Compensate for the HDISP code above. */
if (svga->crtc[1] & 1)
svga->monitor->mon_overscan_x++;
if ((svga->hdisp >= 2048) || (svga->left_overscan < 0)) {
svga->left_overscan = svga->x_add = 0;
svga->monitor->mon_overscan_x = 0;
}
svga->y_add = svga->vtotal - vblankend + 1;
/* - 1 because + 1 but also - 2 to compensate for the + 2 added to vtotal above. */
svga->y_add = svga->vtotal - vblankend - 1;
svga->monitor->mon_overscan_y = svga->y_add + abs(svga->vblankstart - svga->dispend);
if ((svga->dispend >= 2048) || (svga->y_add < 0)) {