Skip to content

Commit

Permalink
Android: Fix CArmRecompilerOps::Compile_Branch
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed Jul 25, 2022
1 parent 06b303a commit f117b5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void CArmRecompilerOps::Compile_BranchCompare(BRANCH_COMPARE CompareType)
}
}

void CArmRecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE BranchType, bool Link)
void CArmRecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, bool Link)
{
static CRegInfo RegBeforeDelay;
static bool EffectDelaySlot;
Expand All @@ -208,30 +208,12 @@ void CArmRecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE B

if ((m_CompilePC & 0xFFC) != 0xFFC)
{
switch (BranchType)
R4300iOpcode DelaySlot;
if (!g_MMU->MemoryValue32(m_CompilePC + 4, DelaySlot.Value))
{
case BranchTypeRs: EffectDelaySlot = DelaySlotEffectsCompare(m_CompilePC, m_Opcode.rs, 0); break;
case BranchTypeRsRt: EffectDelaySlot = DelaySlotEffectsCompare(m_CompilePC, m_Opcode.rs, m_Opcode.rt); break;
case BranchTypeCop1:

if (!g_MMU->MemoryValue32(m_CompilePC + 4, Command.Value))
{
g_Notify->FatalError(GS(MSG_FAIL_LOAD_WORD));
}

EffectDelaySlot = false;
if (Command.op == R4300i_CP1)
{
if ((Command.fmt == R4300i_COP1_S && (Command.funct & 0x30) == 0x30) ||
(Command.fmt == R4300i_COP1_D && (Command.funct & 0x30) == 0x30))
{
EffectDelaySlot = true;
}
}
break;
default:
if (HaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); }
g_Notify->FatalError(GS(MSG_FAIL_LOAD_WORD));
}
EffectDelaySlot = R4300iInstruction(m_CompilePC, m_Opcode.Value).DelaySlotEffectsCompare(DelaySlot.Value);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CArmRecompilerOps :

// Branch functions
void Compile_BranchCompare(BRANCH_COMPARE CompareType);
void Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE BranchType, bool Link);
void Compile_Branch(BRANCH_COMPARE CompareType, bool Link);
void Compile_BranchLikely(BRANCH_COMPARE CompareType, bool Link);
void BNE_Compare();
void BEQ_Compare();
Expand Down

0 comments on commit f117b5d

Please sign in to comment.