Merge pull request #264 from unknownbrackets/ppu-minor

Clean up LR updates in branches, remove CA update in ADD
This commit is contained in:
B1ackDaemon 2014-05-23 19:24:32 +03:00
commit a186efded2

View File

@ -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)
{
@ -2816,7 +2820,6 @@ private:
const u64 RA = CPU.GPR[ra];
const u64 RB = CPU.GPR[rb];
CPU.GPR[rd] = RA + RB;
CPU.XER.CA = CPU.IsCarry(RA, RB);
if(oe) UNK("addo");
if(rc) CPU.UpdateCR0<s64>(CPU.GPR[rd]);
}