Get Tile Data Pointer From Unit Misc ID

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: GET TILE DATA POINTER FROM UNIT MISC ID
#       Parameters:
#           r4 = (unitMiscID) Unit Misc ID
#       Returns:
#           r2 = Pointer to Tile Data for coordinates that specified unit is on

8008df78: 27bdffe8 addiu r29,r29,-0x0018
8008df7c: afbf0010 sw r31,0x0010(r29)
8008df80: 0c01e9b9 jal 0x8007a6e4                   #   unitMiscData = Get Unit Misc Data Pointer (unitMiscID);
8008df84: 3084ffff andi r4,r4,0xffff
8008df88: 9044007c lbu r4,0x007c(r2)                #   unitMiscData.X
8008df8c: 9045007d lbu r5,0x007d(r2)                #   unitMiscData.Y
8008df90: 9046007e lbu r6,0x007e(r2)                #   unitMiscData.MapLevel
8008df94: 0c060fed jal 0x80183fb4                   #   result = Get Tile Data Pointer (unitMiscData.X, unitMiscData.Y, unitMiscData.MapLevel);
8008df98: 00000000 nop
8008df9c: 8fbf0010 lw r31,0x0010(r29)               #   return result;
8008dfa0: 27bd0018 addiu r29,r29,0x0018
8008dfa4: 03e00008 jr r31
8008dfa8: 00000000 nop