All pastes #1360780 Raw Edit

Untitled

public diff v1 · immutable
#1360780 ·published 2009-03-14 17:25 UTC
rendered paste body
Index: pcsx2/x86/iR3000A.cpp===================================================================--- pcsx2/x86/iR3000A.cpp	(revision 782)+++ pcsx2/x86/iR3000A.cpp	(working copy)@@ -805,12 +805,9 @@ { 	u32 blockCycles = psxScaleBlockCycles(); -	MOV32MtoR(ECX, (uptr)&psxRegs.cycle);-	MOV32MtoR(EAX, (uptr)&psxCycleEE);-	ADD32ItoR(ECX, blockCycles);-	SUB32ItoR(EAX, blockCycles*8);-	MOV32RtoM((uptr)&psxRegs.cycle, ECX); // update cycles-	MOV32RtoM((uptr)&psxCycleEE, EAX);+	ADD32ItoM((uptr)&psxRegs.cycle, blockCycles);+	SUB32ItoM((uptr)&psxCycleEE, blockCycles*8);+	MOV32MtoR(EAX, (uptr)&psxRegs.cycle);  	j8Ptr[2] = JG8( 0 );	// jump if psxCycleEE > 0 @@ -820,7 +817,7 @@ 	x86SetJ8( j8Ptr[2] );  	// check if an event is pending-	SUB32MtoR(ECX, (uptr)&g_psxNextBranchCycle);+	SUB32MtoR(EAX, (uptr)&g_psxNextBranchCycle); 	j8Ptr[0] = JS8( 0 );  	CALLFunc((uptr)psxBranchTest);Index: pcsx2/x86/ix86-32/iR5900-32.cpp===================================================================--- pcsx2/x86/ix86-32/iR5900-32.cpp	(revision 782)+++ pcsx2/x86/ix86-32/iR5900-32.cpp	(working copy)@@ -1143,10 +1143,9 @@ 	// Equiv code to: 	//    cpuRegs.cycle += blockcycles; 	//    if( cpuRegs.cycle > g_nextBranchCycle ) { DoEvents(); }-	MOV32MtoR(EAX, (uptr)&cpuRegs.cycle);-	ADD32ItoR(EAX, eeScaleBlockCycles());-	MOV32RtoM((uptr)&cpuRegs.cycle, EAX); // update cycles-	SUB32MtoR(EAX, (uptr)&g_nextBranchCycle);+	MOV32MtoR(EAX, (uptr)&g_nextBranchCycle);+	ADD32ItoM((uptr)&cpuRegs.cycle, eeScaleBlockCycles());+	CMP32RtoM((uptr)&cpuRegs.cycle, EAX);  	if (!noDispatch) { 		if (newpc == 0xffffffff)Index: pcsx2/x86/ix86/ix86.inl===================================================================--- pcsx2/x86/ix86/ix86.inl	(revision 781)+++ pcsx2/x86/ix86/ix86.inl	(working copy)@@ -2942,6 +2942,15 @@ 	write32<I>( MEMADDR(from, 4) );  } +/* cmp m32 to r32 */+emitterT void eCMP32RtoM( uptr to, x86IntRegType from ) +{+	RexR(0,to);+	write8<I>( 0x39 );+	ModRM<I>( 0, from, DISP32 );+	write32<I>( MEMADDR(to, 4) ); +}+ // cmp imm8 to [r32] emitterT void eCMP32I8toRm( x86IntRegType to, u8 from) {Index: pcsx2/x86/ix86/ix86_macros.h===================================================================--- pcsx2/x86/ix86/ix86_macros.h	(revision 781)+++ pcsx2/x86/ix86/ix86_macros.h	(working copy)@@ -354,6 +354,7 @@ #define CMP32ItoM eCMP32ItoM<_EmitterId_> #define CMP32RtoR eCMP32RtoR<_EmitterId_> #define CMP32MtoR eCMP32MtoR<_EmitterId_>+#define CMP32RtoM eCMP32RtoM<_EmitterId_> #define CMP32I8toRm eCMP32I8toRm<_EmitterId_> #define CMP32I8toRmOffset8 eCMP32I8toRmOffset8<_EmitterId_> #define CMP32I8toM eCMP32I8toM<_EmitterId_>