Ok, i've used for now old dark_samus a9lh installer (had the files already):
https://github.com/dark-samus/arm9loaderhax/tree/1ee8d8849bf8c340bc1421b8a642b8d64d31d165
payload_stage1 > main.c (for A Button)
Code:
#include "common.h"
#include "sdmmc.h"
#include "i2c.h"
#define HID_PAD ((~*(u16*)0x10146000) & 0xFFF)
#define BUTTON_A (1 << 0)
#define BUTTON_B (1 << 1)
u16 pressed;
int main()
{
// Initialize sdcard and nand
*(vu32*)0x10000020 = 0;
*(vu32*)0x10000020 = 0x340;
sdmmc_sdcard_init();
pressed = HID_PAD;
if (pressed & BUTTON_A) //if a button is pressed
{
//Jump to alternate stage2
sdmmc_nand_readsectors(0x5A000, 0x20, (u8*)0x08006000);
}
else
{
//jump to normal stage2
sdmmc_nand_readsectors(0x5C000, 0x20, (u8*)0x08006000);
}
// Jump to secondary payload
((void (*)())0x08006000)();
return 0;
}
To use B Button change the line to " if (pressed & BUTTON_B) //if b button is pressed "
Currently i'm too tired adding this to aurora's SafeA9LHInstaller... nightshift and +12h without sleep ^^'''
It works, a9lh and gw a9lh