microVU: Added some logs to dev builds for checking rare cases. (VU programs that wrap around VU memory, and VU0 micro-programs that access VU1's registers by its mem-mapping at 0x4xxx)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3688 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-08-25 00:57:51 +00:00
parent d19cc9d951
commit 0300f5a80e
2 changed files with 14 additions and 1 deletions

View File

@ -99,7 +99,7 @@ static void mVUsetupRange(microVU* mVU, s32 pc, bool isStartPC) {
}
}
else {
//DevCon.WriteLn(Color_Green, "microVU%d: Prog Range Wrap [%04x] [%d]", mVU->index, mVUrange.start, mVUrange.end);
DevCon.WriteLn(Color_Green, "microVU%d: Prog Range Wrap [%04x] [%d]", mVU->index, mVUrange.start, mVUrange.end);
mVUrange.end = mVU->microMemSize;
microRange mRange = {0, pc};
ranges->push_front(mRange);

View File

@ -213,6 +213,9 @@ void mVUmergeRegs(const xmm& dest, const xmm& src, int xyzw, bool modXYZW)
// Micro VU - Misc Functions
//------------------------------------------------------------------
// Gets called by mVUaddrFix at execution-time
static void __fastcall mVUwarningRegAccess(mV) { Console.Error("microVU0 Warning: Accessing VU1 Regs! [%04x] [%x]", xPC, mVU->prog.cur); }
// Transforms the Address in gprReg to valid VU0/VU1 Address
__fi void mVUaddrFix(mV, const x32& gprReg)
{
@ -223,6 +226,16 @@ __fi void mVUaddrFix(mV, const x32& gprReg)
else {
xCMP(gprReg, 0x400);
xForwardJL8 jmpA; // if addr >= 0x4000, reads VU1's VF regs and VI regs
if (IsDevBuild && !isCOP2) { // Lets see which games do this!
xPUSH(gprT1); // Note: Kernel does it via COP2 to initialize VU1!
xPUSH(gprT2); // So we don't spam console, we'll only check micro-mode...
xPUSH(gprT3);
xMOV(gprT2, (uptr)mVU);
xCALL(mVUwarningRegAccess);
xPOP(gprT3);
xPOP(gprT2);
xPOP(gprT1);
}
xAND(gprReg, 0x43f); // ToDo: theres a potential problem if VU0 overrides VU1's VF0/VI0 regs!
xForwardJump8 jmpB;
jmpA.SetTarget();