summaryrefslogtreecommitdiffstats
path: root/src/core/core_timing.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-12-16 01:01:48 +0100
committerbunnei <bunneidev@gmail.com>2016-12-22 05:29:13 +0100
commit232ef55c1a13552e5ba8b72d61d1d072f5851598 (patch)
tree729ee82ded58202888a2c27bdc3beec6ab926768 /src/core/core_timing.cpp
parentfile_util: Remove unused paths. (diff)
downloadyuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.gz
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.bz2
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.lz
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.xz
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.zst
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.zip
Diffstat (limited to 'src/core/core_timing.cpp')
-rw-r--r--src/core/core_timing.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 5220b55ea..9fe374795 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -130,7 +130,6 @@ int RegisterEvent(const char* name, TimedCallback callback) {
static void AntiCrashCallback(u64 userdata, int cycles_late) {
LOG_CRITICAL(Core_Timing, "Savestate broken: an unregistered event was called.");
- Core::Halt("invalid timing events");
}
void RestoreRegisterEvent(int event_type, const char* name, TimedCallback callback) {
@@ -147,7 +146,7 @@ void UnregisterAllEvents() {
}
void Init() {
- Core::g_app_core->down_count = INITIAL_SLICE_LENGTH;
+ Core::AppCore().down_count = INITIAL_SLICE_LENGTH;
g_slice_length = INITIAL_SLICE_LENGTH;
global_timer = 0;
idled_cycles = 0;
@@ -187,7 +186,7 @@ void Shutdown() {
}
u64 GetTicks() {
- return (u64)global_timer + g_slice_length - Core::g_app_core->down_count;
+ return (u64)global_timer + g_slice_length - Core::AppCore().down_count;
}
u64 GetIdleTicks() {
@@ -461,18 +460,18 @@ void MoveEvents() {
}
void ForceCheck() {
- s64 cycles_executed = g_slice_length - Core::g_app_core->down_count;
+ s64 cycles_executed = g_slice_length - Core::AppCore().down_count;
global_timer += cycles_executed;
// This will cause us to check for new events immediately.
- Core::g_app_core->down_count = 0;
+ Core::AppCore().down_count = 0;
// But let's not eat a bunch more time in Advance() because of this.
g_slice_length = 0;
}
void Advance() {
- s64 cycles_executed = g_slice_length - Core::g_app_core->down_count;
+ s64 cycles_executed = g_slice_length - Core::AppCore().down_count;
global_timer += cycles_executed;
- Core::g_app_core->down_count = g_slice_length;
+ Core::AppCore().down_count = g_slice_length;
if (has_ts_events)
MoveEvents();
@@ -481,7 +480,7 @@ void Advance() {
if (!first) {
if (g_slice_length < 10000) {
g_slice_length += 10000;
- Core::g_app_core->down_count += g_slice_length;
+ Core::AppCore().down_count += g_slice_length;
}
} else {
// Note that events can eat cycles as well.
@@ -491,7 +490,7 @@ void Advance() {
const int diff = target - g_slice_length;
g_slice_length += diff;
- Core::g_app_core->down_count += diff;
+ Core::AppCore().down_count += diff;
}
if (advance_callback)
advance_callback(static_cast<int>(cycles_executed));
@@ -507,12 +506,12 @@ void LogPendingEvents() {
}
void Idle(int max_idle) {
- s64 cycles_down = Core::g_app_core->down_count;
+ s64 cycles_down = Core::AppCore().down_count;
if (max_idle != 0 && cycles_down > max_idle)
cycles_down = max_idle;
if (first && cycles_down > 0) {
- s64 cycles_executed = g_slice_length - Core::g_app_core->down_count;
+ s64 cycles_executed = g_slice_length - Core::AppCore().down_count;
s64 cycles_next_event = first->time - global_timer;
if (cycles_next_event < cycles_executed + cycles_down) {
@@ -527,9 +526,9 @@ void Idle(int max_idle) {
cycles_down / (float)(g_clock_rate_arm11 * 0.001f));
idled_cycles += cycles_down;
- Core::g_app_core->down_count -= cycles_down;
- if (Core::g_app_core->down_count == 0)
- Core::g_app_core->down_count = -1;
+ Core::AppCore().down_count -= cycles_down;
+ if (Core::AppCore().down_count == 0)
+ Core::AppCore().down_count = -1;
}
std::string GetScheduledEventsSummary() {