VU: Copy CLIP flag instance back to VU0 int and microVU when COP2 modifies it

Fixes Soul Calibur 3 hair
This commit is contained in:
refractionpcsx2 2020-09-10 11:52:47 +01:00
parent 27598fecce
commit 19ab48c280
2 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,8 @@ void __fastcall vu0ExecMicro(u32 addr) {
vu0Finish();
}
// Need to copy the clip flag back to the interpreter in case COP2 has edited it
VU0.clipflag = VU0.VI[REG_CLIP_FLAG].UL;
VU0.VI[REG_VPU_STAT].UL &= ~0xFF;
VU0.VI[REG_VPU_STAT].UL |= 0x01;
VU0.cycle = cpuRegs.cycle;

View File

@ -109,6 +109,14 @@ __fi void mVUallocCFLAGb(mV, const x32& reg, int fInstance)
{
if (fInstance < 4) xMOV(ptr32[&mVU.clipFlag[fInstance]], reg); // microVU
else xMOV(ptr32[&mVU.regs().VI[REG_CLIP_FLAG].UL], reg); // macroVU
// On COP2 modifying the CLIP flag we need to update the microVU version for when it's restored on new program
if (fInstance == 0xff)
{
xMOVDZX(xmmT1, reg);
xSHUF.PS(xmmT1, xmmT1, 0);
xMOVAPS(ptr128[&mVU.regs().micro_clipflags], xmmT1);
}
}
//------------------------------------------------------------------