move ime_scheduled logic from opcode handler
This commit is contained in:
parent
8fc35fa1e1
commit
d73fbc827c
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue