From e248cf8cf00d02c5cc4941516383ca7eb4eb3917 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Sat, 14 Mar 2009 00:21:35 +0000 Subject: [PATCH] Grandia 2 is playable again. The old block manager was incorrectly clearing a block which didn't need clearing and thus masking this constprop bug. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@774 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900Move.cpp | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900Move.cpp b/pcsx2/x86/ix86-32/iR5900Move.cpp index 8554f58eee..76348682b7 100644 --- a/pcsx2/x86/ix86-32/iR5900Move.cpp +++ b/pcsx2/x86/ix86-32/iR5900Move.cpp @@ -425,12 +425,9 @@ void recMTLO1( void ) //// MOVZ void recMOVZtemp_const() { - GPR_DEL_CONST(_Rd_); - _deleteEEreg(_Rd_, 1); - _eeOnWriteReg(_Rd_, 0); if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rs_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rs_].UL[1]); + g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; + g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; } } @@ -546,21 +543,14 @@ void recMOVZ() if( _Rs_ == _Rd_ ) return; + // aren't the templates meant to take care of this kind of thing? if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { // remove the const, since move is conditional _deleteEEreg(_Rd_, 0); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); } - else { - if (g_cpuConstRegs[_Rt_].UD[0] == 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } - return; - } } recMOVZtemp(); @@ -569,12 +559,9 @@ void recMOVZ() //// MOVN void recMOVNtemp_const() { - GPR_DEL_CONST(_Rd_); - _deleteEEreg(_Rd_, 1); - _eeOnWriteReg(_Rd_, 0); if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rs_].UL[0]); - MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rs_].UL[1]); + g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; + g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; } } @@ -686,20 +673,12 @@ void recMOVN() return; if( GPR_IS_CONST1(_Rd_) ) { - if( !GPR_IS_CONST2(_Rs_, _Rt_) ) { // remove the const, since move is conditional _deleteEEreg(_Rd_, 0); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[0], g_cpuConstRegs[_Rd_].UL[0]); MOV32ItoM((uptr)&cpuRegs.GPR.r[_Rd_].UL[1], g_cpuConstRegs[_Rd_].UL[1]); } - else { - if (g_cpuConstRegs[_Rt_].UD[0] != 0) { - g_cpuConstRegs[_Rd_].UL[0] = g_cpuConstRegs[_Rs_].UL[0]; - g_cpuConstRegs[_Rd_].UL[1] = g_cpuConstRegs[_Rs_].UL[1]; - } - return; - } } recMOVNtemp();