Status Checks (r5 = set to check)

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Duplicated here Does_Unit_Have_Status_In_Set

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 - across statuses set  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

001743f8: Chocobo Check                             (r5 = 0x0A)
001832f4: Status_checks                             (r5 = 0x03)
001833e4: Gameover_by_party_incapacitated           (r5 = 0x01)
0018345c: Check_Battle_Outcome                      (r5 = 0x01)
0018c984: Check_if_unit_can_react?                  (r5 = 0x04)
0018dd88: Move-HP Up, Move-MP Up, Gained Exp Up     (r5 = 0x04)
0018e790: Learn_on_hit_1                            (r5 = 0x04)
0019b608: Monster_Skill_Use_Check                   (r5 = 0x04)
0019cc34: Some_height/Map_coordinate_calculation_for_all_units  (r5 = 0x04)