From fe6247ddedd59fde1ee765be19c2082a294786c0 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 29 Jan 2022 18:40:19 +0100 Subject: [PATCH] cheats: iOS build fix --- core/cheats.cpp | 2 +- core/cheats.h | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/core/cheats.cpp b/core/cheats.cpp index 2ba661e3c..b894c7f66 100644 --- a/core/cheats.cpp +++ b/core/cheats.cpp @@ -370,7 +370,7 @@ void CheatManager::reset(const std::string& gameId) if (gameId == "VF4 FINAL TUNED JAPAN") { active = true; - cheats.push_back(Cheat{ Cheat::Type::setValue, "Skip DIMM version check", true, 16, 0x000205c6, 9, 0, 1, 0, 0, 0 }); + cheats.emplace_back(Cheat::Type::setValue, "Skip DIMM version check", true, 16, 0x000205c6, 9); } } widescreen_cheat = nullptr; diff --git a/core/cheats.h b/core/cheats.h index 63999475b..5e091e947 100644 --- a/core/cheats.h +++ b/core/cheats.h @@ -42,17 +42,25 @@ struct Cheat runNextIfLt, copy }; - Type type = Type::disabled; + Type type; std::string description; - bool enabled = false; - u32 size = 0; - u32 address = 0; - u32 value = 0; - u8 valueMask = 0; - u32 repeatCount = 1; - u32 repeatValueIncrement = 0; - u32 repeatAddressIncrement = 0; - u32 destAddress = 0; + bool enabled; + u32 size; + u32 address; + u32 value; + u8 valueMask; + u32 repeatCount; + u32 repeatValueIncrement; + u32 repeatAddressIncrement; + u32 destAddress; + + Cheat(Type type = Type::disabled, const std::string& description = "", bool enabled = false, u32 size = 0, u32 address = 0, + u8 valueMask = 0, u32 repeatCount = 1, u32 repeatValueIncrement = 0, + u32 repeatAddressIncrement = 0, u32 destAddress = 0) + : type(type), description(description), enabled(enabled), size(size), address(address), valueMask(valueMask), + repeatCount(repeatCount), repeatValueIncrement(repeatValueIncrement), repeatAddressIncrement(repeatAddressIncrement), destAddress(destAddress) + { + } }; class CheatManager