chore(cpu): move RST behaviour to a method

This commit is contained in:
2021-04-07 23:05:03 -05:00
parent 0eb40a8109
commit cf3b79f0dc
2 changed files with 13 additions and 6 deletions

View File

@@ -222,13 +222,13 @@ impl Cpu {
};
let _ = match vector {
Some(register) => {
Some(address) => {
// Write the Changes to 0xFF0F and 0xFFFF registers
self.write_byte(0xFF0F, req.into());
// Disable all future interrupts
self.set_ime(ImeState::Disabled);
self.execute(Instruction::RST(register))
Instruction::reset(self, address)
}
None => Cycle::new(0), // NO Interrupts were enabled and / or requested
};