Hello guys!
I'm currently trying (i'm newbie to programming...) to add a menu feature to yifanlu (the Reisyukaku fork)
modified sysmodule "loader". I want to add a menu that show up when launching the notifications applet (or anything else) while pressing a given key. But here is my problem, while compiling the loader module with the ctrulib hid functions loader become bigger than it would be to be injected. And I don't succeed to write to frammebuffer...
So I want to know three things:
- firstly is there a way to read the hid register (I tried with pointers but didn't work...) without using the hid shared memory with libctru's functions ?
- secondly, if I have to use all the code provided by ctrulib, is there a way to load some code from sdmmc and then execute it? This way, loader could be of the right size and my menu code could be as big as a normal homebrew.
- thirdly, why can't I write to framebuffer? I think it's the right address...
Thank you in advance guys !
PS: English is not my first language, sorry if there is mistakes.
The code that I added in the patch_code() function (except the "#define" parts, that is where it had to be):
I'm currently trying (i'm newbie to programming...) to add a menu feature to yifanlu (the Reisyukaku fork)
modified sysmodule "loader". I want to add a menu that show up when launching the notifications applet (or anything else) while pressing a given key. But here is my problem, while compiling the loader module with the ctrulib hid functions loader become bigger than it would be to be injected. And I don't succeed to write to frammebuffer...
So I want to know three things:
- firstly is there a way to read the hid register (I tried with pointers but didn't work...) without using the hid shared memory with libctru's functions ?
- secondly, if I have to use all the code provided by ctrulib, is there a way to load some code from sdmmc and then execute it? This way, loader could be of the right size and my menu code could be as big as a normal homebrew.
- thirdly, why can't I write to framebuffer? I think it's the right address...
Thank you in advance guys !
PS: English is not my first language, sorry if there is mistakes.
The code that I added in the patch_code() function (except the "#define" parts, that is where it had to be):
Code:
#define BUTTON_A (1 << 0)
#define BUTTON_L (1 << 9)
#define BUTTON_B (1 << 1)
#define HID (~*(u32 *)0x10146000)
//want to run that code only if A and L are pressed
//u8 key = (HID & 0xFFF) == ((BUTTON_A | BUTTON_L) & 0xFFF) ? 1 : 0;
if((progid == 0x000400300000A002) /*&& key == 1*/) { //EUR notifications applet
int cnt;
u8 *framebuffer = ((u32 *)0x18000000 + 0x48F000); //vram addr for bottom framebuffer
while(1) {
//want to break and launch title when B is pressed
//key = (HID & 0xFFF) == ((BUTTON_A | BUTTON_L) & 0xFFF) ? 1 : 0;
for(cnt = 0; cnt < 0x38400; cnt++) {
framebuffer[cnt] = 0xFF;
}
}
}