øAslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index80d1.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&action=statse:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index80d1.html.zx‰õg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈÀ$;ÿOKtext/htmlISO-8859-1gzip@øÕ;ÿÿÿÿÿÿÿÿÿÑHTue, 10 Mar 2020 20:32:31 GMT0ó°° ®0®P®€§²ð®‡õg^ÿÿÿÿÿÿÿÿj;ÿ Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)

Author Topic: Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)  (Read 78687 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Table of Contents

1. Spell Routine Offsets

2. Command Routine Offsets

3. Specialty Routine Offsets

4. Event Routine Offsets

5. Bug Fixes

6. Custom Routine Offsets (& Replacements)
A. Commands
B.  Spells
C. Event Instructions
D. Patches

7. Miscellaneous


Well this has been a long time coming, even I'm now having trouble keeping track of all I've found thus far, hehe. So I thought a separate thread to keep everything in a clean manner would make it easier to find and maybe others would be able to track down this information in a more efficient fashion.

I will list the Routine Maps as they appear in the Tower of Babil Docs (thereby ROM) for quick and easy reference (for myself and for others) I will have several links to the Tower of Babil Docs as well, to reference the routines I haven't done because they were completed long ago.

To find any of these values in ROM decrease the amount by 1FE00 (for v1.1) - They are in their LoRom format for efficiency purposes.

 :edit: 1/31/14 Added a Combo Patch which puts all of my released patches into one easy patch.

 :edit: 7/12/15 Finally cleaning this topic a little to put all of my work back into the main part of this topic.

This post is now updated with quick links to all of the available Command Subroutines I've commented on.

Spell Routine Offsets -

00 Damaging Spells- 03D388
01 Damage, Sap - 03D3C2
02 HP Healing - 03D41C
03 Single Digit HP - 03D453
04 Drain - 03D476
05 Psych - 03D498
06 Status - 03D515
07 Immobilizing Status - 03D5B6
08 Add Image - 03D623
09 Reflect - 03D62C
0A Life - 03D65B
0B Heal/Remove All Statuses Except.... - 03D6F8
0C Shape Changing Status - 03D82A
0D Protect - 03D84F
0E Shell - 03D873
0F Slow - 03D897
10 Dispel - 03D8B0
11 Stop - 03D8EE
12 Peep - 03D924
13 Exit - 03D97F
14 Damage Based on Caster's HP - 03D99D
15 MP Recovery - 03D9F9
16 Elixir - 03DA19
17 Damage, Poison - 03DA2B
18 Damage, Status - 03DA73
19 Damage, Immobilizing Status - 03DA8C
1A Sylph - 03DAAE
1B Odin - 03DB5F
1C Count - 03BB5
1D Damage Based on Target's Max HP - 03DBE5
1E Add Calcify - 03DC2B
1F Gaze - 03DC90
20 Blaster - 03DCB0
21 Slap - 03DCCB
22 Mind Blast - 03DCF0
23 Hug - 03DCFB
24 Explode - 03DD12
25 Reaction - 03DD2F
26 Recover 1/10 of Max HP - 03DD4E
27 Damage, Status(Unused?) - 03DD92
28 Spawn Monster - 03DD98
29 Black Hole - 03DDAE
2A Attack Based on Physical Power - 03DDC6
2B Recover 1/3 of Current HP - 03DD62
2C "Trigger A Reaction" - 03DDD9
2D Invincibility Counter-On - 03DDD6
2E Invincibility Counter-Off - 03DDDA
2F Revive Monster - 03DDDE
30 Tradeoff(Suicide, bring in Next Monster) - 03DE31
31 End Battle - 03DFCF
32 Search - 03DFD5
33 Hatch - 03DFE8
34 Rydia Returns - 03E004

Command Routine Offsets

00 Fight - 03C499
01 Damage Routines - 03C924
02 White/Black/Call/Ninja/Spell Item Routines - 03CC46
03 Spell Subroutines (Above)
04 Peep/Study - 03E153
05 Enemy Runs Away - 03E1B2
06 Steal- 03E1CC
07 Salve/Medicine - 03E2DC
08 Throw/Dart - 03E34C
09 Change/Row - 03E3D1
0A Regen - 03E3FA
0B Twin - 03E46F
0C Cover - 03E60F
0D Off - 03E653
0E Gird/Endure - 03E696
0F Kick - 03E6B4
10 Focus/Boost - 03EF70
11 Aim - 03E836
12 Pray - 03E852
13 Hide - 03E876
14 Show - 03E8BB
15 Sing - 03E900
16 Jump - 03E954
17 Parry - 03E9DE
18 Dark Wave - 03E9E9
19 Recall - 03EA1A
1A Bluff/Boast - 03EAC3
1B Cry - 03EAE6
1C Part of Steal Subroutine - 03EB29
1D Item - 03EB9D


Specialty Routine Offsets

Damage Determination - 03C9AF
Grimoire Item - 03EC0D
Out of Battle White Magic - 01B753
Full Disassembly on the Poison Status - 039E45/03A8FD
Full Disassembly on All Status Timers

Event Instruction Offsets
00 Load Some Type of Graphic FC (Actually Nothing) - 000000
01 Repeat XX Times the Following YY Actions EB - 000000(blank because this is looked at in respect to the Movement Patterns)
02 Play Visual Effect FD - 00C17C
03 Show Message from Bank 02 (Event Call) EE - 00E339
04 Open Namingway Screen D9 - 00E344
05 Open Fat Chocobo Screen D4 - 00E351
06 Bring Up Shop XX ED - 00E35E
07 Fade Song XX in EA - 00E379
08 Toggle Music Fade D8 - 00E38B
09 Fight Battle with Enemy Set XX EC - 00E391
0A Toggle Running D7 - 00E54B
0B Play Song XX FA - 00E559
0C Play Sound Effect XX FB - 00E56F
0D Add XX Character to Party E7 - 00E578
0E Remove XX Character from Party E8 - 00E6AF
0F Toggle Screen Tint XX F9 - 00E731
10 Toggle Screen Fade DA - 00E7C4
11 Put in Spell List XX' SpellBook, Spell YY E2 - 00E7D8
12 Restore HP (10 * XX HP) DE - 00E7FF
13 Restore MP (10 * XX MP) DF - 00E85F
14 Add Item XX to Inventory E0 - 00E8BF
15 Remove Item XX from Inventory E1 - 00E8CB
16 Toggle Status Ailments XX DB - 00E90A
17 Remove All Status Ailments but XX E3 - 00E929
18 Add Status Ailments XX E4 - 00E948
19 Add 100 * XX GP to Party E5 - 00E967
1A Subtract 100 * XX GP to Party E6 - 00E97E
1B Change Character Graphic to XX DD - 00E9B6
1C Inn DC - 00E9E6
1D End Event FF - 00EA20
1E Pause XX Cycles E9 - 00EAB5
1F Show Message 1XX (Yes/No Box) F8 - 00EAE9
20 Bring up Item Selection Window F7 - 00EB0E
21 Screen moves up 1 tile and down 1 tile D6 - 00EB65
22 Toggle Screen Shake D0 - 00EB94
23 Screen Flash D1 - 00EB9D
24 Screen blur and unblur D2 - 00EBD4
25 Travel to/from Moon D3 - 00EBEF
26 Open a Door D5 - 00EC17
27 Load Map FE - 00EDB1
28 Show Message from Bank 02 (Map Call) EF - 00EF28
29 Show Message 0XX from Bank 01. F0 - 00EF4E
2A Show Message 1XX from Bank 01. F1 - 00EF5F
2B Show Message XX (from Bank 3) F6 - 00EF70
2C Set Event Flag XX F2 - 00EF81
2D Clear Event Flag XX F3 - 00EF8A
2E Activate NPC XX F4 - 00EF93
2F Deactivate NPC XX F5 - 00EF9C

Visual Effect Offsets





Bug Fixes

Enemy Evasion Fix
Enemy Magic Evasion Fix
Infinite Arrow Fix
99% Evasion through Immune Byte Fix
Lingering x4 Weakness through Immune Byte Fix


Custom Routine Offsets (& Replacements)
Commands
Fight(Broken Calcify Weapon Routine) to Fight(Imbued Weapons)
Peep to Seek
Peep to Geomancy
Cry to FFIV:CC Cry
Cry to Coat Hammer
Steal to Mug
Salve to Item Master
Dart to Draw Out(Katana Soul)l
Twin to W.Meteo/Third Random Spell Twin
Twin to Targeting Dependent Spell Used Twin
Aim to Snipe
Aim to Barrage
Aim to Arrowstorm
Pray to Hunt
(Empty Space) to Hunt Rewards System
(Empty Space) to Hunt Rewards System +
Hide to Advnc (Advance)
Dark Wave to Dark Wave - Zombie Death
Dark Wave to FFIV:DS Darkness
Dark Wave to Dark Wave + Spell Cast
Item to Not 100% Item Accuracy
Sing to Harp-Dependent Sing
(Empty Space) to Magic Weapons
Recall to Dragon Speak
Regen to Will Based Regen
Kick to No Armor-Improved Kick.
Gird to FFI Based Armor-Gird
Boast to Elemental Weapon
(Empty Space) to Seek Remastered

Spells

Healing Spells to Alchemy-Cure
Damaging Spells to Item Lore-Damage
Weak to LOCK
Shell to SLO1
Modify Speed to TMPR
Hug to FAST
Reaction to SLO2
Dispel to SABR
Chillyfeez's Dispel to Aura
Count to HARM
Counte to Elemental Strike/Fancy Flourish
Blink to RUSE
Odin to AFIR,AICE,ALIT,ARUB, WALL, FEAR
Protect to Spell Power Dependent Protect
Blast to Magic Sword
Damage, Sap to Piercing Sight
Search to Taunt
Sylph to Battle Skill
Damage, Status (Unused) to Regen (Command)

Specialty
Auto-Hide to XX Armor = Dark Wave replacing Cover
Redundant Start of Game Code to Storing Commands in RAM!


Patches

Imbued Weapons
Katana Soul
Battle Skills
Geomancy
FF III Style Sing
FFV Style Magic Weapons
Combo Patch of the above 6 Patches

Miscellaneous

Amount of Free Space contained within Banks
Audiovisual Code Breakdown
Outside of Battle Treasure Acquiring
Chance to Drop Money while running and Stat Replacement
Auto-Hide Notes 1
Auto-Hide Notes 2
All Attack Building Formulas
Auto-Cover Notes
Fighting Zeromus without Cecil.
Command Menu Accesses
Back Attack/Ambush/First Strike Code
Level Up Code and Notes
Shadow Slot Procedure
Big Chocobo Coding (some)
Damage Tiles
Disabling Level+Shield Defense Multipliers
Enabling all items to be checked and decremented in the Item Use Event
Enabling Critical Hits for Foes
Stat Changing AI Routines
Bow/Arrow Index Routines 1
Bow/Arrow Index Routines 2
« Last Edit: July 12, 2015, 11:55:42 AM by Grimoire LD »

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #1 on: September 09, 2013, 05:17:28 PM »
Defend increases both evasion and defense?

I'm not entirely sure of that (I point to Tellah and FuSoYa for being wrecked so often).

Also, "resetting E4 and E3" reference is probably the simple act of "clearing" the accumulator (aka reset everything to 0).

 :edit:
I'm pretty sure being in the back row is more likely to increase evasion and/or defense.
« Last Edit: September 09, 2013, 05:35:29 PM by Deathlike2 »
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: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #2 on: September 09, 2013, 06:32:05 PM »
I should have been clearer... Defense doesn't literally mean the Defend command (never found it yet) but the results of being attacked and how the Target's stats will respond, hence why I used the term "attack" probably not exactly the best way to put it though. Any ideas on a better name for it?

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #3 on: September 09, 2013, 07:13:33 PM »
I don't know at the moment.

When I use the term "Defend", it's more related to the status (the command itself invokes the status).
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: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #4 on: September 09, 2013, 07:49:42 PM »
Indeed, the stuff at the end is just related to defensive measures and calculations. Hence, Back row dealings, Cursed Dealing, Toad/Mini Dealings, etc. (though I have yet to find back row attacks and then I would need to find Long-Range weapon bit in the character data which I don't believe had been found before. However that was put together before I knew that Elemental Defenses would be present in an earlier portion of the routine.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #5 on: September 10, 2013, 04:07:54 PM »
Update now includes... Row Functionality - Long Range Check - Function of Blink - Jumping/Charging - Darkness - Toad/Mini - Evasion - Normal Attacks - Elemental/Very Weak/Immune Elemental Attacks - Creature Type Attack/Resistances - Berserk - Curse - Defend - Critical Hit Bonus Damage (may be directly related to Drain Elemental) Drain Elemental - Zombie Reverse Drain Elemental - The means to nerf or improve much of anything is now within our hands.  Did you ever think Berserk was too strong and now find out Charging slices your Magical Defense AND Physical Defense makes Focus too weak? Why not add a bit of challenge and strategy by making Berserk inherit those faults (thereby making it a plausible attack to use on an enemy to lower their Defenses). Is your mod a Solo Mod and therefore would logically not use Rows? The checks to disable for that are all clearly there. Do you want to nerf the damage Race Weakness does? The means to do so are above, or how about make Drain Weaponry not so powerful that they require massive stat decreases? Did the idea of Race Resistant armor ever strike you as strange and unnecessary? You can change those into Race Weaknesses so say that you have a powerful shield, but it is weak to Giant type enemies. It could add a bit more strategy to your equipment set up. The last thing notable thing (that I can think of...) we are missing now is the Status Infliction routine. All the means to do as you will are listed in the basic Attack/Defense Disassembly above. If you have any questions I'll try my best to answer them.

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #6 on: September 10, 2013, 05:23:04 PM »
So cool that all of this has been found now.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #7 on: September 10, 2013, 08:07:55 PM »
Indeed DragonsBrethren, I can only hope that it will be put to use. This has been the labor of my time the last couple of days before school really begins to pummel me.

Unfortunately when I wrote the disassembly of that last large chunk of code I lost a fair amount of my former post (seemed to be swallowed up by the new addition to the post) It seems there are space limits on posts and much of what I wrote  that could be done with that information was lost, well no matter. I'll try to be more comprehensive here.

Here is what has been found (I don't think there's much else left to find in the normal attack/defense routines...)

 What has been found thus far in the range of normal attacking..
Row Functionality -
Function of Blink -
Jumping/Charging -
Darkness -
Toad/Mini -
Evasion -
Normal Attacks -
Elemental/Very Weak/Immune Elemental Attacks -
Creature Type Attack/Resistances -
Berserk -
Curse -
Front Row/Back Row (while being attacked) -
Defend -
Critical Hit Bonus Damage (may be directly related to Drain Elemental)
Drain Elemental -
Zombie Reverse Drain Elemental -
Status Inflictions -
And that should be it.

Now a note about weapon status inflictions... Status infliction works in a strange and frankly, incomplete manner. If it is intended to be the way it is it is heavily sided with the player over monsters. This is how it works...

$03/C842   AD 9C 26   LDA $269C  [$7E:269C]   A:0000   X:0680   Y:001A   P:envMxdiZC - Load Target's Physical Attack Percentage.
$03/C845   ED 29 27   SBC $2729  [$7E:2729]   A:004D   X:0680   Y:001A   P:envMxdizC - Subtract A by Target's Physical Evasion.

Then it is run through an RNG where it will spit out a number and if it falls in the success zone it will inflict the status (after a Lot of other checks...)

Now I checked the monster stats, they supposedly should have an Evade byte, location 29 Bytes into their stats, but they don't. The game never loads any monster's given Evasion, thereby this check is only really done when the player would be hit by an attack status. Here is where the problem lies... A weapon with 99% Accuracy will Always inflict its status if, the enemy is susceptible to it. This may go a way to explain why most of the Status Weapons have questionable accuracy. It seems like such a waste and in many ways it could unbalance the game. So here is my suggested fix....

$03/C842   AD 9C 26   LDA $269C  [$7E:269C]   A:0000   X:0680   Y:001A   P:envMxdiZC - Load Target's Physical Attack Percentage.
$03/C845   ED 2F 27   SBC $272F  [$7E:272F]   A:004D   X:0680   Y:001A   P:envMxdizC - Subtract A by Target's Run Strength.

Enemies and Allies both have Run Strengths (though you could also attach it to level if you'd like since Run Strength is always a fair bit higher), Allies however never increase their Run Strength, I don't believe and but they all have at least a 0A (Except Paladin Cecil, his is curiously 01) and this in essence would give some marginal amount of worth to Porom's Cry command as it would increase the likelihood of getting through an enemy's chance to block the status.

Jump is a grossly overpowered command and now that I have all of the data in front of me, trumps Focus in every single way. Let us see all that Jump helps and Focus hurts...

$03/C525   AD 81 26   LDA $2681  [$7E:2681]   A:0080   X:0000   Y:0000   P:eNvMxdizc - Load Caster's Class and Row
$03/C528   29 20   AND #$20   A:0080   X:0000   Y:0000   P:eNvMxdizc - Is it Long Ranged?
$03/C52A   D0 0A   BNE $0A    [$C536]   A:0000   X:0000   Y:0000   P:envMxdiZc - Long Range Check - If successful branch to 03C536
$03/C52C   AD 85 26   LDA $2685  [$7E:2685]   A:0000   X:0000   Y:0000   P:envMxdiZc - Load Status Byte 3.
$03/C52F   29 02   AND #$02   A:0000   X:0000   Y:0000   P:envMxdiZc - Is it Jump?
$03/C531   D0 03   BNE $03    [$C536]   A:0000   X:0000   Y:0000   P:envMxdiZc - If so branch to 03C536
$03/C533   4E F8 38   LSR $38F8  [$7E:38F8]   A:0000   X:0000   Y:0000   P:envMxdiZc - Divide Accuracy by 2.

It passes by one Row check...

$03/C55A   AD 81 26   LDA $2681  [$7E:2681]   A:0080   X:0000   Y:0003   P:eNvMxdizc - Load Caster's class/row/Long Range
$03/C55D   29 20   AND #$20   A:0080   X:0000   Y:0003   P:eNvMxdizc  - Is it Long Range?
$03/C55F   D0 0A   BNE $0A    [$C56B]   A:0000   X:0000   Y:0003   P:envMxdiZc - If so branch to 03C56B.
$03/C561   AD 85 26   LDA $2685  [$7E:2685]   A:0000   X:0000   Y:0003   P:envMxdiZc - Load Caster's Status Byte 3.
$03/C564   29 02   AND #$02   A:0000   X:0000   Y:0003   P:envMxdiZc - Is it Jump?
$03/C566   D0 03   BNE $03    [$C56B]   A:0000   X:0000   Y:0003   P:envMxdiZc - If so branch to 03C56B.
$03/C568   4E F8 38   LSR $38F8  [$7E:38F8]   A:0000   X:0000   Y:0003   P:envMxdiZc - Divide Accuracy by 2.

Passes by another Row Check (Target in Back Row I believe).

$03/C6E7   AD 85 26   LDA $2685  [$7E:2685]   A:0000   X:0028   Y:0000   P:envMxdiZC - Load Status Anomalies (Byte 3) from Caster's Data Copy into A.
$03/C6EA   29 0A   AND #$0A   A:0008   X:0028   Y:0000   P:envMxdizC - Is it Jumping or Charging?
$03/C6EC   F0 06   BEQ $06    [$C6F4]   A:0008   X:0028   Y:0000   P:envMxdizC - If not jump to 03C6F4
--------------------------------------------------------------------------------------------------------------------------------
$03/C6EE   0E 02 39   ASL $3902  [$7E:3902]   A:0008   X:0028   Y:0000   P:envMxdizC - Shift the value in 3902 (Attack Base) and make it x2
$03/C6F1   2E 03 39   ROL $3903  [$7E:3903]   A:0008   X:0028   Y:0000   P:envMxdizc -  Do the same here?

Double the Damage.

Whereas this is what Charging does...

$03/C6EA   29 0A   AND #$0A   A:0008   X:0028   Y:0000   P:envMxdizC - Is it Jumping or Charging? (How it gleans this from 0A, I'm unsure. 08+02 does equal 0A though)
$03/C6EC   F0 06   BEQ $06    [$C6F4]   A:0008   X:0028   Y:0000   P:envMxdizC - If not jump to 03C6F4
--------------------------------------------------------------------------------------------------------------------------------
$03/C6EE   0E 02 39   ASL $3902  [$7E:3902]   A:0008   X:0028   Y:0000   P:envMxdizC - Shift the value in 3902 (Attack Base) and make it x2
$03/C6F1   2E 03 39   ROL $3903  [$7E:3903]   A:0008   X:0028   Y:0000   P:envMxdizc -  Do the same here?

Double Damage.

$03/C740   AD 05 27   LDA $2705  [$7E:2705]   A:0000   X:0000   Y:0000   P:envMxdiZC - Load Status Byte 3 from Target's Data.
$03/C743   29 08   AND #$08   A:0010   X:0000   Y:0000   P:envMxdizc - Is the Target Charging?
$03/C745   F0 06   BEQ $06    [$C74D]   A:0000   X:0000   Y:0000   P:envMxdiZc - If not branch to 03C74D
------------------------------------------------------------------------------------------------------------------------------------
$03/C747   4E 05 39   LSR $3905  [$7E:3905]   A:0008   X:0000   Y:0000   P:envMxdizC - Divide Physical Defense by 2
$03/C74A   6E 04 39   ROR $3904  [$7E:3904]   A:0008   X:0000   Y:0000   P:envMxdiZc - Divide 3904 by 2. (Possibly Magic Defense)

Yes, Focus gets both defenses cut in half. We could easily change that to something more reasonable. I had always thought Berserk was a fairly overpowered status so why not attach this detriment to that and to do so is quite simple.

$03/C740   AD 05 27   LDA $2704  [$7E:2704]   A:0000   X:0000   Y:0000   P:envMxdiZC - Load Status Byte 2 from Target's Data.
$03/C743   29 08   AND #$04   A:0010   X:0000   Y:0000   P:envMxdizc - Is the Target Berserk?
$03/C745   F0 06   BEQ $06    [$C74D]   A:0000   X:0000   Y:0000   P:envMxdiZc - If not branch to 03C74D
------------------------------------------------------------------------------------------------------------------------------------
$03/C747   4E 05 39   LSR $3905  [$7E:3905]   A:0008   X:0000   Y:0000   P:envMxdizC - Divide Physical Defense by 2
$03/C74A   6E 04 39   ROR $3904  [$7E:3904]   A:0008   X:0000   Y:0000   P:envMxdiZc - Divide 3904 by 2. (Possibly Magic Defense)


I'll get to more uses later, but for now feel free to post any ideas you would like to see with the available information.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #8 on: September 10, 2013, 08:24:05 PM »
Now a note about weapon status inflictions... Status infliction works in a strange and frankly, incomplete manner. If it is intended to be the way it is it is heavily sided with the player over monsters. This is how it works...

$03/C842   AD 9C 26   LDA $269C  [$7E:269C]   A:0000   X:0680   Y:001A   P:envMxdiZC - Load Target's Physical Attack Percentage.
$03/C845   ED 29 27   SBC $2729  [$7E:2729]   A:004D   X:0680   Y:001A   P:envMxdizC - Subtract A by Target's Physical Evasion.

Then it is run through an RNG where it will spit out a number and if it falls in the success zone it will inflict the status (after a Lot of other checks...)

Now I checked the monster stats, they supposedly should have an Evade byte, location 29 Bytes into their stats, but they don't. The game never loads any monster's given Evasion, thereby this check is only really done when the player would be hit by an attack status. Here is where the problem lies... A weapon with 99% Accuracy will Always inflict its status if, the enemy is susceptible to it. This may go a way to explain why most of the Status Weapons have questionable accuracy. It seems like such a waste and in many ways it could unbalance the game. So here is my suggested fix....

It's just hit rate/accuracy vs evasion for applied status effects? That would explain a few things. My initial thought had to do with Agility or level, but considering that the Whip has a low accuracy factor and low accuracy status weapons are around (Fairy Claw, Ancient Sword, Slumber Sword), that would "screw with the numbers".

Of course, it still comes back to how evasion is everything...

With respect to monster stats, the game is probably NOT reading the evade byte... intentionally or unintentionally. It is consistent in their evasion being 0... but I don't think that is actually intentional.

For instance, Barbariccia and Cagnazzo have evasion modifiers applied with their stat changing code, so it's THERE.

It would also "imply" that you're supposed to "never hurt" any Flan type monster physically and damage variation would kinda exist (it wouldn't make the game that much harder, but the monsters would take less damage across the board).

The only monster that happens to be a special case is Zemus's Mind. It is the only non-Flan monster with 254 defense that would have benefited from the evasion stat.
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: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #9 on: September 10, 2013, 08:56:26 PM »
Wow... Are you serious? Well, fine work Square, truly Fine Work! Oy, you fools...

$03/90CE   AD 1C 29   LDA $291C  [$7E:291C]   A:0002   X:0280   Y:0083   P:envMxdIzC
$03/90D1   9D 28 20   STA $2028,x[$7E:22A8]   A:0001   X:0280   Y:0083   P:envMxdIzC
$03/90D4   AD 1D 29   LDA $291D  [$7E:291D]   A:0001   X:0280   Y:0083   P:envMxdIzC
$03/90D7   9D 2A 20   STA $202A,x[$7E:22AA]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DA   AD 1E 29   LDA $291E  [$7E:291E]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DD   9D 2A 20   STA $202A,x[$7E:22AA]   A:0002   X:0280   Y:0083   P:envMxdIzC


Do you see the Problem?

Having heard from you that Evasion is Supposed to work for monsters but doesn't I decided to do a quick look. Set a breakpoint on the evasion byte, waltzed into battle and... other than a clear, nothing happened. So I thought, "Let me see how the rest of the stats get added in..." I changed the breakpoint to one byte over (2A) and what awaited me?

$03/90D7   9D 2A 20   STA $202A,x[$7E:22AA]   A:0046   X:0280   Y:0083   P:envMxdIzC

The given Evasion of my test Zombie in A. So I set my breakpoint to execute at the start of the line (3090D0) and that's what I was greeted with....

Square Literally Accidentally Wrote Their Evasion To The Physical Defense Base Instead Of Evasion!

That is some Special kind of incompetency there...

So... to fix this... you change this...

$03/90D7   9D 2A 20   STA $202A,x[$7E:22AA]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DA   AD 1E 29   LDA $291E  [$7E:291E]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DD   9D 2A 20   STA $202A,x[$7E:22AA]   A:0002   X:0280   Y:0083   P:envMxdIzC

To this...

$03/90D7   9D 29 20   STA $2029,x[$7E:22AA]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DA   AD 1E 29   LDA $291E  [$7E:291E]   A:0046   X:0280   Y:0083   P:envMxdIzC
$03/90DD   9D 2A 20   STA $202A,x[$7E:22AA]   A:0002   X:0280   Y:0083   P:envMxdIzC

One Byte! Happy Square? I fixed your game yet again...

(Sorry about my tone, this just incenses me greatly for some reason.)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #10 on: September 11, 2013, 02:34:46 AM »
Holy Routine
Code: [Select]
$03/D3C2 20 FD E0 JSR $E0FD  [$03:E0FD] A:0003 X:0002 Y:0000 P:envMxdizc - Jump to Elemental Subroutine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/E0FD AD 26 27 LDA $2726  [$7E:2726] A:0003 X:0002 Y:0000 P:envMxdizc - Load Target's Elemental Immunity Defense into A.
$03/E100 2D A2 28 AND $28A2  [$7E:28A2] A:0000 X:0002 Y:0000 P:envMxdiZc - Test it against stored Elemental Attack.
$03/E103 F0 11 BEQ $11    [$E116] A:0000 X:0002 Y:0000 P:envMxdiZc - If it is not the same, branch to 03E116
------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E105 7B TDC A:0010 X:0002 Y:0000 P:envMxdizc - ?Transfer Direct Page to Accumulator?
$03/E106 8D FE 38 STA $38FE  [$7E:38FE] A:0000 X:0002 Y:0000 P:envMxdiZc - Store A in Attack Altering Field.
$03/E109 AD 26 27 LDA $2726  [$7E:2726] A:0000 X:0002 Y:0000 P:envMxdiZc - Load Target's Elemental Immunity Defense into A.
$03/E10C 29 40 AND #$40 A:00D0 X:0002 Y:0000 P:eNvMxdizc - Is it Drain?
$03/E10E F0 1F BEQ $1F    [$E12F] A:0040 X:0002 Y:0000 P:envMxdizc - If not, branch to 03E12F.
-----------------------------------------------------------------------------------------------------------------------------------------------
$03/E110 A9 84 LDA #$84 A:0040 X:0002 Y:0000 P:envMxdizc - Load 84 into A. (Activating Heal Flag and dealing x2 damage)
$03/E112 8D FE 38 STA $38FE  [$7E:38FE] A:0084 X:0002 Y:0000 P:eNvMxdizc - Store A in Attack Altering Field (x2 Damage)
$03/E115 60 RTS A:0084 X:0002 Y:0000 P:eNvMxdizc - Return
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E116 AD 25 27 LDA $2725  [$7E:2725] A:0000 X:0002 Y:0000 P:envMxdiZc  - Load Target's Elemental Defense into A.
$03/E119 2D A2 28 AND $28A2  [$7E:28A2] A:0008 X:0002 Y:0000 P:envMxdizc - Test it against stored Elemental Attack.
$03/E11C F0 11 BEQ $11    [$E12F] A:0000 X:0002 Y:0000 P:envMxdiZc - If it is not the same, branch to 03E12F.
----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E11E A9 01 LDA #$01 A:0010 X:0002 Y:0000 P:envMxdizc - Load 01 into A.
$03/E120 8D FE 38 STA $38FE  [$7E:38FE] A:0001 X:0002 Y:0000 P:envMxdizc - Store A in Damage Altering Field (x1/2 Power)
$03/E123 AD 25 27 LDA $2725  [$7E:2725] A:0001 X:0002 Y:0000 P:envMxdizc - Load Target's Elemental Defense into A.
$03/E126 29 40 AND #$40 A:0010 X:0002 Y:0000 P:envMxdizc - Is it Drain?
$03/E128 F0 05 BEQ $05    [$E12F] A:0000 X:0002 Y:0000 P:envMxdiZc - If not, branch to 03E12F.
----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E12A A9 82 LDA #$82 A:0040 X:0002 Y:0000 P:envMxdizc - Load 82 into A (Thereby activating the Heal Flag and dealing normal damage)
$03/E12C 8D FE 38 STA $38FE  [$7E:38FE] A:0082 X:0002 Y:0000 P:eNvMxdizc - Store A in Damage Altering Field (x1 Power)
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E12F 60 RTS A:0000 X:0002 Y:0000 P:envMxdiZc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D3C5 AD FE 38 LDA $38FE  [$7E:38FE] A:0000 X:0002 Y:0000 P:envMxdiZc - Load A from 7E38FE
$03/D3C8 10 08 BPL $08    [$D3D2] A:0002 X:0002 Y:0000 P:envMxdizc - Branch if Plus (If Heal Tag is included it will become minus.) to 03D3D2.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D3CA 29 7F AND #$7F A:0084 X:0002 Y:0000 P:eNvMxdizc - ??
$03/D3CC 8D FE 38 STA $38FE  [$7E:38FE] A:0004 X:0002 Y:0000 P:envMxdizc - Store A in Damage Altering Field.
$03/D3CF 4C 1C D4 JMP $D41C  [$03:D41C] A:0004 X:0002 Y:0000 P:envMxdizc - Jump to Subroutine 03D41C.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D3D2 20 30 E1 JSR $E130  [$03:E130] A:0002 X:0002 Y:0000 P:envMxdizc - Jump to Subroutine 03E130 (Weakness Subroutine).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/E130 AD FE 38 LDA $38FE  [$7E:38FE] A:0002 X:0002 Y:0000 P:envMxdizc - Load A into Damage Altering Field.
$03/E133 C9 02 CMP #$02 A:0002 X:0002 Y:0000 P:envMxdizc - Is it Normal Damage?
$03/E135 D0 1B BNE $1B    [$E152] A:0002 X:0002 Y:0000 P:envMxdiZC - If it is not then branch to 03E152.
----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E137 AD 21 27 LDA $2721  [$7E:2721] A:0002 X:0002 Y:0000 P:envMxdiZC - Load Target's Very Weak Element.
$03/E13A 2D A2 28 AND $28A2  [$7E:28A2] A:0000 X:0002 Y:0000 P:envMxdiZC - Check against the stored Element.
$03/E13D F0 06 BEQ $06    [$E145] A:0000 X:0002 Y:0000 P:envMxdiZC - If not, branch to 03E145
--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E145 AD 20 27 LDA $2720  [$7E:2720] A:0000 X:0002 Y:0000 P:envMxdiZC - Load Target's Elemental Weakness.
$03/E148 2D A2 28 AND $28A2  [$7E:28A2] A:0010 X:0002 Y:0000 P:envMxdizC - Check against the stored Element.
$03/E14B F0 05 BEQ $05    [$E152] A:0010 X:0002 Y:0000 P:envMxdizC - If not, branch to 03E152.
$03/E14D A9 04 LDA #$04 A:0010 X:0002 Y:0000 P:envMxdizC - Load 04 into A.
$03/E14F 8D FE 38 STA $38FE  [$7E:38FE] A:0004 X:0002 Y:0000 P:envMxdizC - Store 04 in Damage Altering Fields (x2 Damage)
$03/E152 60 RTS A:0004 X:0002 Y:0000 P:envMxdizC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D41C AD 40 27 LDA $2740  [$7E:2740] A:0004 X:0002 Y:0000 P:envMxdizc - Load Target's Creature Type.
$03/D41F 29 80 AND #$80 A:0080 X:0002 Y:0000 P:eNvMxdizc - Is it 80? (Zombie)
$03/D421 F0 03 BEQ $03    [$D426] A:0080 X:0002 Y:0000 P:eNvMxdizc - If not, branch to 03D421.
$03/D423 4C BE D3 JMP $D3BE  [$03:D3BE] A:0080 X:0002 Y:0000 P:eNvMxdizc - Jump to Subroutine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D3BE 20 AF C9 JSR $C9AF  [$03:C9AF] A:0080 X:0002 Y:0000 P:eNvMxdizc - Jump to Subroutine. (Damage Routine)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D3C1 60 RTS A:0000 X:002D Y:0000 P:envMxdizc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D3D5 20 AF C9 JSR $C9AF  [$03:C9AF] A:0004 X:0002 Y:0000 P:envMxdizC - Jump to Subroutine (Damage Routine)
$03/D3D8 AD 2A 35 LDA $352A  [$7E:352A] A:0000 X:002D Y:0000 P:envMxdizc  - Load 352A into A.
$03/D3DB D0 09 BNE $09    [$D3E6] A:0000 X:002D Y:0000 P:envMxdiZc - ?? (No idea how to pass it)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D3DD AD D2 26 LDA $26D2  [$7E:26D2] A:0000 X:002D Y:0000 P:envMxdiZc - Load Next Action/Spell taken by Caster.
$03/D3E0 C9 0B CMP #$0B A:000B X:002D Y:0000 P:envMxdizc - Is it Holy/White?
$03/D3E2 D0 10 BNE $10    [$D3F4] A:000B X:002D Y:0000 P:envMxdiZC - If not, branch to 03D3F4
--------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D3E4 F0 07 BEQ $07    [$D3ED] A:000B X:002D Y:0000 P:envMxdiZC - ?? (No idea how to pass it)
-----------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------
$03/D3ED AD 40 27 LDA $2740  [$7E:2740] A:000B X:002D Y:0000 P:envMxdiZC - Load Target's Type
$03/D3F0 29 80 AND #$80 A:0080 X:002D Y:0000 P:eNvMxdizC - Is it Zombie?
$03/D3F2 F0 27 BEQ $27    [$D41B] A:0080 X:002D Y:0000 P:eNvMxdizC - If not branch to 03D41B.
-----------------------------------------------------------------------------------------------------------------------------------------------
$03/D3F4 AD 06 27 LDA $2706  [$7E:2706] A:0080 X:002D Y:0000 P:eNvMxdizC - Load Target's Status Byte 4 into A.
$03/D3F7 09 40 ORA #$40 A:0040 X:002D Y:0000 P:envMxdizC - Load 40 (HP Leak)into A.
$03/D3F9 8D 06 27 STA $2706  [$7E:2706] A:0040 X:002D Y:0000 P:envMxdizC -  Store HP Leak into Target's Status Byte 4.
$03/D3FC A9 09 LDA #$09 A:0040 X:002D Y:0000 P:envMxdizC - Load 09 into A.
$03/D3FE 85 D6 STA $D6    [$00:00D6] A:0009 X:002D Y:0000 P:envMxdizC - Store A in D6.
$03/D400 A5 CF LDA $CF    [$00:00CF] A:0009 X:002D Y:0000 P:envMxdizC - Load A from CF.
$03/D402 20 36 9E JSR $9E36  [$03:9E36] A:0005 X:002D Y:0000 P:envMxdizC - Jump to Subroutine.
$03/D405 A9 06 LDA #$06 A:0000 X:001E Y:001E P:envMxdizc - Load 06 into A.
$03/D407 20 C8 85 JSR $85C8  [$03:85C8] A:0006 X:001E Y:001E P:envMxdizc - Jump to Subroutine.
$03/D40A A9 40 LDA #$40 A:0000 X:006F Y:001E P:envMxdiZc - Load 40 into A.
$03/D40C 9D 06 2A STA $2A06,x[$7E:2A75] A:0040 X:006F Y:001E P:envMxdizc - Store A in 7E2A06.
$03/D40F A5 CF LDA $CF    [$00:00CF] A:0040 X:006F Y:001E P:envMxdizc - Load xCF into A.
$03/D411 0A ASL A A:0005 X:006F Y:001E P:envMxdizc - Multiply A by 2.
$03/D412 AA TAX A:000A X:006F Y:001E P:envMxdizc - Transfer A to X.
$03/D413 BD EB 29 LDA $29EB,x[$7E:29F5] A:000A X:000A Y:001E P:envMxdizc - Load A from 7E29F5.
$03/D416 09 20 ORA #$20 A:0040 X:000A Y:001E P:envMxdizc - ?Add 20?
$03/D418 9D EB 29 STA $29EB,x[$7E:29F5] A:0060 X:000A Y:001E P:envMxdizc - Store A in 7E29F5.
$03/D41B 60 RTS A:0060 X:000A Y:001E P:envMxdizc - Return

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D3D2 20 30 E1 JSR $E130  [$03:E130] A:0002 X:0002 Y:0000 P:envMxdizc - Jump to 03E130 (Weakness Subroutine)


And that will be all for tonight. I found what I wanted, that being the absolutely worthless HP Leak (which apparently only effects Zombies which can also be changed, not necessarily enemies weak to Holy...) maybe I can change it to something better. Perhaps Berserk? (combined with my Berserk nerf to make it a viable strategy to lower an opponent's defenses)

To do so...

$03/D3F4   AD 04 27   LDA $2704  [$7E:2704]   A:0080   X:002D   Y:0000   P:eNvMxdizC - Load Target's Status Byte 2 into A.
$03/D3F7   09 04   ORA #$04   A:0040   X:002D   Y:0000   P:envMxdizC - Load 04 (Berserk)into A.
$03/D3F9   8D 04 27   STA $2704  [$7E:2704]   A:0040   X:002D   Y:0000   P:envMxdizC -  Store Berserk into Target's Status Byte 2.


It's very late so I'll get back to this tomorrow.

 :edit:  And done! Looking at the Tower of Babil Doc, and taking v1.1 into account I have completely covered Holy's routine. There is a Lot to change here for versatility. I have no idea what the developers were thinking when they gave this spell HP Leak, (-60 HP over a time at Level 45+, yeah, that'll help!). Nor do I understand why it only effects Zombie type foes. It can easily be changed to another portion to check for. Now what gets me the most is how the game Needs to make sure that it is Holy being cast... which is laughable. It is the only spell in the game to use that formula. Why look to see if it is Holy specifically being cast...?

 Oh, it's not the only spell that uses the formula. Bio, and several monster spells do as well. I'd say switch the rest to Poison if you plan on changing the effect of HP Leak into anything more substantial.
« Last Edit: September 23, 2013, 02:37:17 PM by Grimoire LD »

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #11 on: September 11, 2013, 08:18:48 AM »
To do so...

$03/D3F4   AD 04 27   LDA $2704  [$7E:2704]   A:0080   X:002D   Y:0000   P:eNvMxdizC - Load Target's Status Byte 2 into A.
$03/D3F7   09 04   ORA #$04   A:0040   X:002D   Y:0000   P:envMxdizC - Load 04 (Berserk)into A.
$03/D3F9   8D 04 27   STA $2704  [$7E:2704]   A:0040   X:002D   Y:0000   P:envMxdizC -  Store Berserk into Target's Status Byte 2.
Try this instead:
Code: [Select]
A9 04 - LDA #$04
0C 04 27 - TSB $2704
Faster and smaller. :wink:

(Sorry about my tone, this just incenses me greatly for some reason.)
Oh man, you should see some of the "questionable" code FF6 offers. It's rather hilarious and stupid.

119 bugs fixed and counting.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #12 on: September 11, 2013, 08:41:29 AM »
You know... not once had I ever seen FFIV use TSB, I only used the original instructions but (and since this is basically how I'm learning SNES ASM...) you could save a Lot of space by condensing the many, Many uses of LDA, ORA, STA sequentially and compound them down to nearly half of their original length. Good call Lenophis!

 :edit: And the Damage, Sap subroutine has been completed (for the most part).
« Last Edit: September 11, 2013, 09:43:46 AM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #13 on: September 11, 2013, 10:16:20 AM »
Life Routine

Code: [Select]
$03/D65B A9 02 LDA #$02 A:0003 X:0014 Y:FFFF P:envMxdizc - Load 02 into A.
$03/D65D 8D E6 38 STA $38E6  [$7E:38E6] A:0002 X:0014 Y:FFFF P:envMxdizc - Store A in 7E38E6.
$03/D660 AD 40 27 LDA $2740  [$7E:2740] A:0002 X:0014 Y:FFFF P:envMxdizc - Load Target's Creature Type
$03/D663 29 80 AND #$80 A:0000 X:0014 Y:FFFF P:envMxdiZc - Is it Zombie? (Wha?)
$03/D665 F0 0B BEQ $0B    [$D672] A:0000 X:0014 Y:FFFF P:envMxdiZc - If not, branch to 7ED672.
---------------------------------------------------------------------------------------------------------------------------------------------
$03/D667 A9 80 LDA #$80 A:0080 X:0014 Y:0000 P:eNvMxdizc - Load 80 into A.
$03/D669 8D A3 28 STA $28A3  [$7E:28A3] A:0080 X:0014 Y:0000 P:eNvMxdizc - Store A in 7E28A3
$03/D66C 9C A4 28 STZ $28A4  [$7E:28A4] A:0080 X:0014 Y:0000 P:eNvMxdizc - Store Zero in 7E28A4
$03/D66F 4C 24 D5 JMP $D524  [$03:D524] A:0080 X:0014 Y:0000 P:eNvMxdizc - Jump to Subroutine. (In the Status Routine)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D524 AD 03 27 LDA $2703  [$7E:2703] A:0080 X:0014 Y:0000 P:eNvMxdizc - Load Target's Status Byte 1.
$03/D527 85 AC STA $AC    [$00:00AC] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in AC.
$03/D529 85 A9 STA $A9    [$00:00A9] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in A9.
$03/D52B AD 04 27 LDA $2704  [$7E:2704] A:0000 X:0014 Y:0000 P:envMxdiZc - Load Target's Status Byte 2.
$03/D52E 85 AA STA $AA    [$00:00AA] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in AA.
$03/D530 29 BF AND #$BF A:0000 X:0014 Y:0000 P:envMxdiZc - ??
$03/D532 85 AB STA $AB    [$00:00AB] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in AB
$03/D534 AD A3 28 LDA $28A3  [$7E:28A3] A:0000 X:0014 Y:0000 P:envMxdiZc - Load Stored Creature Type.
$03/D537 85 AE STA $AE    [$00:00AE] A:0080 X:0014 Y:0000 P:eNvMxdizc - Store A in AE
$03/D539 AD A4 28 LDA $28A4  [$7E:28A4] A:0080 X:0014 Y:0000 P:eNvMxdizc - Load Stored ??
$03/D53C 85 AD STA $AD    [$00:00AD] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in AD.
$03/D53E C2 20 REP #$20 A:0000 X:0014 Y:0000 P:envMxdiZc - Reset Processor Status Bits.
$03/D540 A5 AB LDA $AB    [$00:00AB] A:0000 X:0014 Y:0000 P:envmxdiZc - Load A from AB.
$03/D542 C5 AD CMP $AD    [$00:00AD] A:0000 X:0014 Y:0000 P:envmxdiZc - Do AB and AD match?
$03/D544 90 06 BCC $06    [$D54C] A:0000 X:0014 Y:0000 P:eNvmxdizc - If so branch to 03D54C
---------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------
$03/D54C 7B TDC A:0000 X:0014 Y:0000 P:eNvmxdizc - Transfer Direct Page to Accumulator
$03/D54D E2 20 SEP #$20 A:0000 X:0014 Y:0000 P:envmxdiZc - Set Flag
$03/D54F AD 2B 27 LDA $272B  [$7E:272B] A:0000 X:0014 Y:0000 P:envMxdiZc - Load Target's Status Immunity 1.
$03/D552 2D A3 28 AND $28A3  [$7E:28A3] A:00B9 X:0014 Y:0000 P:eNvMxdizc - Check it against Stored Creature Type?
$03/D555 D0 06 BNE $06    [$D55D] A:0080 X:0014 Y:0000 P:eNvMxdizc - If not equal, branch to 03D55D
----------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D557 AD 2C 27 LDA $272C  [$7E:272C] A:0000 X:0014 Y:0000 P:envMxdiZc - Load Target's Status Immunity 2 .
$03/D55A 2D A4 28 AND $28A4  [$7E:28A4] A:0030 X:0014 Y:0000 P:envMxdizc - Check it against ??
---------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D55D D0 53 BNE $53    [$D5B2] A:0080 X:0014 Y:0000 P:eNvMxdizc - If not equal, branch to 03D5B2
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D55F AD 03 27 LDA $2703  [$7E:2703] A:0000 X:0014 Y:0000 P:envMxdiZc - Load Target's Status Byte 1
$03/D562 05 AE ORA $AE    [$00:00AE] A:0000 X:0014 Y:0000 P:envMxdiZc - Add (80?) to Status Byte 1.
$03/D564 8D 03 27 STA $2703  [$7E:2703] A:0080 X:0014 Y:0000 P:eNvMxdizc - Store A in Status Byte 1 (Death).
$03/D567 AD 04 27 LDA $2704  [$7E:2704] A:0080 X:0014 Y:0000 P:eNvMxdizc - Load Target's Status Byte 2
$03/D56A 05 AD ORA $AD    [$00:00AD] A:0000 X:0014 Y:0000 P:envMxdiZc - Load... nothing into A?
$03/D56C 8D 04 27 STA $2704  [$7E:2704] A:0000 X:0014 Y:0000 P:envMxdiZc - Store A in Target's Status Byte 2.
$03/D56F AD A4 28 LDA $28A4  [$7E:28A4] A:0000 X:0014 Y:0000 P:envMxdiZc - Load ??
$03/D572 29 28 AND #$28 A:0000 X:0014 Y:0000 P:envMxdiZc - Is it ?equal? to value in 28?
$03/D574 F0 3A BEQ $3A    [$D5B0] A:0000 X:0014 Y:0000 P:envMxdiZc - If ?so? branch to 03D5B0.
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
$03/D5B0 80 03 BRA $03    [$D5B5] A:0000 X:0014 Y:0000 P:envMxdiZc - Branch Alway to 03D5B5.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D5B2 20 2D E0 JSR $E02D  [$03:E02D] A:0080 X:0014 Y:0000 P:eNvMxdizc - Jump to Subroutine. (Miss/Fail Routine)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D5B5 60 RTS A:0000 X:0014 Y:0000 P:envMxdiZc - Return
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/D672 AD 03 27 LDA $2703  [$7E:2703] A:0000 X:0014 Y:FFFF P:envMxdiZc - Load Target's Status Byte 1
$03/D675 30 01 BMI $01    [$D678] A:0080 X:0014 Y:FFFF P:eNvMxdizc - Break if Minus (Which it will be if the target is dead.) (80).
------------------------------------------------------------------------------------------------------------------------
$03/D677 60 RTS A:0000 X:0014 Y:FFFF P:envMxdiZc - Return
------------------------------------------------------------------------------------------------------------------------
$03/D678 29 7E AND #$7E A:0080 X:0014 Y:FFFF P:eNvMxdizc - Store the value from 7E and place it in A?
$03/D67A 8D 03 27 STA $2703  [$7E:2703] A:0000 X:0014 Y:FFFF P:envMxdiZc - Store A in Target's Status Byte 1.
$03/D67D AD 04 27 LDA $2704  [$7E:2704] A:0000 X:0014 Y:FFFF P:envMxdiZc - Load Target's Status Byte 2.
$03/D680 29 C0 AND #$C0 A:0000 X:0014 Y:FFFF P:envMxdiZc - Store the value from C0 and Place it in A?
$03/D682 8D 04 27 STA $2704  [$7E:2704] A:0000 X:0014 Y:FFFF P:envMxdiZc - Store A in Target's Status Byte 2.
$03/D685 AD 05 27 LDA $2705  [$7E:2705] A:0000 X:0014 Y:FFFF P:envMxdiZc - Load  Target's Status Byte 3.
$03/D688 29 20 AND #$20 A:0000 X:0014 Y:FFFF P:envMxdiZc - Store the Value from 20 and Place it in A?
$03/D68A 8D 05 27 STA $2705  [$7E:2705] A:0000 X:0014 Y:FFFF P:envMxdiZc - Store A in Target's Status Byte 3.
$03/D68D AD 06 27 LDA $2706  [$7E:2706] A:0000 X:0014 Y:FFFF P:envMxdiZc - Load Target's Status Byte 4.
$03/D690 29 80 AND #$80 A:0000 X:0014 Y:FFFF P:envMxdiZc - Store the value from 80 and place it in A?
$03/D692 8D 06 27 STA $2706  [$7E:2706] A:0000 X:0014 Y:FFFF P:envMxdiZc  Store A in Target's Status Byte 4. (Is this all really necessary? The only status that prolongs after death outside of the first byte to my knowledge is Float.)
$03/D695 64 D6 STZ $D6    [$00:00D6] A:0000 X:0014 Y:FFFF P:envMxdiZc Store Zero in D6.
$03/D697 A5 CF LDA $CF    [$00:00CF] A:0000 X:0014 Y:FFFF P:envMxdiZc - Load A from CF.
$03/D699 20 36 9E JSR $9E36  [$03:9E36] A:0001 X:0014 Y:FFFF P:envMxdizc - Jump to Subroutine.
$03/D69C A9 03 LDA #$03 A:0000 X:0006 Y:0006 P:envMxdizc - Load 03 into A.
$03/D69E 20 C8 85 JSR $85C8  [$03:85C8] A:0003 X:0006 Y:0006 P:envMxdizc - Jump to Subroutine.
$03/D6A1 9E 06 2A STZ $2A06,x[$7E:2A1E] A:0000 X:0018 Y:0006 P:envMxdiZc - Store Zero in 7E20A6
$03/D6A4 AD 2F 35 LDA $352F  [$7E:352F] A:0000 X:0018 Y:0006 P:envMxdiZc - Load A from 7E352F.
$03/D6A7 0A ASL A A:0001 X:0018 Y:0006 P:envMxdizc - Multiply A by 2.
$03/D6A8 AA TAX A:0002 X:0018 Y:0006 P:envMxdizc - Transfer A to X.
$03/D6A9 A9 40 LDA #$40 A:0002 X:0002 Y:0006 P:envMxdizc - Load a 40 into A.
$03/D6AB 9D EB 29 STA $29EB,x[$7E:29ED] A:0040 X:0002 Y:0006 P:envMxdizc - Store A in 7E29ED
$03/D6AE A5 CF LDA $CF    [$00:00CF] A:0040 X:0002 Y:0006 P:envMxdizc - Load the value in CF into A.
$03/D6B0 C9 05 CMP #$05 A:0001 X:0002 Y:0006 P:envMxdizc - Is it 5?
$03/D6B2 90 11 BCC $11    [$D6C5] A:0001 X:0002 Y:0006 P:eNvMxdizc - If not, branch to 03D6C5 (Not sure how to trigger this one.)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/D6C5 AD 2A 35 LDA $352A  [$7E:352A] A:0001 X:0002 Y:0006 P:eNvMxdizc - Load A from 7E352A.
$03/D6C8 D0 0F BNE $0F    [$D6D9] A:0000 X:0002 Y:0006 P:envMxdiZc - Branch if ?equal?  to 7ED6D9.
$03/D6CA AD D2 26 LDA $26D2  [$7E:26D2] A:0000 X:0002 Y:0006 P:envMxdiZc - Load Next Action into A.
$03/D6CD C9 14 CMP #$14 A:0013 X:0002 Y:0006 P:envMxdizc - Is it Life 2?
$03/D6CF F0 1A BEQ $1A    [$D6EB] A:0013 X:0002 Y:0006 P:eNvMxdizc  - If so, branch to 7ED6EB.
$03/D6D1 C9 AB CMP #$AB A:0013 X:0002 Y:0006 P:eNvMxdizc - Is it Recover? (But doesn't Recover use its own Formula?)
$03/D6D3 F0 16 BEQ $16    [$D6EB] A:0013 X:0002 Y:0006 P:envMxdizc - If so, branch to 7ED6EB.
$03/D6D5 C9 AC CMP #$AC A:0013 X:0002 Y:0006 P:envMxdizc - Is it Remedy? (Again, it has its own Formula, no?)
$03/D6D7 F0 12 BEQ $12    [$D6EB] A:0013 X:0002 Y:0006 P:envMxdizc - If so, branch to 7ED6EB.
$03/D6D9 AD 16 27 LDA $2716  [$7E:2716] A:0013 X:0002 Y:0006 P:envMxdizc - Load Target's Modified Vitality.
$03/D6DC 85 DF STA $DF    [$00:00DF] A:0006 X:0002 Y:0006 P:envMxdizc - Store A in DF.
$03/D6DE A9 05 LDA #$05 A:0006 X:0002 Y:0006 P:envMxdizc - Load 05 into A (How did I miss this?!)
$03/D6E0 85 E1 STA $E1    [$00:00E1] A:000F X:0002 Y:0006 P:envMxdizc - Store A in E1
$03/D6E2 20 E0 83 JSR $83E0  [$03:83E0] A:000F X:0002 Y:0006 P:envMxdizc - Jump to Subroutine. (Cleaning Routine)
$03/D6E5 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0006 P:envMxdiZc - Load X from E3 (where the end result of multiplying DF and E1 must have taken place)
$03/D6E7 8E 07 27 STX $2707  [$7E:2707] A:0000 X:005A Y:0006 P:envMxdizc - Store X in Character's HP.
$03/D6EA 60 RTS A:0000 X:005A Y:0006 P:envMxdizc - End of Routine.



Confirmed! Life was Supposed to kill Zombie-type enemies in a Single Blow! But All Zombies in the game are resistant to Instant-KO so this functionality of Life goes Completely unused in every version of the game to my knowledge. You can test this for yourself easily by getting rid of KO immunity on any Zombie and using Life on them.

I will finish this routine up, but I thought to post this as this was something I don't believe was commonly known.

 :edit: 2:
$03/D6DE   A9 05   LDA #$05   A:0006   X:0002   Y:0006   P:envMxdizc - Load 05 into A (What was it I said in the Life topic? Oh right... You fool.

And that's that. Life has been, for the most part, fully explored. Not a single reference to Asura, no wonder that multi-life problem plagued Phoenix... The only comparable effect I've seen to Asura is Salve using Phoenix Downs. It must deal something with selective targeting, which I wouldn't know where to start on that.
« Last Edit: September 11, 2013, 12:16:09 PM by Grimoire LD »

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #14 on: September 11, 2013, 11:39:35 AM »
Confirmed! Life was Supposed to kill Zombie-type enemies in a Single Blow! But All Zombies in the game are resistant to Instant-KO so this functionality of Life goes Completely unused in every version of the game to my knowledge. You can test this for yourself easily by getting rid of KO immunity on any Zombie and using Life on them.

I will finish this routine up, but I thought to post this as this was something I don't believe was commonly known.

-----------------------------------------------------------------------------------------------------------------------------------------------
$03/D672   AD 03 27   LDA $2703  [$7E:2703]   A:0000   X:0014   Y:FFFF   P:envMxdiZc -

There is actually one monster that fits the criteria... it's the VampLady (Sealed Cave monster).

The existence of an attack almost FF6-like... I forget how FF5 deals with it, but it's close enough IIRC.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3