0x830a8
Jump to navigation
Jump to search
# ROUTINE: 0x830a8 # Related to Brave Story menu # Parameters: # r4 = (p1) ? 800830a8: 3c02800a lui r2,0x800a 800830ac: 8c42ef3c lw r2,-0x10c4(r2) # *0x8009ef3c 800830b0: 27bdffe8 addiu r29,r29,-0x0018 800830b4: afbf0014 sw r31,0x0014(r29) 800830b8: afb00010 sw r16,0x0010(r29) 800830bc: 00021840 sll r3,r2,0x01 # *0x8009ef3c * 2 800830c0: 00621821 addu r3,r3,r2 # *0x8009ef3c * 3 800830c4: 00031880 sll r3,r3,0x02 # *0x8009ef3c * 12 800830c8: 00621821 addu r3,r3,r2 # *0x8009ef3c * 13 800830cc: 00031880 sll r3,r3,0x02 # *0x8009ef3c * 52 800830d0: 3c01800c lui r1,0x800c 800830d4: 2421bc70 addiu r1,r1,-0x4390 800830d8: 00230821 addu r1,r1,r3 800830dc: 8c220000 lw r2,0x0000(r1) # *(0x800bbc70 + (*0x8009ef3c * 52)) 800830e0: 00000000 nop 800830e4: 30420100 andi r2,r2,0x0100 # *(0x800bbc70 + (*0x8009ef3c * 52)) & 0x100 800830e8: 144000cf bne r2,r0,0x80083428 # if ((*(0x800bbc70 + (*0x8009ef3c * 52)) & 0x100) != 0) return; 800830ec: 00808021 addu r16,r4,r0 # p1 800830f0: 3c028005 lui r2,0x8005 800830f4: 8c42d950 lw r2,-0x26b0(r2) # *0x8004d950 800830f8: 00000000 nop 800830fc: 30420004 andi r2,r2,0x0004 # *0x8004d950 & 4 80083100: 10400021 beq r2,r0,0x80083188 # if ((*0x8004d950 & 4) != 0) { 80083104: 00000000 nop 80083108: 0c03ffbb jal 0x800ffeec # isRunning = Check Thread Running Status (WORLD.BIN) (14); 8008310c: 3404000e ori r4,r0,0x000e 80083110: 1440001d bne r2,r0,0x80083188 # if (!isRunning) { 80083114: 00000000 nop 80083118: 3c078005 lui r7,0x8005 8008311c: 8ce7d950 lw r7,-0x26b0(r7) # *0x8004d950 80083120: 00000000 nop 80083124: 30e20008 andi r2,r7,0x0008 # *0x8004d950 & 8 80083128: 14400017 bne r2,r0,0x80083188 # if ((*0x8004d950 & 8) == 0) { 8008312c: 00000000 nop 80083130: 8e050000 lw r5,0x0000(r16) # *p1 80083134: 3c02800d lui r2,0x800d 80083138: 8c420828 lw r2,0x0828(r2) # *0x800d0828 8008313c: 3c03800d lui r3,0x800d 80083140: 8c63082c lw r3,0x082c(r3) # *0x800d082c 80083144: 3c018005 lui r1,0x8005 80083148: ac229a10 sw r2,-0x65f0(r1) # *0x80049a10 = *0x800d0828 8008314c: 3c018005 lui r1,0x8005 80083150: ac239a14 sw r3,-0x65ec(r1) # *0x80049a14 = *0x800d082c 80083154: 38e20001 xori r2,r7,0x0001 # *0x8004d950 XOR 1 80083158: 3c030004 lui r3,0x0004 8008315c: 00431025 or r2,r2,r3 # (*0x8004d950 XOR 1) | 0x40000 80083160: 3c018005 lui r1,0x8005 80083164: ac22d950 sw r2,-0x26b0(r1) # *0x8004d950 = (*0x8004d950 XOR 1) | 0x40000 80083168: 3c018005 lui r1,0x8005 8008316c: ac25e9d0 sw r5,-0x1630(r1) # *0x8004e9d0 = *p1 80083170: 0c03bc6a jal 0x800ef1a8 # weatherValue = Get Script Variable (WORLD.BIN) (0x23); 80083174: 34040023 ori r4,r0,0x0023 80083178: 3c018005 lui r1,0x8005 8008317c: ac22d9b0 sw r2,-0x2650(r1) # *0x8004d9b0 = weatherValue 80083180: 08020d0a j 0x80083428 # return; 80083184: 00000000 nop # } # } # } 80083188: 3c02800c lui r2,0x800c 8008318c: 8c42c2f0 lw r2,-0x3d10(r2) # *0x800bc2f0 80083190: 00000000 nop 80083194: 30420010 andi r2,r2,0x0010 # *0x800bc2f0 & 0x10 80083198: 10400020 beq r2,r0,0x8008321c 8008319c: 340401fc ori r4,r0,0x01fc # if ((*0x800bc2f0 & 0x10) != 0) { // Might be check for Triangle button press 800831a0: 0c03bc97 jal 0x800ef25c # Set Script Variable (WORLD.BIN) (0x1fc, 1); 800831a4: 34050001 ori r5,r0,0x0001 800831a8: 8e020000 lw r2,0x0000(r16) # *p1 800831ac: 3c038009 lui r3,0x8009 800831b0: 8c636a50 lw r3,0x6a50(r3) # *0x80096a40 800831b4: 00021040 sll r2,r2,0x01 # *p1 * 2 800831b8: 00431021 addu r2,r2,r3 # *0x80096a40 + (*p1 * 2) 800831bc: 94450000 lhu r5,0x0000(r2) # currentEventID = *(*0x80096a40 + (*p1 * 2)) 800831c0: 0c03bc97 jal 0x800ef25c # Set Script Variable (WORLD.BIN) (0x27, currentEventID); 800831c4: 34040027 ori r4,r0,0x0027 800831c8: 34040002 ori r4,r0,0x0002 # 2 800831cc: 3c028005 lui r2,0x8005 800831d0: 8c42d950 lw r2,-0x26b0(r2) # *0x8004d950 800831d4: 00000000 nop 800831d8: 34420004 ori r2,r2,0x0004 # *0x8004d950 & 4 800831dc: 3c018005 lui r1,0x8005 800831e0: ac22d950 sw r2,-0x26b0(r1) # *0x8004d950 = *0x8004d950 & 4 800831e4: 0c01a500 jal 0x80069400 # 0x69400 (2, 16); 800831e8: 34050010 ori r5,r0,0x0010 800831ec: 3404000e ori r4,r0,0x000e 800831f0: 00002821 addu r5,r0,r0 800831f4: 2406ffff addiu r6,r0,-0x0001 800831f8: 0c03ffc2 jal 0x800fff08 # Store Thread Function Parameters (WORLD.BIN) (14, 0, -1, 0); 800831fc: 00003821 addu r7,r0,r0 80083200: 0c02434c jal 0x80090d30 # Play Sound Effect (0x90d30) (1); 80083204: 34040001 ori r4,r0,0x0001 80083208: 34040002 ori r4,r0,0x0002 8008320c: 0c024354 jal 0x80090d50 # 0x90d50 (2, 16); 80083210: 34050010 ori r5,r0,0x0010 80083214: 08020d0a j 0x80083428 # return; 80083218: 00000000 nop # } 8008321c: 3c04800a lui r4,0x800a 80083220: 2484eef8 addiu r4,r4,-0x1108 # 0x8009eef8 80083224: 0c0240f9 jal 0x800903e4 # result = 0x903e4 (0x8009eef8); 80083228: 00000000 nop 8008322c: 1440007e bne r2,r0,0x80083428 # if (result != 0) return; 80083230: 00000000 nop 80083234: 0c02434c jal 0x80090d30 # Play Sound Effect (0x90d30) (2); 80083238: 34040002 ori r4,r0,0x0002 8008323c: 3c06800c lui r6,0x800c 80083240: 8cc6b4f0 lw r6,-0x4b10(r6) # *0x800bb4f0 80083244: 00000000 nop 80083248: 24c2fffe addiu r2,r6,-0x0002 # *0x800bb4f0 - 2 8008324c: 00022040 sll r4,r2,0x01 # (*0x800bb4f0 - 2) * 2 80083250: 00822021 addu r4,r4,r2 # (*0x800bb4f0 - 2) * 3 80083254: 000420c0 sll r4,r4,0x03 # (*0x800bb4f0 - 2) * 24 80083258: 00822023 subu r4,r4,r2 # (*0x800bb4f0 - 2) * 23 8008325c: 00042080 sll r4,r4,0x02 # index = (*0x800bb4f0 - 2) * 92 80083260: 3c01800c lui r1,0x800c 80083264: 2421b994 addiu r1,r1,-0x466c 80083268: 00240821 addu r1,r1,r4 8008326c: 8c230000 lw r3,0x0000(r1) # *(0x800bb994 + index) 80083270: 00000000 nop 80083274: 00031040 sll r2,r3,0x01 # *(0x800bb994 + index) * 2 80083278: 00431021 addu r2,r2,r3 # *(0x800bb994 + index) * 3 8008327c: 00021080 sll r2,r2,0x02 # *(0x800bb994 + index) * 12 80083280: 00431021 addu r2,r2,r3 # *(0x800bb994 + index) * 13 80083284: 00021080 sll r2,r2,0x02 # *(0x800bb994 + index) * 52 80083288: 3c01800c lui r1,0x800c 8008328c: 2421bc70 addiu r1,r1,-0x4390 80083290: 00220821 addu r1,r1,r2 80083294: 8c230000 lw r3,0x0000(r1) # value = *(0x800bbc70 + (*(0x800bb994 + index) * 52)) 80083298: 3c01800c lui r1,0x800c 8008329c: 2421b98c addiu r1,r1,-0x4674 800832a0: 00240821 addu r1,r1,r4 800832a4: 8c250000 lw r5,0x0000(r1) # *(0x800bb98c + index) 800832a8: 34630100 ori r3,r3,0x0100 # value & 0x100 800832ac: 3c01800c lui r1,0x800c 800832b0: 2421bc70 addiu r1,r1,-0x4390 800832b4: 00220821 addu r1,r1,r2 800832b8: ac230000 sw r3,0x0000(r1) # *(0x800bbc70 + (*(0x800bb994 + index) * 52)) = value & 0x100 800832bc: 000518c0 sll r3,r5,0x03 # *(0x800bb98c + index) * 8 800832c0: 00651821 addu r3,r3,r5 # *(0x800bb98c + index) * 9 800832c4: 00031880 sll r3,r3,0x02 # *(0x800bb98c + index) * 36 800832c8: 3c01800c lui r1,0x800c 800832cc: 2421b504 addiu r1,r1,-0x4afc 800832d0: 00230821 addu r1,r1,r3 800832d4: 8c220000 lw r2,0x0000(r1) # value = *(0x800bb504 + (*(0x800bb98c + index) * 36)) 800832d8: 2405ffef addiu r5,r0,-0x0011 800832dc: 00451024 and r2,r2,r5 # value & 0xffffffef 800832e0: 3c01800c lui r1,0x800c 800832e4: 2421b504 addiu r1,r1,-0x4afc 800832e8: 00230821 addu r1,r1,r3 800832ec: ac220000 sw r2,0x0000(r1) # *(0x800bb504 + (*(0x800bb98c + index) * 36)) = value & 0xffffffef 800832f0: 3c01800c lui r1,0x800c 800832f4: 2421b990 addiu r1,r1,-0x4670 800832f8: 00240821 addu r1,r1,r4 800832fc: 8c220000 lw r2,0x0000(r1) # *(0x800bb990 + index) 80083300: 00000000 nop 80083304: 000218c0 sll r3,r2,0x03 # *(0x800bb990 + index) * 8 80083308: 00621821 addu r3,r3,r2 # *(0x800bb990 + index) * 9 8008330c: 00031880 sll r3,r3,0x02 # *(0x800bb990 + index) * 36 80083310: 3c01800c lui r1,0x800c 80083314: 2421b504 addiu r1,r1,-0x4afc 80083318: 00230821 addu r1,r1,r3 8008331c: 8c220000 lw r2,0x0000(r1) # value = *(0x800bb504 + (*(0x800bb990 + index) * 36)) 80083320: 00000000 nop 80083324: 00451024 and r2,r2,r5 # value & 0xffffffef 80083328: 3c01800c lui r1,0x800c 8008332c: 2421b504 addiu r1,r1,-0x4afc 80083330: 00230821 addu r1,r1,r3 80083334: ac220000 sw r2,0x0000(r1) # *(0x800bb504 + (*(0x800bb990 + index) * 36)) = value & 0xffffffef 80083338: 3c01800c lui r1,0x800c 8008333c: 2421b994 addiu r1,r1,-0x466c 80083340: 00240821 addu r1,r1,r4 80083344: 8c230000 lw r3,0x0000(r1) # *(0x800bb994 + index) 80083348: 00000000 nop 8008334c: 00031040 sll r2,r3,0x01 # *(0x800bb994 + index) * 2 80083350: 00431021 addu r2,r2,r3 # *(0x800bb994 + index) * 3 80083354: 00021080 sll r2,r2,0x02 # *(0x800bb994 + index) * 12 80083358: 00431021 addu r2,r2,r3 # *(0x800bb994 + index) * 13 8008335c: 00021080 sll r2,r2,0x02 # *(0x800bb994 + index) * 52 80083360: 3c01800c lui r1,0x800c 80083364: 2421bc70 addiu r1,r1,-0x4390 80083368: 00220821 addu r1,r1,r2 8008336c: 8c230000 lw r3,0x0000(r1) # value = *(0x800bbc70 + (*(0x800bb994 + index) * 52)) 80083370: 00000000 nop 80083374: 00651824 and r3,r3,r5 # value & 0xffffffef 80083378: 3c01800c lui r1,0x800c 8008337c: 2421bc70 addiu r1,r1,-0x4390 80083380: 00220821 addu r1,r1,r2 80083384: ac230000 sw r3,0x0000(r1) # *(0x800bbc70 + (*(0x800bb994 + index) * 52)) = value & 0xffffffef 80083388: 3c01800c lui r1,0x800c 8008338c: 2421b9ac addiu r1,r1,-0x4654 80083390: 00240821 addu r1,r1,r4 80083394: 8c220000 lw r2,0x0000(r1) # *(0x800bb9ac + index) 80083398: 00000000 nop 8008339c: 000218c0 sll r3,r2,0x03 # *(0x800bb9ac + index) * 8 800833a0: 00621821 addu r3,r3,r2 # *(0x800bb9ac + index) * 9 800833a4: 00031880 sll r3,r3,0x02 # *(0x800bb9ac + index) * 36 800833a8: 3c01800c lui r1,0x800c 800833ac: 2421b504 addiu r1,r1,-0x4afc 800833b0: 00230821 addu r1,r1,r3 800833b4: 8c220000 lw r2,0x0000(r1) # value = *(0x800bb504 + (*(0x800bb9ac + index) * 36)) 800833b8: 00000000 nop 800833bc: 00451024 and r2,r2,r5 # value & 0xffffffef 800833c0: 3c01800c lui r1,0x800c 800833c4: 2421b504 addiu r1,r1,-0x4afc 800833c8: 00230821 addu r1,r1,r3 800833cc: ac220000 sw r2,0x0000(r1) # *(0x800bb504 + (*(0x800bb9ac + index) * 36)) = value 800833d0: 3c01800c lui r1,0x800c 800833d4: 2421b9b0 addiu r1,r1,-0x4650 800833d8: 00240821 addu r1,r1,r4 800833dc: 8c230000 lw r3,0x0000(r1) # *(0x800bb9b0 + index) 800833e0: 00000000 nop 800833e4: 000310c0 sll r2,r3,0x03 # *(0x800bb9b0 + index) * 8 800833e8: 00431021 addu r2,r2,r3 # *(0x800bb9b0 + index) * 9 800833ec: 00021080 sll r2,r2,0x02 # *(0x800bb9b0 + index) * 36 800833f0: 3c01800c lui r1,0x800c 800833f4: 2421b504 addiu r1,r1,-0x4afc 800833f8: 00220821 addu r1,r1,r2 800833fc: 8c230000 lw r3,0x0000(r1) # value = *(0x800bb504 + (*(0x800bb9b0 + index) * 36)) 80083400: 24c6ffff addiu r6,r6,-0x0001 # *0x800bb4f0 - 1 80083404: 3c01800c lui r1,0x800c 80083408: ac26b4f0 sw r6,-0x4b10(r1) # *0x800bb4f0 = *0x800bb4f0 - 1 8008340c: 00651824 and r3,r3,r5 # value & 0xffffffef 80083410: 3c01800c lui r1,0x800c 80083414: 2421b504 addiu r1,r1,-0x4afc 80083418: 00220821 addu r1,r1,r2 8008341c: ac230000 sw r3,0x0000(r1) # *(0x800bb504 + (*(0x800bb9b0 + index) * 36)) = value 80083420: 0c020a7a jal 0x800829e8 # 0x829e8 (); 80083424: 00000000 nop 80083428: 8fbf0014 lw r31,0x0014(r29) 8008342c: 8fb00010 lw r16,0x0010(r29) 80083430: 27bd0018 addiu r29,r29,0x0018 80083434: 03e00008 jr r31 80083438: 00000000 nop