Fixed C&T SuperEGA timings.

This commit is contained in:
OBattler
2025-08-27 03:37:31 +02:00
parent 08edbaff83
commit e42ce145b1

View File

@@ -149,6 +149,7 @@ ega_out(uint16_t addr, uint8_t val, void *priv)
ega->vres = !(val & 0x80);
ega->pallook = ega->vres ? pallook16 : pallook64;
ega->vidclock = val & 4;
pclog("clock = %01X\n", (val & 0x0c) >> 2);
ega->miscout = val;
ega->overscan_color = ega->vres ? pallook16[ega->attrregs[0x11] & 0x0f] :
pallook64[ega->attrregs[0x11] & 0x3f];
@@ -603,7 +604,22 @@ ega_recalctimings(ega_t *ega)
ega->linedbl = ega->crtc[9] & 0x80;
ega->rowcount = ega->crtc[9] & 0x1f;
if (ega_type == EGA_TYPE_COMPAQ) {
if (ega->actual_type == EGA_SUPEREGA) {
switch ((ega->miscout >> 2) & 0x03) {
case 0x00:
crtcconst = (cpuclock / 16257000.0 * (double) (1ULL << 32));
break;
case 0x01:
crtcconst = (cpuclock / (157500000.0 / 11.0) * (double) (1ULL << 32));
break;
default:
case 0x02: case 0x03:
crtcconst = (cpuclock / 25110000.0 * (double) (1ULL << 32));
break;
}
crtcconst *= mdiv;
} else if (ega_type == EGA_TYPE_COMPAQ) {
color = (ega->miscout & 1);
clksel = ((ega->miscout & 0xc) >> 2);