Difference between revisions of "Status Checks (r5 = set to check)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
  Status Checks (r5 = set to check)
+
  r5 = set to check  
  0005e1b0: 00003021 addu r6,r0,r0 Counter = 0
+
r4 = target data pointer   
  0005e1b4: 3c038006 lui r3,0x8006
+
Returns r2 = 0x01 if target has one of the checked statuses, else 0x00
  0005e1b8: 246362d0 addiu r3,r3,0x62d0
+
---------------------------------------------------------------------------------------------------
  0005e1bc: 00051080 sll r2,r5,0x02 Preset Value * 4
+
  0005e1b0: 00003021 addu r6,r0,r0           |{{f/std|<nowiki>r6 = 0x00 (loop counter)</nowiki>}}
  0005e1c0: 00451021 addu r2,r2,r5 Preset Value * 5
+
  0005e1b4: 3c038006 lui r3,0x8006           |
  0005e1c4: 00432821 addu r5,r2,r3
+
  0005e1b8: 246362d0 addiu r3,r3,0x62d0       |{{f/std|<nowiki>r3 = 800662d0</nowiki>}}
  0005e1c8: 00861021 addu r2,r4,r6
+
  0005e1bc: 00051080 sll r2,r5,0x02           |{{f/std|<nowiki>Preset Value * 4</nowiki>}}
  0005e1cc: 90420058 lbu r2,0x0058(r2) Load Unit's Current Statuses 1
+
  0005e1c0: 00451021 addu r2,r2,r5           |{{f/std|<nowiki>Preset Value * 5</nowiki>}}
  0005e1d0: 90a30000 lbu r3,0x0000(r5) Load Statuses to check against
+
  0005e1c4: 00432821 addu r5,r2,r3           |{{f/std|<nowiki>r5 = 800662d0 + preset value *5</nowiki>}}
  0005e1d4: 00000000 nop
+
  0005e1c8: 00861021 addu r2,r4,r6           {{f/bloop|<nowiki> LOOP</nowiki>}} {{f/std|<nowiki>r2 = target data pointer + loop counter</nowiki>}}
  0005e1d8: 00431024 and r2,r2,r3
+
  0005e1cc: 90420058 lbu r2,0x0058(r2)             |{{f/load|<nowiki>r2 = target current status set X (X = loop counter)</nowiki>}}
  0005e1dc: 14400006 bne r2,r0,0x0005e1f8 Branch if Unit has loaded statuses
+
  0005e1d0: 90a30000 lbu r3,0x0000(r5)             |{{f/load|<nowiki>r3 = statuses to check</nowiki>}} {{f/jal|Status_Check_table_-_0x800662d0|<nowiki>Status_Check_table_-_0x800662d0</nowiki>}}
  0005e1e0: 34020001 ori r2,r0,0x0001 r2 = 1 (statuses found)
+
  0005e1d4: 00000000 nop                           |
  0005e1e4: 24c60001 addiu r6,r6,0x0001 Counter ++
+
  0005e1d8: 00431024 and r2,r2,r3                 |{{f/std|<nowiki>r2 <> 0x00 if target as one of the checked statuses</nowiki>}}
  0005e1e8: 28c20005 slti r2,r6,0x0005
+
  0005e1dc: 14400006 bne r2,r0,0x0005e1f8         {{f/Cond|<nowiki>If none of the checked status is found </nowiki>}} /If target has one of the statuses {{f/loc|<nowiki>branch to end (with r2 = 0x01)</nowiki>}}
  0005e1ec: 1440fff6 bne r2,r0,0x0005e1c8 Branch if Counter < 5
+
  0005e1e0: 34020001 ori r2,r0,0x0001             |{{f/std|<nowiki>r2 = 1 (statuses found)</nowiki>}}
  0005e1f0: 24a50001 addiu r5,r5,0x0001 Status Pointer += 1
+
  0005e1e4: 24c60001 addiu r6,r6,0x0001               |{{f/std|<nowiki>Loop counter + 1 </nowiki>}}
  0005e1f4: 00001021 addu r2,r0,r0 r2 = 0 (statuses not found)
+
  0005e1e8: 28c20005 slti r2,r6,0x0005                 |{{f/std|<nowiki>r2 = 0x01 if counter < 0x05 - else 0x00</nowiki>}}
  0005e1f8: 03e00008 jr r31
+
  0005e1ec: 1440fff6 bne r2,r0,0x0005e1c8     {{f/eloop|<nowiki>Loop while counter < 0x05 </nowiki>}} /Else goto r2 = 0x00 then exit the routine
 +
  0005e1f0: 24a50001 addiu r5,r5,0x0001           |{{f/std|<nowiki>Checking status pointer +1</nowiki>}}
 +
  0005e1f4: 00001021 addu r2,r0,r0           |{{f/std|<nowiki>r2 = 0 (statuses not found)</nowiki>}}
 +
  0005e1f8: 03e00008 jr r31                  
 
  0005e1fc: 00000000 nop
 
  0005e1fc: 00000000 nop
 
 
  
 
== Return Locations ==
 
== Return Locations ==

Revision as of 13:05, 27 November 2021

r5 = set to check 
r4 = target data pointer    
Returns r2 = 0x01 if target has one of the checked statuses, else 0x00
---------------------------------------------------------------------------------------------------
0005e1b0: 00003021 addu r6,r0,r0            |r6 = 0x00 (loop counter)
0005e1b4: 3c038006 lui r3,0x8006            |
0005e1b8: 246362d0 addiu r3,r3,0x62d0       |r3 = 800662d0
0005e1bc: 00051080 sll r2,r5,0x02           |Preset Value * 4
0005e1c0: 00451021 addu r2,r2,r5            |Preset Value * 5
0005e1c4: 00432821 addu r5,r2,r3            |r5 = 800662d0 + preset value *5
0005e1c8: 00861021 addu r2,r4,r6            @ LOOP r2 = target data pointer + loop counter
0005e1cc: 90420058 lbu r2,0x0058(r2)             |r2 = target current status set X (X = loop counter)
0005e1d0: 90a30000 lbu r3,0x0000(r5)             |r3 = statuses to check -->Status_Check_table_-_0x800662d0
0005e1d4: 00000000 nop                           |
0005e1d8: 00431024 and r2,r2,r3                  |r2 <> 0x00 if target as one of the checked statuses
0005e1dc: 14400006 bne r2,r0,0x0005e1f8          #If none of the checked status is found  /If target has one of the statuses branch to end (with r2 = 0x01)
0005e1e0: 34020001 ori r2,r0,0x0001              |r2 = 1 (statuses found)
0005e1e4: 24c60001 addiu r6,r6,0x0001                |Loop counter + 1 
0005e1e8: 28c20005 slti r2,r6,0x0005                 |r2 = 0x01 if counter < 0x05 - else 0x00
0005e1ec: 1440fff6 bne r2,r0,0x0005e1c8     Λ Loop while counter < 0x05  /Else goto r2 = 0x00 then exit the routine
0005e1f0: 24a50001 addiu r5,r5,0x0001            |Checking status pointer +1
0005e1f4: 00001021 addu r2,r0,r0            |r2 = 0 (statuses not found)
0005e1f8: 03e00008 jr r31                   
0005e1fc: 00000000 nop

Return Locations

001743f0: Chocobo Check
001832ec:
001833dc:
00183454:
0018c97c:
0018dd80: Move-HP Up, Move-MP Up, Gained Exp Up
0018e788:
0019b600: 
0019cc2c: