Difference between revisions of "Linear Attack Tile Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "Linear Attack Tile Calculation 0017c044: 34020002 ori r2,r0,0x0002 0017c048: 10820010 beq r4,r2,0x0017c08c Branch if Direction = 2 0017c04c: 28820003 slti r2,r4,0x0003 00...")
 
 
Line 1: Line 1:
Linear Attack Tile Calculation
+
'''0017c044 - 0017c154'''
  0017c044: 34020002 ori r2,r0,0x0002
+
  0017c048: 10820010 beq r4,r2,0x0017c08c Branch if Direction = 2
+
'''Parameters''': r4 = Set value = Attack direction
  0017c04c: 28820003 slti r2,r4,0x0003
+
            r5 = Attacker X coord
  0017c050: 10400005 beq r2,r0,0x0017c068 Branch if Direction >= 3
+
            r6 = Attacker Y coord
  0017c054: 00000000 nop
+
  0017c058: 1080000a beq r4,r0,0x0017c084 Branch if Direction = 0
+
The routine Will loop through 32 panels (max) in attack direction, setting their targeted flag (byte 0x01) "ON"  (= 0x01) if their AoE is > 0.
  0017c05c: 34090001 ori r9,r0,0x0001 X Mod = 1
+
Note that the Ability using linear attack has their AoE = their range
 
+
----------------------------------------------------------------------------------------
*Direction = 1*
+
  0017c044: 34020002 ori r2,r0,0x0002         |{{f/std|<nowiki>r2 = 0x02</nowiki>}} {{f/std|<nowiki>r6 = Attacker's Y coord</nowiki>}}
  0017c060: 0805f054 j 0x0017c150 (quit)
+
  0017c048: 10820010 beq r4,r2,0x0017c08c     {{f/Cond|<nowiki>If Direction <> 0x02</nowiki>}} {{f/Cond|<nowiki>Branch if Direction = 2</nowiki>}}
  0017c064: 00000000 nop
+
  0017c04c: 28820003 slti r2,r4,0x0003             |{{f/std|<nowiki>r2 = 0x01 if r4 < 0x03</nowiki>}}
  0017c068: 34020004 ori r2,r0,0x0004
+
  0017c050: 10400005 beq r2,r0,0x0017c068         {{f/Cond|<nowiki>If Direction < 0x03 (0X00 or 0x01)</nowiki>}} {{f/Cond|<nowiki>Branch if Direction >= 3</nowiki>}}
  0017c06c: 1082000c beq r4,r2,0x0017c0a0 Branch if Direction = 4
+
  0017c054: 00000000 nop                               |{{f/std|<nowiki> </nowiki>}}
  0017c070: 34020006 ori r2,r0,0x0006
+
  0017c058: 1080000a beq r4,r0,0x0017c084             {{f/Cond|<nowiki>If Direction <> 0x00 (= 0x01)</nowiki>}} {{f/Cond|<nowiki>Branch if Direction = 0</nowiki>}}
  0017c074: 10820008 beq r4,r2,0x0017c098 Branch if Direction = 6
+
  0017c05c: 34090001 ori r9,r0,0x0001                 |{{f/std|<nowiki>r9 = 0x01 </nowiki>}}
  0017c078: 00004821 addu r9,r0,r0 X Mod = 0
+
  0017c060: 0805f054 j 0x0017c150                         {{f/jump|<nowiki>Jump to </nowiki>{{f/loc|<nowiki>END</nowiki>}}<nowiki></nowiki>}}
 
+
  0017c064: 00000000 nop                                   |
*Direction = 3 or 5*
+
  0017c068: 34020004 ori r2,r0,0x0004             {{f/Cond|<nowiki>Else (Direction > 0x03)</nowiki>}} {{f/std|<nowiki>r2 = 0x04</nowiki>}}
  0017c07c: 0805f054 j 0x0017c150 (quit)
+
  0017c06c: 1082000c beq r4,r2,0x0017c0a0             {{f/Cond|<nowiki>If Direction <> 0x04</nowiki>}} {{f/Cond|<nowiki>Branch if Direction = 4</nowiki>}}
  0017c080: 00000000 nop
+
  0017c070: 34020006 ori r2,r0,0x0006                 |{{f/std|<nowiki>r2 = 0x06</nowiki>}}
 
+
  0017c074: 10820008 beq r4,r2,0x0017c098                 {{f/Cond|<nowiki>If direction <> 0x06 (= 0x03 or 0x05)</nowiki>}} {{f/Cond|<nowiki>Branch if Direction = 6</nowiki>}}
*Direction = 0*
+
  0017c078: 00004821 addu r9,r0,r0                         |{{f/std|<nowiki>r9 = 0x00</nowiki>}}
  0017c084: 0805f02a j 0x0017c0a8
+
  0017c07c: 0805f054 j 0x0017c150                             {{f/jump|<nowiki>Jump to </nowiki>{{f/loc|<nowiki>END</nowiki>}}<nowiki></nowiki>}}
  0017c088: 00004021 addu r8,r0,r0 Y Mod = 0; X Mod = 1
+
  0017c080: 00000000 nop                                       |
 
+
*Direction = 2*
+
                            --- Direction is set (0x00, 0x02, 0x04 or 0x06) : Now set X and Y mod ---
  0017c08c: 2409ffff addiu r9,r0,0xffff X Mod = -1
+
  0017c090: 0805f02a j 0x0017c0a8
+
  0017c084: 0805f02a j 0x0017c0a8             {{f/Cond|<nowiki>Direction = 0x00</nowiki>}} {{f/jump|<nowiki>Jump to LOOP ( X mod = +1 / Y mod = 0)</nowiki>}}
  0017c094: 00004021 addu r8,r0,r0 Y Mod = 0
+
  0017c088: 00004021 addu r8,r0,r0                 |{{f/std|<nowiki>r8 = 0x00</nowiki>}}
 
+
  0017c08c: 2409ffff addiu r9,r0,-0x0001      {{f/Cond|<nowiki>Direction = 0x02</nowiki>}} {{f/std|<nowiki>r9 = -0x01</nowiki>}}
*Direction = 6*
+
  0017c090: 0805f02a j 0x0017c0a8                 {{f/jump|<nowiki>Jump to LOOP ( X mod = -1 / Y mod = 0)</nowiki>}}
  0017c098: 0805f02a j 0x0017c0a8
+
  0017c094: 00004021 addu r8,r0,r0                 |{{f/std|<nowiki>r8 = 0x00</nowiki>}}
  0017c09c: 34080001 ori r8,r0,0x0001 Y Mod = 1; X Mod = 0
+
  0017c098: 0805f02a j 0x0017c0a8             {{f/Cond|<nowiki>Direction = 0x06</nowiki>}} {{f/jump|<nowiki>Jump to LOOP ( X mod = 0 / Y mod = 1)</nowiki>}}
 
+
  0017c09c: 34080001 ori r8,r0,0x0001             |{{f/std|<nowiki>r8 = 0x00</nowiki>}}
*Direction = 4*
+
  0017c0a0: 00004821 addu r9,r0,r0           {{f/Cond|<nowiki>Direction = 0x04</nowiki>}} {{f/std|<nowiki>r9 = 0x00 (X mod)</nowiki>}}
  0017c0a0: 00004821 addu r9,r0,r0 X Mod = 0
+
  0017c0a4: 2408ffff addiu r8,r0,-0x0001          |{{f/std|<nowiki>r8 = -0x01 (Y mod)</nowiki>}}
  0017c0a4: 2408ffff addiu r8,r0,0xffff Y Mod = -1
+
  0017c0a8: 00003821 addu r7,r0,r0 Counter = 0
+
                            --- X mod and Y mod are set : Now loop in the right direction ---
  0017c0ac: 3c0b8019 lui r11,0x8019
+
  0017c0b0: 256b2dd8 addiu r11,r11,0x2dd8 r11 = ? Tile Data Pointer
+
  0017c0a8: 00003821 addu r7,r0,r0           |{{f/std|<nowiki>r7 = 0x00 (Loop counter)</nowiki>}}
  0017c0b4: 340a0001 ori r10,r0,0x0001 r10 = 1
+
  0017c0ac: 3c0b8019 lui r11,0x8019           |
  0017c0b8: 04a00025 bltz r5,0x0017c150 Branch if X is negative
+
  0017c0b0: 256b2dd8 addiu r11,r11,0x2dd8     |{{f/adr|<nowiki>r11 = Targetable grid data pointer</nowiki>}}
  0017c0bc: 00000000 nop
+
  0017c0b4: 340a0001 ori r10,r0,0x0001       |{{f/std|<nowiki>r10 = 0x01</nowiki>}}
  0017c0c0: 3c03800e lui r3,0x800e
+
  0017c0b8: 04a00025 bltz r5,0x0017c150       {{f/bloop|<nowiki>LOOP</nowiki>}} {{f/Cond|<nowiki>If Attacker X coord is >= 0x00</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}} {{f/std|<nowiki>First iteration, it's Attacker coordinates</nowiki>}}
  0017c0c4: 90634e9c lbu r3,0x4e9c(r3) Load Map Max X
+
  0017c0bc: 00000000 nop                               |{{f/std|<nowiki> </nowiki>}}
  0017c0c8: 00000000 nop
+
  0017c0c0: 3c03800e lui r3,0x800e                     |
  0017c0cc: 00a3102a slt r2,r5,r3
+
  0017c0c4: 90634e9c lbu r3,0x4e9c(r3)                 |{{f/load|<nowiki>r3 = Map Max X </nowiki>}} {{f/std|<nowiki>0x800e49ec</nowiki>}}
  0017c0d0: 1040001f beq r2,r0,0x0017c150 Branch if X >= Max X
+
  0017c0c8: 00000000 nop                               |
  0017c0d4: 00000000 nop
+
  0017c0cc: 00a3102a slt r2,r5,r3                     |{{f/std|<nowiki>r2 = 0x01 if Attacker X coord < Map Max X</nowiki>}}
  0017c0d8: 04c0001d bltz r6,0x0017c150 Branch if Y is negative
+
  0017c0d0: 1040001f beq r2,r0,0x0017c150             {{f/Cond|<nowiki>If Attack X coord < Map Max X</nowiki>}} /Else Branch to {{f/loc|<nowiki>END</nowiki>}}
  0017c0dc: 00000000 nop
+
  0017c0d4: 00000000 nop                                   |{{f/std|<nowiki> </nowiki>}}
  0017c0e0: 3c02800e lui r2,0x800e
+
  0017c0d8: 04c0001d bltz r6,0x0017c150                   {{f/Cond|<nowiki>If Attack Y coord < 0x00</nowiki>}} /Else Branch to {{f/loc|<nowiki>END</nowiki>}}
  0017c0e4: 90424ea0 lbu r2,0x4ea0(r2) Load Map Max Y
+
  0017c0dc: 00000000 nop                                       |{{f/std|<nowiki> </nowiki>}}
  0017c0e8: 00000000 nop
+
  0017c0e0: 3c02800e lui r2,0x800e                             |{{f/std|<nowiki> </nowiki>}}
  0017c0ec: 00c2102a slt r2,r6,r2
+
  0017c0e4: 90424ea0 lbu r2,0x4ea0(r2)                         |{{f/load|<nowiki>r2 = Map Max Y</nowiki>}} {{f/std|<nowiki>0x800e4ea0</nowiki>}}
  0017c0f0: 10400017 beq r2,r0,0x0017c150 Branch if Y >= Max Y
+
  0017c0e8: 00000000 nop                                       |
  0017c0f4: 00c30018 mult r6,r3 Y * Max X
+
  0017c0ec: 00c2102a slt r2,r6,r2                             |{{f/std|<nowiki>r2 = 0x01 if Attack Y coord < Map Max Y</nowiki>}}
  0017c0f8: 00001012 mflo r2
+
  0017c0f0: 10400017 beq r2,r0,0x0017c150                     {{f/Cond|<nowiki>If Attack Y coord < Map Max Y</nowiki>}} /Else Branch to {{f/loc|<nowiki>END</nowiki>}}
  0017c0fc: 00452021 addu r4,r2,r5 Tile ID = Y * Max X + X
+
  0017c0f4: 00c30018 mult r6,r3                                   |{{f/std|<nowiki>Attack Y coord * Max X</nowiki>}}
  0017c100: 00041080 sll r2,r4,0x02 ID * 4
+
  0017c0f8: 00001012 mflo r2                                       |{{f/std|<nowiki>r2 =  Attack Y coord * Max X</nowiki>}}
  0017c104: 00441021 addu r2,r2,r4 ID * 5
+
  0017c0fc: 00452021 addu r4,r2,r5                                 |{{f/std|<nowiki>r4 = Attack X coord + Attack Y coord * Max X = Lower elevation tile ID</nowiki>}}
  0017c108: 004b1821 addu r3,r2,r11
+
  0017c100: 00041080 sll r2,r4,0x02                               |{{f/std|<nowiki>r2 = Lower Tile ID * 4</nowiki>}}
  0017c10c: 90620000 lbu r2,0x0000(r3) Load Low Tile's AoE
+
  0017c104: 00441021 addu r2,r2,r4                                 |{{f/std|<nowiki>r2 = Lower Tile ID * 5 (5 = Size of targetable panel data)</nowiki>}}
  0017c110: 00000000 nop
+
  0017c108: 004b1821 addu r3,r2,r11                               |{{f/adr|<nowiki>r3 = Lower Targetable panel data pointer</nowiki>}}
  0017c114: 10400002 beq r2,r0,0x0017c120 Branch if Low AoE = 0
+
  0017c10c: 90620000 lbu r2,0x0000(r3)                             |{{f/load|<nowiki>r2 =  Lower elevation panel's AoE</nowiki>}}
  0017c118: 24840100 addiu r4,r4,0x0100 Tile ID + 0x100
+
  0017c110: 00000000 nop                                           |
  0017c11c: a06a0001 sb r10,0x0001(r3) Store Tile Targeted? = True
+
  0017c114: 10400002 beq r2,r0,0x0017c120                         {{f/Cond|<nowiki>If Lower elevation panel's AoE <> 0x00</nowiki>}} /Else Avoid update of panel targeted flag
  0017c120: 00041080 sll r2,r4,0x02 ID * 4
+
  0017c118: 24840100 addiu r4,r4,0x0100                           |{{f/std|<nowiki>r4 = Tile ID + 0x100 (higher elevation tile ID)</nowiki>}}
  0017c124: 00441021 addu r2,r2,r4 ID * 5
+
  0017c11c: a06a0001 sb r10,0x0001(r3)                                 |{{f/store|<nowiki>Set Lower Targetable panel targeted flag "ON" (byte [0x01] = 0x01)</nowiki>}}
  0017c128: 004b1821 addu r3,r2,r11
+
  0017c120: 00041080 sll r2,r4,0x02                               |{{f/std|<nowiki>r2 = Higher Tile ID *4</nowiki>}}
  0017c12c: 90620000 lbu r2,0x0000(r3) Load High Tile's AoE
+
  0017c124: 00441021 addu r2,r2,r4                                 |{{f/std|<nowiki>r2 = Higher Tile ID *5 (5 = Size of targetable panel data)</nowiki>}}
  0017c130: 00000000 nop
+
  0017c128: 004b1821 addu r3,r2,r11                               |{{f/adr|<nowiki>r3 = Higher Targetable panel data pointer</nowiki>}}
  0017c134: 10400002 beq r2,r0,0x0017c140 Branch if High AoE = 0
+
  0017c12c: 90620000 lbu r2,0x0000(r3)                             |{{f/load|<nowiki>r2 =  Higher elevation panel's AoE</nowiki>}}
  0017c138: 00c83021 addu r6,r6,r8 Y += Y Mod
+
  0017c130: 00000000 nop                                           |
  0017c13c: a06a0001 sb r10,0x0001(r3) Store Tile Targeted? = True
+
  0017c134: 10400002 beq r2,r0,0x0017c140                         {{f/Cond|<nowiki>If Lower elevation panel's AoE <> 0x00</nowiki>}} {{f/Cond|<nowiki>Branch if High AoE = 0</nowiki>}}
  0017c140: 24e70001 addiu r7,r7,0x0001 Counter ++
+
  0017c138: 00c83021 addu r6,r6,r8                                 |{{f/std|<nowiki>r6 = Attack Y + Y mod</nowiki>}}
  0017c144: 28e20020 slti r2,r7,0x0020
+
  0017c13c: a06a0001 sb r10,0x0001(r3)                                 |{{f/store|<nowiki>Set Higher Targetable panel targeted flag "ON" (byte [0x01] = 0x01)</nowiki>}}
  0017c148: 1440ffdb bne r2,r0,0x0017c0b8 Branch if Counter < 0x20
+
  0017c140: 24e70001 addiu r7,r7,0x0001                           |{{f/std|<nowiki>r7 = loop counter + 1</nowiki>}}
  0017c14c: 00a92821 addu r5,r5,r9 X += X Mod
+
  0017c144: 28e20020 slti r2,r7,0x0020                             |{{f/std|<nowiki>r2 = 0x01 if counter < 0x20 </nowiki>}}
  0017c150: 03e00008 jr r31
+
  0017c148: 1440ffdb bne r2,r0,0x0017c0b8     {{f/eloop|<nowiki>Loop while counter < 0x20</nowiki>}}
  0017c154: 00000000 nop
+
  0017c14c: 00a92821 addu r5,r5,r9                                 |{{f/std|<nowiki>r5 = Attack X coord + X mod</nowiki>}}
 +
  0017c150: 03e00008 jr r31                   '''END'''
 +
  0017c154: 00000000 nop                    
 +
=== Return location ===
 +
0017bee0: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf00: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf10: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf28: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf48: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf58: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf70: [[Linear/3-direction_AoE_Calculation]]
 +
0017bf90: [[Linear/3-direction_AoE_Calculation]]
 +
0017bfa0: [[Linear/3-direction_AoE_Calculation]]
 +
0017bfb8: [[Linear/3-direction_AoE_Calculation]]
 +
0017bfd8: [[Linear/3-direction_AoE_Calculation]]
 +
0017bfe8: [[Linear/3-direction_AoE_Calculation]]

Latest revision as of 21:42, 8 February 2022

0017c044 - 0017c154

Parameters: r4 = Set value = Attack direction
            r5 = Attacker X coord
            r6 = Attacker Y coord

The routine Will loop through 32 panels (max) in attack direction, setting their targeted flag (byte 0x01) "ON"  (= 0x01) if their AoE is > 0.
Note that the Ability using linear attack has their AoE = their range
----------------------------------------------------------------------------------------
0017c044: 34020002 ori r2,r0,0x0002         |r2 = 0x02 r6 = Attacker's Y coord
0017c048: 10820010 beq r4,r2,0x0017c08c     #If Direction <> 0x02 #Branch if Direction = 2
0017c04c: 28820003 slti r2,r4,0x0003             |r2 = 0x01 if r4 < 0x03
0017c050: 10400005 beq r2,r0,0x0017c068          #If Direction < 0x03 (0X00 or 0x01) #Branch if Direction >= 3
0017c054: 00000000 nop                               | 
0017c058: 1080000a beq r4,r0,0x0017c084              #If Direction <> 0x00 (= 0x01) #Branch if Direction = 0
0017c05c: 34090001 ori r9,r0,0x0001                  |r9 = 0x01 
0017c060: 0805f054 j 0x0017c150                          >>Jump to END
0017c064: 00000000 nop                                   |
0017c068: 34020004 ori r2,r0,0x0004              #Else (Direction > 0x03) r2 = 0x04
0017c06c: 1082000c beq r4,r2,0x0017c0a0              #If Direction <> 0x04 #Branch if Direction = 4
0017c070: 34020006 ori r2,r0,0x0006                  |r2 = 0x06
0017c074: 10820008 beq r4,r2,0x0017c098                  #If direction <> 0x06 (= 0x03 or 0x05) #Branch if Direction = 6
0017c078: 00004821 addu r9,r0,r0                         |r9 = 0x00
0017c07c: 0805f054 j 0x0017c150                              >>Jump to END
0017c080: 00000000 nop                                       |

                            --- Direction is set (0x00, 0x02, 0x04 or 0x06) : Now set X and Y mod ---

0017c084: 0805f02a j 0x0017c0a8             #Direction = 0x00 >>Jump to LOOP ( X mod = +1 / Y mod = 0)
0017c088: 00004021 addu r8,r0,r0                 |r8 = 0x00
0017c08c: 2409ffff addiu r9,r0,-0x0001      #Direction = 0x02 r9 = -0x01
0017c090: 0805f02a j 0x0017c0a8                  >>Jump to LOOP ( X mod = -1 / Y mod = 0)
0017c094: 00004021 addu r8,r0,r0                 |r8 = 0x00
0017c098: 0805f02a j 0x0017c0a8             #Direction = 0x06 >>Jump to LOOP ( X mod = 0 / Y mod = 1)
0017c09c: 34080001 ori r8,r0,0x0001              |r8 = 0x00
0017c0a0: 00004821 addu r9,r0,r0            #Direction = 0x04 r9 = 0x00 (X mod)
0017c0a4: 2408ffff addiu r8,r0,-0x0001           |r8 = -0x01 (Y mod)

                            --- X mod and Y mod are set : Now loop in the right direction ---

0017c0a8: 00003821 addu r7,r0,r0            |r7 = 0x00 (Loop counter)
0017c0ac: 3c0b8019 lui r11,0x8019           |
0017c0b0: 256b2dd8 addiu r11,r11,0x2dd8     |r11 = Targetable grid data pointer
0017c0b4: 340a0001 ori r10,r0,0x0001        |r10 = 0x01
0017c0b8: 04a00025 bltz r5,0x0017c150       @LOOP #If Attacker X coord is >= 0x00 /Else branch to END First iteration, it's Attacker coordinates
0017c0bc: 00000000 nop                               | 
0017c0c0: 3c03800e lui r3,0x800e                     |
0017c0c4: 90634e9c lbu r3,0x4e9c(r3)                 |r3 = Map Max X  0x800e49ec
0017c0c8: 00000000 nop                               |
0017c0cc: 00a3102a slt r2,r5,r3                      |r2 = 0x01 if Attacker X coord < Map Max X
0017c0d0: 1040001f beq r2,r0,0x0017c150              #If Attack X coord < Map Max X /Else Branch to END 
0017c0d4: 00000000 nop                                   | 
0017c0d8: 04c0001d bltz r6,0x0017c150                    #If Attack Y coord < 0x00 /Else Branch to END 
0017c0dc: 00000000 nop                                       | 
0017c0e0: 3c02800e lui r2,0x800e                             | 
0017c0e4: 90424ea0 lbu r2,0x4ea0(r2)                         |r2 = Map Max Y 0x800e4ea0
0017c0e8: 00000000 nop                                       |
0017c0ec: 00c2102a slt r2,r6,r2                              |r2 = 0x01 if Attack Y coord < Map Max Y
0017c0f0: 10400017 beq r2,r0,0x0017c150                      #If Attack Y coord < Map Max Y /Else Branch to END 
0017c0f4: 00c30018 mult r6,r3                                    |Attack Y coord * Max X
0017c0f8: 00001012 mflo r2                                       |r2 =  Attack Y coord * Max X
0017c0fc: 00452021 addu r4,r2,r5                                 |r4 =  Attack X coord + Attack Y coord * Max X = Lower elevation tile ID
0017c100: 00041080 sll r2,r4,0x02                                |r2 = Lower Tile ID * 4
0017c104: 00441021 addu r2,r2,r4                                 |r2 = Lower Tile ID * 5 (5 = Size of targetable panel data)
0017c108: 004b1821 addu r3,r2,r11                                |r3 = Lower Targetable panel data pointer
0017c10c: 90620000 lbu r2,0x0000(r3)                             |r2 =  Lower elevation panel's AoE
0017c110: 00000000 nop                                           |
0017c114: 10400002 beq r2,r0,0x0017c120                          #If Lower elevation panel's AoE <> 0x00 /Else Avoid update of panel targeted flag
0017c118: 24840100 addiu r4,r4,0x0100                            |r4 = Tile ID + 0x100 (higher elevation tile ID)
0017c11c: a06a0001 sb r10,0x0001(r3)                                 |Set Lower Targetable panel targeted flag "ON" (byte [0x01] = 0x01)
0017c120: 00041080 sll r2,r4,0x02                                |r2 = Higher Tile ID *4
0017c124: 00441021 addu r2,r2,r4                                 |r2 = Higher Tile ID *5  (5 = Size of targetable panel data)
0017c128: 004b1821 addu r3,r2,r11                                |r3 = Higher Targetable panel data pointer
0017c12c: 90620000 lbu r2,0x0000(r3)                             |r2 =  Higher elevation panel's AoE
0017c130: 00000000 nop                                           |
0017c134: 10400002 beq r2,r0,0x0017c140                          #If Lower elevation panel's AoE <> 0x00 #Branch if High AoE = 0
0017c138: 00c83021 addu r6,r6,r8                                 |r6 = Attack Y + Y mod
0017c13c: a06a0001 sb r10,0x0001(r3)                                 |Set Higher Targetable panel targeted flag "ON" (byte [0x01] = 0x01)
0017c140: 24e70001 addiu r7,r7,0x0001                            |r7 = loop counter + 1
0017c144: 28e20020 slti r2,r7,0x0020                             |r2 = 0x01 if counter < 0x20 
0017c148: 1440ffdb bne r2,r0,0x0017c0b8     Λ Loop while counter < 0x20
0017c14c: 00a92821 addu r5,r5,r9                                 |r5 = Attack X coord + X mod
0017c150: 03e00008 jr r31                   END
0017c154: 00000000 nop                      

Return location

0017bee0: Linear/3-direction_AoE_Calculation
0017bf00: Linear/3-direction_AoE_Calculation
0017bf10: Linear/3-direction_AoE_Calculation
0017bf28: Linear/3-direction_AoE_Calculation
0017bf48: Linear/3-direction_AoE_Calculation
0017bf58: Linear/3-direction_AoE_Calculation
0017bf70: Linear/3-direction_AoE_Calculation
0017bf90: Linear/3-direction_AoE_Calculation
0017bfa0: Linear/3-direction_AoE_Calculation
0017bfb8: Linear/3-direction_AoE_Calculation
0017bfd8: Linear/3-direction_AoE_Calculation
0017bfe8: Linear/3-direction_AoE_Calculation