Map Location Calculation

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Map Location Calculation (requires r4 = Target Data Pointer)
001810a0: 90830048 lbu r3,0x0048(r4)		Target Y Coordinate
001810a4: 3c02800e lui r2,0x800e
001810a8: 90424e9c lbu r2,0x4e9c(r2)		Map Max X Coordinate
001810ac: 00000000 nop
001810b0: 00620018 mult r3,r2			Y  * Max X
001810b4: 94820048 lhu r2,0x0048(r4)		Y Coordinate + Elevation/Facing Flags
001810b8: 90840047 lbu r4,0x0047(r4)		X Coordinate
001810bc: 000213c2 srl r2,r2,0x0f		Checks for Higher Elevation
001810c0: 00021200 sll r2,r2,0x08		r2 = 0 or 256 (if at a Higher  Elevation)
001810c4: 00001812 mflo r3
001810c8: 00431021 addu r2,r2,r3		Y * Max X + 0 or 256
001810cc: 03e00008 jr r31
001810d0: 00441021 addu r2,r2,r4		r2 = X + Y * Max X + 0 or 256 (Target's Tile ID)


Return Locations

00174a90: - Routine at 174430 - massive routine
00174e38: - Routine at 174df8
001797c8: - Routine at 1797b0
00179e34: - Routine at 179dc8
0017a330: - Check ability data?
0017a738: - Routine at 17a6dc
0017a9b0: - Routine at 17a8c0
0017af68: - Routine at 17ac90
0017b74c: - Calculator Routine
0017bafc: - Targeting routine
0017bdfc: - Routine at 17bdd0
0017c2a4: - Routine at 17c158
0017d044: - Routine at 17ce44
0017e31c: - Main reaction routine?
0017e6c4: - Routine at 17e650
0017eca4: - Routine at 17ec18
0017f20c: - Routine at 17f17c
0017f2e0: - Get Elemental Ability ID
0017f734: - Routine at 17f6c4
00181344: - Weapon Guard Usability
00182254: - Elemental ability loading
001846d4: - Knockback 2 
0018b44c: - Pre Formula Setup (FDC)
0018db28: - Routine at 18da88
0018f39c: - Routine at 18f2b0