Moldball Virus Depth Check

From Final Fantasy Hacktics Wiki
Revision as of 13:32, 8 February 2022 by Orkney (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Parameters : r4 = Ability ID

Nullify AoE flag of targetable grid panel if Ability is MoldBall virus (0x149) and tile depht > 0
---------------------------------------------------------------------------------------------------
00179204: 00042400 sll r4,r4,0x10           |
00179208: 00042403 sra r4,r4,0x10           |r4 = Ability ID (upper register cleard)
0017920c: 34020149 ori r2,r0,0x0149         |r2 = Moldball Virus ID (0x149)
00179210: 14820010 bne r4,r2,0x00179254     #If Ability is Moldball Virus #\Else Branch to END
00179214: 00000000 nop                           |
00179218: 00002821 addu r5,r0,r0                 |Counter = 0
0017921c: 3c048019 lui r4,0x8019                 |
00179220: 24842dd8 addiu r4,r4,0x2dd8            |r4 = Targetable grid data pointer
00179224: 3c038019 lui r3,0x8019                 |
00179228: 2463f8cc addiu r3,r3,-0x0734           |r3 = Tile Data Pointer
0017922c: 90620003 lbu r2,0x0003(r3)             @LOOP through all tiles/panels r2 = this iteration tile depht + halves
00179230: 00000000 nop                               |
00179234: 304200e0 andi r2,r2,0x00e0                 |r2 <> 0x00 if depht <> 0
00179238: 10400002 beq r2,r0,0x00179244              #If tile depht <> 0 #\Else branch to next loop iteration
0017923c: 24630008 addiu r3,r3,0x0008                |r3 = Tile data pointer + 0x08 (next tile pointer)
00179240: a0800000 sb r0,0x0000(r4)                      |Nullify targetable panel AoE (matching this iteration tile)
00179244: 24a50001 addiu r5,r5,0x0001                |r5 = Tile counter +1
00179248: 28a20200 slti r2,r5,0x0200                 |r2 = 0x01 if Tile counter < 0x200 (every tile - lower and higher elevation)
0017924c: 1440fff7 bne r2,r0,0x0017922c          Λ Loop until last possible tile 
00179250: 24840005 addiu r4,r4,0x0005                |r4 = Targetable panel data pointer + 0x05 (next panel pointer)
00179254: 03e00008 jr r31                   END
00179258: 00000000 nop                      

Return location

 0017bafc: Targeting_routine