Set target state for all units panels

From Final Fantasy Hacktics Wiki
(Redirected from 0017a6dc - 0017a7b8)
Jump to navigation Jump to search

Expand Range from Ally/Enemy (Nonfunctioning) 17a6dc: 0017a6dc - 0017a7b8

	001810a0: Map Location Calculation
r4 = Caster Data
r5 = Ability Flags 1
0017a6dc: 27bdffc8 addiu r29,r29,-0x0038
0017a6e0: afb10014 sw r17,0x0014(r29)
0017a6e4: 00808821 addu r17,r4,r0					r17 = Caster Data
0017a6e8: afb7002c sw r23,0x002c(r29)
0017a6ec: 30b70080 andi r23,r5,0x0080				r23 = Unknown Flag 1
0017a6f0: afb60028 sw r22,0x0028(r29)
0017a6f4: 30b60040 andi r22,r5,0x0040				r22 = Unknown Flag 2
0017a6f8: afb3001c sw r19,0x001c(r29)
0017a6fc: 00009821 addu r19,r0,r0					r19 = Counter
0017a700: afb40020 sw r20,0x0020(r29)
0017a704: 34140001 ori r20,r0,0x0001				r20 = True
0017a708: afbf0030 sw r31,0x0030(r29)
0017a70c: afb50024 sw r21,0x0024(r29)
0017a710: afb20018 sw r18,0x0018(r29)
0017a714: afb00010 sw r16,0x0010(r29)
0017a718: 92350005 lbu r21,0x0005(r17)				r21 = ENTD flags
0017a71c: 92230001 lbu r3,0x0001(r17)				r3 = Unit ID
0017a720: 340200ff ori r2,r0,0x00ff					r2 = 0x00ff
0017a724: 10620015 beq r3,r2,0x0017a77c				Branch if Unit ID(Caster) doesn't exist (FF)?
0017a728: 02202021 addu r4,r17,r0					r4 = Caster Data
0017a72c: 922201ba lbu r2,0x01ba(r17)				r2 = Modified ENTD Flags
0017a730: 00000000 nop
0017a734: 02a28026 xor r16,r21,r2					r16 = ENTD Flags
0017a738: 0c060428 jal 0x001810a0					Get Unit Tile ID
0017a73c: 02009021 addu r18,r16,r0					r18 = ENTD Flags
0017a740: 00021880 sll r3,r2,0x02					r3 = Caster Tile ID
0017a744: 00621821 addu r3,r3,r2
0017a748: 3c028019 lui r2,0x8019
0017a74c: 24422dd8 addiu r2,r2,0x2dd8				r2 = Tile Grid Data (0x192dd8)
0017a750: 12e00005 beq r23,r0,0x0017a768			If Unknown Flag = False
0017a754: 00621821 addu r3,r3,r2					r3 = Caster Tile Data
0017a758: 32020030 andi r2,r16,0x0030				r2 = Green Team Flag
0017a75c: 14400002 bne r2,r0,0x0017a768				Branch if Green Team
0017a760: 00000000 nop
0017a764: a0740001 sb r20,0x0001(r3)				Caster Tile is Targeted
0017a768: 12c00004 beq r22,r0,0x0017a77c			If Unknown Flag 2 = False
0017a76c: 32420030 andi r2,r18,0x0030				r2 = Green Team Flag
0017a770: 10400002 beq r2,r0,0x0017a77c				Branch if not Green Team
0017a774: 00000000 nop                                         
0017a778: a0740001 sb r20,0x0001(r3)				Caster Tile is Targeted
0017a77c: 26730001 addiu r19,r19,0x0001				Counter++
0017a780: 2a620015 slti r2,r19,0x0015				If Counter < 0x0015
0017a784: 1440ffe5 bne r2,r0,0x0017a71c				Branch Back if True
0017a788: 00000000 nop                                         Should be "addiu r17,r17,0x01c0"
0017a78c: 8fbf0030 lw r31,0x0030(r29)
0017a790: 8fb7002c lw r23,0x002c(r29)
0017a794: 8fb60028 lw r22,0x0028(r29)
0017a798: 8fb50024 lw r21,0x0024(r29)
0017a79c: 8fb40020 lw r20,0x0020(r29)
0017a7a0: 8fb3001c lw r19,0x001c(r29)
0017a7a4: 8fb20018 lw r18,0x0018(r29)
0017a7a8: 8fb10014 lw r17,0x0014(r29)
0017a7ac: 8fb00010 lw r16,0x0010(r29)
0017a7b0: 27bd0038 addiu r29,r29,0x0038
0017a7b4: 03e00008 jr r31
0017a7b8: 00000000 nop

Notes:

Bugs
-Loop does not properly iterate though character data offsets.
-Character data starts at cur_Chardata offset instead of 0x1908cc