Difference between revisions of "Attack UP/Two Hands/Martial Arts"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(I didn't like how unsure it was and it was killing me. makes it easier to modify if I know what I'm doing)
 
Line 1: Line 1:
  Attack UP/Two Hands/Martial Arts
+
  No parameters - Returns Nothing
  00186054: 3c038019 lui r3,0x8019
+
  00186058: 906338ff lbu r3,0x38ff(r3) Load Weapon Characteristics
+
Checks if Attacker uses 2-Hands, Attack-Up and/or Martial Arts as Support Ability
  0018605c: 00000000 nop
+
Modify Ability XA ( 0x801938ce ) if needed. Could be cumulative.
  00186060: 30620001 andi r2,r3,0x0001 Checks for forced two hands
+
  - 2 Hands : XA = 200% of base XA
  00186064: 1440000e bne r2,r0,0x001860a0 Branch if weapon has Forced Two  hands
+
  - Attack Up : XA = 133% of base XA
  00186068: 30620004 andi r2,r3,0x0004 Checks for cannot two hands
+
  - Martial Art : XA = 150% of base XA
  0018606c: 1040000c beq r2,r0,0x001860a0 Branch if weapon cannot use Two  hands
+
-----------------------------------------------------------------------------------------------------------
  00186070: 00000000 nop
+
  00186054: 3c038019 lui r3,0x8019           |
  00186074: 3c028019 lui r2,0x8019
+
  00186058: 906338ff lbu r3,0x38ff(r3)       |{{f/load|<nowiki>r3 = Current Ability used Weapon Characteristics</nowiki>}} {{f/std| 0x801938ff / 801938ff}}
  00186078: 904238d9 lbu r2,0x38d9(r2) Load double-check Two-Hands flag
+
  0018605c: 00000000 nop                     |
  0018607c: 00000000 nop
+
  00186060: 30620001 andi r2,r3,0x0001       |{{f/std|<nowiki>r2 = 0x01 if Used Weapon has forced 2-Hands enable</nowiki>}}
  00186080: 10400007 beq r2,r0,0x001860a0 Branch if two weapons equipped, and 2hands cannot be applied
+
  00186064: 1440000e bne r2,r0,0x001860a0     {{f/Cond|If weapon doesn't have Forced Two  hands}}
  00186084: 00000000 nop
+
  00186068: 30620004 andi r2,r3,0x0004           |{{f/std|<nowiki>r2 = 0x04 if Used Weapon is Avaible for 2 hands</nowiki>}}
  00186088: 3c028019 lui r2,0x8019
+
  0018606c: 1040000c beq r2,r0,0x001860a0         {{f/Cond|If Weapon Can be hold with two hands}}
  0018608c: 844238ce lh r2,0x38ce(r2) Load XA - inflicted damage
+
  00186070: 00000000 nop                             |
  00186090: 00000000 nop
+
  00186074: 3c028019 lui r2,0x8019                   |
  00186094: 00021040 sll r2,r2,0x01 XA * 2
+
  00186078: 904238d9 lbu r2,0x38d9(r2)               |{{f/load|<nowiki>r2 = Ability [2 Hands] checks</nowiki>}} {{f/std| 0x801938d9 / 801938d9}}
  00186098: 3c018019 lui r1,0x8019
+
  0018607c: 00000000 nop                             |
  0018609c: a42238ce sh r2,0x38ce(r1) Store new Damage
+
  00186080: 10400007 beq r2,r0,0x001860a0             {{f/Cond|If 2 Hands is active}}
  001860a0: 3c028019 lui r2,0x8019
+
  00186084: 00000000 nop                                 |{{f/std|}}
  001860a4: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Data Pointer
+
  00186088: 3c028019 lui r2,0x8019                       |{{f/std|}}
  001860a8: 00000000 nop
+
  0018608c: 844238ce lh r2,0x38ce(r2)                     |{{f/load|<nowiki>r2 = Ability XA</nowiki>}} {{f/std| 0x801938ce / 801938ce}}
  001860ac: 90420090 lbu r2,0x0090(r2) Load Attacker's 2nd set of Support
+
  00186090: 00000000 nop                                 |
  001860b0: 00000000 nop
+
  00186094: 00021040 sll r2,r2,0x01                       |{{f/std|XA * 2}}
  001860b4: 30420010 andi r2,r2,0x0010 checks for Attack UP
+
  00186098: 3c018019 lui r1,0x8019                       |
  001860b8: 1040000b beq r2,r0,0x001860e8 Branch if Attacker doesn't have  Attack UP
+
  0018609c: a42238ce sh r2,0x38ce(r1)                     |{{f/store|Store XA (200% of original)}}
  001860bc: 3c025555 lui r2,0x5555 preperation for fractional multiplication
+
  001860a0: 3c028019 lui r2,0x8019           |{{f/std|}}
  001860c0: 3c048019 lui r4,0x8019
+
  001860a4: 8c422d94 lw r2,0x2d94(r2)         |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
  001860c4: 248438ce addiu r4,r4,0x38ce
+
  001860a8: 00000000 nop                     |
  001860c8: 84830000 lh r3,0x0000(r4) Load XA - inflicted damage
+
  001860ac: 90420090 lbu r2,0x0090(r2)       |{{f/load|<nowiki>r2 = Attacker's 2nd set of support skill</nowiki>}}
  001860cc: 34425556 ori r2,r2,0x5556 r2 = 1/3
+
  001860b0: 00000000 nop                     |
  001860d0: 00031880 sll r3,r3,0x02 Dmg * 4
+
  001860b4: 30420010 andi r2,r2,0x0010       |{{f/std|<nowiki>r2 = 0x10 if Attacker uses [Attack Up]</nowiki>}}
  001860d4: 00620018 mult r3,r2 Dmg * 4 * 0.33333333
+
  001860b8: 1040000b beq r2,r0,0x001860e8     {{f/Cond|If Attacker uses [Attack Up]}}
  001860d8: 00031fc3 sra r3,r3,0x1f
+
  001860bc: 3c025555 lui r2,0x5555               |{{f/std|}}
  001860dc: 00001010 mfhi r2
+
  001860c0: 3c048019 lui r4,0x8019               |{{f/std|}}
  001860e0: 00431023 subu r2,r2,r3 r2 = dmg * 4/3
+
  001860c4: 248438ce addiu r4,r4,0x38ce           |{{f/adr|<nowiki>r4 = Ability XA data pointer</nowiki>}}
  001860e4: a4820000 sh r2,0x0000(r4) Store new Dmg
+
  001860c8: 84830000 lh r3,0x0000(r4)             |{{f/load|<nowiki>r3 = Ability XA</nowiki>}}
  001860e8: 3c028019 lui r2,0x8019
+
  001860cc: 34425556 ori r2,r2,0x5556             |{{f/std|<nowiki>r2 = 0x55555556 (0,33 * 2^32)</nowiki>}}
  001860ec: 904238d8 lbu r2,0x38d8(r2) Load used Weapon ID
+
  001860d0: 00031880 sll r3,r3,0x02               |{{f/std|<nowiki>r3 = XA * 4</nowiki>}}
  001860f0: 00000000 nop
+
  001860d4: 00620018 mult r3,r2                   |{{f/std|4* XA * 0,33 * 2^32}}
  001860f4: 14400013 bne r2,r0,0x00186144 Branch if not Unarmed
+
  001860d8: 00031fc3 sra r3,r3,0x1f               |{{f/std|<nowiki>r3 = 4* XA higher bit (should be 0x00)</nowiki>}}
  001860f8: 00000000 nop
+
  001860dc: 00001010 mfhi r2                     |{{f/std|<nowiki>r2 = XA * 4/3</nowiki>}}
  001860fc: 3c028019 lui r2,0x8019
+
  001860e0: 00431023 subu r2,r2,r3               |{{f/std|<nowiki>r2 = XA * 4/3 - 0x00</nowiki>}}
  00186100: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Data Pointer
+
  001860e4: a4820000 sh r2,0x0000(r4)             |{{f/store|Store XA (133% of previous value)}}
  00186104: 00000000 nop
+
  001860e8: 3c028019 lui r2,0x8019           |
  00186108: 90420091 lbu r2,0x0091(r2) Load Attacker's 3rd set of Support
+
  001860ec: 904238d8 lbu r2,0x38d8(r2)       |{{f/load|<nowiki>r2 = Current Ability used Weapon ID</nowiki>}} {{f/std| 0x801938d8 / 801938d8}}
  0018610c: 00000000 nop
+
  001860f0: 00000000 nop                     |
  00186110: 30420020 andi r2,r2,0x0020
+
  001860f4: 14400013 bne r2,r0,0x00186144     {{f/Cond|<nowiki>If Weapon ID = 0x00 (Fist)</nowiki>}}
  00186114: 1040000b beq r2,r0,0x00186144 Branch if Attacker doesn't have Martial Arts
+
  001860f8: 00000000 nop                         |
  00186118: 00000000 nop
+
  001860fc: 3c028019 lui r2,0x8019               |
  0018611c: 3c028019 lui r2,0x8019
+
  00186100: 8c422d94 lw r2,0x2d94(r2)             |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
  00186120: 844238ce lh r2,0x38ce(r2) Load XA - inflicted damage
+
  00186104: 00000000 nop                         |
  00186124: 00000000 nop
+
  00186108: 90420091 lbu r2,0x0091(r2)           |{{f/load|<nowiki>r2 = Attacker's 3rd set of Support</nowiki>}}
  00186128: 00021840 sll r3,r2,0x01 XA * 2
+
  0018610c: 00000000 nop                         |
  0018612c: 00621821 addu r3,r3,r2 XA * 3
+
  00186110: 30420020 andi r2,r2,0x0020           |{{f/std|<nowiki>r2 = 0x20 if Attacker uses Martial Arts</nowiki>}}
  00186130: 000317c2 srl r2,r3,0x1f
+
  00186114: 1040000b beq r2,r0,0x00186144         {{f/Cond|If Attacker uses Martial Arts}}
  00186134: 00621821 addu r3,r3,r2
+
  00186118: 00000000 nop                             |
  00186138: 00031843 sra r3,r3,0x01 XA * 3 / 2
+
  0018611c: 3c028019 lui r2,0x8019                   |
  0018613c: 3c018019 lui r1,0x8019
+
  00186120: 844238ce lh r2,0x38ce(r2)                 |{{f/load|<nowiki>r2 = Ability XA</nowiki>}}
  00186140: a42338ce sh r3,0x38ce(r1) Store new damage
+
  00186124: 00000000 nop                             |
  00186144: 03e00008 jr r31
+
  00186128: 00021840 sll r3,r2,0x01                   |{{f/std|XA * 2}}
  00186148: 00000000 nop
+
  0018612c: 00621821 addu r3,r3,r2                   |{{f/std|XA * 3}}
 
+
  00186130: 000317c2 srl r2,r3,0x1f                   |{{f/std|<nowiki>r2 = Higher bit of XA*3 (should be 0x00)</nowiki>}}
 
+
  00186134: 00621821 addu r3,r3,r2                   |{{f/std|<nowiki>r3 = XA*3 + 0x00</nowiki>}}
== Return Locations ==
+
  00186138: 00031843 sra r3,r3,0x01                   |{{f/std|<nowiki>r3 = Ability XA * 3/2</nowiki>}}
 
+
  0018613c: 3c018019 lui r1,0x8019                   |
*Battle.bin
+
  00186140: a42338ce sh r3,0x38ce(r1)                 |{{f/store|Store XA (150% of previous value)}}
  00188600: [[Physical XA Modifying Statuses/Support ]]
+
  00186144: 03e00008 jr r31                   END
 +
  00186148: 00000000 nop  
 +
=== Return Locations ===
 +
'''Battle.bin'''
 +
  00188608: [[Physical XA Modifying Statuses/Support ]]

Latest revision as of 20:52, 26 March 2022

No parameters - Returns Nothing

Checks if Attacker uses 2-Hands, Attack-Up and/or Martial Arts as Support Ability
Modify Ability XA ( 0x801938ce ) if needed. Could be cumulative.
 - 2 Hands : XA = 200% of base XA
 - Attack Up : XA = 133% of base XA
 - Martial Art : XA = 150% of base XA
-----------------------------------------------------------------------------------------------------------
00186054: 3c038019 lui r3,0x8019            |
00186058: 906338ff lbu r3,0x38ff(r3)        |r3 = Current Ability used Weapon Characteristics  0x801938ff / 801938ff
0018605c: 00000000 nop                      |
00186060: 30620001 andi r2,r3,0x0001        |r2 = 0x01 if Used Weapon has forced 2-Hands enable
00186064: 1440000e bne r2,r0,0x001860a0     #If weapon doesn't have Forced Two  hands
00186068: 30620004 andi r2,r3,0x0004            |r2 = 0x04 if Used Weapon is Avaible for 2 hands
0018606c: 1040000c beq r2,r0,0x001860a0         #If Weapon Can be hold with two hands
00186070: 00000000 nop                              |
00186074: 3c028019 lui r2,0x8019                    |
00186078: 904238d9 lbu r2,0x38d9(r2)                |r2 = Ability [2 Hands] checks  0x801938d9 / 801938d9
0018607c: 00000000 nop                              |
00186080: 10400007 beq r2,r0,0x001860a0             #If 2 Hands is active
00186084: 00000000 nop                                  |
00186088: 3c028019 lui r2,0x8019                        |
0018608c: 844238ce lh r2,0x38ce(r2)                     |r2 = Ability XA  0x801938ce / 801938ce
00186090: 00000000 nop                                  |
00186094: 00021040 sll r2,r2,0x01                       |XA * 2
00186098: 3c018019 lui r1,0x8019                        |
0018609c: a42238ce sh r2,0x38ce(r1)                     |Store XA (200% of original)
001860a0: 3c028019 lui r2,0x8019            |
001860a4: 8c422d94 lw r2,0x2d94(r2)         |r2 = Attacker data pointer
001860a8: 00000000 nop                      |
001860ac: 90420090 lbu r2,0x0090(r2)        |r2 = Attacker's 2nd set of support skill
001860b0: 00000000 nop                      |
001860b4: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Attacker uses [Attack Up]
001860b8: 1040000b beq r2,r0,0x001860e8     #If Attacker uses [Attack Up]
001860bc: 3c025555 lui r2,0x5555                |
001860c0: 3c048019 lui r4,0x8019                |
001860c4: 248438ce addiu r4,r4,0x38ce           |r4 = Ability XA data pointer
001860c8: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
001860cc: 34425556 ori r2,r2,0x5556             |r2 = 0x55555556 (0,33 * 2^32)
001860d0: 00031880 sll r3,r3,0x02               |r3 = XA * 4
001860d4: 00620018 mult r3,r2                   |4* XA * 0,33 * 2^32
001860d8: 00031fc3 sra r3,r3,0x1f               |r3 = 4* XA higher bit (should be 0x00)
001860dc: 00001010 mfhi r2                      |r2 = XA * 4/3
001860e0: 00431023 subu r2,r2,r3                |r2 = XA * 4/3  - 0x00
001860e4: a4820000 sh r2,0x0000(r4)             |Store XA (133% of previous value)
001860e8: 3c028019 lui r2,0x8019            |
001860ec: 904238d8 lbu r2,0x38d8(r2)        |r2 = Current Ability used Weapon ID  0x801938d8 / 801938d8
001860f0: 00000000 nop                      |
001860f4: 14400013 bne r2,r0,0x00186144     #If Weapon ID = 0x00 (Fist)
001860f8: 00000000 nop                          |
001860fc: 3c028019 lui r2,0x8019                |
00186100: 8c422d94 lw r2,0x2d94(r2)             |r2 = Attacker data pointer
00186104: 00000000 nop                          |
00186108: 90420091 lbu r2,0x0091(r2)            |r2 = Attacker's 3rd set of Support
0018610c: 00000000 nop                          |
00186110: 30420020 andi r2,r2,0x0020            |r2 = 0x20 if Attacker uses Martial Arts
00186114: 1040000b beq r2,r0,0x00186144         #If Attacker uses Martial Arts
00186118: 00000000 nop                              |
0018611c: 3c028019 lui r2,0x8019                    |
00186120: 844238ce lh r2,0x38ce(r2)                 |r2 = Ability XA
00186124: 00000000 nop                              |
00186128: 00021840 sll r3,r2,0x01                   |XA * 2
0018612c: 00621821 addu r3,r3,r2                    |XA * 3
00186130: 000317c2 srl r2,r3,0x1f                   |r2 = Higher bit of XA*3 (should be 0x00)
00186134: 00621821 addu r3,r3,r2                    |r3 = XA*3 + 0x00
00186138: 00031843 sra r3,r3,0x01                   |r3 = Ability XA * 3/2
0018613c: 3c018019 lui r1,0x8019                    |
00186140: a42338ce sh r3,0x38ce(r1)                 |Store XA (150% of previous value)
00186144: 03e00008 jr r31                   END
00186148: 00000000 nop    

Return Locations

Battle.bin
00188608: Physical XA Modifying Statuses/Support