microVU: Found another bug with double branches, when there is a conditional in a JR/JALR delay slot it may have ended up in the wrong place. Unknown what it fixes, if anything.

VIF/Path3 Masking: Put a timing break in on Path2 transfers, this gives it chance to stop being busy incase it is closely followed by a path3 mask, which caused it to go out of time.  Fixes Sensible Soccer.

VIF: Fixed up a couple of typo's, which may or may not have done anything, one which was not setting an offset if it stalled on 1/4 of a quadword, which could have been disasterous if done by the wrong game.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5564 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction@gmail.com 2013-02-18 20:42:27 +00:00
parent c64c9a16ad
commit 8c86009a27
3 changed files with 22 additions and 15 deletions

View File

@ -161,6 +161,8 @@ template<int idx> __fi int _vifCode_Direct(int pass, const u8* data, bool isDire
if (vif1.tag.size == 0) {
vif1.cmd = 0;
vif1.pass = 0;
vif1.vifstalled.enabled = true;
vif1.vifstalled.value = VIF_TIMING_BREAK;
}
return ret / 4;
}
@ -188,12 +190,12 @@ vifOp(vifCode_Flush) {
GUNIT_WARN("Vif Flush: Stall!");
//gifUnit.PrintInfo();
vif1Regs.stat.VGW = true;
vifX.vifstalled.enabled = true;
vifX.vifstalled.value = VIF_TIMING_BREAK;
vif1.vifstalled.enabled = true;
vif1.vifstalled.value = VIF_TIMING_BREAK;
return 0;
}
else vifX.cmd = 0;
vifX.pass = 0;
else vif1.cmd = 0;
vif1.pass = 0;
}
pass3 { VifCodeLog("Flush"); }
return 1;
@ -213,8 +215,8 @@ vifOp(vifCode_FlushA) {
{
GUNIT_WARN("Vif FlushA: Stall!");
vif1Regs.stat.VGW = true;
vifX.vifstalled.enabled = true;
vifX.vifstalled.value = VIF_TIMING_BREAK;
vif1.vifstalled.enabled = true;
vif1.vifstalled.value = VIF_TIMING_BREAK;
return 0;
//gifUnit.PrintInfo();
@ -240,8 +242,8 @@ vifOp(vifCode_FlushA) {
}
else*/
//Didn't need to stall!
vifX.cmd = 0;
vifX.pass = 0;
vif1.cmd = 0;
vif1.pass = 0;
}
pass3 { VifCodeLog("FlushA"); }
return 1;

View File

@ -107,9 +107,9 @@ _vifT static __fi bool vifTransfer(u32 *data, int size, bool TTE) {
}
else
{
if(vifX.irqoffset.value > 1)
if(vifX.irqoffset.value != 0){
vifX.irqoffset.enabled = true;
else
}else
vifX.irqoffset.enabled = false;
}

View File

@ -1245,7 +1245,7 @@ void setBranchA(mP, int x, int _x_) {
void condEvilBranch(mV, int JMPcc) {
if (mVUlow.badBranch) {
xMOV(ptr32[&mVU.branch], gprT1);
xMOV(ptr32[&mVU.badBranch], branchAddr);
xMOV(ptr32[&mVU.badBranch], branchAddrN);
xCMP(gprT1b, 0);
xForwardJump8 cJMP((JccComparisonType)JMPcc);
@ -1261,6 +1261,9 @@ void condEvilBranch(mV, int JMPcc) {
xMOV(gprT1, ptr32[&mVU.badBranch]); // Branch Not Taken
xMOV(ptr32[&mVU.evilBranch], gprT1);
cJMP.SetTarget();
incPC(-2);
if(mVUlow.branch >= 9) DevCon.Warning("Conditional in JALR/JR delay slot - If game broken report to PCSX2 Team");
incPC(2);
}
mVUop(mVU_B) {
@ -1284,7 +1287,7 @@ mVUop(mVU_BAL) {
mVUallocVIb(mVU, gprT1, _It_);
}
if (mVUlow.badBranch) { xMOV(ptr32[&mVU.badBranch], branchAddr); }
if (mVUlow.badBranch) { xMOV(ptr32[&mVU.badBranch], branchAddrN); }
if (mVUlow.evilBranch) { xMOV(ptr32[&mVU.evilBranch], branchAddr);}
mVU.profiler.EmitOp(opBAL);
}
@ -1382,9 +1385,11 @@ void normJumpPass2(mV) {
mVUallocVIa(mVU, gprT1, _Is_);
xSHL(gprT1, 3);
xAND(gprT1, mVU.microMemSize - 8);
if (!mVUlow.evilBranch) xMOV(ptr32[&mVU.branch], gprT1);
else { xMOV(ptr32[&mVU.evilBranch], gprT1);}
if (!mVUlow.evilBranch) { xMOV(ptr32[&mVU.branch], gprT1 ); }
else { xMOV(ptr32[&mVU.evilBranch], gprT1 ); }
//If delay slot is conditional, it uses badBranch to go to its target
if (mVUlow.badBranch) { xADD(gprT1, 8); xMOV(ptr32[&mVU.badBranch], gprT1); }
}
}