Show Graphic

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: SHOW GRAPHIC (CHAPTER END IMAGES)
#   Shows a graphic and leaves it up for a certain amount of time.
#       Parameters:
#           r4 = graphicID    

801bf01c: 27bdffd8 addiu r29,r29,-0x0028
801bf020: afb10014 sw r17,0x0014(r29)
801bf024: 00808821 addu r17,r4,r0               #   graphicID
801bf028: afbf0020 sw r31,0x0020(r29)
801bf02c: afb3001c sw r19,0x001c(r29)
801bf030: afb20018 sw r18,0x0018(r29)
801bf034: afb00010 sw r16,0x0010(r29)
                                                #   while (true) {
801bf038: 3c048001 lui r4,0x8001
801bf03c: 8c840010 lw r4,0x0010(r4)
801bf040: 0c011137 jal 0x800444dc               #       result_0x444dc = ? 0x444dc (*0x80010010, 0x20000); (realloc?)
801bf044: 3c050002 lui r5,0x0002
801bf048: 3c038001 lui r3,0x8001
801bf04c: 8c630010 lw r3,0x0010(r3)             #       *0x80010010 // 0x801df000
801bf050: 00409021 addu r18,r2,r0               #       result_0x444dc
801bf054: 1243000e beq r18,r3,0x801bf090
801bf058: 00118140 sll r16,r17,0x05             #       graphicID * 32
                                                #       if (result_0x444dc == 801df000) break;
801bf05c: 0c0532a0 jal 0x8014ca80               #       Switch To Next Thread ();
801bf060: 00000000 nop
801bf064: 3c028004 lui r2,0x8004
801bf068: 8c4259d0 lw r2,0x59d0(r2)             #       *0x800459d0
801bf06c: 00000000 nop
801bf070: 1040fff1 beq r2,r0,0x801bf038         #       if (*0x800459d0 == 0) continue;
801bf074: 00000000 nop
801bf078: 3c04801c lui r4,0x801c
801bf07c: 2484f000 addiu r4,r4,-0x1000
801bf080: 0c008d6b jal 0x800235ac               #       ? 0x235ac (*0x801bf000);
801bf084: 00000000 nop
801bf088: 0806fc0e j 0x801bf038                 #   }
801bf08c: 00000000 nop

801bf090: 3c138004 lui r19,0x8004
801bf094: 26734694 addiu r19,r19,0x4694         #   0x80044694
                                                #   do {
801bf098: 0c0532a0 jal 0x8014ca80               #       Switch To Next Thread ();
801bf09c: 00000000 nop
801bf0a0: 3c01801c lui r1,0x801c
801bf0a4: 00300821 addu r1,r1,r16
801bf0a8: 8c2408a0 lw r4,0x08a0(r1)             #       *(*0x801c08a0 + (graphicID * 32)) // LBA sector of graphic ID
801bf0ac: 3c01801c lui r1,0x801c
801bf0b0: 00300821 addu r1,r1,r16
801bf0b4: 8c2508a4 lw r5,0x08a4(r1)             #       *(*0x801c08a4 + (graphicID * 32)) // filesize of graphic ID
801bf0b8: 3c018017 lui r1,0x8017
801bf0bc: ac333ca8 sw r19,0x3ca8(r1)            #       *0x80173ca8 = 0x80044694        // function pointer
801bf0c0: 0c0533ad jal 0x8014ceb4               #       result_0x44694 = Call Inner Subroutine (*(*0x801c08a0 + (graphicID * 32)), *(*0x801c08a4 + (graphicID * 32)), result_0x444dc);
801bf0c4: 02403021 addu r6,r18,r0
801bf0c8: 1440fff3 bne r2,r0,0x801bf098         #   } while (result_0x44694 != 0)
801bf0cc: 00000000 nop
801bf0d0: 3c108004 lui r16,0x8004
801bf0d4: 261046c8 addiu r16,r16,0x46c8         #   0x800446c8
                                                #   do {
801bf0d8: 0c0532a0 jal 0x8014ca80               #       Switch To Next Thread ();
801bf0dc: 00000000 nop
801bf0e0: 3c018017 lui r1,0x8017
801bf0e4: ac303ca8 sw r16,0x3ca8(r1)            #       *0x80173ca8 = 0x800446c8        // function pointer
801bf0e8: 0c0533ad jal 0x8014ceb4               #       result_0x446c8 = Call Inner Subroutine ();
801bf0ec: 00000000 nop
801bf0f0: 1440fff9 bne r2,r0,0x801bf0d8         #   } while (result_0x446c8 != 0)
801bf0f4: 00000000 nop
801bf0f8: 00118140 sll r16,r17,0x05             #   graphicID * 32
801bf0fc: 3c01801c lui r1,0x801c
801bf100: 00300821 addu r1,r1,r16
801bf104: 8c2208b8 lw r2,0x08b8(r1)             #   value = *(0x801c08b8 + (graphicID * 32))
801bf108: 00000000 nop
801bf10c: 2c420002 sltiu r2,r2,0x0002
801bf110: 10400016 beq r2,r0,0x801bf16c         
801bf114: 34020001 ori r2,r0,0x0001             #   1
                                                #   if (value < 2) {
801bf118: 3c01801c lui r1,0x801c
801bf11c: 00300821 addu r1,r1,r16
801bf120: 8c2408a8 lw r4,0x08a8(r1)             #       *(0x801c08a8 + (graphicID * 32))
801bf124: 0c00923f jal 0x800248fc               #       ? 0x248fc (*(0x801c08a8 + (graphicID * 32)), result_0x444dc);
801bf128: 02402821 addu r5,r18,r0               #       result_0x444dc
801bf12c: 3c01801c lui r1,0x801c
801bf130: 00300821 addu r1,r1,r16
801bf134: 8c2308b8 lw r3,0x08b8(r1)             #       *(0x801c08b8 + (graphicID * 32))
801bf138: 34020001 ori r2,r0,0x0001             #       1
801bf13c: 1462009a bne r3,r2,0x801bf3a8         #       if (*(0x801c08b8 + (graphicID * 32)) == 1) {
801bf140: 00000000 nop
801bf144: 3c01801c lui r1,0x801c
801bf148: 00300821 addu r1,r1,r16
801bf14c: 8c2508a4 lw r5,0x08a4(r1)             #           *(0x801c08a4 + (graphicID * 32))
801bf150: 3c04801c lui r4,0x801c
801bf154: 24840658 addiu r4,r4,0x0658           #           0x801c0658
801bf158: 02452821 addu r5,r18,r5               #           result_0x444dc + *(0x801c08a4 + (graphicID * 32))
801bf15c: 0c00923f jal 0x800248fc               #           ? 0x248fc (0x801c0658, (result_0x444dc + *(0x801c08a4 + (graphicID * 32)) - 512));
801bf160: 24a5fe00 addiu r5,r5,-0x0200          #           result_0x444dc + *(0x801c08a4 + (graphicID * 32)) - 512
                                                #       }
801bf164: 0806fcea j 0x801bf3a8                         
801bf168: 00000000 nop                          #   } else {
801bf16c: 3c018016 lui r1,0x8016
801bf170: a4225ff2 sh r2,0x5ff2(r1)             #       *0x80165ff2
801bf174: 34020008 ori r2,r0,0x0008             #       8
801bf178: 16220010 bne r17,r2,0x801bf1bc
801bf17c: 340200ff ori r2,r0,0x00ff             #       255
                                                #       if (graphicID == 8) {
801bf180: 2402ff01 addiu r2,r0,-0x00ff          #           -255
801bf184: 3c018016 lui r1,0x8016
801bf188: ac22603c sw r2,0x603c(r1)             #           *0x8016603c = -255
                                                #           do {
801bf18c: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf190: 00000000 nop
801bf194: 3c028016 lui r2,0x8016
801bf198: 8c42603c lw r2,0x603c(r2)             #               *0x8016603c
801bf19c: 00000000 nop
801bf1a0: 24420008 addiu r2,r2,0x0008           #               *0x8016603c + 8
801bf1a4: 3c018016 lui r1,0x8016
801bf1a8: ac22603c sw r2,0x603c(r1)             #               *0x8016603c = *0x8016603c + 8
801bf1ac: 1840fff7 blez r2,0x801bf18c           #           } while (0x8016603c <= 0)
801bf1b0: 00000000 nop
801bf1b4: 0806fc7b j 0x801bf1ec
801bf1b8: 00000000 nop                          #       } else {
801bf1bc: 3c018016 lui r1,0x8016
801bf1c0: ac22603c sw r2,0x603c(r1)             #           *0x8016603c = 255
                                                #           do {
801bf1c4: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf1c8: 00000000 nop
801bf1cc: 3c028016 lui r2,0x8016
801bf1d0: 8c42603c lw r2,0x603c(r2)             #               *0x8016603c
801bf1d4: 00000000 nop
801bf1d8: 2442fff8 addiu r2,r2,-0x0008          #               *0x8016603c - 8
801bf1dc: 3c018016 lui r1,0x8016
801bf1e0: ac22603c sw r2,0x603c(r1)             #               *0x8016603c = *0x8016603c - 8
801bf1e4: 1c40fff7 bgtz r2,0x801bf1c4           #           } while (*0x8016603c > 0)
801bf1e8: 00000000 nop                          #       }
801bf1ec: 3c018016 lui r1,0x8016
801bf1f0: ac20603c sw r0,0x603c(r1)             #       *0x8016603c = 0
801bf1f4: 34020008 ori r2,r0,0x0008             #       8
801bf1f8: 16220011 bne r17,r2,0x801bf240
801bf1fc: 3402000a ori r2,r0,0x000a             #       10
                                                #       if (graphicID == 8) {
801bf200: 00008021 addu r16,r0,r0               #           count = 0
801bf204: 34130001 ori r19,r0,0x0001            #           1
                                                #           do {
801bf208: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf20c: 26100001 addiu r16,r16,0x0001         #               count = count + 1
801bf210: 3c028017 lui r2,0x8017
801bf214: 8c424038 lw r2,0x4038(r2)             #               threadID
801bf218: 3c038016 lui r3,0x8016
801bf21c: 8c635f98 lw r3,0x5f98(r3)             #               Base thread array pointer
801bf220: 00021280 sll r2,r2,0x0a               #               threadID * sizeof(thread)
801bf224: 00431021 addu r2,r2,r3                #               thread
801bf228: ac53000c sw r19,0x000c(r2)            #               thread.0x0c = 1
801bf22c: 2a0204ec slti r2,r16,0x04ec
801bf230: 10400045 beq r2,r0,0x801bf348         #           } while (count < 0x4ec)       // <-- This is the delay causer for chapter 1 end graphic
801bf234: 00000000 nop
801bf238: 0806fc82 j 0x801bf208                 #       
801bf23c: 00000000 nop                          #       }
801bf240: 16220011 bne r17,r2,0x801bf288        
801bf244: 3402000b ori r2,r0,0x000b             #       11
                                                #       else if (graphicID == 10) {
801bf248: 00008021 addu r16,r0,r0               #           count = 0
801bf24c: 34130001 ori r19,r0,0x0001            #           1
                                                #           do {
801bf250: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf254: 26100001 addiu r16,r16,0x0001         #               count = count + 1
801bf258: 3c028017 lui r2,0x8017
801bf25c: 8c424038 lw r2,0x4038(r2)             #               threadID
801bf260: 3c038016 lui r3,0x8016
801bf264: 8c635f98 lw r3,0x5f98(r3)             #               Thread array base pointer
801bf268: 00021280 sll r2,r2,0x0a               #               threadID * sizeof(thread)
801bf26c: 00431021 addu r2,r2,r3                #               thread
801bf270: ac53000c sw r19,0x000c(r2)            #               thread.0x0c = 1
801bf274: 2a0205a0 slti r2,r16,0x05a0
801bf278: 10400033 beq r2,r0,0x801bf348         #           } while (count < 0x5a0)
801bf27c: 00000000 nop
801bf280: 0806fc94 j 0x801bf250
801bf284: 00000000 nop                          #       }
801bf288: 16220011 bne r17,r2,0x801bf2d0
801bf28c: 3402000c ori r2,r0,0x000c             #       12
                                                #       else if (graphicID == 11) {
801bf290: 00008021 addu r16,r0,r0               #           count = 0
801bf294: 34130001 ori r19,r0,0x0001            #           1
                                                #           do {
801bf298: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf29c: 26100001 addiu r16,r16,0x0001         #               count = count + 1
801bf2a0: 3c028017 lui r2,0x8017
801bf2a4: 8c424038 lw r2,0x4038(r2)             #               threadID
801bf2a8: 3c038016 lui r3,0x8016
801bf2ac: 8c635f98 lw r3,0x5f98(r3)             #               Thread array base pointer
801bf2b0: 00021280 sll r2,r2,0x0a               #               threadID * sizeof(thread)
801bf2b4: 00431021 addu r2,r2,r3                #               thread
801bf2b8: ac53000c sw r19,0x000c(r2)            #               thread.0x0c = 1
801bf2bc: 2a0208ac slti r2,r16,0x08ac
801bf2c0: 10400021 beq r2,r0,0x801bf348         #           } while (count < 0x8ac)
801bf2c4: 00000000 nop
801bf2c8: 0806fca6 j 0x801bf298
801bf2cc: 00000000 nop                          #       }
801bf2d0: 16220010 bne r17,r2,0x801bf314        #       else if (graphicID == 12) {        
801bf2d4: 00008021 addu r16,r0,r0               #           count = 0
801bf2d8: 34130001 ori r19,r0,0x0001            #           1
                                                #           do {
801bf2dc: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf2e0: 26100001 addiu r16,r16,0x0001         #               count = count + 1
801bf2e4: 3c028017 lui r2,0x8017
801bf2e8: 8c424038 lw r2,0x4038(r2)             #               threadID
801bf2ec: 3c038016 lui r3,0x8016
801bf2f0: 8c635f98 lw r3,0x5f98(r3)             #               Thread array base pointer
801bf2f4: 00021280 sll r2,r2,0x0a               #               threadID * sizeof(thread)
801bf2f8: 00431021 addu r2,r2,r3                #               thread
801bf2fc: ac53000c sw r19,0x000c(r2)            #               thread.0x0c = 1
801bf300: 2a020258 slti r2,r16,0x0258
801bf304: 10400010 beq r2,r0,0x801bf348         #           } while (count < 0x258)
801bf308: 00000000 nop
801bf30c: 0806fcb7 j 0x801bf2dc
801bf310: 00000000 nop                          #       } else {
                                                #           count = 0
801bf314: 34130001 ori r19,r0,0x0001            #           1
                                                #           do {
801bf318: 0c0532a0 jal 0x8014ca80               #               Switch To Next Thread ();
801bf31c: 26100001 addiu r16,r16,0x0001         #               count = count + 1
801bf320: 3c028017 lui r2,0x8017
801bf324: 8c424038 lw r2,0x4038(r2)             #               threadID
801bf328: 3c038016 lui r3,0x8016
801bf32c: 8c635f98 lw r3,0x5f98(r3)             #               Thread array base pointer
801bf330: 00021280 sll r2,r2,0x0a               #               threadID * sizeof(thread)
801bf334: 00431021 addu r2,r2,r3                #               thread
801bf338: ac53000c sw r19,0x000c(r2)            #               thread.0x0c = 1
801bf33c: 2a0217e8 slti r2,r16,0x17e8           
801bf340: 1440fff5 bne r2,r0,0x801bf318         #           } while (count < 0x17e8)
801bf344: 00000000 nop                          #       }

801bf348: 3c018016 lui r1,0x8016
801bf34c: ac20603c sw r0,0x603c(r1)             #       *0x8016603c = 0
                                                #       do {
801bf350: 0c0532a0 jal 0x8014ca80               #           Switch To Next Thread ();
801bf354: 00000000 nop
801bf358: 0c0532a0 jal 0x8014ca80               #           Switch To Next Thread ();       // Do it twice for some reason...
801bf35c: 00000000 nop
801bf360: 3c028016 lui r2,0x8016
801bf364: 8c42603c lw r2,0x603c(r2)             #           *0x8016603c
801bf368: 00000000 nop
801bf36c: 24420008 addiu r2,r2,0x0008           #           *0x8016603c + 8
801bf370: 3c018016 lui r1,0x8016
801bf374: ac22603c sw r2,0x603c(r1)             #           *0x8016603c = *0x8016603c + 8
801bf378: 28420100 slti r2,r2,0x0100
801bf37c: 1440fff4 bne r2,r0,0x801bf350         #       } while (*0x8016603c < 256)
801bf380: 340200ff ori r2,r0,0x00ff

801bf384: 3c018016 lui r1,0x8016
801bf388: ac22603c sw r2,0x603c(r1)             #       *0x8016603c = 255
801bf38c: 3402000a ori r2,r0,0x000a             #       10
801bf390: 3c018016 lui r1,0x8016
801bf394: a4205ff2 sh r0,0x5ff2(r1)             #       *0x80165ff2 = 0
801bf398: 16220003 bne r17,r2,0x801bf3a8        #       if (graphicID == 10) {
801bf39c: 00000000 nop
801bf3a0: 3c018016 lui r1,0x8016
801bf3a4: ac20603c sw r0,0x603c(r1)             #           *0x8016603c = 0
                                                #       }
                                                #   }
801bf3a8: 0c0091b5 jal 0x800246d4               #   ? 0x246d4 (0);
801bf3ac: 00002021 addu r4,r0,r0
801bf3b0: 0c011180 jal 0x80044600               #   ? 0x44600 (result_0x444dc);
801bf3b4: 02402021 addu r4,r18,r0
801bf3b8: 8fbf0020 lw r31,0x0020(r29)
801bf3bc: 8fb3001c lw r19,0x001c(r29)
801bf3c0: 8fb20018 lw r18,0x0018(r29)
801bf3c4: 8fb10014 lw r17,0x0014(r29)
801bf3c8: 8fb00010 lw r16,0x0010(r29)
801bf3cc: 27bd0028 addiu r29,r29,0x0028
801bf3d0: 03e00008 jr r31
801bf3d4: 00000000 nop