Difference between revisions of "Target XA affecting Statuses (Physical)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  Target XA affecting Statuses (Physical):
+
  No Parameters - Returns Nothing
  0018636c: 3c028019 lui r2,0x8019
+
  00186370: 8c422d98 lw r2,0x2d98(r2) Load Target's Data Pointer
+
Checks for Target's statuses and modify Ability XA (0x801938ce) if needed (all cumulative):
  00186374: 00000000 nop
+
- Target has Protect : XA = 66% of XA
  00186378: 9042005b lbu r2,0x005b(r2) Load Target's 4th set of Statuses
+
- Target is sleeping or charging : XA = 150% of XA
  0018637c: 00000000 nop
+
- Target is a frog or a chicken : XA = 150% of XA
  00186380: 30420020 andi r2,r2,0x0020
+
-----------------------------------------------------------------------------------------------------------
  00186384: 1040000b beq r2,r0,0x001863b4 Branch if Target doesn't have  Protect
+
  0018636c: 3c028019 lui r2,0x8019           |
  00186388: 3c025555 lui r2,0x5555
+
  00186370: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target's Data Pointer</nowiki>}}
  0018638c: 3c048019 lui r4,0x8019
+
  00186374: 00000000 nop                     |
  00186390: 248438ce addiu r4,r4,0x38ce
+
  00186378: 9042005b lbu r2,0x005b(r2)       |{{f/load|<nowiki>r2 = Target's 4th set of Statuses byte</nowiki>}}
  00186394: 84830000 lh r3,0x0000(r4) Load XA
+
  0018637c: 00000000 nop                     |
  00186398: 34425556 ori r2,r2,0x5556
+
  00186380: 30420020 andi r2,r2,0x0020       |{{f/std|<nowiki>r2 = 0x20 if TargetHas protect</nowiki>}}
  0018639c: 00031840 sll r3,r3,0x01 XA * 2
+
  00186384: 1040000b beq r2,r0,0x001863b4     {{f/Cond|If Target has Protect}}
  001863a0: 00620018 mult r3,r2 XA * 2 * 0.33333333
+
  00186388: 3c025555 lui r2,0x5555               |
  001863a4: 00031fc3 sra r3,r3,0x1f
+
  0018638c: 3c048019 lui r4,0x8019               |
  001863a8: 00001010 mfhi r2 r2 = XA * 2 * 0.33333333 (XA * 2 / 3)
+
  00186390: 248438ce addiu r4,r4,0x38ce           |{{f/adr|<nowiki>r4 = 0x801938ce (Ability XA pointer)</nowiki>}} {{f/std| 801938ce}}
  001863ac: 00431023 subu r2,r2,r3
+
  00186394: 84830000 lh r3,0x0000(r4)             |{{f/load|<nowiki>r3 = Ability XA</nowiki>}}
  001863b0: a4820000 sh r2,0x0000(r4) Store XA
+
  00186398: 34425556 ori r2,r2,0x5556             |{{f/std|<nowiki>r2 = 0x55555556 (0,33 * 2^32)</nowiki>}}
  001863b4: 3c038019 lui r3,0x8019
+
  0018639c: 00031840 sll r3,r3,0x01               |{{f/std|XA * 2}}
  001863b8: 8c632d98 lw r3,0x2d98(r3) Load Target's Data Pointer
+
  001863a0: 00620018 mult r3,r2                   |{{f/std|XA * 2 * 0.33 * 2^32}}
  001863bc: 00000000 nop
+
  001863a4: 00031fc3 sra r3,r3,0x1f               |{{f/std|<nowiki>r3 = Higher bit of r3 (should be 0x00)</nowiki>}}
  001863c0: 9062005c lbu r2,0x005c(r3) Load Target's 5th set of Statuses
+
  001863a8: 00001010 mfhi r2                     |{{f/std|<nowiki>r2 = XA * 2/3</nowiki>}}
  001863c4: 00000000 nop
+
  001863ac: 00431023 subu r2,r2,r3               |{{f/std|<nowiki>r2 = XA * 2/3 - 0x00</nowiki>}}
  001863c8: 30420010 andi r2,r2,0x0010
+
  001863b0: a4820000 sh r2,0x0000(r4)             |{{f/store|Store XA (66% of its initial value)}}
  001863cc: 14400006 bne r2,r0,0x001863e8 Branch if Target is Sleeping
+
  001863b4: 3c038019 lui r3,0x8019           |
  001863d0: 00000000 nop
+
  001863b8: 8c632d98 lw r3,0x2d98(r3)         |{{f/adr|<nowiki>r3 = Target's Data Pointer</nowiki>}}
  001863d4: 90620058 lbu r2,0x0058(r3) Load Target's 1st set of Statuses
+
  001863bc: 00000000 nop                     |
  001863d8: 00000000 nop
+
  001863c0: 9062005c lbu r2,0x005c(r3)       |{{f/load|<nowiki>r3 = Target's 5th set of Statuses byte</nowiki>}}
  001863dc: 30420008 andi r2,r2,0x0008
+
  001863c4: 00000000 nop                     |
  001863e0: 1040000b beq r2,r0,0x00186410 Branch if Target is Charging
+
  001863c8: 30420010 andi r2,r2,0x0010       |{{f/std|<nowiki>r2 = 0x10 if Target is sleeping</nowiki>}}
  001863e4: 00000000 nop
+
  001863cc: 14400006 bne r2,r0,0x001863e8     {{f/Cond|If Target is not Sleeping}} /Else branch to increase XA section
  001863e8: 3c048019 lui r4,0x8019
+
  001863d0: 00000000 nop                         |
  001863ec: 248438ce addiu r4,r4,0x38ce
+
  001863d4: 90620058 lbu r2,0x0058(r3)           |{{f/load|<nowiki>r2 = Target's 1st set of Statuses byte</nowiki>}}
  001863f0: 84830000 lh r3,0x0000(r4) Load XA
+
  001863d8: 00000000 nop                         |
  001863f4: 00000000 nop
+
  001863dc: 30420008 andi r2,r2,0x0008           |{{f/std|<nowiki>r2 = 0x08 if Target is Charging</nowiki>}}
  001863f8: 00031040 sll r2,r3,0x01 XA * 2
+
  001863e0: 1040000b beq r2,r0,0x00186410         {{f/Cond|If Target is charging}} /Else avoid increase XA section
  001863fc: 00431021 addu r2,r2,r3 XA * 3
+
  001863e4: 00000000 nop                             |
  00186400: 00021fc2 srl r3,r2,0x1f
+
  001863e8: 3c048019 lui r4,0x8019           {{f/Cond|E }}    |
  00186404: 00431021 addu r2,r2,r3
+
  001863ec: 248438ce addiu r4,r4,0x38ce               |{{f/adr|<nowiki>r4 = 0x801938ce (Ability XA pointer)</nowiki>}} {{f/std| 801938ce}}
  00186408: 00021043 sra r2,r2,0x01 XA * 3 / 2
+
  001863f0: 84830000 lh r3,0x0000(r4)                 |{{f/load|<nowiki>r3 = Ability XA</nowiki>}}
  0018640c: a4820000 sh r2,0x0000(r4) Store new XA
+
  001863f4: 00000000 nop                             |
  00186410: 3c028019 lui r2,0x8019
+
  001863f8: 00031040 sll r2,r3,0x01                   |{{f/std|XA * 2}}
  00186414: 8c422d98 lw r2,0x2d98(r2) Load Target's Data Pointer
+
  001863fc: 00431021 addu r2,r2,r3                   |{{f/std|XA * 3}}
  00186418: 00000000 nop
+
  00186400: 00021fc2 srl r3,r2,0x1f                   |{{f/std|<nowiki>r3 = higher bit of r2 (should be 0x00)</nowiki>}}
  0018641c: 9042005a lbu r2,0x005a(r2) Load Target's 3rd set of Statuses
+
  00186404: 00431021 addu r2,r2,r3                   |{{f/std|XA*3 + 0x00}}
  00186420: 00000000 nop
+
  00186408: 00021043 sra r2,r2,0x01                   |{{f/std|<nowiki>r2 = XA *3/2</nowiki>}}
  00186424: 30420006 andi r2,r2,0x0006
+
  0018640c: a4820000 sh r2,0x0000(r4)                 |{{f/store|Store XA (150% of previous value)}}
  00186428: 1040000b beq r2,r0,0x00186458 Branch if Target is a Chicken/Frog
+
  00186410: 3c028019 lui r2,0x8019           |
  0018642c: 00000000 nop
+
  00186414: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 =  Target's Data Pointer</nowiki>}}
  00186430: 3c048019 lui r4,0x8019
+
  00186418: 00000000 nop                     |
  00186434: 248438ce addiu r4,r4,0x38ce
+
  0018641c: 9042005a lbu r2,0x005a(r2)       |{{f/load|<nowiki>r2 = Target's 3rd set of Statuses byte</nowiki>}}
  00186438: 84830000 lh r3,0x0000(r4) Load XA
+
  00186420: 00000000 nop                     |
  0018643c: 00000000 nop
+
  00186424: 30420006 andi r2,r2,0x0006       |{{f/std|r2 <> 0x00if Target has Chicken or Frog}}
  00186440: 00031040 sll r2,r3,0x01 XA * 2
+
  00186428: 1040000b beq r2,r0,0x00186458     {{f/Cond|If Target is a Chicken or a Frog}}
  00186444: 00431021 addu r2,r2,r3 XA * 3
+
  0018642c: 00000000 nop                         |
  00186448: 00021fc2 srl r3,r2,0x1f
+
  00186430: 3c048019 lui r4,0x8019               |
  0018644c: 00431021 addu r2,r2,r3
+
  00186434: 248438ce addiu r4,r4,0x38ce           |{{f/adr|<nowiki>r4 = Ability XA pointer</nowiki>}}
  00186450: 00021043 sra r2,r2,0x01 XA * 3 / 2
+
  00186438: 84830000 lh r3,0x0000(r4)             |{{f/load|<nowiki>r3 = Ability XA</nowiki>}}
  00186454: a4820000 sh r2,0x0000(r4) Store new XA
+
  0018643c: 00000000 nop                         |
  00186458: 03e00008 jr r31
+
  00186440: 00031040 sll r2,r3,0x01               |{{f/std|XA * 2}}
  0018645c: 00000000 nop
+
  00186444: 00431021 addu r2,r2,r3               |{{f/std|XA * 3}}
 
+
  00186448: 00021fc2 srl r3,r2,0x1f               |{{f/std|<nowiki>r3 = higher bit of r2 (should be 0x00)</nowiki>}}
 
+
  0018644c: 00431021 addu r2,r2,r3               |{{f/std|XA*3 + 0x00}}
== Return Locations ==
+
  00186450: 00021043 sra r2,r2,0x01               |{{f/std|<nowiki>r2 = XA *3/2</nowiki>}}
 
+
  00186454: a4820000 sh r2,0x0000(r4)             |{{f/store|Store XA (150% of previous value)}}
*Battle.bin
+
  00186458: 03e00008 jr r31                   END
  00188618: [[Physical XA Modifying Statuses/Support ]]
+
  0018645c: 00000000 nop          
  00188af4: [[Cluster of Physical Routines]]
+
=== Return Locations ===
  001898a8: [[28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%]]
+
'''Battle.bin'''
 +
  00188620: [[Physical XA Modifying Statuses/Support ]]
 +
  00188afc: [[Cluster of Physical Routines]]
 +
  001898b0: [[28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%]]

Latest revision as of 19:30, 5 April 2022

No Parameters - Returns Nothing

Checks for Target's statuses and modify Ability XA (0x801938ce) if needed (all cumulative):
- Target has Protect : XA = 66% of XA
- Target is sleeping or charging : XA = 150% of XA
- Target is a frog or a chicken : XA = 150% of XA
-----------------------------------------------------------------------------------------------------------
0018636c: 3c028019 lui r2,0x8019            |
00186370: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target's Data Pointer
00186374: 00000000 nop                      |
00186378: 9042005b lbu r2,0x005b(r2)        |r2 = Target's 4th set of Statuses byte
0018637c: 00000000 nop                      |
00186380: 30420020 andi r2,r2,0x0020        |r2 = 0x20 if TargetHas protect
00186384: 1040000b beq r2,r0,0x001863b4     #If Target has Protect
00186388: 3c025555 lui r2,0x5555                |
0018638c: 3c048019 lui r4,0x8019                |
00186390: 248438ce addiu r4,r4,0x38ce           |r4 = 0x801938ce (Ability XA pointer)  801938ce
00186394: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
00186398: 34425556 ori r2,r2,0x5556             |r2 = 0x55555556 (0,33 * 2^32)
0018639c: 00031840 sll r3,r3,0x01               |XA * 2
001863a0: 00620018 mult r3,r2                   |XA * 2 * 0.33 * 2^32
001863a4: 00031fc3 sra r3,r3,0x1f               |r3 = Higher bit of r3 (should be 0x00)
001863a8: 00001010 mfhi r2                      |r2 = XA * 2/3
001863ac: 00431023 subu r2,r2,r3                |r2 = XA * 2/3 - 0x00
001863b0: a4820000 sh r2,0x0000(r4)             |Store XA (66% of its initial value)
001863b4: 3c038019 lui r3,0x8019            |
001863b8: 8c632d98 lw r3,0x2d98(r3)         |r3 = Target's Data Pointer
001863bc: 00000000 nop                      |
001863c0: 9062005c lbu r2,0x005c(r3)        |r3 = Target's 5th set of Statuses byte
001863c4: 00000000 nop                      |
001863c8: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Target is sleeping
001863cc: 14400006 bne r2,r0,0x001863e8     #If Target is not Sleeping /Else branch to increase XA section
001863d0: 00000000 nop                          |
001863d4: 90620058 lbu r2,0x0058(r3)            |r2 = Target's 1st set of Statuses byte
001863d8: 00000000 nop                          |
001863dc: 30420008 andi r2,r2,0x0008            |r2 = 0x08 if Target is Charging
001863e0: 1040000b beq r2,r0,0x00186410         #If Target is charging /Else avoid increase XA section
001863e4: 00000000 nop                              |
001863e8: 3c048019 lui r4,0x8019            #E      |
001863ec: 248438ce addiu r4,r4,0x38ce               |r4 = 0x801938ce (Ability XA pointer)  801938ce
001863f0: 84830000 lh r3,0x0000(r4)                 |r3 = Ability XA
001863f4: 00000000 nop                              |
001863f8: 00031040 sll r2,r3,0x01                   |XA * 2
001863fc: 00431021 addu r2,r2,r3                    |XA * 3
00186400: 00021fc2 srl r3,r2,0x1f                   |r3 = higher bit of r2 (should be 0x00)
00186404: 00431021 addu r2,r2,r3                    |XA*3 + 0x00
00186408: 00021043 sra r2,r2,0x01                   |r2 = XA *3/2
0018640c: a4820000 sh r2,0x0000(r4)                 |Store XA (150% of previous value)
00186410: 3c028019 lui r2,0x8019            |
00186414: 8c422d98 lw r2,0x2d98(r2)         |r2 =  Target's Data Pointer
00186418: 00000000 nop                      |
0018641c: 9042005a lbu r2,0x005a(r2)        |r2 = Target's 3rd set of Statuses byte
00186420: 00000000 nop                      |
00186424: 30420006 andi r2,r2,0x0006        |r2 <> 0x00if Target has Chicken or Frog
00186428: 1040000b beq r2,r0,0x00186458     #If Target is a Chicken or a Frog
0018642c: 00000000 nop                          |
00186430: 3c048019 lui r4,0x8019                |
00186434: 248438ce addiu r4,r4,0x38ce           |r4 = Ability XA pointer
00186438: 84830000 lh r3,0x0000(r4)             |r3 = Ability XA
0018643c: 00000000 nop                          |
00186440: 00031040 sll r2,r3,0x01               |XA * 2
00186444: 00431021 addu r2,r2,r3                |XA * 3
00186448: 00021fc2 srl r3,r2,0x1f               |r3 = higher bit of r2 (should be 0x00)
0018644c: 00431021 addu r2,r2,r3                |XA*3 + 0x00
00186450: 00021043 sra r2,r2,0x01               |r2 = XA *3/2
00186454: a4820000 sh r2,0x0000(r4)             |Store XA (150% of previous value)
00186458: 03e00008 jr r31                   END
0018645c: 00000000 nop           

Return Locations

Battle.bin
00188620: Physical XA Modifying Statuses/Support 
00188afc: Cluster of Physical Routines
001898b0: 28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%