summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-03-16 14:25:15 -0400
committerGravatar bunnei2015-03-16 14:25:15 -0400
commite4e2c929af8953fd9946d2556b112b80c9b0ffb5 (patch)
tree2ea2d84aac8e0226f8cc089c5752178473ba4030 /src
parentMerge pull request #657 from Subv/flip (diff)
parentarm_interface: Get rid of GetTicks. (diff)
downloadyuzu-e4e2c929af8953fd9946d2556b112b80c9b0ffb5.tar.gz
yuzu-e4e2c929af8953fd9946d2556b112b80c9b0ffb5.tar.xz
yuzu-e4e2c929af8953fd9946d2556b112b80c9b0ffb5.zip
Merge pull request #663 from lioncash/ticks
arm_interface: Get rid of GetTicks.
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/arm_interface.h6
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp5
-rw-r--r--src/core/arm/dyncom/arm_dyncom.h1
-rw-r--r--src/core/hle/service/hid/hid.cpp6
-rw-r--r--src/core/hle/svc.cpp5
5 files changed, 6 insertions, 17 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index ef37ee055..fe1e584ad 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -74,12 +74,6 @@ public:
74 virtual void SetCPSR(u32 cpsr) = 0; 74 virtual void SetCPSR(u32 cpsr) = 0;
75 75
76 /** 76 /**
77 * Returns the number of clock ticks since the last rese
78 * @return Returns number of clock ticks
79 */
80 virtual u64 GetTicks() const = 0;
81
82 /**
83 * Advance the CPU core by the specified number of ticks (e.g. to simulate CPU execution time) 77 * Advance the CPU core by the specified number of ticks (e.g. to simulate CPU execution time)
84 * @param ticks Number of ticks to advance the CPU core 78 * @param ticks Number of ticks to advance the CPU core
85 */ 79 */
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index bbcbbdd2b..cb1a410a0 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -68,11 +68,6 @@ void ARM_DynCom::SetCPSR(u32 cpsr) {
68 state->Cpsr = cpsr; 68 state->Cpsr = cpsr;
69} 69}
70 70
71u64 ARM_DynCom::GetTicks() const {
72 // TODO(Subv): Remove ARM_DynCom::GetTicks() and use CoreTiming::GetTicks() directly once ARMemu is gone
73 return CoreTiming::GetTicks();
74}
75
76void ARM_DynCom::AddTicks(u64 ticks) { 71void ARM_DynCom::AddTicks(u64 ticks) {
77 down_count -= ticks; 72 down_count -= ticks;
78 if (down_count < 0) 73 if (down_count < 0)
diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h
index 213cac1ad..a7f95d307 100644
--- a/src/core/arm/dyncom/arm_dyncom.h
+++ b/src/core/arm/dyncom/arm_dyncom.h
@@ -23,7 +23,6 @@ public:
23 u32 GetCPSR() const override; 23 u32 GetCPSR() const override;
24 void SetCPSR(u32 cpsr) override; 24 void SetCPSR(u32 cpsr) override;
25 25
26 u64 GetTicks() const override;
27 void AddTicks(u64 ticks) override; 26 void AddTicks(u64 ticks) override;
28 27
29 void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg); 28 void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg);
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index e7f9bec7e..8adb03f2e 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -7,7 +7,7 @@
7#include "core/hle/service/hid/hid_spvr.h" 7#include "core/hle/service/hid/hid_spvr.h"
8#include "core/hle/service/hid/hid_user.h" 8#include "core/hle/service/hid/hid_user.h"
9 9
10#include "core/arm/arm_interface.h" 10#include "core/core_timing.h"
11#include "core/hle/kernel/event.h" 11#include "core/hle/kernel/event.h"
12#include "core/hle/kernel/shared_memory.h" 12#include "core/hle/kernel/shared_memory.h"
13#include "core/hle/hle.h" 13#include "core/hle/hle.h"
@@ -82,7 +82,7 @@ void HIDUpdate() {
82 // If we just updated index 0, provide a new timestamp 82 // If we just updated index 0, provide a new timestamp
83 if (mem->pad.index == 0) { 83 if (mem->pad.index == 0) {
84 mem->pad.index_reset_ticks_previous = mem->pad.index_reset_ticks; 84 mem->pad.index_reset_ticks_previous = mem->pad.index_reset_ticks;
85 mem->pad.index_reset_ticks = (s64)Core::g_app_core->GetTicks(); 85 mem->pad.index_reset_ticks = (s64)CoreTiming::GetTicks();
86 } 86 }
87 87
88 mem->touch.index = next_touch_index; 88 mem->touch.index = next_touch_index;
@@ -102,7 +102,7 @@ void HIDUpdate() {
102 // If we just updated index 0, provide a new timestamp 102 // If we just updated index 0, provide a new timestamp
103 if (mem->touch.index == 0) { 103 if (mem->touch.index == 0) {
104 mem->touch.index_reset_ticks_previous = mem->touch.index_reset_ticks; 104 mem->touch.index_reset_ticks_previous = mem->touch.index_reset_ticks;
105 mem->touch.index_reset_ticks = (s64)Core::g_app_core->GetTicks(); 105 mem->touch.index_reset_ticks = (s64)CoreTiming::GetTicks();
106 } 106 }
107 107
108 // Signal both handles when there's an update to Pad or touch 108 // Signal both handles when there's an update to Pad or touch
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 17385f9b2..bbb4eb9cd 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -7,8 +7,9 @@
7#include "common/string_util.h" 7#include "common/string_util.h"
8#include "common/symbols.h" 8#include "common/symbols.h"
9 9
10#include "core/arm/arm_interface.h" 10#include "core/core_timing.h"
11#include "core/mem_map.h" 11#include "core/mem_map.h"
12#include "core/arm/arm_interface.h"
12 13
13#include "core/hle/kernel/address_arbiter.h" 14#include "core/hle/kernel/address_arbiter.h"
14#include "core/hle/kernel/event.h" 15#include "core/hle/kernel/event.h"
@@ -551,7 +552,7 @@ static void SleepThread(s64 nanoseconds) {
551 552
552/// This returns the total CPU ticks elapsed since the CPU was powered-on 553/// This returns the total CPU ticks elapsed since the CPU was powered-on
553static s64 GetSystemTick() { 554static s64 GetSystemTick() {
554 return (s64)Core::g_app_core->GetTicks(); 555 return (s64)CoreTiming::GetTicks();
555} 556}
556 557
557/// Creates a memory block at the specified address with the specified permissions and size 558/// Creates a memory block at the specified address with the specified permissions and size