diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index 02c6d7f1c8..4b53ab8846 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -161,6 +161,8 @@ template __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; diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index 4b4361a70e..6beb36a75a 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -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; } diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 69af6b2158..f44e11501a 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -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); } } }