From 74e2437d9198fa6a1a0256ebe41340d59105f533 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 6 Nov 2023 07:05:15 +0100 Subject: [PATCH] 808x machines with >= 8 MHz CPU speed now default to fast PIT, fixes #3776. --- src/machine/machine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/machine/machine.c b/src/machine/machine.c index a21d8115c..c4ace6b4f 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -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);