From a84b3d7a2bc8541c39ea057e8699d5f41d90b276 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 18 Sep 2019 00:22:10 +1000 Subject: [PATCH] CPU: Fix interrupts in branch delay slots messing up PC --- src/pse/cpu_core.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pse/cpu_core.cpp b/src/pse/cpu_core.cpp index 693052720..397f779e0 100644 --- a/src/pse/cpu_core.cpp +++ b/src/pse/cpu_core.cpp @@ -317,14 +317,14 @@ TickCount Core::Execute() const Instruction inst = m_next_instruction; m_current_instruction_pc = m_regs.pc; - // fetch the next instruction - if (DispatchInterrupts() || !FetchInstruction()) - continue; - // handle branch delays - we are now in a delay slot if we just branched m_in_branch_delay_slot = m_branched; m_branched = false; + // fetch the next instruction + if (DispatchInterrupts() || !FetchInstruction()) + continue; + // execute the instruction we previously fetched ExecuteInstruction(inst);