From f6dfdc35886e4fae989c7ab5ab56b4a75314b721 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 3 Dec 2017 16:40:21 +0000 Subject: [PATCH] core/arm: Improve timing accuracy before service calls in CPU interpreter --- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 3522d1e82a..8f7126ae35 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -18,6 +18,7 @@ #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/armsupp.h" #include "core/arm/skyeye_common/vfp/vfp.h" +#include "core/core_timing.h" #include "core/gdbstub/gdbstub.h" #include "core/hle/svc.h" #include "core/memory.h" @@ -3859,6 +3860,10 @@ SUB_INST : { SWI_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { swi_inst* const inst_cream = (swi_inst*)inst_base->component; + CoreTiming::AddTicks(num_instrs); + cpu->NumInstrsToExecute = + num_instrs >= cpu->NumInstrsToExecute ? 0 : cpu->NumInstrsToExecute - num_instrs; + num_instrs = 0; SVC::CallSVC(inst_cream->num & 0xFFFF); }