From fc1210aac5d2a6ebaaf3a336a63fba2267898f21 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 5 Dec 2024 11:25:20 +1030 Subject: [PATCH] Core: Do not allow CX86RecompilerOps::SPECIAL_DSRL32 and CX86RecompilerOps::SPECIAL_DSRA32 to write to R0 --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 0b686889c..282d1e5c8 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -7288,6 +7288,10 @@ void CX86RecompilerOps::SPECIAL_DSLL32() void CX86RecompilerOps::SPECIAL_DSRL32() { + if (m_Opcode.rd == 0) + { + return; + } if (m_RegWorkingSet.IsConst(m_Opcode.rt)) { if (m_Opcode.rt != m_Opcode.rd) @@ -7339,6 +7343,10 @@ void CX86RecompilerOps::SPECIAL_DSRL32() void CX86RecompilerOps::SPECIAL_DSRA32() { + if (m_Opcode.rd == 0) + { + return; + } if (m_RegWorkingSet.IsConst(m_Opcode.rt)) { if (m_Opcode.rt != m_Opcode.rd)