dmnt-cheat: Add support for saving/restoring cheat toggle state

This commit is contained in:
Michael Scire 2019-03-25 10:35:08 -07:00
parent 20ba6432b9
commit f4950ff26e
3 changed files with 333 additions and 157 deletions

View file

@ -11,4 +11,8 @@ usb30_force_enabled = u8!0x0
power_menu_reboot_function = str!payload
; Controls whether dmnt cheats should be toggled on or off by
; default. 1 = toggled on by default, 0 = toggled off by default.
dmnt_cheats_enabled_by_default = u8!0x1
dmnt_cheats_enabled_by_default = u8!0x1
; Controls whether dmnt should always save cheat toggle state
; for restoration on new game launch. 1 = always save toggles,
; 0 = only save toggles if toggle file exists.
dmnt_always_save_cheat_toggles = u8!0x0

File diff suppressed because it is too large Load diff

View file

@ -42,8 +42,13 @@ class DmntCheatManager {
static void ResetAllCheatEntries();
static CheatEntry *GetFreeCheatEntry();
static CheatEntry *GetCheatEntryById(size_t i);
static CheatEntry *GetCheatEntryByReadableName(const char *readable_name);
static bool ParseCheats(const char *cht_txt, size_t len);
static bool LoadCheats(u64 title_id, const u8 *build_id);
static bool ParseCheatToggles(const char *s, size_t len);
static bool LoadCheatToggles(u64 title_id);
static void SaveCheatToggles(u64 title_id);
static void ResetFrozenAddresses();
public: