From b313f8b90ce4eb4e761b9de86c12dcff3258c218 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 23 Nov 2016 18:53:14 +1100 Subject: [PATCH] [Project64] implement CArmRecompilerOps::COP0_CO_TLBWR --- .../Recompiler/Arm/ArmRecompilerOps.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp index 63b873787..f8ed40500 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp @@ -3891,14 +3891,20 @@ void CArmRecompilerOps::COP0_CO_TLBWI() void CArmRecompilerOps::COP0_CO_TLBWR() { if (!g_System->bUseTlb()) { return; } - if (g_Settings->LoadBool(Game_32Bit)) - { - CompileInterpterCall((void *)R4300iOp32::COP0_CO_TLBWR, "R4300iOp32::COP0_CO_TLBWR"); - } - else - { - CompileInterpterCall((void *)R4300iOp::COP0_CO_TLBWR, "R4300iOp::COP0_CO_TLBWR"); - } + + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() - g_System->CountPerOp()); + UpdateCounters(m_RegWorkingSet, false, true); + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp()); + m_RegWorkingSet.BeforeCallDirect(); + MoveConstToArmReg(Arm_R0, (uint32_t)g_SystemTimer, "g_SystemTimer"); + CallFunction((void *)AddressOf(&CSystemTimer::UpdateTimers), "CSystemTimer::UpdateTimers"); + + MoveConstToArmReg(Arm_R2, (uint32_t)true, "true"); + MoveVariableToArmReg(&g_Reg->RANDOM_REGISTER, "RANDOM_REGISTER", Arm_R1); + AndConstToArmReg(Arm_R1, Arm_R1, 0x1F); + MoveConstToArmReg(Arm_R0, (uint32_t)g_TLB, "g_TLB"); + CallFunction((void *)AddressOf(&CTLB::WriteEntry), "CTLB::WriteEntry"); + m_RegWorkingSet.AfterCallDirect(); } void CArmRecompilerOps::COP0_CO_TLBP()