Get Unit Screen Location Data Pointer

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: GET UNIT SCREEN LOCATION DATA POINTER
#       Parameters:
#           r4 = unitMiscID
#       Returns:
#           r2 = Pointer to unit's screen location data (unitMiscDataPtr + 0x40)

8008c410: 27bdffe8 addiu r29,r29,-0x0018
8008c414: afbf0010 sw r31,0x0010(r29)
8008c418: 0c01e9b9 jal 0x8007a6e4                   #   unitMiscDataPtr = Get Unit Misc Data Pointer (unitMiscID);
8008c41c: 3084ffff andi r4,r4,0xffff
8008c420: 14400002 bne r2,r0,0x8008c42c
8008c424: 24420040 addiu r2,r2,0x0040               #   result = unitMiscDataPtr + 0x40         // Points to unit's screen location data
                                                    #   if (unitMiscDataPtr == null) {
8008c428: 00001021 addu r2,r0,r0                    #       result = null
                                                    #   }
8008c42c: 8fbf0010 lw r31,0x0010(r29)               #   return result;
8008c430: 27bd0018 addiu r29,r29,0x0018
8008c434: 03e00008 jr r31
8008c438: 00000000 nop