diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-16 00:30:06 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-16 00:54:15 +0200 |
commit | 8b50c660dfce50a07c2b2aa3c1b6b8642259a944 (patch) | |
tree | 798b0427a660bf249311f3a13d96c6df69a6bcb5 /src/core/memory/cheat_engine.cpp | |
parent | Merge pull request #4342 from lioncash/endian (diff) | |
download | yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar.gz yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar.bz2 yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar.lz yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar.xz yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.tar.zst yuzu-8b50c660dfce50a07c2b2aa3c1b6b8642259a944.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/memory/cheat_engine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index 53d27859b..09bf8c5cf 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp @@ -20,7 +20,7 @@ namespace Core::Memory { -constexpr s64 CHEAT_ENGINE_TICKS = static_cast<s64>(1000000000 / 12); +constexpr auto CHEAT_ENGINE_NS = std::chrono::nanoseconds{1000000000 / 12}; constexpr u32 KEYPAD_BITMASK = 0x3FFFFFF; StandardVmCallbacks::StandardVmCallbacks(Core::System& system, const CheatProcessMetadata& metadata) @@ -191,7 +191,7 @@ void CheatEngine::Initialize() { event = Core::Timing::CreateEvent( "CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id), [this](u64 userdata, s64 ns_late) { FrameCallback(userdata, ns_late); }); - core_timing.ScheduleEvent(CHEAT_ENGINE_TICKS, event); + core_timing.ScheduleEvent(CHEAT_ENGINE_NS, event); metadata.process_id = system.CurrentProcess()->GetProcessID(); metadata.title_id = system.CurrentProcess()->GetTitleID(); @@ -230,7 +230,8 @@ void CheatEngine::FrameCallback(u64 userdata, s64 ns_late) { vm.Execute(metadata); - core_timing.ScheduleEvent(CHEAT_ENGINE_TICKS - ns_late, event); + const auto future_ns = CHEAT_ENGINE_NS - std::chrono::nanoseconds{ns_late}; + core_timing.ScheduleEvent(future_ns, event); } } // namespace Core::Memory |