From ada3e0978476afc7ddec14e204f8f8d083ba8714 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sun, 24 Apr 2016 19:23:40 +0200 Subject: [PATCH] Added L+A payload --- loader/source/buttons.h | 1 + loader/source/main.c | 1 + source/buttons.h | 5 ++--- source/firm.c | 2 +- source/fs.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/loader/source/buttons.h b/loader/source/buttons.h index d032df8..336eaf5 100644 --- a/loader/source/buttons.h +++ b/loader/source/buttons.h @@ -7,6 +7,7 @@ #define BUTTON_LEFT (1 << 5) #define BUTTON_UP (1 << 6) #define BUTTON_DOWN (1 << 7) +#define BUTTON_A 1 #define BUTTON_X (1 << 10) #define BUTTON_Y (1 << 11) #define BUTTON_R1 (1 << 8) diff --git a/loader/source/main.c b/loader/source/main.c index 8daa78a..e255006 100644 --- a/loader/source/main.c +++ b/loader/source/main.c @@ -51,6 +51,7 @@ void main(void) ((pressed & BUTTON_X) && LOAD_PAYLOAD("x")) || ((pressed & BUTTON_Y) && LOAD_PAYLOAD("y")) || ((pressed & BUTTON_R1) && LOAD_PAYLOAD("r")) || + ((pressed & BUTTON_A) && LOAD_PAYLOAD("a")) || ((pressed & BUTTON_SELECT) && LOAD_PAYLOAD("sel")) || LOAD_PAYLOAD("def")) ((void (*)())PAYLOAD_ADDRESS)(); diff --git a/source/buttons.h b/source/buttons.h index 9a65de4..9c9b884 100644 --- a/source/buttons.h +++ b/source/buttons.h @@ -19,9 +19,8 @@ #define BUTTON_LEFT (1 << 5) #define BUTTON_UP (1 << 6) #define BUTTON_DOWN (1 << 7) -#define BUTTON_L1R1 (BUTTON_R1 | BUTTON_L1) -#define SAFE_MODE (BUTTON_L1R1 | BUTTON_A | BUTTON_UP) +#define SAFE_MODE (BUTTON_R1 | BUTTON_L1 | BUTTON_A | BUTTON_UP) #define OVERRIDE_BUTTONS (BUTTON_B ^ 0xFFF) #define SINGLE_PAYLOAD_BUTTONS (BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN | BUTTON_START | BUTTON_X | BUTTON_Y) -#define L_PAYLOAD_BUTTONS (BUTTON_R1 | BUTTON_SELECT) +#define L_PAYLOAD_BUTTONS (BUTTON_R1 | BUTTON_A | BUTTON_SELECT) #define MENU_BUTTONS (BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN | BUTTON_A | BUTTON_START) \ No newline at end of file diff --git a/source/firm.c b/source/firm.c index 5a4ebfa..ef6ca70 100755 --- a/source/firm.c +++ b/source/firm.c @@ -406,6 +406,6 @@ static inline void launchFirm(u32 bootType) //Set ARM11 kernel entrypoint *arm11 = (u32)firm->arm11Entry; - //Final jump to arm9 kernel + //Final jump to ARM9 kernel ((void (*)())firm->arm9Entry)(); } \ No newline at end of file diff --git a/source/fs.c b/source/fs.c index eb60c64..604117b 100644 --- a/source/fs.c +++ b/source/fs.c @@ -96,12 +96,12 @@ void firmRead(void *dest, const char *firmFolder) //Complete the string with the .app name memcpy(&path[34], "/00000000.app", 14); + //Last digit of the .app u32 i = 42; //Convert back the .app name from integer to array while(id > 0) { - //Last digit of the .app static const char hexDigits[] = "0123456789ABCDEF"; path[i--] = hexDigits[id & 0xF]; id >>= 4;