From af83d31e8d2b63b89353fd0eb7e7af9c4c187a49 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sat, 20 Feb 2016 23:25:00 +0100 Subject: [PATCH] New button combos No more complaints about triggering the cameras! --- source/firm.c | 15 +++++++-------- source/firm.h | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/source/firm.c b/source/firm.c index 01d2ff7..57da2e6 100755 --- a/source/firm.c +++ b/source/firm.c @@ -36,10 +36,9 @@ u8 loadFirm(u8 a9lhBoot){ section = firmLocation->section; - /* If L and R are pressed on a 9.0/2 SysNAND, or L on an updated - SysNAND, boot 9.0 FIRM */ - if((!updatedSys && (pressed & BUTTON_L1R1) == BUTTON_L1R1) || - (updatedSys && (pressed & BUTTON_L1R1) == BUTTON_L1)) mode = 0; + /* If L is pressed, and on an updated SysNAND setup the SAFE MODE combo + is not pressed, boot 9.0 FIRM */ + if((pressed & BUTTON_L1) && !(updatedSys && pressed == SAFEMODE)) mode = 0; //If not using an A9LH setup, do so by decrypting FIRM0 if(!a9lhSetup && !mode){ @@ -116,10 +115,10 @@ u8 loadEmu(void){ //Patches u8 patchFirm(void){ - /* If L is pressed on a 9.0/9.2 SysNAND, or L+R on a > 9.2 SysNAND, - or the 9.0 FIRM is loaded on a > 9.2 SysNAND, boot emuNAND */ - if((updatedSys && (!mode || ((pressed & BUTTON_L1R1) == BUTTON_L1R1 && - pressed != SAFEMODE))) || (!updatedSys && mode && !(pressed & BUTTON_L1))){ + /* If L or R aren't pressed on a 9.0/9.2 SysNAND, or the 9.0 FIRM is selected + or R is pressed on a > 9.2 SysNAND, boot emuNAND */ + if((updatedSys && (!mode || ((pressed & BUTTON_R1) && pressed != SAFEMODE))) || + (!updatedSys && mode && !(pressed & (BUTTON_L1 | BUTTON_R1)))){ if (loadEmu()) return 1; } else if(a9lhSetup){ diff --git a/source/firm.h b/source/firm.h index 8d81074..336045c 100644 --- a/source/firm.h +++ b/source/firm.h @@ -10,10 +10,10 @@ #define PDN_MPCORE_CFG (*(u8*)0x10140FFC) #define HID_PAD ((~*(u16*)0x10146000) & 0xFFF) -#define BUTTON_L1R1 (3 << 8) +#define BUTTON_R1 (1 << 8) #define BUTTON_L1 (1 << 9) #define BUTTON_A 1 -#define SAFEMODE (BUTTON_L1R1 | BUTTON_A | (1 << 6)) +#define SAFEMODE (BUTTON_L1 | BUTTON_R1 | BUTTON_A | (1 << 6)) #define PATCHED_FIRM_PATH "/rei/patched_firmware.bin" u8 loadFirm(u8 a9lhSetup);