summaryrefslogtreecommitdiff
path: root/src/core/arm
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/arm_interface.h2
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp8
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:
103 return num_instructions; 103 return num_instructions;
104 } 104 }
105 105
106 s64 down_count; ///< A decreasing counter of remaining cycles before the next event, decreased by the cpu run loop
107
106protected: 108protected:
107 109
108 /** 110 /**
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 @@
9#include "core/arm/dyncom/arm_dyncom.h" 9#include "core/arm/dyncom/arm_dyncom.h"
10#include "core/arm/dyncom/arm_dyncom_interpreter.h" 10#include "core/arm/dyncom/arm_dyncom_interpreter.h"
11 11
12#include "core/core_timing.h"
13
12const static cpu_config_t s_arm11_cpu_info = { 14const static cpu_config_t s_arm11_cpu_info = {
13 "armv6", "arm11", 0x0007b000, 0x0007f000, NONCACHE 15 "armv6", "arm11", 0x0007b000, 0x0007f000, NONCACHE
14}; 16};
@@ -77,6 +79,9 @@ u64 ARM_DynCom::GetTicks() const {
77 79
78void ARM_DynCom::AddTicks(u64 ticks) { 80void ARM_DynCom::AddTicks(u64 ticks) {
79 this->ticks += ticks; 81 this->ticks += ticks;
82 down_count -= ticks;
83 if (down_count < 0)
84 CoreTiming::Advance();
80} 85}
81 86
82void ARM_DynCom::ExecuteInstructions(int num_instructions) { 87void ARM_DynCom::ExecuteInstructions(int num_instructions) {
@@ -85,7 +90,8 @@ void ARM_DynCom::ExecuteInstructions(int num_instructions) {
85 // Dyncom only breaks on instruction dispatch. This only happens on every instruction when 90 // Dyncom only breaks on instruction dispatch. This only happens on every instruction when
86 // executing one instruction at a time. Otherwise, if a block is being executed, more 91 // executing one instruction at a time. Otherwise, if a block is being executed, more
87 // instructions may actually be executed than specified. 92 // instructions may actually be executed than specified.
88 ticks += InterpreterMainLoop(state.get()); 93 unsigned ticks_executed = InterpreterMainLoop(state.get());
94 AddTicks(ticks_executed);
89} 95}
90 96
91void ARM_DynCom::SaveContext(ThreadContext& ctx) { 97void ARM_DynCom::SaveContext(ThreadContext& ctx) {