Difference between revisions of "Formation Screen Frame Processing"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " # ROUTINE: Formation Screen Frame Processing 801140bc: 27bdffe8 addiu r29,r29,-0x0018 801140c0: afbf0014 sw r31,0x0014(r29) 801140c4: afb00010 sw r16,0x0010(r29) 8011...")
 
 
Line 443: Line 443:
 
  80114734: 14620003 bne r3,r2,0x80114744                #  else if (*0x8018ba1c == 4) {
 
  80114734: 14620003 bne r3,r2,0x80114744                #  else if (*0x8018ba1c == 4) {
 
  80114738: 00000000 nop
 
  80114738: 00000000 nop
  8011473c: 0c0480d1 jal 0x80120344                      #      0x120344 ();
+
  8011473c: 0c0480d1 jal 0x80120344                      #      [[Handle Dismiss Unit Menu]] ();
 
  80114740: 00000000 nop                                  #  }
 
  80114740: 00000000 nop                                  #  }
 
  80114744: 8fbf0014 lw r31,0x0014(r29)
 
  80114744: 8fbf0014 lw r31,0x0014(r29)

Latest revision as of 14:15, 1 July 2020

#   ROUTINE: Formation Screen Frame Processing

801140bc: 27bdffe8 addiu r29,r29,-0x0018
801140c0: afbf0014 sw r31,0x0014(r29)
801140c4: afb00010 sw r16,0x0010(r29)
801140c8: 3c10801d lui r16,0x801d
801140cc: 8e10d52c lw r16,-0x2ad4(r16)                  #   *0x801cd52c
801140d0: 3c028019 lui r2,0x8019
801140d4: 8c42ba1c lw r2,-0x45e4(r2)                    #   *0x8018ba1c
801140d8: 00000000 nop
801140dc: 1440018c bne r2,r0,0x80114710
801140e0: 34020005 ori r2,r0,0x0005                     #   5
                                                        #   if (*0x8018ba1c == 0) {
801140e4: 3c028019 lui r2,0x8019
801140e8: 8042bad4 lb r2,-0x452c(r2)                    #       *0x8018bad4
801140ec: 00000000 nop
801140f0: 14400043 bne r2,r0,0x80114200                 #       if (*0x8018bad4 == 0) {
801140f4: 00000000 nop
801140f8: 3c028019 lui r2,0x8019
801140fc: 9042bae9 lbu r2,-0x4517(r2)                   #           *0x8018bae9
80114100: 3c018019 lui r1,0x8019
80114104: a022ba25 sb r2,-0x45db(r1)                    #           *0x8018ba25 = *0x8018bae9
80114108: 3c018019 lui r1,0x8019
8011410c: a420d768 sh r0,-0x2898(r1)                    #           *0x8018d768 = 0
80114110: 00002021 addu r4,r0,r0
80114114: 3c05801d lui r5,0x801d
80114118: 24a5d5ec addiu r5,r5,-0x2a14
8011411c: 0c04843a jal 0x801210e8                       #           result_0x1210e8 = ? 0x1210e8 (0, formationUnitReferenceArray, 0);
80114120: 00003021 addu r6,r0,r0
80114124: 3c01801d lui r1,0x801d
80114128: a022d788 sb r2,-0x2878(r1)                    #           *0x801cd788 = result_0x1210e8
8011412c: 3c038019 lui r3,0x8019
80114130: 8463ba20 lh r3,-0x45e0(r3)                    #           *0x801945e0
80114134: 3c02801d lui r2,0x801d
80114138: 9042d788 lbu r2,-0x2878(r2)                   #           *0x801cd788
8011413c: 00000000 nop
80114140: 2442ffff addiu r2,r2,-0x0001                  #           *0x801cd788 - 1
80114144: 0043102a slt r2,r2,r3
80114148: 10400009 beq r2,r0,0x80114170                 #           if ((*0x801cd788 - 1) < *0x801945e0) {
8011414c: 00000000 nop
80114150: 3c02801d lui r2,0x801d
80114154: 9042d788 lbu r2,-0x2878(r2)                   #               *0x801cd788
80114158: 00000000 nop
8011415c: 2442ffff addiu r2,r2,-0x0001                  #               *0x801cd788 - 1
80114160: 3c018019 lui r1,0x8019
80114164: a422ba20 sh r2,-0x45e0(r1)                    #               *0x8018ba20 = *0x801cd788 - 1
80114168: 3c018019 lui r1,0x8019
8011416c: a422ba22 sh r2,-0x45de(r1)                    #               *0x8018ba22 = *0x801cd788 - 1
                                                        #           }
80114170: 0c045022 jal 0x80114088                       #           0x114088 ();        // Clears 0x801cd728 data (sets multiple values to -1)
80114174: 00000000 nop
80114178: 3c018019 lui r1,0x8019
8011417c: a020ba24 sb r0,-0x45dc(r1)                    #           *0x8018ba24 = 0
80114180: 3c048019 lui r4,0x8019
80114184: 8484ba20 lh r4,-0x45e0(r4)                               
80114188: 0c045813 jal 0x8011604c                       #           0x11604c (selectedFormationUnitIndex);
8011418c: 00000000 nop
80114190: 3c028019 lui r2,0x8019
80114194: 8442ba20 lh r2,-0x45e0(r2)                    #           selectedFormationUnitIndex
80114198: 00000000 nop
8011419c: 00021080 sll r2,r2,0x02                       #           selectedFormationUnitIndex * 4
801141a0: 3c01801d lui r1,0x801d
801141a4: 00220821 addu r1,r1,r2
801141a8: 8c22d5ec lw r2,-0x2a14(r1)                    #           formationUnitReferenceArray[selectedFormationUnitIndex]
801141ac: 00000000 nop
801141b0: 90420070 lbu r2,0x0070(r2)                    #           formationUnitReferenceArray[selectedFormationUnitIndex].Flags
801141b4: 00000000 nop
801141b8: 30420004 andi r2,r2,0x0004                    #           isBoss = (formationUnitReferenceArray[selectedFormationUnitIndex].Flags) & 4         // Has ??? Stats
801141bc: 1040000e beq r2,r0,0x801141f8                 #           if (isBoss) {
801141c0: 34020001 ori r2,r0,0x0001
801141c4: 3c018019 lui r1,0x8019
801141c8: a020ba27 sb r0,-0x45d9(r1)                    #               *0x8018ba27 = 0
801141cc: 3c018019 lui r1,0x8019
801141d0: ac20bab4 sw r0,-0x454c(r1)                    #               *0x8018bab4 = 0
801141d4: 3c018019 lui r1,0x8019
801141d8: ac20baa0 sw r0,-0x4560(r1)                    #               *0x8018baa0 = 0
801141dc: 0c04a966 jal 0x8012a598                       #               0x12a598 (9);
801141e0: 34040009 ori r4,r0,0x0009
801141e4: 0c04a966 jal 0x8012a598                       #               0x12a598 (12);
801141e8: 3404000c ori r4,r0,0x000c
801141ec: 3c018019 lui r1,0x8019
801141f0: a020c190 sb r0,-0x3e70(r1)                    #               *0x8018c190 = 0
801141f4: 34020001 ori r2,r0,0x0001
                                                        #           }
801141f8: 3c018019 lui r1,0x8019
801141fc: a022bad4 sb r2,-0x452c(r1)                    #           *0x8018bad4 = 1
                                                        #       }
80114200: 3c028019 lui r2,0x8019
80114204: 9042e48c lbu r2,-0x1b74(r2)                   #       *0x8018e48c
80114208: 00000000 nop
8011420c: 1440000d bne r2,r0,0x80114244                 #       if (*0x8018e48c == 0) {
80114210: 00000000 nop
80114214: 0c04b56f jal 0x8012d5bc                       #           result_0x12d5bc = 0x12d5bc ();
80114218: 00000000 nop
8011421c: 14400009 bne r2,r0,0x80114244                 #           if (result_0x12d5bc == 0) {
80114220: 00000000 nop
80114224: 3c018019 lui r1,0x8019
80114228: a020bad4 sb r0,-0x452c(r1)                    #               *0x8018bad4 = 0
8011422c: 0c03ff84 jal 0x800ffe10                       #               Mark Thread As Stopped (WORLD.BIN) (6);
80114230: 34040006 ori r4,r0,0x0006
80114234: 3c018019 lui r1,0x8019
80114238: a020baea sb r0,-0x4516(r1)                    #               *0x8018baea = 0
8011423c: 080451d1 j 0x80114744
80114240: 00000000 nop                                  #           }
                                                        #       }
80114244: 3c028019 lui r2,0x8019
80114248: 9042c191 lbu r2,-0x3e6f(r2)                   #       *0x8018c191
8011424c: 00000000 nop
80114250: 10400088 beq r2,r0,0x80114474                 #       if (*0x8018c191 != 0) {
80114254: 2402ffff addiu r2,r0,-0x0001
80114258: 3c01801d lui r1,0x801d
8011425c: ac20d754 sw r0,-0x28ac(r1)                    #           *0x8018d754 = 0
80114260: 3c028019 lui r2,0x8019
80114264: 8442ba20 lh r2,-0x45e0(r2)                    #           selectedFormationUnitIndex
80114268: 00000000 nop
8011426c: 00021080 sll r2,r2,0x02                       #           selectedFormationUnitIndex * 4
80114270: 3c01801d lui r1,0x801d
80114274: 00220821 addu r1,r1,r2
80114278: 8c22d5ec lw r2,-0x2a14(r1)                    #           formationUnitReferenceArray[selectedFormationUnitIndex]
8011427c: 00000000 nop
80114280: 90420070 lbu r2,0x0070(r2)                    #           formationUnitReferenceArray[selectedFormationUnitIndex].Flags
80114284: 00000000 nop
80114288: 30420004 andi r2,r2,0x0004                    #           isBoss = (formationUnitReferenceArray[selectedFormationUnitIndex].Flags) & 4         // Has ??? Stats
8011428c: 10400024 beq r2,r0,0x80114320                 #           if (isBoss) {
80114290: 00000000 nop
80114294: 3c058019 lui r5,0x8019
80114298: 24a5c114 addiu r5,r5,-0x3eec                  #               
8011429c: 0c04aade jal 0x8012ab78                       #               isRunning = Run Menu Thread (WORLD.BIN) (6, 0x8018c114);
801142a0: 34040006 ori r4,r0,0x0006
801142a4: 3c018019 lui r1,0x8019
801142a8: a022c191 sb r2,-0x3e6f(r1)                    #               *0x8018c191 = isRunning
801142ac: 304200ff andi r2,r2,0x00ff
801142b0: 14400124 bne r2,r0,0x80114744                 #               if (isRunning) return;
801142b4: 00000000 nop
801142b8: 3c02801d lui r2,0x801d
801142bc: 8442d728 lh r2,-0x28d8(r2)                    #               *0x801cd728
801142c0: 00000000 nop
801142c4: 1440000a bne r2,r0,0x801142f0                 #               if (*0x801cd728 == 0) {
801142c8: 00000000 nop
801142cc: 3c048019 lui r4,0x8019
801142d0: 8484ba20 lh r4,-0x45e0(r4)                    
801142d4: 0c04824c jal 0x80120930                       #                   0x120930 (selectedFormationUnitIndex);
801142d8: 00000000 nop
801142dc: 3c018019 lui r1,0x8019
801142e0: a020bad4 sb r0,-0x452c(r1)                    #                   *0x8018bad4 = 0
801142e4: 34020009 ori r2,r0,0x0009
801142e8: 3c018019 lui r1,0x8019
801142ec: a022bacc sb r2,-0x4534(r1)                    #                   *0x8018bacc = 9
                                                        #               }
801142f0: 3c018019 lui r1,0x8019
801142f4: a420c188 sh r0,-0x3e78(r1)                    #               *0x8018c188 = 0
801142f8: 0c045022 jal 0x80114088                       #               0x114088 ();
801142fc: 00000000 nop
80114300: 3c018019 lui r1,0x8019
80114304: ac20baa0 sw r0,-0x4560(r1)                    #               *0x8018baa0 = 0
80114308: 3c018019 lui r1,0x8019
8011430c: ac20bab4 sw r0,-0x454c(r1)                    #               *0x8018bab4 = 0
80114310: 3c018019 lui r1,0x8019
80114314: a020c190 sb r0,-0x3e70(r1)                    #               *0x8018c190 = 0
80114318: 080451d1 j 0x80114744                         #               return;
8011431c: 00000000 nop                                  #           }
80114320: 3c058019 lui r5,0x8019
80114324: 24a5c0d8 addiu r5,r5,-0x3f28                  
80114328: 0c04aade jal 0x8012ab78                       #           isRunning = Run Menu Thread (WORLD.BIN) (6, 0x8018c0d8);
8011432c: 34040006 ori r4,r0,0x0006
80114330: 3c018019 lui r1,0x8019
80114334: a022c191 sb r2,-0x3e6f(r1)                    #           *0x8018c191 = isRunning
80114338: 304200ff andi r2,r2,0x00ff
8011433c: 14400101 bne r2,r0,0x80114744                 #           if (isRunning) return;
80114340: 00000000 nop
80114344: 3c02801d lui r2,0x801d
80114348: 8442d728 lh r2,-0x28d8(r2)                    #           testValue = *0x801cd728
8011434c: 00000000 nop
80114350: 14400008 bne r2,r0,0x80114374                 #           if (testValue == 0) {
80114354: 34020001 ori r2,r0,0x0001
80114358: 34020010 ori r2,r0,0x0010
8011435c: 3c018019 lui r1,0x8019
80114360: ac22ba1c sw r2,-0x45e4(r1)                    #               *0x8018ba1c = 16
80114364: 0c046aba jal 0x8011aae8                       #               0x11aae8 ();
80114368: 00000000 nop
8011436c: 080450fb j 0x801143ec
80114370: 00000000 nop                                  
80114374: 3c03801d lui r3,0x801d
80114378: 8463d728 lh r3,-0x28d8(r3)
8011437c: 00000000 nop
80114380: 14620008 bne r3,r2,0x801143a4                 #           } else if (testValue == 1) {
80114384: 34020002 ori r2,r0,0x0002
80114388: 34020012 ori r2,r0,0x0012
8011438c: 3c018019 lui r1,0x8019
80114390: ac22ba1c sw r2,-0x45e4(r1)                    #               *0x8018ba1c = 18
80114394: 0c047726 jal 0x8011dc98                       #               0x11dc98 ();
80114398: 00000000 nop
8011439c: 080450fb j 0x801143ec
801143a0: 00000000 nop
801143a4: 14620008 bne r3,r2,0x801143c8                 #           } else if (testValue == 2) {
801143a8: 34020003 ori r2,r0,0x0003
801143ac: 3402000e ori r2,r0,0x000e
801143b0: 3c018019 lui r1,0x8019
801143b4: ac22ba1c sw r2,-0x45e4(r1)                    #               *0x8018ba1c = 14
801143b8: 0c0463c5 jal 0x80118f14                       #               0x118f14 ();
801143bc: 00000000 nop
801143c0: 080450fb j 0x801143ec                         
801143c4: 00000000 nop
801143c8: 3c03801d lui r3,0x801d
801143cc: 8463d728 lh r3,-0x28d8(r3)
801143d0: 00000000 nop
801143d4: 10620003 beq r3,r2,0x801143e4                 #           } else if ((testValue == 3)
801143d8: 34020004 ori r2,r0,0x0004
801143dc: 14620003 bne r3,r2,0x801143ec                 #               || (testValue == 4))
801143e0: 34020005 ori r2,r0,0x0005                     #           {
801143e4: 3c018019 lui r1,0x8019
801143e8: ac22ba1c sw r2,-0x45e4(r1)                    #               *0x8018ba1c = testValue + 1
                                                        #           }
801143ec: 3c018019 lui r1,0x8019
801143f0: ac20baa0 sw r0,-0x4560(r1)                    #           *0x8018baa0 = 0
801143f4: 3c018019 lui r1,0x8019
801143f8: ac20bab4 sw r0,-0x454c(r1)                    #           *0x8018bab4 = 0
801143fc: 3c03801d lui r3,0x801d
80114400: 8463d728 lh r3,-0x28d8(r3)                    #           *0x801cd728
80114404: 2402ffff addiu r2,r0,-0x0001
80114408: 1062ffc1 beq r3,r2,0x80114310                 #           if (*0x801cd728 == -1) { *0x8018c190 = 0; return; }
8011440c: 00000000 nop
80114410: 3c028019 lui r2,0x8019
80114414: 9042ba25 lbu r2,-0x45db(r2)                   #           *0x8018ba25
80114418: 3c018019 lui r1,0x8019
8011441c: a022bae9 sb r2,-0x4517(r1)                    #           *0x8018bae9 = *0x8018ba25
80114420: 3c038019 lui r3,0x8019
80114424: 8c63ba1c lw r3,-0x45e4(r3)                    #           *0x8018ba1c
80114428: 34020004 ori r2,r0,0x0004
8011442c: 10620007 beq r3,r2,0x8011444c                 #           if (*0x8018ba1c != 4) {
80114430: 34020001 ori r2,r0,0x0001
80114434: 0c04a966 jal 0x8012a598                       #               0x12a598 (9);
80114438: 34040009 ori r4,r0,0x0009
8011443c: 0c04a966 jal 0x8012a598                       #               0x12a598 (12);
80114440: 3404000c ori r4,r0,0x000c
80114444: 08045117 j 0x8011445c
80114448: 00000000 nop                                  #           } else {
8011444c: 3c018019 lui r1,0x8019
80114450: ac22baa0 sw r2,-0x4560(r1)                    #               *0x8018baa0 = 1
80114454: 3c018019 lui r1,0x8019
80114458: ac22bab4 sw r2,-0x454c(r1)                    #               *0x8018bab4 = 1
                                                        #           }
8011445c: 3c018019 lui r1,0x8019
80114460: a020c18f sb r0,-0x3e71(r1)                    #           *0x8018c18f = 0
80114464: 3c018019 lui r1,0x8019
80114468: a020bad4 sb r0,-0x452c(r1)                    #           *0x8018bad4 = 0
8011446c: 080451d1 j 0x80114744                         #           return;
80114470: 00000000 nop                                  #       }
80114474: 3c01801d lui r1,0x801d
80114478: ac22d754 sw r2,-0x28ac(r1)                    #       *0x801cd754 = -1
8011447c: 3c028019 lui r2,0x8019
80114480: 8442ba20 lh r2,-0x45e0(r2)                    #       selectedFormationUnitIndex
80114484: 00000000 nop
80114488: 00021080 sll r2,r2,0x02                       #       selectedFormationUnitIndex * 4
8011448c: 3c01801d lui r1,0x801d
80114490: 00220821 addu r1,r1,r2
80114494: 8c22d5ec lw r2,-0x2a14(r1)                    #       formationUnitReferenceArray[selectedFormationUnitIndex]
80114498: 00000000 nop
8011449c: 90420070 lbu r2,0x0070(r2)                    #       formationUnitReferenceArray[selectedFormationUnitIndex].Flags
801144a0: 00000000 nop
801144a4: 30420004 andi r2,r2,0x0004                    #       isBoss = (formationUnitReferenceArray[selectedFormationUnitIndex].Flags) & 4         // Has ??? Stats
801144a8: 10400005 beq r2,r0,0x801144c0                 #       if (isBoss) {
801144ac: 3402101c ori r2,r0,0x101c
801144b0: 3c01801d lui r1,0x801d
801144b4: ac22d754 sw r2,-0x28ac(r1)                    #           *0x801cd754 = 0x101c
801144b8: 0804514d j 0x80114534
801144bc: 00000000 nop                                  #       } else {
801144c0: 3c028019 lui r2,0x8019
801144c4: 9042c190 lbu r2,-0x3e70(r2)                   #           *0x8018c190
801144c8: 00000000 nop
801144cc: 14400019 bne r2,r0,0x80114534                 #           if (*0x8018c190 == 0) {
801144d0: 00000000 nop
801144d4: 3c028019 lui r2,0x8019
801144d8: 9042ba27 lbu r2,-0x45d9(r2)                   #               *0x8018ba27
801144dc: 00000000 nop
801144e0: 10400006 beq r2,r0,0x801144fc                 #               if (*0x8018ba27 != 0) {
801144e4: 3c020002 lui r2,0x0002
801144e8: 34420002 ori r2,r2,0x0002
801144ec: 3c01801d lui r1,0x801d
801144f0: ac22d754 sw r2,-0x28ac(r1)                    #                   *0x801cd754 = 0x20002
801144f4: 0804514d j 0x80114534
801144f8: 00000000 nop                                  #               } else {
801144fc: 3c028019 lui r2,0x8019
80114500: 9042ba25 lbu r2,-0x45db(r2)                   #                   *0x8018ba25
80114504: 00000000 nop
80114508: 1040000a beq r2,r0,0x80114534                 #                   if (*0x8018ba25 != 0) {
8011450c: 00000000 nop
80114510: 3c02801d lui r2,0x801d
80114514: 9042d80c lbu r2,-0x27f4(r2)                   #                       *0x801cd80c
80114518: 00000000 nop                                  #                       setValue = 0x20000
8011451c: 10400003 beq r2,r0,0x8011452c                 #                       if (*0x801cd80c != 0) {
80114520: 3c030002 lui r3,0x0002
80114524: 3c030002 lui r3,0x0002
80114528: 34630001 ori r3,r3,0x0001                     #                           setValue = 0x20001
                                                        #                       }
8011452c: 3c01801d lui r1,0x801d
80114530: ac23d754 sw r3,-0x28ac(r1)                    #                       *0x801cd754 = setValue
                                                        #                   }
                                                        #               }
                                                        #           }
                                                        #       }
80114534: 0c044d82 jal 0x80113608                       #       result_0x113608 = 0x113608 ();
80114538: 00000000 nop
8011453c: 14400081 bne r2,r0,0x80114744                 #       if (result_0x113608 != 0) return;
80114540: 00000000 nop
80114544: 0c045728 jal 0x80115ca0                       #       result_0x115ca0 = 0x115ca0 ();
80114548: 00000000 nop
8011454c: 1440007d bne r2,r0,0x80114744                 #       if (result_0x115ca0 != 0) return;
80114550: 32020010 andi r2,r16,0x0010
80114554: 14400008 bne r2,r0,0x80114578                 #       if ((((*0x801cd52c & 0x10) == 0)
80114558: 32020800 andi r2,r16,0x0800
8011455c: 14400006 bne r2,r0,0x80114578                 #           || ((*0x801cd52c & 0x800) == 0))
80114560: 00000000 nop
80114564: 3c028019 lui r2,0x8019
80114568: 9042c190 lbu r2,-0x3e70(r2)
8011456c: 00000000 nop
80114570: 10400035 beq r2,r0,0x80114648                 #           || (*0x8018c190 != 0))
80114574: 32020020 andi r2,r16,0x0020                   #       {
80114578: 3c02801d lui r2,0x801d
8011457c: 9042d80c lbu r2,-0x27f4(r2)                   #           *0x801cd80c
80114580: 00000000 nop
80114584: 10400003 beq r2,r0,0x80114594                 #           if (*0x801cd80c != 0) {
80114588: 00000000 nop
8011458c: 08045166 j 0x80114598
80114590: 34020020 ori r2,r0,0x0020                     #               screenY = 32
                                                        #           } else {
80114594: 34020078 ori r2,r0,0x0078                     #               screenY = 120
                                                        #           }
80114598: 3c018019 lui r1,0x8019
8011459c: a422c0e2 sh r2,-0x3f1e(r1)                    #           *0x8018c0e2 = screenY   // (menuData.ScreenY) (menuData.0x0a)
801145a0: 3c038019 lui r3,0x8019
801145a4: 8463ba20 lh r3,-0x45e0(r3)                    #           value = selectedFormationUnitIndex
801145a8: 00000000 nop
801145ac: 04610002 bgez r3,0x801145b8                   #           if (selectedFormationUnitIndex < 0) {
801145b0: 00601021 addu r2,r3,r0
801145b4: 24620003 addiu r2,r3,0x0003                   #               value = 3
                                                        #           }
801145b8: 00021083 sra r2,r2,0x02                       #           value / 4
801145bc: 00021080 sll r2,r2,0x02                       #           (value / 4) * 4
801145c0: 00621023 subu r2,r3,r2                        #           (value % 4)         //  value - ((value / 4) * 4)
801145c4: 00021400 sll r2,r2,0x10
801145c8: 00021403 sra r2,r2,0x10
801145cc: 28420002 slti r2,r2,0x0002                    
801145d0: 14400007 bne r2,r0,0x801145f0                 
801145d4: 3402012c ori r2,r0,0x012c                     #           setValue = 0x12c
                                                        #           if ((value % 4) >= 2) {
801145d8: 3c028019 lui r2,0x8019
801145dc: 9042ba27 lbu r2,-0x45d9(r2)                   #               *0x8018ba27
801145e0: 00000000 nop
801145e4: 14400002 bne r2,r0,0x801145f0                 
801145e8: 3402012c ori r2,r0,0x012c
                                                        #               if (*0x8018ba27 == 0) {
801145ec: 3402008a ori r2,r0,0x008a                     #                   setValue = 0x8a
                                                        #               }
                                                        #           }
801145f0: 3c018019 lui r1,0x8019
801145f4: a422c0e0 sh r2,-0x3f20(r1)                    #           *0x8018c0e0 = setValue
801145f8: 34020001 ori r2,r0,0x0001
801145fc: 3c018019 lui r1,0x8019
80114600: ac22baa0 sw r2,-0x4560(r1)                    #           *0x8018baa0 = 1
80114604: 3c018019 lui r1,0x8019
80114608: ac22bab4 sw r2,-0x454c(r1)                    #           *0x8018bab4 = 1
8011460c: 34020001 ori r2,r0,0x0001
80114610: 3c018019 lui r1,0x8019
80114614: a022c191 sb r2,-0x3e6f(r1)                    #           *0x8018c191 = 1
80114618: 3c018019 lui r1,0x8019
8011461c: a022c190 sb r2,-0x3e70(r1)                    #           *0x8018c190 = 1
80114620: 32020010 andi r2,r16,0x0010
80114624: 14400004 bne r2,r0,0x80114638
80114628: 34020001 ori r2,r0,0x0001
                                                        #           if (((*0x801cd52c & 0x10) == 0) 
8011462c: 32020800 andi r2,r16,0x0800
80114630: 10400021 beq r2,r0,0x801146b8
80114634: 34020001 ori r2,r0,0x0001
                                                        #               || ((*0x801cd52c & 0x800) != 0))
                                                        #           {
80114638: 3c018019 lui r1,0x8019
8011463c: a022bacc sb r2,-0x4534(r1)                    #               *0x8018bacc = 1
                                                        #           }
80114640: 080451ae j 0x801146b8
80114644: 00000000 nop                                  
80114648: 1040001b beq r2,r0,0x801146b8                 #       } else if (((*0x801cd52c & 0x20) != 0)
8011464c: 00000000 nop
80114650: 3c028019 lui r2,0x8019
80114654: 9042ba27 lbu r2,-0x45d9(r2)
80114658: 00000000 nop
8011465c: 1040001b beq r2,r0,0x801146cc                 #           && (*0x8018ba27 != 0))
80114660: 32020040 andi r2,r16,0x0040                   #       {
80114664: 3c028019 lui r2,0x8019
80114668: 8442ba20 lh r2,-0x45e0(r2)                    #           selectedFormationUnitIndex
8011466c: 00000000 nop
80114670: 00021080 sll r2,r2,0x02                       #           selectedFormationUnitIndex * 4
80114674: 3c01801d lui r1,0x801d
80114678: 00220821 addu r1,r1,r2
8011467c: 8c22d5ec lw r2,-0x2a14(r1)                    #           formationUnitReferenceArray[selectedFormationUnitIndex]
80114680: 00000000 nop
80114684: 8442003e lh r2,0x003e(r2)                     #           formationUnitReferenceArray[selectedFormationUnitIndex].isLucaviSkillset
80114688: 00000000 nop
8011468c: 10400005 beq r2,r0,0x801146a4                 #           if (formationUnitReferenceArray[selectedFormationUnitIndex].isLucaviSkillset) {
80114690: 34020005 ori r2,r0,0x0005
80114694: 3c018019 lui r1,0x8019
80114698: a022bacc sb r2,-0x4534(r1)                    #               *0x8018bacc = 5
8011469c: 080451ae j 0x801146b8
801146a0: 00000000 nop                                  #           } else {
801146a4: 3c018019 lui r1,0x8019
801146a8: a020bad4 sb r0,-0x452c(r1)                    #               *0x8018bad4 = 0
801146ac: 3402000d ori r2,r0,0x000d
801146b0: 3c018019 lui r1,0x8019
801146b4: ac22ba1c sw r2,-0x45e4(r1)                    #               *0x8018ba1c = 13
                                                        #           }
                                                        #       }
801146b8: 3c028019 lui r2,0x8019
801146bc: 9042ba27 lbu r2,-0x45d9(r2)                   #       *0x8018ba27
801146c0: 00000000 nop
801146c4: 1440001f bne r2,r0,0x80114744                 #       if (*0x8018ba27 != 0) return;
801146c8: 32020040 andi r2,r16,0x0040
801146cc: 1040001d beq r2,r0,0x80114744                 #       if ((*0x801cd52c & 0x40) == 0) return;
801146d0: 00000000 nop
801146d4: 3c028019 lui r2,0x8019
801146d8: 9042e48c lbu r2,-0x1b74(r2)                   #       *0x8018e48c
801146dc: 00000000 nop
801146e0: 14400018 bne r2,r0,0x80114744                 #       if (*0x8018e48c != 0) return;
801146e4: 00000000 nop
801146e8: 0c04b523 jal 0x8012d48c                       #       0x12d48c ();
801146ec: 00000000 nop
801146f0: 00002021 addu r4,r0,r0
801146f4: 0c010efa jal 0x80043be8                       #       0x43be8 (0, 0xf0);
801146f8: 340500f0 ori r5,r0,0x00f0
801146fc: 34020002 ori r2,r0,0x0002
80114700: 3c018019 lui r1,0x8019
80114704: a022bacc sb r2,-0x4534(r1)                    #       *0x8018bacc = 2
80114708: 080451d1 j 0x80114744                               
8011470c: 00000000 nop                                  #   }
80114710: 3c038019 lui r3,0x8019
80114714: 8c63ba1c lw r3,-0x45e4(r3)                    #   *0x8018ba1c
80114718: 00000000 nop
8011471c: 14620005 bne r3,r2,0x80114734                 #   else if (*0x8018ba1c == 5) {
80114720: 34020004 ori r2,r0,0x0004
80114724: 0c04803e jal 0x801200f8                       #       Order Unit Menu Processing ();
80114728: 00000000 nop
8011472c: 080451d1 j 0x80114744                         #       
80114730: 00000000 nop                                  #   }
80114734: 14620003 bne r3,r2,0x80114744                 #   else if (*0x8018ba1c == 4) {
80114738: 00000000 nop
8011473c: 0c0480d1 jal 0x80120344                       #       Handle Dismiss Unit Menu ();
80114740: 00000000 nop                                  #   }
80114744: 8fbf0014 lw r31,0x0014(r29)
80114748: 8fb00010 lw r16,0x0010(r29)
8011474c: 27bd0018 addiu r29,r29,0x0018
80114750: 03e00008 jr r31
80114754: 00000000 nop