øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=1754.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1d22.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1754.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index1d22.html.zxçCg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈÀ™d.rOKtext/htmlISO-8859-1gzip@øÕ.rÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:54:36 GMT0ó°° ®0®P®€§²ð®åCg^ÿÿÿÿÿÿÿÿ>™.r Print Page - Unknown info from FF4 that would be great to know

Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Pinkpuff on September 10, 2012, 10:27:11 AM

Title: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on September 10, 2012, 10:27:11 AM
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on September 10, 2012, 11:54:10 AM
The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 10, 2012, 01:55:11 PM
Interesting list. I had noticed those bytes aren't enabled in the latest editor, likely because of the belief that they did nothing. Though having a "Weapon Durability system" like FFL does sound like an admittedly interesting idea if that's what the Arrow byte does.

Good finding on the Two-handed equipment, I did not notice that at all. The Key Items list may not be so difficult to find, since the Legend sword is the odd man out in the list.

I would imagine that the Dark Wave Command parameters would be around the other commands like Focus, Jump, Kick, that sort of thing... which to my knowledge we've not found a single one of these.

One of my personal curiosities is what the Dummy (Crash) for Cid was supposed to do. Several Japanese guidebooks apparently said it was something like "Airstrike", but using it clearly, does nothing of the sort. I wonder if it can be repaired or if it was just never completed.

Also what exactly is Item 60? The FAQ I've found lists it right after Artemis Arrows and has "??????" for all of its data. When I hack it into the game, it shows up as an unusable item with no name but here's the strangest part, if you take it into battle with you, after the battle it will be gone. It shows up as usable in the battle, but it just gives you the "Error" sound when you try to use it. What is this item even classified as, anyhow? It's clearly not a legitimate null item, since that's as expected 00. Might it deal something with Arrows? Since it is strange it would vanish after battle.



Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on September 10, 2012, 04:36:40 PM
That item is used for the default evasion value for each armor slot when you don't have anything equipped in them.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 10, 2012, 06:04:18 PM
Ah... for some reason I had thought that was tied into Item 00, so it seems that there's a default "No Armor" item as well.
Thanks for the information.

Also I've been using Cheat Engine to try and find some info. but its clear going by the older documents that this is not how the data is meant to be viewed. Would you happen to know of a RAM editor for the SNES? I've taken a few looks, but each have come up empty.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on September 10, 2012, 10:28:39 PM
  • Armor equip slots: The armors have flags that seem to be set corresponding to what equip slot the armor goes in (Head, Body, Arms, Hand). However, like with the weapon equip properties above, changing these bits has no effect on what slot the armor actually can equip. I suspect that as above something is checking the index range, as once again, the armors of the same equip slot are all next to each other.

I'm pretty convinced that most of the coding for this is probably terrible since something like this should be fundamentally pretty easy to do codewise, but very likely deadlines were responsible for it...

Quote
  • Key items: The game seems to treat some items as key items (they appear yellow in the item list and you can't drop them or sell them) and the item data does not seem to have such a flag corresponding to this property. It could be that there's a table or list of them somewhere; in any case being able to change this would definitely be a huge plus to anyone doing any kind of major hacking project.

If you are clever enough with a debugger, you may want to put many key items in the inventory, such as the Pink Tail and give some to the tail guy. A trace could probably provide some insight as to where they are being checked from. The Legend Sword is also one of them, and that will most certainly be part of the list, despite being in the middle of nowhere...

Quote
  • Spell casting animations: By this I mean, some spells when you cast them produce a green ring around your character and the black magic casting sound. Others produce white cubes and the white magic casting sound. As with the item properties above, it seems like these are hard-coded by index as there does not seem to be any flags in the spell data indicating this information, and the ones with like properties are next to each other in the list. It would be great to be able to change this property so that you can, say, replace a formerly black spell with a white one and not have it produce a black casting animation when your character casts it.

I know Phoenix did some work in this area regarding spell learning, but I'm unsure if he make sure the spell animations correlate... White, Black/Ninja, and Summon are all accessed by their index, so a trace regarding this is probably necessary.

Quote
  • Out-of-battle effects of items and spells: There was some discussion in the thread for the editor that mentioned that these kinds of effects appear to be triggering map events of some kind. It would be great to know what spells are triggering what events, and even better would if it would be possible to edit which spells and items trigger which events.

Some Event trigger examples:
Exit and Warp spells
Alert/Siren item - monster summon
Dwarfbread -  map overhead effect (same with the spell Sight)
Tent/Cabin - save/overworld animation
Summon items - Cockatrice, Goblin/Imp, Mage, Bomb
Flute/Whistle - Big Chocobo summoning
Emergency Exit - same as Exit spell in item form (except it won't cast Exit in battle - strange IMO)
I'm not sure if the SomaDrop+Apples are event items....
Magazine - does this need an explanation?

I think that covers most of it.

The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.

Yea, I remember that. I wonder if it is tied to any code that gives you 10 of said item. All Arrows are usually given in that quantity... it could be strictly for arrows (not checking the bit, but the index range). I haven't exactly tested that out.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 11, 2012, 06:49:29 AM
Welcome back Deathlike2!

As for events... as strange as it is and how simple it would be to write the Summon Learnings as events, they seem to be classified as something entirely different. The same follows with the Apples and Soma Drops. Sirens also don't seem to correspond with events it appears.

Good catch on the Big Chocobo Whistle though, not sure where the sound effect comes in as no event seems to deal with that (That is Event 4D).


EDIT: I've been doing a bit of testing with the 1E and 1F Commands to see if their 100% status still applied despite being used independent of their original attack, but on a Dark Sword it seems 100% or near 100% that if a status can be applied it Will be applied. I believe this also follows through with Harps, now I'm curious to know if there's some internal percentage chance for weapon types to apply their status.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 20, 2012, 12:50:52 AM
Quote from: Deathlike2

The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.

Yea, I remember that. I wonder if it is tied to any code that gives you 10 of said item. All Arrows are usually given in that quantity... it could be strictly for arrows (not checking the bit, but the index range). I haven't exactly tested that out.



I just tested this by giving the Shadow Sword an Arrow Byte. Unfortunately the game does not recognize the Shadow Sword as a consumable item so you can only have one equipped. When you do attack it vanishes like it was an Arrow. Finally placing it inside a chest will not give you 10, it will still only give 1.
Title: Re: Unknown info from FF4 that would be great to know
Post by: darkmage on September 21, 2012, 05:25:12 PM
One thing I would like to see as an option for this editor is for increasing the palette size for overworld/menu/battle palettes from the godawful 3BPP/8BPP limit. There's a method that was described in this post (http://slickproductions.org/forum/index.php?topic=165.msg2072#msg2072). It might involve expanding the ROM; I've never really looked at messing with FF4, especially after reading this board and learning what a gum-up the engine is. But having this might get me to look at it - time permitting, of course.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 26, 2012, 06:22:48 PM
  • Out-of-battle effects of items and spells: There was some discussion in the thread for the editor that mentioned that these kinds of effects appear to be triggering map events of some kind. It would be great to know what spells are triggering what events, and even better would if it would be possible to edit which spells and items trigger which events.

Finally found this! I've been looking for several weeks off and on but it seems my work has paid off. You should now be able to change what each out-of-battle Spell and Item does!

This one was quite tricky to find. I started with a breakpoint on the secondary item pointer as I had with the Summon Items on the Magazine and sure enough I came across another SBC command. Ordinarily when subtraction are used in FFIV it's used to put things in an index. The first SBC I found was at 0x1A702 - Sure enough when I changed it the Event of the Magazine would change, but the changes were sporadic and there was no rhyme or reason. I couldn't fathom why this was. I put another breakpoint, I believe on the SBC at 0x1A702 to see where this was taking us to, and found another SBC down the line. This time it was an E1 at 0x01A854. This had rhyme and reason. I changed that to E2 and suddenly the Exit Item was now a Warp Item. This is because Because E5-E2=3 E5-E1=04. So I wrote down a list and came across a strange truth.

The game looks at an index from 00-07 in order to activate specific events. I quickly recorded the eight events, then looked closer in the data and saw what I was subtracting was actually being stored somewhere and with that information I came across a "Secondary Event Identifier" at 7E1A03 - This is where the subtracted item was being stored and sure enough it matched up with my list.

I set a breakpoint of Write on that, expecting to finally find the answer, but each attempt ended up in disappointment and loops. Then absent-mindedly today when I was tracing its data I accidentally set the breakpoint to Read or Execute and I found all of the information I need and where this sequence of 00-07 grabs its information. Here are the RAM values...

8260 - 03
8264 - 87 (Event Number corrsponding to Warp)
8269 - 04
826D - 86 (Event Number corresponding to Exit)
8272 - 05
8276 - FB (Event Number corresponding to Sight)
827B - 06
827F - 01 (?? Siren ??)
8286 - DB (Event Number corresponding to Magazine)

Here are the ROM values. (Still missing the Tent/Cabin oddly enough, even though they should have been included with the numbers, Siren might be something completely different.)


0x464 - Warp
0x46D - Exit (Includes Item and Spell)
0x476 - Sight (Includes Item and Spell)
0x486 - Magazine

0x1B97 - Tent?

It's not perfect and it's still a bit messy (I have no idea where Cabins and Sirens are, for instance) nor does it allow you to choose which items can use which event or spell for that matter. But it's a start, I guess)

I'm honestly not sure what the point of this immediate information is as, if you really wanted to, you could just modify their base event to what you wanted, but hopefully this information will serve purpose down the line.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 10, 2013, 01:23:25 PM
Well it's been a while since I've done any real hacking in FFIV, and I wanted to get back into the groove of things. I managed to find the location of Ether's value (outside of battle) and how the game reaches it's value. All v1.1 ROM's for any ROM mentions.

The first thing the game does is draw a value from

0x0F9747 - A simple 01, then using the 0A ASM instructions at 01A604, 05, 06  (Which tells the game to continue to accumulate) it continues to boost that 01 to 02, 04, 08, 10, then it loads it somewhere else and accumulates it again to 20 and for it's final accumulation it adds 30.

I was always under the impression that Ethers outside of battle also restored random amounts of MP, but no. It is a static 48 (AKA Hex 30) If you change the value at 0x0F9747 to 02, Ether1's will then restore 96 MP, and so on and so forth.

In ROM this is located at...

0x079947 - 01 to anything you like. I suppose in theory it should be possible to modify it's accumulation phase as well. but as of yet I'm not sure if any other item uses that. (or this 01 even)

 Hopefully I'll be able to find the rest of the other healing items in short order.

 :edit: Hmm... the more I look at this surrounding data, the more I see a pattern emerging...

0x079947 - 0080 2001 6415 - Data involving Ether1
0x07994A - 0080 2003 6415 - Data involving Ether2?

And I see plenty of other similar data formations. I'll have to take a closer look at all of that.


 :edit: 2 Since I felt I had some good momentum going, I decided to look not just for healing items, but the stat boosting items.

So far I've found Soma Drop's location... and within that given space another pattern emerged to show me the location of the Silver Apple (Golden is conspicuously missing...)

This was done with a simple breakpoint on Rydia's Max MP that when it was written to. I was taken to the end of an instruction block, but becoming more familiar with this game's programming I had a feeling I could simply trace backwards slightly and find it (or at least find another lead) and indeed I did. It was just in the basic instructions without any crazy jumps or loops like they did with healing items.

0x01A754 - Silver Apple's amount of HP Raising - 32 (50)
0x01A761 - Soma Drop's amount of MP raising. - 0A (10)

I'll see what's up with the Golden Apple if I can.


 :edit: 3 Well that didn't take long. Looks like, for whatever reason, Golden Apple is placed roughly 20 bytes above the other two stat items. Same data formation though.
B1 60 18 69 64 00

0x01A73A - Golden Apple's amount of HP Raising 64 (100)

The aforementioned three are located in ROM at...

0xA93A - Golden Apple - 64 (100)
0xA954 - Silver Apple - 32 (50)
0xA961 - Soma Drop - 0A (10)

 :edit: 4 Oh! I'm a fool! The data for healing items had already been found before. Ah well, at least the stat boosting item info is new (I think?)

 :edit: 5 Ah, here's something a bit interesting. I think you can very easily change what stat you want the stat boosting items to raise.

09 00 B1 60 18 69 64 00 - That 09 00 At least is telling the game to write to HP.

0D 00 B1 60 18 69 0A 00 - The 0D 00 is telling the game to write to MP.

If you look at normal character data...

09 of 40 Bytes is the Max HP Byte
0D of 40 Bytes is the Max MP Byte

So if my thoughts are correct you can increase any stat you like with these items. (If I'm not mistaken, maybe even change classes too) this will require some experimentation.

 :edit: Looks like I was right. Rydia eating the Soma Drop changed her name to Yang and gave her Kick.

(http://i112.photobucket.com/albums/n198/LastingDawn/RydiatoYang_zpse4ba7efc.png)

This does have very interesting applications if one wants to take the game in a new direction.... (Possibly, since it doesn't seem to kill Levels, have a set of 3 jobs you can change into at will.

And even better because the game gives two bytes for these to play around with you can change Class and Character without any ill side effects (well they'll have the stats and equipment of the person they switched from, since you are changing only two bytes) but they'll have their own abilities at least. However the problem that you may have noticed by now is something I didn't take into account. It only increments, it doesn't set a value. Now there may be a way to change that, but as of now I could see these items as only working towards "class upgrades" or some such.

 :edit: 7 Well that issue is solved... truly the Heavens smile on me today. First byte change and boom, exactly what I'm looking for.

0D 00 B1 60 18 69 0A 00 - All you have to do is change 60 to 00. That will get rid of the Increment and the game will read it as an overwrite. Now you can choose whichever 3 classes you like and switch to them freely (It should be noted that all that will accomplish is changing Sprite, commands, and available Equips,(possibly Level Ups as well, I haven't tested that) however you will still be equipped with whatever you had originally, (So say you wanted to change Cecil into a Mage, he would still be equipped with all of the Dark Knight gear if you used this method) Also there is no way (without making a special event place for it) for the game to know who belongs to what class. So if you use... Let's say a Mage book on Yang. That will be Yang, from now on, even if you only planned on having it be given to Cecil.

Really this plan works out Marvelously for a Solo Mod, but when there's a party involved, yeah... things get messy. However you can still increase any basic stat you would like with this, just use... http://rb.thundaga.com/ and JCE's hacking document to change the stat you want to increase or set.

 :edit: As great as Geigers is, sometimes it's just so infuriating "not allowed to go into certain ranges where battle data is contained, grumble, grumble..." so back to Cheat Engine for now, which was not made for SNES games and makes actually doing much other than memory editing a bit tricky...

However I looked up how the game puts various equipment on. The breakable bit, as earlier mentioned, does work for non-arrow items, but the issue is that the game will only ever equip one of an item on. But every inventory slot has an extra byte which would be used for diminishing uses of an item and setting that to 2 or above will show a plain number next to the item. This leads me to believe that it is looking at an index for the Arrows specifically, but if that range can be expanded to all weapons, well there might be an interesting game...


 :edit: 9

I think you'll like this one, PinkPuff (for data purposes, I can't see too many people really making use of it's potential)

(http://i112.photobucket.com/albums/n198/LastingDawn/Pic1_zps331a7dae.png)

(http://i112.photobucket.com/albums/n198/LastingDawn/Pic2_zps3d63a041.png)

No tricks here, just a little simple hacking (just one byte change actually)

I was encountering difficulty discovering where the game was looking to decide whether to add a whole stack or just one to weapon counters, I then eventually found the start of the process at 0x01C12E I was at first searching for BNE (Break if Not Equals) since I thought that would be the defining amount and was indeed looking for item 54, which is Iron Arrows. Lo and behold it seems I was looking for CMP (Compare Accumulator with Memory) and noticed that 54. I changed it to 00 and every weapon (and only weapons) equipped
became equipped in bunches. Which means that my Shadow Sword experiment from way back finally succeeded and you can make SaGa-esque weaponry now!

Down the line I would like to try to make it to where using the weapon as an item would consume it. But that's that! I think with this you have a reason to include the "Break if used" byte included on weapons.

The byte is contained at

0x01C234 in RAM and in ROM at...

0xC434 Just change the 54 to whatever index you like and the items will be equipped in bunches.



Hopefully I can find the mystery to Two-Handed ness as well soon.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 10, 2013, 06:31:50 PM
Short answer: Items outside of battle always use a multiplier of 12... or was it 8. I can't recall. I'm pretty sure it's 12.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 10, 2013, 07:09:30 PM
Very nice finds.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 10, 2013, 07:20:56 PM
@ Deathlike2

Yeah, I think that's what all of that x2/x2/x2/x2 x x2/x2/x2/x2 that is going on there adds up to. It all ends up in Hex values in the end.

@ Dragonsbrethren

Thanks! I just also (like literally minutes ago) found how the game looks at Arrows and where that index starts and edited that into my previous post.
Title: Re: Unknown info from FF4 that would be great to know
Post by: JCE3000GT on January 10, 2013, 08:17:58 PM
I at one time I found the info for the two handed and what item is on what slot data, lost the offsets in a hdd crash.  I believe it was an index range data format but I could be remembering incorrectly. I do know it exists...LOL!

I planned on locating this info for my hack I'm working on right now actually... 
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 10, 2013, 08:28:25 PM
I at one time I found the info for the two handed and what item is on what slot data, lost the offsets in a hdd crash.  I believe it was an index range data format but I could be remembering incorrectly. I do know it exists...LOL!

I planned on locating this info for my hack I'm working on right now actually...

Right after the Arrow Index is a 90C960 which leads me to believe that is the start of armor index, but aside from that I have come up blank. I've found several possible leads, but all of those turned out to be flops. Also if I can ask, what tools do you use? I mean Geiger is great, but the issue with it is that it refuses to look into some Critical ranges, like all of the battle data.
Title: Re: Unknown info from FF4 that would be great to know
Post by: JCE3000GT on January 10, 2013, 09:59:31 PM
Actually good old fashioned staring at hex and corrupting data that I see that could be part of something.  I usually don't use the tracer unless I give up using the old fashioned way. :)

I have a GREAT idea or two for my newest hack but I need to find this data. LOL!

Oh and I had already had planned to use the arrow data above for my hack and I was beaten to the punch on posting it!!
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 10, 2013, 10:55:06 PM
Hehe, that's why I post everything the moment I can find it. Never sure what catastrophe is around the bend...

And speaking of posting I finally found the damage that Dark Wave causes!

Now I'm not sure how it's calculated, or frankly how it really works... but changing this has a profound effect on the damage that Dark Wave will cause Cecil.

I found it by first breakpointing his Battle HP, then traced backwards from there and found that it was doing a bunch of compounding of his max HP and found it was subtracting this all against a static A9. Now I don't know what the A9 really does, but changing it to 00 kills Cecil when using Dark Wave and changing it to FF makes it so he takes no damage from Dark Wave,

In RAM this is located at...

0x03E9FE - A9 - Dark Wave's self-damage

ROM at...

0x01EBFE - A9 - Dark Wave's self-damage

Now FF - A9 = 56, which when translated to normal decimal is 86. This makes me wonder if this is maybe a way for the game to deal 1/8.6 of Cecil's HP?

 :edit: No, it clearly does not.

Here's the instructions if anyone wants to make better sense out of it.

$03/E9EF   A6 A6   LDX $A6    [$00:00A6]   A:0000   X:000A   Y:0000   P:envmxdiZc
$03/E9F1   BD 09 20   LDA $2009,x[$7E:2009]   A:0000   X:0000   Y:0000   P:envmxdiZc
$03/E9F4   20 85 84   JSR $8485  [$03:8485]   A:0110   X:0000   Y:0000   P:envmxdizc
$03/8485   4A    LSR A   A:0110   X:0000   Y:0000   P:envmxdizc
$03/8486   4A    LSR A   A:0088   X:0000   Y:0000   P:envmxdizc
$03/8487   4A    LSR A   A:0044   X:0000   Y:0000   P:envmxdizc
$03/8488   60    RTS   A:0022   X:0000   Y:0000   P:envmxdizc
$03/E9F7   85 A9   STA $A9    [$00:00A9]   A:0022   X:0000   Y:0000   P:envmxdizc
$03/E9F9   38    SEC   A:0022   X:0000   Y:0000   P:envmxdizc
$03/E9FA   BD 07 20   LDA $2007,x[$7E:2007]   A:0022   X:0000   Y:0000   P:envmxdizC
$03/E9FD   E5 A9   SBC $A9    [$00:00A9]   A:00A8   X:0000   Y:0000   P:envmxdizC
$03/E9FF   9D 07 20   STA $2007,x[$7E:2007]   A:0086   X:0000   Y:0000   P:envmxdizC
$03/EA02   B0 0C   BCS $0C    [$EA10]   A:0086   X:0000   Y:0000   P:envmxdizC
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 11, 2013, 07:40:53 AM
Dark Wave always deals 1/8 damage to the user, unless the user is considered an enemy on the field (like the DK vs Paladin event).
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 12:40:31 PM
Yes, I'm aware. And one of the requests was how to change that. So I searched around and found that. Somewhere in that bit of programming is  the answer to Why it deals 1/8 damage to Cecil, but I couldn't figure that out. All I could manage was how to have it deal no damage to Cecil or kill him instantly, with the values I tried.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 11, 2013, 01:08:24 PM
Looks like it's loading Cecil's maximum HP, bitshifting right three times to get 1/8th of it, subtracting that from his current HP, then storing his current HP.

Rereading your post, you almost had it: You're getting confused by the SBC $A9. Note that $ - it's a memory address, not a static value.

 :edit:

Commented:

Code: [Select]
$03/E9EF   A6 A6    LDX $A6
$03/E9F1   BD 09 20 LDA $2009,x ; load Cecil's max HP, A = 272
$03/E9F4   20 85 84 JSR $8485
$03/8485   4A LSR A ; A = 136
$03/8486   4A LSR A ; A = 68
$03/8487   4A LSR A ; A = 34
$03/8488   60 RTS
$03/E9F7   85 A9 STA $A9 ; $00A9 = 34
$03/E9F9   38 SEC
$03/E9FA   BD 07 20 LDA $2007,x ; load Cecil's current HP, A = 168
$03/E9FD   E5 A9 SBC $A9 ; subtract value at $00A9 (34) from A (168)
$03/E9FF   9D 07 20 STA $2007,x ; store result as Cecil's current HP, A = 134
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 01:59:30 PM
Well there we go! Mystery solved! Great work Dragonsbrethren. I guess the only plausible thing to make out of it is to make it hurt him more. That would also explain why the damage dealt to him in other values was random or instant death. Unfortunately when it comes to finding out the damage of Dark Wave I've taken several long looks and have come up empty.

Also I've taken a look at Aim, and it doesn't seem to increase your accuracy to 255. The accuracy byte doesn't change at all when used, but two fairly unknown bytes do, but breakpointing on them didn't help me find out Aim's working functionality.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 11, 2013, 02:19:26 PM
Well there we go! Mystery solved! Great work Dragonsbrethren. I guess the only plausible thing to make out of it is to make it hurt him more.

I'd be cautious changing that bitshift subroutine, since it's probably used for other things, but you've got the code right in front of you now, you can give it any effect you want. Example:

Code: [Select]
$03/E9EF   A6 A6    LDX $A6
$03/E9F1   BD 09 20 LDA $2009,x ; load Cecil's max HP, A = 272
$03/E9F4   20 85 84 JSR $8485
$03/8485   4A LSR A ; A = 136
$03/8486   4A LSR A ; A = 68
$03/8487   4A LSR A ; A = 34
$03/8488   60 RTS
$03/E9F7   85 A9 STA $A9 ; $00A9 = 34
$03/E9F9   38 SEC
$03/E9FA   BD 07 20 LDA $2007,x ; load Cecil's current HP, A = 168
$03/E9FD   E5 A9 SBC $A9 ; subtract value at $00A9 (34) from A (168)
$03/E9FF   EA NOP
$03EA00    EA NOP
$03EA01    EA NOP

Now it does nothing. I wasn't sure if the values in A and X were used after this, so I just NOPed out the part where it damages Cecil.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 02:24:15 PM
That's true, but it's only half of the story. I only have the damage it does to Cecil, and not yet the damage that Dark Wave does The other issue would be space, but yes. I tried changing one of those 0A's when I first found it (because I had thought it may have dealt something with the damage divisor) and at the end of battle things kind of blew up. So yeah... probably not a good idea to mess with those.

 :edit: Good work Dragonsbrethren. That was a fairly simple change after all.

 :edit: Bah, failing left and right with the Commands. I at least expected to find how Jump and Focus get their attack boosts, but no dice.

And since Aim didn't increase Accuracy I hit a wall there (it likely just removes the Hit% check, if I had to guess)

But I did at least find Bluff's command info. Mainly because I knew it would be the easiest to find. Increase one of my base stats by X amount? Why thank you! Finding it was no issue.

I just did a slight bit of tracing and came across the two most important pieces of the code...

03EAC8 - A9 10   LDA #$10   A:0011   X:0022   Y:0000 - Load up a 10 (16) into Register A (Change that to what you will)

03EAD0 - BD 17 20 LDA $2017,x[$7E:2017]   A:0010   X:0000   Y:0000   P:envMxdic - Load this 10 (16) into Intelligence Stat.


Now I should do a bit of clarifying, it seems that info. on the battle stats of rom is woefully non-existent, so I'll just throw out some of the basics.


81 - Character Identifier
00 - ??
0A  - ??
00
00
00
0045  - Current HP
0064  - Max HP
000A - Current MP
000A - Max MP
00 - ??
06 - Basic Strength
05 - Basic Agility
05 - Basic Vitality
03 - Basic Wisdom
02 - Basic Will
06 - Strength
05 - Agility
05 - Vitality
33 - Wisdom - 7E2017!!
05 - Will
10 - Defense?
00
01 - Magic Defense?
63 - Accuracy
2B - Attack Power?

So just work your way backwards or forwards from 2017 (or since it is reversed in game 17 20) and fill in whatever you'd like it to increase and how much you'd like it to increase.

NOTE: (This may only apply to the first character, since everyone has different locations for their stats in RAM. In such a case I will update appropriately.)

 :edit: Nope, look likes this game is well made. It uses 2017 as it will always be byte 17 in the corresponding character's data, regardless of which character is using it.

ROM -
0x01ECD0 - BD1720 - Writing to 2017 in RAM
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 11, 2013, 04:32:40 PM
I'm only repeating what Phoenix told me about Aim. It's technically accurate given the handicaps to Aim that have occurred since the original game.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 06:18:57 PM
Hmm, I read through the Aim thread again and there is something odd going on there, Phoenix was definitely more skilled than me in this so I'm willing to trust his word over mine, but it does not appear to increase accuracy in the Character sense. Just as Focus and Jump don't increase Strength or Attack Power in that basic sense.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 11, 2013, 07:28:48 PM
It probably just sets the attack to always hit rather than actually making use of the accuracy stat.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 07:32:48 PM
It probably just sets the attack to always hit rather than actually making use of the accuracy stat.

I thought that too, until I reread the Aim Command thread. Deathlike lists several reasons why it does seem to use a 255% Accuracy rating moreso than a "Skip Accuracy check".
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 11, 2013, 08:13:30 PM
It probably just sets the attack to always hit rather than actually making use of the accuracy stat.

You'd also have to factor in special cases, like Golbez's battle... Zeromus's battle, and the various Blink statuses.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 11, 2013, 09:20:04 PM
Woohoo! I finally cracked Sneak!


This was my entire goal for going into Commands in the first place!

I wanted to change Sneak's stolen item to the fourth item instead (and thereby making it, mostly a steal only item, unless you're stupidly lucky). This is great for my hack then to where there will be (fairly unique) steal-able equipment and items!

I found it by doing a lot of traces in a lot of different places. The first place I encountered trouble is that the game never seems to execute the Monster Item Byte while in battle, which lead me to believe the stored item must be put Somewhere. So I loaded up Cheat Engine, did a couple of scans, while stealing from Eagle and FloatEye to lower down the results and found where that was located.

After that I did some math to find where it was located in normal memory and went to a breakpoint from there. After a couple of false leads, I stumbled upon what was the defining element of what I wanted to change...

$03/E256   BF 00 9F 0E   LDA $0E9F00,x[$0E:9FE0]   A:00E0   X:00E0   Y:0000   P:envMxdizc

BF00 9F0E or in otherwords Load Accumulator from 0E9F00 (+ what's already in the accumulator) leading to the Imp type enemy Drop table. I changed 00 to 03 (in hopes that it would give me it's rarest item on Sneak and...

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII000_zpsd826d41c.png)


Despite all of the other failures, that made my day!

This is located in ROM at...

0x1E456 - BF00 9F0E - Change the 00 to any digit from 00-03 to receive that rank of item when you use Sneak.

 :edit:

So I started looking into why the Avenger causes Berserk... then things got weird...

Following it a short ways when equipped in battle I came across a 04 which was being put into 7E2004 (The Status Byte) so I changed it and the status appeared to work, but Cecil first used the Avenger as an Item before proceeding to attack (While petrified mind you).

Then thinking that maybe if I just disabled the status byte all together, maybe that would solve the problems? No. No it did not.

What it did... and this is kind of difficult to believe, was had Cecil Mirror every Move Kain would do. Kain fights, Cecil would fight, Kain Jumps, Cecil would use Dark Wave, Kain uses an Item, Cecil will attempt to use the same item. Cecil would even go so far to try and cast spells that Kain had used.

If Kain has yet to act Cecil will just continue to use the Avenger as an item, as odd as that is.

It's almost like a proto-type Mimic class from later FF's. I can't say I Ever expected to find behavior like that present in FFIV.

If you want to check this out for yourself (maybe with a full roster)

Go to 0x03A4DE in RAM and change the 04 there to a 00.

Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 12, 2013, 02:42:13 AM
Well, I didn't crack the Avenger, but I did find a little bit more out about it.

It seems there are 2 checks (maybe more since I Still haven't gotten Auto-Berserk off the Avenger) for Berserk Weapons.

The first is at

0x3A4BE - 4C it is being compared with the A Register, which if it reads 4C will continue on. If you change it to say 16 (Shadow Sword) Than the Shadow Sword will become a Berserk Weapon, just like the Avenger. And the Avenger will Still be a Berserk weapon. Oy...

 In ROM this is located at...

0x1A6BE - Change the 4C to whichever other weapon you want to have Berserk on it. (I'm now doing a sweep of the Rom for other Compare 4C's to see if that could still be the answer, I'll check that out in the morning though.)


Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 12, 2013, 02:46:06 PM
Alright! Well that ends the Arrow business. I found how to make treasure chests give multiples of items, that aren't arrows.

I found it by breakpointing on where the Arrows would appear in my inventory when picked up from a chest, back traced a little from there and found another C9 54 (Compare with 54) and there it was. An unintended consequence of this is that all Weapons are given a multiple of 10 from events. So there would be 10 Excaliburs for instance when you trade the Adamant Ore for the Excalibur (however then you can just have the Smithy's apprentice sell "repairs" to Excalibur, since it's not a quest item.

In addition is the amount that these are given.

In RAM at...

0x009824 - 54 (Change that to whatever value you would like so that when you collect that specific kind of item a multiple would appear in your inventory up until the Armor begins)

0x009828 - 0A (Change that to what you wish for the quantity of item from those sorts of items.)

In ROM at...

0x1A24 - 54

0x1A28 - 0A

Looks like there's no issue now with a Durability based FFIV.

If only finding the information on Two-handedness was this simple...


Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 12, 2013, 02:54:23 PM
Looks like there's no issue now with a Durability based FFIV.

Except for the near-infinite arrow bug. of course.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 12, 2013, 03:15:48 PM
Well, yes. But that's easy enough to deal with by getting rid of Berserk status, I would imagine? (At least that's how I thought that bug went?)
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 12, 2013, 03:50:11 PM
A single arrows/consumable weapon is only removed when a character gets their next turn after attacking. As long as they only get one turn in each battle, the arrow can last forever. It's a non-issue with arrows for the most part, but it would be game-breaking to the system you want to implement.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 12, 2013, 03:57:04 PM
A single arrows/consumable weapon is only removed when a character gets their next turn after attacking. As long as they only get one turn in each battle, the arrow can last forever. It's a non-issue with arrows for the most part, but it would be game-breaking to the system you want to implement.

Hmm, that does seem like an issue and I just tested it and it looks like you're right. What an odd way to program it. However in a difficulty mod or a solo mod (where defeating all enemies would ideally take more than one round of turns) would it work in such situations?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 12, 2013, 04:50:12 PM
I get the feeling that the game says "decrement this weapon" and simply waits to process it on the next turn.

What it should actually do is decrement  the weapon when the character's turn is executed. I know there has been issues with item decrementing in various FF games, waiting to delay it instead of processing it when it happens... I'm sure there's some "item lockage" or "item dependency" at work, but inevitably it is coded poorly.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 13, 2013, 02:54:09 PM
So I have some good news and I have some... strange news.

Good news is I found out how the game makes Two-handed weapons work! It wasn't a "CMP" byte like I expected it to be, but a value stored in the X Register of 4C44 (which is looking at the data between 44 and 4C. If you switch that index you can make items that weren't two handed, two handed. But this comes with a strange caveat...

Despite it specifically looking for weapons that are 44-4C it will still count default Two-handed weapons as two handed. You can even make a Two-Handed shield (when Defense is the best priority?) You can sadly not have "Two-Handed" Armor of any type, the game will just ignore the input indexes.

So we're nearly there! If I can just find this other range (if it exists) than Two-Handed weapons are ours to manipulate.

This data is located in RAM at...

01C02A - A2 44 4C - (Change the range of 44-4C to anything you like, say you want Kain's Spears to be two handed, per instance you would change this to 23 2A. That is only for the Weapon side of things though. The Shield side is located at...

01C02F - A2 44 4C - (As above change the Range and the game will read (If Shield then...) for the Two-handed weapons.

In ROM this is at...

0xC22A - A2 44 4C
0xC22F - A2 44 4C

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII005_zps91833af1.png)

We're so close now! Hopefully I can update this with an Edit, to say I've found the original range, but this in itself is quite interesting...

Did they originally intend for there to be two sets of Two Handed Equipment, rather than all shoved into one section?  Since these values apparently have no effect on normal Two-handed weapons. As of now this only works outside of battle. Inside of battle the "new" Two-Handed Equipment is treated no differently than normal,  need to track down a few more values it would appear.


 :edit: Woohoo! I found how Two Handed Weapons are calculated...! In battle. (So now I've got one side in battle and one side outside of battle, how odd.) While outside of battle there exists two ranges that the game is apparently looking at, no such thing exists for in battle, unfortunately (as far as I could see) In battle uses a simple CMP 44, as I expected it to do.

I found it by breakpointing on the Item Location of the Shadow Shield and (painstakingly since I basically had to hold down Enter, click left, see if it registered (since the breakpoint is continually going off)  click up, and A) and for one tiny sliver of opportunity to present itself, when the Equip fails. After several tries I finally got it and followed it to a Bunch of CMP values (this will prove useful) and CMP 44 was among them. So inside of battle now we can change the range (only the Range can be changed unfortunately, so you can start Two-Handed weapons earlier or later than original. I'm going to post the Instructions, since Dragonsbrethren can better understand them to see if I missed anything.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII006_zps6c100cce.png)


Code: [Select]
$03/F30F D0 04 BNE $04    [$F315] A:0049 X:0000 Y:0000 P:envMxdIzc
$03/F315 C9 44 CMP #$44 A:0049 X:0000 Y:0000 P:envMxdIzc
$03/F317 B0 04 BCS $04    [$F31D] A:0049 X:0000 Y:0000 P:envMxdIzC
$03/F31D C9 4D CMP #$4D A:0049 X:0000 Y:0000 P:envMxdIzC
$03/F31F B0 04 BCS $04    [$F325] A:0049 X:0000 Y:0000 P:eNvMxdIzc
$03/F321 A9 02 LDA #$02 A:0049 X:0000 Y:0000 P:eNvMxdIzc
$03/F323 80 1B BRA $1B    [$F340] A:0002 X:0000 Y:0000 P:envMxdIzc
$03/F340 85 0F STA $0F    [$00:000F] A:0002 X:0000 Y:0000 P:envMxdIzc
$03/F342 AD 95 28 LDA $2895  [$7E:2895] A:0002 X:0000 Y:0000 P:envMxdIzc
$03/F345 D0 04 BNE $04    [$F34B] A:0062 X:0000 Y:0000 P:envMxdIzc
$03/F34B C9 44 CMP #$44 A:0062 X:0000 Y:0000 P:envMxdIzc
$03/F34D B0 04 BCS $04    [$F353] A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F353 C9 4D CMP #$4D A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F355 B0 04 BCS $04    [$F35B] A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F35B C9 54 CMP #$54 A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F35D B0 04 BCS $04    [$F363] A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F363 C9 61 CMP #$61 A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F365 B0 04 BCS $04    [$F36B] A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F36B C9 6D CMP #$6D A:0062 X:0000 Y:0000 P:envMxdIzC
$03/F36D B0 04 BCS $04    [$F373] A:0062 X:0000 Y:0000 P:eNvMxdIzc
$03/F36F A9 10 LDA #$10 A:0062 X:0000 Y:0000 P:eNvMxdIzc
$03/F371 80 03 BRA $03    [$F376] A:0010 X:0000 Y:0000 P:envMxdIzc
$03/F376 85 0E STA $0E    [$00:000E] A:0010 X:0000 Y:0000 P:envMxdIzc
$03/F378 AD 22 18 LDA $1822  [$7E:1822] A:0010 X:0000 Y:0000 P:envMxdIzc
$03/F37B C2 20 REP #$20 A:0000 X:0000 Y:0000 P:envMxdIZc


As before there are two checks, but I'm not entirely sure what the second one is doing since you can dequip the Two Handed weapon and re-equip it with the Shield still on, so it doesn't act like the instructions in the first part.

(Though it is written right above...)

This is located in RAM at...

03F315 - C9 44 (Change the 44 to where ever you want the Two-Handed weapons to start)

03F34B - C9 44 (Not sure what it's doing, but it's likely best to change this to whatever value you are changing the above to)

In ROM at...

0x1F515 - C9 44

0x1F54B - C9 44

And if I'm not mistaken the other CMP's are listing Bows and Arrows.

CMP 4D is where the Bows start
CMP 54 is where Arrows start
CMP 61 is where Shields start
CMP 6D is where Helmets start (No idea why that's being compared) So some further things to keep in mind. (And will likely get a post in on these in time)


 :edit: And we are done! I have figured out all aspects of Two-handedness! (Sort of, not really, still missing the range on what you can and can't equip while under Two-Handedness, hopefully I can find that, but it's not really too important, in my opinion.)It doesn't have any effect on the normal Two-Handed weapons because of a second check that the game has (quite redundant if you ask me...) that CMP's it with a 43 (which was what was throwing me off for a long time.)

It seems what I had found above was the first part of it...

Quote
In ROM this is at...

0xC22A - A2 44 4C
0xC22F - A2 44 4C

You change those to two values (but keep in mind, anything that comes after this will count as bows, so to be safe, it's best to keep the end indexes more or less the same, unless you plan to change the amount of bows to be less/more.)

As before there are two checks (Well technically 3, but changing that one or keeping it at 43 does not appear to make any visible difference) One for the Weapon and one for the Shield.

They are in RAM at...

1C045 - 00 43 (Change this to any value that you want the Two-Handed weapons to begin, this is the Shield check to see if you can Equip X weapon with a Shield already on)
1C075 - 00 43 (As above, this is the Weapon check to see if you can Equip a Shield with X weapon on.)

And in ROM at...

0xC245
0xC275

And in total to make more (or less) Two-Handed weapons follow these steps.

1. Go to 0xC22A - A2 44 4C, 0xC22F - A2 44 4C and change those to where ever you want Two-Handed Weapons to start and end (Keep in mind that after Two-Handed comes Bows, so be careful what what you set here, since the actual checks do not have an "end range" unfortunately)

2.  Go to 0xC245- A2 00 44, 0xC275 - A2 00 44 and change those to the second value you chose above.

3. Go to  0x1F515 - C9 44, 0x1F54B - C9 44 and change the 44 to the value above for a starting point to the Two-Handed Weapons.

There we go, The range of Two-Handed weapons altered in 3 easy steps!





(http://i112.photobucket.com/albums/n198/LastingDawn/FFII007_zps23a8df38.png)

And that should cover it for Two-Handedness. At least for now. If anyone has anything else they'd like me to look up about that functionality, please let me know.


Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 13, 2013, 06:17:17 PM
Yeah, I don't really get why values greater than helmets are tested. If they were using BCC for the comparison it would make perfect sense since they'd be using the helmet start to test shields. As it is, I don't get it, I figure they would rule out the value being out of range sooner, but that's probably what it's there for.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 13, 2013, 09:56:22 PM
Minor Update - I found how the game looks at Key Items. It was a very simple check.  Set the breakpoint to the Legend Sword's slot. See when the Legend Sword was being Read, try to throw it away, see why it can't be thrown away.

It was a simple (our old friend) C9 19, CMP 19. Right above that was the check to the rest of the Key Items.

In RAM at...


0x01A397 - C9 19 - Legend Sword, Key Item Status

0x01A39F - C9 EC - All other Key Items (I'm not sure why it supposedly starts above EC and a few others...)

0x01A245 - CMP E2 (Tent?)
0x01A249 - CMP E3 (Cabin?)
0x01A324 - CMP ED (Chocobo Whistle) Looks like 1AXXX seems like a good place to look around for those odder item dealings.

 :edit: A note with these item CMP's. Aside from the Key Item search, all the others are looking at That specific value. So say... for whatever reason you want a "Chocobo Sword" (It will still be greyed out in a normal menu)and that sword is Value 16. You would then change  the value of ED to 16 and voila. Using the Sword would call the Big Chocobo. And if you didn't want the sword in this example to disappear after use, you would change

DE 41 14   DEC $1441,x[$7E:1441]   A:00ED   X:0000   Y:6800   P:envMxdIZC to a Nop (I think! Dragonsbrethren can probably think of an easier way.)
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on January 14, 2013, 08:04:18 AM
This is absolutely fantastic news! Grimoire, you are my new hero. You really went above and beyond the call on this one! We now have:

* Two-handed-ness (basically)
* Key-item-ness
* Equips-like-bow
* Eqiups-like-arrow
* Shields
* Helmets

(though, not body/arms? still... awesome)

This will all be incorporated into the editor in the near future, but I'm not sure how much time it will take as I will need to fool around with the interface a little to accomodate this new information. Just to make sure, are all these addresses for headered v1.1?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 14, 2013, 12:30:59 PM
This is absolutely fantastic news! Grimoire, you are my new hero. You really went above and beyond the call on this one! We now have:

* Two-handed-ness (basically)
* Key-item-ness
* Equips-like-bow
* Eqiups-like-arrow
* Shields
* Helmets

(though, not body/arms? still... awesome)

This will all be incorporated into the editor in the near future, but I'm not sure how much time it will take as I will need to fool around with the interface a little to accomodate this new information. Just to make sure, are all these addresses for headered v1.1?

Thanks PinkPuff! I suggest waiting on the Bow and Arrow, I've come across index ranges (like those of the Two-handed weapons among a few other things. I will need to research those more thoroughly before I can really say that they are usable.

As for Helmets... I wouldn't say that's the case. I don't know why it's looking at that area (maybe just to say that is where Armor begins) but there will be more to it than just that one CMP, I'm quite sure. I'll be getting to all of this in short order though.

Since I am using FF4kster to get quick access to various things, and it works without issue I would say this is a headered 1.1 version.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 14, 2013, 07:48:06 PM
Well, this has been quite a wild ride, jumping from one section of RAM to another, following any little byte and being mislead time and again.

First off, the "bad" news. This...

Quote
03F315 - C9 44 (Change the 44 to where ever you want the Two-Handed weapons to start)

03F34B - C9 44 (Not sure what it's doing, but it's likely best to change this to whatever value you are changing the above to)

Are actually Left and Right hands. However that 03F315 above is not Two Handed Weapons per se, but is the start of "special" weapons all together. It took me forever in-battle to realize that this was just a starting index, and the first index just happens to be Two-Handed weapons. What does this mean? I'm not entirely sure, to be honest. But if this value is not lower than what you have Bows set to (not sure why you'd ever want that) then you will not be able to equip bows in non-bows/arrows in either hand. So really, it's not a big deal, just don't go too crazy with placements and always keep your indexes aligned, lest any problems appear.

So without further ado, the data!

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII008_zpsd7fb913c.png)

This one's going to get a little messy (since there's a lot of moving pieces to this one)

in RAM...

- 01BFBD - A2 4D 5F (Index Range of Bows and Arrows, checks this range to see if it is allowed in the recessive hand, use this to add more weapons that can be used in the recessive hand.)

- 01C044 - A2 00 43 (Weapon Must be above this value to be equipped with an Arrow (The game ordinarily uses this value so in theory you could equip Two-Handed weapons with Arrows, if there weren't other checks made to prevent this.

- 01C07A - A2 4D 53 (Index Range of Bows - Unsure, but best to change it to whatever value you have the others 4D53's set to.)

- 01C096 - A2 4D 53 (When changed to a new index, will allow you to equip arrows to selected index Only if the arrows were not equipped in the first place and the other checks had not been modified.)

- 038F27 - C94D (When altered to a new Index, it will add the Attack power of both weapons (Arrow + otherwise) together.)

- 03F315 - C9 44 (Right Hand -(possibly dominant hand) Change the 44 to where ever you want the Special Property weapons to start)

- 03F34B - C9 44 (Left Hand - possibly recessive hand) Change the value to what you have above.)


- 038F27 - C9 4D (When altered to a new Index, it will add the Attack power of both weapons (Arrow + otherwise) together (or divide them depending on which hand it is held) to the left (possibly recessive) hand. Around this are are other various CMP's for Arrows, and Shields)

- 038F41 - C9 4D (As above, except for right (possibly dominant) hand.)



In ROM...

- 0xC1BD - A2 4D 5F (Index Range of Bows and Arrows, checks this range to see if it is allowed in the recessive hand, use this to add more weapons that can be used in the recessive hand.)

- 0xC244 - A2 00 43 (Weapon Must be above this value to be equipped with an Arrow (The game ordinarily uses this value so in theory you could equip Two-Handed weapons with Arrows, if there weren't other checks made to prevent this. Also Special Weapons cannot be equipped with Shields.)


- 0xC27A - A2 4D 53 (Index Range of Bows - Unsure, but best to change it to whatever value you have the others 4D53's set to.)

- 0xC296 - A2 4D 53 (When changed to a new index, will allow you to equip arrows to selected index Only if the arrows were not equipped in the first place and the other checks had not been modified.)

- 0x19127 - C9 4D (When altered to a new Index, it will add the Attack power of both weapons (Arrow + otherwise) together of the right hand.)

- 0x19141 - C9 44 (Right Hand -(possibly dominant hand) Change the 44 to where ever you want the Special Property weapons to start)

- 0x19127 - C9 4D (When altered to a new Index, it will add the Attack power of both weapons (Arrow + otherwise) together (or divide them depending on which hand it is held) to the left (possibly recessive) hand. Around this are are other various CMP's for Arrows, and Shields)

- 0x19141 - C9 4D (As above, except for right (possibly dominant) hand.)

- 0x1F515 - C9 44 (Right Hand -(possibly dominant hand) Change the 44 to where ever you want the Special Property weapons to start)

- 0x1F54B - C9 44 (Left Hand - possibly recessive hand) Change the value to what you have above.)




(http://i112.photobucket.com/albums/n198/LastingDawn/FFII009_zpsd06845a5.png)


There's a Lot here, but that's now to be expected with Special Weapons functionality, thank goodness for editors to compound these all into a simple step. Oh yes, I forgot to actually write down the ROM Locations of the Key Items (and Whistle)

0xA597 - C9 1F - Legend Sword (Change to whatever value you'd like.)
0xA59F - C9 EC - All other Key Item Index (Pass and Whistle have two unique entries for some reason.)
0xA524 - C9 ED - Changing this value will change whatever value you set it to, to act like a Chocobo Whistle

And that's that! I may get a post or edit in on arrows tonight (depends how much energy I have left)


 :edit:

Switched my focus. As I had thought, it seemed that the Key Items portion was only half of the puzzle. The rest of it was in very different (and rather obscure) places.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII011_zpscf553edb.png)

In RAM...


- 01A25C - C9 19 (Legend Sword, Shows up dark "as unsellable" in Shops, change value to desired item.)

-01C2A7 - A2 00 ED (Shows up dark "as unsellable" in Shops, change value to desired items to make them white (Sellable) but don't forget to change the initial index range!)

-01C927 - C9 19 (Prevents you from selling the Legend Sword, change to desired value to prevent selling that item.)

-01C92F - C9 EE (Prevents you from selling any items above this range, can be altered as one wishes.)




In ROM...

-0xA45C - C9 19 (Legend Sword, Shows up dark "as unsellable" in Shops, change value to desired item.)

-0xC4A7- A2 00 ED (Shows up dark "as unsellable" in Shops, change value to desired items to make them white (Sellable) but don't forget to change the initial index range!)

-0xCB27 - C9 19 (Prevents you from selling the Legend Sword, change to desired value to prevent selling that item.)

-0xCB2F - C9 EE (Prevents you from selling any items above this range, can be altered as one wishes.)




Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 15, 2013, 03:08:39 PM
Alright, time to get to Arrows. Since Arrows and Bows are pretty tied together, expect a bit of repeating data.


-01BFBD - A24D5F (Index Range of Bows and Arrows, checks this range to see if it is allowed to be equipped by Bows (And equipped in the recessive hand.))
-01C044 - A20043 (Weapon Must be above this value to be equipped with an Arrow (The game ordinarily uses this value so in theory you could equip Two-Handed weapons with Arrows, if there weren't other checks made to prevent this. Also Special Weapons cannot be equipped with Shields.)
-01C085 - A2545F (Index Range of Arrows, change to where ever you want to change it, allows you to equip Otherwise + a Bow)
-01C08C - A2545F (Index Range of Arrows change to where ever you want to change it, allows you to equip a Bow + Otherwise )



In ROM at...
- 0xC1BD - A2 4D 5F 01BFBD - A24D5F (Index Range of Bows and Arrows, checks this range to see if it is allowed to be equipped by Bows (And if it can be equipped in the recessive hand.))

-0xC244 - A2 00 43 (Weapon Must be above this value to be equipped with an Arrow (The game ordinarily uses this value so in theory you could equip Two-Handed weapons with Arrows, if there weren't other checks made to prevent this. Also Special Weapons cannot be equipped with Shields.)

-0xC285 - A2 54 5F (Index Range of Arrows, change to where ever you want to change it, allows you to equip Otherwise + a Bow)

-0xC28C - A2 54 5F (Index Range of Arrows change to where ever you want to change it, allows you to equip a Bow + Otherwise )

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII012_zps4bbf2de4.png)


(Several Hours Later...)

Oh boy, as fast as this was to find outside of battle, inside of battle was a headache and a half. It was fairly basic, but not what I expected.

In RAM...

-03F325 - C9 54 (This is the starting range of arrows. Change to whatever the new starting range of your arrows may be.)

-03F35B - C9 54 (It originally prevents arrows from being equipped with arrows and bows being equipped with bow thus preventing (1 manner) of item duplication. This is the End range for what is set at 3F325. It is best to have the two match ranges, as things can get messy otherwise.)

Example: Say you want another arrow but don't want to eat into Shields, you would then change the Bow index, (in another post) and change these two values to the value of the Artemis bow (53) and the Artemis Bow would be treated as an Arrow inside of battle.

In ROM...

0x1F525 - C9 54 (This is the starting range of arrows. Change to whatever the new starting range of your arrows may be.)

0x1F55B - C9 54 (It originally prevents arrows from being equipped with arrows and bows being equipped with bow thus preventing (1 manner) of item duplication. This is the End range for what is set at 3F325. It is best to have the two match ranges, as things can get messy otherwise.)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII013_zps8475a47d.png)


That leaves only shields! Should hopefully get to that tonight, then I'll probably revisit either items or commands.


 :edit:-
RAM -

Here's the information on Shields. There's not really a lot here, since Shields are not all that complicated. Just two checks are done.

In RAM...

01BFC5 - A2 61 6C (Index Range of Shield + Weapon)
01C069 - A2 61 6C (Index Range of Sheilds)

In ROM...

0C1C5 - A2 61 6C (Index Range of allowed Shield + Weapon)

0C269 - A2 61 6C (Index Range of allowed Weapon + Shield)
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 26, 2013, 09:32:42 PM
So I spent the better part of the day looking for how Protect/Shell work because let's face it. They're worthless the way they are. But I thought the idea behind them had potential so I went data-diving. Only to meet with some very odd and almost disheartening results. The game passes by each value in a "mirror data" and reallocates stats based on what is present within, I didn't realize this until late, but when I did everything started to click.

I had set every kind of breakpoint on Defense for using Protect but came up each time in a circle, when I found the mirror data in 7E2700 I found leads almost immediately and I am proud to say that I found out how Protect works.

I set out on this hoping to make use of Protect/Shell for my Solo Black Mage mod for Saber and Temper respectively, and I finally found the data necessary for it (At least for Protect which will become Saber)

(Second Mirror! 7E2700 - (For whatever reason the game has a mirror of your in-battle data that it draws from to put in the actual battle data table)

03D866 - AD 2A 27 - (Where it loads the stat to add to +5) e.g changing this to 17 20 will load your Wisdom into your defense +5.

03D869 - 69 05 (Location of Protect Modifier change 05 to what you wish)

03D86F - 8D 2A 27 (Will decide where to put Defense +5) e.g. changing it to 8D 29 27 will change your evasion to Defense +5

NOTE: If you change the the first and second values listed to the same amount you will then be able to continue stacking. Should you change the first value, you will then replace whichever value is the second one with the first value +5.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIIA002_zps3fa92399.png)

In ROM this is at...

0x01DA66 - AD 2A 27 ( (Where it loads the stat to add to  then +5) e.g changing this to 17 20 will load your Wisdom into your defense +5.

0x01DA69 - 69 05 (Location of Protect Modifier change 05 to what you wish)

0x01DA6F - 8D 2A 27 (Will decide where to put Defense +5) e.g. changing it to 8D 29 27 will change your evasion to Defense +5

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIIA004_zpsee70ffeb.png)

And finally here's the data chart so you can switch its function without fear of what you're switching it to...

00 -Character Identifier - 81
01 - Class - 09
02 - Level - 01
03 - ??? - 00
04 - ??? - 00
05 - ??? - 00
06 - ??? - 00
07 - HP (1) - 55
08 - HP (2) - 00
09 - Max HP (1) - 55
0A - Max HP (2) - 00
0B - MP (1) - 19
0C - MP (2) - 00
0D - Max MP (1) - 19
0E - Max MP (2) - 00
0F - Strength - 03
10 - Agility - 07
11 - Vitality - 02
12 - Wisdom - 08
13 - Will - 03
14 - Modified Strength - 03
15 - Modified Agility - 07
16 - Modified Vitality - 02
17 - Modified Wisdom - 08
18 - Modified Will - 03
19 - ???- 00
1A - ??? - 00
1B - X's to hit - 01
1C - Accuracy - 28
1D - Attack Power - 03
1E - ???- 00
1F - ??? - 00
20 - ??? - 00
21 - ??? - 00
22 - ??? - 00
23 - Magic Evasion - 06
24 - ??? - 00
25 - ??? - 00
26 - ??? - 00
27 - ??? - 00
28 - ??? - 00
29 - Physical Evasion - 1E
2A - Physical Defense - 03
2B - ??? - 00
2C - ??? - 00
2D - ??? - 04
2E - ??? - 15
2F - ??? - 0A

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIIA003_zps4bbd1f68.png)

Though as for what I plan as Saber... I'm not yet sure... there's several possibilities here.

1. Use it to increase Raw attack power (as in the above example) by 5 each cast.

2. Use Wisdom in place of the weapon's attack power +5 (Cannot be stacked)

Any other ideas on what might be applicable there?

 :edit: Turns out Shell was right next to it.

0x01DA8A - AD 24 27 ( Where it loads the stat to add to  then +3) e.g changing this to 17 20 will load your Wisdom into your magic defense +3.

0x01DA8D - 69 03 (Location of Shell Modifier change 03 to what you wish)

0x01DA93 - 8D 24 27 (Will decide where to put Defense +5) e.g. changing it to 8D 29 27 will change your evasion to Magic Defense +3

Temper will likely just be X's to hit, +1 for an exorbitant amount of MP (and only for special branches of the Black Mage Class)

 :edit: 2 An Addendum to Bluff

While finding out how Protect/Shell worked , I finally realized what I was missing on getting Bluff to increase any statistic. The "(Where it loads the stat to add to  then +10)"

I went back to its location and lo and behold I missed the value sitting no more than half a word away from it!

to recap...


03EAC8 - A9 10   LDA #$10   A:0011   X:0022   Y:0000 - Load up a 10 (16) into Register A (Change that to what you will)

03EAD0 - BD 17 20 LDA $2017,x[$7E:2017]   A:0010   X:0000   Y:0000   P:envMxdic - Load this 10 (16) into Intelligence Stat.

And to finish it off...

03EADB - 9D 17 20 (Change this to choose where it will be adding the +10 from) Both the second and the third values listed here must be the same for it to properly stack.


In ROM this can all be found at...

0x01ECC8 - A9 10   LDA #$10   A:0011   X:0022   Y:0000 - Load up a 10 (16) into Register A (Change that to what you will)

0x1ECD0 - BD 17 20 LDA $2017,x[$7E:2017]   A:0010   X:0000   Y:0000   P:envMxdic - Load this 10 (16) into Intelligence Stat.

0x1ECDB - 9D 17 20 (Change this to choose where it will be adding the +10 from) Both the second and the third values listed here must be the same for it to properly stack.

With this knowledge of a "second mirror data" I may be able to find out more about commands.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 27, 2013, 11:01:23 AM
Well I've made some headway on Hide, but I'm still missing a piece... In any case I managed to turn off Auto-Hide on Edward (Leaving him in a state of inaction, there's still something I'm missing here...), you can now change it to Auto-Command anything you like (As long as it involves allies or hits all enemies otherwise it will be used upon Edward) So in other words... Dark Wave, Hide (Really?!), Pray,  Kick, Endure, Bluff, Cry, Regen, and Parry. It has limited use, really. But, in my opinion, some of those options are better than Hide.

In RAM at...

03AB56 C9 05 (Compare A with 05) - Character ID of the character that will Hide of its own volition when in Critical)

03AD0B A9 09 (Command the Character who ordinarily Hides will perform on themselves)
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 27, 2013, 11:40:24 AM
It's not "10", but hex 0x10 , which is 16.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 27, 2013, 12:52:55 PM
I know, but since I was using Hex terms elsewhere I decided to apply Hex terms there. Only trying to stay consistent with the terminology I used before.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 27, 2013, 10:43:10 PM
Well I've made some headway on Hide, but I'm still missing a piece... In any case I managed to turn off Auto-Hide on Edward (Leaving him in a state of inaction, there's still something I'm missing here...), you can now change it to Auto-Command anything you like (As long as it involves allies or hits all enemies otherwise it will be used upon Edward) So in other words... Dark Wave, Hide (Really?!), Pray,  Kick, Endure, Bluff, Cry, Regen, and Parry. It has limited use, really. But, in my opinion, some of those options are better than Hide.

In RAM at...

03AB56 C9 05 (Compare A with 05) - Character ID of the character that will Hide of its own volition when in Critical)

03AD0B A9 09 (Command the Character who ordinarily Hides will perform on themselves)

As I had thought, I was missing Just one piece and after some more data-diving I managed to find that final piece.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII018_zps96fc470e.png)


You may now set Auto-Hide (Or Auto-Pray, Auto-Regen, Auto-Salve, whatever you wish (as long as it targets You!) on whoever you wish! Do you want Rosa to take emergency precautions and use Pray automatically (very often as well) until she gets herself out of Critical? Or how about Edward actually uses Salve until he escapes Critical?

It has its uses. And above all, you can easily change it to 00 so Edward no longer Auto-Hides!

In RAM at...

03A407 - C9 05 (Character ID of the character that, if they happen to have Auto-Hide, will auto-hide even when their menu is shown)

03AB56 -  C9 05  (Character ID of the character that will Hide of its own volition when in Critical)

03AD0B -  A9 09 (The Command the Character who ordinarily Hides will perform on themselves)

In ROM at...


0x1A607  - C9 05 (Character ID of the character that, if they happen to have Auto-Hide, will auto-hide even when their menu is shown)

0x1AD56 -  C9 05  (Character ID of the character that will Hide of its own volition when in Critical)

0x1AF0B -  A9 09 (The Command the Character who ordinarily Hides will perform on themselves)

The only thing I am missing from Hide is its targeting, and I don't know if that refers to the normal command's targeting or not.

Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 27, 2013, 11:21:10 PM
I'd rather not use Dark Wave while critical...  :tongue:
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on January 28, 2013, 08:25:49 AM
 :hmm: I wonder how this would interact with Berserk? It's trivial enough to change, say, Yang's Gird into casting Berserk rather than Protect. After the first time would the character keep casting berserk due to being in critical or keep attacking due to being berserk?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 28, 2013, 09:53:14 AM
Berserk would probably have precedence. You only react during critical status once your turn is up.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 28, 2013, 10:24:36 AM
Easy enough to test! I'll try it out...

Yep! Looks like Deathlike2 was correct. Setting Gird to cast Berserk, will throw the Auto-Girding character into Berserk.

Tested it with Dispel as well and he will continue to cast Gird on himself until he's re-Berserked and it he gets out of critical range, and you cast Dispel, he will not continue to cast Berserk.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 30, 2013, 02:40:52 PM
I think I may have found the means to nerf Jump...

03E980 - 09 02 (Status to Inflict on person using Jump - NOTE: Not responsible for the actual jumping portion, but does seem to deal something with the damage done, when changed to Not 02 or not 00, the character will seem inflicted by Doom but the counter will read 00 and nothing will happen.)

Unfortunately all of my other efforts to find how Jump is used has gone nowhere. I found what appeared to be the Jump Status, but when changed the character Jumping will never return from their jump.


In other news I managed to find out how the game looks at what needs to be equipped to use certain skills. The entire collection is bunched together so it's not a difficult thing to figure out.

By changing these you can then set them towards different skills like say that you want a Two-Handed weapon equipped to use Jump instead of Sing (because that makes no sense, Edward doesn't even Use a Harp in his Sing command animation)

In RAM at...

03A28E - C9 05 (Compare with Dark Wave's Command)
03A292 - C9 08 (Compare with Sing's Command)
03A296 - C9 0C (Compare with Aim's Command)
03A29A - C9 10 (Compare with Twin's Command)


I'll hopefully be able to find out the direct relation between ranges for these four commands (or rather three. Because Twin is something extra special without doubt) For reference here is all the Commands in Hex

(From the Tower of Babil Docs)

#  Name  Tg Comments
-- ----  -- --------
00 Fight 50 one ally/enemy
01 Item  00 opens a sub-menu
02 White 00 opens a sub-menu
03 Black 00 opens a sub-menu
04 Call  00 opens a sub-menu
05 Dummy 60 all enemy (Dark Wave)
06 Jump  58 one ally/enemy
07 Dummy 60 all enemy (Remember)
08 Sing  50 one enemy
09 Hide  00
0A Dummy 20 all allies (Medicine)
0B Dummy 20 all allies (Pray)
0C Aim   50 one ally/enemy
0D Dummy 50 one enemy (Store)
0E Kick  60 all enemy
0F Dummy 00 (Endure)
10 Twin  60 all enemy
11 Dummy 00 (Strengthen)
12 Dummy 60 all enemies (Cry)
13 Cover 18 one ally
14 Peep  58 one ally/enemy
15 Dummy 60 (Unknown and unused command)
16 Dart  50 one ally/enemy
17 Sneak 50 one ally/enemy
18 Ninja 00 opens a sub-menu
19 Dummy 28 all allies (Spirit Wave)
1A Chang -- Yes, this really is "Chang" in the ROM; I don't know where the e
            gets put in.
1B Parry --
1C Show  --
1D Off   --

 :edit: Alright! Found the item ranges that the game looks at for Commands. They are quite close to the original offsets above.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFII020_zps8c2547fd.png)

03A2F8 - C9 61 (If the Weapon value is this or above this (or 00?) Dark Wave cannot be used)
03A304 - C9 61 (Unsure, it does not appear to effect Dark Wave (May be Equipped Hand)

03A30E - C9 44 (If the value is this or above this, Sing can be used)
03A312 - C9 4D (If the value is this or above this, Sing cannot be used)
03A31C - C9 44 (I'm beginning to wonder if maybe these are Hand dealings? But every character that has a special command like this is Right Handed, curiously enough. I guess it shows them to be thorough. For now on I'll mark these as "Right" and "Left" handed. )
03A320 - C9 4D (Left Handed - If the value is this or above this Sing cannot be used)

03A32A - C9 54 (Right Handed - If the value is this or above this Aim can be used.
03A32E - C9 61 (Right Handed - If the values it this or above this Aim cannot be used (Looking for Bow? This would hint that Aim can be used with two Arrows equipped or two bows... well I'll give it a shot... Yep. Looks like it's right. Aim can be used with Two Bows or Two Arrows. An interesting non-check. Good on the programmers.)

Interestingly enough there is no duplicate data for Left/Right handed for Bows/Arrows.


And unfortunately as I thought, looks like Twin wasn't going to be in here.


The possibilities are immense! Do you want to make magic require a Staff or Rod equipped? Or for Dark Wave to actually require a Dark Sword? How about a Whip to use Call, or Two Handed Weapon for Jump?

While there are plenty of possibilities, there's only three that can be utilized. You may change Dark Wave's limits to another command and restrict (or expand?) the range of which it can be used (In example, Require Rosa to use a Staff to use a (better?) Pray.)

And the same applies for the other commands! This opens up a lot for me and I hope it helps you all as well!


In ROM this is located at...

01A48E - C9 05 (Compare with Dark Wave's Command)
01A492 - C9 08 (Compare with Sing's Command)
01A496 - C9 0C (Compare with Aim's Command)
01A49A - C9 10 (Compare with Twin's Command)


01A4F8 - C9 61 (Right Handed - If the Weapon value is this or above this (or 00?) Dark Wave cannot be used)
01A504 - C9 61 (Left Handed -  If the Weapon value is this or above this (or 00?) Dark Wave cannot be used (May be Equipped Hand)

01A50E - C9 44 (Right Handed - If the value is this or above this, Sing can be used)
01A512 - C9 4D (Right Handed - If the value is this or above this, Sing cannot be used)
01A51C - C9 44 (Left Handed  - If the value is this or above this, Sing can be used)
01A520 - C9 4D (Left Handed - If the value is this or above this Sing cannot be used)

01A52A - C9 54 ( - If the value is this or above this Aim can be used.
01A52E - C9 61 (Right Handed - If the values it this or above this Aim cannot be used (Looking for Bow? This would hint that Aim can be used with two Arrows equipped or two bows... well I'll give it a shot... Yep. Looks like it's right. Aim can be used with Two Bows or Two Arrows. An interesting non-check. Good on the programmers.)

 :edit: 2 -

I've taken another look about the surrounding data and I noticed an interesting pattern...

03A2F3 - BD 33 20 (7E2033 the location of the character's Right Hand Weapon)
03A2F6 - F0 07 (???)
03A2F8 - C9 61 (Right Handed Dark Wave Ranges)

In essence this means you can switch What it requires for you to use a particular command (in using the Character Data Table a few posts up). I find it difficult to think of a skill that would require that, but that's now a possibility. This data is always two bytes separated from the main Command Range, but if someone would like me to record their exact ROM locations, I can do it on request.

Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on January 30, 2013, 07:28:02 PM
Alright I've been taking a look at Aim now and yes, it seems that Phoenix was right. The game loads FF into a Mirror Data of Accuracy. But I have seen a low level Edward with Aim miss and not infrequently against Imps. Is there something else that's going on here?

 I'm currently looking how an FF gets put in there...

Found it. Aim is programmed in a way which makes it Very difficult to change without significantly modifying its code. This is how it works... It starts out as a 0000 Accumulator. Then it is Decremented once. Resetting it to FF. And there you have it. That's how the game gets the FF. Maybe taking a further look at the data will show me a solution, hmm...

Well here's the relevant data before it gets pushed into other sectors.

Code: [Select]
$03/E836 AD 9C 26 LDA $269C  [$7E:269C] A:0003 X:0018 Y:0000 Load Edward's Accuracy into A.
$03/E839 48 PHA A:002F X:0018 Y:0000 Push A (Not really sure what that means in this case)
$03/E83A AD 29 27 LDA $2729  [$7E:2729] A:002F X:0018 Y:0000 Load A into 7E2729 (The Mirror Data for First Character)
$03/E83D 48 PHA A:0000 X:0018 Y:0000 Push A (No idea)
$03/E83E 7B TDC A:0000 X:0018 Y:0000    Transfer something... I don't see it's relevance here.
$03/E83F 8D 29 27 STA $2729  [$7E:2729] A:0000 X:0018 Y:0000 Store A in 7E2729 (Highly redundant, isn't it? Why not just change it to 00 above rather than putting in an Accuracy which will be overwritten in several instructions?)
$03/E842 3A DEC A A:0000 X:0018 Y:0000 -1 From A, making it 00FF
$03/E843 8D 9C 26 STA $269C  [$7E:269C] A:00FF X:0018 Y:0000 Store A in True Accuracy

I'll try to comment...

This to me screams of redundant code. I cannot figure out why it pampers a value for several commands that it soon erases entirely? I think there may be room to change Aim to make it merely double accuracy (by using some Shift Right Logical commands... I think?) Instead of 255 "Always Hits".

But DragonsBrethren is much better at stuff like rewriting commands than I am. So I'll leave any actual modifications in that regard to him.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 30, 2013, 09:13:05 PM
I can't really explain that phenomenon to you other than there may be "futzing" with the attack multiplier at lower levels and/or bows.

 :edit:

The only thing this reminds me most of is the WSC/GBA port's new Flan rule where you commonly use 1 or occasional 2 of the attack multiplier when you attempt to hit Flan.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on January 31, 2013, 01:36:08 PM
I'm sure they're pushing the accuracy values to the stack so they can pull the original values back later in the routine.

The TDC instruction transfers the direct page register to the accumulator. I guess FF4 always uses 0 (or this code can break horribly) and they were trying to be efficient here.

Your call's as good as mine on storing 0 in the temp accuracy, only thing I can guess is that they make use of it later in the routine.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Deathlike2 on January 31, 2013, 04:31:25 PM
Well, that could explain a few things in why the attack misses outright... but there must be a level or some comparison involved to cause early game misses.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on February 04, 2013, 02:27:38 PM
Hmm, I wonder if breaking on Level references might help me find out some of the formula... doubt it, but it may be worth a chance.

Well, I found where the game stores where to start with the random level up bonuses.

In RAM at...

03EF20 - C9 46 (Compare with 70 - Checks the Level Up Data located at Level 69 and disregards displayed level up amount)

03EF45 - C9 46 (Compare with 70 - Checks the Level Up Data located in the "above 70" section. Does not work unless 03EF20 also reads the same amount.)

To make this actually usable for a hack, there would need to be some changes to it. I need to find the location of why it looks only at 69's Level Up Data if I can and switch that to normal procedure. The only thing I'd like from this is the random level ups.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on February 04, 2013, 03:12:31 PM
The HP and MP bonuses for the 70+ levels are drawn from the level 69 bonus. Could it have something to do with that?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on February 04, 2013, 03:36:40 PM
Indeed, it has everything to do with that. I've found what Seems to be why that is, but unfortunately changing it makes the entire process not function correctly, it's really quite bizarre.
Title: Re: Unknown info from FF4 that would be great to know
Post by: vivify93 on February 10, 2013, 04:27:15 AM
1A Chang -- Yes, this really is "Chang" in the ROM; I don't know where the e
            gets put in.
I actually found some info on the Change and Parry commands just now. I'll quote it here.

Quote from: vivify93
Okay, story time. So I noticed the battle label "Need MP" is different from the menu label sharing the same text. So I looked for it. No dice. Then I found this weird block of text.

Code: [Select]
KOSWaeimp/NeedMP
ParyChnge0123456
"mp" before the slash on the first line are the little ones shown in the HP / MP display.

I think I just discovered where "Change" and "Parry" are really being drawn from. I'll report my findings.
:hmm:

 :edit: I discovered, so far, that I have no idea where the game is drawing the space for "Need MP" from. Attempts at changing it to "MP Cost" yielded "MPCo st". Further, it appears the "a" of "Parry" and "Change" are shared. Changing it to "Row" made it show as "Roaw" in battle.

"Pary" just doubles its own "r".

I hope this helps somehow. I have no idea what to do with this information.
Title: Re: Unknown info from FF4 that would be great to know
Post by: chillyfeez on February 10, 2013, 11:42:02 AM
What a bizarre way to... save space? I ran into a similar type of issue attempting to change the word "Call" to something with five letters in the spell menu screen - doing so causes the word "Ninja" not to appear correctly... Inserting the extra byte for a letter after "Call" causes "Ninja" to not appear at all (instead you get "Black," which the game somehow replaces with "Ninja" when the character is in Edge's slot). Typing over the 00 that naturally follows "Call" works, but then you get a "u" after that, and changing the naturally-occurring "u" again causes "Ninja" to mess up. So it seems like the only possibility is to change "Call" to a six-character string that ends with "u."
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 14, 2013, 12:15:28 PM
Does anyone know anything about how encounters are stored? By which I mean, what monster formations do you fight in what maps, and at what frequencies?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on August 14, 2013, 12:23:01 PM
Hmm, as I recall several of the older editors has that information able to be editted (at least for the overworld) but where that data is drawn from, I'm not sure.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 14, 2013, 01:20:46 PM
Ok so from Zyrthofar's editor I've discovered that there is a table from 74966 to 74C95. The table consists of 0x60 entries, each of which is a sequence of 8 bytes. Each byte is the index of a formation.

The next question then is, how does the game store which maps correspond to which encounter sets? This information is displayed in Zyrthofar's editor but is not editable and thus I'm not sure I can reverse engineer it.

 :edit: Never mind, I found it!! There is a list from 74796 to 74915. Each entry is a single byte and represents the encounter table used for that map's encounters.
Title: Re: Unknown info from FF4 that would be great to know
Post by: chillyfeez on August 14, 2013, 01:28:45 PM
There are 511 possible monster formations, each composed of 8 bytes, located in a table at 70200 (previously discussed here: http://slickproductions.org/forum/index.php?topic=1713.300)

There are 96 sets of monster formations that can be assigned to any given location.
Each set consists of eight of the possible monster formations (represented by one byte each, and whether this byte represents one of the first 255 or the latter 255 formations is determined by whether the location it's set to is in the Overworld or Underworld/Moon). The probability of each formation within a set is even.
The table for these sets begins at 74996.

Which monster formation set is used by each location is determined by a table beginning at 74742.
According to Phoenix:
   74742-74781   For the Overworld (1 byte per 32x32 tile region)
   74782-74791   For the Underground (1 byte per 32x32 tile region)
   74792-74795   For the Moon (1 byte per 32x32 tile region)
   74796-74995   For Locations (1 byte per location)

I hope I made that clear enough. If not, lemme know.

 :edit: You figured some of that out in the time it took me to type it.  :blush:
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 14, 2013, 01:38:57 PM
 :celosa: No problem. Your info is much more comprehensive by the looks of it. Thanks!!

 :edit: Wait a second...

The probability of each formation within a set is even.

... is that true?? There's a 1/8 chance of a Pinkpuff encounter?
Title: Re: Unknown info from FF4 that would be great to know
Post by: chillyfeez on August 14, 2013, 02:29:03 PM
Hmm... good question. I assume it is true because I haven't seen any indication otherwise. I guess some experimentation is needed.

 :edit: This seems to imply I'm mistaken: http://rb.thundaga.com/monsters/pink_puffs.txt
Still looking for the actual answer.

 :edit: 2 - Found it.
http://s-endo.skr.jp/ff_analyzer.html
This document is in Japanese, but I'm 99% sure that it says:
Group 1: 43/256 Chance Encounter
Group 2: 43/256
Group 3: 43/256
Group 4: 43/256
Group 5: 32/256
Group 6: 32/256
Group 7: 16/256
Group 8: 4/256

Kinda wish I could read more Japanese... I bet there's some good stuff in there.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on August 15, 2013, 11:04:08 AM
Hmm, is there any documentation on how Cover actually works? It seems that if it's not the Paladin who is using it, it would put the Paladin into Cover, if the Paladin were present.  Which is actually interesting when you think about it. You could give the Cover command to Rosa and have her call out for her own protection rather than using a turn with Cecil to protect her.



 :edit: Well that's a little disappointing, at least in regards to my hack. The game will not say that the Paladin is Present in the Cover section of data if the Dark Knight is also present, therefore Cover will not work if both Dark Knight Cecil and Paladin Cecil are in the same party. I'll try to find the reason for this.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 15, 2013, 12:12:07 PM
:edit: 2 - Found it.
http://s-endo.skr.jp/ff_analyzer.html
This document is in Japanese, but I'm 99% sure that it says:
...etc...
Kinda wish I could read more Japanese... I bet there's some good stuff in there.

That is awesome! Thanks chillyfeez! So it is as I suspected. I wonder if we can find where those probabilities are stored and change them!  :hmm:

I can read a little Japanese... not enough to read that document though.  :sad:
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on August 15, 2013, 02:49:10 PM
Well... Cover is cracked. It's an odd little command, admittedly with a redundant check which is quite boggling.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-KainCoveringDarkKnightCecil_zps343e8099.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-KainCoveringDarkKnightCecil_zps343e8099.png.html)

So how the command works is at the start of the battle the game checks to see what slot the Paladin is Occupying (thanks to the Tower of Babil docs for that bit of info.)  If the Paladin is present then Cover can effectively be used.

If the Paladin is not present however or the Dark Knight Cecil is Present, Cover Cannot Work.

It's bizarre that the game would have programmed in it this safeguard that can never logically happen. In any case in RAM it is at...

0x038D61 - C9 01 (CMP with 01 ) 01 is Dark Knight Cecil's Actor Number. If the Dark Knight is Present the game will act as if the Paladin is Not.

0x038D65 - C9 0B (CMP with 0B)  0B is Paladin Cecil's Actor Number. If the Dark Knight is Present and the Paladin is, the game will still act as if the Paladin is Not.

In ROM this is at...

0x018F61 - C9 01 (CMP with 01 ) 01 is Dark Knight Cecil's Actor Number. If the Dark Knight is Present the game will act as if the Paladin is Not.

0x018F65 - C9 0B (CMP with 0B)  0B is Paladin Cecil's Actor Number. If the Dark Knight is Present and the Paladin is, the game will still act as if the Paladin is Not.

If you were giving Cover to say... Kain or Yang you would first change the 01 to an invalid number like 1F and then change 0B to their corresponding Actor Numbers. Though there is a problem you may have noticed,  when a character leaves the group the next time they come back they likely are using a different Actor Number, therefore unless your game has a set party or the same instance of a character returns instead of a copy (Not sure how that would work) then Cover would no longer work. I'm sure a little more digging could be done to find why it is looking at an Actor and switch that to the Character ID, but this is fine for my purposes for the moment.

 :edit: I can never just leave things be, can I? Well here's the way to change Cover's lockouts and allowances based on Character Class rather than Actor ID, making it a lot more versatile and you won't have to change things wildly to use it on a rejoining character.

In RAM at...

0x038D5C BD 00 20 - Loads what is at 7E2000 (mirrors) - This is the Actor Identifier and it's looking at this to determine if the Paladin and/or the Dark Knight is present. Changing this to BD 01 20 allows for the modder to assign the Cover functionality to a Class rather than a Character, meaning that you can freely give it to another character, no matter who they are without worry of losing it when they rejoin.

In ROM this is at...

0x018F5C BD 00 20 - Loads what is at 7E2000 (mirrors) - This is the Actor Identifier and it's looking at this to determine if the Paladin and/or the Dark Knight is present. Changing this to BD 01 20 or rather 7E2001 check, allows for the modder to assign the Cover functionality to a Class rather than a Character, meaning that you can freely give it to another character, no matter who they are without worry of losing it when they rejoin.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 16, 2013, 09:33:44 AM
Ok, I have created a new wishlist of things to figure out. It's rather lengthy and involved, so I'm basically trying to decide between these options:

1. Post it here as a reply. The list is large-ish and this thread is already a bit all-over-the-place, but it would fit the original theme and purpose of the thread

2. Edit the original post to contain the new wishlist. Similar to above except it might make it easier to reference (though I'll probably have to do a better job of maintaining it than I had been)

3. Post a new thread for the new wishlist. This would be easier for me but might cause too many too-closely-related threads (this, the new one, and the main FF4kster thread)

4. Post a new (separate) thread for each item in the wishlist. Might be kinda cluttered but at least it would be organized and easier to find information on particular topics.

Do you guys have any advice?
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on August 16, 2013, 09:48:49 AM
Well here's a little bit of information that some might find interesting. I'm not sure if anyone's ever noticed but when you go to use an Item in a "Use Item" event like the Well in Agart, you can only choose Items. While this makes sense from the game's standpoint it is also very limiting for modders, especially since Square went through the efforts of making any kind of item usable in those kind of events. Well a quick check on why a specific weapon wasn't showing up as a choice for a custom event (setting a read breakpoint on it) I found the answer straight away.

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-WeaponsinItemEvents_zps7a796385.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-WeaponsinItemEvents_zps7a796385.png.html)

In RAM at 0x0B0AE C9 CE - Compare with the Start of the Consumables List. If you want it to include all items just change C9 CE to C9 00.

In ROM at 0x032AE C9 CE - Compare with the Start of the Consumables List. If you want it to include all items just change C9 CE to C9 00.

In addition nearby there are references to C9 E7, C9 EB, and C9 FE, but I have no idea what they are comparing.

-------------------------------------------------------------------

Hmm, the separate thread idea would be keeping up with the tradition that Deathlike2 started and his information and sorting is concise for the most part, but it would depend on how many threads you plan on making, is it more than 5? 10? If it's less than 5 it might be a good idea, more than 5 it could be a bit cluttered.

A new thread is always an option, though the idea to edit your opening post for this thread is a very valid option, but there is quite a bit in this thread already.

In the end it comes down to how easy it is to see things. If you think you can manage the ideas with this thread and not let much slip through the cracks, that could be your best bet. But if you're worried about accessibility your multiple threads idea would not be without precedence.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Pinkpuff on August 16, 2013, 10:47:44 AM
I'm leaning towards the separate thread for each item myself. There's already some gems that I know are in this thread somewhere but it's too haphazard / I'm too lazy to go hunting for it. There are definitely more than 5. 15-20 would be a better estimate.

I think what I'll do then is make separate threads and if it's a problem the mods can bring it up with me and I'll by all means comply with whatever they say.

Perhaps we can have an index thread then that links to all of them, kind of like how there's a "THE Command Thread" but then there's a thread for each separate command.
Title: Re: Unknown info from FF4 that would be great to know
Post by: chillyfeez on August 16, 2013, 10:56:39 AM
Perhaps we can have an index thread then that links to all of them, kind of like how there's a "THE Command Thread" but then there's a thread for each separate command.
My vote is for this idea. The index thread can always be added to if new "sub-threads" are created (because you think of new stuff you want to figure out).
Title: Re: Unknown info from FF4 that would be great to know
Post by: Dragonsbrethren on August 16, 2013, 11:21:42 AM
Yeah, go ahead and make separate threads, that's fine.

Grimoire, the FE compare is probably so -Sort- and the TrashCan don't show up. (E7 and EB are a mystery. EB's the Carrot, but the game doesn't do anything special with those AFAIK.)
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 03, 2013, 02:05:33 PM
I thought to add some of my miscellaneous and not very ground breaking findings here since there's no other real topic.

We all know that we can switch the first effect of Sing's effect to actually Do Something, but the game will still give the message "Nothing Happened" for the Song's effect. Now we obviously can't change that because it's used by a lot of other things but we can now change which battle message its referring to in order to fix that annoyance.

In LoRom/HiRom

0x3E9017 - A9 00 (LDA 00) - Stores message 00 for the first instance of Sing's effects.
0x3E901C - A9 00 (LDA 00) - Seems to be necessary to change both, otherwise both are considered 00 regardless of what they actually are.

In ROM at...

01EB17 - A9 00 (LDA 00) - Stores message 00 for the first instance of Sing's effects.
01EB1C - A9 00 (LDA 00) - Seems to be necessary to change both, otherwise both are considered 00 regardless of what they actually are.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 04, 2013, 04:32:57 PM
So in a bit of experimentation I was trying to prepare some sort of Solo Dungeon mod and thought to start with Rydia. To make it really work I'll have to wait until a graphics editor is out or find out how class sprite assignments work. (Since I plan for the choice between 3 different variant of a take on Summoner)

In the midst of this I tried a lot of shadow slot changing and I noticed something very special that I never saw before. Rydia is the only character in the game to change class (Cecil's character is erased and a new one is added for the Dark Knight. The only connection the two seem to have is you can't use Cover if the Dark Knight is in the party, bizarrely enough.)

Every other character has their class from start to finish. Rydia's class changes to use her new graphic. An interesting way to go about it. I grew suspicious when I saw there was no automated fashion this is done, at least according to the editor so I took a look around and quickly found the answer.

In LoRom - HiRom....

0x0E5B7 - C9 11 (CMP 11) - Compare Adult Rydia's ID (Somehow) if this is read...
0x0E5BB - A9 0B (LDA 0B) - Load 0B (Adult Rydia's Class) into...
0x0E5BD - 99 01 10 (STA 7E1001) - 7E1001 - Rydia's Information.

In ROM at...

0x067B7 - C9 11 (CMP 11) - Compare Adult Rydia's ID (Somehow) if this is read...
0x067BB - A9 0B (LDA 0B) - Load 0B (Adult Rydia's Class) into...
0x067BD - 99 01 10 (STA 7E1001) - 7E1001 - Rydia's Information.

The uses for this could be interesting, in case you didn't want Rydia to return in an aged fashion or wanted to use the assignment of byte to somewhere else. Or want another character to change their class. But it does solve to me how the game switches a class in the middle of the character's existence.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on September 05, 2013, 08:02:25 AM
7E358E is not just the collective enemy group Item Byte but is also the chance to gain said item. The value increases by 40 for each value it is set and then the Item Index is taken into account. For instance 40 = 1, 80 = 2, C0 = 3 as shown in the editor. This is excellent news! This means my "Seek" command  (which I plan to replace Peek with) which increases the chance of gaining any said item compound to its second variant (Always a +40) can be made real.

I just wanted to record this in case it wasn't known what the item chances actually were and if it was known they could be manipulated in combat.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on November 04, 2013, 01:48:36 PM
I thought this was pretty neat and worth posting for any person that wants to change the game's story significantly to where the game would star another character (or at least start the game as someone who is not Cecil.)




$00/92D6   BF 00 A9 0F   LDA $0FA900,x[$0F:A900]   A:0001   X:0000   Y:0000   P:envMxdIZC - Load starting character's stats from this point.

All you need to do is add 20 until you get the stats (including character ID) of the character you want to start the game as. This was originally gotten around before by changing Cecil's Class, but changing the starting point of the stats themselves lends a bit more legitimacy to the proceedings, so to speak.

In ROM this is located at  0x14D6.

In addition to this closeby is the calculating of the default Critical hit dealings and "steal prevention" (I am now under the impression that these never naturally change when leveling)

$00/92E7   BF 00 A9 0F   LDA $0FA900,x[$0F:A916]   A:0014   X:0016   Y:0002   P:eNvMxdIzc - Load the 14, 15, 16th bytes of the the default data and load it into 102D, 2E, 2F.

ROM - 14E7

And finally...

$00/92F8   BF 00 A9 0F   LDA $0FA900,x[$0F:A91E]   A:0063   X:001E   Y:0007   P:eNvMxdIzc - Loads bytes 17 - 1F into character stats starting at 1037 (Current EXP)

ROM - 14F8

$00/E67D   BF 00 AB 0F   LDA $0FAB00,x[$0F:AB05]   A:0001   X:0005   Y:0005   P:envMxdIzC - Load Starting Equipment. (Every 7 bytes is a set of a character's equipment)

ROM - 687D

And let's try and change the starting event, it is Event 10 strangely enough so finding this will be a bit tricky, likely. As it has never been looked for...

Ah! And finally found it! This is located at...

8081 in LoROM (Thank you Dragonsbrethren for the lead in the default items topic)

$00/8081   A9 10   LDA #$10   A:0081   X:21E0   Y:00F0   P:eNVMxdizC - Add 10 to A (Starting Events)
$00/8083   20 63 DF   JSR $DF63  [$00:DF63]   A:0010   X:21E0   Y:00F0   P:enVMxdizC - Jump to Subroutine (Event Dealings)

In Rom this is at...

281 - A9 10 - Starting Event.

This is Exceptionally useful when testing your hack and you don't want to have to rebuild your event library every single time you want to play a normal game. So you no longer need to destroy the main event and (granted there's a Load Map command within) can start the game from any point.

So there you go. This is the way to switch the main character in a more legitimate way than kicking Cecil out of the party or changing Cecil's class alone and finally for testing you no longer are confined in starting at Event 10, but may start the game where ever there is a Load Map function.
Title: Re: Unknown info from FF4 that would be great to know
Post by: Grimoire LD on December 23, 2013, 04:50:20 PM
A slight addendum to Chillyfeez's positively ancient "changing the effects of call items" thread.

I said then that Child Rydia was the only one looked at... which after all this time I've realized that makes No sense. Taking another look at the data I found that the check for Adult Rydia is right next to it

Code: [Select]
$01/9010 BF 25 C6 0F LDA $0FC625,x[$0F:C625] A:A800 X:0000 Y:6800 P:envmxdIZc - Load 1000 from ROM.
$01/9014 AA TAX A:1000 X:0000 Y:6800 P:envmxdIzc - Transfer A to X.
$01/9015 E2 20 SEP #$20 A:1000 X:1000 Y:6800 P:envmxdIzc - Set Processor Status.
$01/9017 68 PLA A:1000 X:1000 Y:6800 P:envMxdIzc - Pull A from Stack
$01/9018 60 RTS A:1000 X:1000 Y:6800 P:envMxdIZc - Return
------------------------------------------------------------------------------------------
$01/A8F4 BD 00 00 LDA $0000,x[$7E:1000] A:1000 X:1000 Y:6800 P:envMxdIZc - Load Character 1's ID.
$01/A8F7 29 3F AND #$3F A:1081 X:1000 Y:6800 P:eNvMxdIzc - Get rid of unneccessary bits.
$01/A8F9 60 RTS A:1001 X:1000 Y:6800 P:envMxdIzc - Return.
-------------------------------------------------------------------------------------------------------------------------------------
$01/A876 C9 03 CMP #$03 A:1001 X:1000 Y:6800 P:envMxdIzc - Is it Child Rydia?
$01/A878 F0 11 BEQ $11    [$A88B] A:1001 X:1000 Y:6800 P:eNvMxdIzc - If so branch to 01A88B
$01/A87A C9 11 CMP #$11 A:1001 X:1000 Y:6800 P:eNvMxdIzc - Is it Adult Rydia?
$01/A87C F0 0D BEQ $0D    [$A88B] A:1001 X:1000 Y:6800 P:eNvMxdIzc - If so branch to 01A88B
$01/A87E E6 45 INC $45    [$00:0145] A:1001 X:1000 Y:6800 P:eNvMxdIzc - +1 to x45.
$01/A880 A5 45 LDA $45    [$00:0145] A:1001 X:1000 Y:6800 P:envMxdIzc - Load A from 45.
$01/A882 C9 05 CMP #$05 A:1001 X:1000 Y:6800 P:envMxdIzc - Has it looked at every party member?
$01/A884 D0 EB BNE $EB    [$A871] A:1001 X:1000 Y:6800 P:eNvMxdIzc - If not loop back to 01A871. (Start of Process)
-------------------------------------------------------------------------------------------------------