diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index 2a8411d4cf..d3557228e0 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -139,17 +139,63 @@ void _flushConstReg(int reg) void _flushConstRegs() { - int i; + int i, j; + int zero_cnt = 0, minusone_cnt = 0; + int eaxval = 1; // 0, -1 + unsigned long done[4] = {0, 0, 0, 0}; + u8* rewindPtr; // flush constants + // flush 0 and -1 first // ignore r0 - for(i = 1; i < 32; ++i) { - if( g_cpuHasConstReg & (1< 0) + XOR32RtoR(EAX, EAX), eaxval = 0; +#else + if (eaxval > 0) + MOV32ItoR(EAX, -1), eaxval = -1; +#endif + if (eaxval == 0) + NOT32R(EAX), eaxval = -1; + MOV32RtoM((uptr)&cpuRegs.GPR.r[i].SL[j], EAX); + done[j + 2] |= 1<