microVU: Implemented some undocumented stuff which lets Champions Return to Arms get in-game.

The game still looks ugly, I'm not sure if its problems are gsdx or pcsx2. zeroGS just renders a black screen which it no help xD

Note: I still need to optimize this fix.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1630 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-08-16 02:49:25 +00:00
parent 0efb1c534f
commit 1c37a9abf4
4 changed files with 20 additions and 7 deletions

View File

@ -83,11 +83,12 @@ public:
}
else { // Can do Simple Search (Only Matches the Important Pipeline Stuff)
for (int i = 0; i <= listI; i++) {
if ((linkI->block->pState.q == pState->q)
&& (linkI->block->pState.p == pState->p)
&& (linkI->block->pState.vi15 == pState->vi15)
&& (linkI->block->pState.flags == pState->flags)
&& (linkI->block->pState.xgkick == pState->xgkick)
if ((linkI->block->pState.q == pState->q)
&& (linkI->block->pState.p == pState->p)
&& (linkI->block->pState.vi15 == pState->vi15)
&& (linkI->block->pState.flags == pState->flags)
&& (linkI->block->pState.xgkick == pState->xgkick)
&& (linkI->block->pState.viBackUp == pState->viBackUp)
&& !(linkI->block->pState.needExactMatch & 5)) { return linkI->block; }
linkI = linkI->next;
}

View File

@ -356,10 +356,14 @@ microVUt(void) mVUanalyzeXGkick(mV, int Fs, int xCycles) {
microVUt(void) analyzeBranchVI(mV, int xReg, bool &infoVar) {
if (!xReg) return;
int i;
int iEnd = aMin(5, mVUcount);
int iEnd = aMin(5, (mVUcount+1));
int bPC = iPC;
incPC2(-2);
for (i = 0; i < iEnd; i++) {
if (i == mVUcount) {
if (mVUpBlock->pState.viBackUp == xReg) infoVar = 1;
break;
}
if ((mVUlow.VI_write.reg == xReg) && mVUlow.VI_write.used) {
if (mVUlow.readFlags || i == 5) break;
if (i == 0) { incPC2(-2); continue; }
@ -371,7 +375,7 @@ microVUt(void) analyzeBranchVI(mV, int xReg, bool &infoVar) {
}
if (i) {
incPC2(2);
mVUlow.backupVI = 1;
if (!infoVar) mVUlow.backupVI = 1;
iPC = bPC;
infoVar = 1;
DevCon::Status("microVU%d: Branch VI-Delay (%d) [%04x]", params getIndex, i, xPC);

View File

@ -162,6 +162,12 @@ microVUt(void) branchWarning(mV) {
Console::Error("microVU%d Warning: Branch in E-bit/Branch delay slot! [%04x]", params mVU->index, xPC);
mVUlow.isNOP = 1;
}
if (mVUinfo.isBdelay) { // Check if VI Reg Written to on Branch Delay
if (mVUlow.VI_write.reg && mVUlow.VI_write.used) {
mVUlow.backupVI = 1;
mVUregs.viBackUp = mVUlow.VI_write.reg;
}
}
}
// Optimizes the End Pipeline State Removing Unnecessary Info
@ -294,6 +300,7 @@ microVUt(void) mVUinitFirstPass(microVU* mVU, microBlock* &pBlock, uptr pState,
mVUblock.x86ptrStart = thisPtr;
pBlock = mVUblocks[mVUstartPC/2]->add(&mVUblock); // Add this block to block manager
mVUpBlock = pBlock;
mVUregs.viBackUp= 0;
mVUregs.flags = 0;
mVUflagInfo = 0;
mVUsFlagHack = CHECK_VU_FLAGHACK;

View File

@ -40,6 +40,7 @@ __declspec(align(16)) struct microRegInfo { // Ordered for Faster Compares
u8 p;
u8 r;
u8 xgkick;
u8 viBackUp;
u8 VI[16];
regInfo VF[32];
u8 flags; // clip x2 :: status x2