CPU: Fix interrupts in branch delay slots messing up PC

This commit is contained in:
Connor McLaughlin 2019-09-18 00:22:10 +10:00
parent 4025d6e4a6
commit a84b3d7a2b
1 changed files with 4 additions and 4 deletions

View File

@ -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);