summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/cheat_engine.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-22 16:08:04 +0100
committerLioncash <mathew1800@gmail.com>2019-03-22 19:43:41 +0100
commit733cf179b84a098955f0b7296d90da0aac3ddf7b (patch)
treeac956d572471abb004afe7833a9052839727fef3 /src/core/file_sys/cheat_engine.cpp
parentfile_sys/cheat_engine: Remove use of global system accessors (diff)
downloadyuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar.gz
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar.bz2
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar.lz
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar.xz
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.tar.zst
yuzu-733cf179b84a098955f0b7296d90da0aac3ddf7b.zip
Diffstat (limited to 'src/core/file_sys/cheat_engine.cpp')
-rw-r--r--src/core/file_sys/cheat_engine.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/file_sys/cheat_engine.cpp b/src/core/file_sys/cheat_engine.cpp
index 1cbdc6020..247fbc864 100644
--- a/src/core/file_sys/cheat_engine.cpp
+++ b/src/core/file_sys/cheat_engine.cpp
@@ -17,7 +17,7 @@
namespace FileSys {
-constexpr u64 CHEAT_ENGINE_TICKS = Core::Timing::BASE_CLOCK_RATE / 60;
+constexpr s64 CHEAT_ENGINE_TICKS = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60);
constexpr u32 KEYPAD_BITMASK = 0x3FFFFFF;
u64 Cheat::Address() const {
@@ -185,8 +185,9 @@ void CheatList::Loop(const Cheat& cheat) {
ASSERT(iter != block_pairs.end());
ASSERT(iter->first < iter->second);
- for (int i = cheat.Value(4, 4); i >= 0; --i) {
- register_3 = i;
+ const s32 initial_value = static_cast<s32>(cheat.Value(4, sizeof(s32)));
+ for (s32 i = initial_value; i >= 0; --i) {
+ register_3 = static_cast<u64>(i);
for (std::size_t c = iter->first + 1; c < iter->second; ++c) {
current_index = c;
ExecuteSingleCheat(
@@ -478,7 +479,7 @@ CheatEngine::~CheatEngine() {
core_timing.UnscheduleEvent(event, 0);
}
-void CheatEngine::FrameCallback(u64 userdata, int cycles_late) {
+void CheatEngine::FrameCallback(u64 userdata, s64 cycles_late) {
for (auto& list : cheats) {
list.Execute();
}