Find Unit's Misc Data Pointer and Load Spritesheet Value

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Parameters : r4 = Unit ID
Returns : r2 = Unit spritesheet graphic height ( 0x80094748 + 0x03 )
          r2 = 0x00 if r4 leads to invalid data / Unit is dead, crystal or treasure
-------------------------------------------------------------------------------------
0008dc9c: 27bdffe8 addiu r29,r29,-0x0018
0008dca0: afbf0010 sw r31,0x0010(r29)
0008dca4: 0c01e9c9 jal 0x0007a724		-->Get unit misc data that matches r4 ID - return r2 = unit misc. data pointer (or 0x00 if invalid ID / not found)
0008dca8: 3084ffff andi r4,r4,0xffff		r4 = Unit ID
0008dcac: 0c023709 jal 0x0008dc24		-->Get Unit's Spritesheet Graphic height - return r2 = Units spritesheet graphic height (or 0x00 if invalid Pointer or not relevant)
0008dcb0: 00402021 addu r4,r2,r0		r4 = Unit's Misc Data Pointer
0008dcb4: 8fbf0010 lw r31,0x0010(r29)
0008dcb8: 27bd0018 addiu r29,r29,0x0018
0008dcbc: 03e00008 jr r31
0008dcc0: 00000000 nop

Return locations

001af870: List_targeting_data_of_all_valid_units
001aff64: Set_and_Validate_Arc_Trajectory - r4 = Attacker ID
001aff94: Set_and_Validate_Arc_Trajectory - r4 = Target ID
001b06f8: 001b06d0_-_001b0814
001b0720: 001b06d0_-_001b0814
001b0850: 001b0818_-_001b0a8c
001b0880: 001b0818_-_001b0a8c