diff --git a/Source/Core/Core/Src/Debugger/DebugInterface.h b/Source/Core/Core/Src/Debugger/DebugInterface.h index 223b60bf42..819f69073a 100644 --- a/Source/Core/Core/Src/Debugger/DebugInterface.h +++ b/Source/Core/Core/Src/Debugger/DebugInterface.h @@ -9,7 +9,7 @@ protected: virtual ~DebugInterface() {} public: virtual void disasm(unsigned int /*address*/, char *dest, int max_size) {strcpy(dest, "NODEBUGGER");} - virtual void getRawMemoryString(unsigned int /*address*/, char *dest, int max_size) {strcpy(dest, "NODEBUGGER");} + virtual void getRawMemoryString(unsigned int /*address*/, char *dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");} virtual int getInstructionSize(int /*instruction*/) {return 1;} virtual bool isAlive() {return true;} diff --git a/Source/Core/Core/Src/HW/CPUCompare.cpp b/Source/Core/Core/Src/HW/CPUCompare.cpp index 96a85e64e5..d0de2436e2 100644 --- a/Source/Core/Core/Src/HW/CPUCompare.cpp +++ b/Source/Core/Core/Src/HW/CPUCompare.cpp @@ -172,7 +172,7 @@ int Sync() } } } - if (PowerPC::ppcState.cr != state.cr) + if (GetCR() != state.cr) { LOG(GEKKO, "DIFFERENCE - CR (local %08x, remote %08x)", PowerPC::ppcState.cr, state.cr); difference = true; diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp index bdbfef0fe6..7ef208a121 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -23,33 +23,30 @@ namespace Interpreter void Helper_UpdateCR0(u32 _uValue) { - u32 Flags = 0; + u32 new_cr0; int sValue = (int)_uValue; if (sValue > 0) - Flags |= 0x40000000; + new_cr0 = 0x4; else if (sValue < 0) - Flags |= 0x80000000; + new_cr0 = 0x8; else - Flags |= 0x20000000; - Flags |= PowerPC::ppcState.spr[SPR_XER*4] & 0x10000000; - PowerPC::ppcState.cr = (PowerPC::ppcState.cr & 0xFFFFFFF) | Flags; + new_cr0 = 0x2; + new_cr0 |= GetXER_SO(); + SetCRField(0, new_cr0); } void Helper_UpdateCRx(int _x, u32 _uValue) { - int shiftamount = _x*4; - int crmask = 0xFFFFFFFF ^ (0xF0000000 >> shiftamount); - - u32 Flags = 0; + u32 new_crX; int sValue = (int)_uValue; if (sValue > 0) - Flags |= 0x40000000; + new_crX = 0x4; else if (sValue < 0) - Flags |= 0x80000000; + new_crX = 0x8; else - Flags |= 0x20000000; - Flags |= PowerPC::ppcState.spr[SPR_XER*4] & 0x10000000; - PowerPC::ppcState.cr = (PowerPC::ppcState.cr & crmask) | (Flags >> shiftamount); + new_crX = 0x2; + new_crX |= GetXER_SO(); + SetCRField(_x, new_crX); } u32 Helper_Carry(u32 _uValue1, u32 _uValue2) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_SystemRegisters.cpp index 4a1cf30ab9..68c9474146 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_SystemRegisters.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_SystemRegisters.cpp @@ -160,6 +160,7 @@ namespace Jit64 void mfcr(UGeckoInstruction inst) { + // USES_CR int d = inst.RD; gpr.LoadToX64(d, false, true); MOV(32, gpr.R(d), M(&PowerPC::ppcState.cr)); @@ -167,6 +168,7 @@ namespace Jit64 void mtcrf(UGeckoInstruction inst) { + // USES_CR u32 mask = 0; u32 crm = inst.CRM; gpr.FlushLockX(ECX); diff --git a/Source/Core/Core/Src/Tracer.cpp b/Source/Core/Core/Src/Tracer.cpp index 74bf3610d6..640ed27259 100644 --- a/Source/Core/Core/Src/Tracer.cpp +++ b/Source/Core/Core/Src/Tracer.cpp @@ -97,7 +97,7 @@ int SyncTrace() } }*/ /* - if (PowerPC::ppcState.cr != state.cr) + if (GetCR() != state.cr) { LOG(GEKKO, "DIFFERENCE - CR (local %08x, remote %08x)", PowerPC::ppcState.cr, state.cr); difference = true;