Difference between revisions of "Count number of targets hit by ability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0018ee24: 00002821 addu r5,r0,r0 0018ee28: 00001821 addu r3,r0,r0 0018ee2c: 340600ff ori r6,r0,0x00ff 0018ee30: 3c018019 lui r1,0x8019 0018ee3...")
 
Line 1: Line 1:
<font face='Courier New'>
+
'''Parameters''' : r4 = misc attacker data 0x18e
 
   
 
   
  0018ee24: 00002821 addu r5,r0,r0
+
'''Returns''': r2 = Target/Hit counter
  0018ee28: 00001821 addu r3,r0,r0
+
  0018ee2c: 340600ff ori r6,r0,0x00ff
+
'''Store''' : List of Targets ID at Attacker misc data 0x16e to 0x17d (from list at 0x80193868 )
  0018ee30: 3c018019 lui r1,0x8019
+
--------------------------------------------------------------------------------------------------
  0018ee34: 00230821 addu r1,r1,r3
+
  0018ee24: 00002821 addu r5,r0,r0           |{{f/std|<nowiki>r5 = 0x00</nowiki>}}
  0018ee38: 90223868 lbu r2,0x3868(r1) load targets hit
+
  0018ee28: 00001821 addu r3,r0,r0           |{{f/std|<nowiki>r3 = 0x00</nowiki>}}
  0018ee3c: 00000000 nop
+
  0018ee2c: 340600ff ori r6,r0,0x00ff         |{{f/std|<nowiki>r6 = 0x00ff</nowiki>}}
  0018ee40: a0820000 sb r2,0x0000(r4) store into misc. unit data, 0x18e
+
  0018ee30: 3c018019 lui r1,0x8019           {{f/bloop|<nowiki>LOOP</nowiki>}}
  0018ee44: 10460002 beq r2,r6,0x0018ee50
+
  0018ee34: 00230821 addu r1,r1,r3                 |{{f/std|<nowiki>r1 = 0x8019 0000 + loop counter</nowiki>}}
  0018ee48: 24840001 addiu r4,r4,0x0001
+
  0018ee38: 90223868 lbu r2,0x3868(r1)             |{{f/load|<nowiki>r2 = this iteration Targeted unit ( 0x80193868 + loop offset)</nowiki>}}
  0018ee4c: 24a50001 addiu r5,r5,0x0001 hit counter++
+
  0018ee3c: 00000000 nop                           |
  0018ee50: 24630001 addiu r3,r3,0x0001
+
  0018ee40: a0820000 sb r2,0x0000(r4)             |{{f/store|<nowiki>Store targeted unit ID in Attacker misc data 0x18e (+loop offset)</nowiki>}}
  0018ee54: 28620010 slti r2,r3,0x0010
+
  0018ee44: 10460002 beq r2,r6,0x0018ee50         {{f/Cond|<nowiki>if This iteration target ID = 0xff</nowiki>}}
  0018ee58: 1440fff5 bne r2,r0,0x0018ee30
+
  0018ee48: 24840001 addiu r4,r4,0x0001           |{{f/std|<nowiki>r4 = Attacker misc data offset counter (+0x01 each iteration)</nowiki>}}
  0018ee5c: 00000000 nop
+
  0018ee4c: 24a50001 addiu r5,r5,0x0001               |{{f/std|<nowiki>r5 = Target counter</nowiki>}}
  0018ee60: 03e00008 jr r31
+
  0018ee50: 24630001 addiu r3,r3,0x0001           |{{f/std|<nowiki>r3 = Loop counter + 1</nowiki>}}
  0018ee64: 00a01021 addu r2,r5,r0 return hit counter
+
  0018ee54: 28620010 slti r2,r3,0x0010             |{{f/std|<nowiki>r2 = 0x01 while counter < 0x10</nowiki>}}
</font>
+
  0018ee58: 1440fff5 bne r2,r0,0x0018ee30     {{f/eloop|<nowiki>Loop 0x10 times (size of list on 0x80193868 )</nowiki>}} {{f/std|<nowiki> contains only 0x10 units (0x14 targets available)</nowiki>}}
 +
  0018ee5c: 00000000 nop                           |
 +
  0018ee60: 03e00008 jr r31                   {{f/jump|<nowiki>END</nowiki>}}
 +
  0018ee64: 00a01021 addu r2,r5,r0           |{{f/std|<nowiki>return r2 = Target/Hit counter</nowiki>}}
 +
=== Return location ===
 +
  0017d0e0: [[Main_ability_loading_routine%3F]]

Revision as of 20:54, 16 February 2022

Parameters : r4 = misc attacker data 0x18e

Returns: r2 = Target/Hit counter

Store : List of Targets ID at Attacker misc data 0x16e to 0x17d (from list at 0x80193868 )
--------------------------------------------------------------------------------------------------
0018ee24: 00002821 addu r5,r0,r0            |r5 = 0x00
0018ee28: 00001821 addu r3,r0,r0            |r3 = 0x00
0018ee2c: 340600ff ori r6,r0,0x00ff         |r6 = 0x00ff
0018ee30: 3c018019 lui r1,0x8019            @LOOP
0018ee34: 00230821 addu r1,r1,r3                 |r1 = 0x8019 0000 + loop counter
0018ee38: 90223868 lbu r2,0x3868(r1)             |r2 = this iteration Targeted unit ( 0x80193868 + loop offset)
0018ee3c: 00000000 nop                           |
0018ee40: a0820000 sb r2,0x0000(r4)              |Store targeted unit ID in Attacker misc data 0x18e (+loop offset)
0018ee44: 10460002 beq r2,r6,0x0018ee50          #if This iteration target ID = 0xff
0018ee48: 24840001 addiu r4,r4,0x0001            |r4 = Attacker misc data offset counter (+0x01 each iteration)
0018ee4c: 24a50001 addiu r5,r5,0x0001                |r5 = Target counter
0018ee50: 24630001 addiu r3,r3,0x0001            |r3 = Loop counter + 1
0018ee54: 28620010 slti r2,r3,0x0010             |r2 = 0x01 while counter < 0x10
0018ee58: 1440fff5 bne r2,r0,0x0018ee30     Λ Loop 0x10 times (size of list on 0x80193868 )  contains only 0x10 units (0x14 targets available)
0018ee5c: 00000000 nop                           |
0018ee60: 03e00008 jr r31                   >>END
0018ee64: 00a01021 addu r2,r5,r0            |return r2 = Target/Hit counter

Return location

 0017d0e0: Main_ability_loading_routine?