[Project64] Add CArmOps::MoveArmRegToVariable
This commit is contained in:
parent
86d7fbd4b8
commit
b672cfa21b
|
@ -279,6 +279,26 @@ void CArmOps::CallFunction(void * Function, const char * FunctionName)
|
|||
AddCode16(op.Hex);
|
||||
}
|
||||
|
||||
void CArmOps::MoveArmRegToVariable(ArmReg Reg, void * Variable, const char * VariableName)
|
||||
{
|
||||
if (mInItBlock) { g_Notify->BreakPoint(__FILE__, __LINE__); }
|
||||
bool WasRegProtected = m_RegWorkingSet.GetArmRegProtected(Reg);
|
||||
if (!WasRegProtected)
|
||||
{
|
||||
m_RegWorkingSet.SetArmRegProtected(Reg, true);
|
||||
}
|
||||
|
||||
ArmReg VariableReg = m_RegWorkingSet.Map_TempReg(Arm_Any, -1, false);
|
||||
MoveConstToArmReg(VariableReg, (uint32_t)Variable, VariableName);
|
||||
StoreArmRegToArmRegPointer(Reg, VariableReg, 0);
|
||||
|
||||
m_RegWorkingSet.SetArmRegProtected(VariableReg, false);
|
||||
if (!WasRegProtected)
|
||||
{
|
||||
m_RegWorkingSet.SetArmRegProtected(Reg, false);
|
||||
}
|
||||
}
|
||||
|
||||
void CArmOps::MoveConstToArmReg(ArmReg DestReg, uint16_t Const, const char * comment)
|
||||
{
|
||||
if (comment != NULL)
|
||||
|
|
|
@ -175,6 +175,7 @@ protected:
|
|||
static void LoadArmRegPointerToFloatReg(ArmReg RegPointer, ArmFpuSingle Reg, uint8_t Offset);
|
||||
static void LoadFloatingPointControlReg(ArmReg DestReg);
|
||||
static void MoveArmRegArmReg(ArmReg DestReg, ArmReg SourceReg);
|
||||
static void MoveArmRegToVariable(ArmReg Reg, void * Variable, const char * VariableName);
|
||||
static void MoveConstToArmReg(ArmReg DestReg, uint16_t Const, const char * comment = NULL);
|
||||
static void MoveConstToArmRegTop(ArmReg DestReg, uint16_t Const, const char * comment = NULL);
|
||||
static void MoveConstToArmReg(ArmReg DestReg, uint32_t Const, const char * comment = NULL);
|
||||
|
|
Loading…
Reference in New Issue