microVU: Preserve XGKIck cycles in delay slot

Also added handling for xgkick sync on single instructions
This commit is contained in:
refractionpcsx2 2021-11-21 16:06:17 +00:00
parent d88f638fbc
commit 0a79892923
1 changed files with 34 additions and 6 deletions

View File

@ -596,6 +596,18 @@ void* mVUcompileSingleInstruction(microVU& mVU, u32 startPC, uptr pState, microF
mVUopL(mVU, 0); mVUopL(mVU, 0);
incPC(1); incPC(1);
} }
if (!mVUlow.isKick)
{
mVUlow.kickcycles = 1 + mVUstall;
mVUregs.xgkickcycles = 0;
}
else
{
mVUregs.xgkickcycles = 0;
mVUlow.kickcycles = 0;
}
mVUsetCycles(mVU); mVUsetCycles(mVU);
mVUinfo.readQ = mVU.q; mVUinfo.readQ = mVU.q;
mVUinfo.writeQ = !mVU.q; mVUinfo.writeQ = !mVU.q;
@ -620,12 +632,19 @@ void* mVUcompileSingleInstruction(microVU& mVU, u32 startPC, uptr pState, microF
} }
mVUexecuteInstruction(mVU); mVUexecuteInstruction(mVU);
if (isVU1 && mVUlow.kickcycles && CHECK_XGKICKHACK)
{
mVU_XGKICK_SYNC(mVU, false);
}
mVUincCycles(mVU, 1); //Just incase the is XGKick mVUincCycles(mVU, 1); //Just incase the is XGKick
if (mVUinfo.doXGKICK) if (mVUinfo.doXGKICK)
{ {
mVU_XGKICK_DELAY(mVU); mVU_XGKICK_DELAY(mVU);
} }
mVUregs.xgkickcycles = 0;
return thisPtr; return thisPtr;
} }
@ -769,8 +788,11 @@ void* mVUcompile(microVU& mVU, u32 startPC, uptr pState)
} }
branchWarning(mVU); branchWarning(mVU);
mVUlow.kickcycles = mVUregs.xgkickcycles; if (mVUregs.xgkickcycles)
mVUregs.xgkickcycles = 0; {
mVUlow.kickcycles = mVUregs.xgkickcycles;
mVUregs.xgkickcycles = 0;
}
break; break;
} }
else if (branch == 1) else if (branch == 1)
@ -789,15 +811,21 @@ void* mVUcompile(microVU& mVU, u32 startPC, uptr pState)
if (mVUup.mBit && !branch && !mVUup.eBit) if (mVUup.mBit && !branch && !mVUup.eBit)
{ {
mVUregs.needExactMatch |= 7; mVUregs.needExactMatch |= 7;
mVUlow.kickcycles = mVUregs.xgkickcycles; if (mVUregs.xgkickcycles)
mVUregs.xgkickcycles = 0; {
mVUlow.kickcycles = mVUregs.xgkickcycles;
mVUregs.xgkickcycles = 0;
}
break; break;
} }
if (mVUinfo.isEOB) if (mVUinfo.isEOB)
{ {
mVUlow.kickcycles = mVUregs.xgkickcycles; if (mVUregs.xgkickcycles)
mVUregs.xgkickcycles = 0; {
mVUlow.kickcycles = mVUregs.xgkickcycles;
mVUregs.xgkickcycles = 0;
}
break; break;
} }