Language…
11 users online: Darolac, howardadam1126, isaix, lean4, obiet, Oskise,  Segment1Zone2, Shiki_Makiro, SpacePea, underway, Zavok - Guests: 260 - Bots: 327
Users: 64,795 (2,377 active)
Latest user: mathew

[Resolved] Wanting to insert extra instructions into some of the code.

I wanted to add some extra instructions in various places throughout the rom.

Only problem is there isn't enough room to do it inline so I thought of cutting the code out and putting it into a function.

By running a debugger and manually stitching in my new code I got it to work.

All I need to do now is apply this change to the rom to make it permanent but I'm not sure where to put the function in the rom.

Where do I go about adding a new function into the rom?

I'm using an extended US version.
Originally posted by bluelightzero
All I need to do now is apply this change to the rom to make it permanent but I'm not sure where to put the function in the rom.

Where do I go about adding a new function into the rom?


There are many unused functions in ROM that you can overwrite if you want. 0x80246050-0x8024616F (ROM 0x001050-0x00116F) and the one immediately after it are pretty good. If you need more space, then the usual route is to start using an unused portion of ROM (like 0x7CC6C0 as you have found) and use DMA to copy it to expansion RAM.

David has an example provided with his Simple Armips GUI tool called "04_DmaCopy.asm" which demonstrates how to use the built-in DmaCopy function.
Thanks the unused functions are perfect.

Have a nice day. #smrpg{y}