Difference between revisions of "Map Location Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (notes)
Line 1: Line 1:
  Map Location Calculation (requires r4 = Target Data Pointer)
+
  Map Location Calculation  
 +
------------------------------------
 +
requires r4 = Target Data Pointer
 +
returns r2 hosting tiles infos
 +
------------------------------------
 
  001810a0: 90830048 lbu r3,0x0048(r4) Target Y Coordinate
 
  001810a0: 90830048 lbu r3,0x0048(r4) Target Y Coordinate
 
  001810a4: 3c02800e lui r2,0x800e
 
  001810a4: 3c02800e lui r2,0x800e

Revision as of 18:52, 3 June 2021

Map Location Calculation 
------------------------------------
requires r4 = Target Data Pointer
returns r2 hosting tiles infos
------------------------------------
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: - Store movement stuff into scratch pad
00174e38: - 00174df8 - 00174e80
001797c8: - Height vs Water and Float Routine
00179e34: - Set Ability Targeting?
0017a330: - Check ability data?
0017a738: - Set target state for all units panels
0017a9b0: - Calculate ability range based on action menu byte
0017af68: - Targeting validation (weapon flags)
0017b74c: - Calculator Routine
0017bafc: - Targeting routine
0017bdfc: - Check if Unit can be Targeted
0017c2a4: - Calculate Height Data
0017d044: - Main ability loading routine?
0017e31c: - Main reaction routine?
0017e6c4: - Store counter ability?
0017eca4: - Big map/panel routine
0017f20c: - Calculate Projected Action Effect
0017f2e0: - Get Elemental Ability ID
0017f734: - Validate unit placement
00181344: - Weapon Guard Usability
00182254: - Elemental ability loading
001846d4: - Knockback 2 
0018b44c: - Pre Formula Setup (FDC)
0018db28: - Poison Marsh Routine
0018f39c: - Load last used ability