Changed timer base frequency on XT models to 14.318MHz - PIT, CGA and 4.77MHz CPU should now stay in perfect sync.

This commit is contained in:
TomW 2015-11-25 21:50:38 +00:00
commit 79202cc5c0
10 changed files with 49 additions and 29 deletions

View file

@ -6,7 +6,7 @@ extern int timer_start;
#define timer_end_period(cycles) \
do \
{ \
int diff = timer_start - cycles; \
int diff = timer_start - (cycles); \
timer_count -= diff; \
timer_start = cycles; \
if (timer_count <= 0) \
@ -16,14 +16,23 @@ extern int timer_start;
} \
} while (0)
#define timer_clock() \
do \
{ \
int diff = timer_start - cycles; \
timer_count -= diff; \
timer_start = cycles; \
timer_process(); \
timer_update_outstanding(); \
#define timer_clock() \
do \
{ \
int diff; \
if (AT) \
{ \
diff = timer_start - (cycles << TIMER_SHIFT); \
timer_start = cycles << TIMER_SHIFT; \
} \
else \
{ \
diff = timer_start - (cycles * xt_cpu_multi); \
timer_start = cycles * xt_cpu_multi; \
} \
timer_count -= diff; \
timer_process(); \
timer_update_outstanding(); \
} while (0)
void timer_process();