Fix bug in interpreter's lswx. Was overwriting extra register.
When n was a multiple of 4, the old implementation would overwrite the following register with 0. This was causing Not64 to crash. Thanks to Extrems for spotting this.
This commit is contained in:
parent
0fbf72cbf1
commit
5b47635b3f
|
@ -509,7 +509,7 @@ void Interpreter::lswx(UGeckoInstruction _inst)
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
rGPR[r] = 0;
|
rGPR[r] = 0;
|
||||||
do
|
while (true)
|
||||||
{
|
{
|
||||||
u32 TempValue = PowerPC::Read_U8(EA) << (24 - i);
|
u32 TempValue = PowerPC::Read_U8(EA) << (24 - i);
|
||||||
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
|
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
|
||||||
|
@ -520,8 +520,10 @@ void Interpreter::lswx(UGeckoInstruction _inst)
|
||||||
}
|
}
|
||||||
rGPR[r] |= TempValue;
|
rGPR[r] |= TempValue;
|
||||||
|
|
||||||
|
if (--n == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
EA++;
|
EA++;
|
||||||
n--;
|
|
||||||
i += 8;
|
i += 8;
|
||||||
if (i == 32)
|
if (i == 32)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +531,7 @@ void Interpreter::lswx(UGeckoInstruction _inst)
|
||||||
r = (r + 1) & 31;
|
r = (r + 1) & 31;
|
||||||
rGPR[r] = 0;
|
rGPR[r] = 0;
|
||||||
}
|
}
|
||||||
} while (n > 0);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue