Difference between revisions of "Get Unit Tile data pointer from Unit ID"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0008dfac: 27bdffe8 addiu r29,r29,0xffe8 0008dfb0: afbf0010 sw r31,0x0010(r29) 0008dfb4: 0c01e9c9 jal 0x0007a724 0008dfb8: 3084ffff andi r4,r4,0...")
 
m (return link)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<font face='Courier New'>
+
Parameters : r4 = Unit ID
 
   
 
   
  0008dfac: 27bdffe8 addiu r29,r29,0xffe8
+
Returns : r2 = Unit Tile data pointer
  0008dfb0: afbf0010 sw r31,0x0010(r29)
+
--------------------------------------------------------
  0008dfb4: 0c01e9c9 jal 0x0007a724
+
  0008dfac: 27bdffe8 addiu r29,r29,-0x0018   
  0008dfb8: 3084ffff andi r4,r4,0xffff
+
  0008dfb0: afbf0010 sw r31,0x0010(r29)      
  0008dfbc: 9044007c lbu r4,0x007c(r2)
+
  0008dfb4: 0c01e9c9 jal 0x0007a724           |{{f/jal|Get_unit_misc_data_that_matches_r4_ID|<nowiki>Get_unit_misc_data_that_matches_r4_ID</nowiki>}} Return r2 = Unit X misc data pointer / If not found = 0x00
  0008dfc0: 9045007d lbu r5,0x007d(r2)
+
  0008dfb8: 3084ffff andi r4,r4,0xffff       |{{f/std|<nowiki>r4 = unit ID</nowiki>}}
  0008dfc4: 9046007e lbu r6,0x007e(r2)
+
  0008dfbc: 9044007c lbu r4,0x007c(r2)       |{{f/load|<nowiki>r4 = Unit X coordinates</nowiki>}}
  0008dfc8: 0c060fed jal 0x00183fb4
+
  0008dfc0: 9045007d lbu r5,0x007d(r2)       |{{f/load|<nowiki>r5 = Unit Y coordinates</nowiki>}}
  0008dfcc: 00000000 nop
+
  0008dfc4: 9046007e lbu r6,0x007e(r2)       |{{f/load|<nowiki>r6 = Unit elevation</nowiki>}}
  0008dfd0: 8fbf0010 lw r31,0x0010(r29)
+
  0008dfc8: 0c060fed jal 0x00183fb4           |{{f/jal|Get_Tile_Data_Pointer|<nowiki>Get_Tile_Data_Pointer</nowiki>}} r2 = Pointer to Tile Data for specified coordinates (0x00 if not valid)
  0008dfd4: 27bd0018 addiu r29,r29,0x0018
+
  0008dfcc: 00000000 nop                    
  0008dfd8: 03e00008 jr r31
+
  0008dfd0: 8fbf0010 lw r31,0x0010(r29)      
  0008dfdc: 00000000 nop
+
  0008dfd4: 27bd0018 addiu r29,r29,0x0018    
</font>
+
  0008dfd8: 03e00008 jr r31                  
 +
  0008dfdc: 00000000 nop                    
 +
=== Return location ===
 +
'''Battle.bin'''
 +
  001af410: [[Maths_For_Arcing_Trajectory]]

Latest revision as of 22:19, 28 January 2022

Parameters : r4 = Unit ID

Returns : r2 = Unit Tile data pointer
--------------------------------------------------------
0008dfac: 27bdffe8 addiu r29,r29,-0x0018    
0008dfb0: afbf0010 sw r31,0x0010(r29)       
0008dfb4: 0c01e9c9 jal 0x0007a724           |-->Get_unit_misc_data_that_matches_r4_ID Return r2 = Unit X misc data pointer / If not found = 0x00
0008dfb8: 3084ffff andi r4,r4,0xffff        |r4 = unit ID
0008dfbc: 9044007c lbu r4,0x007c(r2)        |r4 = Unit X coordinates
0008dfc0: 9045007d lbu r5,0x007d(r2)        |r5 = Unit Y coordinates
0008dfc4: 9046007e lbu r6,0x007e(r2)        |r6 = Unit elevation
0008dfc8: 0c060fed jal 0x00183fb4           |-->Get_Tile_Data_Pointer r2 = Pointer to Tile Data for specified coordinates (0x00 if not valid)
0008dfcc: 00000000 nop                      
0008dfd0: 8fbf0010 lw r31,0x0010(r29)       
0008dfd4: 27bd0018 addiu r29,r29,0x0018     
0008dfd8: 03e00008 jr r31                   
0008dfdc: 00000000 nop                      

Return location

Battle.bin
 001af410: Maths_For_Arcing_Trajectory