øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.msg19171e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe1bd.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe1bd.html.zx÷g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ'ÃgOKtext/htmlISO-8859-1gzip(¾ÖÃgÿÿÿÿÿÿÿÿTue, 10 Mar 2020 04:59:57 GMT0ó°° ®0®P®€§²ð®õg^ÿÿÿÿÿÿÿÿFKÃg 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 78645 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #15 on: September 11, 2013, 12:26:38 PM »
I must have missed her, but yes you are absolutely right. She is killed by Life spells and to my knowledge she is the only one to have that happen due to not having any resistance to Death.

My Life Subroutine is finished and other than the true  (which I complained about trying to find in the Life topic) and Zombie killing it is what you would expect. (I still say that data to look and restore the status of any other bytes aside from the first two is a bit misdirected though)

Grimoire LD

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

Code: [Select]
$03/E43E A2 01 00 LDX #$0001 A:0003 X:0020 Y:0000 P:envMxdizc - Load 01 into X.
$03/E441 A5 CD LDA $CD    [$00:00CD] A:0003 X:0001 Y:0000 P:envMxdizc - Load A from CD.
$03/E443 CD 39 35 CMP $3539  [$7E:3539] A:0001 X:0001 Y:0000 P:envMxdizc - Compare A with the Slots of the Character's Casting Twin.
$03/E446 F0 01 BEQ $01    [$E449] A:0001 X:0001 Y:0000 P:envMxdiZC - If it is equal branch to 03E449
--------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------
$03/E449 BD 39 35 LDA $3539,x[$7E:353A] A:0001 X:0001 Y:0000 P:envMxdiZC - Load the Second Slot of Character Casting Twin
$03/E44C 20 89 84 JSR $8489  [$03:8489] A:0003 X:0001 Y:0000 P:envMxdizC - Jump to Cleaning Routine (May Actually be how the game gets the X amounts for stat allocations to various slots!)
$03/E44F A6 A6 LDX $A6    [$00:00A6] A:0000 X:0360 Y:0000 P:envMxdizc - Load X from A6.
$03/E451 BD 03 20 LDA $2003,x[$7E:2183] A:0000 X:0180 Y:0000 P:envMxdizc - Load A from Other Twin's Status Byte 1.
$03/E454 29 C0 AND #$C0 A:0000 X:0180 Y:0000 P:envMxdiZc - Is it Dead or Petrified?
$03/E456 F0 03 BEQ $03    [$E45B] A:0000 X:0180 Y:0000 P:envMxdiZc - If not branch to 03E45B.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E458 4C D6 E4 JMP $E4D6  [$03:E4D6] A:0080 X:0180 Y:0000 P:eNvMxdizc - Jump to 03E4D6.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E45B BD 04 20 LDA $2004,x[$7E:2184] A:0000 X:0180 Y:0000 P:envMxdiZc - Load Other Twin's Status Byte 2.
$03/E45E 29 3C AND #$3C A:0000 X:0180 Y:0000 P:envMxdiZc - Is it Berserk, Charm, Sleep or Paralyzed?
$03/E460 F0 03 BEQ $03    [$E465] A:0000 X:0180 Y:0000 P:envMxdiZc - If not branch to 03E465.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E462 4C D6 E4 JMP $E4D6  [$03:E4D6] A:0030 X:0180 Y:0000 P:envMxdizc (This seems like a waste of space. Why not just use a negative value to loop back to 03E458 so you can save some space?)
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E465 BD 05 20 LDA $2005,x[$7E:2185] A:0000 X:0180 Y:0000 P:envMxdiZc - Load Other Twin's Status Byte 3.
$03/E468 29 40 AND #$40 A:0000 X:0180 Y:0000 P:envMxdiZc - Is it Stopped?
$03/E46A F0 03 BEQ $03    [$E46F] A:0000 X:0180 Y:0000 P:envMxdiZc - If not branch to 03E46F
-----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E46C 4C D6 E4 JMP $E4D6  [$03:E4D6] A:0040 X:0180 Y:0000 P:envMxdizc - Jump to 03E4D6.
------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E46F BD 05 20 LDA $2005,x[$7E:2005] A:0000 X:0000 Y:0000 P:envMxdiZc - Load Character's Status Byte 3.
$03/E472 09 04 ORA #$04 A:0000 X:0000 Y:0000 P:envMxdiZc - Add 04 to A (Twincasting)
$03/E474 9D 05 20 STA $2005,x[$7E:2005] A:0004 X:0000 Y:0000 P:envMxdizc - Store A in Character's Status Byte 3.
$03/E477 AD D0 26 LDA $26D0  [$7E:26D0] A:0004 X:0000 Y:0000 P:envMxdizc - Load Caster's (unknown) into A
$03/E47A 9D 50 20 STA $2050,x[$7E:2050] A:0080 X:0000 Y:0000 P:eNvMxdizc - Store it in actual Character's data.
$03/E47D AD D3 26 LDA $26D3  [$7E:26D3] A:0080 X:0000 Y:0000 P:eNvMxdizc - Load Caster's Next Monster Target into A
$03/E480 9D 53 20 STA $2053,x[$7E:2053] A:00F0 X:0000 Y:0000 P:eNvMxdizc  - Store it in actual Character's data.
$03/E483 A9 20 LDA #$20 A:00F0 X:0000 Y:0000 P:eNvMxdizc- Load 20 into A.
$03/E485 9D 51 20 STA $2051,x[$7E:2051] A:0020 X:0000 Y:0000 P:envMxdizc - Store A into Character's next command.
$03/E488 AE 30 35 LDX $3530  [$7E:3530] A:0020 X:0000 Y:0000 P:envMxdizc - Load X from 7E3530.
$03/E48B 86 92 STX $92    [$00:0092] A:0020 X:0000 Y:0000 P:envMxdiZc - Store X in 92.
$03/E48D A9 20 LDA #$20 A:0020 X:0000 Y:0000 P:envMxdiZc - Load 20 into A.
$03/E48F 8D 7B 39 STA $397B  [$7E:397B] A:0020 X:0000 Y:0000 P:envMxdizc - Store A in 397B (Possibly Command location?)
$03/E492 A9 0C LDA #$0C A:0020 X:0000 Y:0000 P:envMxdizc - Load A into 0C.
$03/E494 85 D6 STA $D6    [$00:00D6] A:000C X:0000 Y:0000 P:envMxdizc - Store A in D6.
$03/E496 A5 CD LDA $CD    [$00:00CD] A:000C X:0000 Y:0000 P:envMxdizc - Load A into CD.
$03/E498 20 36 9E JSR $9E36  [$03:9E36] A:0000 X:0000 Y:0000 P:envMxdiZc - Jump to a Speed Routine.
$03/E49B A9 03 LDA #$03 A:0000 X:0002 Y:0002 P:envMxdizc - Load 03 into A.
$03/E49D 20 C8 85 JSR $85C8  [$03:85C8] A:0003 X:0002 Y:0002 P:envMxdizc - Jump to a Cleaning Routine.
$03/E4A0 A9 08 LDA #$08 A:0000 X:0003 Y:0002 P:envMxdiZc - Load 08 into A.
$03/E4A2 9D 06 2A STA $2A06,x[$7E:2A09] A:0008 X:0003 Y:0002 P:envMxdizc - Store A in 7E2A09.
$03/E4A5 18 CLC A:0008 X:0003 Y:0002 P:envMxdizc - Clear Carry Flag.
$03/E4A6 A5 92 LDA $92    [$00:0092] A:0008 X:0003 Y:0002 P:envMxdizc - Load x92 into A.
$03/E4A8 69 03 ADC #$03 A:0000 X:0003 Y:0002 P:envMxdiZc - Add 03 to A.
$03/E4AA 85 92 STA $92    [$00:0092] A:0003 X:0003 Y:0002 P:envMxdizc - Store A in 92.
$03/E4AC A5 93 LDA $93    [$00:0093] A:0003 X:0003 Y:0002 P:envMxdizc - Load x93 into A.
$03/E4AE 69 00 ADC #$00 A:0000 X:0003 Y:0002 P:envMxdiZc - Add 0 to A.
$03/E4B0 85 93 STA $93    [$00:0093] A:0000 X:0003 Y:0002 P:envMxdiZc - Store A in 93.
$03/E4B2 A6 92 LDX $92    [$00:0092] A:0000 X:0003 Y:0002 P:envMxdiZc - Load x92 into X.
$03/E4B4 A5 D4 LDA $D4    [$00:00D4] A:0000 X:0003 Y:0002 P:envMxdizc - Load xD4 into A.
$03/E4B6 9D 04 2A STA $2A04,x[$7E:2A07] A:0002 X:0003 Y:0002 P:envMxdizc - Store A in 7E2A07.
$03/E4B9 A5 D5 LDA $D5    [$00:00D5] A:0002 X:0003 Y:0002 P:envMxdizc - Load xD5 into A.
$03/E4BB 9D 05 2A STA $2A05,x[$7E:2A08] A:0000 X:0003 Y:0002 P:envMxdiZc - Store A in 7E2A08.
$03/E4BE A9 08 LDA #$08 A:0000 X:0003 Y:0002 P:envMxdiZc - Load 08 into A.
$03/E4C0 9D 06 2A STA $2A06,x[$7E:2A09] A:0008 X:0003 Y:0002 P:envMxdizc - Store A in 7E2A06.
$03/E4C3 A6 A6 LDX $A6    [$00:00A6] A:0008 X:0003 Y:0002 P:envMxdizc - Load xA6 into X.
$03/E4C5 BD 05 20 LDA $2005,x[$7E:2005] A:0008 X:0000 Y:0002 P:envMxdiZc - Load A from Character's Status Byte 3.
$03/E4C8 09 04 ORA #$04 A:0004 X:0000 Y:0002 P:envMxdizc - Add 4 (if not already 4 - Twincasting)
$03/E4CA 9D 05 20 STA $2005,x[$7E:2005] A:0004 X:0000 Y:0002 P:envMxdizc - Store A in Character's Status Byte 3.
$03/E4CD A9 20 LDA #$20 A:0004 X:0000 Y:0002 P:envMxdizc - Load 20 into A.
$03/E4CF 9D 51 20 STA $2051,x[$7E:2051] A:0020 X:0000 Y:0002 P:envMxdizc - Store A in Character's next action.
$03/E4D2 EE 0A 39 INC $390A  [$7E:390A] A:0020 X:0000 Y:0002 P:envMxdizc - Increment 7E390A by 1.
$03/E4D5 60 RTS A:0020 X:0000 Y:0002 P:envMxdizc - Return
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$03/E4D6 A9 FF LDA #$FF A:0080 X:0180 Y:0000 P:eNvMxdizc - Load FF into A.
$03/E4D8 8D 7B 35 STA $357B  [$7E:357B] A:00FF X:0180 Y:0000 P:eNvMxdizc - Store A in 7E357B.
$03/E4DB A9 11 LDA #$11 A:00FF X:0180 Y:0000 P:eNvMxdizc - Load 11 into A. (Failed.)
$03/E4DD 8D CA 34 STA $34CA  [$7E:34CA] A:0011 X:0180 Y:0000 P:envMxdizc - Store A in 7E34CA  (Battle Message)
$03/E4E0 4C A6 85 JMP $85A6  [$03:85A6] A:0011 X:0180 Y:0000 P:envMxdizc - Jump to 0385A6.
------------------------------------------------------------------------------------------------------------------------------
Second Portion of Routine - Not directly accessed from the start of the routine, oddly enough.

$03/E4E3 A9 FF LDA #$FF A:0003 X:0040 Y:0000 P:envMxdizc - Load FF into A,
$03/E4E5 8D 7B 35 STA $357B  [$7E:357B] A:00FF X:0040 Y:0000 P:eNvMxdizc - Store A in 7E357B.
$03/E4E8 A6 A6 LDX $A6    [$00:00A6] A:00FF X:0040 Y:0000 P:eNvMxdizc - Load xA6 into X.
$03/E4EA 86 8C STX $8C    [$00:008C] A:00FF X:0080 Y:0000 P:envMxdizc - Store X in 8C.
$03/E4EC BD 05 20 LDA $2005,x[$7E:2085] A:00FF X:0080 Y:0000 P:envMxdizc - Load Status Byte 3 of Character 2.
$03/E4EF 29 FB AND #$FB A:0004 X:0080 Y:0000 P:envMxdizc - -4 to A.
$03/E4F1 9D 05 20 STA $2005,x[$7E:2085] A:0000 X:0080 Y:0000 P:envMxdiZc - Store A in Status Byte 3. (Clearing data essentially)
$03/E4F4 AD 85 26 LDA $2685  [$7E:2685] A:0000 X:0080 Y:0000 P:envMxdiZc - Load Status Byte 3 of Caster into A.
$03/E4F7 29 FB AND #$FB A:0004 X:0080 Y:0000 P:envMxdizc - -4 to A.
$03/E4F9 8D 85 26 STA $2685  [$7E:2685] A:0000 X:0080 Y:0000 P:envMxdiZc - Store A in 7E2685.
$03/E4FC A2 01 00 LDX #$0001 A:0000 X:0080 Y:0000 P:envMxdiZc - Load 01 into X.
$03/E4FF A5 CD LDA $CD    [$00:00CD] A:0000 X:0001 Y:0000 P:envMxdizc Load xCD into A.
$03/E501 CD 39 35 CMP $3539  [$7E:3539] A:0001 X:0001 Y:0000 P:envMxdizc - Compare two values.
$03/E504 F0 01 BEQ $01    [$E507] A:0001 X:0001 Y:0000 P:envMxdiZC - If equal branch to 03E507.
---------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------
$03/E507 64 D6 STZ $D6    [$00:00D6] A:0001 X:0001 Y:0000 P:envMxdiZC - Store Zero in D6.
$03/E509 BD 39 35 LDA $3539,x[$7E:353A] A:0001 X:0001 Y:0000 P:envMxdiZC - Load A from 7E3539.
$03/E50C 20 36 9E JSR $9E36  [$03:9E36] A:0000 X:0001 Y:0000 P:envMxdiZC - Jump to Subroutine.
$03/E50F A6 A6 LDX $A6    [$00:00A6] A:0000 X:0005 Y:0005 P:envMxdizc - Load xA6 into X.
$03/E511 BD 05 20 LDA $2005,x[$7E:2005] A:0000 X:0000 Y:0005 P:envMxdiZc - Load Status Byte 3  of Character 1 into A.
$03/E514 29 FB AND #$FB A:0004 X:0000 Y:0005 P:envMxdizc - -4 to A (No idea why this is repeating again)
$03/E516 9D 05 20 STA $2005,x[$7E:2005] A:0000 X:0000 Y:0005 P:envMxdiZc - Store Status Byte 3 of Character 1 from A.
$03/E519 BD 03 20 LDA $2003,x[$7E:2003] A:0000 X:0000 Y:0005 P:envMxdiZc - Load Status Byte 1 of Character 1.
$03/E51C 29 C0 AND #$C0 A:0000 X:0000 Y:0005 P:envMxdiZc Is it ?Dead/Stone? (80+40=C0)
$03/E51E D0 07 BNE $07    [$E527] A:0000 X:0000 Y:0005 P:envMxdiZc - If not, break to 03D527.
-----------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E520 BD 04 20 LDA $2004,x[$7E:2004] A:0000 X:0000 Y:0005 P:envMxdiZc - Load Status Byte 2 of Character 1 into A.
$03/E523 29 3C AND #$3C A:0000 X:0000 Y:0005 P:envMxdiZc - Is it Berserk/Charm/Sleep/Paralyze?
$03/E525 F0 24 BEQ $24    [$E54B] A:0000 X:0000 Y:0005 P:envMxdiZc - If not go to 03E54B.
------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E54B A9 03 LDA #$03 A:0000 X:0000 Y:0005 P:envMxdiZc - Load 03 into A.
$03/E54D 20 C8 85 JSR $85C8  [$03:85C8] A:0003 X:0000 Y:0005 P:envMxdizc - Jump to Subroutine.
$03/E550 9E 06 2A STZ $2A06,x[$7E:2A09] A:0000 X:0003 Y:0005 P:envMxdiZc - Store Zero in 7E2A09.
$03/E553 A6 A6 LDX $A6    [$00:00A6] A:0000 X:0003 Y:0005 P:envMxdiZc - Load xA6 into X.
$03/E555 86 92 STX $92    [$00:0092] A:0000 X:0000 Y:0005 P:envMxdiZc - Store X in 92.
$03/E557 BD 05 20 LDA $2005,x[$7E:2005] A:0000 X:0000 Y:0005 P:envMxdiZc - Load Status Byte 3 of Character 1
$03/E55A 29 40 AND #$40 A:0000 X:0000 Y:0005 P:envMxdiZc - Is it Stop?
$03/E55C D0 C9 BNE $C9    [$E527] A:0000 X:0000 Y:0005 P:envMxdiZc - If so branch to 03E527.
$03/E55E A6 8C LDX $8C    [$00:008C] A:0000 X:0000 Y:0005 P:envMxdiZc - Load x8C into X.
$03/E560 BD 03 20 LDA $2003,x[$7E:2083] A:0000 X:0080 Y:0005 P:envMxdizc - Load Status Byte 1 of Character 2.
$03/E563 29 C0 AND #$C0 A:0000 X:0080 Y:0005 P:envMxdiZc - Is it Dead/Stone
$03/E565 D0 C0 BNE $C0    [$E527] A:0000 X:0080 Y:0005 P:envMxdiZc - ?/ (No idea how this is branching without saying so)
$03/E567 BD 04 20 LDA $2004,x[$7E:2084] A:0000 X:0080 Y:0005 P:envMxdiZc - Load Status Byte 2 of Character 2
$03/E56A 29 3C AND #$3C A:0000 X:0080 Y:0005 P:envMxdiZc - Is it Berserk/Charm/Sleep/Paralyze?
$03/E56C D0 B9 BNE $B9    [$E527] A:0000 X:0080 Y:0005 P:envMxdiZc - ??
$03/E56E BD 00 20 LDA $2000,x[$7E:2080] A:0000 X:0080 Y:0005 P:envMxdiZc - Load Character 1's Character ID into A.
$03/E571 29 1F AND #$1F A:0089 X:0080 Y:0005 P:eNvMxdizc - -80? to A?
$03/E573 C9 13 CMP #$13 A:0009 X:0080 Y:0005 P:envMxdizc - (Palom and Porom are 08 and 09, not 13 and 15, I have no ide... FuSoYa and Golbez.) Is it FuSoYa?
$03/E575 F0 04 BEQ $04    [$E57B] A:0009 X:0080 Y:0005 P:eNvMxdizc - If so branch to 03E57B.
$03/E577 C9 15 CMP #$15 A:0009 X:0080 Y:0005 P:eNvMxdizc - Is it Golbez?
$03/E579 D0 04 BNE $04    [$E57F] A:0009 X:0080 Y:0005 P:eNvMxdizc - If not branch to 03E57F.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57B A9 5E LDA #$5E A:0015 X:0080 Y:0005 P:envMxdiZC - Load W. Meteo
$03/E57D 80 19 BRA $19    [$E598] A:005E X:0080 Y:0005 P:envMxdizC - Branch Always to 03E598.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57F 20 93 85 JSR $8593  [$03:8593] A:0009 X:0080 Y:0005 P:eNvMxdizc - Jump to Subroutine (where random number seems to be generated)
$03/E582 C9 FF CMP #$FF A:008F X:0011 Y:0005 P:eNvMxdizC - Was it FF (or higher)?
$03/E584 90 08 BCC $08    [$E58E] A:008F X:0011 Y:0005 P:eNvMxdizc - If not, branch to 03E58E.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E586 A9 11 LDA #$11 A:00FF X:0033 Y:0007 P:envMxdiZC- Load x11 into A. (Failed Message)
$03/E588 8D CA 34 STA $34CA  [$7E:34CA] A:0011 X:001B Y:0005 P:envMxdizC - Store A in 7E34CA (Battle Message Area)
$03/E58B 4C A6 85 JMP $85A6  [$03:85A6] A:0011 X:001B Y:0005 P:envMxdizC - Jump to Subroutine which leads out of the Routine all together.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E58E C9 40 CMP #$40 A:008F X:0011 Y:0005 P:eNvMxdizc - Is it less than 40?
$03/E590 90 04 BCC $04    [$E596] A:008F X:0011 Y:0005 P:envMxdizC - If so, branch to 03E596.
$03/E592 A9 41 LDA #$41 A:008F X:0011 Y:0005 P:envMxdizC - Load Flare into A.
$03/E594 80 02 BRA $02    [$E598] A:0041 X:0011 Y:0005 P:envMxdizC - Branch Always to 03E598.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E596 A9 40 LDA #$40 A:0024 X:0064 Y:0007 P:eNvMxdizc - Load Comet
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E598 85 94 STA $94    [$00:0094] A:0041 X:0011 Y:0005 P:envMxdizC - Store A in 94.
$03/E59A AA TAX A:0041 X:0011 Y:0005 P:envMxdizC - Transfer A to X.
$03/E59B 86 E5 STX $E5    [$00:00E5] A:0041 X:0041 Y:0005 P:envMxdizC - Store X in E5
$03/E59D A2 A0 97 LDX #$97A0 A:0041 X:0041 Y:0005 P:envMxdizC - Load 97A0 into X.
$03/E5A0 86 80 STX $80    [$00:0080] A:0041 X:97A0 Y:0005 P:eNvMxdizC - Store X into 80.
$03/E5A2 A9 0F LDA #$0F A:0041 X:97A0 Y:0005 P:eNvMxdizC - Load 0F into A.
$03/E5A4 85 82 STA $82    [$00:0082] A:000F X:97A0 Y:0005 P:envMxdizC - Store A into 82.
$03/E5A6 A9 06 LDA #$06 A:000F X:97A0 Y:0005 P:envMxdizC - Load 06 into A.
$03/E5A8 20 5E 84 JSR $845E  [$03:845E] A:0006 X:97A0 Y:0005 P:envMxdizC -  Jump to Subroutine (Cleaning)
$03/E5AB AD A0 28 LDA $28A0  [$7E:28A0] A:000A X:0006 Y:018C P:envMxdiZC - Load 7E28A0 into A.
$03/E5AE 29 7F AND #$7F A:0000 X:0006 Y:018C P:envMxdiZC - ??
$03/E5B0 85 DF STA $DF    [$00:00DF] A:0000 X:0006 Y:018C P:envMxdiZC - Store A in DF.
$03/E5B2 A9 03 LDA #$03 A:0000 X:0006 Y:018C P:envMxdiZC - Load 03 into A,
$03/E5B4 85 E1 STA $E1    [$00:00E1] A:0003 X:0006 Y:018C P:envMxdizC - Store A in E1.
$03/E5B6 20 E0 83 JSR $83E0  [$03:83E0] A:0003 X:0006 Y:018C P:envMxdizC - Jump to Subroutine (Cleaning)
$03/E5B9 A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:018C P:envMxdiZc - Load xE3 into X.
$03/E5BB 7B TDC A:0000 X:0000 Y:018C P:envMxdiZc - Transfer Direct Page.
$03/E5BC A8 TAY A:0000 X:0000 Y:018C P:envMxdiZc - Transfer A to Y.
$03/E5BD BF 90 A5 0F LDA $0FA590,x[$0F:A590] A:0000 X:0000 Y:0000 P:envMxdiZc - Load A from 0FA590.
$03/E5C1 99 A2 28 STA $28A2,y[$7E:28A2] A:0000 X:0000 Y:0000 P:envMxdiZc - Store A in 7E 28A2.
$03/E5C4 C8 INY A:0000 X:0000 Y:0000 P:envMxdiZc - Add 1 to Y
$03/E5C5 E8 INX A:0000 X:0000 Y:0001 P:envMxdizc - Add 1 to X
$03/E5C6 C0 03 00 CPY #$0003 A:0000 X:0001 Y:0001 P:envMxdizc - Copy Y to 03?
$03/E5C9 D0 F2 BNE $F2    [$E5BD] A:0000 X:0001 Y:0001 P:eNvMxdizc - Loop.
$03/E5BD BF 90 A5 0F LDA $0FA590,x[$0F:A591] A:0000 X:0001 Y:0001 P:eNvMxdizc - Load A from 0FA590.
$03/E5C1 99 A2 28 STA $28A2,y[$7E:28A3] A:0000 X:0001 Y:0001 P:envMxdiZc - Store A in 7E28A3.
$03/E5C4 C8 INY A:0000 X:0001 Y:0001 P:envMxdiZc - Add 1 to Y
$03/E5C5 E8 INX A:0000 X:0001 Y:0002 P:envMxdizc - Add 1 to X
$03/E5CB AD 8B 26 LDA $268B  [$7E:268B] A:0000 X:0003 Y:0003 P:envMxdiZC - Load Caster's MP
$03/E5CE 85 A9 STA $A9    [$00:00A9] A:0032 X:0003 Y:0003 P:envMxdizC - Store it in A9.
$03/E5D0 AD 8C 26 LDA $268C  [$7E:268C] A:0032 X:0003 Y:0003 P:envMxdizC - Load Caster's MP Byte 2.
$03/E5D3 F0 04 BEQ $04    [$E5D9] A:0000 X:0003 Y:0003 P:envMxdiZC - ?? (Possibly if not enough MP to cast spell?)
$03/E5D9 AD A1 28 LDA $28A1  [$7E:28A1] A:0000 X:0003 Y:0003 P:envMxdiZC - Load A from Spell's MP Cost?
$03/E5DC 29 7F AND #$7F A:000A X:0003 Y:0003 P:envMxdizC - ??
$03/E5DE 85 AB STA $AB    [$00:00AB] A:000A X:0003 Y:0003 P:envMxdizC - Store A in AB
$03/E5E0 C5 A9 CMP $A9    [$00:00A9] A:000A X:0003 Y:0003 P:envMxdizC - ?Is it more than in A9 (MP)?
$03/E5E2 F0 02 BEQ $02    [$E5E6] A:000A X:0003 Y:0003 P:eNvMxdizc  - If so, branch to 03E5E6
$03/E5E4 B0 28 BCS $28    [$E60E] A:000A X:0003 Y:0003 P:eNvMxdizc - If carry is set branch to 03E60E
$03/E5E6 A6 92 LDX $92    [$00:0092] A:000A X:0003 Y:0003 P:eNvMxdizc - Load x92 into X.
$03/E5E8 38 SEC A:000A X:0000 Y:0003 P:envMxdiZc - Set Carry Flag.
$03/E5E9 BD 0B 20 LDA $200B,x[$7E:200B] A:000A X:0000 Y:0003 P:envMxdiZC - Load Character 1's MP.
$03/E5EC E5 AB SBC $AB    [$00:00AB] A:00E7 X:0000 Y:0003 P:eNvMxdizC - Subtract it from AB.
$03/E5EE 85 A9 STA $A9    [$00:00A9] A:00DD X:0000 Y:0003 P:eNvMxdizC - Store new value in A9.
$03/E5F0 BD 0C 20 LDA $200C,x[$7E:200C] A:00DD X:0000 Y:0003 P:eNvMxdizC - Load Character 1's MP Byte 2.
$03/E5F3 E9 00 SBC #$00 A:0003 X:0000 Y:0003 P:envMxdizC - Subtract 00?
$03/E5F5 85 AA STA $AA    [$00:00AA] A:0003 X:0000 Y:0003 P:envMxdizC - Store A in AA.
$03/E5F7 90 15 BCC $15    [$E60E] A:0003 X:0000 Y:0003 P:envMxdizC - Branch if Carry Flag is Set to 03E60E.
$03/E5F9 A5 A9 LDA $A9    [$00:00A9] A:0003 X:0000 Y:0003 P:envMxdizC - Load A from MP Storing Area.
$03/E5FB 9D 0B 20 STA $200B,x[$7E:200B] A:00DD X:0000 Y:0003 P:eNvMxdizC - Store MP in Character 1's MP.
$03/E5FE A5 AA LDA $AA    [$00:00AA] A:00DD X:0000 Y:0003 P:eNvMxdizC - Load A from MP Storing Area 2.
$03/E600 9D 0C 20 STA $200C,x[$7E:200C] A:0003 X:0000 Y:0003 P:envMxdizC - Store MP in Character's MP Byte 2.
$03/E603 A5 94 LDA $94    [$00:0094] A:0003 X:0000 Y:0003 P:envMxdizC - Load x94 into A (Flare?)
$03/E605 8D D2 26 STA $26D2  [$7E:26D2] A:0041 X:0000 Y:0003 P:envMxdizC - Store A in Caster's Next Action.
$03/E608 EE 5D 35 INC $355D  [$7E:355D] A:0041 X:0000 Y:0003 P:envMxdizC - +1 to value in 7E355D.
$03/E60E 60 RTS A:00F0 X:0680 Y:001A P:eNvMxdizC - Return


I'm beginning to grow leery of this command structure, it looks as if these may not actually contain much of the relevant data, but none of the subroutines in this formula were unique, they were simple cleaning routines. The only thing of note here is the Twincasting status part for both participants.


 :edit: Now that's more like it! The rest of the code was sitting close-by, I guess Return commands doesn't always mean that the routine is finished.

What a trip this was! Now this was valuable information (for me) not only can I make an easy to use third Twin Spell, but I can also make a special Equipment requirement for W. Meteo (ala FFIVA) now that I know how the game puts it all into place!

 :edit: Updated the starting information which includes tenets for failing before the command begins.
« Last Edit: October 03, 2013, 11:43:27 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 #17 on: September 11, 2013, 03:32:59 PM »
Well, there's definitely a section of code that would show the probabilities of how Burst (mini-Flare), Comet, and "failed to cast spell".

If only we could find that out for FF4A as well...
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 #18 on: September 11, 2013, 11:44:40 PM »
Enormous update to previous post! With this information we are now able to do several things of relative importance.

One - We can now make a special equipment (or anything in the character's stats really) that will allow the player to use W. Meteo!

Here's how...
Change this....
$03/E56E   BD 00 20   LDA $2000,x[$7E:2080]   A:0000   X:0080   Y:0005   P:envMxdiZc - Load Character 1's Character ID into A.
$03/E571   29 1F   AND #$1F   A:0089   X:0080   Y:0005   P:eNvMxdizc - -80? to A?
$03/E573   C9 13   CMP #$13   A:0009   X:0080   Y:0005   P:envMxdizc - (Palom and Porom are 08 and 09, not 13 and 15, I have no ide... FuSoYa and Golbez.) Is it FuSoYa?
$03/E575   F0 04   BEQ $04    [$E57B]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If so branch to 03E57B.
$03/E577   C9 15   CMP #$15   A:0009   X:0080   Y:0005   P:eNvMxdizc - Is it Golbez?
$03/E579   D0 04   BNE $04    [$E57F]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If not branch to 03E57F.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57B   A9 5E   LDA #$5E   A:0015   X:0080   Y:0005   P:envMxdiZC - Load W. Meteo
$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Branch Always to 03E598.


To this...

$03/E56E   BD 00 20   LDA $2032,x[$7E:2080]   A:0000   X:0080   Y:0005   P:envMxdiZc - Load Character 1's Gauntlet into A.
$03/E571   DE DE   NULL #$1F   A:0089   X:0080   Y:0005   P:eNvMxdizc - NULL
$03/E573   C9 AF   CMP #$AF   A:0009   X:0080   Y:0005   P:envMxdizc - Is it Cursed Ring?
$03/E575   F0 04   BEQ $04    [$E57B]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If so branch to 03E57B.
$03/E577   C9 FF   CMP #$FF   A:0009   X:0080   Y:0005   P:eNvMxdizc - Is it TrashCans (Which Golbez defaultly has equipped)
$03/E579   D0 04   BNE $04    [$E57F]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If not branch to 03E57F.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57B   A9 5E   LDA #$5E   A:0015   X:0080   Y:0005   P:envMxdiZC - Load W. Meteo
$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Branch Always to 03E598.



Two - You can make use of that worthless (barely ever seen) "Failed" Message for the Twins and turn it into a Third spell and here's how...

You take this...

$03/E57F   20 93 85   JSR $8593  [$03:8593]   A:0009   X:0080   Y:0005   P:eNvMxdizc - Jump to Subroutine (where random number seems to be generated)
$03/E582   C9 FF   CMP #$FF   A:008F   X:0011   Y:0005   P:eNvMxdizC - Was it FF (or higher)?
$03/E584   90 08   BCC $08    [$E58E]   A:008F   X:0011   Y:0005   P:eNvMxdizc - If not, branch to 03E58E.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E586   A9 11   LDA #$11   A:00FF   X:0033   Y:0007   P:envMxdiZC- Load x11 into A. (Failed Message)
$03/E588   8D CA 34   STA $34CA  [$7E:34CA]   A:0011   X:001B   Y:0005   P:envMxdizC - Store A in 7E34CA (Battle Message Area)
$03/E58B   4C A6 85   JMP $85A6  [$03:85A6]   A:0011   X:001B   Y:0005   P:envMxdizC - Jump to Subroutine which leads out of the Routine all together.

And change it to this...

$03/E57F   20 93 85   JSR $8593  [$03:8593]   A:0009   X:0080   Y:0005   P:eNvMxdizc - Jump to Subroutine (where random number seems to be generated)
$03/E582   C9 C0   CMP #$FF   A:008F   X:0011   Y:0005   P:eNvMxdizC - Was it C0 (or higher)?
$03/E584   90 08   BCC $08    [$E58E]   A:008F   X:0011   Y:0005   P:eNvMxdizc - If not, branch to 03E58E.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E586   A9 XX   LDA #$XX   A:00E8   X:00F8   Y:0007   P:envMxdizC - Whatever spell you please, as long as it targets enemies. Healing spells will still hit the enemy if chosen.
$03/E588   80 0E   BRA $0E    [$E598]   A:0011   X:00F8   Y:0007   P:envMxdizC - Branch Always to 03E598 (to get back to the normal routine.)
$03/E58B   DE DE DE NULL    $85A6  [$03:85A6]   A:0011   X:001B   Y:0005   P:envMxdizC - NULL

And there you have it! The command of Twin completely enhanced by simply knowing its basic coding!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #19 on: September 12, 2013, 12:26:02 AM »
That is pretty freaking awesome, Grimoire.
Question: will a healing spell still always target the enemies even if you change its targeting to "all allies," thus nullifying its ability to target enemies under normal circumstances?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #20 on: September 12, 2013, 12:56:17 AM »
Unfortunately no. It seems you had the same idea as me of having Twin actually *gasp* having something to do with the White Mage portion of the Cast! But no, All Allies still only hits enemies and there doesn't appear to be anything in that formula to change it. We're still missing some secondary targeting table for commands, I'm almost sure of it. I'm just not sure how to go about looking 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 #21 on: September 12, 2013, 01:14:44 AM »
You would have to change targeting and the spells used to make the "new targeting" effective.

Otherwise, you'd probably have to write custom code to use the spell's built in behavior (that is why some of the FF4A Confuse status bugs are comical).

Just remember that Burst/mini-Flare is a single target spell that is forced to do split-damage when cast (it has almost the same spell power as Bio).
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #22 on: September 12, 2013, 01:59:17 AM »
Hmm...
Correct me if I'm wrong, but I think selecting Twin begins an automatic sequence that bypasses targeting.
BUT Twin's entry in the targeting table (9FFC3 - 9FFDC) is 60 (all enemies). If we changed that to 70 (one/all allies/enemies, defaults to enemy), perhaps this would enable targeting allies depending on the particulars of the spell.
I realize this is a bit optimistic, but it's worth a try.

 :edit: Nope. While it is possible to change the targeting of Twin, the command always forces its targeting on the spell cast. Even if you change it to "00" (target self with no finger), the spell just gets cast on the twin who initiates Twin.  :bah:
« Last Edit: September 12, 2013, 09:17:52 AM by chillyfeez »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #23 on: September 12, 2013, 09:26:08 AM »
Hmm, and if you tell it to target single/all/allies/enemies the game never takes that into account? Because I had a theory to use, if those are ever taken into account.

 :edit: Yep. Auto-Targeting, I have no idea where and how that is determined.
« Last Edit: September 12, 2013, 09:43:49 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 #24 on: September 12, 2013, 10:04:26 AM »
Chillyfeez your theory was right on the mark!




Set the Targeting to F0 and you can target either Ally/Allies Enemy or Enemies.

I have a plan to use this for, but I'm out of time. I'll post when I get home, but needless to say I think I can make a way to have one White Magic spell act on Allies and another Twin Spell on enemies.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« Reply #25 on: September 12, 2013, 07:45:39 PM »
After roughly an hour of thinking on how to make a separate Black-esque spell and White-esque spell for Twin the answer finally came, it does involve replacing the Golbez/FuSoYa check though, but that's fine. I think Zeromus will still scriptedly die to a Comet or Flare anyhow.

$03/E56E   BD 54 20   LDA $2054,x[$7E:2054]   A:0000   X:0000   Y:0005   P:envMxdiZc - Load Character's Targeting Info (Ally).
$03/E571   C9 00   CMP #$00   A:0080   X:0000   Y:0005   P:eNvMxdizc - Is it 00? (Which it will be if the character is using an Ally target)
$03/E573   F0 0A   BEQ $0A    [$E57F]   A:0080   X:0000   Y:0005   P:eNvMxdizC - If so break to 03E57F (To the normal routine.)
$03/E575   A9 00   LDA #$00   A:0080   X:0000   Y:0005   P:eNvMxdizC - Load a 00 into A.
$03/E577   8D 54 20   STA $2054  [$7E:2054]   A:0000   X:0000   Y:0005   P:envMxdiZC - Erases the Ally Target Info so it is not saved in subsequent casts (Causing problems)
$03/E57A   EA    NOP   A:0000   X:0000   Y:0005   P:envMxdiZC -
$03/E57B   A9 85   LDA #$85   A:0000   X:0000   Y:0005   P:envMxdiZC$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Load Absorb (just a test, you can use anything you like)

Is what I would say if I thought about this way too hard (which I did). But this comes with a host of problems. First and foremost the byte that shows whether someone is targeting an ally or is going to target an ally is never properly cleared and there's not enough room to clear those bytes from everyone, so here is my new, simpler, and probably more effective and character defining skill. when I can just use the normal one and slightly alter it...

$03/E56E   AD 00 20   LDA $2680,[$7E:2680]   A:0000   X:0080   Y:0005   P:envMxdiZc - Load Character 1's Character ID from Caster's Data into A.
$03/E571   29 1F   AND #$1F   A:0089   X:0080   Y:0005   P:eNvMxdizc - -80? to A?
$03/E573   C9 09   CMP #$08   A:0008   X:0080   Y:0005   P:envMxdizc - Is it Palom?
$03/E575   F0 04   BEQ $04    [$E57B]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If so branch to 03E57B.
$03/E577   C9 15   CMP #$15   A:0009   X:0080   Y:0005   P:eNvMxdizc - Is it Golbez?
$03/E579   D0 04   BNE $04    [$E57F]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If not branch to 03E57F.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57B   A9 5E   LDA #$5E   A:0015   X:0080   Y:0005   P:envMxdiZC - Load W. Meteo
$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Branch Always to 03E598.


Twincast works a very strange way. The character who initiates the Twincast is actually not attacking, but the other Twin is the one taking action. If Porom uses Twincast the game loads Palom's stats. If Palom uses Twincast the game loads Porom's stats. Unless one is occupying the middle slot. In such a case the Twins will load their own stats for their command.

This makes setting up a constant a lot more difficult than it should be since in differing circumstances the checks would be reversed. Now I know somewhere else in RAM the targeting is stored (assuming that too has a different byte for allies or enemies), but I'm not sure where. But until I find that I guess there's no logical way to separate Palom and Porom's Twincast.

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 #26 on: September 12, 2013, 08:33:41 PM »
Twincast works a very strange way. The character who initiates the Twincast is actually not attacking, but the other Twin is the one taking action. If Porom uses Twincast the game loads Palom's stats. If Palom uses Twincast the game loads Porom's stats. Unless one is occupying the middle slot. In such a case the Twins will load their own stats for their command.

Hmm... the middle slot is the best for controlling Twincast, but that behavior is odd. I kinda thought Agility had some influence with it (at least with respect to FF4A).
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 #27 on: September 12, 2013, 09:24:41 PM »
Indeed DeathLike2, I was expecting that to play some role, but as far as the SNES versions appear to be concerned placement is Everything. You noted this in the Algorithm FAQ that the Twin in the middle is the one whose stats are calculated.


Okay! So I have it mostly figured out. There is still one problem I can't fix but that's more to do with an Inferior/Superior Twin problem. I guess it's a ?feature? of the hack then.


$03/E56E   BD 3B 39   LDA $393B,x[$7E:393B]   A:0000   X:0000   Y:0005   P:envMxdiZc - Load Character's Targeting Info (Internal).
$03/E571   C9 00   CMP #$00   A:0080   X:0000   Y:0005   P:eNvMxdizc - Is it 00? (Which it will be if the character is using an Ally target)
$03/E573   F0 0A   BEQ $0A    [$E57F]   A:0080   X:0000   Y:0005   P:eNvMxdizC - If so break to 03E57F (To the normal routine.)
$03/E575   A9 00   LDA #$00   A:0080   X:0000   Y:0005   P:eNvMxdizC - Load a 00 into A.
$03/E577   8D 54 20   STA $2054  [$7E:2054]   A:0000   X:0000   Y:0005   P:envMxdiZC - Erases the Ally Target Info so it is not saved in subsequent casts (Causing problems)
$03/E57A   EA    NOP   A:0000   X:0000   Y:0005   P:envMxdiZC -
$03/E57B   A9 85   LDA #$85   A:0000   X:0000   Y:0005   P:envMxdiZC$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Load Absorb (just a test, you can use anything you like)

As I had hoped I followed the targeting back to it's (halfway-house, but for our purposes...) origin and found it at 7E393B I really need to pay more attention to these Data Altering Fields which are located in this section, a lot of important stuff is drawn from, and put in to it. This switches with any action taken by anyone and therefore will not stay static as it would in the character's own Targeting info until the next true Cast-On-Party Spell is cast to overwrite the previous one.

So now there will be a unique spell cast from Twincast only if it is targeting someone in the party, or the whole party.

Now onto the Superior/Inferior Twin problem...

The Twin that is considered the current Superior is the one that seems to be placed earlier in the slots with the Twin in Slot 1 taking precedence in everything. This is already known, but what is not known is that the Inferior Twin will Always be Porom unless the two are considered Current Equals, which only occurs when Porom occupies the Main Slot or the 3rd (I think that's the top? Maybe that's the 2nd...) slot. Now this wouldn't ordinarily be that large of a problem, the game goes on like this in a normal fashion without it being noticeable at all.

However it is Very noticeable by using this hack. When Inferior Porom goes to use a spell on the party, she will instead only cast the spell on Palom no matter who is targeted. It is a Bizarre behavior. When the Twins are considered Equal, they both work the same.

Well that was a bit of interesting work, I never expected the Twincast System to be that complicated. As far as I could tell (boosted Porom's Agility to 22 while Palom's was still 8) Agility did not factor into it at all for the SNES versions.



« Last Edit: September 12, 2013, 10:30:24 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 #28 on: September 13, 2013, 10:28:12 AM »
Code: [Select]
$03/E56E   BD 3B 39   LDA $393B,x[$7E:393B]   A:0000   X:0000   Y:0005   P:envMxdiZc - Load Character's Targeting Info (Internal).
$03/E571   C9 00   CMP #$00   A:0080   X:0000   Y:0005   P:eNvMxdizc - Is it 00? (Which it will be if the character is using an Ally target)
$03/E573   F0 0A   BEQ $0A    [$E57F]   A:0080   X:0000   Y:0005   P:eNvMxdizC - If so break to 03E57F (To the normal routine.)
$03/E575   A9 00   LDA #$00   A:0080   X:0000   Y:0005   P:eNvMxdizC - Load a 00 into A.
$03/E577   8D 54 20   STA $2054  [$7E:2054]   A:0000   X:0000   Y:0005   P:envMxdiZC - Erases the Ally Target Info so it is not saved in subsequent casts (Causing problems)
$03/E57A   EA    NOP   A:0000   X:0000   Y:0005   P:envMxdiZC -
$03/E57B   A9 85   LDA #$85   A:0000   X:0000   Y:0005   P:envMxdiZC
$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Load Absorb (just a test, you can use anything you like)
Here's some optimizing you can do:
LDA $393B,X - This will load whatever is in this address, so far so good.
CMP #$00 - You don't need this. LDA will set the Z flag appropriately upon load. Guessing this is Square's doing (they did this a lot in FF6, too).
The rest of it looks good.

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 #29 on: September 15, 2013, 10:54:57 AM »
Ah, so CMP #00 isn't needed and will always set on its own? That is very useful information and frees up crucial space in trying to make routines that should look at a 00.