Difference between revisions of "0014a39c - 0014a3f4"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0014a39c: 27bdffe8 addiu r29,r29,0xffe8 0014a3a0: afb00010 sw r16,0x0010(r29) 0014a3a4: 2410ffff addiu r16,r0,0xffff 0014a3a8: 28820080 slti r2...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<font face='Courier New'>
+
Parameters : r4 = Variable ID
 
   
 
   
  0014a39c: 27bdffe8 addiu r29,r29,0xffe8
+
Returns : r2 = -0x01 if Variable is a word (ID < 0x80)
  0014a3a0: afb00010 sw r16,0x0010(r29)
+
          r2 = Variable position in his word (ID from 0x80 to 0x3ff)
  0014a3a4: 2410ffff addiu r16,r0,0xffff
+
          r2 = new thread r16 value if Variable ID > 0x400
  0014a3a8: 28820080 slti r2,r4,0x0080
+
---------------------------------------------------------------------------
  0014a3ac: 1440000c bne r2,r0,0x0014a3e0
+
  0014a39c: 27bdffe8 addiu r29,r29,-0x0018   
  0014a3b0: afbf0014 sw r31,0x0014(r29)
+
  0014a3a0: afb00010 sw r16,0x0010(r29)      
  0014a3b4: 28820360 slti r2,r4,0x0360
+
  0014a3a4: 2410ffff addiu r16,r0,-0x0001    |{{f/std|<nowiki>r16 = -0x01</nowiki>}}
  0014a3b8: 10400003 beq r2,r0,0x0014a3c8
+
  0014a3a8: 28820080 slti r2,r4,0x0080       |{{f/std|<nowiki>r2 = 0x01 if Variable ID < 0x80 </nowiki>}}
  0014a3bc: 28820400 slti r2,r4,0x0400
+
  0014a3ac: 1440000c bne r2,r0,0x0014a3e0     {{f/Cond|<nowiki>If Variable is not a word (ID >= 0x80)</nowiki>}}
  0014a3c0: 080528f8 j 0x0014a3e0
+
  0014a3b0: afbf0014 sw r31,0x0014(r29)           |
  0014a3c4: 3090001f andi r16,r4,0x001f
+
  0014a3b4: 28820360 slti r2,r4,0x0360           |{{f/std|<nowiki>r2 = 0x01 if Variable < 0x360</nowiki>}}
  0014a3c8: 10400003 beq r2,r0,0x0014a3d8
+
  0014a3b8: 10400003 beq r2,r0,0x0014a3c8         {{f/Cond|<nowiki>If Variable < 0x360 (Variable length = 1 bit)</nowiki>}}
  0014a3cc: 30820007 andi r2,r4,0x0007
+
  0014a3bc: 28820400 slti r2,r4,0x0400           |{{f/std|<nowiki>r2 = 1 if Variable ID <0x400</nowiki>}}
  0014a3d0: 080528f8 j 0x0014a3e0
+
  0014a3c0: 080528f8 j 0x0014a3e0                     {{f/jump|jump to nearly end}}
  0014a3d4: 00028080 sll r16,r2,0x02
+
  0014a3c4: 3090001f andi r16,r4,0x001f               |{{f/std|<nowiki>r16 = Variable ID/32 reminder</nowiki>}} {{f/std|<nowiki>* 32 Variables per words : r16 = Variable position in his word</nowiki>}}
  0014a3d8: 0c053256 jal 0x0014c958
+
  0014a3c8: 10400003 beq r2,r0,0x0014a3d8         {{f/Cond|<nowiki>if r4 is between 0x360 and 0x3FF (variable length = 8 bits)</nowiki>}}
  0014a3dc: 00000000 nop
+
  0014a3cc: 30820007 andi r2,r4,0x0007               |{{f/std|<nowiki>r2 = Variable ID/8 reminder</nowiki>}} {{f/std| 8 Variables per words (results will be 0 to 7)}}
  0014a3e0: 02001021 addu r2,r16,r0
+
  0014a3d0: 080528f8 j 0x0014a3e0                     {{f/jump|Jump to nearly end}}
  0014a3e4: 8fbf0014 lw r31,0x0014(r29)
+
  0014a3d4: 00028080 sll r16,r2,0x02                 |{{f/std|<nowiki>r16 = r2 * 4 </nowiki>}} {{f/std|<nowiki>* Results will be 0 to 28  - r16 = Variable starting position in his word</nowiki>}}
  0014a3e8: 8fb00010 lw r16,0x0010(r29)
+
  0014a3d8: 0c053256 jal 0x0014c958               |{{f/jal|0014c958_-_0014c990|0014c958_-_0014c990}} Stop current running thread ans seek another one to run
  0014a3ec: 27bd0018 addiu r29,r29,0x0018
+
  0014a3dc: 00000000 nop                         |
  0014a3f0: 03e00008 jr r31
+
  0014a3e0: 02001021 addu r2,r16,r0           |{{f/std|Returns r2}}
  0014a3f4: 00000000 nop
+
  0014a3e4: 8fbf0014 lw r31,0x0014(r29)       END
</font>
+
  0014a3e8: 8fb00010 lw r16,0x0010(r29)          
 +
  0014a3ec: 27bd0018 addiu r29,r29,0x0018        
 +
  0014a3f0: 03e00008 jr r31                      
 +
  0014a3f4: 00000000 nop nop
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
0014a090: [[Run_Script_Variable_Command]]
 +
0014a0d8: [[Run_Script_Variable_Command]]

Latest revision as of 19:36, 6 March 2022

Parameters : r4 = Variable ID

Returns : r2 = -0x01 if Variable is a word (ID < 0x80)
          r2 = Variable position in his word (ID from 0x80 to 0x3ff)
          r2 = new thread r16 value if Variable ID > 0x400
---------------------------------------------------------------------------
0014a39c: 27bdffe8 addiu r29,r29,-0x0018    
0014a3a0: afb00010 sw r16,0x0010(r29)       
0014a3a4: 2410ffff addiu r16,r0,-0x0001     |r16 = -0x01
0014a3a8: 28820080 slti r2,r4,0x0080        |r2 = 0x01 if Variable ID < 0x80 
0014a3ac: 1440000c bne r2,r0,0x0014a3e0     #If Variable is not a word (ID >= 0x80)
0014a3b0: afbf0014 sw r31,0x0014(r29)           |
0014a3b4: 28820360 slti r2,r4,0x0360            |r2 = 0x01 if Variable < 0x360
0014a3b8: 10400003 beq r2,r0,0x0014a3c8         #If Variable < 0x360 (Variable length = 1 bit)
0014a3bc: 28820400 slti r2,r4,0x0400            |r2 = 1 if Variable ID <0x400
0014a3c0: 080528f8 j 0x0014a3e0                     >>jump to nearly end
0014a3c4: 3090001f andi r16,r4,0x001f               |r16 = Variable ID/32 reminder * 32 Variables per words : r16 = Variable position in his word
0014a3c8: 10400003 beq r2,r0,0x0014a3d8         #if r4 is between 0x360 and 0x3FF (variable length = 8 bits)
0014a3cc: 30820007 andi r2,r4,0x0007                |r2 = Variable ID/8 reminder  8 Variables per words (results will be 0 to 7)
0014a3d0: 080528f8 j 0x0014a3e0                     >>Jump to nearly end
0014a3d4: 00028080 sll r16,r2,0x02                  |r16 = r2 * 4  * Results will be 0 to 28  - r16 = Variable starting position in his word
0014a3d8: 0c053256 jal 0x0014c958               |-->0014c958_-_0014c990 Stop current running thread ans seek another one to run
0014a3dc: 00000000 nop                          |
0014a3e0: 02001021 addu r2,r16,r0           |Returns r2
0014a3e4: 8fbf0014 lw r31,0x0014(r29)       END
0014a3e8: 8fb00010 lw r16,0x0010(r29)           
0014a3ec: 27bd0018 addiu r29,r29,0x0018         
0014a3f0: 03e00008 jr r31                       
0014a3f4: 00000000 nop nop

Return locations

Battle.bin
0014a090: Run_Script_Variable_Command
0014a0d8: Run_Script_Variable_Command