Get casting unit's misc data

From Final Fantasy Hacktics Wiki
Revision as of 12:52, 8 March 2022 by Orkney (talk | contribs)
Jump to navigation Jump to search
Returns r2 = Acting unit's misc data pointer (= pointer matching ID stored at 0x8009611c)
        r2 = 0x00 if not found
------------------------------------------------------------------------------------------------------------------------
0007a1d4: 3c03800a lui r3,0x800a            
0007a1d8: 8c638a54 lw r3,-0x75ac(r3)            |r3 =  pointer to last units misc. data
0007a1dc: 00000000 nop                          |
0007a1e0: 1060000b beq r3,r0,0x0007a210         #If Pointer is valid /Else branch to END (r2 = 0x00)
0007a1e4: 00001021 addu r2,r0,r0                |r2 = 0x00
0007a1e8: 3c048009 lui r4,0x8009                    |r4 = 0x80190000
0007a1ec: 8c84611c lw r4,0x611c(r4)                 |r4 = Acting Unit's misc ID
0007a1f0: 90620004 lbu r2,0x0004(r3)                @LOOP r2 = This iteration unit's misc ID
0007a1f4: 00000000 nop                                  | 
0007a1f8: 10440005 beq r2,r4,0x0007a210                 #If This iteration Unit is not the acting unit /Else branch to End (r2 = Acting unit's misc data pointer)
0007a1fc: 00601021 addu r2,r3,r0                        |r2 = This iteration misc data pointer
0007a200: 8c630000 lw r3,0x0000(r3)                         |r3 = pointer to previous unit misc data
0007a204: 00000000 nop                                      | 
0007a208: 1460fff9 bne r3,r0,0x0007a1f0             Λ Loop while previous misc data pointer is not 0x00
0007a20c: 00001021 addu r2,r0,r0                        |r2 = 0x00
0007a210: 03e00008 jr r31                               
0007a214: 00000000 nop

Returns location

Battle.bin
00068b70:
00068bb0:
00070c20:
0007160c:
0007189c:
000719b0:
00071ae4:
00071b7c:
00071f08:
000723ec:
00072c14:
00072d14:
00073184:
000731e8:
00073308:
00073bd8:
00073f14: Set_damage_display_type_based_on_ability
000746c8:
000747dc:
00074840:
000748c8:
00074998:
000749fc:
00074a60:
00074fd0:
00075628:
00075930:
00075d44:
00075dd8:
00076210:
000766a0:
000771b0:
00077388:
00077478:
00077854:
000779e0:
00077d0c:
00077dd0:
00077e00:
00077efc:
00078080:
00085244: