From a0bc6d33bbeadd6c5d464ab477d263fc8031bb72 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Tue, 23 Jun 2009 01:54:33 +0000 Subject: [PATCH] microVU: fixed a problem introduced in r1304 (fixes bios memcard viewer hanging, tekken 5, and probably a lot more...) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1421 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Analyze.inl | 67 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/pcsx2/x86/microVU_Analyze.inl b/pcsx2/x86/microVU_Analyze.inl index abec8bcda8..cd9d47b659 100644 --- a/pcsx2/x86/microVU_Analyze.inl +++ b/pcsx2/x86/microVU_Analyze.inl @@ -345,45 +345,44 @@ microVUt(void) mVUanalyzeXGkick(mV, int Fs, int xCycles) { // Branches - Branch Opcodes //------------------------------------------------------------------ -#define analyzeBranchVI(xReg, infoVar) { \ - if (xReg) { \ - int i; \ - int iEnd = aMin(5, mVUcount); \ - int bPC = iPC; \ - for (i = 0; i < iEnd; i++) { \ - incPC2(-2) \ - if ((mVUlow.VI_write.reg == xReg) && mVUlow.VI_write.used) { \ - if (mVUlow.readFlags || i == 5) break; \ - if (i == 0) continue; \ - if (((mVUlow.VI_read[0].reg == xReg) && (mVUlow.VI_read[0].used)) \ - || ((mVUlow.VI_read[1].reg == xReg) && (mVUlow.VI_read[1].used))) \ - { continue; } \ - } \ - break; \ - } \ - if (i) { \ - DevCon::Status("microVU%d: Branch VI-Delay (%d)", params getIndex, i); \ - incPC2(2); \ - mVUlow.backupVI = 1; \ - iPC = bPC; \ - infoVar = 1; \ - } \ - iPC = bPC; \ - } \ +microVUt(void) analyzeBranchVI(mV, int xReg, bool &infoVar) { + if (!xReg) return; + int i; + int iEnd = aMin(5, mVUcount); + int bPC = iPC; + incPC2(-2); + for (i = 0; i < iEnd; i++) { + if ((mVUlow.VI_write.reg == xReg) && mVUlow.VI_write.used) { + if (mVUlow.readFlags || i == 5) break; + if (i == 0) { incPC2(-2); continue; } + if (((mVUlow.VI_read[0].reg == xReg) && (mVUlow.VI_read[0].used)) + || ((mVUlow.VI_read[1].reg == xReg) && (mVUlow.VI_read[1].used))) + { incPC2(-2); continue; } + } + break; + } + if (i) { + incPC2(2); + mVUlow.backupVI = 1; + iPC = bPC; + infoVar = 1; + DevCon::Status("microVU%d: Branch VI-Delay (%d) [%04x]", params getIndex, i, xPC); + } + iPC = bPC; } microVUt(void) mVUanalyzeBranch1(mV, int Is) { - if (mVUregs.VI[Is] || mVUstall) { analyzeVIreg1(Is, mVUlow.VI_read[0]); } - else { analyzeBranchVI(Is, mVUlow.memReadIs); } + analyzeVIreg1(Is, mVUlow.VI_read[0]); + if (!mVUstall) { + analyzeBranchVI(mVU, Is, mVUlow.memReadIs); + } } microVUt(void) mVUanalyzeBranch2(mV, int Is, int It) { - if (mVUregs.VI[Is] || mVUregs.VI[It] || mVUstall) { - analyzeVIreg1(Is, mVUlow.VI_read[0]); - analyzeVIreg1(It, mVUlow.VI_read[1]); - } - else { - analyzeBranchVI(Is, mVUlow.memReadIs); - analyzeBranchVI(It, mVUlow.memReadIt); + analyzeVIreg1(Is, mVUlow.VI_read[0]); + analyzeVIreg1(It, mVUlow.VI_read[1]); + if (!mVUstall) { + analyzeBranchVI(mVU, Is, mVUlow.memReadIs); + analyzeBranchVI(mVU, It, mVUlow.memReadIt); } }