Always allow exceptions to occur, regardless of interrupt flag state

This commit is contained in:
Ry 2022-09-17 14:51:18 -07:00
parent bf48300f2f
commit 3aaebeaf3e

View File

@ -211,7 +211,8 @@ impl Cpu {
}
pub fn interrupt(&mut self, interrupt: Interrupt) {
if DEBUG { println!("interrupt(): enabled: {}", self.flag.interrupt); }
if self.flag.interrupt {
let is_exception = if let Interrupt::Exception(_) = interrupt { true } else { false };
if self.flag.interrupt || is_exception {
match interrupt {
Interrupt::Request(vector) => {
self.handle_interrupt(vector as u16);