From 0300f5a80e0e798730899598700884d916d3526d Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 25 Aug 2010 00:57:51 +0000 Subject: [PATCH] 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 --- pcsx2/x86/microVU_Compile.inl | 2 +- pcsx2/x86/microVU_Misc.inl | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index b725023fd1..cf3d0510e4 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -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); diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index 54c36d3a61..86c7e8490b 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -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();