core/arm: Improve timing accuracy before service calls in CPU interpreter

This commit is contained in:
MerryMage 2017-12-03 16:40:21 +00:00
parent 7cd8b437aa
commit f6dfdc3588

View file

@ -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);
}