First batch of video fixes, also fixes the MDA timings.

This commit is contained in:
OBattler
2023-08-12 01:16:49 +02:00
parent 6ceb63aacc
commit 33471594f4
3 changed files with 66 additions and 5 deletions

View File

@@ -1014,7 +1014,11 @@ pit_set_clock(int clock)
PITCONSTD = (cpuclock / 1193182.0);
PITCONST = (uint64_t) (PITCONSTD * (double) (1ULL << 32));
#ifdef IMPRECISE_CGACONST
CGACONST = (uint64_t) ((cpuclock / (19687503.0 / 11.0)) * (double) (1ULL << 32));
#else
CGACONST = (uint64_t) ((cpuclock / (157500000.0 / 88.0)) * (double) (1ULL << 32));
#endif
ISACONST = (uint64_t) ((cpuclock / (double) cpu_isa_speed) * (double) (1ULL << 32));
xt_cpu_multi = 1ULL;
} else {
@@ -1064,7 +1068,11 @@ pit_set_clock(int clock)
} else if (cpuclock != 14318184.0) {
PITCONSTD = (cpuclock / 1193182.0);
PITCONST = (uint64_t) (PITCONSTD * (double) (1ULL << 32));
#ifdef IMPRECISE_CGACONST
CGACONST = (uint64_t) ((cpuclock / (19687503.0 / 11.0)) * (double) (1ULL << 32));
#else
CGACONST = (uint64_t) ((cpuclock / (157500000.0 / 88.0)) * (double) (1ULL << 32));
#endif
}
ISACONST = (1ULL << 32ULL);
@@ -1074,7 +1082,11 @@ pit_set_clock(int clock)
/* Delay for empty I/O ports. */
io_delay = (int) round(((double) cpu_s->rspeed) / 3000000.0);
#ifdef WRONG_MDACONST
MDACONST = (uint64_t) (cpuclock / 2032125.0 * (double) (1ULL << 32));
#else
MDACONST = (uint64_t) (cpuclock / (16257000.0 / 9.0) * (double) (1ULL << 32));
#endif
HERCCONST = MDACONST;
VGACONST1 = (uint64_t) (cpuclock / 25175000.0 * (double) (1ULL << 32));
VGACONST2 = (uint64_t) (cpuclock / 28322000.0 * (double) (1ULL << 32));