Fixed off by one errors in (S)VGA horizontal blanking start calculation.

This commit is contained in:
OBattler
2024-02-18 17:54:14 +01:00
parent 0b5bf60aaf
commit 4c3cceec69
14 changed files with 28 additions and 34 deletions

View File

@@ -558,10 +558,10 @@ banshee_recalctimings(svga_t *svga)
that is, no overscan and relying on display end to blank. */
if (banshee->vgaInit0 & 0x40) {
svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/ +
(((svga->crtc[0x1a] & 0x04) >> 2) << 8) + 1;
(((svga->crtc[0x1a] & 0x04) >> 2) << 8);
svga->hblank_end_mask = 0x0000007f;
} else {
svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/ + 1;
svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/;
svga->hblank_end_mask = 0x0000003f;
}
svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/;
@@ -579,12 +579,12 @@ banshee_recalctimings(svga_t *svga)
svga->linedbl = 0;
} else {
if (banshee->vgaInit0 & 0x40) {
svga->hblankstart = (((svga->crtc[0x1a] & 0x10) >> 4) << 8) + svga->crtc[2] + 1;
svga->hblankstart = (((svga->crtc[0x1a] & 0x10) >> 4) << 8) + svga->crtc[2];
svga->hblank_end_val = (svga->crtc[3] & 0x1f) | (((svga->crtc[5] & 0x80) >> 7) << 5) |
(((svga->crtc[0x1a] & 0x20) >> 5) << 6);
svga->hblank_end_mask = 0x0000007f;
} else {
svga->hblankstart = svga->crtc[2] + 1;
svga->hblankstart = svga->crtc[2];
svga->hblank_end_val = (svga->crtc[3] & 0x1f) | (((svga->crtc[5] & 0x80) >> 7) << 5);
svga->hblank_end_mask = 0x0000003f;
}
@@ -652,9 +652,6 @@ banshee_recalctimings(svga_t *svga)
if (banshee->vidProcCfg & VIDPROCCFG_2X_MODE) {
svga->hdisp *= 2;
// svga->htotal *= 2;
// svga->hblankstart *= 2;
// svga->hblank_end_val *= 2;
svga->dots_per_clock *= 2;
}