From 7b70ba0da33a6dff5e052b024dbdee625c1dda27 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 12 Mar 2013 18:40:50 +1100 Subject: [PATCH] Recompiler: Fix up protection of op in DADDU --- .../N64 System/Recompiler/Recompiler Ops.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index c765a671e..003e86edb 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -3561,13 +3561,13 @@ void CRecompilerOps::SPECIAL_DADD (void) { int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs; int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt; + if (IsMapped(source2)) { ProtectGPR(source2); } Map_GPR_64bit(m_Opcode.rd,source1); if (IsConst(source2)) { AddConstToX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegLo(source2)); AddConstToX86Reg(GetMipsRegMapHi(m_Opcode.rd),GetMipsRegHi(source2)); } else if (IsMapped(source2)) { x86Reg HiReg = Is64Bit(source2)?GetMipsRegMapHi(source2):Map_TempReg(x86_Any,source2,TRUE); - ProtectGPR(source2); AddX86RegToX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegMapLo(source2)); AdcX86RegToX86Reg(GetMipsRegMapHi(m_Opcode.rd),HiReg); } else { @@ -3597,13 +3597,13 @@ void CRecompilerOps::SPECIAL_DADDU (void) { int source1 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rt:m_Opcode.rs; int source2 = m_Opcode.rd == m_Opcode.rt?m_Opcode.rs:m_Opcode.rt; + if (IsMapped(source2)) { ProtectGPR(source2); } Map_GPR_64bit(m_Opcode.rd,source1); if (IsConst(source2)) { AddConstToX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegLo(source2)); AddConstToX86Reg(GetMipsRegMapHi(m_Opcode.rd),GetMipsRegHi(source2)); } else if (IsMapped(source2)) { x86Reg HiReg = Is64Bit(source2)?GetMipsRegMapHi(source2):Map_TempReg(x86_Any,source2,TRUE); - ProtectGPR(source2); AddX86RegToX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegMapLo(source2)); AdcX86RegToX86Reg(GetMipsRegMapHi(m_Opcode.rd),HiReg); } else { @@ -3639,10 +3639,8 @@ void CRecompilerOps::SPECIAL_DSUB (void) { SbbX86RegToX86Reg(GetMipsRegMapHi(m_Opcode.rd),HiReg); return; } - if (IsMapped(m_Opcode.rt)) - { - ProtectGPR(m_Opcode.rt); - } + + if (IsMapped(m_Opcode.rt)) { ProtectGPR(m_Opcode.rt); } Map_GPR_64bit(m_Opcode.rd,m_Opcode.rs); if (IsConst(m_Opcode.rt)) { SubConstFromX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegLo(m_Opcode.rt)); @@ -3684,10 +3682,7 @@ void CRecompilerOps::SPECIAL_DSUBU (void) { SbbX86RegToX86Reg(GetMipsRegMapHi(m_Opcode.rd),HiReg); return; } - if (IsMapped(m_Opcode.rt)) - { - ProtectGPR(m_Opcode.rt); - } + if (IsMapped(m_Opcode.rt)) { ProtectGPR(m_Opcode.rt); } Map_GPR_64bit(m_Opcode.rd,m_Opcode.rs); if (IsConst(m_Opcode.rt)) { SubConstFromX86Reg(GetMipsRegMapLo(m_Opcode.rd),GetMipsRegLo(m_Opcode.rt));