microVU: Took me about 5 hours to figure out the problem, but finally fixed the problem with Sly Cooper running at 1 fps with mVU...

The problem was that the game does a branch in a branch delay slot, and mVU wasn't setting some pipeline state variable in this case correctly.
This in turn caused the pipeline state comparison for the block to always be wrong, which meant a new block would always be recompiled whenever this specific block was to be executed.
This ended up happening 1000's of times slowing down the game to 1 fps...


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3266 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-06-22 08:56:40 +00:00
parent 2ecfe10b7a
commit a5208c4227
2 changed files with 10 additions and 5 deletions

View File

@ -102,9 +102,14 @@ public:
if (listI < 7) return;
microBlockLink* linkI = &blockList;
for (int i = 0; i <= listI; i++) {
DevCon.WriteLn( Color_Green, "[%04x][Block #%d][q=%02d][p=%02d][xgkick=%d][vi15=%08x][viBackup=%02d][flags=%02x][exactMatch=%x]",
pc, i, linkI->block->pState.q, linkI->block->pState.p, linkI->block->pState.xgkick, linkI->block->pState.vi15,
linkI->block->pState.viBackUp, linkI->block->pState.flags, linkI->block->pState.needExactMatch);
u32 viCRC = 0, vfCRC = 0, crc = 0, z = sizeof(microRegInfo)/4;
for (u32 j = 0; j < 4; j++) viCRC -= ((u32*)linkI->block->pState.VI)[j];
for (u32 j = 0; j < 32; j++) vfCRC -= linkI->block->pState.VF[j].reg;
for (u32 j = 0; j < z; j++) crc -= ((u32*)&linkI->block->pState)[j];
DevCon.WriteLn(Color_Green, "[%04x][Block #%d][crc=%08x][q=%02d][p=%02d][xgkick=%d][vi15=%08x][viBackup=%02d]"
"[flags=%02x][exactMatch=%x][blockType=%d][viCRC=%08x][vfCRC=%08x]", pc, i, crc, linkI->block->pState.q,
linkI->block->pState.p, linkI->block->pState.xgkick, linkI->block->pState.vi15, linkI->block->pState.viBackUp,
linkI->block->pState.flags, linkI->block->pState.needExactMatch, linkI->block->pState.blockType, viCRC, vfCRC);
linkI = linkI->next;
}
}

View File

@ -350,11 +350,11 @@ _f void mVUinitFirstPass(microVU* mVU, uptr pState, u8* thisPtr) {
memcpy_const((u8*)&mVU->prog.lpState, (u8*)pState, sizeof(microRegInfo));
}
mVUblock.x86ptrStart = thisPtr;
mVUpBlock = mVUblocks[mVUstartPC/2]->add(&mVUblock); // Add this block to block manager
mVUpBlock = mVUblocks[mVUstartPC/2]->add(&mVUblock); // Add this block to block manager
mVUregs.needExactMatch =(mVUregs.blockType || noFlagOpts) ? 7 : 0; // 1-Op blocks should just always set exactMatch (Sly Cooper)
mVUregs.blockType = 0;
mVUregs.viBackUp = 0;
mVUregs.flags = 0;
mVUregs.needExactMatch = 0;
mVUsFlagHack = CHECK_VU_FLAGHACK;
mVUinitConstValues(mVU);
}