microVU: Fixed bug in E-bit conditional branches. Fixes DT Racer

GameDB: Added VU0 Kickstart hack for DT Racer
This commit is contained in:
refractionpcsx2 2020-10-25 21:41:29 +00:00
parent 418974a28a
commit 0448b4902c
2 changed files with 13 additions and 6 deletions

View File

@ -15658,6 +15658,7 @@ Serial = SLES-53904
Name = DT Racer
Region = PAL-M5
GIFFIFOHack = 1 // Fixes corrupted graphics in the menus.
VU0KickstartHack = 1 // Fixes TLB misses and collision bugs
---------------------------------------------
Serial = SLES-53906
Name = 50cent - Bulletproof
@ -40481,6 +40482,7 @@ Name = DT Racer
Region = NTSC-U
Compat = 5
GIFFIFOHack = 1 // Fixes corrupted graphics in the menus.
VU0KickstartHack = 1 // Fixes TLB misses and collision bugs
---------------------------------------------
Serial = SLUS-21096
Name = Ape Escape - Pumped & Primed

View File

@ -365,6 +365,7 @@ void condBranch(mV, microFlagCycles& mFC, int JMPcc) {
if (mVUup.tBit)
{
DevCon.Warning("T-Bit on branch, please report if broken");
u32 tempPC = iPC;
xTEST(ptr32[&VU0.VI[REG_FBRST].UL], (isVU1 ? 0x800 : 0x8));
xForwardJump32 eJMP(Jcc_Zero);
@ -405,26 +406,30 @@ void condBranch(mV, microFlagCycles& mFC, int JMPcc) {
eJMP.SetTarget();
iPC = tempPC;
}
xCMP(ptr16[&mVU.branch], 0);
if (mVUup.eBit) { // Conditional Branch With E-Bit Set
if(mVUlow.evilBranch)
DevCon.Warning("End on evil branch! - Not implemented! - If game broken report to PCSX2 Team");
incPC(3);
mVUendProgram(mVU, &mFC, 2);
xForwardJump32 eJMP(xInvertCond((JccComparisonType)JMPcc));
xCMP(ptr16[&mVU.branch], 0);
incPC(3);
xForwardJump32 eJMP(((JccComparisonType)JMPcc));
incPC(1); // Set PC to First instruction of Non-Taken Side
xMOV(ptr32[&mVU.regs().VI[REG_TPC].UL], xPC);
xJMP(mVU.exitFunct);
eJMP.SetTarget();
eJMP.SetTarget();
incPC(-4); // Go Back to Branch Opcode to get branchAddr
iPC = branchAddr(mVU)/4;
xMOV(ptr32[&mVU.regs().VI[REG_TPC].UL], xPC);
xJMP(mVU.exitFunct);
return;
}
else { // Normal Conditional Branch
xCMP(ptr16[&mVU.branch], 0);
incPC(3);
if(mVUlow.evilBranch) //We are dealing with an evil evil block, so we need to process this slightly differently
{