Users browsing this thread: 1 Guest(s)
Addresses After Editing Events
07-19-2020, 09:59 PM
I've been browsing the help files on this page and looking through the tools available and had a question about editing the hex events. I have never edited a ROM before but my previous experience with hex and assembly left me with a question:
If I edit an existing event by adding actions that were not previously there, won't the additional data shift everything after it forward however many bytes it added, thus causing all of their address references to be off? Can you move it to the end of the file and update the event trigger address to preserve the integrity of the surrounding data? Do you just overwrite any data that comes after it instead of shifting it (the tutorial screenshots seemed to be overwriting)?
If I edit an existing event by adding actions that were not previously there, won't the additional data shift everything after it forward however many bytes it added, thus causing all of their address references to be off? Can you move it to the end of the file and update the event trigger address to preserve the integrity of the surrounding data? Do you just overwrite any data that comes after it instead of shifting it (the tutorial screenshots seemed to be overwriting)?
07-20-2020, 09:29 AM
Any event must start in the $CA-$CC banks because of what event offset can take NPCs / event triggers. However you can insert a B2 command in banks $CA-$CC that let you call an event routine elsewhere in the ROM and continue your event anywhere past bank $CC. And yes, normally you would overwrite the bytes when editing something instead of inserting them to not shift everything after.
07-20-2020, 06:12 PM
(07-20-2020, 09:29 AM)madsiur Wrote: Any event must start in the $CA-$CC banks because of what event offset can take NPCs / event triggers. However you can insert a B2 command in banks $CA-$CC that let you call an event routine elsewhere in the ROM and continue your event anywhere past bank $CC. And yes, normally you would overwrite the bytes when editing something instead of inserting them to not shift everything after.
Okay, thank you. I saw the B2 command and wondered if that was good to use if I wanted to extend an existing event while preserving the integrity of the data surrounding it.
07-20-2020, 11:11 PM
(07-20-2020, 06:12 PM)Fast Moon Wrote: I saw the B2 command and wondered if that was good to use if I wanted to extend an existing event while preserving the integrity of the data surrounding it.
Yes, that's its use. You just make room for 4 bytes in banks $CA-$CC, put those 4 bytes in the empty space where you jump to, then add your stuff and finish by a return byte ($FE).
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)