808x machines with >= 8 MHz CPU speed now default to fast PIT, fixes #3776.

This commit is contained in:
OBattler
2023-11-06 07:05:15 +01:00
parent 7dd13b704c
commit 74e2437d91

View File

@@ -168,13 +168,15 @@ pit_irq0_timer(int new_out, int old_out)
void
machine_common_init(UNUSED(const machine_t *model))
{
uint8_t cpu_requires_fast_pit = is486 || (is8086 && (cpu_s->rspeed >= 8000000));
/* System devices first. */
pic_init();
dma_init();
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
/* Select fast PIT if needed */
if (((pit_mode == -1) && is486) || (pit_mode == 1))
if (((pit_mode == -1) && cpu_requires_fast_pit) || (pit_mode == 1))
pit_type += 2;
pit_common_init(pit_type, pit_irq0_timer, NULL);