Difference between revisions of "34 Heal (PA*Y) HealMP (PA*Y/2)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " [34] 00189e94: 27bdffe8 addiu r29,r29,0xffe8 00189e98: afbf0010 sw r31,0x0010(r29) 00189e9c: 0c061781 jal 0x 00185e04 Loads PA and Y 00189ea0: 00000000 nop ...")
 
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
  [34]
 
  [34]
  00189e94: 27bdffe8 addiu r29,r29,0xffe8
+
  00189e94: 27bdffe8 addiu r29,r29,-0x0018    |
  00189e98: afbf0010 sw r31,0x0010(r29)
+
  00189e98: afbf0010 sw r31,0x0010(r29)       |
  00189e9c: 0c061781 jal 0x 00185e04      Loads PA and Y
+
  00189e9c: 0c061781 jal 0x00185e04          |{{f/jal|Store PA and Y|Store PA and Y}} - XA = Attacker's PA and YA = Ability Y
  00189ea0: 00000000 nop
+
  00189ea0: 00000000 nop                     |
  00189ea4: 0c061853 jal 0x 0018614c      Attack UP/Martial Arts Check
+
  00189ea4: 0c061853 jal 0x0018614c          |{{f/jal|Formula 32, 33, 34, 35 Attack Up and Martial Arts|Attack Up and Martial Arts}} Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
  00189ea8: 00000000 nop
+
  00189ea8: 00000000 nop                     |
  00189eac: 0c061259 jal 0x 00184964      Zodiac Calculation
+
  00189eac: 0c061259 jal 0x00184964          |{{f/jal|Compatibility|Compatibility}} Modify Ability XA : from -50% to + 50%
  00189eb0: 00000000 nop
+
  00189eb0: 00000000 nop                     |
  00189eb4: 0c06195a jal 0x 00186568      Damage Calculation (Forbids elemental.)
+
  00189eb4: 0c06195a jal 0x00186568          |{{f/jal|XA * YA Calculation|XA * YA Calculation}} - Store XA*YA as Target Current Action HP damage (TCA 0x04) and Set TCA Attack type to 0x80 (HP damage)
  00189eb8: 00000000 nop
+
  00189eb8: 00000000 nop                     |
  00189ebc: 3c048019 lui r4,0x8019
+
  00189ebc: 3c048019 lui r4,0x8019           |
  00189ec0: 8c842d90 lw r4,0x2d90(r4)
+
  00189ec0: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  00189ec4: 00000000 nop
+
  00189ec4: 00000000 nop                     |
  00189ec8: 94820004 lhu r2,0x0004(r4)
+
  00189ec8: 94820004 lhu r2,0x0004(r4)       |{{f/load|<nowiki>r2 = TCA HP damage</nowiki>}}
  00189ecc: a4800004 sh r0,0x0004(r4)
+
  00189ecc: a4800004 sh r0,0x0004(r4)         |{{f/store|Nullify TCA HP damage}}
  00189ed0: a4820006 sh r2,0x0006(r4)     Set HP Healing
+
  00189ed0: a4820006 sh r2,0x0006(r4)         |{{f/store|<nowiki>Set TCA HP recovery = previous HP Damage (XA*YA)</nowiki>}}
  00189ed4: 94830006 lhu r3,0x0006(r4)
+
  00189ed4: 94830006 lhu r3,0x0006(r4)       |{{f/load|<nowiki>r3 = HP recovery</nowiki>}}
  00189ed8: 34020050 ori r2,r0,0x0050
+
  00189ed8: 34020050 ori r2,r0,0x0050         |{{f/std|<nowiki>r2 = 0x50</nowiki>}}
  00189edc: a0820025 sb r2,0x0025(r4)
+
  00189edc: a0820025 sb r2,0x0025(r4)         |{{f/store|<nowiki>Set TCA Attack type = HP and MP recovery</nowiki>}}
  00189ee0: 00031c00 sll r3,r3,0x10    
+
  00189ee0: 00031c00 sll r3,r3,0x10           |{{f/std|Left shift HP recovery in upper registery}}
  00189ee4: 00031403 sra r2,r3,0x10    
+
  00189ee4: 00031403 sra r2,r3,0x10           |{{f/std|Right shift HP recovery in lower registery (set word higher bit to 1 if halfword higher bit was 1)}}
  00189ee8: 00031fc2 srl r3,r3,0x1f    
+
  00189ee8: 00031fc2 srl r3,r3,0x1f           |{{f/std|<nowiki>r3 = Higher bit of r3 (rounding prep)</nowiki>}}
  00189eec: 00431021 addu r2,r2,r3
+
  00189eec: 00431021 addu r2,r2,r3           |{{f/std|<nowiki>r2 = HP recovery +0 or +1</nowiki>}}
  00189ef0: 00021043 sra r2,r2,0x01
+
  00189ef0: 00021043 sra r2,r2,0x01           |{{f/std|<nowiki>r2 = HP receovery / 2</nowiki>}}
  00189ef4: a482000a sh r2,0x000a(r4)     SEt MP Healing as half of HP
+
  00189ef4: a482000a sh r2,0x000a(r4)         |{{f/store|<nowiki>Set TCA MP recovery = HP recovery/2</nowiki>}}
  00189ef8: 8fbf0010 lw r31,0x0010(r29)
+
  00189ef8: 8fbf0010 lw r31,0x0010(r29)
  00189efc: 27bd 0018 addiu r29,r29,0x 0018
+
  00189efc: 27bd0018 addiu r29,r29,0x0018
  00189f00: 03e00008 jr r31
+
  00189f00: 03e00008 jr r31
 
  00189f04: 00000000 nop
 
  00189f04: 00000000 nop
 +
=== Return location ===
 +
'''Battle.bin'''
 +
0018b97c - [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Latest revision as of 12:12, 24 April 2022

[34]
00189e94: 27bdffe8 addiu r29,r29,-0x0018    |
00189e98: afbf0010 sw r31,0x0010(r29)       |
00189e9c: 0c061781 jal 0x00185e04           |-->Store PA and Y - XA = Attacker's PA and YA = Ability Y
00189ea0: 00000000 nop                      |
00189ea4: 0c061853 jal 0x0018614c           |-->Attack Up and Martial Arts Increase XA if Attacker uses Attack Up or Martial art with elligible weapon
00189ea8: 00000000 nop                      |
00189eac: 0c061259 jal 0x00184964           |-->Compatibility Modify Ability XA : from -50% to + 50%
00189eb0: 00000000 nop                      |
00189eb4: 0c06195a jal 0x00186568           |-->XA * YA Calculation - Store XA*YA as Target Current Action HP damage (TCA 0x04) and Set TCA Attack type to 0x80 (HP damage)
00189eb8: 00000000 nop                      |
00189ebc: 3c048019 lui r4,0x8019            |
00189ec0: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action (TCA) data pointer
00189ec4: 00000000 nop                      |
00189ec8: 94820004 lhu r2,0x0004(r4)        |r2 = TCA HP damage
00189ecc: a4800004 sh r0,0x0004(r4)         |Nullify TCA HP damage
00189ed0: a4820006 sh r2,0x0006(r4)         |Set TCA HP recovery = previous HP Damage (XA*YA)
00189ed4: 94830006 lhu r3,0x0006(r4)        |r3 = HP recovery
00189ed8: 34020050 ori r2,r0,0x0050         |r2 = 0x50
00189edc: a0820025 sb r2,0x0025(r4)         |Set TCA Attack type = HP and MP recovery
00189ee0: 00031c00 sll r3,r3,0x10           |Left shift HP recovery in upper registery
00189ee4: 00031403 sra r2,r3,0x10           |Right shift HP recovery in lower registery (set word higher bit to 1 if halfword higher bit was 1)
00189ee8: 00031fc2 srl r3,r3,0x1f           |r3 = Higher bit of r3 (rounding prep)
00189eec: 00431021 addu r2,r2,r3            |r2 = HP recovery +0 or +1
00189ef0: 00021043 sra r2,r2,0x01           |r2 = HP receovery / 2
00189ef4: a482000a sh r2,0x000a(r4)         |Set TCA MP recovery = HP recovery/2
00189ef8: 8fbf0010 lw r31,0x0010(r29)
00189efc: 27bd0018 addiu r29,r29,0x0018
00189f00: 03e00008 jr r31
00189f04: 00000000 nop

Return location

Battle.bin
0018b97c - Pre Formula Setup