summaryrefslogtreecommitdiffstats
path: root/src/core/arm/dyncom
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-07 21:30:46 +0100
committerbunnei <bunneidev@gmail.com>2015-01-07 21:30:46 +0100
commit3eca33c6a430a004a9ffe2fc5265143fdf6503f3 (patch)
treeed1972f2121bfdb011e0a566015272aa5dbd5473 /src/core/arm/dyncom
parentMerge pull request #440 from yuriks/lifetime-fix (diff)
parentCoreTiming: Ported the CoreTiming namespace from PPSSPP (diff)
downloadyuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar.gz
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar.bz2
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar.lz
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar.xz
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.tar.zst
yuzu-3eca33c6a430a004a9ffe2fc5265143fdf6503f3.zip
Diffstat (limited to 'src/core/arm/dyncom')
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp8
1 files changed, 7 insertions, 1 deletions
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) {