Display Height
Jump to navigation
Jump to search
# ROUTINE: DISPLAY HEIGHT? (0x134438) # This routine loads the height number for display... # No parameters. # No return value. 00134438: 27bdfec0 addiu r29,r29,-0x0140 0013443c: afb3012c sw r19,0x012c(r29) 00134440: 3c138017 lui r19,0x8017 00134444: 26733cbc addiu r19,r19,0x3cbc # 0x80173cbc 00134448: 2664012c addiu r4,r19,0x012c # (Routine call parameter 1) = 0x80173de8 0013444c: afbf013c sw r31,0x013c(r29) 00134450: afb60138 sw r22,0x0138(r29) 00134454: afb50134 sw r21,0x0134(r29) 00134458: afb40130 sw r20,0x0130(r29) 0013445c: afb20128 sw r18,0x0128(r29) 00134460: afb10124 sw r17,0x0124(r29) 00134464: afb00120 sw r16,0x0120(r29) 00134468: 3c018016 lui r1,0x8016 0013446c: ac206044 sw r0,0x6044(r1) # *0x80166044 = 0 00134470: 0c0529b9 jal 0x0014a6e4 # ROUTINE: ? 0x14a6e4 00134474: 34050001 ori r5,r0,0x0001 # (Routine call parameter 2) = 1 00134478: 26640138 addiu r4,r19,0x0138 # (Routine call parameter 1) = 0x80173df4 0013447c: 0c0529b9 jal 0x0014a6e4 # ROUTINE: ? 0x14a6e4 00134480: 00002821 addu r5,r0,r0 # (Routine call parameter 2) = 0 00134484: 00008821 addu r17,r0,r0 # count = 0 00134488: 34127cfc ori r18,r0,0x7cfc # 0x7cfc 0013448c: 02608021 addu r16,r19,r0 # ptr = 0x80173cbc # do { 00134490: 0c008f51 jal 0x00023d44 # ROUTINE: ? 0x23d44 (ptr) 00134494: 02002021 addu r4,r16,r0 # Routine call parameter: ptr 00134498: 02002021 addu r4,r16,r0 # (Routine call parameter 1): ptr 0013449c: 0c008f24 jal 0x00023c90 # ROUTINE: ? 0x23c90 (ptr, 0) 001344a0: 00002821 addu r5,r0,r0 # (Routine call parameter 2): 0 001344a4: 02002021 addu r4,r16,r0 # (Routine call parameter 1): ptr 001344a8: 0c008f1a jal 0x00023c68 # ROUTINE: ? 0x23c68 (ptr, 1) 001344ac: 34050001 ori r5,r0,0x0001 # (Routine call parameter 2): 1 001344b0: 00002021 addu r4,r0,r0 # texture compression mode: 4 bit compressed 001344b4: 00002821 addu r5,r0,r0 # semi transparency mode: 0.5b + 0.5f 001344b8: 34060380 ori r6,r0,0x0380 # tpage X location: 0x380 // I think this is... vram slot E to the right? 001344bc: 0c008e63 jal 0x0002398c # ROUTINE: P00 GetTpage (0, 0, 0x380, 0x120) 001344c0: 34070120 ori r7,r0,0x0120 # tpage Y location: 0x120 // the 0x20 is irrelevant here? it's ANDed out anyway. 2nd row of vram? (item.bin?) 001344c4: a602001a sh r2,0x001a(r16) # Struct data offset 0x1a (Spritesheet ID) = (Routine 0x2398c result); Seems to be 0x001e (ITEM.BIN) 001344c8: a612000e sh r18,0x000e(r16) # Struct data offset 0x0e = 0x7cfc 001344cc: 26310001 addiu r17,r17,0x0001 # count = count + 1 001344d0: 2a220005 slti r2,r17,0x0005 001344d4: 1440ffee bne r2,r0,0x00134490 001344d8: 26100034 addiu r16,r16,0x0034 # ptr = ptr + sizeof(struct data) // = 0x34 (52) # } while (count < 5) 001344dc: 26640104 addiu r4,r19,0x0104 # (Routine call parameter 1) = 0x0104 001344e0: 34050002 ori r5,r0,0x0002 # (Routine call parameter 2) = 2 001344e4: 0c04b8ae jal 0x0012e2b8 # ROUTINE: ? 0x12eb28 (0x0104, 2, 0x7cbc) 001344e8: 34067cbc ori r6,r0,0x7cbc # (Routine call parameter 3) = 0x7cbc 001344ec: 34027d7c ori r2,r0,0x7d7c # 0x7d7c 001344f0: a6620126 sh r2,0x0126(r19) # 0x80173de2 = 0x7d7c 001344f4: 00008821 addu r17,r0,r0 # count = 0 001344f8: 3c128016 lui r18,0x8016 001344fc: 2652797c addiu r18,r18,0x797c # ptr = 0x8016797c 00134500: 34100104 ori r16,r0,0x0104 # offset = 0x0104 # do { 00134504: 02702021 addu r4,r19,r16 # (Routine call parameter 1) = 0x80173cbc + offset 00134508: 3c058016 lui r5,0x8016 0013450c: 24a55ea4 addiu r5,r5,0x5ea4 # (Routine call parameter 2) = 0x80165ea4 00134510: 3c068016 lui r6,0x8016 00134514: 24c67974 addiu r6,r6,0x7974 # (Routine call parameter 3) = 0x80167974 00134518: 0c052a0d jal 0x0014a834 # ROUTINE: Image loading setup? (0x14a834) (0x80173cbc + offset, 0x80165ea4, 0x80167974, ptr) 0013451c: 02403821 addu r7,r18,r0 # (Routine call parameter 4) = ptr 00134520: 2652000c addiu r18,r18,0x000c # ptr = ptr + 12 00134524: 26310001 addiu r17,r17,0x0001 # count = count + 1 00134528: 2a220002 slti r2,r17,0x0002 0013452c: 1440fff5 bne r2,r0,0x00134504 00134530: 26100014 addiu r16,r16,0x0014 # offset = offset + 0x14 (20) # } while (count < 2) 00134534: afa00010 sw r0,0x0010(r29) 00134538: 27a40018 addiu r4,r29,0x0018 0013453c: 34050018 ori r5,r0,0x0018 00134540: 34060010 ori r6,r0,0x0010 00134544: 0c04d0f8 jal 0x001343e0 00134548: 26670104 addiu r7,r19,0x0104 0013454c: 3c048017 lui r4,0x8017 00134550: 24843e00 addiu r4,r4,0x3e00 # Routine call parameter 1: 0x80173e00 00134554: 2485febc addiu r5,r4,-0x0144 # Routine call parameter 2: 0x80173cbc 00134558: 0c052fd5 jal 0x0014bf54 # ROUTINE: ? 0x14bf54 0013455c: 34060144 ori r6,r0,0x0144 # Routine call parameter 3: 324 00134560: 0000a021 addu r20,r0,r0 # count = 0 00134564: 3c168015 lui r22,0x8015 00134568: 26d6d034 addiu r22,r22,-0x2fcc # 0x8014d034 0013456c: 27b20020 addiu r18,r29,0x0020 # sp + 20 00134570: 3c158016 lui r21,0x8016 00134574: 26b55fa8 addiu r21,r21,0x5fa8 # 0x80165fa8 # for (; ; count++) { // Loops infinitely until result of routine call at 0x8014cc28 != 0. "count" increases every iteration. 00134578: 32820001 andi r2,r20,0x0001 # value = count & 1 0013457c: 00021880 sll r3,r2,0x02 # value * 4 00134580: 00621821 addu r3,r3,r2 # value * 5 00134584: 00031900 sll r3,r3,0x04 # value * 80 00134588: 00621821 addu r3,r3,r2 # value * 81 0013458c: 00031880 sll r3,r3,0x02 # value * 324 00134590: 3c028017 lui r2,0x8017 00134594: 24423cbc addiu r2,r2,0x3cbc # 0x80173cbc 00134598: 00629821 addu r19,r3,r2 # 0x80173cbc + (value * 324) 0013459c: 3c048015 lui r4,0x8015 001345a0: 8484d032 lh r4,-0x2fce(r4) # Routine call parameter 1: Height (halves) + depth? (*0x8014d032) // Changing value loaded here changes the displayed height 001345a4: 0c04d1bd jal 0x001346f4 # ROUTINE: Height Number Display Setup // Return value is number of images to display for height. Blanking out this call # // makes the displayed height never change. 001345a8: 02602821 addu r5,r19,r0 # Routine call parameter 2: 0x80173cbc + (value * 0x144 (324)) 001345ac: 0c0532a0 jal 0x0014ca80 # ROUTINE: ? 0x14ca80 001345b0: 2451ffff addiu r17,r2,0xffff 001345b4: 0c05272f jal 0x00149cbc # ROUTINE: ? 0x149cbc 001345b8: 34040036 ori r4,r0,0x0036 # Routine call parameter: 54 001345bc: 1440003a bne r2,r0,0x001346a8 # if (Routine call result != 0) 001345c0: 00000000 nop # continue; // (skip this iteration) 001345c4: 0c05272f jal 0x00149cbc # ROUTINE: ? 0x149cbc 001345c8: 34040037 ori r4,r0,0x0037 # Routine call parameter: 55 001345cc: 14400036 bne r2,r0,0x001346a8 # if (Routine call result != 0) 001345d0: 00000000 nop # continue; // (skip this iteration) 001345d4: 3c018016 lui r1,0x8016 001345d8: ac206044 sw r0,0x6044(r1) # *0x80166044 = 0 001345dc: 0c05330a jal 0x0014cc28 # ROUTINE: ? 0x14cc28 001345e0: 00000000 nop 001345e4: 14400032 bne r2,r0,0x001346b0 # if (Routine call result != 0), break (exit the loop) 001345e8: 02208021 addu r16,r17,r0 # r16 = (Routine 0x1346f4 result) - Number of images to display 001345ec: 0600000b bltz r16,0x0013461c # if (r16 >= 0) { 001345f0: 00101040 sll r2,r16,0x01 # r16 * 2 001345f4: 00501021 addu r2,r2,r16 # r16 * 3 001345f8: 00021080 sll r2,r2,0x02 # r16 * 12 001345fc: 00501021 addu r2,r2,r16 # r16 * 13 00134600: 00021080 sll r2,r2,0x02 # r16 * 52 00134604: 00538821 addu r17,r2,r19 # r17 = (r16 * 52) + 0x80173cbc + (value * 324) # do { 00134608: 0c05297a jal 0x0014a5e8 # ROUTINE: Image Loading Setup (0x14a5e8) 0013460c: 02202021 addu r4,r17,r0 # Routine call parameter: (r16 * 0x34 (52)) + 0x80173cbc + (value * 0x144 (324)) 00134610: 2610ffff addiu r16,r16,-0x0001 # r16 = r16 - 1 00134614: 0601fffc bgez r16,0x00134608 00134618: 2631ffcc addiu r17,r17,-0x0034 # r17 = r17 - 0x34 (52) # } while (r16 >= 0) # } 0013461c: 86c20000 lh r2,0x0000(r22) # *0x8014d034 00134620: 00000000 nop 00134624: 10400020 beq r2,r0,0x001346a8 # if (*0x8014d034 != 0) { 00134628: 00000000 nop 0013462c: 02402021 addu r4,r18,r0 00134630: 0c052fb6 jal 0x0014bed8 00134634: 34050100 ori r5,r0,0x0100 00134638: 34040010 ori r4,r0,0x0010 0013463c: 00002821 addu r5,r0,r0 00134640: 34020018 ori r2,r0,0x0018 00134644: 0c0529b3 jal 0x0014a6cc 00134648: aea20000 sw r2,0x0000(r21) 0013464c: 34050001 ori r5,r0,0x0001 00134650: 02403021 addu r6,r18,r0 00134654: 86c40000 lh r4,0x0000(r22) 00134658: 0c052b0c jal 0x0014ac30 0013465c: 26a7fff8 addiu r7,r21,-0x0008 00134660: 3c028016 lui r2,0x8016 00134664: 94427970 lhu r2,0x7970(r2) 00134668: 00000000 nop 0013466c: 1440000e bne r2,r0,0x001346a8 00134670: 00000000 nop 00134674: 27a40018 addiu r4,r29,0x0018 00134678: 0c00923f jal 0x000248fc 0013467c: 02402821 addu r5,r18,r0 00134680: 34027cbc ori r2,r0,0x7cbc 00134684: a6620112 sh r2,0x0112(r19) 00134688: 0c05297a jal 0x0014a5e8 0013468c: 26640104 addiu r4,r19,0x0104 00134690: 0c05297a jal 0x0014a5e8 00134694: 2664012c addiu r4,r19,0x012c 00134698: 0c05297a jal 0x0014a5e8 0013469c: 26640118 addiu r4,r19,0x0118 001346a0: 0c05297a jal 0x0014a5e8 001346a4: 26640138 addiu r4,r19,0x0138 # } 001346a8: 0804d15e j 0x00134578 001346ac: 26940001 addiu r20,r20,0x0001 # (Adds 1 to count at end of iteration) # } 001346b0: 0c0532a0 jal 0x0014ca80 001346b4: 00000000 nop 001346b8: 0c04bb24 jal 0x0012ec90 001346bc: 27a40018 addiu r4,r29,0x0018 001346c0: 0c053256 jal 0x0014c958 001346c4: 00000000 nop 001346c8: 8fbf013c lw r31,0x013c(r29) 001346cc: 8fb60138 lw r22,0x0138(r29) 001346d0: 8fb50134 lw r21,0x0134(r29) 001346d4: 8fb40130 lw r20,0x0130(r29) 001346d8: 8fb3012c lw r19,0x012c(r29) 001346dc: 8fb20128 lw r18,0x0128(r29) 001346e0: 8fb10124 lw r17,0x0124(r29) 001346e4: 8fb00120 lw r16,0x0120(r29) 001346e8: 27bd0140 addiu r29,r29,0x0140 001346ec: 03e00008 jr r31 001346f0: 00000000 nop