Difference between revisions of "25 Equipped: Break Hit (PA+WP+X)%"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
  [25]
 
  [25]
  001896ec: 27bdffe8 addiu r29,r29,0xffe8
+
  001896ec: 27bdffe8 addiu r29,r29,0xffe8     |
  001896f0: afbf0010 sw r31,0x0010(r29)
+
  001896f0: afbf0010 sw r31,0x0010(r29)       |
  001896f4: 0c061e72 jal 0x 001879c8      [[Steal/Break/Might Sword Hard Coding]]
+
  001896f4: 0c061e72 jal 0x001879c8          |{{f/jal|Steal/Break/Might Sword Hard Coding|Steal/Break/Might Sword Hard Coding}} Choose Item to break (from Ability ID), If ok : store item ID (Action 0x03) and set Action remove item flag (Action 0x19)
  001896f8: 00000000 nop
+
  001896f8: 00000000 nop                     |
  001896fc: 10400007 beq r2,r0,0x 0018971c Branch if successful
+
  001896fc: 10400007 beq r2,r0,0x0018971c    {{f/Cond|If No item to break / wrong ability}}
  00189700: 34020001 ori r2,r0,0x0001
+
  00189700: 34020001 ori r2,r0,0x0001             |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  00189704: 3c018019 lui r1,0x8019
+
  00189704: 3c018019 lui r1,0x8019               |
  00189708: a02238e9 sb r2,0x38e9(r1)         Default to attack flag - Yes
+
  00189708: a02238e9 sb r2,0x38e9(r1)             |{{f/store|Enable Current Ability Default to Attack flag}} {{f/std|          0x801938e9 / 801938e9}}
  0018970c: 0c062b56 jal 0x 0018ad58      [[Double WP if two hands is equipped?]] <-- actually is routine to do damage instead
+
  0018970c: 0c062b56 jal 0x0018ad58              |{{f/jal|Switch_Ability_to_default_Attack|Switch_Ability_to_default_Attack}} Perform a normal attack instead of used ability
  00189710: 00000000 nop
+
  00189710: 00000000 nop                         |
  00189714: 080625e1 j 0x 00189784 Jump to end
+
  00189714: 080625e1 j 0x00189784                {{f/jump|Jump to }} {{f/loc|END}}
  00189718: 00000000 nop
+
  00189718: 00000000 nop                         |
  0018971c: 3c018019 lui r1,0x8019
+
  0018971c: 3c018019 lui r1,0x8019           |
  00189720: a02038e9 sb r0,0x38e9(r1)         Default to attack flag - No
+
  00189720: a02038e9 sb r0,0x38e9(r1)         |{{f/store|Clear Current Ability Default to Attack flag}}
  00189724: 0c062144 jal 0x 00188510      [[Physical Evade Calculation]]
+
  00189724: 0c062144 jal 0x00188510          |{{f/jal|Physical Evade Calculation|Physical Evade Calculation}}  If Abillity is evadeable roll Ability Evade byte against Ability base Hit - Returns r2
  00189728: 00000000 nop
+
  00189728: 00000000 nop                     |
  0018972c: 14400015 bne r2,r0,0x 00189784 Branch to end if evaded
+
  0018972c: 14400015 bne r2,r0,0x00189784    {{f/Cond|If Attack is not Evaded}}
  00189730: 00000000 nop
+
  00189730: 00000000 nop                         |
  00189734: 0c061797 jal 0x 00185e5c      [[Store PA and WP + Y]]
+
  00189734: 0c061797 jal 0x00185e5c              |{{f/jal|Store PA and WP + Y|Store PA and WP + Y}}  XA is Attacker's PA and YA is WP + Y
  00189738: 00000000 nop
+
  00189738: 00000000 nop                         |
  0018973c: 0c0621b5 jal 0x 001886d4      [[Routine used in formula 2B]]
+
  0018973c: 0c0621b5 jal 0x001886d4              |{{f/jal|Calculate_Accuracy_for_Physical|Calculate_Accuracy_for_Physical}}  Modify XA and YA (physical) and uses XA+YA as hit% - Returns r2
  00189740: 00000000 nop
+
  00189740: 00000000 nop                         |
  00189744: 10400005 beq r2,r0,0x 0018975c Branch if successful
+
  00189744: 10400005 beq r2,r0,0x0018975c        {{f/Cond|If Attack miss}}
  00189748: 00000000 nop
+
  00189748: 00000000 nop                             |
  0018974c: 3c028019 lui r2,0x8019
+
  0018974c: 3c028019 lui r2,0x8019                   |
  00189750: 8c422d90 lw r2,0x2d90(r2)
+
  00189750: 8c422d90 lw r2,0x2d90(r2)                 |{{f/adr|<nowiki>r2 = Target Current Action (TCA) data pointer</nowiki>}}
  00189754: 080625e1 j 0x 00189784                      Jump to end
+
  00189754: 080625e1 j 0x00189784                    {{f/jump|Jump to }} {{f/loc|END}}
  00189758: a4400010 sh r0,0x0010(r2)         Store fail
+
  00189758: a4400010 sh r0,0x0010(r2)                 |{{f/store|Clear TCA Specials flags}}
  0018975c: 0c061d8e jal 0x 00187638      [[Maintenance]]
+
                                                {{f/Cond|Else : Attack Hits}}
  00189760: 00000000 nop
+
  0018975c: 0c061d8e jal 0x00187638              |{{f/jal|Maintenance|Maintenance}} Attack is guarded if Target uses maintenance
  00189764: 3c038019 lui r3,0x8019
+
  00189760: 00000000 nop                         |
  00189768: 8c632d90 lw r3,0x2d90(r3)
+
  00189764: 3c038019 lui r3,0x8019               |
  0018976c: 00000000 nop
+
  00189768: 8c632d90 lw r3,0x2d90(r3)             |{{f/adr|<nowiki>r3 = TCA data pointer</nowiki>}}
  00189770: 90620000 lbu r2,0x0000(r3)         Load hit flag
+
  0018976c: 00000000 nop                         |
  00189774: 00000000 nop
+
  00189770: 90620000 lbu r2,0x0000(r3)           |{{f/load|<nowiki>r2 = TCA hit flag</nowiki>}}
  00189778: 10400002 beq r2,r0,0x 00189784 Branch if miss
+
  00189774: 00000000 nop                         |
  0018977c: 34020004 ori r2,r0,0x0004        
+
  00189778: 10400002 beq r2,r0,0x00189784        {{f/Cond|If Attack is not guarded}}
  00189780: a4620010 sh r2,0x0010(r3)         Store special flag - break item
+
  0018977c: 34020004 ori r2,r0,0x0004                 |{{f/std|<nowiki>r2 = 0x04</nowiki>}}
  00189784: 8fbf0010 lw r31,0x0010(r29)
+
  00189780: a4620010 sh r2,0x0010(r3)                 |{{f/store|Store TCA special flag - break item}}
  00189788: 27bd0018 addiu r29,r29,0x 0018
+
  00189784: 8fbf0010 lw r31,0x0010(r29)       END
  0018978c: 03e00008 jr r31
+
  00189788: 27bd0018 addiu r29,r29,0x0018
 +
  0018978c: 03e00008 jr r31
 
  00189790: 00000000 nop
 
  00189790: 00000000 nop
 +
=== Return location ===
 +
'''Battle.bin'''
 +
0018b97c - [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Latest revision as of 05:28, 22 April 2022

[25]
001896ec: 27bdffe8 addiu r29,r29,0xffe8     |
001896f0: afbf0010 sw r31,0x0010(r29)       |
001896f4: 0c061e72 jal 0x001879c8           |-->Steal/Break/Might Sword Hard Coding Choose Item to break (from Ability ID), If ok : store item ID (Action 0x03) and set Action remove item flag (Action 0x19)
001896f8: 00000000 nop                      |
001896fc: 10400007 beq r2,r0,0x0018971c     #If No item to break / wrong ability
00189700: 34020001 ori r2,r0,0x0001             |r2 = 0x01
00189704: 3c018019 lui r1,0x8019                |
00189708: a02238e9 sb r2,0x38e9(r1)             |Enable Current Ability Default to Attack flag           0x801938e9 / 801938e9
0018970c: 0c062b56 jal 0x0018ad58               |-->Switch_Ability_to_default_Attack Perform a normal attack instead of used ability
00189710: 00000000 nop                          |
00189714: 080625e1 j 0x00189784                 >>Jump to  END
00189718: 00000000 nop                          |
0018971c: 3c018019 lui r1,0x8019            |
00189720: a02038e9 sb r0,0x38e9(r1)         |Clear Current Ability Default to Attack flag
00189724: 0c062144 jal 0x00188510           |-->Physical Evade Calculation  If Abillity is evadeable roll Ability Evade byte against Ability base Hit - Returns r2
00189728: 00000000 nop                      |
0018972c: 14400015 bne r2,r0,0x00189784     #If Attack is not Evaded
00189730: 00000000 nop                          |
00189734: 0c061797 jal 0x00185e5c               |-->Store PA and WP + Y  XA is Attacker's PA and YA is WP + Y
00189738: 00000000 nop                          |
0018973c: 0c0621b5 jal 0x001886d4               |-->Calculate_Accuracy_for_Physical  Modify XA and YA (physical) and uses XA+YA as hit% - Returns r2
00189740: 00000000 nop                          |
00189744: 10400005 beq r2,r0,0x0018975c         #If Attack miss
00189748: 00000000 nop                              |
0018974c: 3c028019 lui r2,0x8019                    |
00189750: 8c422d90 lw r2,0x2d90(r2)                 |r2 = Target Current Action (TCA) data pointer
00189754: 080625e1 j 0x00189784                     >>Jump to  END
00189758: a4400010 sh r0,0x0010(r2)                 |Clear TCA Specials flags
                                                #Else : Attack Hits
0018975c: 0c061d8e jal 0x00187638               |-->Maintenance Attack is guarded if Target uses maintenance
00189760: 00000000 nop                          |
00189764: 3c038019 lui r3,0x8019                |
00189768: 8c632d90 lw r3,0x2d90(r3)             |r3 = TCA data pointer
0018976c: 00000000 nop                          |
00189770: 90620000 lbu r2,0x0000(r3)            |r2 = TCA hit flag
00189774: 00000000 nop                          |
00189778: 10400002 beq r2,r0,0x00189784         #If Attack is not guarded
0018977c: 34020004 ori r2,r0,0x0004                 |r2 = 0x04
00189780: a4620010 sh r2,0x0010(r3)                 |Store TCA special flag - break item
00189784: 8fbf0010 lw r31,0x0010(r29)       END
00189788: 27bd0018 addiu r29,r29,0x0018
0018978c: 03e00008 jr r31
00189790: 00000000 nop

Return location

Battle.bin
0018b97c - Pre Formula Setup