Set damage display type based on ability

From Final Fantasy Hacktics Wiki
Revision as of 09:24, 22 April 2024 by Sardek (talk | contribs) (One of the return locations was a lie)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
On the way toward Ability resolution
Then Load ability Effect and determines if Ability effect should be played or not
---------------------------------------------------------------------------------------------------
No Parameters
Returns nothing
----------------------------------------------------------------------------------------------------
00073eec: 27bdffe0 addiu r29,r29,-0x0020    |
00073ef0: 34020001 ori r2,r0,0x0001         |r2 = 0x01
00073ef4: afbf001c sw r31,0x001c(r29)       |
00073ef8: afb20018 sw r18,0x0018(r29)       |
00073efc: afb10014 sw r17,0x0014(r29)       |
00073f00: afb00010 sw r16,0x0010(r29)       |
00073f04: 3c018004 lui r1,0x8004            |
00073f08: ac225980 sw r2,0x5980(r1)         |Set Animation speed to 0x01  80045980
00073f0c: 0c01e875 jal 0x0007a1d4           |-->Get casting unit's misc data Returns r2 = Acting unit's misc data (matching ID at 0x8009611c )
00073f10: 00000000 nop                      |
00073f14: 00408021 addu r16,r2,r0           |r16 = Acting unit's misc data pointer
00073f18: 8e020134 lw r2,0x0134(r16)        |r2 = Acting unit's data pointer
00073f1c: 00000000 nop                      |
00073f20: 9044018a lbu r4,0x018a(r2)        |r4 = Raw Unit ID
00073f24: 0c05f391 jal 0x0017ce44           |-->Main ability loading routine? Way to Formula resolution
00073f28: 2605018c addiu r5,r16,0x018c      |r5 = misc unit current action data
00073f2c: 02002821 addu r5,r16,r0           |r5 = Acting unit's misc data pointer
00073f30: 920401ab lbu r4,0x01ab(r16)       |Load Acting Unit's used Weapon ID
00073f34: 960201a0 lhu r2,0x01a0(r16)       |Load Acting Unit's used Ability ID
00073f38: 861201a6 lh r18,0x01a6(r16)       |Load Acting Unit's Proc Ability ID 
00073f3c: 3051ffff andi r17,r2,0xffff       |r17 = Acting Unit's used Ability ID
00073f40: 0c020dd6 jal 0x00083758           |-->Set thrown item graphic/palette
00073f44: a6020138 sh r2,0x0138(r16)        |Store used Ability ID at Acting Unit's misc 0x138
00073f48: 12400003 beq r18,r0,0x00073f58    #If There is or will be a Proc
00073f4c: 34020200 ori r2,r0,0x0200         |r2 = 0x200 (Fall ID ?)
00073f50: 16320009 bne r17,r18,0x00073f78       #If Used Ability is not the Proc : Branch to  No Effect section
00073f54: 00000000 nop                          |
00073f58: 12220007 beq r17,r2,0x00073f78    #If Used Ability ID = 0x200 (Fall) : Branch to No Effect section
00073f5c: 00000000 nop                      |
00073f60: 12200005 beq r17,r0,0x00073f78    #If Used Ability = 0x00 (Attack ?) :  Branch to No Effect section
00073f64: 00000000 nop                      |
     ----Load Effect section --- 
00073f68: 0c068605 jal 0x001a1814           |-->Load_Ability_Effect returns r2 = 0x01 if effect is 0xffff / else 0x00 
00073f6c: 02202021 addu r4,r17,r0           |r4 = Used Ability ID
00073f70: 10400005 beq r2,r0,0x00073f88     #If Ability Effect is 0xffff 
00073f74: 3402002b ori r2,r0,0x002b         |r2 = 0x2b

     ----No Effect section (Attack - Fall - Effect 0xffff - Incoming Proc ) ----  
00073f78: 0c01cee7 jal 0x00073b9c               |-->Set some target coordinates/attacker animation, others
00073f7c: 00000000 nop                          |
00073f80: 0801cfe7 j 0x00073f9c                 >>jump to end
00073f84: 00000000 nop                          |

     ----Ability Effect section (Not Attack - Not Fall - Effect <> 0xffff - Ongoing Proc) ---- 
00073f88: 3c018009 lui r1,0x8009            #Else : Effect is not 0xffff
00073f8c: ac2260e4 sw r2,0x60e4(r1)             |store display byte = 0x2b 800960e4
00073f90: 02202021 addu r4,r17,r0               |r4 = Use Ability ID
00073f94: 0c01cdb5 jal 0x000736d4               |-->Store target coordinates, attack display types
00073f98: 02002821 addu r5,r16,r0               |r5 = Acting unit's misc data pointer
00073f9c: 8fbf001c lw r31,0x001c(r29)       END
00073fa0: 8fb20018 lw r18,0x0018(r29)
00073fa4: 8fb10014 lw r17,0x0014(r29)
00073fa8: 8fb00010 lw r16,0x0010(r29)
00073fac: 27bd0020 addiu r29,r29,0x0020
00073fb0: 03e00008 jr r31
00073fb4: 00000000 nop

Return locations

Battle.bin
00077210: 000771a0_-_00077310
0007729c: 000771a0_-_00077310