VU-JIT: Backup non cached VI before writing to it when load != write

This commit is contained in:
refractionpcsx2 2023-04-22 05:34:03 +01:00
parent 0e0d7a5441
commit 535ad110e3
1 changed files with 10 additions and 0 deletions

View File

@ -1025,7 +1025,17 @@ public:
// allocate a new register for writing to
int x = findFreeGPR(viWriteReg);
const xRegister32& gprX = xRegister32::GetInstance(x);
writeBackReg(gprX, true);
// writeReg not cached, needs backing up
if (backup && gprMap[x].VIreg != viWriteReg)
{
xMOVZX(gprX, ptr16[&getVI(viWriteReg)]);
writeVIBackup(gprX);
backup = false;
}
if (zext_if_dirty)
xMOVZX(gprX, xRegister16(i));
else