Final Fantasy IV Research & Development / Re: Grimoire LD's Notes, Methods, and Hacks (Basic Attack/Defense Disassembly)
« on: September 25, 2013, 12:46:34 AM »$03/DC2B 20 FD E0 JSR $E0FD [$03:E0FD] A:0003 X:003E Y:0000 P:envMxdizc - Jump to "Is it Absorb?" Routine.
$03/DC2E AD FE 38 LDA $38FE [$7E:38FE] A:0000 X:003E Y:0000 P:envMxdiZc - Load 7E38FE into A.
$03/DC31 10 08 BPL $08 [$DC3B] A:0001 X:003E Y:0000 P:envMxdizc - Is it Positive (Cure Tag?)
------------------------------------------------------------------------------------
03/DC33 29 7F AND #$7F A:0084 X:003E Y:0000 P:eNvMxdizc
$03/DC35 8D FE 38 STA $38FE [$7E:38FE] A:0004 X:003E Y:0000 P:envMxdizc
$03/DC38 4C 1C D4 JMP $D41C [$03:D41C] A:0004 X:003E Y:0000 P:envMxdizc
------------------------------------------------------------------------------------
$03/DC3B AD 2C 27 LDA $272C [$7E:272C] A:0001 X:003E Y:0000 P:envMxdizc - Load Target's Status Immunity 2 into A.
$03/DC3E 2D A4 28 AND $28A4 [$7E:28A4] A:0010 X:003E Y:0000 P:envMxdizc - Check Spell's Status Infliction Byte 2.
$03/DC41 F0 03 BEQ $03 [$DC46] A:0000 X:003E Y:0000 P:envMxdiZc - Branch if not equal to 03DC41.
-----------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
$03/DC46 AD 04 27 LDA $2704 [$7E:2704] A:0000 X:003E Y:0000 P:envMxdiZc - Load Target's Status Byte 2 into A.
$03/DC49 29 FC AND #$FC A:0000 X:003E Y:0000 P:envMxdiZc - ?Add -4? -(Remove Berserk?)
$03/DC4B 85 AA STA $AA [$00:00AA] A:0000 X:003E Y:0000 P:envMxdiZc - Store A in AA.
$03/DC4D AD 04 27 LDA $2704 [$7E:2704] A:0000 X:003E Y:0000 P:envMxdiZc - Load Target's Status Byte 2 into A.
$03/DC50 29 03 AND #$03 A:0000 X:003E Y:0000 P:envMxdiZc - Is there 03 already there?
$03/DC52 18 CLC A:0000 X:003E Y:0000 P:envMxdiZc - Clear Carry Flag.
$03/DC53 69 01 ADC #$01 A:0000 X:003E Y:0000 P:envMxdiZc - Add 01 to A.
$03/DC55 C9 04 CMP #$04 A:0001 X:003E Y:0000 P:envMxdizc - Is it 04?
$03/DC57 90 08 BCC $08 [$DC61] A:0001 X:003E Y:0000 P:eNvMxdizc - If not, branch to 03DC61,
---------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
$03/DC61 05 AA ORA $AA [$00:00AA] A:0001 X:003E Y:0000 P:eNvMxdizc - Add the value in AA into A?
$03/DC63 8D 04 27 STA $2704 [$7E:2704] A:0001 X:003E Y:0000 P:envMxdizc - Store A in 7E2704.
$03/DC66 A9 07 LDA #$07 A:0001 X:003E Y:0000 P:envMxdizc - Load 07 into A.
$03/DC68 85 D6 STA $D6 [$00:00D6] A:0007 X:003E Y:0000 P:envMxdizc - Store A in D6.
$03/DC6A A5 CF LDA $CF [$00:00CF] A:0007 X:003E Y:0000 P:envMxdizc - Load A in CF.
$03/DC6C 20 36 9E JSR $9E36 [$03:9E36] A:0005 X:003E Y:0000 P:envMxdizc - Jump to Subroutine. (??)
$03/DC6F A9 0C LDA #$0C A:0000 X:0024 Y:0024 P:envMxdizc - Load 0C into A.
$03/DC71 20 C8 85 JSR $85C8 [$03:85C8] A:000C X:0024 Y:0024 P:envMxdizc - Jump to Subroutine (May deal something with a Timer)
$03/DC74 A9 40 LDA #$40 A:0000 X:0075 Y:0024 P:envMxdiZc - Load 40 into A.
$03/DC76 9D 06 2A STA $2A06,x[$7E:2A7B] A:0040 X:0075 Y:0024 P:envMxdizc - Store A in 7E2A7B.
$03/DC79 A5 CF LDA $CF [$00:00CF] A:0040 X:0075 Y:0024 P:envMxdizc - Load CF into A.
$03/DC7B 0A ASL A A:0005 X:0075 Y:0024 P:envMxdizc - Multiply A by 2.
$03/DC7C AA TAX A:000A X:0075 Y:0024 P:envMxdizc - Transfer A to X.
$03/DC7D BD EB 29 LDA $29EB,x[$7E:29F5] A:000A X:000A Y:0024 P:envMxdizc - Load A from 7E29F5.
$03/DC80 09 08 ORA #$08 A:0040 X:000A Y:0024 P:envMxdizc - Add 08 to A.
$03/DC82 9D EB 29 STA $29EB,x[$7E:29F5] A:0048 X:000A Y:0024 P:envMxdizc - Store A 7E29F5.
$03/DC85 A5 D4 LDA $D4 [$00:00D4] A:0048 X:000A Y:0024 P:envMxdizc - Load A from D4.
$03/DC87 9D 44 2B STA $2B44,x[$7E:2B4E] A:0024 X:000A Y:0024 P:envMxdizc - Store A in 7E2B4E.
$03/DC8A A5 D5 LDA $D5 [$00:00D5] A:0024 X:000A Y:0024 P:envMxdizc - Load A from D5.
$03/DC8C 9D 45 2B STA $2B45,x[$7E:2B4F] A:0000 X:000A Y:0024 P:envMxdiZc - Store A in 7E2B4F.
$03/DC8F 60 RTS A:0000 X:000A Y:0024 P:envMxdiZc - Return
-------------------------------------------------------------------------------------------------------------------------------------
Hmm, now there are a few interesting items here. One is the Absorb tag when the routine does no damage (normally. If the Absorb routine and is carried through the Target will instead by healed based on the power of the Spell.) and the second is that very familiar sequence at the end which is becoming a staple for Timed Statuses, that is something to take note of. Furthermore I've cast this spell many, many times on enemies and have not frozen the game once, with enemies dying properly. But I can't say the same for the Calcify Weapon Effect. The game will sporadically freeze, as mentioned elsewhere when timers elapse. My thought is that the timer isn't dealt with correctly when the status is inflicted by a weapon. If it's inflicted by a spell it appears to work perfectly fine.
So have no fear in using Calcify as a spell. Just be wary of using it as a Weapon Effect.
We have EVEN MORE themes now, but some old ones are gone...
12/26/14 - Well, looks like the answer to Count's Timer was in front of me the whole time. It's just the Spell Power of the given Spell, hence Count's Timer is 0A.