ATTACK.OUT Prepare Deployed Unit Map Coordinate Data Pointer

From Final Fantasy Hacktics Wiki
Revision as of 22:21, 23 May 2025 by RetroTypes (talk | contribs) (RetroTypes moved page Prepare Deployed Unit Map Coordinate Data Pointer to ATTACK.OUT Prepare Deployed Unit Map Coordinate Data Pointer: Renaming routines to have file name in them for clarity)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Checks if one deployment pass has already been done (this should only be the case if this is a World Debug Battle Style encounter and the Red Team has already been initialized).
If the first pass has not been done, this routine marks down that the first pass has now been completed, and sets the pointer to Slot 1 (of 12).
If the first pass has already been done, this routine sets the pointer to Slot 7. 
001c5a50: 3c02801d lui r2,0x801d
001c5a54: 8c425b04 lw r2,0x5b04(r2)            
001c5a58: 00000000 nop
001c5a5c: 10400005 beq r2,r0,0x001c5a74         # Branch if this is the first deployment pass (pointer at the start of the data)
001c5a60: 34020001 ori r2,r0,0x0001
001c5a64: 3c02801e lui r2,0x801e
001c5a68: 2442cac4 addiu r2,r2,0xcac4           # r2 = 0x801DCAC4 (Deployed Unit Map Coordinate Data slot #7)
001c5a6c: 080716a1 j 0x 001c5a84
001c5a70: 00000000 nop
001c5a74: 3c01801d lui r1,0x801d
001c5a78: ac225b04 sw r2,0x5b04(r1)             # Store 0x01 to mark that we've now done the first deployment pass
001c5a7c: 3c02801e lui r2,0x801e
001c5a80: 2442caac addiu r2,r2,0xcaac           # r2 = 0x801DCAAC (Deployed Unit Map Coordinate Data slot #1)
001c5a84: 03e00008 jr r31
001c5a88: 00000000 nop