Interpreter_Integer: Set the overflow flag if the OE bit is set for neg

Also amends the condition that was being checked. Previously it was
checking if the destination register value was 0x80000000, however it's
actually the source register that should be checked.
This commit is contained in:
Lioncash 2018-03-19 11:29:21 -04:00
parent 675d2fb774
commit 2fa0cb91a1
1 changed files with 5 additions and 6 deletions

View File

@ -580,16 +580,15 @@ void Interpreter::mullwx(UGeckoInstruction inst)
void Interpreter::negx(UGeckoInstruction inst)
{
rGPR[inst.RD] = (~rGPR[inst.RA]) + 1;
const u32 a = rGPR[inst.RA];
if (rGPR[inst.RD] == 0x80000000)
{
if (inst.OE)
PanicAlert("OE: negx");
}
rGPR[inst.RD] = (~a) + 1;
if (inst.Rc)
Helper_UpdateCR0(rGPR[inst.RD]);
if (inst.OE && a == 0x80000000)
SetXER_OV(true);
}
void Interpreter::subfx(UGeckoInstruction inst)