Get Source Unit Misc Data Pointer

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: GET SOURCE UNIT MISC DATA POINTER
#       No parameters.
#       Returns:
#           r2 = [Unit misc data pointer] of Source unit, or null if non-existent

0007a218: 3c03800a lui r3,0x800a
0007a21c: 8c638a54 lw r3,-0x75ac(r3)            #   [Current Unit Misc Data Pointer] = [Last Unit Misc Data Pointer]
0007a220: 00000000 nop
0007a224: 1060000b beq r3,r0,0x0007a254         #   if ([Current Unit Misc Data Pointer] == null)
0007a228: 00001021 addu r2,r0,r0                #       return null
0007a22c: 3c048009 lui r4,0x8009
0007a230: 8c846118 lw r4,0x6118(r4)             #   [Source Unit Misc ID]
                                                #   do {
0007a234: 90620004 lbu r2,0x0004(r3)            #       [Current Unit Misc ID]   
0007a238: 00000000 nop
0007a23c: 10440005 beq r2,r4,0x0007a254         #       if ([Source Unit Misc ID] == [Current Unit Misc ID])
0007a240: 00601021 addu r2,r3,r0                #           return [Current Unit Misc Data Pointer]
0007a244: 8c630000 lw r3,0x0000(r3)             #       [Current Unit Misc Data Pointer] = [Current Unit Misc Data Pointer].Previous
0007a248: 00000000 nop
0007a24c: 1460fff9 bne r3,r0,0x0007a234         #   } while ([Current Unit Misc Data Pointer] != null)
0007a250: 00001021 addu r2,r0,r0                #   return null
0007a254: 03e00008 jr r31
0007a258: 00000000 nop