Get Free Party Slot Status
Jump to navigation
Jump to search
# ROUTINE: Get Free Party Slot Status # Parameters: # r4 = (unitIndex) Battle unit index # Returns: # r2 = 2, if unit is joining as Guest # 1, if there is a free party slot # 0, otherwise 801c6000: 27bdffe0 addiu r29,r29,-0x0020 801c6004: afbf0018 sw r31,0x0018(r29) 801c6008: afb10014 sw r17,0x0014(r29) 801c600c: 0c0602bf jal 0x80180afc # unit = Get Unit's Data Pointer (unitIndex); 801c6010: afb00010 sw r16,0x0010(r29) 801c6014: 90420006 lbu r2,0x0006(r2) # unit.Flags 801c6018: 00000000 nop 801c601c: 30420001 andi r2,r2,0x0001 # unit.Flags & UNIT_FLAGS_JOIN_AS_GUEST 801c6020: 14400019 bne r2,r0,0x801c6088 # if (unit.Flags & UNIT_FLAGS_JOIN_AS_GUEST) return 2; 801c6024: 34020002 ori r2,r0,0x0002 801c6028: 00008021 addu r16,r0,r0 # index = 0 801c602c: 341100ff ori r17,r0,0x00ff # 0xff # do { 801c6030: 0c0166bc jal 0x80059af0 # partyUnit = Get Party Data Pointer (index); 801c6034: 02002021 addu r4,r16,r0 801c6038: 00402821 addu r5,r2,r0 # partyUnit 801c603c: 90a20001 lbu r2,0x0001(r5) # partyUnit.partyIndex 801c6040: 00000000 nop 801c6044: 10510007 beq r2,r17,0x801c6064 # if (partyUnit.partyIndex == 0xff) continue; // Unit doesn't exist 801c6048: 00000000 nop 801c604c: 90a20000 lbu r2,0x0000(r5) # partyUnit.BaseClass 801c6050: 00000000 nop 801c6054: 10400003 beq r2,r0,0x801c6064 # if (partyUnit.BaseClass == 0) continue; 801c6058: 2c420004 sltiu r2,r2,0x0004 801c605c: 14400005 bne r2,r0,0x801c6074 # if (partyUnit.BaseClass < 4) break; 801c6060: 00000000 nop 801c6064: 26100001 addiu r16,r16,0x0001 # index = index + 1 801c6068: 2a020014 slti r2,r16,0x0014 801c606c: 1440fff0 bne r2,r0,0x801c6030 801c6070: 00000000 nop # } while (index < 20); 801c6074: 00002021 addu r4,r0,r0 801c6078: 0c016757 jal 0x80059d5c # partyIndex = Find Free Party Index (0, partyUnit + 3); // Writes 0 to Team ID for this party unit 801c607c: 24a50003 addiu r5,r5,0x0003 801c6080: 00021027 nor r2,r0,r2 801c6084: 0002102b sltu r2,r0,r2 # return (partyIndex != -1); 801c6088: 8fbf0018 lw r31,0x0018(r29) 801c608c: 8fb10014 lw r17,0x0014(r29) 801c6090: 8fb00010 lw r16,0x0010(r29) 801c6094: 27bd0020 addiu r29,r29,0x0020 801c6098: 03e00008 jr r31 801c609c: 00000000 nop