diff --git a/sysmodules/rosalina/include/menus/cheats.h b/sysmodules/rosalina/include/menus/cheats.h index cd66c6c..b95e36c 100644 --- a/sysmodules/rosalina/include/menus/cheats.h +++ b/sysmodules/rosalina/include/menus/cheats.h @@ -33,4 +33,4 @@ #define CHEATS_PER_MENU_PAGE 18 void RosalinaMenu_Cheats(void); -void Cheat_ApplyKeyCheats(); +void Cheat_ApplyCheats(); diff --git a/sysmodules/rosalina/source/menu.c b/sysmodules/rosalina/source/menu.c index ae32bf3..7d1145e 100644 --- a/sysmodules/rosalina/source/menu.c +++ b/sysmodules/rosalina/source/menu.c @@ -169,9 +169,7 @@ void menuThreadMain(void) } else { - if (HID_PAD & 0xFFF) { - Cheat_ApplyKeyCheats(); - } + Cheat_ApplyCheats(); } svcSleepThread(50 * 1000 * 1000LL); } diff --git a/sysmodules/rosalina/source/menus/cheats.c b/sysmodules/rosalina/source/menus/cheats.c index beb543f..ed8cad9 100644 --- a/sysmodules/rosalina/source/menus/cheats.c +++ b/sysmodules/rosalina/source/menus/cheats.c @@ -465,7 +465,7 @@ static u32 Cheat_ApplyCheat(const Handle processHandle, const CheatDescription* case 0xB: // B Type // Format: BXXXXXXX 00000000 - // Description: Loads offset register. + // Description: Loads offset register with value at given XXXXXXX if (!skipExecution) { u32 value; @@ -1120,16 +1120,12 @@ static u32 Cheat_GetCurrentPID(u64* titleId) } } -void Cheat_ApplyKeyCheats(void) +void Cheat_ApplyCheats(void) { if (!cheatCount) { return; } - if (!hasKeyActivated) - { - return; - } u64 titleId = 0; u32 pid = Cheat_GetCurrentPID(&titleId); @@ -1151,9 +1147,13 @@ void Cheat_ApplyKeyCheats(void) u32 keys = HID_PAD & 0xFFF; for (int i = 0; i < cheatCount; i++) { - if (cheats[i]->active && cheats[i]->keyActivated && (cheats[i]->keyCombo & keys) == keys) + if (cheats[i]->active && !(cheats[i]->keyActivated)) { Cheat_MapMemoryAndApplyCheat(pid, cheats[i]); + } + else if (cheats[i]->active && cheats[i]->keyActivated && (cheats[i]->keyCombo & keys) == keys) + { + Cheat_MapMemoryAndApplyCheat(pid, cheats[i]); } } }