/[pcsx2_0.9.7]/trunk/pcsx2/x86/microVU_Compile.inl
ViewVC logotype

Diff of /trunk/pcsx2/x86/microVU_Compile.inl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/pcsx2/x86/microVU_Compile.inl	2010/09/07 11:08:22	62
+++ trunk/pcsx2/x86/microVU_Compile.inl	2010/12/23 12:02:12	280
@@ -109,7 +109,7 @@
 		mVU->regAlloc->clearRegVF(33);
 
 		if (CHECK_VU_OVERFLOW && ((curI & 0x7fffffff) >= 0x7f800000)) {
-			Console.WriteLn(Color_Green,"microVU%d: Clamping I Reg", mVU->index);
+			DevCon.WriteLn(Color_Green,"microVU%d: Clamping I Reg", mVU->index);
 			tempI = (0x80000000 & curI) | 0x7f7fffff; // Clamp I Reg
 		}
 		else tempI = curI;
@@ -372,7 +372,7 @@
 
 // This gets run at the start of every loop of mVU's first pass
 static __fi void startLoop(mV) {
-	if (curI & _Mbit_)	{ Console.WriteLn(Color_Green, "microVU%d: M-bit set!", getIndex); }
+	if (curI & _Mbit_)	{ DevCon.WriteLn (Color_Green, "microVU%d: M-bit set!", getIndex); }
 	if (curI & _Dbit_)	{ DevCon.WriteLn (Color_Green, "microVU%d: D-bit set!", getIndex); }
 	if (curI & _Tbit_)	{ DevCon.WriteLn (Color_Green, "microVU%d: T-bit set!", getIndex); }
 	memzero(mVUinfo);
@@ -513,7 +513,19 @@
 }
 
 // mVUcompileJIT() - Called By JR/JALR during execution
-_mVUt void* __fastcall mVUcompileJIT(u32 startPC, uptr pState) {
-	//return mVUblockFetch(mVUx, startPC, pState);
-	return mVUsearchProg<vuIndex>(startPC, pState); // Find and set correct program
+_mVUt void* __fastcall mVUcompileJIT(u32 startPC, uptr ptr) {
+	if (doJumpCaching) { // When doJumpCaching, ptr is a microBlock pointer
+		microVU* mVU = mVUx;
+		microBlock* pBlock = (microBlock*)ptr;
+		microJumpCache& jc = pBlock->jumpCache[startPC/8];
+		if (jc.prog && jc.prog == mVU->prog.quick[startPC/8].prog) return jc.x86ptrStart;
+		void* v = mVUsearchProg<vuIndex>(startPC, (uptr)&pBlock->pStateEnd);
+		jc.prog = mVU->prog.quick[startPC/8].prog;
+		jc.x86ptrStart = v;
+		return v;
+	}
+	else { // When !doJumpCaching, pBlock param is really a microRegInfo pointer
+		//return mVUblockFetch(mVUx, startPC, ptr);
+		return mVUsearchProg<vuIndex>(startPC, ptr); // Find and set correct program
+	}
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22