Skip to content

Commit

Permalink
fix buttons and boot issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RShadowhand committed May 24, 2016
1 parent d02544b commit a97bf40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion payload_stage1/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main()

u32 pressed = HID_PAD;

if(pressed == SAFE_MODE || pressed == BUTTON_UP) //if home button is pressed
if(pressed == BUTTON_DOWN) //if home button is pressed
{
//Jump to alternate stage2
sdmmc_nand_readsectors(0x5A000, 0x64, (u8*)0x08006000);
Expand Down
15 changes: 4 additions & 11 deletions payload_stage2/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,17 @@ void main()
FIL payload;
unsigned int br;

const char firstPayload[] = "bootmgr.bin";
const char secondPayload[] = "arm9loaderhax.bin";

f_mount(&fs, "0:", 0); //This never fails due to deferred mounting
prepareForBoot();
if(f_open(&payload, firstPayload, FA_READ) == FR_OK)
{
f_read(&payload, (void *)PAYLOAD_ADDRESS, f_size(&payload), &br);
((void (*)())PAYLOAD_ADDRESS)();
}
else if(f_open(&payload, secondPayload, FA_READ) == FR_OK)
if(f_open(&payload, "arm9loaderhax.bin", FA_READ) == FR_OK)
{
prepareForBoot();
f_read(&payload, (void *)PAYLOAD_ADDRESS, f_size(&payload), &br);
((void (*)())PAYLOAD_ADDRESS)();
}
else
{
error("Couldn't find the payload.\nMake sure to have arm9loaderhax.bin in the root.");
prepareForBoot();
error("Couldn't find the payload.\nMake sure to have arm9loaderhax.bin in the root.");
}
}

Expand Down

0 comments on commit a97bf40

Please sign in to comment.