FF6 Hacking
Addresses After Editing Events - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Addresses After Editing Events (/thread-4024.html)



Addresses After Editing Events - Fast Moon - 07-19-2020

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)?


RE: Addresses After Editing Events - madsiur - 07-20-2020

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.


RE: Addresses After Editing Events - Fast Moon - 07-20-2020

(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.


RE: Addresses After Editing Events - madsiur - 07-20-2020

(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).