diff --git a/src/processor/mod.rs b/src/processor/mod.rs index 7f5fd78..9464812 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -30,6 +30,14 @@ impl CPU { self.last_instruction_addr = self.reg.pc; let opcode = self.next_opcode(); self.last_instruction = opcode; + + if self.memory.ime_scheduled > 0 { + self.memory.ime_scheduled = self.memory.ime_scheduled.saturating_sub(1); + if self.memory.ime_scheduled == 0 { + self.memory.ime = true; + } + } + verbose_println!( "exec {:#4X} from pc: {:#X}", opcode,