From 1a16d463682fe08637184f65d35f3625d02269c5 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 1 Oct 2016 11:44:21 +1000 Subject: [PATCH] [Android] Get TestVariable to use temp registers --- .../N64System/Recompiler/Arm/ArmOps.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp index b96c5faee..3477dc726 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp @@ -871,10 +871,16 @@ void CArmOps::SubConstFromVariable(uint32_t Const, void * Variable, const char * void CArmOps::TestVariable(uint32_t Const, void * Variable, const char * VariableName) { - MoveVariableToArmReg(Variable,VariableName, Arm_R2); - MoveConstToArmReg(Arm_R3, Const); - AndArmRegToArmReg(Arm_R3,Arm_R2); - CompareArmRegToArmReg(Arm_R2,Arm_R3); + ArmReg TempReg1 = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false); + ArmReg TempReg2 = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false); + + MoveVariableToArmReg(Variable,VariableName, TempReg1); + MoveConstToArmReg(TempReg2, Const); + AndArmRegToArmReg(TempReg1,TempReg2); + CompareArmRegToArmReg(TempReg1,TempReg2); + + m_RegWorkingSet.SetArmRegProtected(TempReg1,false); + m_RegWorkingSet.SetArmRegProtected(TempReg2,false); } void CArmOps::XorArmRegToArmReg(ArmReg DestReg, ArmReg SourceReg)