From 3593aa7b8174d12ecd426a1e69f7ffbe411a04a9 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 27 Aug 2016 01:54:30 -0700 Subject: [PATCH] GB: Halting should do nothing if an IRQ is already pending --- src/gb/gb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gb/gb.c b/src/gb/gb.c index 9800ec847..f8f762603 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -372,8 +372,10 @@ void GBSetInterrupts(struct LR35902Core* cpu, bool enable) { } void GBHalt(struct LR35902Core* cpu) { - cpu->cycles = cpu->nextEvent; - cpu->halted = true; + if (!cpu->irqPending) { + cpu->cycles = cpu->nextEvent; + cpu->halted = true; + } } void GBStop(struct LR35902Core* cpu) {