From 9c673f527dced4404db37721523c6556b0e65f27 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 6 Sep 2023 18:58:47 -0700 Subject: [PATCH] ARM, SM83: Check for events both before and after single stepping --- src/arm/arm.c | 3 +++ src/sm83/sm83.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/arm/arm.c b/src/arm/arm.c index 37dfe726c..cb93136aa 100644 --- a/src/arm/arm.c +++ b/src/arm/arm.c @@ -234,6 +234,9 @@ void ARMRun(struct ARMCore* cpu) { } else { ARMStep(cpu); } + while (cpu->cycles >= cpu->nextEvent) { + cpu->irqh.processEvents(cpu); + } } void ARMRunLoop(struct ARMCore* cpu) { diff --git a/src/sm83/sm83.c b/src/sm83/sm83.c index 00163a20b..9f14ab341 100644 --- a/src/sm83/sm83.c +++ b/src/sm83/sm83.c @@ -181,6 +181,9 @@ void SM83Tick(struct SM83Core* cpu) { cpu->irqh.processEvents(cpu); } _SM83TickInternal(cpu); + while (cpu->cycles >= cpu->nextEvent) { + cpu->irqh.processEvents(cpu); + } } void SM83Run(struct SM83Core* cpu) {