service interrupts when halted

This commit is contained in:
Alex Janka 2023-02-08 18:07:46 +11:00
parent 8ef947d54a
commit f518e390fa

View file

@ -114,7 +114,7 @@ impl CPU {
} }
fn handle_interrupts(&mut self) -> u8 { 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); let req_and_enabled = self.memory.get(0xFF0F) & self.memory.get(0xFFFF);
// all interrupts should last 5 cycles? // all interrupts should last 5 cycles?
if get_bit(req_and_enabled, 0) { if get_bit(req_and_enabled, 0) {