40x25 text mode and Cardex ET4000/w32p 80x25 text mode now actually fixes.

This commit is contained in:
OBattler
2020-12-20 21:14:24 +01:00
parent 66e2b9bc1b
commit da1de8aaf5
2 changed files with 15 additions and 3 deletions

View File

@@ -355,6 +355,17 @@ void et4000w32p_recalctimings(svga_t *svga)
svga->clock = (cpuclock * (double)(1ull << 32)) / svga->getclock((svga->miscout >> 2) & 3, svga->clock_gen);
if (svga->adv_flags & FLAG_NOSKEW) {
/* On the Cardex ET4000/W32p, adjust text mode clocks by 1. */
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
svga->ma_latch--;
if ((svga->seqregs[1] & 8)) /*40 column*/
svga->hdisp += (svga->seqregs[1] & 1) ? 16 : 18;
else
svga->hdisp += (svga->seqregs[1] & 1) ? 8 : 9;
}
}
switch (svga->bpp)
{
case 15: case 16:

View File

@@ -445,7 +445,7 @@ svga_recalctimings(svga_t *svga)
svga->interlace = 0;
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]);
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5);
svga->ca_adj = 0;
svga->rowcount = svga->crtc[9] & 31;
@@ -457,10 +457,11 @@ svga_recalctimings(svga_t *svga)
if (svga->seqregs[1] & 8) /*40 column*/ {
svga->render = svga_render_text_40;
svga->hdisp *= (svga->seqregs[1] & 1) ? 16 : 18;
/* Character clock is off by 1 now in 40-line modes, on all cards. */
svga->ma_latch--;
svga->hdisp += (svga->seqregs[1] & 1) ? 16 : 18;
} else {
svga->render = svga_render_text_80;
if (!(svga->adv_flags & FLAG_NOSKEW))
svga->ma_latch += ((svga->crtc[8] & 0x60) >> 5);
svga->hdisp *= (svga->seqregs[1] & 1) ? 8 : 9;
}
svga->hdisp_old = svga->hdisp;