Difference between revisions of "Move/Jump +X Calculation"

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:
  Move/Jump +X Calculation (CAN BE USED TO LOAD DATA AT START OF BATTL E
+
  HP initialization + Move/Jump +X Calculation (CAN BE USED TO LOAD DATA AT START OF BATTLE
  0005c8ec: 14a00005 bne r5,r0,0x0005c904 Branch if not Setting Current  HP/MP to Max
+
  0005c8f0: 00000000 nop
+
Parameters : r4 = Unit data pointer
  0005c8f4: 9482002a lhu r2,0x002a(r4) Load Unit's Max HP
+
              r5 = Input value / if <> 0x00 will skip HP initialization
  0005c8f8: 9483002e lhu r3,0x002e(r4) Load Unit's Max MP
+
--------------------------------------------------------------------------------------------------
  0005c8fc: a4820028 sh r2,0x0028(r4) Store Current HP = Max HP
+
  0005c8ec: 14a00005 bne r5,r0,0x0005c904     {{f/Cond|<nowiki>If Input value = 0x00</nowiki>}}
  0005c900: a483002c sh r3,0x002c(r4) Store Current MP = Max MP
+
  0005c8f0: 00000000 nop                         |{{f/std|}}
  0005c904: 9085003a lbu r5,0x003a(r4) Load Unit's Move
+
  0005c8f4: 9482002a lhu r2,0x002a(r4)           |{{f/load|<nowiki>r2 = Unit's max HP</nowiki>}}
  0005c908: 90860093 lbu r6,0x0093(r4) Load Unit's 1st set of Movements
+
  0005c8f8: 9483002e lhu r3,0x002e(r4)           |{{f/load|<nowiki>r3 = Unit's Max MP</nowiki>}}
  0005c90c: 9083003b lbu r3,0x003b(r4) Load Unit's Jump
+
  0005c8fc: a4820028 sh r2,0x0028(r4)             |{{f/store|<nowiki>Store Unit Current HP = Max HP</nowiki>}}
  0005c910: 30c20080 andi r2,r6,0x0080
+
  0005c900: a483002c sh r3,0x002c(r4)             |{{f/store|<nowiki>Store Unit Current MP = Max MP</nowiki>}}
  0005c914: 10400002 beq r2,r0,0x0005c920 Branch if Unit doesn't have Move +1
+
  0005c904: 9085003a lbu r5,0x003a(r4)       |{{f/load|<nowiki>r5 = Unit's Move</nowiki>}}
  0005c918: 30c20040 andi r2,r6,0x0040
+
  0005c908: 90860093 lbu r6,0x0093(r4)       |{{f/load|<nowiki>r6 = Unit's 1st set of Movements</nowiki>}}
  0005c91c: 24a50001 addiu r5,r5,0x0001 Move += 1
+
  0005c90c: 9083003b lbu r3,0x003b(r4)       |{{f/load|<nowiki>r3 = Unit's Jump</nowiki>}}
  0005c920: 10400002 beq r2,r0,0x0005c92c Branch if Unit doesn't have Move +2
+
  0005c910: 30c20080 andi r2,r6,0x0080       |{{f/std|<nowiki>r2 = 0x80 if Unit uses Move + 1</nowiki>}}
  0005c924: 30c20020 andi r2,r6,0x0020
+
  0005c914: 10400002 beq r2,r0,0x0005c920     {{f/Cond|If Unit uses Move +1}}
  0005c928: 24a50002 addiu r5,r5,0x0002 Move += 2
+
  0005c918: 30c20040 andi r2,r6,0x0040       |{{f/std|<nowiki>r2 = 0x40 if unit uses Move + 2</nowiki>}}
  0005c92c: 10400002 beq r2,r0,0x0005c938 Branch if Unit doesn't have Move +3
+
  0005c91c: 24a50001 addiu r5,r5,0x0001           |{{f/std|<nowiki>r5 = Unit's move + 1</nowiki>}}
  0005c930: 30c20010 andi r2,r6,0x0010
+
  0005c920: 10400002 beq r2,r0,0x0005c92c     {{f/Cond|If Unit uses Move +2}}
  0005c934: 24a50003 addiu r5,r5,0x0003 Move += 3
+
  0005c924: 30c20020 andi r2,r6,0x0020       |{{f/std|<nowiki>r2 = 0x20 if unit uses Move + 3</nowiki>}}
  0005c938: 10400002 beq r2,r0,0x0005c944 Branch if Unit doesn't have Jump +1
+
  0005c928: 24a50002 addiu r5,r5,0x0002           |{{f/std|<nowiki>r5 = Unit's Move + 2</nowiki>}}
  0005c93c: 30c20008 andi r2,r6,0x0008
+
  0005c92c: 10400002 beq r2,r0,0x0005c938     {{f/Cond|If Unit uses Move + 3}}
  0005c940: 24630001 addiu r3,r3,0x0001 Jump += 1
+
  0005c930: 30c20010 andi r2,r6,0x0010       |{{f/std|<nowiki>r2 = 0x10 if Unit uses Jump + 1</nowiki>}}
  0005c944: 10400002 beq r2,r0,0x0005c950 Branch if Unit doesn't have Jump +2
+
  0005c934: 24a50003 addiu r5,r5,0x0003           |{{f/std|<nowiki>r5 = Unit's Move + 3</nowiki>}}
  0005c948: 30c20004 andi r2,r6,0x0004
+
  0005c938: 10400002 beq r2,r0,0x0005c944     {{f/Cond|If Unit uses Jump +1}}
  0005c94c: 24630002 addiu r3,r3,0x0002 Jump += 2
+
  0005c93c: 30c20008 andi r2,r6,0x0008       |{{f/std|<nowiki>r2 = 0x08 if Unit uses Jump + 2</nowiki>}}
  0005c950: 10400002 beq r2,r0,0x0005c95c Branch if Unit doesn't have Jump +3
+
  0005c940: 24630001 addiu r3,r3,0x0001           |{{f/std|<nowiki>r3 = Unit's Jump + 1</nowiki>}}
  0005c954: 30a2ffff andi r2,r5,0xffff
+
  0005c944: 10400002 beq r2,r0,0x0005c950     {{f/Cond|If Unit uses Jump + 2}}
  0005c958: 24630003 addiu r3,r3,0x0003 Jump += 3
+
  0005c948: 30c20004 andi r2,r6,0x0004       |{{f/std|<nowiki>r2 = 0x04 if Unit uses Jump +3</nowiki>}}
  0005c95c: 2c4200fd sltiu r2,r2,0x00fd
+
  0005c94c: 24630002 addiu r3,r3,0x0002           |{{f/std|<nowiki>r3 = Unit's Jump + 2</nowiki>}}
  0005c960: 14400002 bne r2,r0,0x0005c96c Branch if Unit's Move < 253
+
  0005c950: 10400002 beq r2,r0,0x0005c95c     {{f/Cond|If Unit uses Jump + 3}}
  0005c964: 3062ffff andi r2,r3,0xffff
+
  0005c954: 30a2ffff andi r2,r5,0xffff       |{{f/std|<nowiki>r2 = Unit's Move (halfword)</nowiki>}}
  0005c968: 340500fc ori r5,r0,0x00fc Move = 252
+
  0005c958: 24630003 addiu r3,r3,0x0003           |{{f/std|<nowiki>r3 = Unit's Jump + 3</nowiki>}}
  0005c96c: 2c420008 sltiu r2,r2,0x0008
+
  0005c95c: 2c4200fd sltiu r2,r2,0x00fd       |{{f/std|<nowiki>r2 = 0x01 if Unit's Move < 0xfd (253)</nowiki>}}
  0005c970: 14400002 bne r2,r0,0x0005c97c Branch if Unit's Jump < 8
+
  0005c960: 14400002 bne r2,r0,0x0005c96c     {{f/Cond|If Unit's Move > 252}}
  0005c974: a085003a sb r5,0x003a(r4) Store Move
+
  0005c964: 3062ffff andi r2,r3,0xffff       |{{f/std|<nowiki>r2 = Unit's Jump (halfword)</nowiki>}}
  0005c978: 34030007 ori r3,r0,0x0007 Jump = 7
+
  0005c968: 340500fc ori r5,r0,0x00fc             |{{f/std|<nowiki>r5 = Unit's Move caped to 252</nowiki>}}
  0005c97c: 03e00008 jr r31
+
  0005c96c: 2c420008 sltiu r2,r2,0x0008       |{{f/std|<nowiki>r2 = 0x01 if Unit's Jump < 0x08</nowiki>}}
  0005c980: a083003b sb r3,0x003b(r4) Store Jump
+
  0005c970: 14400002 bne r2,r0,0x0005c97c     {{f/Cond|If Unit's Jump > 7}}
 
+
  0005c974: a085003a sb r5,0x003a(r4)         |{{f/store|Store Unit's Move}}
 
+
  0005c978: 34030007 ori r3,r0,0x0007             |{{f/std|<nowiki>r3 = Unit's Jump forced to 0x07</nowiki>}}
 +
  0005c97c: 03e00008 jr r31                      
 +
  0005c980: a083003b sb r3,0x003b(r4)         |{{f/store|Store Unit's Jump}}
  
 
== Return Locations ==
 
== Return Locations ==
 
+
'''SCUS_942.21'''
 
  0005ab24: [[Equipment/Move/Jump +X/Name Storing/Generation]]
 
  0005ab24: [[Equipment/Move/Jump +X/Name Storing/Generation]]
 
  0005d6fc: [[Status Setting/Checking + Equip/R/S/M Stats]]
 
  0005d6fc: [[Status Setting/Checking + Equip/R/S/M Stats]]

Latest revision as of 19:53, 21 March 2022

HP initialization + Move/Jump +X Calculation (CAN BE USED TO LOAD DATA AT START OF BATTLE

Parameters : r4 = Unit data pointer
             r5 = Input value / if <> 0x00 will skip HP initialization
--------------------------------------------------------------------------------------------------
0005c8ec: 14a00005 bne r5,r0,0x0005c904     #If Input value = 0x00
0005c8f0: 00000000 nop                          |
0005c8f4: 9482002a lhu r2,0x002a(r4)            |r2 = Unit's max HP
0005c8f8: 9483002e lhu r3,0x002e(r4)            |r3 = Unit's Max MP
0005c8fc: a4820028 sh r2,0x0028(r4)             |Store Unit Current HP = Max HP
0005c900: a483002c sh r3,0x002c(r4)             |Store Unit Current MP = Max MP
0005c904: 9085003a lbu r5,0x003a(r4)        |r5 = Unit's Move
0005c908: 90860093 lbu r6,0x0093(r4)        |r6 = Unit's 1st set of Movements
0005c90c: 9083003b lbu r3,0x003b(r4)        |r3 = Unit's Jump
0005c910: 30c20080 andi r2,r6,0x0080        |r2 = 0x80 if Unit uses Move + 1
0005c914: 10400002 beq r2,r0,0x0005c920     #If Unit uses Move +1
0005c918: 30c20040 andi r2,r6,0x0040        |r2 = 0x40 if unit uses Move + 2
0005c91c: 24a50001 addiu r5,r5,0x0001           |r5 = Unit's move + 1
0005c920: 10400002 beq r2,r0,0x0005c92c     #If Unit uses Move +2
0005c924: 30c20020 andi r2,r6,0x0020        |r2 = 0x20 if unit uses Move + 3
0005c928: 24a50002 addiu r5,r5,0x0002           |r5 = Unit's Move + 2
0005c92c: 10400002 beq r2,r0,0x0005c938     #If Unit uses Move + 3
0005c930: 30c20010 andi r2,r6,0x0010        |r2 = 0x10 if Unit uses Jump + 1
0005c934: 24a50003 addiu r5,r5,0x0003           |r5 = Unit's Move + 3
0005c938: 10400002 beq r2,r0,0x0005c944     #If Unit uses Jump +1
0005c93c: 30c20008 andi r2,r6,0x0008        |r2 = 0x08 if Unit uses Jump + 2
0005c940: 24630001 addiu r3,r3,0x0001           |r3 = Unit's Jump + 1
0005c944: 10400002 beq r2,r0,0x0005c950     #If Unit uses Jump + 2
0005c948: 30c20004 andi r2,r6,0x0004        |r2 = 0x04 if Unit uses Jump +3
0005c94c: 24630002 addiu r3,r3,0x0002           |r3 = Unit's Jump + 2
0005c950: 10400002 beq r2,r0,0x0005c95c     #If Unit uses Jump + 3
0005c954: 30a2ffff andi r2,r5,0xffff        |r2 = Unit's Move (halfword)
0005c958: 24630003 addiu r3,r3,0x0003           |r3 = Unit's Jump + 3
0005c95c: 2c4200fd sltiu r2,r2,0x00fd       |r2 = 0x01 if Unit's Move < 0xfd (253)
0005c960: 14400002 bne r2,r0,0x0005c96c     #If Unit's Move > 252
0005c964: 3062ffff andi r2,r3,0xffff        |r2 = Unit's Jump (halfword)
0005c968: 340500fc ori r5,r0,0x00fc             |r5 = Unit's Move caped to 252
0005c96c: 2c420008 sltiu r2,r2,0x0008       |r2 = 0x01 if Unit's Jump < 0x08
0005c970: 14400002 bne r2,r0,0x0005c97c     #If Unit's Jump > 7
0005c974: a085003a sb r5,0x003a(r4)         |Store Unit's Move
0005c978: 34030007 ori r3,r0,0x0007             |r3 = Unit's Jump forced to 0x07
0005c97c: 03e00008 jr r31                       
0005c980: a083003b sb r3,0x003b(r4)         |Store Unit's Jump

Return Locations

SCUS_942.21
0005ab24: Equipment/Move/Jump +X/Name Storing/Generation
0005d6fc: Status Setting/Checking + Equip/R/S/M Stats