All pastes #1927128 Raw Edit

Unnamed

public cpp v1 · immutable
#1927128 ·published 2010-08-27 20:30 UTC
rendered paste body
Index: pcsx2/VUops.cpp===================================================================--- pcsx2/VUops.cpp	(revision 3696)+++ pcsx2/VUops.cpp	(working copy)@@ -1579,7 +1579,7 @@ __fi u32* GET_VU_MEM(VURegs* VU, u32 addr)		// non-static, also used by sVU for now. { 	if( VU == &vuRegs[1] ) return (u32*)(vuRegs[1].Mem+(addr&0x3fff));-	if( addr >= 0x4000 ) return (u32*)(vuRegs[0].Mem+(addr&0x43f0)); // get VF and VI regs (they're mapped to 0x4xx0 in VU0 mem!)+	if( addr & 0x4000 ) return (u32*)(vuRegs[1].VF+(addr&0x3f0)); // get VF and VI regs (they're mapped to 0x4xx0 in VU0 mem!) 	return (u32*)(vuRegs[0].Mem+(addr&0x0fff)); // for addr 0x0000 to 0x4000 just wrap around } Index: pcsx2/x86/microVU_Misc.inl===================================================================--- pcsx2/x86/microVU_Misc.inl	(revision 3696)+++ pcsx2/x86/microVU_Misc.inl	(working copy)@@ -224,8 +224,11 @@ 		xSHL(gprReg, 4); 	} 	else {-		xCMP(gprReg, 0x400);-		xForwardJL8 jmpA; // if addr >= 0x4000, reads VU1's VF regs and VI regs+		xTEST(gprReg, 0x400);+		xForwardJNZ8 jmpA; // if addr & 0x4000, reads VU1's VF regs and VI regs+			xAND(gprReg, 0xff); // if !(addr & 0x4000), wrap around+			xForwardJump8 jmpB;+		jmpA.SetTarget(); 			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...@@ -236,10 +239,8 @@ 				xPOP(gprT2); 				xPOP(gprT1); 			}-			xAND(gprReg, 0x43f); // ToDo: theres a potential problem if VU0 overrides VU1's VF0/VI0 regs!-			xForwardJump8 jmpB;-		jmpA.SetTarget();-			xAND(gprReg, 0xff); // if addr < 0x4000, wrap around+			xAND(gprReg, 0x3f); // ToDo: theres a potential problem if VU0 overrides VU1's VF0/VI0 regs!+			xADD(gprReg, (u128*)VU1.VF - (u128*)VU0.Mem); 		jmpB.SetTarget(); 		xSHL(gprReg, 4); // multiply by 16 (shift left by 4) 	}