SVGA hskew

This commit is contained in:
Jasmine Iwanek
2023-08-06 20:29:39 -04:00
parent cb24ee27cb
commit 01ffb60df8
7 changed files with 306 additions and 32 deletions

View File

@@ -3038,6 +3038,8 @@ s3_recalctimings(svga_t *svga)
s3_t *s3 = (s3_t *) svga->priv;
int clk_sel = (svga->miscout >> 2) & 3;
svga->hdisp = svga->hdisp_old;
if (!svga->scrblank && svga->attr_palette_enable) {
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
if (svga->crtc[0x3a] & 0x10) { /*256+ color register*/
@@ -3047,14 +3049,13 @@ s3_recalctimings(svga_t *svga)
}
svga->ma_latch |= (s3->ma_ext << 16);
if (s3->chip >= S3_86C928) {
svga->hdisp = svga->hdisp_old;
if (s3->chip >= S3_86C928) {
if (svga->crtc[0x5d] & 0x01)
svga->htotal |= 0x100;
if (svga->crtc[0x5d] & 0x02) {
svga->hdisp_time |= 0x100;
svga->hdisp |= 0x100 * ((svga->seqregs[1] & 8) ? 16 : 8);
svga->hdisp |= 0x100 * svga->dots_per_clock;
}
if (svga->crtc[0x5e] & 0x01)
svga->vtotal |= 0x400;
@@ -3072,7 +3073,8 @@ s3_recalctimings(svga_t *svga)
svga->rowoffset |= (svga->crtc[0x51] & 0x30) << 4;
else if (svga->crtc[0x43] & 0x04)
svga->rowoffset |= 0x100;
}
} else if (svga->crtc[0x43] & 0x04)
svga->rowoffset |= 0x100;
if (!svga->rowoffset)
svga->rowoffset = 0x100;
@@ -3341,6 +3343,30 @@ s3_recalctimings(svga_t *svga)
}
}
}
if (s3->chip >= S3_86C801) {
if (!svga->scrblank && svga->attr_palette_enable && (svga->crtc[0x43] & 0x80)) {
/* TODO: In case of bug reports, disable 9-dots-wide character clocks in graphics modes. */
svga->dots_per_clock = ((svga->seqregs[1] & 1) ? 16 : 18);
}
if (svga->crtc[0x5d] & 0x04)
svga->hblankstart += 0x100;
if (s3->chip >= S3_VISION964) {
/* NOTE: The S3 Trio64V+ datasheet says this is bit 7, but then where is bit 6?
The datasheets for the pre-Trio64V+ cards say +64, which implies bit 6,
and, contrary to VGADOC, it also exists on Trio32, Trio64, Vision868,
and Vision968. */
#if 0
pclog("svga->crtc[0x5d] = %02X\n", svga->crtc[0x5d]);
#endif
if (svga->crtc[0x5d] & 0x08)
svga->hblank_ext = 0x40;
svga->hblank_end_len = 0x00000040;
}
}
svga->hblank_overscan = !(svga->crtc[0x33] & 0x20);
}
static void