Fixed cheat functionality (#1117)
This commit is contained in:
parent
bc06b17823
commit
2219b19d5f
@ -33,4 +33,4 @@
|
|||||||
#define CHEATS_PER_MENU_PAGE 18
|
#define CHEATS_PER_MENU_PAGE 18
|
||||||
|
|
||||||
void RosalinaMenu_Cheats(void);
|
void RosalinaMenu_Cheats(void);
|
||||||
void Cheat_ApplyKeyCheats();
|
void Cheat_ApplyCheats();
|
||||||
|
@ -169,9 +169,7 @@ void menuThreadMain(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (HID_PAD & 0xFFF) {
|
Cheat_ApplyCheats();
|
||||||
Cheat_ApplyKeyCheats();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
svcSleepThread(50 * 1000 * 1000LL);
|
svcSleepThread(50 * 1000 * 1000LL);
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,7 @@ static u32 Cheat_ApplyCheat(const Handle processHandle, const CheatDescription*
|
|||||||
case 0xB:
|
case 0xB:
|
||||||
// B Type
|
// B Type
|
||||||
// Format: BXXXXXXX 00000000
|
// Format: BXXXXXXX 00000000
|
||||||
// Description: Loads offset register.
|
// Description: Loads offset register with value at given XXXXXXX
|
||||||
if (!skipExecution)
|
if (!skipExecution)
|
||||||
{
|
{
|
||||||
u32 value;
|
u32 value;
|
||||||
@ -1120,16 +1120,12 @@ static u32 Cheat_GetCurrentPID(u64* titleId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cheat_ApplyKeyCheats(void)
|
void Cheat_ApplyCheats(void)
|
||||||
{
|
{
|
||||||
if (!cheatCount)
|
if (!cheatCount)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!hasKeyActivated)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 titleId = 0;
|
u64 titleId = 0;
|
||||||
u32 pid = Cheat_GetCurrentPID(&titleId);
|
u32 pid = Cheat_GetCurrentPID(&titleId);
|
||||||
@ -1151,7 +1147,11 @@ void Cheat_ApplyKeyCheats(void)
|
|||||||
u32 keys = HID_PAD & 0xFFF;
|
u32 keys = HID_PAD & 0xFFF;
|
||||||
for (int i = 0; i < cheatCount; i++)
|
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]);
|
Cheat_MapMemoryAndApplyCheat(pid, cheats[i]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user