x86/microVU: Fix VU1->VU0 register access in MTVU mode

eax wasn't being backed up, and in most cases it contains the address
we're loading from/storing to.
This commit is contained in:
Stenzek 2022-12-30 18:19:40 +10:00 committed by refractionpcsx2
parent 79764430d8
commit 4ea331ecf2
2 changed files with 6 additions and 3 deletions

View File

@ -135,8 +135,9 @@ void mvuGenerateWaitMTVU(mV)
if (!xRegister32::IsCallerSaved(i) || i == rsp.GetId()) if (!xRegister32::IsCallerSaved(i) || i == rsp.GetId())
continue; continue;
// no need to save temps // T1 often contains the address we're loading when waiting for VU1.
if (i == gprT1.GetId() || i == gprT2.GetId()) // T2 isn't used until afterwards, so don't bother saving it.
if (i == gprT2.GetId())
continue; continue;
xPUSH(xRegister64(i)); xPUSH(xRegister64(i));
@ -187,7 +188,7 @@ void mvuGenerateWaitMTVU(mV)
if (!xRegister32::IsCallerSaved(i) || i == rsp.GetId()) if (!xRegister32::IsCallerSaved(i) || i == rsp.GetId())
continue; continue;
if (i == gprT1.GetId() || i == gprT2.GetId()) if (i == gprT2.GetId())
continue; continue;
xPOP(xRegister64(i)); xPOP(xRegister64(i));

View File

@ -326,7 +326,9 @@ __fi void mVUaddrFix(mV, const xAddressReg& gprReg)
{ {
xMOV(gprT1, mVU.prog.cur->idx); // Note: Kernel does it via COP2 to initialize VU1! xMOV(gprT1, mVU.prog.cur->idx); // Note: Kernel does it via COP2 to initialize VU1!
xMOV(gprT2, xPC); // So we don't spam console, we'll only check micro-mode... xMOV(gprT2, xPC); // So we don't spam console, we'll only check micro-mode...
mVUbackupRegs(mVU, true, false);
xFastCall((void*)mVUwarningRegAccess, arg1regd, arg2regd); xFastCall((void*)mVUwarningRegAccess, arg1regd, arg2regd);
mVUrestoreRegs(mVU, true, false);
} }
#endif #endif
xFastCall((void*)mVU.waitMTVU); xFastCall((void*)mVU.waitMTVU);