øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=123;area=showposts;start=1155e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexcc06-3.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=123e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexcc06-3.html.zx2òg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ @S iïOKtext/htmlISO-8859-1gzip@øÕiïÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:18:16 GMT0ó°° ®0®P®€§²ð®0òg^ÿÿÿÿÿÿÿÿÇoiï Show Posts - Grimoire LD

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Grimoire LD

1156
Jump is the next object of interest I don't expect to see much different from the other "apply status to self" commands, but we'll see.

Jump Routine

Code: [Select]
$03/E954 A5 CD LDA $CD    [$00:00CD] A:0003 X:000C Y:0000 P:envMxdizc - Load Character Identifier into A.
$03/E956 30 11 BMI $11    [$E969] A:0000 X:000C Y:0000 P:envMxdiZc - Branch if Minus (If it is Enemy Kain) to 03E969.
$03/E958 A5 CE LDA $CE    [$00:00CE] A:0000 X:000C Y:0000 P:envMxdiZc - Load CE into A (Must be target's ID!)
$03/E95A 30 0D BMI $0D    [$E969] A:0083 X:000C Y:0000 P:eNvMxdizc - Branch if Minus (If Jumping on Enemy, not Ally) to 03E969.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E95C A9 D3 LDA #$D3 A:0003 X:000C Y:0000 P:envMxdizc - Load D3 into A.
$03/E95E 8D C4 33 STA $33C4  [$7E:33C4] A:00D3 X:000C Y:0000 P:eNvMxdizc - Store D3 into 7E33C4.
$03/E961 A9 00 LDA #$00 A:00D3 X:000C Y:0000 P:eNvMxdizc - Load 00 into A (Nothing Happened)
$03/E963 8D CA 34 STA $34CA  [$7E:34CA] A:0000 X:000C Y:0000 P:envMxdiZc - Store A in Battle Message Data.
$03/E966 4C A6 85 JMP $85A6  [$03:85A6] A:0000 X:000C Y:0000 P:envMxdiZc - Jump to Routine (Leaves Routine from here)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E969 EE 0A 39 INC $390A  [$7E:390A] A:0083 X:000C Y:0000 P:eNvMxdizc - +1 to 7E390A
$03/E96C A2 04 00 LDX #$0004 A:0083 X:000C Y:0000 P:envMxdizc - Load 04 into X.
$03/E96F 86 D4 STX $D4    [$00:00D4] A:0083 X:0004 Y:0000 P:envMxdizc - Store X in D4.
$03/E971 A9 03 LDA #$03 A:0083 X:0004 Y:0000 P:envMxdizc - Load 03 into A.
$03/E973 20 C8 85 JSR $85C8  [$03:85C8] A:0003 X:0004 Y:0000 P:envMxdizc - Jump to Subroutine (Difficult to say)
$03/E976 A9 08 LDA #$08 A:0000 X:0003 Y:0000 P:envMxdiZc - Load 08 into A.
$03/E978 9D 06 2A STA $2A06,x[$7E:2A09] A:0008 X:0003 Y:0000 P:envMxdizc - Store A in 7EA06 +3
$03/E97B A6 A6 LDX $A6    [$00:00A6] A:0008 X:0003 Y:0000 P:envMxdizc - Load Active Character Slot into X.
$03/E97D BD 05 20 LDA $2005,x[$7E:2005] A:0008 X:0000 Y:0000 P:envMxdiZc - Load User's Status Byte 3.
$03/E980 09 02 ORA #$02 A:0000 X:0000 Y:0000 P:envMxdiZc - Add 02 to it (Jumping)
$03/E982 9D 05 20 STA $2005,x[$7E:2005] A:0002 X:0000 Y:0000 P:envMxdizc -Store A in User's Status Byte 3.
$03/E985 A5 CD LDA $CD    [$00:00CD] A:0002 X:0000 Y:0000 P:envMxdizc - Load Character Identifier into A.
$03/E987 10 04 BPL $04    [$E98D] A:0000 X:0000 Y:0000 P:envMxdiZc - Branch if Plus (Not Enemy Kain)
----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E989 A9 DE LDA #$DE A:0080 X:0280 Y:0000 P:eNvMxdizc - Load DE into A. (Command DE...? Wha?)
$03/E98B 80 02 BRA $02    [$E98F] A:00DE X:0280 Y:0000 P:eNvMxdizc - Branch to 03E98F
---------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E98D A9 1E LDA #$1E A:0000 X:0000 Y:0000 P:envMxdiZc - Load 1E into A.
$03/E98F 9D 51 20 STA $2051,x[$7E:2051] A:001E X:0000 Y:0000 P:envMxdizc - Store A in User's Next Command to Take
$03/E992 A5 CD LDA $CD    [$00:00CD] A:001E X:0000 Y:0000 P:envMxdizc - Load Character Identifier into A.
$03/E994 0A ASL A A:0000 X:0000 Y:0000 P:envMxdiZc - x2 to A.
$03/E995 AA TAX A:0000 X:0000 Y:0000 P:envMxdiZc - Transfer A to X.
$03/E996 BD EA 29 LDA $29EA,x[$7E:29EA] A:0000 X:0000 Y:0000 P:envMxdiZc - Load A in 7E29EA.
$03/E999 8D 7F 35 STA $357F  [$7E:357F] A:0000 X:0000 Y:0000 P:envMxdiZc - Store A in 7E357F.
$03/E99C A9 40 LDA #$40 A:0000 X:0000 Y:0000 P:envMxdiZc - Load 40 into A.
$03/E99E 9D EA 29 STA $29EA,x[$7E:29EA] A:0040 X:0000 Y:0000 P:envMxdizc - Store A in 7E29EA.
$03/E9A1 60 RTS A:0040 X:0000 Y:0000 P:envMxdizc - Return

Other than the strange part at the end, everything seems to be self-explanatory. Except for Enemy Kain having such a high Command that he branches to specifically. It's rather strange, considering it seems to functionally lead to the exact same place as 1E.





Next is 1E, "coming back down" basically Routine.

Jump (Actual Attack) Routine -

Code: [Select]
$03/E9A2 20 99 C4 JSR $C499  [$03:C499] A:0003 X:003C Y:0000 P:envMxdizc - Jump to Subroutine (Fight Routine)
$03/E9A5 A5 CD LDA $CD    [$00:00CD] A:0000 X:0680 Y:001A P:envMxdiZC - Load Character ID into A.
$03/E9A7 10 05 BPL $05    [$E9AE] A:0000 X:0680 Y:001A P:envMxdiZC - If Positive (Not Enemy Kain) branch to 03E9AE.
-------------------------------------------------------------------------------------------------------------------------------
$03/E9A9 29 7F AND #$7F A:0080 X:0680 Y:001A P:eNvMxdizC - Clear A.
$03/E9AB 18 CLC A:0000 X:0680 Y:001A P:envMxdiZC - Clear Carry Flag.
$03/E9AC 69 05 ADC #$05 A:0000 X:0680 Y:001A P:envMxdiZc - Add 05 into A.
------------------------------------------------------------------------------------------------------------------------------------
$03/E9AE 20 89 84 JSR $8489  [$03:8489] A:0000 X:0680 Y:001A P:envMxdiZC - Jump to Subroutine (Preparation?)
$03/E9B1 A6 A6 LDX $A6    [$00:00A6] A:0000 X:0000 Y:001A P:envMxdiZc - Load Appropriate Slot.
$03/E9B3 BD 05 20 LDA $2005,x[$7E:2005] A:0000 X:0000 Y:001A P:envMxdiZc - Load User's Status Byte 3.
$03/E9B6 29 FD AND #$FD A:0002 X:0000 Y:001A P:envMxdizc - Add -2 to it (Get rid of Jump)
$03/E9B8 9D 05 20 STA $2005,x[$7E:2005] A:0000 X:0000 Y:001A P:envMxdiZc - Store A User's Status Byte 3.
$03/E9BB A5 CD LDA $CD    [$00:00CD] A:0000 X:0000 Y:001A P:envMxdiZc - Load Character ID.
$03/E9BD 0A ASL A A:0000 X:0000 Y:001A P:envMxdiZc - x2 to A.
$03/E9BE AA TAX A:0000 X:0000 Y:001A P:envMxdiZc - Transfer A to X.
$03/E9BF AD 7F 35 LDA $357F  [$7E:357F] A:0000 X:0000 Y:001A P:envMxdiZc - Load 7E357F into A.
$03/E9C2 9D EA 29 STA $29EA,x[$7E:29EA] A:0000 X:0000 Y:001A P:envMxdiZc - Store A in 7E29EA.
$03/E9C5 A5 CD LDA $CD    [$00:00CD] A:0000 X:0000 Y:001A P:envMxdiZc - Load Character ID into A.
$03/E9C7 10 14 BPL $14    [$E9DD] A:0000 X:0000 Y:001A P:envMxdiZc - If it is Positive (Not Enemy Kain?), branch to 03E9DD.
--------------------------------------------------------------------------------------------------------------------------------------------------
$03/E9C9 A9 DE LDA #$DE A:0080 X:0000 Y:001A P:eNvMxdizC - Load DE into A.
$03/E9CB 8D C2 33 STA $33C2  [$7E:33C2] A:00DE X:0000 Y:001A P:eNvMxdizC - Store A in 7E33C2.
$03/E9CE A9 F8 LDA #$F8 A:00DE X:0000 Y:001A P:eNvMxdizC - Load F8 into A.
$03/E9D0 8D C3 33 STA $33C3  [$7E:33C3] A:00F8 X:0000 Y:001A P:eNvMxdizC - Store A in 7E33C3.
$03/E9D3 A9 04 LDA #$04 A:00F8 X:0000 Y:001A P:eNvMxdizC - Load 04 into A.
$03/E9D5 8D C4 33 STA $33C4  [$7E:33C4] A:0004 X:0000 Y:001A P:envMxdizC - Store A in 7E33C4.
$03/E9D8 A9 FF LDA #$FF A:0004 X:0000 Y:001A P:envMxdizC - Load FF into A.
$03/E9DA 8D C5 33 STA $33C5  [$7E:33C5] A:00FF X:0000 Y:001A P:eNvMxdizC - Store A in 7E33C5.
-----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E9DD 60 RTS A:0000 X:0000 Y:001A P:envMxdiZc - Return

Quite a few "Enemy Kain Only" branches to be found within the routine, likely targeting and special circumstance. Still not sure why it doesn't use 1E like the normal Jump does or what is even different about DE.


It seems like the only purpose of the branches for Enemy Kain are to allow the Jump attack to actually go through, which is a strange thing to limit in the first place. Why shouldn't Kain be allowed to target Allies? It would free up a bit of space in the routine as well for anything a hacker would like to add.

1157
Let's finish this batch of information up with Sing. I don't expect to find much here, likely the percentage chance of each Song to occur and perhaps even find Frog Song.


Code: [Select]
$03/E900 AD 83 26 LDA $2683  [$7E:2683] A:0003 X:0010 Y:0000 P:envMxdizc - Load Caster's Status Byte 1.
$03/E903 29 20 AND #$20 A:0000 X:0010 Y:0000 P:envMxdiZc - Is it Frog?
$03/E905 F0 09 BEQ $09    [$E910] A:0000 X:0010 Y:0000 P:envMxdiZc -If not, branch to 03E910.
------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E907 A9 0B LDA #$0B A:0020 X:0010 Y:0000 P:envMxdizc - Load 0B into A (Song of Toad)
$03/E909 8D CA 34 STA $34CA  [$7E:34CA] A:000B X:0010 Y:0000 P:envMxdizc - Store A in Battle Message Data.
$03/E90C A9 19 LDA #$19 A:000B X:0010 Y:0000 P:envMxdizc - Load Toad into A.
$03/E90E 80 31 BRA $31    [$E941] A:0019 X:0010 Y:0000 P:envMxdizc - Branch always to 03E941.
------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E910 20 93 85 JSR $8593  [$03:8593] A:0000 X:0010 Y:0000 P:envMxdiZc - Jump to Subroutine (Generate Random Number.)
$03/E913 C9 C0 CMP #$C0 A:005C X:00BD Y:0000 P:envMxdizC - Is it C0?
$03/E915 90 09 BCC $09    [$E920] A:005C X:00BD Y:0000 P:eNvMxdizc - If it is less than C0 branch to 03E920.
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E924 A9 0E LDA #$0E A:0095 X:0052 Y:0000 P:envMxdizC - Load 0E into A (Song of Mute)
$03/E926 8D CA 34 STA $34CA  [$7E:34CA] A:000E X:0052 Y:0000 P:envMxdizC - Store A in Battle Message Data.
$03/E929 A9 02 LDA #$02 A:000E X:0052 Y:0000 P:envMxdizC - Load 02 into A (Mute)
$03/E92B 80 14 BRA $14    [$E941] A:0002 X:0052 Y:0000 P:envMxdizC - Branch to 03E941.
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E920 C9 80 CMP #$80 A:005C X:00BD Y:0000 P:eNvMxdizc - Is it 80?
$03/E922 90 09 BCC $09    [$E92D] A:005C X:00BD Y:0000 P:eNvMxdizc - If it less than 80 branch to 03E92D.
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E917 A9 00 LDA #$00 A:00C0 X:0054 Y:0000 P:envMxdiZC - Load 00 into A (Nothing Happened.)
$03/E919 8D CA 34 STA $34CA  [$7E:34CA] A:0000 X:0054 Y:0000 P:envMxdiZC - Store A in Battle Message Data.
$03/E91C A9 00 LDA #$00 A:0000 X:0054 Y:0000 P:envMxdiZC - Load 00 (Nothing) into A.
$03/E91E 80 21 BRA $21    [$E941] A:0000 X:0054 Y:0000 P:envMxdiZC - Branch to 03E941.
----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E92D C9 40 CMP #$40 A:005C X:00BD Y:0000 P:eNvMxdizc - Is it 40?
$03/E92F 90 09 BCC $09    [$E93A] A:005C X:00BD Y:0000 P:envMxdizC - If it is less than 40 branch to 03E93A
--------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E931 A9 0D LDA #$0D A:005C X:00BD Y:0000 P:envMxdizC - Load 0D (Song of Charm) into A.
$03/E933 8D CA 34 STA $34CA  [$7E:34CA] A:000D X:00BD Y:0000 P:envMxdizC - Store A in Battle Message Data.
$03/E936 A9 03 LDA #$03 A:000D X:00BD Y:0000 P:envMxdizC - Load 03 into A. (Charm)
$03/E938 80 07 BRA $07    [$E941] A:0003 X:00BD Y:0000 P:envMxdizC - Branch to 03E941.
------------------------------------------------------------------------------------------------------------------------------------
$03/E93A A9 0C LDA #$0C A:0030 X:0054 Y:0000 P:eNvMxdizc - Load 0C into A. (Lullaby)
$03/E93C 8D CA 34 STA $34CA  [$7E:34CA] A:000C X:0054 Y:0000 P:envMxdizc - Load A into Battle Message Data.
$03/E93F A9 29 LDA #$29 A:000C X:0054 Y:0000 P:envMxdizc - Load 29 into A (Sleep)
$03/E941 8D D2 26 STA $26D2  [$7E:26D2] A:0029 X:0054 Y:0000 P:envMxdizc - Store A in Caster's Next Action to Take.
$03/E944 20 3E CD JSR $CD3E  [$03:CD3E] A:0029 X:0054 Y:0000 P:envMxdizc - Jump to Subroutine (Magic Call)
---------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E947 A9 08 LDA #$08 A:0010 X:0680 Y:001A P:envMxdizC - Load 08 (Sing) into A.
$03/E949 8D C8 34 STA $34C8  [$7E:34C8] A:0008 X:0680 Y:001A P:envMxdizC - Store A in Mini-Battle Message Data.
$03/E94C A9 10 LDA #$10 A:0008 X:0680 Y:001A P:envMxdizC - Load 10 into A.
$03/E94E 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:0680 Y:001A P:envMxdizC - Store A in 7E34C7.
$03/E951 4C B1 85 JMP $85B1  [$03:85B1] A:0010 X:0680 Y:001A P:envMxdizC - Jump to 0385B1. (May possibly tell the game to use a default targetting as labeled by command?)


Indeed, now this is a Command! Four random options, one easily located reasoning for how things work as they do, and a bonus of Status specialty. Which one can easily change and make look for anything they desire to make it play the special circumstance song. And plainly listed above are the chances for each song to change if they would like.

But that will do it for tonight, only a couple standard Commands left to go!


1158
Next up is Pray, just like with Gird, I don't expect to find many surprises and it is a fairly short command by all accounts.

Pray Routine -

Code: [Select]
$03/E852 20 93 85 JSR $8593  [$03:8593] A:0003 X:0016 Y:0000 P:envMxdizc - Jump to Subroutine (Generate Random Number)
$03/E855 C9 80 CMP #$80 A:00EA X:00CE Y:0000 P:eNvMxdizC - Is it 80?
$03/E857 90 0A BCC $0A    [$E863] A:00EA X:00CE Y:0000 P:envMxdizC - If more than 80 branch to 03E863.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E859 20 A6 85 JSR $85A6  [$03:85A6] A:00EA X:00CE Y:0000 P:envMxdizC - Jump to Subroutine (??)
$03/E85C A9 10 LDA #$10 A:0003 X:00CE Y:0000 P:envMxdizC - Load 10 into A (D) (Failed Prayer)
$03/E85E 8D CA 34 STA $34CA  [$7E:34CA] A:0010 X:00CE Y:0000 P:envMxdizC - Store A in Battle Message Data.
$03/E861 80 08 BRA $08    [$E86B] A:0010 X:00CE Y:0000 P:envMxdizC - Branch Always to 03E86B
--------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E863 A9 0E LDA #$0E A:001C X:0083 Y:0000 P:eNvMxdizc - Load Cure into A.
$03/E865 8D D2 26 STA $26D2  [$7E:26D2] A:000E X:0083 Y:0000 P:envMxdizc - Store A in Next Action to take.
$03/E868 20 3E CD JSR $CD3E  [$03:CD3E] A:000E X:0083 Y:0000 P:envMxdizc - Jump to Subroutine (Magic Call)
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E86B A9 0B LDA #$0B A:0010 X:00CE Y:0000 P:envMxdizC - Load 0B into A.
$03/E86D 8D C8 34 STA $34C8  [$7E:34C8] A:000B X:00CE Y:0000 P:envMxdizC - Store A in 7E34C8.
$03/E870 A9 10 LDA #$10 A:000B X:00CE Y:0000 P:envMxdizC - Load 10 into A.
$03/E872 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:00CE Y:0000 P:envMxdizC - Store A in 7E34C7.
$03/E875 60 RTS A:0010 X:00CE Y:0000 P:envMxdizC -Return

Quite short and quite simple. It's becoming alarmingly clear. It seems all you need to do to get a command to use a Spell is...


$03/E863   A9 0E   LDA #$0E   A:001C   X:0083   Y:0000   P:eNvMxdizc - Load Spell into A.
$03/E865   8D D2 26   STA $26D2  [$7E:26D2]   A:000E   X:0083   Y:0000   P:envMxdizc - Store A in Next Action to take.
$03/E868   20 3E CD   JSR $CD3E  [$03:CD3E]   A:000E   X:0083   Y:0000   P:envMxdizc - Jump to Subroutine (Magic Call)

And that's it. Gird and Pray tell the same story in this regard. Making the "break the game" Command into an Actual skill for Cid (by using the saved bytes from their copied Peep info) is becoming more and more like a simple reality.

Next is Hide, let's see what that can tell us...

Code: [Select]
$03/E876 A6 A6 LDX $A6    [$00:00A6] A:0003 X:0012 Y:0000 P:envMxdizc - Load Character Slot into A.
$03/E878 BD 06 20 LDA $2006,x[$7E:2006] A:0003 X:0000 Y:0000 P:envMxdiZc - Load Slot X's Status Byte 4.
$03/E87B 09 80 ORA #$80 A:0000 X:0000 Y:0000 P:envMxdiZc - Add 80.
$03/E87D 9D 06 20 STA $2006,x[$7E:2006] A:0080 X:0000 Y:0000 P:eNvMxdizc - Store A in Slot X's Status Byte 4.
$03/E880 AE 34 35 LDX $3534  [$7E:3534] A:0080 X:0000 Y:0000 P:eNvMxdizc - Load X from 7E3534.
$03/E883 64 A9 STZ $A9    [$00:00A9] A:0080 X:0000 Y:0000 P:envMxdiZc - Store Zero in A9.
----------------------------------------------------(Looping Point)------------------------------------------------------------------------
$03/E885 BD 03 33 LDA $3303,x[$7E:3303] A:0080 X:0000 Y:0000 P:envMxdiZc - Load A from 7E3303.
$03/E888 C9 09 CMP #$09 A:0000 X:0000 Y:0000 P:envMxdiZc - Is it 09? (Hide)
$03/E88A D0 07 BNE $07    [$E893] A:0000 X:0000 Y:0000 P:eNvMxdizc - If not, branch to 03E893.
-------------------------------------------------------------------------------------------------------------------------------------------
$03/E88C A9 1C LDA #$1C A:0009 X:0010 Y:0000 P:envMxdiZC - Load 1C into A. (Show)
$03/E88E 9D 03 33 STA $3303,x[$7E:3313] A:001C X:0010 Y:0000 P:envMxdizC - Store A in 7E3313. (Location of Command to Replace.)
$03/E891 80 08 BRA $08    [$E89B] A:001C X:0010 Y:0000 P:envMxdizC - Branch to 08.
--------------------------------------------------------------------------------------------------------------------------------------------
$03/E893 BD 02 33 LDA $3302,x[$7E:3302] A:0000 X:0000 Y:0000 P:eNvMxdizc - Load A from 7E3302
$03/E896 09 80 ORA #$80 A:0050 X:0000 Y:0000 P:envMxdizc - Add 80 into A. (Makes it so no other command is selectable but Show)
$03/E898 9D 02 33 STA $3302,x[$7E:3302] A:00D0 X:0000 Y:0000 P:eNvMxdizc - Store A in 7E3302.
$03/E89B E8 INX A:00D0 X:0000 Y:0000 P:eNvMxdizc - +1 to X
$03/E89C E8 INX A:00D0 X:0001 Y:0000 P:envMxdizc +1 to X
$03/E89D E8 INX A:00D0 X:0002 Y:0000 P:envMxdizc +1 to X
$03/E89E E8 INX A:00D0 X:0003 Y:0000 P:envMxdizc +1 to X.
$03/E89F E6 A9 INC $A9    [$00:00A9] A:00D0 X:0004 Y:0000 P:envMxdizc - +1 to A9.
$03/E8A1 A5 A9 LDA $A9    [$00:00A9] A:00D0 X:0004 Y:0000 P:envMxdizc - Load A9 into A.
$03/E8A3 C9 05 CMP #$05 A:0001 X:0004 Y:0000 P:envMxdizc - Is it 05?
$03/E8A5 D0 DE BNE $DE    [$E885] A:0001 X:0004 Y:0000 P:eNvMxdizc - If not, loop back to 03E885.
$03/E8A7 A5 CD LDA $CD    [$00:00CD] A:0005 X:0014 Y:0000 P:envMxdiZC - Load Character ID into A.
$03/E8A9 85 00 STA $00    [$00:0000] A:0000 X:0014 Y:0000 P:envMxdiZC - Store A in 00.
$03/E8AB A9 09 LDA #$09 A:0000 X:0014 Y:0000 P:envMxdiZC - Load 09 into A.
$03/E8AD 20 85 80 JSR $8085  [$03:8085] A:0009 X:0014 Y:0000 P:envMxdizC - Jump to Subroutine (Lots of jumping)
$03/E8B0 A9 09 LDA #$09 A:0005 X:7504 Y:000A P:envMxdiZC - Load 09 into A.
$03/E8B2 8D C8 34 STA $34C8  [$7E:34C8] A:0009 X:7504 Y:000A P:envMxdizC - Store A in 7E34C8.
$03/E8B5 A9 10 LDA #$10 A:0009 X:7504 Y:000A P:envMxdizC - Load 10 into A.
$03/E8B7 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:7504 Y:000A P:envMxdizC - Store A in 7E34C7.
$03/E8BA 60 RTS A:0010 X:7504 Y:000A P:envMxdizC - Return

Now this is the first command that I've actively noticed this (and is likely true to Cover and Off as well) but the forced changing of the command is purely dealt with by using the Hide command. Now this has very interesting possibilities... Due to the way the game works, changing Commands that are on a character with the normal tools available to do so are only done normally through Different References of the same character outside of battle and Commands in-battle. What this seems to show is that we can change commands with a little bit of custom code at any time we please. Say we make an item that utilizes Dispel's formula space that gives a character a new skill. For instance, giving Paladin Cecil back Dark Wave through a custom event that rewards a special item that could only be used by Cecil (Proof of Concept in Crystal) which would move Item to Slot 5 and add Dark Wave to Slot 4.

Next up is Show.

Code: [Select]

$03/E8BB A6 A6 LDX $A6    [$00:00A6] A:0003 X:0038 Y:0000 P:envMxdizc - Load Slot X into A.
$03/E8BD BD 06 20 LDA $2006,x[$7E:2006] A:0003 X:0000 Y:0000 P:envMxdiZc - Load Slot X's Status Byte 4.
$03/E8C0 29 7F AND #$7F A:0080 X:0000 Y:0000 P:eNvMxdizc - Add 7F to it.
$03/E8C2 9D 06 20 STA $2006,x[$7E:2006] A:0000 X:0000 Y:0000 P:envMxdiZc - Store A Slot X's Status Byte 4.
$03/E8C5 AE 34 35 LDX $3534  [$7E:3534] A:0000 X:0000 Y:0000 P:envMxdiZc - Load X from 7E3534.
-----------------------------------------------(Looping Point)-------------------------------------------------------------------------------
$03/E8C8 64 A9 STZ $A9    [$00:00A9] A:0000 X:0000 Y:0000 P:envMxdiZc - Store Zero in A9.
$03/E8CA BD 03 33 LDA $3303,x[$7E:3303] A:0000 X:0000 Y:0000 P:envMxdiZc - Load Command Data into A.
$03/E8CD C9 1C CMP #$1C A:0000 X:0000 Y:0000 P:envMxdiZc - Is it Show?
$03/E8CF D0 07 BNE $07    [$E8D8] A:0000 X:0000 Y:0000 P:eNvMxdizc - If not, branch to 03E8D8.
--------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E8D1 A9 09 LDA #$09 A:001C X:0010 Y:0000 P:envMxdiZC - Load Sing into A.
$03/E8D3 9D 03 33 STA $3303,x[$7E:3313] A:0009 X:0010 Y:0000 P:envMxdizC - Store Sing to its original position.
$03/E8D6 80 08 BRA $08    [$E8E0] A:0009 X:0010 Y:0000 P:envMxdizC - Branch to 03E8E0.
---------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E8D8 BD 02 33 LDA $3302,x[$7E:3302] A:0000 X:0000 Y:0000 P:eNvMxdizc - Load State of Commands (Usable/Not)
$03/E8DB 29 7F AND #$7F A:00D0 X:0000 Y:0000 P:eNvMxdizc - Add 7F (to counter 80) (Restores Commands)
$03/E8DD 9D 02 33 STA $3302,x[$7E:3302] A:0050 X:0000 Y:0000 P:envMxdizc - Store A in 7E3302.
$03/E8E0 E8 INX A:0050 X:0000 Y:0000 P:envMxdizc +1 to X.
$03/E8E1 E8 INX A:0050 X:0001 Y:0000 P:envMxdizc +1 to X.
$03/E8E2 E8 INX A:0050 X:0002 Y:0000 P:envMxdizc +1 to X.
$03/E8E3 E8 INX A:0050 X:0003 Y:0000 P:envMxdizc +1 to X.
$03/E8E4 E6 A9 INC $A9    [$00:00A9] A:0050 X:0004 Y:0000 P:envMxdizc - +1 to A9.
$03/E8E6 A5 A9 LDA $A9    [$00:00A9] A:0050 X:0004 Y:0000 P:envMxdizc - Load A9 into A
$03/E8E8 C9 05 CMP #$05 A:0001 X:0004 Y:0000 P:envMxdizc - Has it checked all 5 commands?
$03/E8EA D0 DE BNE $DE    [$E8CA] A:0001 X:0004 Y:0000 P:eNvMxdizc - If not, loop to 03E8CA.
$03/E8EC A5 CD LDA $CD    [$00:00CD] A:0005 X:0014 Y:0000 P:envMxdiZC - Load Character ID into A.
$03/E8EE 85 00 STA $00    [$00:0000] A:0000 X:0014 Y:0000 P:envMxdiZC - Store A in 00.
$03/E8F0 A9 09 LDA #$09 A:0000 X:0014 Y:0000 P:envMxdiZC - Load 09 into A.
$03/E8F2 20 85 80 JSR $8085  [$03:8085] A:0009 X:0014 Y:0000 P:envMxdizC - Jump to Subroutine (Lots of Jumping)
$03/E8F5 A9 1C LDA #$1C A:0005 X:7504 Y:000A P:envMxdiZC - Load Command Name into A.
$03/E8F7 8D C8 34 STA $34C8  [$7E:34C8] A:001C X:7504 Y:000A P:envMxdizC - Store A in Small Message Data.
$03/E8FA A9 10 LDA #$10 A:001C X:7504 Y:000A P:envMxdizC - Load 10 into A.
$03/E8FC 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:7504 Y:000A P:envMxdizC - Store A in 7E34C7.
$03/E8FF 60 RTS A:0010 X:7504 Y:000A P:envMxdizC - Return.

Some interesting information gleaned from this. Something that is not seen in other commands and wholly unique to Hide is the inability to use any Command but Show afterwards. What is clear now is that the reference to 3302 (first byte of commands) is that it governs whether it can or can't be used. You can use no Commands under hide because the only exception made in it is for Show. All the others had have 80 added to their base value.



1159
Final Fantasy IV Research & Development / Re: Hide Command
« on: October 06, 2013, 11:21:20 PM »
Interestingly enough this behavior only applies to Edward (or whoever would be considered the Auto-Hider). In the SNES version any character with Hide can use it during any circumstance, unless they are Edward, then the special measure listed above is the key. This appears to deal nothing with the Hide command itself, but must be inherent to the Hide Status.

1160
Next up is Aim another self-explanatory command.

Code: [Select]
$03/E836 AD 9C 26 LDA $269C  [$7E:269C] A:0003 X:0018 Y:0000 P:envMxdizc - Load Caster's Physical Attack Percent.
$03/E839 48 PHA A:0034 X:0018 Y:0000 P:envMxdizc - Push A.
$03/E83A AD 29 27 LDA $2729  [$7E:2729] A:0034 X:0018 Y:0000 P:envMxdizc - Load Enemies (Non-existent) Evasion.
$03/E83D 48 PHA A:0000 X:0018 Y:0000 P:envMxdiZc - Push A.
$03/E83E 7B TDC A:0000 X:0018 Y:0000 P:envMxdiZc - Transfer Direct Page (thereby making it 00)
$03/E83F 8D 29 27 STA $2729  [$7E:2729] A:0000 X:0018 Y:0000 P:envMxdiZc - Store 00 in Target's Evasion.
$03/E842 3A DEC A A:0000 X:0018 Y:0000 P:envMxdiZc -1 to A.
$03/E843 8D 9C 26 STA $269C  [$7E:269C] A:00FF X:0018 Y:0000 P:eNvMxdizc - Store A  (FF - 255%) into Physical Attack Percent.
$03/E846 20 99 C4 JSR $C499  [$03:C499] A:00FF X:0018 Y:0000 P:eNvMxdizc - Jump to Subroutine (Full Fight Routine)
$03/E849 68 PLA A:0000 X:750E Y:0018 P:envMxdiZC - Pull A.
$03/E84A 8D 29 27 STA $2729  [$7E:2729] A:0000 X:750E Y:0018 P:envMxdiZC - Store A in Target's Evasion.
$03/E84D 68 PLA A:0000 X:750E Y:0018 P:envMxdiZC - Pull A.
$03/E84E 8D 9C 26 STA $269C  [$7E:269C] A:0034 X:750E Y:0018 P:envMxdizC - Store A in Caster's Accuracy.
$03/E851 60 RTS A:0034 X:750E Y:0018 P:envMxdizC - Return

It seems like only yesterday that I was flummoxed about how to make Aim into a less absolute command. At the time I knew very little and thought it was hopeless, but now I see what Square meant to do and because of what we have a bit freer space. Evasion would only ever effect battles against Valvalis/Barbariccia in the normal game. Therefore I think we could take those Evasion references and make them into something else.

I decided for this experiment to make the Accuracy of the currently equipped Bow to become the new Critical Hit Chance and x2 Accuracy.


$03/E836   AD 9C 26   LDA $269C  [$7E:269C]   A:0003   X:0018   Y:0000   P:envMxdizc - Load Caster's Accuracy.
$03/E839   48    PHA   A:0034   X:0018   Y:0000   P:envMxdizc - Push it onto the Stack in A.
$03/E83A   AE AD 26   LDX $26AD  [$7E:26AD]   A:0034   X:0018   Y:0000   P:envMxdizc - Load Caster's Critical Hit chance.
$03/E83D   DA    PHX   A:0034   X:2306   Y:0000   P:envMxdizc - Push it onto the Stack in X.
$03/E83E   0A    ASL A   A:0034   X:2306   Y:0000   P:envMxdizc - x2 A (Caster's Accuracy)
$03/E83F   8D 9C 26   STA $269C  [$7E:269C]   A:0068   X:2306   Y:0000   P:envMxdizc - Store A in current accuracy.
$03/E842   4A    LSR A   A:0068   X:2306   Y:0000   P:envMxdizc - /2 A (Caster's Accuracy)
$03/E843   8D AD 26   STA $26AD  [$7E:26AD]   A:0034   X:2306   Y:0000   P:envMxdizc - Store in Critical Hit Chance.
$03/E846   20 99 C4   JSR $C499  [$03:C499]   A:0034   X:2306   Y:0000   P:envMxdizc - Jump to Fighting Subroutine.
$03/E849   FA    PLX   A:0000   X:750E   Y:0018   P:envMxdiZC - Pull X from Stack. (To restore original values)
$03/E84A   8E AD 26   STX $26AD  [$7E:26AD]   A:0000   X:2306   Y:0018   P:envMxdizC - Store X in Critical Hit Chance.
$03/E84D   68    PLA   A:0000   X:2306   Y:0018   P:envMxdizC - Pull A from Stack. (To restore original values)
$03/E84E   8D 9C 26   STA $269C  [$7E:269C]   A:0034   X:2306   Y:0018   P:envMxdizC - Store A in Accuracy.
$03/E851   60    RTS   A:0034   X:2306   Y:0018   P:envMxdizC - Return.


It took a little bit of time to figure it out, to make all of this work but it is tried and tested and works flawlessly. It gives Aim that extra push it needs to stack up against the better Commands and it only gets better as the game goes on, with the last bow the player will likely get topping out at 60% Critical Hit Chance for each attack whenever they use Aim with the Samurai Bow. Perhaps its a bit broken, but I was working with a bit of limited space after all, hehe.

 :edit: January 5th 2014 - 2 New Aim Replacements!

Wow... Barrage (FFIII DS, FFT:War of the Lions) was a Stupidly easy thing to program in the end... at least in a basic form...

Because of space limitations I decided to call it (Arrow Symbol)Strm (Arrow Storm) after a tactic common to the Romance of the Three Kingdoms series.

Code: [Select]
$03/E836 20 99 C4 JSR $C499  [$03:C499] A:0003 X:0018 Y:0000 P:envMxdizc - Fight Routine x4
$03/E839 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E83C 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E83F 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E842 60 RTS A:0000 X:750E Y:0018 P:envMxdiZC - Return
Yes, four normal attacks. I honestly thought this was going to cause an overflow problem with the arrows, but to my amazement the game Properly decrements them without overflowing. (And if used with less than 3 Arrows you will no longer have any arrows) And as you'd expect it deals x4 Damage (though without my Infinite Arrow-Glitch fix it still has that problem as you'd expect.)


Now, these all add up properly, but there's still two pieces I'm missing. This first is how to divide the damage by 2. I may need to look back at the original Aim Command for guidance... Specifically at...

$03/E836   AD 9C 26   LDA $269C  [$7E:269C]   A:0003   X:0018   Y:0000   P:envMxdizc - Load Caster's Physical Attack Percent.
$03/E839   48    PHA   A:0034   X:0018   Y:0000   P:envMxdizc - Push A.

That seems like a fine start to a recipe actually.

Well... I learned something through this experience... Never Ever Forget to Retrieve Your Pushed Values!!

For roughly an hour I was looking at my preliminary code, wondering what I was doing wrong, when it finally dawned on me that because I was testing the pure functionality I never retrieved the Pushed value back and this causes a system crash.

So I now have Arrowstorm working like Barrage from FFT:War of the Lions! 4 half-damage attack that takes 4 Ammo for roughly 2x damage (but it attacks four times so even more chance of a status infliction if applicable)

Arrowstorm

Code: [Select]
$03/E836 AD 9D 26 LDA $269D  [$7E:269D] A:0003 X:0018 Y:0000 P:envMxdizc - Load Caster's Physical Attack Base.
$03/E839 48 PHA A:0053 X:0018 Y:0000 P:envMxdizc - Push A onto Stack.
$03/E83A 4A LSR A A:0053 X:0018 Y:0000 P:envMxdizc - Divide Physical Attack Base by 2.
$03/E83B 8D 9D 26 STA $269D  [$7E:269D] A:0029 X:0018 Y:0000 P:envMxdizC - Store A in Physical Attack Base.
$03/E83E 20 99 C4 JSR $C499  [$03:C499] A:0029 X:0018 Y:0000 P:envMxdizC - Fight Routine x 4
$03/E841 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E844 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E847 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC
$03/E84A 68 PLA A:0000 X:750E Y:0018 P:envMxdiZC - Pull A
$03/E84B 8D 9D 26 STA $269D  [$7E:269D] A:0053 X:750E Y:0018 P:envMxdizC - Store A in Physical Attack Base (original value)
$03/E84E 60 RTS A:0053 X:750E Y:0018 P:envMxdizC - Return


Now, FFIII's Barrage is a little trickier to get down...

The way that works is each shot deals full damage +another 10-40% depending on the Job Level. To mimic this, (as well as I can...) I would instead make it look at Strength. At
0-39 Str. There would be no bonus. 40-60 1/8 Bonus in Damage, 60-99 1/4 Bonus in damage. It might encourage people to use Rosa in a Strength set-up rather than always going for the Will set-up possibly. But this seems like it will take a bit more space than Aim actually supports. So I'll have to hold off on that for now.

Though I suppose I could make a variant... (looks back at how he programmed Aura originally...) Yes. Instead make it so that Two Attacks will occur automatically. And if you have over 45 Strength a third one happens and at over 60 strength a fourth one occurs.

Barrage (Arrowstorm) FFIII "Style" (Sort of)

Code: [Select]
$03/E836 20 99 C4 JSR $C499  [$03:C499] A:0003 X:0018 Y:0000 P:envMxdizc - Fight Routine
$03/E839 20 99 C4 JSR $C499  [$03:C499] A:0000 X:750E Y:0018 P:envMxdiZC - Fight Routine
$03/E83C AD 94 26 LDA $2694  [$7E:2694] A:0000 X:750E Y:0018 P:envMxdiZC - Load Modified Strength
$03/E83F C9 2D CMP #$2D A:005D X:750E Y:0018 P:envMxdizC - Is it 45 or Higher?
$03/E841 90 0E BCC $0E    [$E851] A:005D X:750E Y:0018 P:envMxdizC - If lower branch to 03E851
$03/E843 20 99 C4 JSR $C499  [$03:C499] A:005D X:750E Y:0018 P:envMxdizC - Fight Routine
$03/E846 AD 94 26 LDA $2694  [$7E:2694] A:0000 X:750E Y:0018 P:envMxdiZC - Load Modified Strength
$03/E849 C9 3C CMP #$3C A:005D X:750E Y:0018 P:envMxdizC - Is it 60 or Higher?
$03/E84B 90 04 BCC $04    [$E851] A:005D X:750E Y:0018 P:envMxdizC - If lower branch to 03E851
$03/E84D 20 99 C4 JSR $C499  [$03:C499] A:005D X:750E Y:0018 P:envMxdizC - Fight Routine
$03/E850 60 RTS A:0000 X:750E Y:0018 P:envMxdiZC - Return

Geez, I must really love the Aim Command, I've now made three variants for it!

1161
Next up is the Focus/Power/Boost routine. It should seem simple enough in practice.

Code: [Select]
$03/E7F0 EE 0A 39 INC $390A  [$7E:390A] A:0003 X:001A Y:0000 P:envMxdizc - +1 to 7E390A.
$03/E7F3 A9 1F LDA #$1F A:0003 X:001A Y:0000 P:envMxdizc - Load 1F into A.
$03/E7F5 8D 7B 39 STA $397B  [$7E:397B] A:001F X:001A Y:0000 P:envMxdizc - Store A in 7E397B.
$03/E7F8 A9 0C LDA #$0C A:001F X:001A Y:0000 P:envMxdizc - Load 0C into A.
$03/E7FA 85 D6 STA $D6    [$00:00D6] A:000C X:001A Y:0000 P:envMxdizc  - Store A in D6.
$03/E7FC A5 CD LDA $CD    [$00:00CD] A:000C X:001A Y:0000 P:envMxdizc - Load Character Identifier Into A.
$03/E7FE 20 36 9E JSR $9E36  [$03:9E36] A:0000 X:001A Y:0000 P:envMxdiZc - Jump to Subroutine (Likely something dealing with Timers and Speed.)
$03/E801 A9 03 LDA #$03 A:0000 X:0005 Y:0005 P:envMxdizc - Load 03 into A.
$03/E803 20 C8 85 JSR $85C8  [$03:85C8] A:0003 X:0005 Y:0005 P:envMxdizc - Jump to Subroutine (Difficult to Say)
$03/E806 A9 08 LDA #$08 A:0000 X:0003 Y:0005 P:envMxdiZc - Load 08 into A.
$03/E808 9D 06 2A STA $2A06,x[$7E:2A09] A:0008 X:0003 Y:0005 P:envMxdizc - Store A in 7E2A09.
$03/E80B A6 A6 LDX $A6    [$00:00A6] A:0008 X:0003 Y:0005 P:envMxdizc - Load X from A6 (Character Slot)
$03/E80D BD 05 20 LDA $2005,x[$7E:2005] A:0008 X:0000 Y:0005 P:envMxdiZc - Load Slot X's Status Byte 3.
$03/E810 09 08 ORA #$08 A:0000 X:0000 Y:0005 P:envMxdiZc - Add 08 if not already there (Charging)
$03/E812 9D 05 20 STA $2005,x[$7E:2005] A:0008 X:0000 Y:0005 P:envMxdizc - Store Charging in Slot X's Status Byte 3.
$03/E815 A9 1F LDA #$1F A:0008 X:0000 Y:0005 P:envMxdizc - Load 1F into A. (Action to take after the timer has expired.)
$03/E817 9D 51 20 STA $2051,x[$7E:2051] A:001F X:0000 Y:0005 P:envMxdizc - Store 1F in Slot X's Next Action to Take.
$03/E81A 20 A6 85 JSR $85A6  [$03:85A6] A:001F X:0000 Y:0005 P:envMxdizc - Jump to Subroutine (??)
$03/E81D A9 39 LDA #$39 A:0003 X:0000 Y:0005 P:envMxdizc - Load 39 into A (D)
$03/E81F 8D CA 34 STA $34CA  [$7E:34CA] A:0039 X:0000 Y:0005 P:envMxdizc - Store A in Battle Message Data.
$03/E822 60 RTS A:0039 X:0000 Y:0005 P:envMxdizc - Return

Only the basics of what you would expect are in here, but most interestingly is $03/E817   9D 51 20   STA $2051,x[$7E:2051]   A:001F   X:0000   Y:0005   P:envMxdizc - Store 1F in Slot X's Next Action to Take..

What this does is it would allow you to set the next action you take. what takes away the Charging Status is held in Command 1F. You could set it to a normal command of any sort (as long as it doesn't open a sub-menu) and you would effectively have a permanent Charge status, meaning you would deal double the damage, but you would also still be heavily afflicted by Charging's detriments.

The second part of Focus as you would imagine is the actual attack.

Focus (Command 1F) Routine -

Code: [Select]
$03/E823 20 99 C4 JSR $C499  [$03:C499] A:0003 X:003E Y:0000 P:envMxdizc - Jump to Subroutine (All of the Fight Routine)
$03/E826 A5 CD LDA $CD    [$00:00CD] A:0000 X:750E Y:0018 P:envMxdiZC - Load Character Identifier into A.
$03/E828 20 89 84 JSR $8489  [$03:8489] A:0000 X:750E Y:0018 P:envMxdiZC - Jump to Subroutine (Preparation?)
$03/E82B A6 A6 LDX $A6    [$00:00A6] A:0000 X:0000 Y:0018 P:envMxdiZc - Load Character Slot into X.
$03/E82D BD 05 20 LDA $2005,x[$7E:2005] A:0000 X:0000 Y:0018 P:envMxdiZc - Load Slot X's Status Byte 3 into A.
$03/E830 29 F7 AND #$F7 A:0008 X:0000 Y:0018 P:envMxdizc - -8, getting rid of Charging Status.
$03/E832 9D 05 20 STA $2005,x[$7E:2005] A:0000 X:0000 Y:0018 P:envMxdiZc - Store A in 7E2005.
$03/E835 60 RTS A:0000 X:0000 Y:0018 P:envMxdiZc - Return.

And that is it for Focus. Maybe with a bit more wit we could refocus the JSR to not look at Fight, but then where would an applicable place be?







1162
Next up is Gird/Endure/Bear - Yang Casting Protect on Himself for free.

Gird Routine -

Code: [Select]
$03/E696 A9 05 LDA #$05 A:0003 X:001E Y:0000 P:envMxdizc - Load 05 into A. (Protect)
$03/E698 8D D2 26 STA $26D2  [$7E:26D2] A:0005 X:001E Y:0000 P:envMxdizc - Store A in Next Action (Protect)
$03/E69B 9C C4 33 STZ $33C4  [$7E:33C4] A:0005 X:001E Y:0000 P:envMxdizc - Store Zero in 7E33C4.
$03/E69E 20 3E CD JSR $CD3E  [$03:CD3E] A:0005 X:001E Y:0000 P:envMxdizc - Jump to Subroutine (Magic Call... Look at Salve Routine for more detail)
$03/E6A1 20 B1 85 JSR $85B1  [$03:85B1] A:0080 X:0680 Y:001A P:eNvMxdizC - Jump to Subroutine (Nothing of great value as far as I can tell.)
$03/E6A4 A9 3A LDA #$3A A:0003 X:0680 Y:001A P:envMxdizC - Load 3A into A. (D)
$03/E6A6 8D CA 34 STA $34CA  [$7E:34CA] A:003A X:0680 Y:001A P:envMxdizC - Store A in 7E34CA (Battle Message Area)
$03/E6A9 A9 0F LDA #$0F A:003A X:0680 Y:001A P:envMxdizC - Load 0F into A.
$03/E6AB 8D C8 34 STA $34C8  [$7E:34C8] A:000F X:0680 Y:001A P:envMxdizC - Store A in 7E34C8.
$03/E6AE A9 10 LDA #$10 A:000F X:0680 Y:001A P:envMxdizC - Load 10 into A.
$03/E6B0 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:0680 Y:001A P:envMxdizC - Store A in 7E34C7.
$03/E6B3 60 RTS A:0010 X:0680 Y:001A P:envMxdizC - Return

That was a routine? Much shorter than I expected for a literal Spell Casting routine, but this is actually Very good news. Look at how short it is to Actually make a Command cast a given spell? It seems much shorter than Peep. So in reality you could virtually copy this data, paste it into Peep, change 05 to Peep's spell number and there you go. You would probably even save yourself quite a few bytes in doing so.

Interestingly, while Gird clearly shows the character taking a defensive stance it doesn't actually give the user Defensive Status.

Next up is Kick Routine, that we already know is linked to directly to Dark Wave, unfortunately. Change the stat determination in one and you change the stats in the other.

So let's see what the Routine has to show us.


Kick Routine -

Code: [Select]
$03/E6B4 64 C1 STZ $C1    [$00:00C1] A:0003 X:001C Y:0000 P:envMxdizc - Store Zero in C1.
$03/E6B6 4C B9 E6 JMP $E6B9  [$03:E6B9] A:0003 X:001C Y:0000 P:envMxdizc - Jump to... 0 bytes away. Sure, alright.
$03/E6B9 A5 CD LDA $CD    [$00:00CD] A:0003 X:001C Y:0000 P:envMxdizc - Load CD into A. (Character ID?)
$03/E6BB 10 4A BPL $4A    [$E707] A:0000 X:001C Y:0000 P:envMxdiZc - Branch if Plus to 03E707. (If a player is not using it (and is for Enemy Yang)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E6BD 8D C7 34 STA $34C7  [$7E:34C7] A:0080 X:001C Y:0000 P:eNvMxdizc - Store A in 7E34C7.
$03/E6C0 A9 F8 LDA #$F8 A:0080 X:001C Y:0000 P:eNvMxdizc - Load F8 into A
$03/E6C2 8D C5 34 STA $34C5  [$7E:34C5] A:00F8 X:001C Y:0000 P:eNvMxdizc - Store A in 7E34C5.
$03/E6C5 7B TDC A:00F8 X:001C Y:0000 P:eNvMxdizc - Transfer Direct Page.
$03/E6C6 AA TAX A:0000 X:001C Y:0000 P:envMxdiZc - Transfer A to X.
$03/E6C7 A8 TAY A:0000 X:0000 Y:0000 P:envMxdiZc - Transfer A to Y.
------------------------------------------------------------------(Looping Point)------------------------------------------------------------------------------
$03/E6C8 BD C2 33 LDA $33C2,x[$7E:33C2] A:0000 X:0000 Y:0000 P:envMxdiZc - Load 7E33C2 into A. (Graphics of some kind?)
$03/E6CB 99 9C 28 STA $289C,y[$7E:289C] A:00F2 X:0000 Y:0000 P:eNvMxdizc - Store A in 7E289C.
$03/E6CE C9 CE CMP #$CE A:00F2 X:0000 Y:0000 P:eNvMxdizc - Is it CE?
$03/E6D0 F0 08 BEQ $08    [$E6DA] A:00F2 X:0000 Y:0000 P:envMxdizC - If so branch to 03E6DA.
$03/E6D2 C9 C5 CMP #$C5 A:00F2 X:0000 Y:0000 P:envMxdizC - Is it C5?
$03/E6D4 F0 04 BEQ $04    [$E6DA] A:00F2 X:0000 Y:0000 P:envMxdizC - If so branch to 03E6DA.
$03/E6D6 E8 INX A:00F2 X:0000 Y:0000 P:envMxdizC - +1 X.
$03/E6D7 C8 INY A:00F2 X:0001 Y:0000 P:envMxdizC - +1 Y.
$03/E6D8 80 EE BRA $EE    [$E6C8] A:00F2 X:0001 Y:0001 P:envMxdizC - Loop back to 03E6C8.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E6DA C8 INY A:00CE X:0002 Y:0002 P:envMxdiZC - +1 to Y.
$03/E6DB A9 F8 LDA #$F8 A:00CE X:0002 Y:0003 P:envMxdizC - Load F8 into A.
$03/E6DD 99 9C 28 STA $289C,y[$7E:289F] A:00F8 X:0002 Y:0003 P:eNvMxdizC - Store A in 7E289F.
$03/E6E0 C8 INY A:00F8 X:0002 Y:0003 P:eNvMxdizC - +1 to Y.
$03/E6E1 A9 04 LDA #$04 A:00F8 X:0002 Y:0004 P:envMxdizC + Load 04 into A.
$03/E6E3 99 9C 28 STA $289C,y[$7E:28A0] A:0004 X:0002 Y:0004 P:envMxdizC - Store A in 7E28A0.
$03/E6E6 C8 INY A:0004 X:0002 Y:0004 P:envMxdizC - +1 to Y.
$03/E6E7 E8 INX A:0004 X:0002 Y:0005 P:envMxdizC +1 to X.
$03/E6E8 BD C2 33 LDA $33C2,x[$7E:33C5] A:0004 X:0003 Y:0005 P:envMxdizC - Load A from 7E33C5 (Graphics of some kind?)
$03/E6EB 99 9C 28 STA $289C,y[$7E:28A1] A:00FE X:0003 Y:0005 P:eNvMxdizC - Store A in 7E28A1.
$03/E6EE C9 FF CMP #$FF A:00FE X:0003 Y:0005 P:eNvMxdizC - Is it FF?
 $03/E6F0 F0 04 BEQ $04    [$E6F6] A:00FE X:0003 Y:0005 P:eNvMxdizc - If it is branch to 03E6F6.
$03/E6F2 E8 INX A:00FE X:0003 Y:0005 P:eNvMxdizc - +1 to X.
$03/E6F3 C8 INY A:00FE X:0004 Y:0005 P:envMxdizc  - +1 to Y.
$03/E6F4 80 F2 BRA $F2    [$E6E8] A:00FE X:0004 Y:0006 P:envMxdizc - Loop back to 03E6E8.
--------------------------------------------------------------------------------------------------------------------------------------
$03/E6F6 7B TDC A:00FF X:0004 Y:0006 P:envMxdiZC - Transfer Direct Page.
$03/E6F7 AA TAX A:0000 X:0004 Y:0006 P:envMxdiZC - Transfer A to X.
$03/E6F8 BD 9C 28 LDA $289C,x[$7E:289C] A:0000 X:0000 Y:0006 P:envMxdiZC - Load 7E289C.
$03/E6FB 9D C2 33 STA $33C2,x[$7E:33C2] A:00F2 X:0000 Y:0006 P:eNvMxdizC - Store A in 7E33C2.
$03/E6FE C9 FF CMP #$FF A:00F2 X:0000 Y:0006 P:eNvMxdizC - Is it FF?
$03/E700 F0 03 BEQ $03    [$E705] A:00F2 X:0000 Y:0006 P:eNvMxdizc -If so branch to 03E705.
$03/E702 E8 INX A:00F2 X:0000 Y:0006 P:eNvMxdizc - +1 to X.
$03/E703 80 F3 BRA $F3    [$E6F8] A:00F2 X:0001 Y:0006 P:envMxdizc - Loop back to 03E6F8.
$03/E705 80 0A BRA $0A    [$E711] A:00FF X:0006 Y:0006 P:envMxdiZC - Branch to 03E711
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E707 A9 F8 LDA #$F8 A:0000 X:001C Y:0000 P:envMxdiZc - Load F8 into A. (Possibly Graphics Data of sorts)
$03/E709 8D C6 33 STA $33C6  [$7E:33C6] A:00F8 X:001C Y:0000 P:eNvMxdizc - Store A in 7E33C6.
$03/E70C A9 04 LDA #$04 A:00F8 X:001C Y:0000 P:eNvMxdizc - Load 04 into A.
$03/E70E 8D C7 33 STA $33C7  [$7E:33C7] A:0004 X:001C Y:0000 P:envMxdizc - Store A in 7E33C7.
$03/E711 AD 81 38 LDA $3881  [$7E:3881] A:0004 X:001C Y:0000 P:envMxdizc - Load A from 7E3881.
$03/E714 F0 03 BEQ $03    [$E719] A:0000 X:001C Y:0000 P:envMxdiZc - If 00 branch to 03E719.
----------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------
$03/E719 A6 A6 LDX $A6    [$00:00A6] A:0000 X:001C Y:0000 P:envMxdiZc - Load X from A6 (Must be to see who is using Kick)
$03/E71B BD 1B 20 LDA $201B,x[$7E:201B] A:0000 X:0000 Y:0000 P:envMxdiZc - Load User's Physical Attack Multiplier.
$03/E71E 85 DF STA $DF    [$00:00DF] A:0003 X:0000 Y:0000 P:envMxdizc - Store A in DF.
$03/E720 A5 C1 LDA $C1    [$00:00C1] A:0003 X:0000 Y:0000 P:envMxdizc - Load A from C1.
$03/E722 D0 08 BNE $08    [$E72C] A:0000 X:0000 Y:0000 P:envMxdiZc - Branch if not 00 to 03E72C. (Skipped by Dark Wave)
$03/E724 46 DF LSR $DF    [$00:00DF] A:0000 X:0000 Y:0000 P:envMxdiZc - Divide Physical Attack Multiplier by 2.
$03/E726 A5 DF LDA $DF    [$00:00DF] A:0000 X:0000 Y:0000 P:envMxdizC - Load DF into A.
$03/E728 D0 02 BNE $02    [$E72C] A:0001 X:0000 Y:0000 P:envMxdizC - If not 00 branch to 03E72C.
$03/E72C A5 DF LDA $DF    [$00:00DF] A:0001 X:0000 Y:0000 P:envMxdizC - Load DF into A (In case it came from an earlier branch)
$03/E72E 85 84 STA $84    [$00:0084] A:0001 X:0000 Y:0000 P:envMxdizC - Store A in 84.
$03/E730 BD 1D 20 LDA $201D,x[$7E:201D] A:0001 X:0000 Y:0000 P:envMxdizC - Load User's Physical Attack Base.
$03/E733 85 C5 STA $C5    [$00:00C5] A:0027 X:0000 Y:0000 P:envMxdizC - Store A in C5.
$03/E735 85 E1 STA $E1    [$00:00E1] A:0027 X:0000 Y:0000 P:envMxdizC - Store A in E1.
$03/E737 20 E0 83 JSR $83E0  [$03:83E0] A:0027 X:0000 Y:0000 P:envMxdizC - Jump to Subroutine (HP Dealing?)
$03/E73A 46 E4 LSR $E4    [$00:00E4] A:0000 X:0000 Y:0000 P:envMxdiZc - E4 /2.
$03/E73C 66 E3 ROR $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdiZc - E3 /2.
$03/E73E A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0000 P:envMxdizC - Load X from E3.
$03/E740 86 CB STX $CB    [$00:00CB] A:0000 X:0013 Y:0000 P:envMxdizC - Store X in CB.
$03/E742 A5 CD LDA $CD    [$00:00CD] A:0000 X:0013 Y:0000 P:envMxdizC - Load A from CD. (Character ID)
$03/E744 30 0C BMI $0C    [$E752] A:0000 X:0013 Y:0000 P:envMxdiZC - Branch if Negative to 03E752. (Enemy Yang using it)
$03/E746 A2 05 00 LDX #$0005 A:0000 X:0013 Y:0000 P:envMxdiZC - Load 0005 into X. (Starting points of Targets -1)
$03/E749 86 C7 STX $C7    [$00:00C7] A:0000 X:0005 Y:0000 P:envMxdizC - Store X in C7.
$03/E74B A2 0D 00 LDX #$000D A:0000 X:0005 Y:0000 P:envMxdizC - Load 0000D into X (Number of Targets)
$03/E74E 86 C3 STX $C3    [$00:00C3] A:0000 X:000D Y:0000 P:envMxdizC - Store X in C3.
$03/E750 80 09 BRA $09    [$E75B] A:0000 X:000D Y:0000 P:envMxdizC -Branch to 03E75B.
----------------------------------------------------------------------------------------------------------------------------------------
$03/E752 7B TDC A:0080 X:0081 Y:0006 P:eNvMxdizc - Transfer Direct Page.
$03/E753 AA TAX A:0000 X:0081 Y:0006 P:envMxdiZc - Transfer A to X.
$03/E754 86 C7 STX $C7    [$00:00C7] A:0000 X:0000 Y:0006 P:envMxdiZc - Store X in C7.
$03/E756 A2 05 00 LDX #$0005 A:0000 X:0000 Y:0006 P:envMxdiZc - Load 0005 into X.
$03/E759 86 C3 STX $C3    [$00:00C3] A:0000 X:0005 Y:0006 P:envMxdizc - Store X in C3 (Possibly enemy targeting works differently inwardly)
----------------------------------------------------------------------------------------------------------------------------------------
$03/E75B 7B TDC A:0000 X:000D Y:0000 P:envMxdizC - Transfer Direct Page.
$03/E75C AA TAX A:0000 X:000D Y:0000 P:envMxdiZC - Transfer A to X.
$03/E75D A5 C5 LDA $C5    [$00:00C5] A:0000 X:0000 Y:0000 P:envMxdiZC - Load Physical Attack Base into A.
$03/E75F 20 79 83 JSR $8379  [$03:8379] A:0027 X:0000 Y:0000 P:envMxdizC - Jump to Subroutine (Generated Random Number, likely between 0-Physical Attack Base)
$03/E762 85 C9 STA $C9    [$00:00C9] A:001E X:0000 Y:0000 P:envMxdizc - Store A in C9.
$03/E764 18 CLC A:001E X:0000 Y:0000 P:envMxdizc - Clear Carry Flag.
$03/E765 A5 CB LDA $CB    [$00:00CB] A:001E X:0000 Y:0000 P:envMxdizc - Load A from CB.
$03/E767 65 C9 ADC $C9    [$00:00C9] A:0013 X:0000 Y:0000 P:envMxdizc - Add A to C9.
$03/E769 85 C9 STA $C9    [$00:00C9] A:0031 X:0000 Y:0000 P:envMxdizc - Store A in C9.
$03/E76B A5 CC LDA $CC    [$00:00CC] A:0031 X:0000 Y:0000 P:envMxdizc - Load A from CC.
$03/E76D 69 00 ADC #$00 A:0000 X:0000 Y:0000 P:envMxdiZc - Add 00 to A.
$03/E76F 85 CA STA $CA    [$00:00CA] A:0000 X:0000 Y:0000 P:envMxdiZc - Store A in CA.
$03/E771 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0000 Y:0000 P:envMxdiZc - Load C7 into A.
$03/E773 AA TAX A:0005 X:0000 Y:0000 P:envMxdizc - Transfer A to X.
$03/E774 BD 40 35 LDA $3540,x[$7E:3545] A:0005 X:0005 Y:0000 P:envMxdizc - Load A from 7E3545.
$03/E777 D0 68 BNE $68    [$E7E1] A:0000 X:0005 Y:0000 P:envMxdiZc - If not 00 branch to 03E7E1.
-----------------------------------------------------------------------------------------------------------------------------------------------
$03/E779 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0005 Y:0000 P:envMxdiZc - Load A from C7.
$03/E77B 20 89 84 JSR $8489  [$03:8489] A:0005 X:0005 Y:0000 P:envMxdizc - Jump to Subroutine (Preparation?)
$03/E77E A6 A6 LDX $A6    [$00:00A6] A:0000 X:05A0 Y:0000 P:envMxdizc - Load X from A6 (Tells the game what is being targetted)
$03/E780 BD 03 20 LDA $2003,x[$7E:2283] A:0000 X:0280 Y:0000 P:envMxdizc - Load Status Byte 1 of Monster Slot X into A.
$03/E783 29 C0 AND #$C0 A:0000 X:0280 Y:0000 P:envMxdiZc - Are they Petrified or Dead?
$03/E785 D0 5A BNE $5A    [$E7E1] A:0000 X:0280 Y:0000 P:envMxdiZc - If so branch to 03E7E1.
----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E787 BD 05 20 LDA $2005,x[$7E:2285] A:0000 X:0280 Y:0000 P:envMxdiZc - Load Status Byte 3 of Monster Slot X into A.
$03/E78A 29 02 AND #$02 A:0000 X:0280 Y:0000 P:envMxdiZc - Is it Jumping?
$03/E78C D0 53 BNE $53    [$E7E1] A:0000 X:0280 Y:0000 P:envMxdiZc - If so branch to 03E7E1.
---------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E78E BD 06 20 LDA $2006,x[$7E:2286] A:0000 X:0280 Y:0000 P:envMxdiZc - Load Status Byte 4 of Monster Slot X into A.
$03/E791 30 4E BMI $4E    [$E7E1] A:0000 X:0280 Y:0000 P:envMxdiZc - Is it Hiding?, if so branch to 03E7E1.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E793 BD 40 20 LDA $2040,x[$7E:22C0] A:0000 X:0280 Y:0000 P:envMxdiZc - Load Creature Type of Monster Slot X into A.
$03/E796 29 20 AND #$20 A:0000 X:0280 Y:0000 P:envMxdiZc - Is it Slime?
$03/E798 D0 47 BNE $47    [$E7E1] A:0000 X:0280 Y:0000 P:envMxdiZc - If so branch to 03E7E1.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E79A A5 C1 LDA $C1    [$00:00C1] A:0000 X:0280 Y:0000 P:envMxdiZc - Load A from C1.
$03/E79C F0 0D BEQ $0D    [$E7AB] A:0000 X:0280 Y:0000 P:envMxdiZc - If it is 00 branch to 03E7AB
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(Special Part of Code, Used by Dark Wave)!!!!!!!!!!!!!!!!!!!!!!!!!!
$03/E79E BD 40 20 LDA $2040,x[$7E:22C0] A:002E X:0280 Y:0000 P:envMxdizc - Load Creature Type of Monster Slot X into A.
$03/E7A1 10 08 BPL $08    [$E7AB] A:0000 X:0280 Y:0000 P:envMxdiZc - If it not Zombie, branch to 03E7AB.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7A3 46 CA LSR $CA    [$00:00CA] A:0080 X:0280 Y:0000 P:eNvMxdizc - /2 CA.
$03/E7A5 66 C9 ROR $C9    [$00:00C9] A:0080 X:0280 Y:0000 P:envMxdiZc /2 C9
$03/E7A7 46 CA LSR $CA    [$00:00CA] A:0080 X:0280 Y:0000 P:envMxdizC /2 CA
$03/E7A9 66 C9 ROR $C9    [$00:00C9] A:0080 X:0280 Y:0000 P:envMxdiZc /2 C9 9 (Divide Damage by 4)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7AB A5 C1 LDA $C1    [$00:00C1] A:0000 X:0280 Y:0000 P:envMxdiZc  - Load A from C1.
$03/E7AD D0 20 BNE $20    [$E7CF] A:0000 X:0280 Y:0000 P:envMxdiZc - If it is not 00 branch to 03E7CF.
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7AF A5 84 LDA $84    [$00:0084] A:0000 X:0280 Y:0000 P:envMxdiZc - Load A from 84.
$03/E7B1 85 DF STA $DF    [$00:00DF] A:0001 X:0280 Y:0000 P:envMxdizc  - Store A in DF (same as normal?)
$03/E7B3 BD 2A 20 LDA $202A,x[$7E:22AA] A:0001 X:0280 Y:0000 P:envMxdizc - Load Monster Slot X's Physical Defense Base.
$03/E7B6 85 E1 STA $E1    [$00:00E1] A:0000 X:0280 Y:0000 P:envMxdiZc - Store A in E1.
$03/E7B8 20 E0 83 JSR $83E0  [$03:83E0] A:0000 X:0280 Y:0000 P:envMxdiZc - Jump to Subroutine (HP Dealing?)
$03/E7BB 38 SEC A:0000 X:0000 Y:0000 P:envMxdiZc - Set Carry Flag
$03/E7BC A5 C9 LDA $C9    [$00:00C9] A:0000 X:0000 Y:0000 P:envMxdiZC - Load A from C9. (Where Random Number +Attack Base seemed to be stored)
$03/E7BE E5 E3 SBC $E3    [$00:00E3] A:0031 X:0000 Y:0000 P:envMxdizC  - A from E3. (-Random Number +Attack Base from E3.)
$03/E7C0 85 C9 STA $C9    [$00:00C9] A:0031 X:0000 Y:0000 P:envMxdizC - Store A in C9.
$03/E7C2 A5 CA LDA $CA    [$00:00CA] A:0031 X:0000 Y:0000 P:envMxdizC - Load A from CA.
$03/E7C4 E5 E4 SBC $E4    [$00:00E4] A:0000 X:0000 Y:0000 P:envMxdiZC - A from E4.
$03/E7C6 85 CA STA $CA    [$00:00CA] A:0000 X:0000 Y:0000 P:envMxdiZC - Store A in CA.
$03/E7C8 B0 05 BCS $05    [$E7CF] A:0000 X:0000 Y:0000 P:envMxdiZC - ?Branch if 00 or less than.?
------------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7CF A6 C9 LDX $C9    [$00:00C9] A:0000 X:0000 Y:0000 P:envMxdiZC - Load X from C9 (Random Number +Attack Base)
$03/E7D1 F0 F7 BEQ $F7    [$E7CA] A:0000 X:0031 Y:0000 P:envMxdizC - Loop if equal to ?00? to 03E7CA.
$03/E7D3 A5 C7 LDA $C7    [$00:00C7] A:0000 X:0031 Y:0000 P:envMxdizC - Load C7 into A. (5 static, it seems)
$03/E7D5 0A ASL A A:0005 X:0031 Y:0000 P:envMxdizC - x2 A.
$03/E7D6 AA TAX A:000A X:0031 Y:0000 P:envMxdizc - Transfer A to X.
$03/E7D7 A5 C9 LDA $C9    [$00:00C9] A:000A X:000A Y:0000 P:envMxdizc - Load A from C9 (Random Number +Attack Base)
$03/E7D9 9D D4 34 STA $34D4,x[$7E:34DE] A:0031 X:000A Y:0000 P:envMxdizc - Store A in Damage Slot X.
$03/E7DC A5 CA LDA $CA    [$00:00CA] A:0031 X:000A Y:0000 P:envMxdizc - Load A from CA (Second byte of damage, no doubt)
$03/E7DE 9D D5 34 STA $34D5,x[$7E:34DF] A:0000 X:000A Y:0000 P:envMxdiZc - Store A in in Damage Slot X Byte 2.
$03/E7E1 E6 C7 INC $C7    [$00:00C7] A:0000 X:000A Y:0000 P:envMxdiZc - +1 to C7.
$03/E7E3 A5 C7 LDA $C7    [$00:00C7] A:0000 X:000A Y:0000 P:envMxdizc Load C7 into A.
$03/E7E5 C5 C3 CMP $C3    [$00:00C3] A:0006 X:000A Y:0000 P:envMxdizc - Is it the same value that is in C3? (Number of Targets)
$03/E7E7 F0 03 BEQ $03    [$E7EC] A:0006 X:000A Y:0000 P:eNvMxdizc - if so branch to 03E7EC.
$03/E7E9 4C 5B E7 JMP $E75B  [$03:E75B] A:0006 X:000A Y:0000 P:eNvMxdizc  - Jump Back to 03E75B and recalculate everything for all targets.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7EC 20 7E CA JSR $CA7E  [$03:CA7E] A:000D X:000C Y:0000 P:envMxdiZC - Jump to Subroutine (Damage Dealing Routine)
------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E7EF 60 RTS A:0000 X:0680 Y:001A P:envMxdiZC - Return

Now this is extremely informative!

Keep the addresses below in mind because this appears to be near universal....


C5 - Where Attack Base is Stored
DF - Where Attack Multiplier is Stored
E1 - Enemies Physical Defense Base.

What is even more curious is that it seems that the programmers may have planned a way for Kick's damage not to be decremented under some special circumstance. A value stored at C1 that if it does not read 00 (which it seems it Must because of the STZ at the start of the routine) it will branch past the Decrementing Routine. I thought at first it may be something special for Enemy Yang, but C1 in his portion of the routine never changes. Turns out that it is used by Dark Wave, which likely jumps into the Kick routine fairly early on and keeps on going with it. We'll know more when we get to the Dark Wave routine. I never noticed that Dark Wave dealt more damage than Kick, that is quite curious...

Now, some more targeting news, what we're looking at here is something that we've never really seen before and its the way the game puts damage into the individual slots. Kick and Dark Wave are stupidly special in that the normal Caster/Target damage is never used. It uses a different targeting system....

Because it does not look into the section of RAM that Yousei labeled Caster/Target and only looks at their basic battle slots, I will call it "User". Dark Wave/Kick both look at the User's stats. In that same respect there is no Target as there ordinarily is considered to be, but the enemy's stats are looked at directly. Now this was puzzling, until I came across this...

$03/E746   A2 05 00   LDX #$0005   A:0000   X:0013   Y:0000   P:envMxdiZC - Load 0005 into X. (Starting points of Targets -1)
$03/E749   86 C7   STX $C7    [$00:00C7]   A:0000   X:0005   Y:0000   P:envMxdizC - Store X in C7.
$03/E74B   A2 0D 00   LDX #$000D   A:0000   X:0005   Y:0000   P:envMxdizC - Load 0000D into X (Number of Targets)
$03/E74E   86 C3   STX $C3    [$00:00C3]   A:0000   X:000D   Y:0000   P:envMxdizC - Store X in C3.

When I first saw these I had just the normal instructions for what the system was doing and moved on without another thought until I saw this as well...


$03/E7D5   0A    ASL A   A:0005   X:0031   Y:0000   P:envMxdizC - x2 A.
$03/E7D6   AA    TAX   A:000A   X:0031   Y:0000   P:envMxdizc - Transfer A to X.
$03/E7D7   A5 C9   LDA $C9    [$00:00C9]   A:000A   X:000A   Y:0000   P:envMxdizc - Load A from C9 (Random Number +Attack Base)
$03/E7D9   9D D4 34   STA $34D4,x[$7E:34DE]   A:0031   X:000A   Y:0000   P:envMxdizc - Store A in Damage Slot X.
$03/E7DC   A5 CA   LDA $CA    [$00:00CA]   A:0031   X:000A   Y:0000   P:envMxdizc - Load A from CA (Second byte of damage, no doubt)
$03/E7DE   9D D5 34   STA $34D5,x[$7E:34DF]   A:0000   X:000A   Y:0000   P:envMxdiZc - Store A in in Damage Slot X Byte 2.
$03/E7E1   E6 C7   INC $C7    [$00:00C7]   A:0000   X:000A   Y:0000   P:envMxdiZc - +1 to C7.
$03/E7E3   A5 C7   LDA $C7    [$00:00C7]   A:0000   X:000A   Y:0000   P:envMxdizc Load C7 into A.
$03/E7E5   C5 C3   CMP $C3    [$00:00C3]   A:0006   X:000A   Y:0000   P:envMxdizc - Is it the same value that is in C3? (Number of Targets)
$03/E7E7   F0 03   BEQ $03    [$E7EC]   A:0006   X:000A   Y:0000   P:eNvMxdizc - if so branch to 03E7EC.
$03/E7E9   4C 5B E7   JMP $E75B  [$03:E75B]   A:0006   X:000A   Y:0000   P:eNvMxdizc  - Jump Back to 03E75B and recalculate everything for all targets.

Then it made sense, what I was looking at earlier was "range of targets" 05+1 places it just outside the range of Allies. 0D is the final amount of times it should add data into the data slots and the x2 portion was assuring that it was giving two bytes to each slot in terms of damage. I verified this by setting the 05 to 00 and watching as Kick hurt everything on the field. Now this is a bit difficult to deal with. While you can make Kick/Dark Wave only hit one enemy, you could only make it hit a Specific Enemy Placement on the field, and that would be a difficult thing to make use of.

As of now we do not know how stats are written in and out of 2780-2800, but without that we can't change these two routines to look at anything on a Target by Target basis.


1163
Indeed, you can target enemies with it in a normal fashion as well.

As for some Commands though... I don't think they will have the ability to have their targeting changed, mainly the skills that invoke the normal attack routine. Jump, Focus, and Aim since they are modified normal attacks that are only given special circumstances through the same said normal attack routine. (In all fairness Aim is probably a little different) But we will see in time.

Next up is the Cover Routine -

Cover is a very special command for several reasons.

1. It is the first command (inwardly) that changes to something else depending on whether it has been used (In this case "Off")
2. It requires a specific character (and surprisingly it has a safeguard ?against cheaters? that makes it so Cover is disabled if the Dark Knight is present).
3. The behavior can be applied to all characters except the Coverer.
4. If another character uses Cover they can then set another target or themselves to be covered. In essence targeting the Coverer's Cover (perhaps a command for Rosa?)

So let's see what its routine reveals...

Code: [Select]
$03/E60F A5 CE LDA $CE    [$00:00CE] A:0003 X:0026 Y:0000 P:envMxdizc - Load CE from A (Slot of Character that will be Covered)
$03/E611 8D 7A 35 STA $357A  [$7E:357A] A:0001 X:0026 Y:0000 P:envMxdizc - Store A in 7E357A.  (Store A in Character Slot that Will be Covered)
$03/E614 20 89 84 JSR $8489  [$03:8489] A:0001 X:0026 Y:0000 P:envMxdizc - Jump to Subroutine (Preparation?)
$03/E617 A6 A6 LDX $A6    [$00:00A6] A:0000 X:0240 Y:0000 P:envMxdizc - Load the value in A6 into X.
$03/E619 BD 06 20 LDA $2006,x[$7E:2106] A:0000 X:0100 Y:0000 P:envMxdizc - Load A from the Target of Cover's Status Byte 4.
$03/E61C 09 02 ORA #$02 A:0000 X:0100 Y:0000 P:envMxdiZc - Add 02 to A if applicable.
$03/E61E 9D 06 20 STA $2006,x[$7E:2106] A:0002 X:0100 Y:0000 P:envMxdizc - Store "Covered" in Target of Cover's Status Byte 4.
$03/E621 A5 CD LDA $CD    [$00:00CD] A:0002 X:0100 Y:0000 P:envMxdizc - Load A from CD.
$03/E623 20 89 84 JSR $8489  [$03:8489] A:0000 X:0100 Y:0000 P:envMxdiZc - Jump to Subroutine. (Preparation?)
$03/E626 AE 34 35 LDX $3534  [$7E:3534] A:0000 X:0000 Y:0000 P:envMxdiZc - Load X from 7E3534.
-----------------------------------------------------------(Looping Point)-----------------------------------------------------------------------------
$03/E629 BD 03 33 LDA $3303,x[$7E:3303] A:0000 X:0000 Y:0000 P:envMxdiZc - Load A from User's Command Byte X.
$03/E62C C9 13 CMP #$13 A:0000 X:0000 Y:0000 P:envMxdiZc - Is it Cover?
$03/E62E F0 06 BEQ $06    [$E636] A:0000 X:0000 Y:0000 P:eNvMxdizc - Branch if equal to 03E636.
$03/E630 E8 INX A:0000 X:0000 Y:0000 P:eNvMxdizc - +1 to X
$03/E631 E8 INX A:0000 X:0001 Y:0000 P:envMxdizc +1 to X
$03/E632 E8 INX A:0000 X:0002 Y:0000 P:envMxdizc +1 to X
$03/E633 E8 INX A:0000 X:0003 Y:0000 P:envMxdizc +1 to X
$03/E634 80 F3 BRA $F3    [$E629] A:0000 X:0004 Y:0000 P:envMxdizc - Loop back to 03E629. - Continue looking for it.
$03/E636 A9 1D LDA #$1D A:0013 X:0004 Y:0000 P:envMxdiZC - Load 1D into A. - Load Off into A.
$03/E638 9D 03 33 STA $3303,x[$7E:3307] A:001D X:0004 Y:0000 P:envMxdizC - Store A in Command Byte.
$03/E63B 7B TDC A:001D X:0004 Y:0000 P:envMxdizC - Transfer Direct Page. - Transfer Direct Page.
$03/E63C 9D 02 33 STA $3302,x[$7E:3306] A:0000 X:0004 Y:0000 P:envMxdiZC  - Store 00 in the byte before Command.
$03/E63F A5 CD LDA $CD    [$00:00CD] A:0000 X:0004 Y:0000 P:envMxdiZC - Load A from CD. -
$03/E641 85 00 STA $00    [$00:0000] A:0000 X:0004 Y:0000 P:envMxdiZC - Store A in 00.
$03/E643 A9 09 LDA #$09 A:0000 X:0004 Y:0000 P:envMxdiZC - Load 09 into A.
$03/E645 20 85 80 JSR $8085  [$03:8085] A:0009 X:0004 Y:0000 P:envMxdizC - Jump to Subroutine. (A lot of jumping)
$03/E648 A9 13 LDA #$13 A:0005 X:7504 Y:000A P:envMxdiZC - Cover Message into A.
$03/E64A 8D C8 34 STA $34C8  [$7E:34C8] A:0013 X:7504 Y:000A P:envMxdizC - Store A in 7E34C8.
$03/E64D A9 10 LDA #$10 A:0013 X:7504 Y:000A P:envMxdizC - Load Mini-message into A.
$03/E64F 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:7504 Y:000A P:envMxdizC - Store A 7E34C7.
$03/E652 60 RTS A:0010 X:7504 Y:000A P:envMxdizC - Return
--------------------------------------------------------------------------------------------------------------------------------------------------

Well that was short and to the point. Apply Status to the Covered. Now there were a few other things in there as well, but I couldn't really make much sense of them.
Alot of its peculiarities would probably deal with the coding of status ailments and that's a completely unexplored region.



Off Routine -

Code: [Select]
$03/E653 A9 1D LDA #$1D A:0003 X:003A Y:0000 P:envMxdizc - Load 1D into A. - Load Off into Message.
$03/E655 8D C8 34 STA $34C8  [$7E:34C8] A:001D X:003A Y:0000 P:envMxdizc - Store A in 7E34C8.
$03/E658 A9 10 LDA #$10 A:001D X:003A Y:0000 P:envMxdizc - Load 10 into A. - Load Min-Message
$03/E65A 8D C7 34 STA $34C7  [$7E:34C7] A:0010 X:003A Y:0000 P:envMxdizc - Store A in 7E34C7. 
$03/E65D AD 7A 35 LDA $357A  [$7E:357A] A:0010 X:003A Y:0000 P:envMxdizc - Load A from 7E357A. (Character last covered)
$03/E660 20 89 84 JSR $8489  [$03:8489] A:0000 X:003A Y:0000 P:envMxdiZc  - Jump to Subroutine (Preparation?)
$03/E663 A6 A6 LDX $A6    [$00:00A6] A:0000 X:0000 Y:0000 P:envMxdiZc - Load Character Slot into X.
$03/E665 BD 06 20 LDA $2006,x[$7E:2006] A:0000 X:0000 Y:0000 P:envMxdiZc - Load A from Character that was Covered's Status Byte 4.
$03/E668 29 FD AND #$FD A:0002 X:0000 Y:0000 P:envMxdizc - Add -2 to it.
$03/E66A 9D 06 20 STA $2006,x[$7E:2006] A:0000 X:0000 Y:0000 P:envMxdiZc - Store A in the Character that was Covered's Status Byte 4.
$03/E66D A5 CD LDA $CD    [$00:00CD] A:0000 X:0000 Y:0000 P:envMxdiZc - Load CD into A.
$03/E66F 20 89 84 JSR $8489  [$03:8489] A:0000 X:0000 Y:0000 P:envMxdiZc - Jump to Subroutine (Preparation?)
$03/E672 AE 34 35 LDX $3534  [$7E:3534] A:0000 X:0000 Y:0000 P:envMxdiZc - Load X from 7E3534.
-------------------------------------------------------(Looping Point)----------------------------------------------------------------------
$03/E675 BD 03 33 LDA $3303,x[$7E:3303] A:0000 X:0000 Y:0000 P:envMxdiZc - Load from User's Command Byte.
$03/E678 C9 1D CMP #$1D A:0000 X:0000 Y:0000 P:envMxdiZc - Is it Off?
$03/E67A F0 06 BEQ $06    [$E682] A:0000 X:0000 Y:0000 P:eNvMxdizc - If so branch to 03E682.
$03/E67C E8 INX A:0000 X:0000 Y:0000 P:eNvMxdizc - +1 X
$03/E67D E8 INX A:0000 X:0001 Y:0000 P:envMxdizc +1 X
$03/E67E E8 INX A:0000 X:0002 Y:0000 P:envMxdizc +1 X
$03/E67F E8 INX A:0000 X:0003 Y:0000 P:envMxdizc +1 X
$03/E680 80 F3 BRA $F3    [$E675] A:0000 X:0004 Y:0000 P:envMxdizc - Loop back to 03E675. - Look for it until you find it.
$03/E682 A9 13 LDA #$13 A:001D X:0004 Y:0000 P:envMxdiZC - Load Cover into A.
$03/E684 9D 03 33 STA $3303,x[$7E:3307] A:0013 X:0004 Y:0000 P:envMxdizC - Store A in User's Command Byte.
$03/E687 A9 18 LDA #$18 A:0013 X:0004 Y:0000 P:envMxdizC - Load 18 into A -
$03/E689 9D 02 33 STA $3302,x[$7E:3306] A:0018 X:0004 Y:0000 P:envMxdizC - Store A in byte before Command Byte.
$03/E68C A5 CD LDA $CD    [$00:00CD] A:0018 X:0004 Y:0000 P:envMxdizC - Load A from CD.
$03/E68E 85 00 STA $00    [$00:0000] A:0000 X:0004 Y:0000 P:envMxdiZC - Store A in 00.
$03/E690 A9 09 LDA #$09 A:0000 X:0004 Y:0000 P:envMxdiZC - Load 09 into A.
$03/E692 20 85 80 JSR $8085  [$03:8085] A:0009 X:0004 Y:0000 P:envMxdizC (Lots of jumping)
$03/E695 60 RTS A:0005 X:7504 Y:000A P:envMxdiZC - Return

It is almost a carbon copy of what is above surprisingly enough. Except with a -2 rather than a +2.

Well that seems quite simple to figure out. But it seems because of the way it is made it can't be multi-targetted as it has no support in doing so.


:edit: 1/10/14 - Fixed up a bit of the above, adding information that I am more aware of now.



1164
Final Fantasy IV Research & Development / Re: Steal/Sneak Command
« on: October 06, 2013, 11:32:42 AM »
Thanks for the confirmation PinkPuff, yes I want the hacks i make to stay within the compatibility of the editor whenever possible.

1165
That is a very good question. I think what the targeting may actually do is tell the game where to choose the targeting base. If it targets enemies all eight slot will be occupied by monsters, if it starts at ?Slot 5? It will tell the game to start the effects from there.

I need to find that in a few more routines to make absolutely sure that is what it is doing. I am almost certain though since both of the routines we located it in bypass multi-targeted death checks it may be some kind of "Target All No Matter What" sort of dealing, it is fairly difficult to say at the current time.

1166
OK, here are my findings.
The summary is that it's really only worth the while to modify targeting of Sing and Recall, but here's the rest:

Code: [Select]
00 Fight - NO
05 Dark Wave - NO
06 Jump - NO
07 Recall - YES
08 Sing - YES
09 Hide - NO
0A Medicine - NO
0B Pray - YES (sorta... you can make it target only the caster instead of the whole party, because it NEVER has a cursor)
0C Aim - NO
0D Store - NO
0E Kick - NO, (but the visual change is complete - only the targeted enemy will flash, but all take damage)
0F Gird - can't tell, but only the caster gets the "armor" animation
11 Strengthen - Honestly, I have no idea what this does. I thought it was supposed to raise the caster's WIS score, but saw no such thing happen when using SNES 9X Debugger, so I don't know...
12 Cry - irrelevant
13 Cover - NO
14 Peep - NO
16 Dart - NO
17 Sneak - NO
19 Spirit Wave - NO

I did not test magic commands, because they open sub-menus, with sub-commands that have their own targeting details. I DID test Dart, because those items do not have their own targeting details, but apparently it is not even possible to affect the targeting options of Dart (even when you change the byte to target multiple, the cursor will still only allow single targeting)

Hmm, I'm not sure how you tested these Chillyfeez, as I've come across some counter-findings...

Fight - No
Dark Wave - No
Jump - No
Recall - Yes
Sing - Yes
Hide - No
Salve - Yes
Pray - Yes (It can target either allies or enemies without worry)
Aim - No
Focus - No
Kick - No
Gird - Yes (As above with Pray)
Twin - Yes
Boast - No
Cry - Yes
Cover - No
Peep - No
Crash - Yes
Dart - No
Sneak - No
Regen - No

So you were only slightly off. But I thought it would be best to double check just in case. Being able to retarget Salve, Gird, and Pray may have its uses down the line.




1167
Hmm, I've just done a bit of testing Chillyfeez and it seems that you may not have tested Salve as thoroughly as possible. I can change its targeting without any issue. 80- Auto Target All Allies , 60 - Target All Enemies, 50 - Target one Enemy. 10 - Target one Ally, 20 - Target all Allies. F0 Target split Enemies/Allies.

 I wonder if we can turn the Salve Command into a "Split Any Item" effect by checking it, broadly speaking, against the first item and seeing if it falls within the B0 to DD. As the routine itself only seems to load the item routine to load from another area (Magic Call) and giving it Ally/Enemy targeting (F0) allowing the player that much more versaility in using it?


1168
Final Fantasy IV Research & Development / Re: Steal/Sneak Command
« on: October 03, 2013, 11:25:03 PM »
Hmm, yes that is a real danger. I'd rather not make any of the hacks I make be incompatible with the best FFIV Editor there is. I'll probably just have to use blank space already in the ROM itself, where ever that may be. It's a minor issue though. The real issue is to find how slots are recorded.

1169
I did try a few of these, but I'll check out the others and see what happens...

FF will only target your party and three of the enemy. (Splitting it eight ways, hilariously enough)
78 works just as you predicted. It hits all except Character 5 (Slot 1)

26D4? When I was just browsing through the Dark Wave routine, I may have seen it, let me check...

No, apparently I did not.

...Just did a search for it!

You were the one who found a reference, ironically enough...

"
$03/E050 A9 F8       LDA #$F8                A:0000 X:0000 Y:0000
$03/E052 8D D4 26    STA $26D4  [$7E:26D4]   A:0000 X:0000 Y:0000 ;(Don't know what's going on here, seems irrelevant)
"

Load Target All, Store A in Targeting Area. Why can the Life Item when split through Salve go through the normal check? Likely the same reason Asura can go through the normal check. A specific targetting that goes beyond the normal "Is Target Dead? Check."

To my knowledge it is always used as targeting. The reason we have a very compressed version to use in casual editing is because they shoved targeting into only a half-byte.

1170
Final Fantasy IV Research & Development / Re: Cry/Fake Tears Command
« on: October 03, 2013, 09:54:45 PM »
Hmm, I just tested this with a lvl. 100 Zombie against a Level 10 party... There were a lot of Back Attacks which prevented us from running until they got a full turn in, but running away from them after that only took 2 or 3 seconds, maybe a little longer than ordinary. I really couldn't tell. Everyone knows that level is also concerned in back attacks and  pre-emptive strikes, I wonder if it has anything to do with that?

But Cry does work against bosses. All it would seem to do though is increase your chances of stealing a Cure1 from them.