Get Unit Misc Data Pointer By Battle Unit Index
Jump to navigation
Jump to search
# ROUTINE: GET UNIT MISC DATA POINTER BY BATTLE UNIT INDEX # Parameters: # r4 = (p_battleUnitIndex) Battle unit index (to find the unit misc data pointer for) # Returns: # r2 = (Unit misc data pointer) for specified battle unit index, or null if the specified battle unit index had no corresponding data. 8007a724: 3c03800a lui r3,0x800a 8007a728: 8c638a54 lw r3,-0x75ac(r3) # miscDataPointer = *0x80098a54; 8007a72c: 00000000 nop 8007a730: 1060000e beq r3,r0,0x8007a76c # if (miscDataPointer == null) 8007a734: 00001021 addu r2,r0,r0 # return null; 8007a738: 3084ffff andi r4,r4,0xffff # do { 8007a73c: 8c620134 lw r2,0x0134(r3) # miscDataPointer.battleUnit 8007a740: 00000000 nop 8007a744: 10400005 beq r2,r0,0x8007a75c # if (miscDataPointer.battleUnit != null) { 8007a748: 00000000 nop 8007a74c: 9042018a lbu r2,0x018a(r2) # battleUnitIndex = miscDataPointer.battleUnit.unitIndex 8007a750: 00000000 nop 8007a754: 10440005 beq r2,r4,0x8007a76c # if (battleUnitIndex == p_battleUnitIndex) 8007a758: 00601021 addu r2,r3,r0 # return miscDataPointer; # } 8007a75c: 8c630000 lw r3,0x0000(r3) # miscDataPointer = miscDataPointer.previous; 8007a760: 00000000 nop 8007a764: 1460fff5 bne r3,r0,0x8007a73c # } while (miscDataPointer != null); 8007a768: 00001021 addu r2,r0,r0 # return null; 8007a76c: 03e00008 jr r31 8007a770: 00000000 nop