Difference between revisions of "Status checks"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 001832cc: 27bdffe8 addiu r29,r29,0xffe8 001832d0: afb00010 sw r16,0x0010(r29) 001832d4: 00808021 addu r16,r4,r0 001832d8: afbf0014 sw r31,0x001...")
 
 
Line 1: Line 1:
<font face='Courier New'>
+
'''BATTLE.BIN''' - Status_checks
 +
---------------------------------------------------------------------------------------
 +
Parameter : r4 = unit pointer
 
   
 
   
  001832cc: 27bdffe8 addiu r29,r29,0xffe8
+
Returns : r2 = 0x01 if unit do not exist, has a frozen CT or is ridden
  001832d0: afb00010 sw r16,0x0010(r29)
+
          r2 = 0x06 if unit is dead
  001832d4: 00808021 addu r16,r4,r0
+
          r2 with flags :    
  001832d8: afbf0014 sw r31,0x0014(r29)
+
                  0x0a : Unit is sleeping
  001832dc: 92030001 lbu r3,0x0001(r16) load unit ID
+
                  0x10 : Unit has haste
  001832e0: 340200ff ori r2,r0,0x00ff
+
                  0x20 : Unit has slow
  001832e4: 1062000a beq r3,r2,0x00183310 unit exists check
+
---------------------------------------------------------------------------------------
 +
  001832cc: 27bdffe8 addiu r29,r29,-0x0018    |
 +
  001832d0: afb00010 sw r16,0x0010(r29)       |
 +
  001832d4: 00808021 addu r16,r4,r0           |{{f/adr|Pointer to Unit battle stats}}
 +
  001832d8: afbf0014 sw r31,0x0014(r29)       |
 +
  001832dc: 92030001 lbu r3,0x0001(r16)       |{{f/load|Unit ID}}
 +
  001832e0: 340200ff ori r2,r0,0x00ff         |
 +
  001832e4: 1062000a beq r3,r2,0x00183310     {{f/Cond|If Unit do not exist :}} {{f/loc| Exit and returns 0x01}}
 
  001832e8: 02002021 addu r4,r16,r0
 
  001832e8: 02002021 addu r4,r16,r0
  001832ec: 0c01786c jal 0x0005e1b0 check status, return 0x01 if status found
+
  001832ec: 0c01786c jal 0x0005e1b0           |{{f/jal|Status_Checks_(r5_%3D_set_to_check)|Status_Checks_(r5_%3D_set_to_check)}} {{f/std| Check if unit CT is frozen}}
  001832f0: 34050003 ori r5,r0,0x0003
+
  001832f0: 34050003 ori r5,r0,0x0003         |{{f/std|CT freezing statii}}
  001832f4: 1440001a bne r2,r0,0x00183360 branch if status found
+
  001832f4: 1440001a bne r2,r0,0x00183360     {{f/Cond|If Unit CT is frozen :}} {{f/loc| Exit and returns 0x01}}
 
  001832f8: 34020001 ori r2,r0,0x0001
 
  001832f8: 34020001 ori r2,r0,0x0001
  001832fc: 92020182 lbu r2,0x0182(r16) load mount info
+
  001832fc: 92020182 lbu r2,0x0182(r16)       |{{f/load|load mount info}}
  00183300: 00000000 nop
+
  00183300: 00000000 nop                     |
  00183304: 30420040 andi r2,r2,0x0040
+
  00183304: 30420040 andi r2,r2,0x0040       |{{f/std|Check if unit is being ridden}}
  00183308: 10400003 beq r2,r0,0x00183318 branch if not being ridden
+
  00183308: 10400003 beq r2,r0,0x00183318     {{f/Cond|If Unit is being ridden}}
  0018330c: 00000000 nop
+
  0018330c: 00000000 nop                         |
  00183310: 08060cd8 j 0x00183360
+
  00183310: 08060cd8 j 0x00183360                 |{{f/loc| Exit and returns 0x01}}
 
  00183314: 34020001 ori r2,r0,0x0001
 
  00183314: 34020001 ori r2,r0,0x0001
  00183318: 92020058 lbu r2,0x0058(r16)
+
  00183318: 92020058 lbu r2,0x0058(r16)       |{{f/load|Unit current Status 1}}
  0018331c: 9205005b lbu r5,0x005b(r16)
+
  0018331c: 9205005b lbu r5,0x005b(r16)       |{{f/load|Unit current Status 4}}
  00183320: 9204005c lbu r4,0x005c(r16)
+
  00183320: 9204005c lbu r4,0x005c(r16)       |{{f/load|Unit current Status 5}}
  00183324: 30420020 andi r2,r2,0x0020
+
  00183324: 30420020 andi r2,r2,0x0020       |{{f/std|check [Dead]}}
  00183328: 1440000d bne r2,r0,0x00183360 branch if dead
+
  00183328: 1440000d bne r2,r0,0x00183360     {{f/Cond|If Unit is Dead :}} {{f/loc| Exit and returns 0x06}}
  0018332c: 34020006 ori r2,r0,0x0006 return 0x06
+
  0018332c: 34020006 ori r2,r0,0x0006
  00183330: 30820010 andi r2,r4,0x0010 sleep check
+
  00183330: 30820010 andi r2,r4,0x0010       |{{f/std|check [Sleep]}}
  00183334: 0002102b sltu r2,r0,r2
+
  00183334: 0002102b sltu r2,r0,r2           |{{f/std|1 if sleep, else 0}}
  00183338: 00021023 subu r2,r0,r2
+
  00183338: 00021023 subu r2,r0,r2           |{{f/std|0xff if sleep else 0}}
  0018333c: 3043000a andi r3,r2,0x000a
+
  0018333c: 3043000a andi r3,r2,0x000a       |{{f/std|0x0a if sleep, else 0}}
  00183340: 30a20008 andi r2,r5,0x0008
+
  00183340: 30a20008 andi r2,r5,0x0008       |{{f/std|check [Haste]}}
  00183344: 10400002 beq r2,r0,0x00183350 branch if not haste
+
  00183344: 10400002 beq r2,r0,0x00183350     {{f/Cond|If Unit has haste}}
  00183348: 30a20004 andi r2,r5,0x0004
+
  00183348: 30a20004 andi r2,r5,0x0004       |{{f/std|check [slow]}}
  0018334c: 34630010 ori r3,r3,0x0010
+
  0018334c: 34630010 ori r3,r3,0x0010             |{{f/std|Enable 0x10 on r3}}
  00183350: 10400003 beq r2,r0,0x00183360 branch if not slow
+
  00183350: 10400003 beq r2,r0,0x00183360     {{f/Cond|If unit has slow}}
  00183354: 00601021 addu r2,r3,r0
+
  00183354: 00601021 addu r2,r3,r0               |
  00183358: 34630020 ori r3,r3,0x0020
+
  00183358: 34630020 ori r3,r3,0x0020             |{{f/std|Enable 0x20 on r3}}
  0018335c: 00601021 addu r2,r3,r0 return r3
+
  0018335c: 00601021 addu r2,r3,r0           |{{f/std|return r3}}
  00183360: 8fbf0014 lw r31,0x0014(r29)
+
  00183360: 8fbf0014 lw r31,0x0014(r29)       END
 
  00183364: 8fb00010 lw r16,0x0010(r29)
 
  00183364: 8fb00010 lw r16,0x0010(r29)
 
  00183368: 27bd0018 addiu r29,r29,0x0018
 
  00183368: 27bd0018 addiu r29,r29,0x0018
 
  0018336c: 03e00008 jr r31
 
  0018336c: 03e00008 jr r31
 
  00183370: 00000000 nop
 
  00183370: 00000000 nop
</font>
+
===Return location===
 +
'''Battle.bin'''
 +
000725e0: [[00072544_-_00072670]]
 +
001829cc: [[In_between_turn_control_routine]]
 +
00182a5c: [[In_between_turn_control_routine]]
 +
00182b4c: [[In_between_turn_control_routine]]
 +
00182bbc: [[In_between_turn_control_routine]]
 +
00182c1c: [[In_between_turn_control_routine]]
 +
00182da8: [[In_between_turn_control_routine]]
 +
00182e24: [[In_between_turn_control_routine]]
 +
00183dac: [[Change_of_Turn_check]]

Latest revision as of 09:20, 1 August 2023

BATTLE.BIN - Status_checks
---------------------------------------------------------------------------------------
Parameter : r4 = unit pointer	

Returns : r2 = 0x01 if unit do not exist, has a frozen CT or is ridden
          r2 = 0x06 if unit is dead
          r2 with flags :		     
                  0x0a : Unit is sleeping
                  0x10 : Unit has haste
                  0x20 : Unit has slow
---------------------------------------------------------------------------------------
001832cc: 27bdffe8 addiu r29,r29,-0x0018    |
001832d0: afb00010 sw r16,0x0010(r29)       |
001832d4: 00808021 addu r16,r4,r0           |Pointer to Unit battle stats
001832d8: afbf0014 sw r31,0x0014(r29)       |
001832dc: 92030001 lbu r3,0x0001(r16)       |Unit ID
001832e0: 340200ff ori r2,r0,0x00ff         |
001832e4: 1062000a beq r3,r2,0x00183310     #If Unit do not exist :  Exit and returns 0x01
001832e8: 02002021 addu r4,r16,r0
001832ec: 0c01786c jal 0x0005e1b0           |-->Status_Checks_(r5_%3D_set_to_check)  Check if unit CT is frozen
001832f0: 34050003 ori r5,r0,0x0003         |CT freezing statii
001832f4: 1440001a bne r2,r0,0x00183360     #If Unit CT is frozen :  Exit and returns 0x01
001832f8: 34020001 ori r2,r0,0x0001
001832fc: 92020182 lbu r2,0x0182(r16)       |load mount info
00183300: 00000000 nop                      |
00183304: 30420040 andi r2,r2,0x0040        |Check if unit is being ridden
00183308: 10400003 beq r2,r0,0x00183318     #If Unit is being ridden
0018330c: 00000000 nop                          |
00183310: 08060cd8 j 0x00183360                 | Exit and returns 0x01
00183314: 34020001 ori r2,r0,0x0001
00183318: 92020058 lbu r2,0x0058(r16)       |Unit current Status 1
0018331c: 9205005b lbu r5,0x005b(r16)       |Unit current Status 4
00183320: 9204005c lbu r4,0x005c(r16)       |Unit current Status 5
00183324: 30420020 andi r2,r2,0x0020        |check [Dead]
00183328: 1440000d bne r2,r0,0x00183360     #If Unit is Dead :  Exit and returns 0x06
0018332c: 34020006 ori r2,r0,0x0006
00183330: 30820010 andi r2,r4,0x0010        |check [Sleep]
00183334: 0002102b sltu r2,r0,r2            |1 if sleep, else 0
00183338: 00021023 subu r2,r0,r2            |0xff if sleep else 0
0018333c: 3043000a andi r3,r2,0x000a        |0x0a if sleep, else 0
00183340: 30a20008 andi r2,r5,0x0008        |check [Haste]
00183344: 10400002 beq r2,r0,0x00183350     #If Unit has haste
00183348: 30a20004 andi r2,r5,0x0004        |check [slow]
0018334c: 34630010 ori r3,r3,0x0010             |Enable 0x10 on r3
00183350: 10400003 beq r2,r0,0x00183360     #If unit has slow
00183354: 00601021 addu r2,r3,r0                |
00183358: 34630020 ori r3,r3,0x0020             |Enable 0x20 on r3
0018335c: 00601021 addu r2,r3,r0            |return r3
00183360: 8fbf0014 lw r31,0x0014(r29)       END
00183364: 8fb00010 lw r16,0x0010(r29)
00183368: 27bd0018 addiu r29,r29,0x0018
0018336c: 03e00008 jr r31
00183370: 00000000 nop

Return location

Battle.bin
000725e0: 00072544_-_00072670
001829cc: In_between_turn_control_routine
00182a5c: In_between_turn_control_routine
00182b4c: In_between_turn_control_routine
00182bbc: In_between_turn_control_routine
00182c1c: In_between_turn_control_routine
00182da8: In_between_turn_control_routine
00182e24: In_between_turn_control_routine
00183dac: Change_of_Turn_check