Pages: 1
Posted on 09-20-20, 10:34 am


Karma: 2
Posts: 1/1
Since: 09-20-20
Hello to everyone.
I'm trying to hack some lines of jEnesisDS emulator in order to swap screens. I found a line where there's a function that is called just after rom load, and I replaced a line with a branch to another memory address where I put new code (and after execute it, I return to following line after forced branch).
The problem is where to jump, if I go to address 0x160 (rom header) or if jump to rom near end (to take advantage of some lines with zeros and not destroy original code) the program freezes in a real hardware.
However, if I do a little jump (20-30 lines ahead), it works perfectly, but I'm overwriting code. So I ask: is there a problem with long jumps, or is there a "branch protection" that avoid users hack NDS files?
I hope have explained correctly, and thanks for your time
Posted on 09-22-20, 03:51 pm
Mariomaster

Karma: 8528
Posts: 1582/1681
Since: 06-09-12
You adapt the asm patch template for NSMB to insert code into your ROM. It pushes back the main heap by the amount of custom code you add.
_________________________
GitHub - Kuribo64 - YouTube
Pages: 1