From 01231002337b591a91b131248c26d8335857e149 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 7 Nov 2022 10:37:29 +1030 Subject: [PATCH] Core: reorder MoveConstHalfToVariable parameters --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 2 +- Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp | 2 +- Source/Project64-core/N64System/Recompiler/x86/x86ops.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 4887dccc8..75b8bcd0a 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -10288,7 +10288,7 @@ void CX86RecompilerOps::SH_Const(uint32_t Value, uint32_t VAddr) } else if (PAddr < g_MMU->RdramSize()) { - m_Assembler.MoveConstHalfToVariable((uint16_t)Value, (PAddr ^ 2) + g_MMU->Rdram(), stdstr_f("RDRAM + (%X ^ 2)", PAddr).c_str()); + m_Assembler.MoveConstHalfToVariable((PAddr ^ 2) + g_MMU->Rdram(), stdstr_f("RDRAM + (%X ^ 2)", PAddr).c_str(), (uint16_t)Value); } break; default: diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp index df2ac4bf4..6ac1dc458 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.cpp @@ -748,7 +748,7 @@ void CX86Ops::MoveConstByteToVariable(void * Variable, const char * VariableName AddCode8(Const); } -void CX86Ops::MoveConstHalfToVariable(uint16_t Const, void * Variable, const char * VariableName) +void CX86Ops::MoveConstHalfToVariable(void * Variable, const char * VariableName, uint16_t Const) { CodeLog(" mov word ptr [%s], %Xh", VariableName, Const); AddCode8(0x66); diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h index ffdea03e1..88c876b7a 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86ops.h +++ b/Source/Project64-core/N64System/Recompiler/x86/x86ops.h @@ -129,7 +129,7 @@ public: void LeaSourceAndOffset(x86Reg x86DestReg, x86Reg x86SourceReg, int32_t offset); void MoveConstByteToVariable(void * Variable, const char * VariableName, uint8_t Const); void MoveConstByteToX86regPointer(uint8_t Const, x86Reg AddrReg1, x86Reg AddrReg2); - void MoveConstHalfToVariable(uint16_t Const, void * Variable, const char * VariableName); + void MoveConstHalfToVariable(void * Variable, const char * VariableName, uint16_t Const); void MoveConstHalfToX86regPointer(uint16_t Const, x86Reg AddrReg1, x86Reg AddrReg2); void MoveConstToMemoryDisp(uint32_t Const, x86Reg AddrReg, uint32_t Disp); void MoveConstToVariable(uint32_t Const, void * Variable, const char * VariableName);