diff options
| author | 2022-07-10 06:59:40 +0100 | |
|---|---|---|
| committer | 2022-07-10 06:59:40 +0100 | |
| commit | 240650f6a6336df8d3eb11b410cdcd332d8ad562 (patch) | |
| tree | 16ae249e6160a22f88bd2238d43b23079c4afb44 /src/core/memory | |
| parent | Merge pull request #8531 from FernandoS27/core-timing-fix-reg (diff) | |
| download | yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.gz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.xz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.zip | |
Rework CoreTiming
Diffstat (limited to 'src/core/memory')
| -rw-r--r-- | src/core/memory/cheat_engine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index 5f71f0ff5..09a02d2ac 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp | |||
| @@ -184,10 +184,12 @@ CheatEngine::~CheatEngine() { | |||
| 184 | void CheatEngine::Initialize() { | 184 | void CheatEngine::Initialize() { |
| 185 | event = Core::Timing::CreateEvent( | 185 | event = Core::Timing::CreateEvent( |
| 186 | "CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id), | 186 | "CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id), |
| 187 | [this](std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { | 187 | [this](std::uintptr_t user_data, s64 time, |
| 188 | std::chrono::nanoseconds ns_late) -> std::optional<std::chrono::nanoseconds> { | ||
| 188 | FrameCallback(user_data, ns_late); | 189 | FrameCallback(user_data, ns_late); |
| 190 | return std::nullopt; | ||
| 189 | }); | 191 | }); |
| 190 | core_timing.ScheduleEvent(CHEAT_ENGINE_NS, event); | 192 | core_timing.ScheduleLoopingEvent(std::chrono::nanoseconds(0), CHEAT_ENGINE_NS, event); |
| 191 | 193 | ||
| 192 | metadata.process_id = system.CurrentProcess()->GetProcessID(); | 194 | metadata.process_id = system.CurrentProcess()->GetProcessID(); |
| 193 | metadata.title_id = system.GetCurrentProcessProgramID(); | 195 | metadata.title_id = system.GetCurrentProcessProgramID(); |
| @@ -237,8 +239,6 @@ void CheatEngine::FrameCallback(std::uintptr_t, std::chrono::nanoseconds ns_late | |||
| 237 | MICROPROFILE_SCOPE(Cheat_Engine); | 239 | MICROPROFILE_SCOPE(Cheat_Engine); |
| 238 | 240 | ||
| 239 | vm.Execute(metadata); | 241 | vm.Execute(metadata); |
| 240 | |||
| 241 | core_timing.ScheduleEvent(CHEAT_ENGINE_NS - ns_late, event); | ||
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | } // namespace Core::Memory | 244 | } // namespace Core::Memory |