Skip to content

Commit

Permalink
Core: Update when branch goes to the opcode after the delay slot
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed Sep 5, 2022
1 parent 8a01017 commit c380571
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,13 @@ void CX86RecompilerOps::Compile_Branch(RecompilerBranchCompare CompareType, bool
}
else if (m_PipelineStage == PIPELINE_STAGE_DELAY_SLOT_DONE)
{
if (m_CompilePC + ((int16_t)m_Opcode.offset << 2) + 4 == m_CompilePC + 8)
{
m_PipelineStage = PIPELINE_STAGE_NORMAL;
m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() - g_System->CountPerOp());
SetCurrentPC(GetCurrentPC() + 4);
return;
}
if (m_EffectDelaySlot)
{
CJumpInfo * FallInfo = m_Section->m_Jump.FallThrough ? &m_Section->m_Jump : &m_Section->m_Cont;
Expand Down

0 comments on commit c380571

Please sign in to comment.