Post-battle party full unit join selection

From Final Fantasy Hacktics Wiki
Revision as of 03:42, 22 October 2024 by Nyzer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#   ROUTINE: Post-battle party full unit join selection
#       Related to selecting which unit to remove from party when a unit is joining and the party is full

801c60a0: 27bdffb8 addiu r29,r29,-0x0048
801c60a4: afbf0044 sw r31,0x0044(r29)
801c60a8: afbe0040 sw r30,0x0040(r29)
801c60ac: afb7003c sw r23,0x003c(r29)
801c60b0: afb60038 sw r22,0x0038(r29)
801c60b4: afb50034 sw r21,0x0034(r29)
801c60b8: afb40030 sw r20,0x0030(r29)
801c60bc: afb3002c sw r19,0x002c(r29)
801c60c0: afb20028 sw r18,0x0028(r29)
801c60c4: afb10024 sw r17,0x0024(r29)
801c60c8: 0c071516 jal 0x801c5458                       #   0x1c5458 (); Find Formation Palette Index (REQUIRE.OUT)
801c60cc: afb00020 sw r16,0x0020(r29)
801c60d0: 3c108017 lui r16,0x8017
801c60d4: 8e103fac lw r16,0x3fac(r16)                   #   ptr16 = *0x80173fac
801c60d8: 0c0710ec jal 0x801c43b0                       #   0x1c43b0 (1);
801c60dc: 34040001 ori r4,r0,0x0001
801c60e0: 00008821 addu r17,r0,r0                       #   index = 0
801c60e4: 341500fe ori r21,r0,0x00fe                    #   0xfe
801c60e8: 3416000f ori r22,r0,0x000f                    #   15
801c60ec: 3c14801d lui r20,0x801d
801c60f0: 26940d14 addiu r20,r20,0x0d14                 #   ptr20 = 0x801d0d14
                                                        #   do {
801c60f4: 0c0166bc jal 0x80059af0                       #       partyUnit = Get Party Data Pointer (index);
801c60f8: 02202021 addu r4,r17,r0
801c60fc: 00409021 addu r18,r2,r0                       #       partyUnit
801c6100: 92430001 lbu r3,0x0001(r18)                   #       partyUnit.partyIndex
801c6104: 340200ff ori r2,r0,0x00ff
801c6108: 1062000c beq r3,r2,0x801c613c
801c610c: 2a220010 slti r2,r17,0x0010
801c6110: 1040000a beq r2,r0,0x801c613c                 
801c6114: 00000000 nop
801c6118: 924200d0 lbu r2,0x00d0(r18)
801c611c: 00000000 nop
801c6120: 14400006 bne r2,r0,0x801c613c
801c6124: 00000000 nop
801c6128: 92420004 lbu r2,0x0004(r18)
801c612c: 00000000 nop
801c6130: 30420004 andi r2,r2,0x0004
801c6134: 10400005 beq r2,r0,0x801c614c
801c6138: 34020001 ori r2,r0,0x0001
                                                        #       if ((partyUnit.partyIndex == 0xff) || (index >= 16) || (partyUnit.PropositionStatus != 0) || (partyUnit.Flags & UNIT_FLAGS_HAS_SHROUDED_STATS) != 0) {
801c613c: a2800000 sb r0,0x0000(r20)                    #           *ptr20 = 0
801c6140: a2150000 sb r21,0x0000(r16)                   #           *ptr16 = 0xfe   
801c6144: 08071864 j 0x801c6190
801c6148: 26100001 addiu r16,r16,0x0001                 #           ptr16 = ptr16 + 1
                                                        #       } else {
801c614c: a2820000 sb r2,0x0000(r20)                    #           *ptr20 = 1
801c6150: 00001821 addu r3,r0,r0                        #           offset = 0
801c6154: 02431021 addu r2,r18,r3                       #           partyUnit + offset
                                                        #           do {
801c6158: 904200be lbu r2,0x00be(r2)                    #               currentNameChar = *(partyUnit + offset + 0xbe)
801c615c: 00000000 nop
801c6160: a2020000 sb r2,0x0000(r16)                    #               *ptr16 = currentNameChar
801c6164: 304200fe andi r2,r2,0x00fe                    #               currentNameChar & 0xfe          // Check if sentinel value
801c6168: 1055fff6 beq r2,r21,0x801c6144                #               if ((currentNameChar & 0xfe) == 0xfe) { ptr16 = ptr16 + 1; break; }
801c616c: 00000000 nop
801c6170: 14760003 bne r3,r22,0x801c6180                 
801c6174: 26100001 addiu r16,r16,0x0001                 #               ptr16 = ptr16 + 1
                                                        #               if (offset == 15) {
801c6178: a2150000 sb r21,0x0000(r16)                   #                   *ptr16 = 0xfe
801c617c: 26100001 addiu r16,r16,0x0001                 #                   ptr16 = ptr16 + 1
                                                        #               }
801c6180: 24630001 addiu r3,r3,0x0001                   #               offset = offset + 1
801c6184: 28620010 slti r2,r3,0x0010
801c6188: 1440fff3 bne r2,r0,0x801c6158
801c618c: 02431021 addu r2,r18,r3                       #               partyUnit + offset
                                                        #           } while (offset < 16);
                                                        #       }
801c6190: 26310001 addiu r17,r17,0x0001                 #       index = index + 1
801c6194: 2a220014 slti r2,r17,0x0014
801c6198: 1440ffd6 bne r2,r0,0x801c60f4
801c619c: 26940001 addiu r20,r20,0x0001                 #       ptr20 = ptr20 + 1
                                                        #   } while (index < 20);
801c61a0: 00008821 addu r17,r0,r0

801c61a4: 3c01801d lui r1,0x801d
801c61a8: 00310821 addu r1,r1,r17
801c61ac: 90220d14 lbu r2,0x0d14(r1)
801c61b0: 00000000 nop
801c61b4: 10400005 beq r2,r0,0x801c61cc
801c61b8: 00002021 addu r4,r0,r0
801c61bc: 0c071634 jal 0x801c58d0
801c61c0: 02202821 addu r5,r17,r0
801c61c4: 08071877 j 0x801c61dc
801c61c8: 02209821 addu r19,r17,r0
801c61cc: 26310001 addiu r17,r17,0x0001
801c61d0: 2a220014 slti r2,r17,0x0014
801c61d4: 1440fff3 bne r2,r0,0x801c61a4
801c61d8: 00000000 nop

801c61dc: 3c04801d lui r4,0x801d
801c61e0: 2484b31c addiu r4,r4,-0x4ce4
801c61e4: 3c05801d lui r5,0x801d
801c61e8: 24a5b364 addiu r5,r5,-0x4c9c
801c61ec: 3c06801d lui r6,0x801d
801c61f0: 24c6b384 addiu r6,r6,-0x4c7c
801c61f4: 0c04cfde jal 0x80133f78
801c61f8: 00000000 nop
801c61fc: 34020001 ori r2,r0,0x0001
801c6200: 3c01801d lui r1,0x801d
801c6204: ac220088 sw r2,0x0088(r1)
801c6208: 3c01801d lui r1,0x801d
801c620c: ac22009c sw r2,0x009c(r1)
801c6210: 3c01801d lui r1,0x801d
801c6214: ac2200b0 sw r2,0x00b0(r1)
801c6218: 0c0532a0 jal 0x8014ca80
801c621c: 00000000 nop
801c6220: 3c05801c lui r5,0x801c
801c6224: 24a55190 addiu r5,r5,0x5190
801c6228: 0c053228 jal 0x8014c8a0
801c622c: 3404000a ori r4,r0,0x000a
801c6230: 3404000a ori r4,r0,0x000a
801c6234: 00002821 addu r5,r0,r0
801c6238: 00003021 addu r6,r0,r0
801c623c: 0c05328e jal 0x8014ca38
801c6240: 00003821 addu r7,r0,r0
801c6244: 340200ff ori r2,r0,0x00ff
801c6248: 3c018016 lui r1,0x8016
801c624c: ac22603c sw r2,0x603c(r1)
801c6250: 0c0532a0 jal 0x8014ca80
801c6254: 00000000 nop
801c6258: 3c028016 lui r2,0x8016
801c625c: 8c42603c lw r2,0x603c(r2)
801c6260: 00000000 nop
801c6264: 2442fff0 addiu r2,r2,-0x0010
801c6268: 3c018016 lui r1,0x8016
801c626c: ac22603c sw r2,0x603c(r1)
801c6270: 1c40fff7 bgtz r2,0x801c6250
801c6274: 3c029249 lui r2,0x9249
801c6278: 34422493 ori r2,r2,0x2493
801c627c: 02620018 mult r19,r2
801c6280: 3c12801d lui r18,0x801d
801c6284: 26520d34 addiu r18,r18,0x0d34
801c6288: 3c10801d lui r16,0x801d
801c628c: 26100d2c addiu r16,r16,0x0d2c
801c6290: 86450000 lh r5,0x0000(r18)
801c6294: 3c06801d lui r6,0x801d
801c6298: 84c60d36 lh r6,0x0d36(r6)
801c629c: 00138fc3 sra r17,r19,0x1f
801c62a0: 3c018016 lui r1,0x8016
801c62a4: ac20603c sw r0,0x603c(r1)
801c62a8: 00001810 mfhi r3
801c62ac: 00731821 addu r3,r3,r19
801c62b0: 00031883 sra r3,r3,0x02
801c62b4: 00711823 subu r3,r3,r17
801c62b8: 000310c0 sll r2,r3,0x03
801c62bc: 00431023 subu r2,r2,r3
801c62c0: 02621023 subu r2,r19,r2
801c62c4: 000210c0 sll r2,r2,0x03
801c62c8: 24420100 addiu r2,r2,0x0100
801c62cc: a6020000 sh r2,0x0000(r16)
801c62d0: 00031040 sll r2,r3,0x01
801c62d4: 00431021 addu r2,r2,r3
801c62d8: 00021100 sll r2,r2,0x04
801c62dc: 24420028 addiu r2,r2,0x0028
801c62e0: 3c01801d lui r1,0x801d
801c62e4: a4220d2e sh r2,0x0d2e(r1)
801c62e8: 0c009271 jal 0x800249c4
801c62ec: 02002021 addu r4,r16,r0
801c62f0: 3c025555 lui r2,0x5555
801c62f4: 34425556 ori r2,r2,0x5556
801c62f8: 02620018 mult r19,r2
801c62fc: 34150001 ori r21,r0,0x0001
801c6300: 0200b821 addu r23,r16,r0
801c6304: 0240f021 addu r30,r18,r0
801c6308: 3c02801d lui r2,0x801d
801c630c: 24420d3c addiu r2,r2,0x0d3c
801c6310: 0040b021 addu r22,r2,r0
801c6314: 3c05801d lui r5,0x801d
801c6318: 84a50d44 lh r5,0x0d44(r5)
801c631c: 3c06801d lui r6,0x801d
801c6320: 84c60d46 lh r6,0x0d46(r6)
801c6324: 00001810 mfhi r3
801c6328: 00711823 subu r3,r3,r17
801c632c: 00031040 sll r2,r3,0x01
801c6330: 00431021 addu r2,r2,r3
801c6334: 02621023 subu r2,r19,r2
801c6338: 00021100 sll r2,r2,0x04
801c633c: 24420100 addiu r2,r2,0x0100
801c6340: a6c20000 sh r2,0x0000(r22)
801c6344: 3c01801d lui r1,0x801d
801c6348: a4230d3e sh r3,0x0d3e(r1)
801c634c: 0c009271 jal 0x800249c4
801c6350: 02c02021 addu r4,r22,r0



801c6354: 3c058014 lui r5,0x8014
801c6358: 24a5b280 addiu r5,r5,-0x4d80
801c635c: 340200ff ori r2,r0,0x00ff
801c6360: 3c01801d lui r1,0x801d
801c6364: a42271f4 sh r2,0x71f4(r1)
801c6368: 0c053228 jal 0x8014c8a0
801c636c: 34040007 ori r4,r0,0x0007
801c6370: 34040007 ori r4,r0,0x0007
801c6374: 3c05801d lui r5,0x801d
801c6378: 24a501d0 addiu r5,r5,0x01d0
801c637c: 00003021 addu r6,r0,r0
801c6380: 0c05328e jal 0x8014ca38
801c6384: 00003821 addu r7,r0,r0
801c6388: 0c053274 jal 0x8014c9d0
801c638c: 34040007 ori r4,r0,0x0007
801c6390: 0c053274 jal 0x8014c9d0
801c6394: 34040006 ori r4,r0,0x0006
801c6398: 3c02801d lui r2,0x801d
801c639c: 844271f4 lh r2,0x71f4(r2)
801c63a0: 00000000 nop
801c63a4: 10550003 beq r2,r21,0x801c63b4
801c63a8: 2408ffff addiu r8,r0,-0x0001
801c63ac: 14480018 bne r2,r8,0x801c6410
801c63b0: 00000000 nop
801c63b4: 0c0710ec jal 0x801c43b0
801c63b8: 00002021 addu r4,r0,r0
801c63bc: 0000a821 addu r21,r0,r0
801c63c0: 08071a12 j 0x801c6848
801c63c4: 34160001 ori r22,r0,0x0001
801c63c8: 3c058013 lui r5,0x8013
801c63cc: 24a508c0 addiu r5,r5,0x08c0
801c63d0: 0c053228 jal 0x8014c8a0
801c63d4: 34040007 ori r4,r0,0x0007
801c63d8: 92870161 lbu r7,0x0161(r20)
801c63dc: 34040007 ori r4,r0,0x0007
801c63e0: afb50010 sw r21,0x0010(r29)
801c63e4: 8fa60018 lw r6,0x0018(r29)
801c63e8: 0c053296 jal 0x8014ca58
801c63ec: 34050019 ori r5,r0,0x0019
801c63f0: 34040007 ori r4,r0,0x0007
801c63f4: 3c038016 lui r3,0x8016
801c63f8: 8c635f98 lw r3,0x5f98(r3)
801c63fc: 34020018 ori r2,r0,0x0018
801c6400: 0c053274 jal 0x8014c9d0
801c6404: ac621c5c sw r2,0x1c5c(r3)
801c6408: 080718d5 j 0x801c6354
801c640c: 00000000 nop

801c6410: 3c058014 lui r5,0x8014
801c6414: 24a5b280 addiu r5,r5,-0x4d80
801c6418: 0c053228 jal 0x8014c8a0
801c641c: 34040005 ori r4,r0,0x0005
801c6420: 34040005 ori r4,r0,0x0005
801c6424: 3c08801d lui r8,0x801d
801c6428: 250801d0 addiu r8,r8,0x01d0
801c642c: 25050078 addiu r5,r8,0x0078
801c6430: 00003021 addu r6,r0,r0
801c6434: 0c05328e jal 0x8014ca38
801c6438: 00003821 addu r7,r0,r0
801c643c: 0c053274 jal 0x8014c9d0
801c6440: 34040005 ori r4,r0,0x0005
801c6444: 0c0710ec jal 0x801c43b0
801c6448: 00002021 addu r4,r0,r0


801c644c: 0c0532a0 jal 0x8014ca80
801c6450: 00000000 nop
801c6454: 0c05295e jal 0x8014a578
801c6458: 00002021 addu r4,r0,r0
801c645c: 3c01801d lui r1,0x801d
801c6460: ac22208c sw r2,0x208c(r1)
801c6464: 8c430000 lw r3,0x0000(r2)
801c6468: 00000000 nop
801c646c: 30620100 andi r2,r3,0x0100
801c6470: 1040000c beq r2,r0,0x801c64a4
801c6474: 30620008 andi r2,r3,0x0008
801c6478: 0c0526fb jal 0x80149bec
801c647c: 34040010 ori r4,r0,0x0010
801c6480: 00408021 addu r16,r2,r0
801c6484: 3c05801d lui r5,0x801d
801c6488: 24a5b15c addiu r5,r5,-0x4ea4
801c648c: 0c053228 jal 0x8014c8a0
801c6490: 02002021 addu r4,r16,r0
801c6494: 0c053274 jal 0x8014c9d0
801c6498: 02002021 addu r4,r16,r0
801c649c: 08071913 j 0x801c644c
801c64a0: 00000000 nop
801c64a4: 10400017 beq r2,r0,0x801c6504
801c64a8: 34020007 ori r2,r0,0x0007
801c64ac: 3c01801d lui r1,0x801d
801c64b0: a02207d5 sb r2,0x07d5(r1)
801c64b4: 26730001 addiu r19,r19,0x0001

801c64b8: 34020014 ori r2,r0,0x0014
801c64bc: 16620002 bne r19,r2,0x801c64c8
801c64c0: 00000000 nop
801c64c4: 00009821 addu r19,r0,r0
801c64c8: 3c01801d lui r1,0x801d
801c64cc: 00330821 addu r1,r1,r19
801c64d0: 90220d14 lbu r2,0x0d14(r1)
801c64d4: 00000000 nop
801c64d8: 1040fff7 beq r2,r0,0x801c64b8
801c64dc: 26730001 addiu r19,r19,0x0001

801c64e0: 2673ffff addiu r19,r19,-0x0001
801c64e4: 34040001 ori r4,r0,0x0001
801c64e8: 34020006 ori r2,r0,0x0006
801c64ec: 3c018016 lui r1,0x8016
801c64f0: ac225fb4 sw r2,0x5fb4(r1)
801c64f4: 3c01801d lui r1,0x801d
801c64f8: ac350088 sw r21,0x0088(r1)
801c64fc: 0807195a j 0x801c6568
801c6500: 02602821 addu r5,r19,r0
801c6504: 30620004 andi r2,r3,0x0004
801c6508: 1040004d beq r2,r0,0x801c6640
801c650c: 34020007 ori r2,r0,0x0007
801c6510: 3c01801d lui r1,0x801d
801c6514: a02207d4 sb r2,0x07d4(r1)
801c6518: 2673ffff addiu r19,r19,-0x0001

801c651c: 2408ffff addiu r8,r0,-0x0001
801c6520: 16680002 bne r19,r8,0x801c652c
801c6524: 00000000 nop
801c6528: 34130013 ori r19,r0,0x0013
801c652c: 3c01801d lui r1,0x801d
801c6530: 00330821 addu r1,r1,r19
801c6534: 90220d14 lbu r2,0x0d14(r1)
801c6538: 00000000 nop
801c653c: 1040fff7 beq r2,r0,0x801c651c
801c6540: 2673ffff addiu r19,r19,-0x0001

801c6544: 26730001 addiu r19,r19,0x0001
801c6548: 34040001 ori r4,r0,0x0001
801c654c: 02602821 addu r5,r19,r0
801c6550: 34020006 ori r2,r0,0x0006
801c6554: 3c018016 lui r1,0x8016
801c6558: ac225fb4 sw r2,0x5fb4(r1)
801c655c: 34020002 ori r2,r0,0x0002
801c6560: 3c01801d lui r1,0x801d
801c6564: ac220088 sw r2,0x0088(r1)
801c6568: 3c01801d lui r1,0x801d
801c656c: ac35009c sw r21,0x009c(r1)
801c6570: 3c01801d lui r1,0x801d
801c6574: ac3500b0 sw r21,0x00b0(r1)
801c6578: 0c071634 jal 0x801c58d0
801c657c: 001387c3 sra r16,r19,0x1f
801c6580: 3c029249 lui r2,0x9249
801c6584: 34422493 ori r2,r2,0x2493
801c6588: 02620018 mult r19,r2
801c658c: 02e02021 addu r4,r23,r0
801c6590: 87c50000 lh r5,0x0000(r30)
801c6594: 87c60002 lh r6,0x0002(r30)
801c6598: 00001810 mfhi r3
801c659c: 00731821 addu r3,r3,r19
801c65a0: 00031883 sra r3,r3,0x02
801c65a4: 00701823 subu r3,r3,r16
801c65a8: 000310c0 sll r2,r3,0x03
801c65ac: 00431023 subu r2,r2,r3
801c65b0: 02621023 subu r2,r19,r2
801c65b4: 000210c0 sll r2,r2,0x03
801c65b8: 24420100 addiu r2,r2,0x0100
801c65bc: a6e20000 sh r2,0x0000(r23)
801c65c0: 00031040 sll r2,r3,0x01
801c65c4: 00431021 addu r2,r2,r3
801c65c8: 00021100 sll r2,r2,0x04
801c65cc: 24420028 addiu r2,r2,0x0028
801c65d0: 0c009271 jal 0x800249c4
801c65d4: a6e20002 sh r2,0x0002(r23)
801c65d8: 3c025555 lui r2,0x5555
801c65dc: 34425556 ori r2,r2,0x5556
801c65e0: 02620018 mult r19,r2
801c65e4: 02c02021 addu r4,r22,r0
801c65e8: 3c05801d lui r5,0x801d
801c65ec: 84a50d44 lh r5,0x0d44(r5)
801c65f0: 3c06801d lui r6,0x801d
801c65f4: 84c60d46 lh r6,0x0d46(r6)
801c65f8: 00001810 mfhi r3
801c65fc: 00701823 subu r3,r3,r16
801c6600: 00031040 sll r2,r3,0x01
801c6604: 00431021 addu r2,r2,r3
801c6608: 02621023 subu r2,r19,r2
801c660c: 00021100 sll r2,r2,0x04
801c6610: 24420100 addiu r2,r2,0x0100
801c6614: a6c20000 sh r2,0x0000(r22)
801c6618: 0c009271 jal 0x800249c4
801c661c: a6c30002 sh r3,0x0002(r22)
801c6620: 3c04801d lui r4,0x801d
801c6624: 2484b31c addiu r4,r4,-0x4ce4
801c6628: 3c05801d lui r5,0x801d
801c662c: 24a5b364 addiu r5,r5,-0x4c9c
801c6630: 3c06801d lui r6,0x801d
801c6634: 24c6b384 addiu r6,r6,-0x4c7c
801c6638: 0c04cfde jal 0x80133f78
801c663c: 00000000 nop
801c6640: 3c02801d lui r2,0x801d
801c6644: 8c42208c lw r2,0x208c(r2)
801c6648: 00000000 nop
801c664c: 8c420000 lw r2,0x0000(r2)
801c6650: 00000000 nop
801c6654: 30420020 andi r2,r2,0x0020
801c6658: 1040ff7c beq r2,r0,0x801c644c
801c665c: 00008821 addu r17,r0,r0


801c6660: 0c0602bf jal 0x80180afc
801c6664: 02202021 addu r4,r17,r0
801c6668: 90440161 lbu r4,0x0161(r2)
801c666c: 0c060324 jal 0x80180c90
801c6670: 27a50018 addiu r5,r29,0x0018
801c6674: 8fa30018 lw r3,0x0018(r29)
801c6678: 00000000 nop
801c667c: 04600008 bltz r3,0x801c66a0
801c6680: 0040a021 addu r20,r2,r0
801c6684: 16230006 bne r17,r3,0x801c66a0
801c6688: 00000000 nop
801c668c: 0c023388 jal 0x8008ce20
801c6690: 02202021 addu r4,r17,r0
801c6694: 2408ffff addiu r8,r0,-0x0001
801c6698: 14480005 bne r2,r8,0x801c66b0
801c669c: 00000000 nop
801c66a0: 26310001 addiu r17,r17,0x0001
801c66a4: 2a220015 slti r2,r17,0x0015
801c66a8: 1440ffed bne r2,r0,0x801c6660
801c66ac: 00000000 nop
801c66b0: 0c0166bc jal 0x80059af0
801c66b4: 02602021 addu r4,r19,r0
801c66b8: 00409021 addu r18,r2,r0
801c66bc: 92420000 lbu r2,0x0000(r18)
801c66c0: 00000000 nop
801c66c4: 30420080 andi r2,r2,0x0080
801c66c8: 1040000b beq r2,r0,0x801c66f8
801c66cc: 00002821 addu r5,r0,r0
801c66d0: 0c04ed64 jal 0x8013b590
801c66d4: 34040021 ori r4,r0,0x0021
801c66d8: 92430000 lbu r3,0x0000(r18)
801c66dc: 30420007 andi r2,r2,0x0007
801c66e0: 2463ff80 addiu r3,r3,-0x0080
801c66e4: 000318c0 sll r3,r3,0x03
801c66e8: 00621821 addu r3,r3,r2
801c66ec: 24631800 addiu r3,r3,0x1800
801c66f0: 080719df j 0x801c677c
801c66f4: afa30018 sw r3,0x0018(r29)
801c66f8: 92470000 lbu r7,0x0000(r18)
801c66fc: 3c06801d lui r6,0x801d
801c6700: 24c60a00 addiu r6,r6,0x0a00
801c6704: 00002021 addu r4,r0,r0
801c6708: 00c01821 addu r3,r6,r0
801c670c: 90620000 lbu r2,0x0000(r3)
801c6710: 00000000 nop
801c6714: 10e20006 beq r7,r2,0x801c6730
801c6718: 34020003 ori r2,r0,0x0003
801c671c: 24840001 addiu r4,r4,0x0001
801c6720: 28820003 slti r2,r4,0x0003
801c6724: 1440fff9 bne r2,r0,0x801c670c
801c6728: 24630001 addiu r3,r3,0x0001
801c672c: 34020003 ori r2,r0,0x0003
801c6730: 14820006 bne r4,r2,0x801c674c
801c6734: 34020049 ori r2,r0,0x0049
801c6738: 24a50001 addiu r5,r5,0x0001
801c673c: 28a20049 slti r2,r5,0x0049
801c6740: 1440fff0 bne r2,r0,0x801c6704
801c6744: 24c60003 addiu r6,r6,0x0003
801c6748: 34020049 ori r2,r0,0x0049
801c674c: 14a20002 bne r5,r2,0x801c6758
801c6750: 34020047 ori r2,r0,0x0047
801c6754: 00002821 addu r5,r0,r0
801c6758: 14a20002 bne r5,r2,0x801c6764
801c675c: 00000000 nop
801c6760: 34050048 ori r5,r0,0x0048
801c6764: 10e00003 beq r7,r0,0x801c6774
801c6768: 2ce20004 sltiu r2,r7,0x0004
801c676c: 14400002 bne r2,r0,0x801c6778
801c6770: 24a21862 addiu r2,r5,0x1862
801c6774: 24a21818 addiu r2,r5,0x1818
801c6778: afa20018 sw r2,0x0018(r29)
801c677c: 0c0710ec jal 0x801c43b0
801c6780: 34040001 ori r4,r0,0x0001
801c6784: 3c018016 lui r1,0x8016
801c6788: ac335ef4 sw r19,0x5ef4(r1)
801c678c: 92420000 lbu r2,0x0000(r18)
801c6790: 00000000 nop
801c6794: 2c420004 sltiu r2,r2,0x0004
801c6798: 1440ff0b bne r2,r0,0x801c63c8
801c679c: 340200ff ori r2,r0,0x00ff
801c67a0: 3c058013 lui r5,0x8013
801c67a4: 24a508c0 addiu r5,r5,0x08c0
801c67a8: 3c01801d lui r1,0x801d
801c67ac: a42271f0 sh r2,0x71f0(r1)
801c67b0: 0c053228 jal 0x8014c8a0
801c67b4: 34040007 ori r4,r0,0x0007
801c67b8: 92870161 lbu r7,0x0161(r20)
801c67bc: 34040007 ori r4,r0,0x0007
801c67c0: afb50010 sw r21,0x0010(r29)
801c67c4: 8fa60018 lw r6,0x0018(r29)
801c67c8: 0c053296 jal 0x8014ca58
801c67cc: 34050019 ori r5,r0,0x0019
801c67d0: 34040005 ori r4,r0,0x0005
801c67d4: 3c058014 lui r5,0x8014
801c67d8: 24a58ed8 addiu r5,r5,-0x7128
801c67dc: 3c038016 lui r3,0x8016
801c67e0: 8c635f98 lw r3,0x5f98(r3)
801c67e4: 34020018 ori r2,r0,0x0018
801c67e8: 0c053228 jal 0x8014c8a0
801c67ec: ac621c5c sw r2,0x1c5c(r3)
801c67f0: 34040005 ori r4,r0,0x0005
801c67f4: 3c05801d lui r5,0x801d
801c67f8: 24a50158 addiu r5,r5,0x0158
801c67fc: 00003021 addu r6,r0,r0
801c6800: 0c05328e jal 0x8014ca38
801c6804: 00003821 addu r7,r0,r0
801c6808: 0c0713d0 jal 0x801c4f40
801c680c: 00000000 nop
801c6810: 3c02801d lui r2,0x801d
801c6814: 844271f0 lh r2,0x71f0(r2)
801c6818: 00000000 nop
801c681c: 1440fecd bne r2,r0,0x801c6354
801c6820: 00000000 nop



801c6824: 0c071774 jal 0x801c5dd0                       #   0x1c5dd0 (r19);     // Equipment related?
801c6828: 02602021 addu r4,r19,r0
801c682c: 0040a821 addu r21,r2,r0
801c6830: 0000b021 addu r22,r0,r0
801c6834: 0c0167f8 jal 0x80059fe0                       #   Remove Unit from Party (r19);
801c6838: 02602021 addu r4,r19,r0
801c683c: 92440000 lbu r4,0x0000(r18)
801c6840: 0c070e82 jal 0x801c3a08                       #   0x1c3a08 (*r18, 12);
801c6844: 3405000c ori r5,r0,0x000c
801c6848: 3c108017 lui r16,0x8017
801c684c: 8e103fac lw r16,0x3fac(r16)                   #   r16 = *0x80173fac
801c6850: 00008821 addu r17,r0,r0                       #   r17 = 0
801c6854: 341200fe ori r18,r0,0x00fe                    #   0xfe
801c6858: 3413000f ori r19,r0,0x000f                    #   15

801c685c: 0c0602bf jal 0x80180afc
801c6860: 02202021 addu r4,r17,r0
801c6864: 0040a021 addu r20,r2,r0
801c6868: 00001821 addu r3,r0,r0
801c686c: 02831021 addu r2,r20,r3
801c6870: 9042012c lbu r2,0x012c(r2)
801c6874: 00000000 nop
801c6878: a2020000 sb r2,0x0000(r16)
801c687c: 304200fe andi r2,r2,0x00fe
801c6880: 14520003 bne r2,r18,0x801c6890
801c6884: 00000000 nop
801c6888: 08071a2c j 0x801c68b0
801c688c: 26100001 addiu r16,r16,0x0001
801c6890: 14730003 bne r3,r19,0x801c68a0
801c6894: 26100001 addiu r16,r16,0x0001
801c6898: a2120000 sb r18,0x0000(r16)
801c689c: 26100001 addiu r16,r16,0x0001
801c68a0: 24630001 addiu r3,r3,0x0001
801c68a4: 28620010 slti r2,r3,0x0010
801c68a8: 1440fff1 bne r2,r0,0x801c6870
801c68ac: 02831021 addu r2,r20,r3
801c68b0: 26310001 addiu r17,r17,0x0001
801c68b4: 2a220015 slti r2,r17,0x0015
801c68b8: 1440ffe8 bne r2,r0,0x801c685c
801c68bc: 00000000 nop

801c68c0: 12a0000d beq r21,r0,0x801c68f8
801c68c4: 00000000 nop
801c68c8: 3c058014 lui r5,0x8014
801c68cc: 24a5b280 addiu r5,r5,-0x4d80
801c68d0: 0c053228 jal 0x8014c8a0
801c68d4: 34040005 ori r4,r0,0x0005
801c68d8: 34040005 ori r4,r0,0x0005
801c68dc: 3c05801d lui r5,0x801d
801c68e0: 24a50284 addiu r5,r5,0x0284
801c68e4: 00003021 addu r6,r0,r0
801c68e8: 0c05328e jal 0x8014ca38
801c68ec: 00003821 addu r7,r0,r0
801c68f0: 0c053274 jal 0x8014c9d0
801c68f4: 34040005 ori r4,r0,0x0005
801c68f8: 0c0710ec jal 0x801c43b0
801c68fc: 00002021 addu r4,r0,r0
801c6900: 3c018016 lui r1,0x8016
801c6904: ac20603c sw r0,0x603c(r1)

801c6908: 0c0532a0 jal 0x8014ca80
801c690c: 00000000 nop
801c6910: 3c028016 lui r2,0x8016
801c6914: 8c42603c lw r2,0x603c(r2)
801c6918: 00000000 nop
801c691c: 24420010 addiu r2,r2,0x0010
801c6920: 3c018016 lui r1,0x8016
801c6924: ac22603c sw r2,0x603c(r1)
801c6928: 28420100 slti r2,r2,0x0100
801c692c: 1440fff6 bne r2,r0,0x801c6908
801c6930: 340200ff ori r2,r0,0x00ff

801c6934: 3c018016 lui r1,0x8016
801c6938: ac22603c sw r2,0x603c(r1)
801c693c: 3404000a ori r4,r0,0x000a
801c6940: 00002821 addu r5,r0,r0
801c6944: 00003021 addu r6,r0,r0
801c6948: 0c05328e jal 0x8014ca38
801c694c: 34070001 ori r7,r0,0x0001
801c6950: 02c01021 addu r2,r22,r0
801c6954: 8fbf0044 lw r31,0x0044(r29)
801c6958: 8fbe0040 lw r30,0x0040(r29)
801c695c: 8fb7003c lw r23,0x003c(r29)
801c6960: 8fb60038 lw r22,0x0038(r29)
801c6964: 8fb50034 lw r21,0x0034(r29)
801c6968: 8fb40030 lw r20,0x0030(r29)
801c696c: 8fb3002c lw r19,0x002c(r29)
801c6970: 8fb20028 lw r18,0x0028(r29)
801c6974: 8fb10024 lw r17,0x0024(r29)
801c6978: 8fb00020 lw r16,0x0020(r29)
801c697c: 27bd0048 addiu r29,r29,0x0048
801c6980: 03e00008 jr r31
801c6984: 00000000 nop