mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-24 03:32:50 +01:00
Update LR only when cond passes.
It should not be updated otherwise. In most cases, won't matter. Also, reorder slightly so SetBranch() can safely set PC directly.
This commit is contained in:
parent
7948f376fb
commit
493bf93a5a
@ -2084,9 +2084,10 @@ private:
|
||||
{
|
||||
if (CheckCondition(bo, bi))
|
||||
{
|
||||
const u64 nextLR = CPU.PC + 4;
|
||||
CPU.SetBranch(branchTarget((aa ? 0 : CPU.PC), bd), lk);
|
||||
if(lk) CPU.LR = nextLR;
|
||||
}
|
||||
if(lk) CPU.LR = CPU.PC + 4;
|
||||
}
|
||||
void SC(u32 sc_code)
|
||||
{
|
||||
@ -2108,8 +2109,9 @@ private:
|
||||
}
|
||||
void B(s32 ll, u32 aa, u32 lk)
|
||||
{
|
||||
const u64 nextLR = CPU.PC + 4;
|
||||
CPU.SetBranch(branchTarget(aa ? 0 : CPU.PC, ll), lk);
|
||||
if(lk) CPU.LR = CPU.PC + 4;
|
||||
if(lk) CPU.LR = nextLR;
|
||||
}
|
||||
void MCRF(u32 crfd, u32 crfs)
|
||||
{
|
||||
@ -2119,9 +2121,10 @@ private:
|
||||
{
|
||||
if (CheckCondition(bo, bi))
|
||||
{
|
||||
const u64 nextLR = CPU.PC + 4;
|
||||
CPU.SetBranch(branchTarget(0, CPU.LR), true);
|
||||
if(lk) CPU.LR = nextLR;
|
||||
}
|
||||
if(lk) CPU.LR = CPU.PC + 4;
|
||||
}
|
||||
void CRNOR(u32 crbd, u32 crba, u32 crbb)
|
||||
{
|
||||
@ -2171,9 +2174,10 @@ private:
|
||||
{
|
||||
if(bo & 0x10 || CPU.IsCR(bi) == (bo & 0x8))
|
||||
{
|
||||
const u64 nextLR = CPU.PC + 4;
|
||||
CPU.SetBranch(branchTarget(0, CPU.CTR), true);
|
||||
if(lk) CPU.LR = nextLR;
|
||||
}
|
||||
if(lk) CPU.LR = CPU.PC + 4;
|
||||
}
|
||||
void RLWIMI(u32 ra, u32 rs, u32 sh, u32 mb, u32 me, bool rc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user