From 52d904702fe1cd23071800206f14544964e4ae8f Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 28 Nov 2024 11:39:41 +1030 Subject: [PATCH] Core: With CONST64 CX86RegInfo::WriteBackRegisters might not write the high 32bit correct --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 8 ++++---- .../N64System/Recompiler/x86/x86RegInfo.cpp | 2 +- 2 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 ef8a69f9b..4bc3eca0b 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -10155,7 +10155,7 @@ void CX86RecompilerOps::CompileStoreMemoryValue(asmjit::x86::Gp AddressReg, cons m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL); } MemoryWriteDone = m_Assembler.newLabel(); - m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done:", m_CompilePC).c_str(), MemoryWriteDone); + m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done", m_CompilePC).c_str(), MemoryWriteDone); } else if (ValueSize == 16) { @@ -10182,7 +10182,7 @@ void CX86RecompilerOps::CompileStoreMemoryValue(asmjit::x86::Gp AddressReg, cons m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL); } MemoryWriteDone = m_Assembler.newLabel(); - m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done:", m_CompilePC).c_str(), MemoryWriteDone); + m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done", m_CompilePC).c_str(), MemoryWriteDone); } else if (ValueSize == 32) { @@ -10212,7 +10212,7 @@ void CX86RecompilerOps::CompileStoreMemoryValue(asmjit::x86::Gp AddressReg, cons m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL); } MemoryWriteDone = m_Assembler.newLabel(); - m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done:", m_CompilePC).c_str(), MemoryWriteDone); + m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done", m_CompilePC).c_str(), MemoryWriteDone); } else if (ValueSize == 64) { @@ -10241,7 +10241,7 @@ void CX86RecompilerOps::CompileStoreMemoryValue(asmjit::x86::Gp AddressReg, cons m_Assembler.MoveConstToVariable(&g_System->m_PipelineStage, "g_System->m_PipelineStage", PIPELINE_STAGE_NORMAL); } MemoryWriteDone = m_Assembler.newLabel(); - m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done:", m_CompilePC).c_str(), MemoryWriteDone); + m_Assembler.JmpLabel(stdstr_f("MemoryWrite_%X_Done", m_CompilePC).c_str(), MemoryWriteDone); } else { diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp index 7bb7e664d..a33a32974 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp @@ -1763,7 +1763,7 @@ void CX86RegInfo::WriteBackRegisters() { m_Assembler.MoveX86regToVariable(&m_Reg.m_GPR[count].UW[1], CRegName::GPR_Hi[count], asmjit::x86::edi); } - else if (GetMipsRegLo(count) == 0xFFFFFFFF) + else if (GetMipsRegHi(count) == 0xFFFFFFFF) { m_Assembler.MoveX86regToVariable(&m_Reg.m_GPR[count].UW[1], CRegName::GPR_Hi[count], asmjit::x86::esi); }