mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
file_sys/cheat_engine: Silence truncation and sign-conversion warnings
This commit is contained in:
parent
540235bb05
commit
733cf179b8
2 changed files with 6 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace FileSys {
|
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;
|
constexpr u32 KEYPAD_BITMASK = 0x3FFFFFF;
|
||||||
|
|
||||||
u64 Cheat::Address() const {
|
u64 Cheat::Address() const {
|
||||||
|
@ -185,8 +185,9 @@ void CheatList::Loop(const Cheat& cheat) {
|
||||||
ASSERT(iter != block_pairs.end());
|
ASSERT(iter != block_pairs.end());
|
||||||
ASSERT(iter->first < iter->second);
|
ASSERT(iter->first < iter->second);
|
||||||
|
|
||||||
for (int i = cheat.Value(4, 4); i >= 0; --i) {
|
const s32 initial_value = static_cast<s32>(cheat.Value(4, sizeof(s32)));
|
||||||
register_3 = i;
|
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) {
|
for (std::size_t c = iter->first + 1; c < iter->second; ++c) {
|
||||||
current_index = c;
|
current_index = c;
|
||||||
ExecuteSingleCheat(
|
ExecuteSingleCheat(
|
||||||
|
@ -478,7 +479,7 @@ CheatEngine::~CheatEngine() {
|
||||||
core_timing.UnscheduleEvent(event, 0);
|
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) {
|
for (auto& list : cheats) {
|
||||||
list.Execute();
|
list.Execute();
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,7 @@ public:
|
||||||
~CheatEngine();
|
~CheatEngine();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void FrameCallback(u64 userdata, int cycles_late);
|
void FrameCallback(u64 userdata, s64 cycles_late);
|
||||||
|
|
||||||
std::vector<CheatList> cheats;
|
std::vector<CheatList> cheats;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue