From 8053c8a523ad38ecd9ce68f2df96dd2603c49713 Mon Sep 17 00:00:00 2001 From: SarahW Date: Thu, 19 Nov 2020 22:09:41 +0000 Subject: [PATCH] Ensure that any cycles spent when entering IRQ/NMI in dynarec are accounted for in the TSC, and by extension the timer system. Fixes slowdown and stuttering music in Museum Madness. --- src/386_dynarec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/386_dynarec.c b/src/386_dynarec.c index 895c745..9dedf44 100644 --- a/src/386_dynarec.c +++ b/src/386_dynarec.c @@ -591,8 +591,6 @@ void exec386_dynarec(int cycs) exec_interpreter(); else exec_recompiler(); - cycdiff=oldcyc-cycles; - tsc += cycdiff; if (cpu_state.abrt) { @@ -643,6 +641,9 @@ void exec386_dynarec(int cycs) // pclog("IRQ %02X %04X:%04X %04X:%04X\n", temp, SS, SP, CS, pc); } } + + cycdiff=oldcyc-cycles; + tsc += cycdiff; } if (TIMER_VAL_LESS_THAN_VAL(timer_target, (uint32_t)tsc))