Difference between revisions of "0007a7b8 - 0007a83c"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0007a774: 3c03800a lui r3,0x800a 0007a778: 8c638a54 lw r3,-0x75ac(r3) load misc data 0007a77c: 00000000 nop 0007a780: 1060000b beq r3,r0,0x00...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<font face='Courier New'>
+
#Parameters:
 +
  #r4 = Misc Unit ID
 
   
 
   
  0007a774: 3c03800a lui r3,0x800a
+
  #Returns:
  0007a778: 8c638a54 lw r3,-0x75ac(r3) load misc data
+
  #r2 = 0 if invalid unit
  0007a77c: 00000000 nop
+
      = 1 if ?
  0007a780: 1060000b beq r3,r0,0x0007a7b0
+
 
  0007a784: 00002021 addu r4,r0,r0
+
0007a7b8: 27bdffe8 addiu r29,r29,-0x0018
  0007a788: 3405009b ori r5,r0,0x009b
+
0007a7bc: afbf0010 sw r31,0x0010(r29)
  0007a78c: 90620006 lbu r2,0x0006(r3) load spritesheet ID
+
0007a7c0: 0c01e9b9 jal 0x0007a6e4              #[[Find Current Misc Unit Data Pointer (external ID)?]]
  0007a790: 00000000 nop
+
0007a7c4: 3084ffff andi r4,r4,0xffff          #
  0007a794: 14450002 bne r2,r5,0x0007a7a0 branch if not WEP1/2?
+
0007a7c8: 00402821 addu r5,r2,r0              #r5 = Misc Unit Data Pointer
  0007a798: 00000000 nop
+
0007a7cc: 10a00017 beq r5,r0,0x0007a82c        #Branch if invalid Unit ID
  0007a79c: 24840001 addiu r4,r4,0x0001
+
0007a7d0: 00000000 nop                            #
  0007a7a0: 8c630000 lw r3,0x0000(r3) load previous units
+
0007a7d4: 3c03800a lui r3,0x800a                   #
  0007a7a4: 00000000 nop
+
  0007a7d8: 24638a54 addiu r3,r3,-0x75ac             #r3 = Last Unit misc data pointer?
  0007a7a8: 1460fff8 bne r3,r0,0x0007a78c branch if not first
+
0007a7dc: 10600014 beq r3,r0,0x0007a830            #Branch if invalid Unit ID
  0007a7ac: 00000000 nop
+
0007a7e0: 00001021 addu r2,r0,r0                  #Return r2 = 0
  0007a7b0: 03e00008 jr r31
+
0007a7e4: 8c620000 lw r2,0x0000(r3)                   #r2 = Pointer to next previous unit's misc data
  0007a7b4: 00801021 addu r2,r4,r0
+
  0007a7e8: 00000000 nop                                 #
</font>
+
  0007a7ec: 10450006 beq r2,r5,0x0007a808                #Branch if current unit is previous unit
 +
0007a7f0: 00000000 nop                                    #
 +
  0007a7f4: 00401821 addu r3,r2,r0                           #r3 = pointer to previous unit's misc data
 +
  0007a7f8: 1460fffa bne r3,r0,0x0007a7e4                #^Loop if not first unit?
 +
  0007a7fc: 00001021 addu r2,r0,r0                          #r2 = 0
 +
0007a800: 0801ea0c j 0x0007a830                            #Jump to End
 +
  0007a804: 00000000 nop                                     #
 +
  0007a808: 8ca20000 lw r2,0x0000(r5)                    #r2 = Pointer to previous unit's misc data
 +
  0007a80c: 3c04800a lui r4,0x800a                      #
 +
  0007a810: 24848a54 addiu r4,r4,-0x75ac                #r4 = Last Unit misc data pointer?
 +
0007a814: ac620000 sw r2,0x0000(r3)                    #Save ?
 +
  0007a818: 8c830000 lw r3,0x0000(r4)                    #r3 = ?
 +
0007a81c: 34020001 ori r2,r0,0x0001                    #r2 = 1
 +
0007a820: aca30000 sw r3,0x0000(r5)                   #Save ?
 +
0007a824: 0801ea0c j 0x0007a830                        #Jump to END
 +
  0007a828: ac850000 sw r5,0x0000(r4)                    #Save ?
 +
  0007a82c: 00001021 addu r2,r0,r0              #r2 = 0 (fail case)
 +
 +
  End:
 +
  0007a830: 8fbf0010 lw r31,0x0010(r29)
 +
  0007a834: 27bd0018 addiu r29,r29,0x0018
 +
0007a838: 03e00008 jr r31
 +
0007a83c: 00000000 nop

Latest revision as of 10:32, 11 February 2024

#Parameters:
  #r4 = Misc Unit ID

#Returns:
  #r2 = 0 if invalid unit
      = 1 if ?
0007a7b8: 27bdffe8 addiu r29,r29,-0x0018
0007a7bc: afbf0010 sw r31,0x0010(r29)
0007a7c0: 0c01e9b9 jal 0x0007a6e4              #Find Current Misc Unit Data Pointer (external ID)?
0007a7c4: 3084ffff andi r4,r4,0xffff           #
0007a7c8: 00402821 addu r5,r2,r0               #r5 = Misc Unit Data Pointer
0007a7cc: 10a00017 beq r5,r0,0x0007a82c        #Branch if invalid Unit ID
0007a7d0: 00000000 nop                             #
0007a7d4: 3c03800a lui r3,0x800a                   #
0007a7d8: 24638a54 addiu r3,r3,-0x75ac             #r3 = Last Unit misc data pointer?
0007a7dc: 10600014 beq r3,r0,0x0007a830            #Branch if invalid Unit ID
0007a7e0: 00001021 addu r2,r0,r0                   #Return r2 = 0
0007a7e4: 8c620000 lw r2,0x0000(r3)                    #r2 = Pointer to next previous unit's misc data
0007a7e8: 00000000 nop                                 #
0007a7ec: 10450006 beq r2,r5,0x0007a808                #Branch if current unit is previous unit
0007a7f0: 00000000 nop                                     #
0007a7f4: 00401821 addu r3,r2,r0                           #r3 = pointer to previous unit's misc data
0007a7f8: 1460fffa bne r3,r0,0x0007a7e4                #^Loop if not first unit?
0007a7fc: 00001021 addu r2,r0,r0                           #r2 = 0
0007a800: 0801ea0c j 0x0007a830                            #Jump to End
0007a804: 00000000 nop                                     #
0007a808: 8ca20000 lw r2,0x0000(r5)                    #r2 = Pointer to previous unit's misc data
0007a80c: 3c04800a lui r4,0x800a                       #
0007a810: 24848a54 addiu r4,r4,-0x75ac                 #r4 = Last Unit misc data pointer?
0007a814: ac620000 sw r2,0x0000(r3)                    #Save ?
0007a818: 8c830000 lw r3,0x0000(r4)                    #r3 = ?
0007a81c: 34020001 ori r2,r0,0x0001                    #r2 = 1
0007a820: aca30000 sw r3,0x0000(r5)                    #Save ?
0007a824: 0801ea0c j 0x0007a830                        #Jump to END
0007a828: ac850000 sw r5,0x0000(r4)                    #Save ?
0007a82c: 00001021 addu r2,r0,r0               #r2 = 0 (fail case)

End:
0007a830: 8fbf0010 lw r31,0x0010(r29)
0007a834: 27bd0018 addiu r29,r29,0x0018
0007a838: 03e00008 jr r31
0007a83c: 00000000 nop