øAslickproductions.org/forum/index.php?PHPSESSID=q4c29v6tmbbnv0gvgpv2lv9nn7&topic=1754.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0c08.htmlslickproductions.org/forum/index.php?board=13.160e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0c08.html.zxŒ@g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ,/—:OKtext/htmlISO-8859-1gzip0|Ö—:ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:40:19 GMT0ó°° ®0®P®€§²ð®‹@g^ÿÿÿÿÿÿÿÿ /—: Unknown info from FF4 that would be great to know

Author Topic: Unknown info from FF4 that would be great to know  (Read 17969 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #15 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.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Unknown info from FF4 that would be great to know
« Reply #16 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!!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #17 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
« Last Edit: January 10, 2013, 11:10:49 PM by Grimoire LD »

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #18 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).
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #19 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.
« Last Edit: January 11, 2013, 12:55:57 PM by Grimoire LD »

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Unknown info from FF4 that would be great to know
« Reply #20 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
« Last Edit: January 11, 2013, 01:35:03 PM by Dragonsbrethren »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #21 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.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Unknown info from FF4 that would be great to know
« Reply #22 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.
« Last Edit: January 11, 2013, 02:24:27 PM by Dragonsbrethren »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #23 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
« Last Edit: January 11, 2013, 06:13:17 PM by Grimoire LD »

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #24 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.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #25 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.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Unknown info from FF4 that would be great to know
« Reply #26 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.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #27 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".

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #28 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.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #29 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...




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.

« Last Edit: January 12, 2013, 12:26:26 AM by Grimoire LD »