From 7d63a694cccfbb4295e0b9bfe70b8d564b06813d Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Sat, 1 Feb 2025 20:47:26 +0100 Subject: [PATCH] fix compare interrupt (#210) --- src/device/exceptions.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/device/exceptions.rs b/src/device/exceptions.rs index 5ddc51e..892a7fa 100644 --- a/src/device/exceptions.rs +++ b/src/device/exceptions.rs @@ -30,12 +30,16 @@ pub fn check_pending_interrupts(device: &mut device::Device) { return; } - device::events::create_event( - device, - device::events::EventType::Interrupt, - device.cpu.cop0.regs[device::cop0::COP0_COUNT_REG as usize], - interrupt_exception, - ); + if device.cpu.cop0.regs[device::cop0::COP0_CAUSE_REG as usize] == device::cop0::COP0_CAUSE_IP7 { + interrupt_exception(device); + } else { + device::events::create_event( + device, + device::events::EventType::Interrupt, + device.cpu.cop0.regs[device::cop0::COP0_COUNT_REG as usize], + interrupt_exception, + ); + } } pub fn interrupt_exception(device: &mut device::Device) {