Get Tile Data Pointer

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: GET TILE DATA POINTER
#       Parameters:
#           r4 = X Coordinate
#           r5 = Y Coordinate
#           r6 = Higher Elevation bit
#       Returns:
#           r2 = Pointer to Tile Data for specified coordinates (0x00 if not valid)

00183fb4: 3c07800e lui r7,0x800e
00183fb8: 90e74e9c lbu r7,0x4e9c(r7)            #   Map Max X Coordinate
00183fbc: 3c03800e lui r3,0x800e
00183fc0: 90634ea0 lbu r3,0x4ea0(r3)            #   Map Max Y Coordinate
00183fc4: 04800009 bltz r4,0x00183fec           #   if ((X Coordinate < 0) 
00183fc8: 0087102a slt r2,r4,r7
00183fcc: 10400007 beq r2,r0,0x00183fec         #       or (X Coordinate >= Map Max X Coordinate)
00183fd0: 00000000 nop
00183fd4: 04a00005 bltz r5,0x00183fec           #       or (Y Coordinate < 0)
00183fd8: 00a3102a slt r2,r5,r3
00183fdc: 10400003 beq r2,r0,0x00183fec         #       or (Y Coordinate >= Map Max Y Coordinate)
00183fe0: 2cc20002 sltiu r2,r6,0x0002
00183fe4: 14400003 bne r2,r0,0x00183ff4         #       or (Higher Elevation bit >= 2)
00183fe8: 00a70018 mult r5,r7
                                                #   ) {

00183fec: 08061005 j 0x00184014                         Return 0 (null)
00183ff0: 00001021 addu r2,r0,r0
                                                #   }
00183ff4: 00061200 sll r2,r6,0x08               #   [Higher Elevation bit] * 256
00183ff8: 00001812 mflo r3                      #   (Y Coordinate * Map Max X Coordinate)
00183ffc: 00431021 addu r2,r2,r3                #   [Higher Elevation bit] * 256 + (Y Coordinate * Map Max X Coordinate) 
00184000: 00441021 addu r2,r2,r4                #   [Higher Elevation bit] * 256 + (Y Coordinate * Map Max X Coordinate) + X Coordinate
00184004: 000210c0 sll r2,r2,0x03               #   Offset for tile at coordinates: ([Higher Elevation bit] * 256 + (Y Coordinate * Map Max X Coordinate) + X Coordinate) * 8
00184008: 3c038019 lui r3,0x8019
0018400c: 2463f8cc addiu r3,r3,-0x0734          #   Tile data base pointer (0x8018f8cc)
00184010: 00431021 addu r2,r2,r3                #   Pointer to Tile data for this tile

00184014: 03e00008 jr r31                       #   Return Tile data pointer
00184018: 00000000 nop

Return locations

Battle bin
00069360:
00069374:
0006942c:
00069524:
00069790:
000698f0:
0006b0cc:
0006b148:
0006b21c:
0006b310:
0006b42c:
0006b4e0:
0006b6c4:
0006b738:
0006b7d8:
0006b84c:
0006b9c8:
0006ba70:
0006bb14:
0006bbd8:
0006c658:
0006e834:
0006e8c8:
0006eb90:
0006ebb4:
0006fc94:
0006fcb8:
00070840:
00076a74:
00076b4c:
0007ba60:
0007c4c8:
0007c894:
0007d1c8: Complex_Height_Data_from_unit_misc_data_and_coordinates
0007d760:
0007da10:
0007ed80:
00082808:
00083514:
00083fc0:
00086c7c:
00087b68:
000891b4:
00089324:
0008a8c8:
0008c4ac: Set_Unit_Xmod,_Y_Mod_and_Height_data_from_unit_ID
0008df9c:
0008dfd0: Get_Unit_Tile_data_pointer_from_Unit_ID
0008e058:
0008e430:
00093298:
001451e4:
001a62fc:
001a9194:
001a9290:
001aabbc:
001aac54:
001af944: Seek_Obstacle_On_Trajectory
001af9cc: Seek_Obstacle_On_Trajectory
001afffc: Set_and_Validate_Arc_Trajectory
001b08f4:
001b0b4c: