diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index d00088f15..16cc6589b 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -5178,19 +5178,19 @@ void CX86RecompilerOps::SPECIAL_DMULTU() /* _RegLO->UDW += ((uint64)Tmp[0].UW[0] + (uint64)Tmp[1].UW[0]) << 32; */ /* [low+4] += ebx + esi */ - AddX86regToVariable(CX86Ops::x86_EBX, &_RegLO->UW[1], "_RegLO->UW[1]"); - AddX86regToVariable(CX86Ops::x86_ESI, &_RegLO->UW[1], "_RegLO->UW[1]"); + AddX86regToVariable(&_RegLO->UW[1], "_RegLO->UW[1]", CX86Ops::x86_EBX); + AddX86regToVariable(&_RegLO->UW[1], "_RegLO->UW[1]", CX86Ops::x86_ESI); /* _RegHI->UDW += (uint64)Tmp[0].UW[1] + (uint64)Tmp[1].UW[1] + Tmp[2].UW[1]; */ /* [hi] += ecx + edi + edx */ - AddX86regToVariable(CX86Ops::x86_ECX, &_RegHI->UW[0], "_RegHI->UW[0]"); + AddX86regToVariable(&_RegHI->UW[0], "_RegHI->UW[0]", CX86Ops::x86_ECX); AdcConstToVariable(&_RegHI->UW[1], "_RegHI->UW[1]", 0); - AddX86regToVariable(CX86Ops::x86_EDI, &_RegHI->UW[0], "_RegHI->UW[0]"); + AddX86regToVariable(&_RegHI->UW[0], "_RegHI->UW[0]", CX86Ops::x86_EDI); AdcConstToVariable(&_RegHI->UW[1], "_RegHI->UW[1]", 0); - AddX86regToVariable(CX86Ops::x86_EDX, &_RegHI->UW[0], "_RegHI->UW[0]"); + AddX86regToVariable(&_RegHI->UW[0], "_RegHI->UW[0]", CX86Ops::x86_EDX); AdcConstToVariable(&_RegHI->UW[1], "_RegHI->UW[1]", 0); #endif } diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp index 7528ca675..322c694e7 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp @@ -107,7 +107,7 @@ void CX86Ops::AddVariableToX86reg(x86Reg Reg, void * Variable, const char * Vari AddCode32((uint32_t)Variable); } -void CX86Ops::AddX86regToVariable(x86Reg Reg, void * Variable, const char * VariableName) +void CX86Ops::AddX86regToVariable(void * Variable, const char * VariableName, x86Reg Reg) { CodeLog(" add dword ptr [%s], %s", VariableName, x86_Name(Reg)); AddCode16((uint16_t)(0x0501 + (Reg * 0x800))); diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h index eb7b0a4e7..45dec7e52 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h @@ -71,7 +71,7 @@ public: void AddConstToVariable(void * Variable, const char * VariableName, uint32_t Const); void AddConstToX86Reg(x86Reg Reg, uint32_t Const, bool NeedCarry = false); void AddVariableToX86reg(x86Reg Reg, void * Variable, const char * VariableName); - void AddX86regToVariable(x86Reg Reg, void * Variable, const char * VariableName); + void AddX86regToVariable(void * Variable, const char * VariableName, x86Reg Reg); void AddX86RegToX86Reg(x86Reg Destination, x86Reg Source); void AndConstToVariable(uint32_t Const, void * Variable, const char * VariableName); void AndConstToX86Reg(x86Reg Reg, uint32_t Const);