I want to share with us some thoughs in order to guess if I'm in a good direction or not
I don't have experience in hacking NDS roms, but after some searches, I have following info:
As indicated in libnds, function lcdSwap() has following implementation:
So, as far as I know, if a program changes 15th bit of half word located in address 0x4000304, screens will be swapped
This, coded using ASM, should be like:
And in ARM is:
Assuming up to this point, I haven't said anything stupid... would be a way to inject this code in any homebrew app (compiled using libnds) to force a swap screen?
I suppose that there are a lot of things that I have missed, but I want to know if this is a good start or not.
Thanks!
I don't have experience in hacking NDS roms, but after some searches, I have following info:
As indicated in libnds, function lcdSwap() has following implementation:
Code:
#define REG_POWERCNT *(vu16*)0x4000304
#define PM_ARM9_DIRECT BIT(16)
[...]
POWER_SWAP_LCDS = PM_ARM9_DIRECT | BIT(15);
[...]
static inline void lcdSwap(void) { REG_POWERCNT ^= POWER_SWAP_LCDS; }
This, coded using ASM, should be like:
Code:
mov r0, #4
lsl r0, r0, #0x18
add r0, r0, #0x304
ldrh r1, [r0]
lsl r1, r1, #18
lsr r1, r1, #18
strh r1, [r0]
Code:
0400A0E3
000CA0E1
C10F80E2
B010D0E1
0119A0E1
2119A0E1
B010C0E1
I suppose that there are a lot of things that I have missed, but I want to know if this is a good start or not.
Thanks!
Last edited by xonn,