diff options
Diffstat (limited to 'src/core/core_timing.h')
| -rw-r--r-- | src/core/core_timing.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 3d8a7d0c0..b72a1b500 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h | |||
| @@ -4,7 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <functional> | ||
| 7 | #include <string> | 8 | #include <string> |
| 9 | #include "common/common_types.h" | ||
| 8 | 10 | ||
| 9 | // This is a system to schedule events into the emulated machine's future. Time is measured | 11 | // This is a system to schedule events into the emulated machine's future. Time is measured |
| 10 | // in main CPU clock cycles. | 12 | // in main CPU clock cycles. |
| @@ -19,10 +21,6 @@ | |||
| 19 | // inside callback: | 21 | // inside callback: |
| 20 | // ScheduleEvent(periodInCycles - cycles_late, callback, "whatever") | 22 | // ScheduleEvent(periodInCycles - cycles_late, callback, "whatever") |
| 21 | 23 | ||
| 22 | #include <functional> | ||
| 23 | |||
| 24 | #include "common/common_types.h" | ||
| 25 | |||
| 26 | extern int g_clock_rate_arm11; | 24 | extern int g_clock_rate_arm11; |
| 27 | 25 | ||
| 28 | inline s64 msToCycles(int ms) { | 26 | inline s64 msToCycles(int ms) { |
| @@ -61,12 +59,11 @@ inline u64 cyclesToMs(s64 cycles) { | |||
| 61 | return cycles / (g_clock_rate_arm11 / 1000); | 59 | return cycles / (g_clock_rate_arm11 / 1000); |
| 62 | } | 60 | } |
| 63 | 61 | ||
| 64 | namespace CoreTiming | 62 | namespace CoreTiming { |
| 65 | { | ||
| 66 | void Init(); | 63 | void Init(); |
| 67 | void Shutdown(); | 64 | void Shutdown(); |
| 68 | 65 | ||
| 69 | typedef void(*MHzChangeCallback)(); | 66 | typedef void (*MHzChangeCallback)(); |
| 70 | typedef std::function<void(u64 userdata, int cycles_late)> TimedCallback; | 67 | typedef std::function<void(u64 userdata, int cycles_late)> TimedCallback; |
| 71 | 68 | ||
| 72 | u64 GetTicks(); | 69 | u64 GetTicks(); |
| @@ -81,7 +78,7 @@ u64 GetGlobalTimeUs(); | |||
| 81 | */ | 78 | */ |
| 82 | int RegisterEvent(const char* name, TimedCallback callback); | 79 | int RegisterEvent(const char* name, TimedCallback callback); |
| 83 | /// For save states. | 80 | /// For save states. |
| 84 | void RestoreRegisterEvent(int event_type, const char *name, TimedCallback callback); | 81 | void RestoreRegisterEvent(int event_type, const char* name, TimedCallback callback); |
| 85 | void UnregisterAllEvents(); | 82 | void UnregisterAllEvents(); |
| 86 | 83 | ||
| 87 | /// userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from disk, | 84 | /// userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from disk, |
| @@ -128,7 +125,7 @@ void ClearPendingEvents(); | |||
| 128 | void LogPendingEvents(); | 125 | void LogPendingEvents(); |
| 129 | 126 | ||
| 130 | /// Warning: not included in save states. | 127 | /// Warning: not included in save states. |
| 131 | void RegisterAdvanceCallback(void(*callback)(int cycles_executed)); | 128 | void RegisterAdvanceCallback(void (*callback)(int cycles_executed)); |
| 132 | void RegisterMHzChangeCallback(MHzChangeCallback callback); | 129 | void RegisterMHzChangeCallback(MHzChangeCallback callback); |
| 133 | 130 | ||
| 134 | std::string GetScheduledEventsSummary(); | 131 | std::string GetScheduledEventsSummary(); |