Difference between revisions of "Remove charging status/ability CT"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 00180178: 27bdffe8 addiu r29,r29,0xffe8 0018017c: afbf0010 sw r31,0x0010(r29) 00180180: 90820058 lbu r2,0x0058(r4) load status 00180184: 0000...")
 
m
 
Line 1: Line 1:
<font face='Courier New'>
+
Parameter r4 = Unit data pointer
   
+
          r5 = Disabling charge flag (0x00 if not disabling)
  00180178: 27bdffe8 addiu r29,r29,0xffe8
+
 
  0018017c: afbf0010 sw r31,0x0010(r29)
+
Returns : r2 = 0x00 if unit is not charging via charge skillset
  00180180: 90820058 lbu r2,0x0058(r4) load status
+
          r2 = 0x01 if unit is charging via charge skillset
  00180184: 00000000 nop
+
          r2 = 0x01 if unit is ridden by a unit charging via charge skillset
  00180188: 30420008 andi r2,r2,0x0008
+
  ------------------------------------------------------------------------------------------------------------
  0018018c: 1040000f beq r2,r0,0x001801cc branch if not charging
+
  00180178: 27bdffe8 addiu r29,r29,-0x0018    |
  00180190: 340200ff ori r2,r0,0x00ff
+
  0018017c: afbf0010 sw r31,0x0010(r29)       |
  00180194: 9083015d lbu r3,0x015d(r4) load ability CT
+
  00180180: 90820058 lbu r2,0x0058(r4)       |{{f/load|Load 1st set of Unit current status}}
  00180198: 00000000 nop
+
  00180184: 00000000 nop                     |
  0018019c: 1062000b beq r3,r2,0x001801cc branch if not charging ability
+
  00180188: 30420008 andi r2,r2,0x0008       |{{f/std|Check for charging}}
  001801a0: 34020008 ori r2,r0,0x0008
+
  0018018c: 1040000f beq r2,r0,0x001801cc     {{f/Cond|If Unit Is charging }}
  001801a4: 9083016f lbu r3,0x016f(r4) load skillset of attack
+
  00180190: 340200ff ori r2,r0,0x00ff             |{{f/std|<nowiki>r2 = 0x00ff</nowiki>}}
  001801a8: 00000000 nop
+
  00180194: 9083015d lbu r3,0x015d(r4)           |{{f/load|Load Unit current Ability CT}}
  001801ac: 14620007 bne r3,r2,0x001801cc branch if not charge
+
  00180198: 00000000 nop                         |
  001801b0: 00000000 nop
+
  0018019c: 1062000b beq r3,r2,0x001801cc         {{f/Cond|If Current ability has a CT }} (not 0x00ff)
  001801b4: 10a00012 beq r5,r0,0x00180200 branch if preset value is 0
+
  001801a0: 34020008 ori r2,r0,0x0008                 |{{f/std|<nowiki>r2 = 0x0008 (charge skillset ID)</nowiki>}}
  001801b8: 34020001 ori r2,r0,0x0001
+
  001801a4: 9083016f lbu r3,0x016f(r4)               |{{f/load|load skillset of attack}}
  001801bc: 0c060084 jal 0x00180210 disable charging status?
+
  001801a8: 00000000 nop                             |
  001801c0: 00000000 nop
+
  001801ac: 14620007 bne r3,r2,0x001801cc             {{f/Cond|If Skillset is Charge}}
  001801c4: 08060080 j 0x00180200
+
  001801b0: 00000000 nop                                 |
  001801c8: 34020001 ori r2,r0,0x0001 return r2 = 1
+
  001801b4: 10a00012 beq r5,r0,0x00180200                 {{f/Cond|If disabling flag is ON (parameter r5 <>  0x00)}} Else branch to END with r2 = 0x01
  001801cc: 90830182 lbu r3,0x0182(r4) load mount flags
+
  001801b8: 34020001 ori r2,r0,0x0001                     |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  001801d0: 00000000 nop
+
  001801bc: 0c060084 jal 0x00180210                           |{{f/jal|Disable_acting_statuses|Disable_acting_statuses}}
  001801d4: 30620040 andi r2,r3,0x0040
+
  001801c0: 00000000 nop                                     |
  001801d8: 10400008 beq r2,r0,0x001801fc branch if not being ridden
+
  001801c4: 08060080 j 0x00180200                             {{f/jump|<nowiki>Jump to END with r2 = 0x01</nowiki>}}
  001801dc: 3062001f andi r2,r3,0x001f r2 = ID of riding unit
+
  001801c8: 34020001 ori r2,r0,0x0001                         |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  001801e0: 000218c0 sll r3,r2,0x03
+
                                            {{f/Cond|Else : Unit is not charging}}
  001801e4: 00621823 subu r3,r3,r2
+
  001801cc: 90830182 lbu r3,0x0182(r4)           |{{f/load|Load Unit mount info}}
  001801e8: 00031980 sll r3,r3,0x06
+
  001801d0: 00000000 nop                         |
  001801ec: 3c028019 lui r2,0x8019
+
  001801d4: 30620040 andi r2,r3,0x0040           |{{f/std|Check if unit is being ridden}}
  001801f0: 244208cc addiu r2,r2,0x08cc
+
  001801d8: 10400008 beq r2,r0,0x001801fc         {{f/Cond|If Unit is being ridden}}
  001801f4: 08060060 j 0x00180180 redo routine for riding unit
+
  001801dc: 3062001f andi r2,r3,0x001f               |{{f/std|Load ID of the ridding unit}}
  001801f8: 00622021 addu r4,r3,r2
+
  001801e0: 000218c0 sll r3,r2,0x03                   |{{f/std|ID * 8}}
  001801fc: 00001021 addu r2,r0,r0 return 0x00 (not charging?)
+
  001801e4: 00621823 subu r3,r3,r2                   |{{f/std|ID * 7}}
  00180200: 8fbf0010 lw r31,0x0010(r29)
+
  001801e8: 00031980 sll r3,r3,0x06                   |{{f/std|ID * 448 (unit table data size)}}
 +
  001801ec: 3c028019 lui r2,0x8019                   |
 +
  001801f0: 244208cc addiu r2,r2,0x08cc               |
 +
  001801f4: 08060060 j 0x00180180                     {{f/jump|Jump back with ridding unit ID and check for charging via charge skillset}}
 +
  001801f8: 00622021 addu r4,r3,r2                   |{{f/std|<nowiki>r4 = Rdding unit data pointer</nowiki>}}
 +
                                                {{f/Cond|Else : Unit is not being ridden}}
 +
  001801fc: 00001021 addu r2,r0,r0                   |{{f/std|Return 0x00 (not charging?)}}
 +
  00180200: 8fbf0010 lw r31,0x0010(r29)       END
 
  00180204: 27bd0018 addiu r29,r29,0x0018
 
  00180204: 27bd0018 addiu r29,r29,0x0018
 
  00180208: 03e00008 jr r31
 
  00180208: 03e00008 jr r31
 
  0018020c: 00000000 nop
 
  0018020c: 00000000 nop
</font>
+
=== Return location ===
 +
'''Battle.bin'''
 +
000722bc: [[Main_Post_Movement]]                              r5 = 0x01
 +
00180100: [[Set_target_for_mounted_unit,_move_find_item/trap]] r5 = 0x00
 +
0018c494: [[Attack_Finalisation_%26_Reaction_Flagging|Attack Finalisation & Reaction Flagging]]          r5 = 0x00

Latest revision as of 21:29, 22 November 2022

Parameter r4 = Unit data pointer
          r5 = Disabling charge flag (0x00 if not disabling)
		  
Returns : r2 = 0x00 if unit is not charging via charge skillset
          r2 = 0x01 if unit is charging via charge skillset
          r2 = 0x01 if unit is ridden by a unit charging via charge skillset
------------------------------------------------------------------------------------------------------------
00180178: 27bdffe8 addiu r29,r29,-0x0018    |
0018017c: afbf0010 sw r31,0x0010(r29)       |
00180180: 90820058 lbu r2,0x0058(r4)        |Load 1st set of Unit current status
00180184: 00000000 nop                      |
00180188: 30420008 andi r2,r2,0x0008        |Check for charging
0018018c: 1040000f beq r2,r0,0x001801cc     #If Unit Is charging 
00180190: 340200ff ori r2,r0,0x00ff             |r2 = 0x00ff
00180194: 9083015d lbu r3,0x015d(r4)            |Load Unit current Ability CT
00180198: 00000000 nop                          |
0018019c: 1062000b beq r3,r2,0x001801cc         #If Current ability has a CT  (not 0x00ff)
001801a0: 34020008 ori r2,r0,0x0008                 |r2 = 0x0008 (charge skillset ID)
001801a4: 9083016f lbu r3,0x016f(r4)                |load skillset of attack
001801a8: 00000000 nop                              |
001801ac: 14620007 bne r3,r2,0x001801cc             #If Skillset is Charge
001801b0: 00000000 nop                                  |
001801b4: 10a00012 beq r5,r0,0x00180200                 #If disabling flag is ON (parameter r5 <>  0x00) Else branch to END with r2 = 0x01
001801b8: 34020001 ori r2,r0,0x0001                     |r2 = 0x01
001801bc: 0c060084 jal 0x00180210                           |-->Disable_acting_statuses
001801c0: 00000000 nop                                      |
001801c4: 08060080 j 0x00180200                             >>Jump to END with r2 = 0x01
001801c8: 34020001 ori r2,r0,0x0001                         |r2 = 0x01
                                            #Else : Unit is not charging
001801cc: 90830182 lbu r3,0x0182(r4)            |Load Unit mount info
001801d0: 00000000 nop                          |
001801d4: 30620040 andi r2,r3,0x0040            |Check if unit is being ridden
001801d8: 10400008 beq r2,r0,0x001801fc         #If Unit is being ridden
001801dc: 3062001f andi r2,r3,0x001f                |Load ID of the ridding unit
001801e0: 000218c0 sll r3,r2,0x03                   |ID * 8
001801e4: 00621823 subu r3,r3,r2                    |ID * 7
001801e8: 00031980 sll r3,r3,0x06                   |ID * 448 (unit table data size)
001801ec: 3c028019 lui r2,0x8019                    |
001801f0: 244208cc addiu r2,r2,0x08cc               |
001801f4: 08060060 j 0x00180180                     >>Jump back with ridding unit ID and check for charging via charge skillset
001801f8: 00622021 addu r4,r3,r2                    |r4 = Rdding unit data pointer
                                                #Else : Unit is not being ridden
001801fc: 00001021 addu r2,r0,r0                    |Return 0x00 (not charging?)
00180200: 8fbf0010 lw r31,0x0010(r29)       END
00180204: 27bd0018 addiu r29,r29,0x0018
00180208: 03e00008 jr r31
0018020c: 00000000 nop

Return location

Battle.bin
000722bc: Main_Post_Movement                               r5 = 0x01
00180100: Set_target_for_mounted_unit,_move_find_item/trap r5 = 0x00
0018c494: Attack Finalisation & Reaction Flagging          r5 = 0x00