Dismiss Unit Event Instruction
Jump to navigation
Jump to search
# ROUTINE: DismissUnit Event Instruction # Parameters: # r4 = (baseClass) Unit base class to dismiss 801340ac: 27bdffe0 addiu r29,r29,-0x0020 801340b0: afb10014 sw r17,0x0014(r29) 801340b4: 00808821 addu r17,r4,r0 # baseClass 801340b8: afb00010 sw r16,0x0010(r29) 801340bc: 34100001 ori r16,r0,0x0001 # partyUnitIndex = 1 801340c0: afb20018 sw r18,0x0018(r29) 801340c4: 341200ff ori r18,r0,0x00ff # 0xff 801340c8: afbf001c sw r31,0x001c(r29) # do { 801340cc: 0c0166bc jal 0x80059af0 # partyUnit = Get Party Data Pointer (partyUnitIndex); 801340d0: 02002021 addu r4,r16,r0 801340d4: 00402821 addu r5,r2,r0 # partyUnit 801340d8: 90a20001 lbu r2,0x0001(r5) # partyUnit.unitIndex 801340dc: 00000000 nop 801340e0: 10520005 beq r2,r18,0x801340f8 # if (partyUnit.unitIndex != 0xff) { 801340e4: 00000000 nop 801340e8: 90a20000 lbu r2,0x0000(r5) # partyUnit.baseClass 801340ec: 00000000 nop 801340f0: 10510005 beq r2,r17,0x80134108 # if (partyUnit.baseClass == baseClass) break; 801340f4: 34020014 ori r2,r0,0x0014 # } 801340f8: 26100001 addiu r16,r16,0x0001 # partyUnitIndex = partyUnitIndex + 1 801340fc: 2a020014 slti r2,r16,0x0014 80134100: 1440fff2 bne r2,r0,0x801340cc 80134104: 34020014 ori r2,r0,0x0014 # } while (partyUnitIndex < 20); 80134108: 12020016 beq r16,r2,0x80134164 8013410c: 00002021 addu r4,r0,r0 # equipSlotOffset = 0 # if (partyUnitIndex != 20) { 80134110: 340600ff ori r6,r0,0x00ff # 0xff 80134114: 00a41021 addu r2,r5,r4 # equipSlotPtr = partyUnit + equipSlotOffset # do { 80134118: 9043000e lbu r3,0x000e(r2) # itemID = *(equipSlotPtr + 0x0e) 8013411c: 00000000 nop 80134120: 1060000b beq r3,r0,0x80134150 80134124: 24840001 addiu r4,r4,0x0001 # equipSlotOffset = equipSlotOffset + 1 80134128: 1066000a beq r3,r6,0x80134154 # if (itemID == 0xff) continue; 8013412c: 28820007 slti r2,r4,0x0007 80134130: 3c018006 lui r1,0x8006 80134134: 00230821 addu r1,r1,r3 80134138: 902296e0 lbu r2,-0x6920(r1) # availableItemQuantities[itemID] 8013413c: 00000000 nop 80134140: 24420001 addiu r2,r2,0x0001 # availableItemQuantities[itemID] + 1 80134144: 3c018006 lui r1,0x8006 80134148: 00230821 addu r1,r1,r3 8013414c: a02296e0 sb r2,-0x6920(r1) # availableItemQuantities[itemID] = availableItemQuantities[itemID] + 1 80134150: 28820007 slti r2,r4,0x0007 80134154: 1440fff0 bne r2,r0,0x80134118 80134158: 00a41021 addu r2,r5,r4 # equipSlotPtr = partyUnit + equipSlotOffset # } while (equipSlotOffset < 7); 8013415c: 0c0167f8 jal 0x80059fe0 # Remove Unit from Party (partyUnitIndex); 80134160: 02002021 addu r4,r16,r0 # } 80134164: 8fbf001c lw r31,0x001c(r29) 80134168: 8fb20018 lw r18,0x0018(r29) 8013416c: 8fb10014 lw r17,0x0014(r29) 80134170: 8fb00010 lw r16,0x0010(r29) 80134174: 27bd0020 addiu r29,r29,0x0020 80134178: 03e00008 jr r31 8013417c: 00000000 nop