Users browsing this thread: 2 Guest(s)
Some final code requests (and screenshots)

Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 159
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
(10-26-2018, 06:09 PM)Lightning Wrote:
(10-26-2018, 04:18 PM)Gi Nattak Wrote: Basically it's done by going into the Level Editor to locate either the NPC or event trigger of the boss (depends on how the battle is triggered, such as Atma Weapon on the Floating Continent map where you must talk to him to initiate the battle) and finding what the offset is for the event code associated with it, it'll show this offset when you select it, among other info. It helps to remove the header before going into the Level Editor to get the exact offset without having to factor in the +200 for offsets. Then once you know the address you can use the event dump and navigate right to that, as well as see the breakdown of the whole event code dealing with the battle.

You'd then do the jump to free space technique and add the play song command of F0 XX, making sure it's right before the battle to make it as seamless as possible. Depending on the boss battle, you may wind up needing to relocate the whole thing if it starts right off with the 'Invoke battle', it depends.

I think I'll work on a small guide, with some pics and elaboration on what I'm about to go into, but for now here is a brief breakdown of Atma Weapon to give you an idea.

Step 1) Go into the Level Editor (headerless ROM) and go to the map with Atma Weapon on it:
[$18A] Floating Continent, Outside

Step 2) Enable at the top the NPCs to be shown (View>NPCs). Then, under the map name you'll see 'NPCS', so click on that tab. Then locate the NPC that is Atma Weapon on the map. Atma is NPC #0 here, which is actually going to be NPC $10 in the event/hex... Anyways, select Atma, NPC #0, and you'll see there in the little window labeled 'Event' the event address associated with this battle. It is DA30. That is going to be address CA/DA30. If it was 1DA30 it'd be CB/DA30. And if it was 2B/DA30 it'd be CC/DA30. These are the three event code banks. So, since this is DA30, it is CA/DA30.

Step 3) Make ready your hex editor with event dump document in hand and go to CA/DA30. You will see the event code there for the Atma Weapon battle...okay I need to stop here, because looking at your ROM/Gen. Leo Edition I see that fedorajoe made an edit to this exact event already, my guess to deal with something Shadow-related. You can see at CA/DA2F that he does a B2 jump: B2 A4 0D 02, which is address CC/0DA4 (the 02 is bank CC and first and last bytes are reversed, so a jump to CC0DA4 in hex would be B2 A4 0D 02...confusing shit, I know.) so going there he has the relocated code for the battle, and a bunch of free space afterwords. So he already did the work for us in this case lol, you'd just need to put the play song command there before the 4D 50 3F (Invoke battle, enemy set $50, background $3F) and move his code 2 bytes further ahead.

All this is pretty damn challenging to explain and depict over typing... please ask questions about anything and I or others can try to elaborate. There's things I did not explain like how to 'display offset as SNES HiROM' if your using WindHex that is, in order to see the bank of the offset, which can help when first starting to understand the correlation between bank and address/offset. And I'm beginning to ramble so I should stop for now lol.

well, I successfully added the F0 XX command to the already moved ATMA code, so your tutorial so far is working.  Now I need to do the hard part and find more events to move and tweak!  I think I'll start with the ATMA encounter in Kefka's tower. Smile  I meant to ask, when you use the B2 jump command, do you have to end that set of code with another command that goes back to the original position, or does the game automatically do that?

Good stuff!

After using B2 to jump to another address, usually you will just need to put an FE byte at the end of the code, this will tell it to Return back to the code directly AFTER the B2 jump command. Always have an FE at the end of your code or it will crash. Usually an FE is all that's needed, but, sometimes, depending on what's going on exactly with the event code, you'll wind up having to do a B2 jump back instead of just an FE. I forget the exact circumstances where this is needed, but I do remember having to do it sometimes or else the event would be on a loop or something terrible. But still remember to put an FE at the end regardless. ALSO, sometimes, again depending on what exactly the event code entails, you'll have to move the whole entire event code to the new spot so it can run completely without having any jumps at all, or the event will loop and loop forever. So keep this in mind if you ever have that happening.


We are born, live, die and then do the same thing over again.
Quote  



Messages In This Thread
RE: Some final code requests (and screenshots) - by Gi Nattak - 10-26-2018, 10:33 PM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite