diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp index cf56ec782..ef1fa7656 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmOps.cpp @@ -12,8 +12,8 @@ #if defined(__arm__) || defined(_M_ARM) #include -#include #include +#include #include /************************************************************************** @@ -117,6 +117,13 @@ void CArmOps::AddConstToArmReg(ArmReg DestReg, ArmReg SourceReg, uint32_t Const) op.imm8_3_1.opcode3 = 0; AddCode32(op.Hex); } + else if ((Const & 0xFFFF8000) == 0xFFFF8000 || (Const & 0xFFFF0000) == 0) + { + ArmReg TempReg = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false); + MoveConstToArmReg(TempReg,Const); + AddArmRegToArmReg(DestReg, TempReg, SourceReg); + m_RegWorkingSet.SetArmRegProtected(TempReg,false); + } else { CPU_Message("%s: DestReg = %X Const = %X", __FUNCTION__, DestReg, Const);