From f518e390fab8b3f914bec7a1f0e47013d6f84139 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Wed, 8 Feb 2023 18:07:46 +1100 Subject: [PATCH] service interrupts when halted --- src/processor/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/mod.rs b/src/processor/mod.rs index d3adc3c..81b1c13 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -114,7 +114,7 @@ impl CPU { } fn handle_interrupts(&mut self) -> u8 { - if self.memory.ime { + if self.memory.ime || self.halted { let req_and_enabled = self.memory.get(0xFF0F) & self.memory.get(0xFFFF); // all interrupts should last 5 cycles? if get_bit(req_and_enabled, 0) {