From eb5d0ce3631fc9694689b8cdbd9bc78af83cfa02 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 7 Nov 2022 14:05:08 +1030 Subject: [PATCH] Core: rearrange MoveSxVariableToX86regByte parameters --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 6 +++--- Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp | 2 +- Source/Project64-core/N64System/Recompiler/x86/x86ops.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 05ead011f..e1ee52746 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -2875,7 +2875,7 @@ void CX86RecompilerOps::LB_KnownAddress(CX86Ops::x86Reg Reg, uint32_t VAddr, boo { if (SignExtend) { - m_Assembler.MoveSxVariableToX86regByte((PAddr ^ 3) + g_MMU->Rdram(), stdstr_f("RDRAM + (%X ^ 3)", PAddr).c_str(), Reg); + m_Assembler.MoveSxVariableToX86regByte(Reg, (PAddr ^ 3) + g_MMU->Rdram(), stdstr_f("RDRAM + (%X ^ 3)", PAddr).c_str()); } else { @@ -2892,7 +2892,7 @@ void CX86RecompilerOps::LB_KnownAddress(CX86Ops::x86Reg Reg, uint32_t VAddr, boo { if (SignExtend) { - m_Assembler.MoveSxVariableToX86regByte(((PAddr ^ 3) - 0x04000000) + g_MMU->Dmem(), stdstr_f("Dmem + (%X ^ 3)", (PAddr - 0x04000000)).c_str(), Reg); + m_Assembler.MoveSxVariableToX86regByte(Reg, ((PAddr ^ 3) - 0x04000000) + g_MMU->Dmem(), stdstr_f("Dmem + (%X ^ 3)", (PAddr - 0x04000000)).c_str()); } else { @@ -2903,7 +2903,7 @@ void CX86RecompilerOps::LB_KnownAddress(CX86Ops::x86Reg Reg, uint32_t VAddr, boo { if (SignExtend) { - m_Assembler.MoveSxVariableToX86regByte(((PAddr ^ 3) - 0x04001000) + g_MMU->Imem(), stdstr_f("Imem + (%X ^ 3)", (PAddr - 0x04001000)).c_str(), Reg); + m_Assembler.MoveSxVariableToX86regByte(Reg, ((PAddr ^ 3) - 0x04001000) + g_MMU->Imem(), stdstr_f("Imem + (%X ^ 3)", (PAddr - 0x04001000)).c_str()); } else { diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp index d9cf1414c..d3a25ecd2 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp @@ -1016,7 +1016,7 @@ void CX86Ops::MoveSxHalfX86regPointerToX86reg(x86Reg Reg, x86Reg AddrReg1, x86Re AddCode8(Param); } -void CX86Ops::MoveSxVariableToX86regByte(void * Variable, const char * VariableName, x86Reg Reg) +void CX86Ops::MoveSxVariableToX86regByte(x86Reg Reg, void * Variable, const char * VariableName) { CodeLog(" movsx %s, byte ptr [%s]", x86_Name(Reg), VariableName); diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h index ec8e29635..34378fc6e 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h @@ -138,7 +138,7 @@ public: void MoveConstToX86regPointer(x86Reg AddrReg1, x86Reg AddrReg2, uint32_t Const); void MoveSxByteX86regPointerToX86reg(x86Reg Reg, x86Reg AddrReg1, x86Reg AddrReg2); void MoveSxHalfX86regPointerToX86reg(x86Reg Reg, x86Reg AddrReg1, x86Reg AddrReg2); - void MoveSxVariableToX86regByte(void * Variable, const char * VariableName, x86Reg Reg); + void MoveSxVariableToX86regByte(x86Reg Reg, void * Variable, const char * VariableName); void MoveSxVariableToX86regHalf(void * Variable, const char * VariableName, x86Reg Reg); void MoveVariableDispToX86Reg(void * Variable, const char * VariableName, x86Reg Reg, x86Reg AddrReg, int32_t Multiplier); void MoveVariableToX86reg(x86Reg Reg, void * Variable, const char * VariableName);