Difference between revisions of "Defense UP routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  001862cc: 3c028019 lui r2,0x8019
+
No Parameters - Returns Nothing
  001862d0: 8c422d98 lw r2,0x2d98(r2) Load Target's Data Pointer
+
  001862d4: 00000000 nop
+
If Target uses Defend Up : Modifiy Ability XA (0x801938ce) to 66% of its initial value
  001862d8: 90420090 lbu r2,0x0090(r2) Load Target's 2nd set of Support
+
----------------------------------------------------------------------------------------------
  001862dc: 00000000 nop
+
  001862cc: 3c028019 lui r2,0x8019          
  001862e0: 30420008 andi r2,r2,0x0008
+
  001862d0: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target's Data Pointer</nowiki>}}
  001862e4: 1040000b beq r2,r0,0x00186314 Branch if Target doesn't have Defense UP
+
  001862d4: 00000000 nop                     |
  001862e8: 3c025555 lui r2,0x5555
+
  001862d8: 90420090 lbu r2,0x0090(r2)       |{{f/load|<nowiki>r2 = Target's 2nd set of Support byte</nowiki>}}
  001862ec: 3c048019 lui r4,0x8019  
+
  001862dc: 00000000 nop                     |
  001862f0: 248438ce addiu r4,r4,0x38ce
+
  001862e0: 30420008 andi r2,r2,0x0008       |{{f/std|<nowiki>r2 = 0x08 if Target uses Defend Up</nowiki>}}
  001862f4: 84830000 lh r3,0x0000(r4) Load XA
+
  001862e4: 1040000b beq r2,r0,0x00186314     {{f/Cond|If Target uses [Defense Up]}}
  001862f8: 34425556 ori r2,r2,0x5556
+
  001862e8: 3c025555 lui r2,0x5555               |
  001862fc: 00031840 sll r3,r3,0x01 XA * 2
+
  001862ec: 3c048019 lui r4,0x8019               |
  00186300: 00620018 mult r3,r2 XA * 2 * 0.33333333
+
  001862f0: 248438ce addiu r4,r4,0x38ce           |{{f/adr|<nowiki>r4 = 0x801938ce (Ability XA pointer)</nowiki>}} {{f/std| 801938ce}}
  00186304: 00031fc3 sra r3,r3,0x1f
+
  001862f4: 84830000 lh r3,0x0000(r4)             |{{f/load|<nowiki>r3 = Abililty XA</nowiki>}}
  00186308: 00001010 mfhi r2 r2 = XA * 2 * 0.33333333 (XA * 2 / 3)
+
  001862f8: 34425556 ori r2,r2,0x5556             |{{f/std|<nowiki>r2 = 0x55555556 (0,33* 2^32)</nowiki>}}
  0018630c: 00431023 subu r2,r2,r3
+
  001862fc: 00031840 sll r3,r3,0x01               |{{f/std|<nowiki>r3 = XA*2</nowiki>}}
  00186310: a4820000 sh r2,0x0000(r4) Store new XA
+
  00186300: 00620018 mult r3,r2                   |{{f/std|XA*2 * 0,33 * 2^32}}
  00186314: 03e00008 jr r31
+
  00186304: 00031fc3 sra r3,r3,0x1f               |{{f/std|<nowiki>r3 = Higher bit of r3 (should be 0x00)</nowiki>}}
  00186318: 00000000 nop
+
  00186308: 00001010 mfhi r2                     |{{f/std|<nowiki>r2 = XA*2/3</nowiki>}}
 
+
  0018630c: 00431023 subu r2,r2,r3               |{{f/std|<nowiki>r2 = XA*2/3 - 0x00</nowiki>}}
 
+
  00186310: a4820000 sh r2,0x0000(r4)             |{{f/store|Store XA (66% of initial value)}}
== Return Locations ==
+
  00186314: 03e00008 jr r31                   END
 
+
  00186318: 00000000 nop        
*Battle.bin
+
=== Return Locations ===
  001885f8 - [[Physical XA Modifying Statuses/Support]]
+
'''Battle.bin'''
  00188adc - [[Cluster of Physical Routines]]
+
  00188618: [[Physical XA Modifying Statuses/Support]]
  00189870 - [[28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%]]
+
  00188af4: [[Cluster of Physical Routines]]
 +
  001898a8: [[28 StealExp_(Lowest of TarCurExp & SP+Y) Hit_(SP+X)%]]

Latest revision as of 21:11, 26 March 2022

No Parameters - Returns Nothing

If Target uses Defend Up : Modifiy Ability XA (0x801938ce) to 66% of its initial value
----------------------------------------------------------------------------------------------
001862cc: 3c028019 lui r2,0x8019            
001862d0: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target's Data Pointer
001862d4: 00000000 nop                      |
001862d8: 90420090 lbu r2,0x0090(r2)        |r2 = Target's 2nd set of Support byte
001862dc: 00000000 nop                      |
001862e0: 30420008 andi r2,r2,0x0008        |r2 = 0x08 if Target uses Defend Up
001862e4: 1040000b beq r2,r0,0x00186314     #If Target uses [Defense Up]
001862e8: 3c025555 lui r2,0x5555                |
001862ec: 3c048019 lui r4,0x8019                |
001862f0: 248438ce addiu r4,r4,0x38ce           |r4 = 0x801938ce (Ability XA pointer)  801938ce
001862f4: 84830000 lh r3,0x0000(r4)             |r3 = Abililty XA
001862f8: 34425556 ori r2,r2,0x5556             |r2 = 0x55555556 (0,33* 2^32)
001862fc: 00031840 sll r3,r3,0x01               |r3 = XA*2
00186300: 00620018 mult r3,r2                   |XA*2 * 0,33 * 2^32
00186304: 00031fc3 sra r3,r3,0x1f               |r3 = Higher bit of r3 (should be 0x00)
00186308: 00001010 mfhi r2                      |r2 = XA*2/3
0018630c: 00431023 subu r2,r2,r3                |r2 = XA*2/3 - 0x00
00186310: a4820000 sh r2,0x0000(r4)             |Store XA (66% of initial value)
00186314: 03e00008 jr r31                   END
00186318: 00000000 nop          

Return Locations

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