diff options
author | Subv <subv2112@gmail.com> | 2015-01-06 02:17:49 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-01-07 21:08:35 +0100 |
commit | 9bf82beb4cbb0b75448a071179c3497187963248 (patch) | |
tree | c7a99156a6aefb78436c625f1d3170ee4becccd0 /src/core/arm | |
parent | Merge pull request #422 from lioncash/bxj (diff) | |
download | yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar.gz yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar.bz2 yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar.lz yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar.xz yuzu-9bf82beb4cbb0b75448a071179c3497187963248.tar.zst yuzu-9bf82beb4cbb0b75448a071179c3497187963248.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/arm/arm_interface.h | 2 | ||||
-rw-r--r-- | src/core/arm/dyncom/arm_dyncom.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 3b7209418..d3bd4a9a3 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -103,6 +103,8 @@ public: return num_instructions; } + s64 down_count; ///< A decreasing counter of remaining cycles before the next event, decreased by the cpu run loop + protected: /** diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index a838fd25a..c779e3fd4 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp @@ -9,6 +9,8 @@ #include "core/arm/dyncom/arm_dyncom.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" +#include "core/core_timing.h" + const static cpu_config_t s_arm11_cpu_info = { "armv6", "arm11", 0x0007b000, 0x0007f000, NONCACHE }; @@ -77,6 +79,9 @@ u64 ARM_DynCom::GetTicks() const { void ARM_DynCom::AddTicks(u64 ticks) { this->ticks += ticks; + down_count -= ticks; + if (down_count < 0) + CoreTiming::Advance(); } void ARM_DynCom::ExecuteInstructions(int num_instructions) { @@ -85,7 +90,8 @@ void ARM_DynCom::ExecuteInstructions(int num_instructions) { // Dyncom only breaks on instruction dispatch. This only happens on every instruction when // executing one instruction at a time. Otherwise, if a block is being executed, more // instructions may actually be executed than specified. - ticks += InterpreterMainLoop(state.get()); + unsigned ticks_executed = InterpreterMainLoop(state.get()); + AddTicks(ticks_executed); } void ARM_DynCom::SaveContext(ThreadContext& ctx) { |