From 6799c345b7e89477e0f6483504c63f71ec4c1e4d Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Fri, 26 Nov 2021 23:19:17 +0000 Subject: [PATCH] Labelling of various things, mainly in and relating to unknown_06B2B0.c --- .../controller_pak/func_8007431C.s | 2 +- .../controller_pak/func_800744DC.s | 2 +- .../controller_pak/func_800746F0.s | 4 +- .../controller_pak/func_8007497C.s | 2 +- asm/non_matchings/menu/func_80094688.s | 4 +- asm/non_matchings/menu/func_80094D28.s | 2 +- asm/non_matchings/menu/tt_menu_loop.s | 104 ++++----- asm/non_matchings/printf/func_800B5F78.s | 2 +- .../unknown_00BC20/func_8000CC7C.s | 4 +- .../unknown_00BC20/func_80019808.s | 2 +- .../unknown_043920/func_8004DE38.s | 2 +- .../unknown_043920/func_8005A6F0.s | 2 +- .../unknown_06B2B0/func_8006CCF0.s | 14 +- .../unknown_06B2B0/func_8006DCF8.s | 40 ++-- .../unknown_06B2B0/func_8006ECFC.s | 4 +- .../unknown_09F8F0/func_800A01A0.s | 6 +- .../unknown_09F8F0/func_800A22F4.s | 2 +- src/audio.c | 10 +- src/controller_pak.c | 2 +- src/fade_transition.c | 16 +- src/menu.c | 219 +++++++++--------- src/menu.h | 11 +- src/thread0_epc.c | 4 +- src/unknown_00BC20.c | 2 +- src/unknown_06B2B0.c | 185 +++++++-------- src/unknown_06B2B0.h | 16 +- src/unknown_078050.c | 12 +- src/unknown_078050.h | 4 +- src/video.c | 20 +- 29 files changed, 361 insertions(+), 338 deletions(-) diff --git a/asm/non_matchings/controller_pak/func_8007431C.s b/asm/non_matchings/controller_pak/func_8007431C.s index 3afa7a2e..746e97a8 100644 --- a/asm/non_matchings/controller_pak/func_8007431C.s +++ b/asm/non_matchings/controller_pak/func_8007431C.s @@ -97,7 +97,7 @@ glabel func_8007431C /* 075070 80074470 1605FFFA */ bne $s0, $a1, .L8007445C /* 075074 80074474 24630004 */ addiu $v1, $v1, 4 .L80074478: -/* 075078 80074478 0C01BAB0 */ jal func_8006EAC0 +/* 075078 80074478 0C01BAB0 */ jal check_reset_pressed /* 07507C 8007447C AFA60054 */ sw $a2, 0x54($sp) /* 075080 80074480 8FA60054 */ lw $a2, 0x54($sp) /* 075084 80074484 1440000C */ bnez $v0, .L800744B8 diff --git a/asm/non_matchings/controller_pak/func_800744DC.s b/asm/non_matchings/controller_pak/func_800744DC.s index 30e6cbd5..47e0f76c 100644 --- a/asm/non_matchings/controller_pak/func_800744DC.s +++ b/asm/non_matchings/controller_pak/func_800744DC.s @@ -38,7 +38,7 @@ glabel func_800744DC /* 07515C 8007455C 02202025 */ move $a0, $s1 /* 075160 80074560 0C01CCBA */ jal func_800732E8 /* 075164 80074564 00402825 */ move $a1, $v0 -/* 075168 80074568 0C01BAB0 */ jal func_8006EAC0 +/* 075168 80074568 0C01BAB0 */ jal check_reset_pressed /* 07516C 8007456C 00000000 */ nop /* 075170 80074570 8FA3002C */ lw $v1, 0x2c($sp) /* 075174 80074574 1440000C */ bnez $v0, .L800745A8 diff --git a/asm/non_matchings/controller_pak/func_800746F0.s b/asm/non_matchings/controller_pak/func_800746F0.s index 4aaa3765..e84aa228 100644 --- a/asm/non_matchings/controller_pak/func_800746F0.s +++ b/asm/non_matchings/controller_pak/func_800746F0.s @@ -24,7 +24,7 @@ glabel func_800746F0 /* 075344 80074744 322F0001 */ andi $t7, $s1, 1 /* 075348 80074748 11E00011 */ beqz $t7, .L80074790 /* 07534C 8007474C AFB10028 */ sw $s1, 0x28($sp) -/* 075350 80074750 0C01BAB0 */ jal func_8006EAC0 +/* 075350 80074750 0C01BAB0 */ jal check_reset_pressed /* 075354 80074754 24110018 */ li $s1, 24 /* 075358 80074758 1440000D */ bnez $v0, .L80074790 /* 07535C 8007475C 00008025 */ move $s0, $zero @@ -47,7 +47,7 @@ glabel func_800746F0 /* 075398 80074798 31090002 */ andi $t1, $t0, 2 /* 07539C 8007479C 11200012 */ beqz $t1, .L800747E8 /* 0753A0 800747A0 00000000 */ nop -/* 0753A4 800747A4 0C01BAB0 */ jal func_8006EAC0 +/* 0753A4 800747A4 0C01BAB0 */ jal check_reset_pressed /* 0753A8 800747A8 24110018 */ li $s1, 24 /* 0753AC 800747AC 1440000E */ bnez $v0, .L800747E8 /* 0753B0 800747B0 00008025 */ move $s0, $zero diff --git a/asm/non_matchings/controller_pak/func_8007497C.s b/asm/non_matchings/controller_pak/func_8007497C.s index c885cfe5..01d33668 100644 --- a/asm/non_matchings/controller_pak/func_8007497C.s +++ b/asm/non_matchings/controller_pak/func_8007497C.s @@ -37,7 +37,7 @@ glabel func_8007497C /* 075604 80074A04 01C2C025 */ or $t8, $t6, $v0 /* 075608 80074A08 01E3C825 */ or $t9, $t7, $v1 /* 07560C 80074A0C AE190004 */ sw $t9, 4($s0) -/* 075610 80074A10 0C01BAB0 */ jal func_8006EAC0 +/* 075610 80074A10 0C01BAB0 */ jal check_reset_pressed /* 075614 80074A14 AE180000 */ sw $t8, ($s0) /* 075618 80074A18 14400008 */ bnez $v0, .L80074A3C /* 07561C 80074A1C 24020001 */ li $v0, 1 diff --git a/asm/non_matchings/menu/func_80094688.s b/asm/non_matchings/menu/func_80094688.s index 0e6efc0b..af73b424 100644 --- a/asm/non_matchings/menu/func_80094688.s +++ b/asm/non_matchings/menu/func_80094688.s @@ -141,7 +141,7 @@ glabel func_80094688 /* 095490 80094890 24090064 */ li $t1, 100 /* 095494 80094894 AC29F47C */ sw $t1, %lo(gMenuDelay)($at) .L80094898: -/* 095498 80094898 0C01B683 */ jal func_8006DA0C +/* 095498 80094898 0C01B683 */ jal get_render_context /* 09549C 8009489C 00000000 */ nop /* 0954A0 800948A0 10400003 */ beqz $v0, .L800948B0 /* 0954A4 800948A4 240A0007 */ li $t2, 7 @@ -230,7 +230,7 @@ glabel func_80094688 .L800949E0: /* 0955E0 800949E0 846A0004 */ lh $t2, 4($v1) /* 0955E4 800949E4 3C018012 */ lui $at, %hi(D_80126BC0) # $at, 0x8012 -/* 0955E8 800949E8 0C01B683 */ jal func_8006DA0C +/* 0955E8 800949E8 0C01B683 */ jal get_render_context /* 0955EC 800949EC AC2A6BC0 */ sw $t2, %lo(D_80126BC0)($at) /* 0955F0 800949F0 14400008 */ bnez $v0, .L80094A14 /* 0955F4 800949F4 3C048012 */ lui $a0, %hi(D_80126BB8) # $a0, 0x8012 diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 87e63951..68dab965 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -590,7 +590,7 @@ glabel L800951CC /* 096184 80095584 24040007 */ li $a0, 7 .L80095588: glabel L80095588 -/* 096188 80095588 0C01B683 */ jal func_8006DA0C +/* 096188 80095588 0C01B683 */ jal get_render_context /* 09618C 8009558C 00000000 */ nop /* 096190 80095590 1440001D */ bnez $v0, .L80095608 /* 096194 80095594 3C0F800E */ lui $t7, %hi(gNumberOfActivePlayers) # $t7, 0x800e diff --git a/asm/non_matchings/menu/tt_menu_loop.s b/asm/non_matchings/menu/tt_menu_loop.s index 0ea1df58..0b5018af 100644 --- a/asm/non_matchings/menu/tt_menu_loop.s +++ b/asm/non_matchings/menu/tt_menu_loop.s @@ -13,7 +13,7 @@ glabel tt_menu_loop /* 09E74C 8009DB4C 0C027B20 */ jal is_in_two_player_adventure /* 09E750 8009DB50 AFA20030 */ sw $v0, 0x30($sp) /* 09E754 8009DB54 10400007 */ beqz $v0, .L8009DB74 -/* 09E758 8009DB58 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09E758 8009DB58 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09E75C 8009DB5C 8FA20030 */ lw $v0, 0x30($sp) /* 09E760 8009DB60 00000000 */ nop /* 09E764 8009DB64 8C4E0010 */ lw $t6, 0x10($v0) @@ -24,13 +24,13 @@ glabel tt_menu_loop /* 09E774 8009DB74 8FA20030 */ lw $v0, 0x30($sp) /* 09E778 8009DB78 24090005 */ li $t1, 5 /* 09E77C 8009DB7C 8C580010 */ lw $t8, 0x10($v0) -/* 09E780 8009DB80 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09E780 8009DB80 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09E784 8009DB84 33190002 */ andi $t9, $t8, 2 /* 09E788 8009DB88 17200002 */ bnez $t9, .L8009DB94 /* 09E78C 8009DB8C 24040001 */ li $a0, 1 -/* 09E790 8009DB90 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09E790 8009DB90 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) .L8009DB94: -/* 09E794 8009DB94 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09E794 8009DB94 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09E798 8009DB98 24010004 */ li $at, 4 /* 09E79C 8009DB9C 10610012 */ beq $v1, $at, .L8009DBE8 /* 09E7A0 8009DBA0 24050018 */ li $a1, 24 @@ -65,12 +65,12 @@ glabel tt_menu_loop /* 09E808 8009DC08 AFA00044 */ sw $zero, 0x44($sp) /* 09E80C 8009DC0C 0C01A955 */ jal get_buttons_pressed_from_player /* 09E810 8009DC10 00002025 */ move $a0, $zero -/* 09E814 8009DC14 3C018012 */ lui $at, %hi(D_80126504) # $at, 0x8012 -/* 09E818 8009DC18 A0206504 */ sb $zero, %lo(D_80126504)($at) -/* 09E81C 8009DC1C 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 +/* 09E814 8009DC14 3C018012 */ lui $at, %hi(sDialogueOptionMax) # $at, 0x8012 +/* 09E818 8009DC18 A0206504 */ sb $zero, %lo(sDialogueOptionMax)($at) +/* 09E81C 8009DC1C 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 /* 09E820 8009DC20 3C018012 */ lui $at, %hi(D_8012650E) # $at, 0x8012 /* 09E824 8009DC24 240E0020 */ li $t6, 32 -/* 09E828 8009DC28 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09E828 8009DC28 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 /* 09E82C 8009DC2C A02E650E */ sb $t6, %lo(D_8012650E)($at) /* 09E830 8009DC30 81030000 */ lb $v1, ($t0) /* 09E834 8009DC34 00402025 */ move $a0, $v0 @@ -181,8 +181,8 @@ glabel L8009DC60 /* 09E9B8 8009DDB8 8FAE0040 */ lw $t6, 0x40($sp) /* 09E9BC 8009DDBC 33198000 */ andi $t9, $t8, 0x8000 /* 09E9C0 8009DDC0 13200032 */ beqz $t9, .L8009DE8C -/* 09E9C4 8009DDC4 3C098012 */ lui $t1, %hi(D_801264E2) # $t1, 0x8012 -/* 09E9C8 8009DDC8 812964E2 */ lb $t1, %lo(D_801264E2)($t1) +/* 09E9C4 8009DDC4 3C098012 */ lui $t1, %hi(sCurrentMenuID) # $t1, 0x8012 +/* 09E9C8 8009DDC8 812964E2 */ lb $t1, %lo(sCurrentMenuID)($t1) /* 09E9CC 8009DDCC 2401000A */ li $at, 10 /* 09E9D0 8009DDD0 1121002E */ beq $t1, $at, .L8009DE8C /* 09E9D4 8009DDD4 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 @@ -204,11 +204,11 @@ glabel L8009DC60 /* 09EA10 8009DE10 3C018012 */ lui $at, %hi(D_8012639C) # $at, 0x8012 /* 09EA14 8009DE14 AC20639C */ sw $zero, %lo(D_8012639C)($at) /* 09EA18 8009DE18 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 -/* 09EA1C 8009DE1C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EA1C 8009DE1C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EA20 8009DE20 240A0008 */ li $t2, 8 /* 09EA24 8009DE24 80636516 */ lb $v1, %lo(D_80126516)($v1) /* 09EA28 8009DE28 10000015 */ b .L8009DE80 -/* 09EA2C 8009DE2C A02A64E2 */ sb $t2, %lo(D_801264E2)($at) +/* 09EA2C 8009DE2C A02A64E2 */ sb $t2, %lo(sCurrentMenuID)($at) /* 09EA30 8009DE30 240400EF */ li $a0, 239 .L8009DE34: /* 09EA34 8009DE34 0C000741 */ jal func_80001D04 @@ -226,10 +226,10 @@ glabel L8009DC60 /* 09EA64 8009DE64 3C01800E */ lui $at, %hi(D_800E1E28) # $at, 0x800e /* 09EA68 8009DE68 A02B1E28 */ sb $t3, %lo(D_800E1E28)($at) /* 09EA6C 8009DE6C 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 -/* 09EA70 8009DE70 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EA70 8009DE70 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EA74 8009DE74 240C0004 */ li $t4, 4 /* 09EA78 8009DE78 80636516 */ lb $v1, %lo(D_80126516)($v1) -/* 09EA7C 8009DE7C A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EA7C 8009DE7C A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) .L8009DE80: /* 09EA80 8009DE80 246D0001 */ addiu $t5, $v1, 1 .L8009DE84: @@ -244,8 +244,8 @@ glabel L8009DC60 /* 09EAA0 8009DEA0 24180003 */ li $t8, 3 /* 09EAA4 8009DEA4 AFB80044 */ sw $t8, 0x44($sp) .L8009DEA8: -/* 09EAA8 8009DEA8 3C038012 */ lui $v1, %hi(D_801264E2) -/* 09EAAC 8009DEAC 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EAA8 8009DEA8 3C038012 */ lui $v1, %hi(sCurrentMenuID) +/* 09EAAC 8009DEAC 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EAB0 8009DEB0 24010004 */ li $at, 4 /* 09EAB4 8009DEB4 14610002 */ bne $v1, $at, .L8009DEC0 /* 09EAB8 8009DEB8 2409000A */ li $t1, 10 @@ -255,8 +255,8 @@ glabel L8009DC60 /* 09EAC4 8009DEC4 24010003 */ li $at, 3 /* 09EAC8 8009DEC8 17210004 */ bne $t9, $at, .L8009DEDC /* 09EACC 8009DECC 240A0003 */ li $t2, 3 -/* 09EAD0 8009DED0 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 -/* 09EAD4 8009DED4 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09EAD0 8009DED0 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 +/* 09EAD4 8009DED4 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) /* 09EAD8 8009DED8 2403000A */ li $v1, 10 .L8009DEDC: /* 09EADC 8009DEDC 2401000A */ li $at, 10 @@ -305,17 +305,17 @@ glabel L8009DEF0 /* 09EB78 8009DF78 24C60010 */ addiu $a2, $a2, 0x10 /* 09EB7C 8009DF7C 14E0FFEF */ bnez $a3, .L8009DF3C /* 09EB80 8009DF80 240F0001 */ li $t7, 1 -/* 09EB84 8009DF84 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 -/* 09EB88 8009DF88 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09EB84 8009DF84 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 +/* 09EB88 8009DF88 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 .L8009DF8C: /* 09EB8C 8009DF8C 8FAA0040 */ lw $t2, 0x40($sp) -/* 09EB90 8009DF90 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09EB90 8009DF90 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09EB94 8009DF94 314BC000 */ andi $t3, $t2, 0xc000 /* 09EB98 8009DF98 11600002 */ beqz $t3, .L8009DFA4 /* 09EB9C 8009DF9C 00000000 */ nop /* 09EBA0 8009DFA0 A1000000 */ sb $zero, ($t0) .L8009DFA4: -/* 09EBA4 8009DFA4 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EBA4 8009DFA4 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EBA8 8009DFA8 100000F5 */ b .L8009E380 /* 09EBAC 8009DFAC 24010001 */ li $at, 1 glabel L8009DFB0 @@ -330,8 +330,8 @@ glabel L8009DFB0 /* 09EBD0 8009DFD0 2404022F */ li $a0, 559 /* 09EBD4 8009DFD4 0C00DAF3 */ jal func_80036BCC /* 09EBD8 8009DFD8 24050001 */ li $a1, 1 -/* 09EBDC 8009DFDC 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EBE0 8009DFE0 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EBDC 8009DFDC 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EBE0 8009DFE0 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EBE4 8009DFE4 100000E6 */ b .L8009E380 /* 09EBE8 8009DFE8 24010001 */ li $at, 1 glabel L8009DFEC @@ -364,21 +364,21 @@ glabel L8009DFEC /* 09EC50 8009E050 24C60010 */ addiu $a2, $a2, 0x10 /* 09EC54 8009E054 14E0FFEF */ bnez $a3, .L8009E014 /* 09EC58 8009E058 240D0001 */ li $t5, 1 -/* 09EC5C 8009E05C 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 -/* 09EC60 8009E060 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09EC5C 8009E05C 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 +/* 09EC60 8009E060 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 /* 09EC64 8009E064 8FA90040 */ lw $t1, 0x40($sp) .L8009E068: /* 09EC68 8009E068 8FAB0030 */ lw $t3, 0x30($sp) /* 09EC6C 8009E06C 312AC000 */ andi $t2, $t1, 0xc000 /* 09EC70 8009E070 11400006 */ beqz $t2, .L8009E08C -/* 09EC74 8009E074 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09EC74 8009E074 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09EC78 8009E078 8D6C0010 */ lw $t4, 0x10($t3) /* 09EC7C 8009E07C 00000000 */ nop /* 09EC80 8009E080 358E0002 */ ori $t6, $t4, 2 /* 09EC84 8009E084 AD6E0010 */ sw $t6, 0x10($t3) /* 09EC88 8009E088 A1000000 */ sb $zero, ($t0) .L8009E08C: -/* 09EC8C 8009E08C 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EC8C 8009E08C 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EC90 8009E090 100000BB */ b .L8009E380 /* 09EC94 8009E094 24010001 */ li $at, 1 glabel L8009E098 @@ -428,10 +428,10 @@ glabel L8009E098 /* 09ED44 8009E144 24180007 */ li $t8, 7 /* 09ED48 8009E148 3C018012 */ lui $at, %hi(D_8012639C) # $at, 0x8012 /* 09ED4C 8009E14C AC38639C */ sw $t8, %lo(D_8012639C)($at) -/* 09ED50 8009E150 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09ED50 8009E150 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09ED54 8009E154 24190008 */ li $t9, 8 /* 09ED58 8009E158 1000000A */ b .L8009E184 -/* 09ED5C 8009E15C A03964E2 */ sb $t9, %lo(D_801264E2)($at) +/* 09ED5C 8009E15C A03964E2 */ sb $t9, %lo(sCurrentMenuID)($at) /* 09ED60 8009E160 8FA90040 */ lw $t1, 0x40($sp) .L8009E164: /* 09ED64 8009E164 00000000 */ nop @@ -440,11 +440,11 @@ glabel L8009E098 /* 09ED70 8009E170 24040241 */ li $a0, 577 /* 09ED74 8009E174 0C000741 */ jal func_80001D04 /* 09ED78 8009E178 00002825 */ move $a1, $zero -/* 09ED7C 8009E17C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 -/* 09ED80 8009E180 A02064E2 */ sb $zero, %lo(D_801264E2)($at) +/* 09ED7C 8009E17C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 +/* 09ED80 8009E180 A02064E2 */ sb $zero, %lo(sCurrentMenuID)($at) .L8009E184: -/* 09ED84 8009E184 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09ED88 8009E188 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09ED84 8009E184 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09ED88 8009E188 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09ED8C 8009E18C 1000007C */ b .L8009E380 /* 09ED90 8009E190 24010001 */ li $at, 1 glabel L8009E194 @@ -482,13 +482,13 @@ glabel L8009E194 /* 09EE10 8009E210 0C03145A */ jal func_800C5168 /* 09EE14 8009E214 24060042 */ li $a2, 66 /* 09EE18 8009E218 8FAC0040 */ lw $t4, 0x40($sp) -/* 09EE1C 8009E21C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EE1C 8009E21C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EE20 8009E220 318ED000 */ andi $t6, $t4, 0xd000 /* 09EE24 8009E224 11C00002 */ beqz $t6, .L8009E230 -/* 09EE28 8009E228 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EE2C 8009E22C A02064E2 */ sb $zero, %lo(D_801264E2)($at) +/* 09EE28 8009E228 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EE2C 8009E22C A02064E2 */ sb $zero, %lo(sCurrentMenuID)($at) .L8009E230: -/* 09EE30 8009E230 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EE30 8009E230 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EE34 8009E234 10000052 */ b .L8009E380 /* 09EE38 8009E238 24010001 */ li $at, 1 glabel L8009E23C @@ -533,53 +533,53 @@ glabel L8009E23C glabel L8009E2D0 /* 09EED0 8009E2D0 3C0C8012 */ lui $t4, %hi(D_8012639C) # $t4, 0x8012 /* 09EED4 8009E2D4 8D8C639C */ lw $t4, %lo(D_8012639C)($t4) -/* 09EED8 8009E2D8 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EED8 8009E2D8 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EEDC 8009E2DC 10000024 */ b .L8009E370 -/* 09EEE0 8009E2E0 A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EEE0 8009E2E0 A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) glabel L8009E2E4 /* 09EEE4 8009E2E4 240E0006 */ li $t6, 6 -/* 09EEE8 8009E2E8 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EEE8 8009E2E8 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EEEC 8009E2EC 10000020 */ b .L8009E370 -/* 09EEF0 8009E2F0 A02E64E2 */ sb $t6, %lo(D_801264E2)($at) +/* 09EEF0 8009E2F0 A02E64E2 */ sb $t6, %lo(sCurrentMenuID)($at) glabel L8009E2F4 /* 09EEF4 8009E2F4 3C0B800E */ lui $t3, %hi(D_800E09D8) # $t3, 0x800e /* 09EEF8 8009E2F8 256B09D8 */ addiu $t3, %lo(D_800E09D8) # addiu $t3, $t3, 0x9d8 /* 09EEFC 8009E2FC 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF00 8009E300 AC2B63A4 */ sw $t3, %lo(D_801263A4)($at) -/* 09EF04 8009E304 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF04 8009E304 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF08 8009E308 240D0001 */ li $t5, 1 /* 09EF0C 8009E30C 10000018 */ b .L8009E370 -/* 09EF10 8009E310 A02D64E2 */ sb $t5, %lo(D_801264E2)($at) +/* 09EF10 8009E310 A02D64E2 */ sb $t5, %lo(sCurrentMenuID)($at) glabel L8009E314 /* 09EF14 8009E314 3C0F800E */ lui $t7, %hi(D_800E09C4) # $t7, 0x800e /* 09EF18 8009E318 25EF09C4 */ addiu $t7, %lo(D_800E09C4) # addiu $t7, $t7, 0x9c4 /* 09EF1C 8009E31C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF20 8009E320 AC2F63A4 */ sw $t7, %lo(D_801263A4)($at) -/* 09EF24 8009E324 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF24 8009E324 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF28 8009E328 24180001 */ li $t8, 1 /* 09EF2C 8009E32C 10000010 */ b .L8009E370 -/* 09EF30 8009E330 A03864E2 */ sb $t8, %lo(D_801264E2)($at) +/* 09EF30 8009E330 A03864E2 */ sb $t8, %lo(sCurrentMenuID)($at) glabel L8009E334 /* 09EF34 8009E334 3C19800E */ lui $t9, %hi(D_800E09EC) # $t9, 0x800e /* 09EF38 8009E338 273909EC */ addiu $t9, %lo(D_800E09EC) # addiu $t9, $t9, 0x9ec /* 09EF3C 8009E33C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF40 8009E340 AC3963A4 */ sw $t9, %lo(D_801263A4)($at) -/* 09EF44 8009E344 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF44 8009E344 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF48 8009E348 24090001 */ li $t1, 1 /* 09EF4C 8009E34C 10000008 */ b .L8009E370 -/* 09EF50 8009E350 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09EF50 8009E350 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) .L8009E354: glabel L8009E354 /* 09EF54 8009E354 3C0A800E */ lui $t2, %hi(D_800E09B0) # $t2, 0x800e /* 09EF58 8009E358 254A09B0 */ addiu $t2, %lo(D_800E09B0) # addiu $t2, $t2, 0x9b0 /* 09EF5C 8009E35C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF60 8009E360 AC2A63A4 */ sw $t2, %lo(D_801263A4)($at) -/* 09EF64 8009E364 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF64 8009E364 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF68 8009E368 240C0001 */ li $t4, 1 -/* 09EF6C 8009E36C A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EF6C 8009E36C A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) .L8009E370: -/* 09EF70 8009E370 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EF74 8009E374 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EF70 8009E370 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EF74 8009E374 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EF78 8009E378 00000000 */ nop .L8009E37C: glabel L8009E37C diff --git a/asm/non_matchings/printf/func_800B5F78.s b/asm/non_matchings/printf/func_800B5F78.s index af53680a..de495bae 100644 --- a/asm/non_matchings/printf/func_800B5F78.s +++ b/asm/non_matchings/printf/func_800B5F78.s @@ -6,7 +6,7 @@ glabel func_800B5F78 /* 0B6B88 800B5F88 AFB40030 */ sw $s4, 0x30($sp) /* 0B6B8C 800B5F8C AFB20028 */ sw $s2, 0x28($sp) /* 0B6B90 800B5F90 AFB10024 */ sw $s1, 0x24($sp) -/* 0B6B94 800B5F94 0C01E015 */ jal func_80078054 +/* 0B6B94 800B5F94 0C01E015 */ jal init_rdp_and_framebuffer /* 0B6B98 800B5F98 AFB00020 */ sw $s0, 0x20($sp) /* 0B6B9C 800B5F9C 0C01E948 */ jal get_video_width_and_height_as_s32 /* 0B6BA0 800B5FA0 00000000 */ nop diff --git a/asm/non_matchings/unknown_00BC20/func_8000CC7C.s b/asm/non_matchings/unknown_00BC20/func_8000CC7C.s index 625315a7..be199e1e 100644 --- a/asm/non_matchings/unknown_00BC20/func_8000CC7C.s +++ b/asm/non_matchings/unknown_00BC20/func_8000CC7C.s @@ -79,7 +79,7 @@ glabel func_8000CC7C /* 00D974 8000CD74 AFB90130 */ sw $t9, 0x130($sp) /* 00D978 8000CD78 A04D003B */ sb $t5, 0x3b($v0) .L8000CD7C: -/* 00D97C 8000CD7C 0C01B683 */ jal func_8006DA0C +/* 00D97C 8000CD7C 0C01B683 */ jal get_render_context /* 00D980 8000CD80 00000000 */ nop /* 00D984 8000CD84 0C01BAA4 */ jal get_settings /* 00D988 8000CD88 AFA20138 */ sw $v0, 0x138($sp) @@ -967,7 +967,7 @@ glabel L8000D98C /* 00E5D4 8000D9D4 3C018012 */ lui $at, %hi(D_8011AD20) # $at, 0x8012 /* 00E5D8 8000D9D8 A020AD20 */ sb $zero, %lo(D_8011AD20)($at) .L8000D9DC: -/* 00E5DC 8000D9DC 0C01B683 */ jal func_8006DA0C +/* 00E5DC 8000D9DC 0C01B683 */ jal get_render_context /* 00E5E0 8000D9E0 00000000 */ nop /* 00E5E4 8000D9E4 1440002D */ bnez $v0, .L8000DA9C /* 00E5E8 8000D9E8 3C028012 */ lui $v0, %hi(objCount) # $v0, 0x8012 diff --git a/asm/non_matchings/unknown_00BC20/func_80019808.s b/asm/non_matchings/unknown_00BC20/func_80019808.s index 47cdfc93..348f5f9b 100644 --- a/asm/non_matchings/unknown_00BC20/func_80019808.s +++ b/asm/non_matchings/unknown_00BC20/func_80019808.s @@ -604,7 +604,7 @@ glabel func_80019808 /* 01ACA0 8001A0A0 00000000 */ nop /* 01ACA4 8001A0A4 AFBF0064 */ sw $ra, 0x64($sp) /* 01ACA8 8001A0A8 AFA80080 */ sw $t0, 0x80($sp) -/* 01ACAC 8001A0AC 0C01B683 */ jal func_8006DA0C +/* 01ACAC 8001A0AC 0C01B683 */ jal get_render_context /* 01ACB0 8001A0B0 AFAA0044 */ sw $t2, 0x44($sp) /* 01ACB4 8001A0B4 8FA80080 */ lw $t0, 0x80($sp) /* 01ACB8 8001A0B8 8FAA0044 */ lw $t2, 0x44($sp) diff --git a/asm/non_matchings/unknown_043920/func_8004DE38.s b/asm/non_matchings/unknown_043920/func_8004DE38.s index 8c2fc46f..93859daf 100644 --- a/asm/non_matchings/unknown_043920/func_8004DE38.s +++ b/asm/non_matchings/unknown_043920/func_8004DE38.s @@ -260,7 +260,7 @@ glabel func_8004DE38 /* 04ED84 8004E184 3C018012 */ lui $at, %hi(D_8011D586) # $at, 0x8012 /* 04ED88 8004E188 A420D586 */ sh $zero, %lo(D_8011D586)($at) .L8004E18C: -/* 04ED8C 8004E18C 0C01B683 */ jal func_8006DA0C +/* 04ED8C 8004E18C 0C01B683 */ jal get_render_context /* 04ED90 8004E190 00000000 */ nop /* 04ED94 8004E194 3C0D8012 */ lui $t5, %hi(D_8011D540) # $t5, 0x8012 /* 04ED98 8004E198 8DADD540 */ lw $t5, %lo(D_8011D540)($t5) diff --git a/asm/non_matchings/unknown_043920/func_8005A6F0.s b/asm/non_matchings/unknown_043920/func_8005A6F0.s index 56d9ce5f..79bc0ac7 100644 --- a/asm/non_matchings/unknown_043920/func_8005A6F0.s +++ b/asm/non_matchings/unknown_043920/func_8005A6F0.s @@ -37,7 +37,7 @@ glabel func_8005A6F0 /* 05B308 8005A708 AFA400A0 */ sw $a0, 0xa0($sp) /* 05B30C 8005A70C AFA600A8 */ sw $a2, 0xa8($sp) /* 05B310 8005A710 AFA700AC */ sw $a3, 0xac($sp) -/* 05B314 8005A714 0C01B683 */ jal func_8006DA0C +/* 05B314 8005A714 0C01B683 */ jal get_render_context /* 05B318 8005A718 AC2ED55C */ sw $t6, %lo(D_8011D55C)($at) /* 05B31C 8005A71C 0C01AF6C */ jal get_current_level_header /* 05B320 8005A720 AFA20094 */ sw $v0, 0x94($sp) diff --git a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s index 1ec9a99d..2771c662 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s @@ -75,10 +75,10 @@ glabel func_8006CCF0 /* 06D9E0 8006CDE0 14400018 */ bnez $v0, .L8006CE44 /* 06D9E4 8006CDE4 3C19800E */ lui $t9, %hi(D_800DD390) # $t9, 0x800e /* 06D9E8 8006CDE8 8339D390 */ lb $t9, %lo(D_800DD390)($t9) -/* 06D9EC 8006CDEC 3C098012 */ lui $t1, %hi(D_801234EC) # $t1, 0x8012 +/* 06D9EC 8006CDEC 3C098012 */ lui $t1, %hi(sRenderContext) # $t1, 0x8012 /* 06D9F0 8006CDF0 17200014 */ bnez $t9, .L8006CE44 /* 06D9F4 8006CDF4 00000000 */ nop -/* 06D9F8 8006CDF8 8D2934EC */ lw $t1, %lo(D_801234EC)($t1) +/* 06D9F8 8006CDF8 8D2934EC */ lw $t1, %lo(sRenderContext)($t1) /* 06D9FC 8006CDFC 3C0A8012 */ lui $t2, %hi(D_80123516) # $t2, 0x8012 /* 06DA00 8006CE00 15200010 */ bnez $t1, .L8006CE44 /* 06DA04 8006CE04 00000000 */ nop @@ -144,8 +144,8 @@ glabel func_8006CCF0 /* 06DAE0 8006CEE0 248411F8 */ addiu $a0, %lo(gCurrDisplayList) # addiu $a0, $a0, 0x11f8 /* 06DAE4 8006CEE4 0C009355 */ jal func_80024D54 /* 06DAE8 8006CEE8 AFB90010 */ sw $t9, 0x10($sp) -/* 06DAEC 8006CEEC 3C098012 */ lui $t1, %hi(D_801234EC) # $t1, 0x8012 -/* 06DAF0 8006CEF0 8D2934EC */ lw $t1, %lo(D_801234EC)($t1) +/* 06DAEC 8006CEEC 3C098012 */ lui $t1, %hi(sRenderContext) # $t1, 0x8012 +/* 06DAF0 8006CEF0 8D2934EC */ lw $t1, %lo(sRenderContext)($t1) /* 06DAF4 8006CEF4 2401DFCF */ li $at, -8241 /* 06DAF8 8006CEF8 15200003 */ bnez $t1, .L8006CF08 /* 06DAFC 8006CEFC 3C0B8012 */ lui $t3, %hi(D_80123516) # $t3, 0x8012 @@ -354,7 +354,7 @@ glabel L8006D19C .L8006D1C0: glabel L8006D1C0 /* 06DDC0 8006D1C0 3C048012 */ lui $a0, %hi(gCurrDisplayList) # $a0, 0x8012 -/* 06DDC4 8006D1C4 0C01E015 */ jal func_80078054 +/* 06DDC4 8006D1C4 0C01E015 */ jal init_rdp_and_framebuffer /* 06DDC8 8006D1C8 248411F8 */ addiu $a0, %lo(gCurrDisplayList) # addiu $a0, $a0, 0x11f8 /* 06DDCC 8006D1CC 3C048012 */ lui $a0, %hi(gCurrDisplayList) # $a0, 0x8012 /* 06DDD0 8006D1D0 0C01DC14 */ jal render_borders_for_multiplayer @@ -608,8 +608,8 @@ glabel L8006D1C0 /* 06E160 8006D560 320C0020 */ andi $t4, $s0, 0x20 .L8006D564: /* 06E164 8006D564 11800004 */ beqz $t4, .L8006D578 -/* 06E168 8006D568 3C0D8012 */ lui $t5, %hi(D_801234EC) # $t5, 0x8012 -/* 06E16C 8006D56C 8DAD34EC */ lw $t5, %lo(D_801234EC)($t5) +/* 06E168 8006D568 3C0D8012 */ lui $t5, %hi(sRenderContext) # $t5, 0x8012 +/* 06E16C 8006D56C 8DAD34EC */ lw $t5, %lo(sRenderContext)($t5) /* 06E170 8006D570 00000000 */ nop /* 06E174 8006D574 11A00004 */ beqz $t5, .L8006D588 .L8006D578: diff --git a/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s b/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s index cd37fc27..e6d1c8a0 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s @@ -53,8 +53,8 @@ glabel func_8006DCF8 /* 06E9A4 8006DDA4 00000000 */ nop /* 06E9A8 8006DDA8 0C01B6F9 */ jal func_8006DBE4 /* 06E9AC 8006DDAC 00000000 */ nop -/* 06E9B0 8006DDB0 3C0D8012 */ lui $t5, %hi(D_801234E8) # $t5, 0x8012 -/* 06E9B4 8006DDB4 8DAD34E8 */ lw $t5, %lo(D_801234E8)($t5) +/* 06E9B0 8006DDB0 3C0D8012 */ lui $t5, %hi(gSPTaskNum) # $t5, 0x8012 +/* 06E9B4 8006DDB4 8DAD34E8 */ lw $t5, %lo(gSPTaskNum)($t5) /* 06E9B8 8006DDB8 3C0F8012 */ lui $t7, %hi(gDisplayLists) # $t7, 0x8012 /* 06E9BC 8006DDBC 000D7080 */ sll $t6, $t5, 2 /* 06E9C0 8006DDC0 01EE7821 */ addu $t7, $t7, $t6 @@ -87,8 +87,8 @@ glabel func_8006DCF8 /* 06EA2C 8006DE2C AD420000 */ sw $v0, ($t2) /* 06EA30 8006DE30 AD200000 */ sw $zero, ($t1) /* 06EA34 8006DE34 AD780000 */ sw $t8, ($t3) -/* 06EA38 8006DE38 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EA3C 8006DE3C AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EA38 8006DE38 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EA3C 8006DE3C AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EA40 8006DE40 3C018012 */ lui $at, %hi(gIsPaused) # $at, 0x8012 /* 06EA44 8006DE44 A0203515 */ sb $zero, %lo(gIsPaused)($at) /* 06EA48 8006DE48 3C018012 */ lui $at, %hi(D_80123516) # $at, 0x8012 @@ -150,8 +150,8 @@ glabel L8006DF00 /* 06EB1C 8006DF1C AD000000 */ sw $zero, ($t0) /* 06EB20 8006DF20 AD200000 */ sw $zero, ($t1) /* 06EB24 8006DF24 AD6F0000 */ sw $t7, ($t3) -/* 06EB28 8006DF28 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EB2C 8006DF2C AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EB28 8006DF28 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EB2C 8006DF2C AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EB30 8006DF30 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 /* 06EB34 8006DF34 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 /* 06EB38 8006DF38 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 @@ -181,9 +181,9 @@ glabel L8006DF70 /* 06EB94 8006DF94 24190064 */ li $t9, 100 /* 06EB98 8006DF98 AD200000 */ sw $zero, ($t1) /* 06EB9C 8006DF9C AD790000 */ sw $t9, ($t3) -/* 06EBA0 8006DFA0 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EBA0 8006DFA0 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EBA4 8006DFA4 AD180000 */ sw $t8, ($t0) -/* 06EBA8 8006DFA8 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EBA8 8006DFA8 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EBAC 8006DFAC 80A2000F */ lb $v0, 0xf($a1) /* 06EBB0 8006DFB0 80A30001 */ lb $v1, 1($a1) /* 06EBB4 8006DFB4 04400002 */ bltz $v0, .L8006DFC0 @@ -211,8 +211,8 @@ glabel L8006DF70 /* 06EC04 8006E004 100000B5 */ b .L8006E2DC /* 06EC08 8006E008 8FBF0024 */ lw $ra, 0x24($sp) glabel L8006E00C -/* 06EC0C 8006E00C 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EC10 8006E010 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EC0C 8006E00C 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EC10 8006E010 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EC14 8006E014 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 /* 06EC18 8006E018 3C088012 */ lui $t0, %hi(D_801234F4) # $t0, 0x8012 /* 06EC1C 8006E01C 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 @@ -231,9 +231,9 @@ glabel L8006E00C /* 06EC50 8006E050 8FBF0024 */ lw $ra, 0x24($sp) glabel L8006E054 /* 06EC54 8006E054 3C058012 */ lui $a1, %hi(D_80121250) # $a1, 0x8012 -/* 06EC58 8006E058 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EC58 8006E058 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EC5C 8006E05C 24A51250 */ addiu $a1, %lo(D_80121250) # addiu $a1, $a1, 0x1250 -/* 06EC60 8006E060 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EC60 8006E060 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EC64 8006E064 80AF0001 */ lb $t7, 1($a1) /* 06EC68 8006E068 80A40000 */ lb $a0, ($a1) /* 06EC6C 8006E06C 00AFC021 */ addu $t8, $a1, $t7 @@ -282,8 +282,8 @@ glabel L8006E0E0 /* 06ED08 8006E108 00000000 */ nop /* 06ED0C 8006E10C 0C01B6F9 */ jal func_8006DBE4 /* 06ED10 8006E110 00000000 */ nop -/* 06ED14 8006E114 3C0D8012 */ lui $t5, %hi(D_801234E8) # $t5, 0x8012 -/* 06ED18 8006E118 8DAD34E8 */ lw $t5, %lo(D_801234E8)($t5) +/* 06ED14 8006E114 3C0D8012 */ lui $t5, %hi(gSPTaskNum) # $t5, 0x8012 +/* 06ED18 8006E118 8DAD34E8 */ lw $t5, %lo(gSPTaskNum)($t5) /* 06ED1C 8006E11C 3C0F8012 */ lui $t7, %hi(gDisplayLists) # $t7, 0x8012 /* 06ED20 8006E120 000D7080 */ sll $t6, $t5, 2 /* 06ED24 8006E124 01EE7821 */ addu $t7, $t7, $t6 @@ -314,10 +314,10 @@ glabel L8006E0E0 /* 06ED88 8006E188 80790004 */ lb $t9, 4($v1) /* 06ED8C 8006E18C 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 /* 06ED90 8006E190 25293504 */ addiu $t1, %lo(D_80123504) # addiu $t1, $t1, 0x3504 -/* 06ED94 8006E194 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06ED94 8006E194 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06ED98 8006E198 AD180000 */ sw $t8, ($t0) /* 06ED9C 8006E19C AD390000 */ sw $t9, ($t1) -/* 06EDA0 8006E1A0 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EDA0 8006E1A0 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EDA4 8006E1A4 806C000C */ lb $t4, 0xc($v1) /* 06EDA8 8006E1A8 3C0B8012 */ lui $t3, %hi(D_80123508) # $t3, 0x8012 /* 06EDAC 8006E1AC 256B3508 */ addiu $t3, %lo(D_80123508) # addiu $t3, $t3, 0x3508 @@ -353,8 +353,8 @@ glabel L8006E0E0 /* 06EE20 8006E220 8FBF0024 */ lw $ra, 0x24($sp) /* 06EE24 8006E224 0C01B6F9 */ jal func_8006DBE4 /* 06EE28 8006E228 00000000 */ nop -/* 06EE2C 8006E22C 3C198012 */ lui $t9, %hi(D_801234E8) # $t9, 0x8012 -/* 06EE30 8006E230 8F3934E8 */ lw $t9, %lo(D_801234E8)($t9) +/* 06EE2C 8006E22C 3C198012 */ lui $t9, %hi(gSPTaskNum) # $t9, 0x8012 +/* 06EE30 8006E230 8F3934E8 */ lw $t9, %lo(gSPTaskNum)($t9) /* 06EE34 8006E234 3C0D8012 */ lui $t5, %hi(gDisplayLists) # $t5, 0x8012 /* 06EE38 8006E238 00196080 */ sll $t4, $t9, 2 /* 06EE3C 8006E23C 01AC6821 */ addu $t5, $t5, $t4 @@ -372,9 +372,9 @@ glabel L8006E0E0 /* 06EE6C 8006E26C AC400004 */ sw $zero, 4($v0) /* 06EE70 8006E270 AC590000 */ sw $t9, ($v0) /* 06EE74 8006E274 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 -/* 06EE78 8006E278 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EE78 8006E278 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EE7C 8006E27C 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 -/* 06EE80 8006E280 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EE80 8006E280 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EE84 8006E284 8D460000 */ lw $a2, ($t2) /* 06EE88 8006E288 8FA4002C */ lw $a0, 0x2c($sp) /* 06EE8C 8006E28C 0C01B2B9 */ jal func_8006CAE4 diff --git a/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s b/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s index ff75ab6a..21abd3e0 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s @@ -137,8 +137,8 @@ glabel func_8006ECFC /* 06FB08 8006EF08 0C01C42C */ jal set_free_queue_state /* 06FB0C 8006EF0C AC2E3534 */ sw $t6, %lo(gCurrNumHudVertsPerPlayer)($at) .L8006EF10: -/* 06FB10 8006EF10 3C038012 */ lui $v1, %hi(D_801234E8) # $v1, 0x8012 -/* 06FB14 8006EF14 8C6334E8 */ lw $v1, %lo(D_801234E8)($v1) +/* 06FB10 8006EF10 3C038012 */ lui $v1, %hi(gSPTaskNum) # $v1, 0x8012 +/* 06FB14 8006EF14 8C6334E8 */ lw $v1, %lo(gSPTaskNum)($v1) /* 06FB18 8006EF18 3C118012 */ lui $s1, %hi(gDisplayLists) # $s1, 0x8012 /* 06FB1C 8006EF1C 263111F0 */ addiu $s1, %lo(gDisplayLists) # addiu $s1, $s1, 0x11f0 /* 06FB20 8006EF20 00037880 */ sll $t7, $v1, 2 diff --git a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s index 6502e3a2..b7da7ea3 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s @@ -45,7 +45,7 @@ glabel func_800A01A0 /* 0A0E40 800A0240 314B0002 */ andi $t3, $t2, 2 /* 0A0E44 800A0244 15600248 */ bnez $t3, .L800A0B68 /* 0A0E48 800A0248 8FBF0024 */ lw $ra, 0x24($sp) -/* 0A0E4C 800A024C 0C01B683 */ jal func_8006DA0C +/* 0A0E4C 800A024C 0C01B683 */ jal get_render_context /* 0A0E50 800A0250 00000000 */ nop /* 0A0E54 800A0254 24030001 */ li $v1, 1 /* 0A0E58 800A0258 10430242 */ beq $v0, $v1, .L800A0B64 @@ -323,10 +323,10 @@ glabel func_800A01A0 /* 0A1258 800A0658 244E0008 */ addiu $t6, $v0, 8 /* 0A125C 800A065C AC8E0000 */ sw $t6, ($a0) /* 0A1260 800A0660 AC400004 */ sw $zero, 4($v0) -/* 0A1264 800A0664 0C01E037 */ jal func_800780DC +/* 0A1264 800A0664 0C01E037 */ jal init_rsp /* 0A1268 800A0668 AC580000 */ sw $t8, ($v0) /* 0A126C 800A066C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 -/* 0A1270 800A0670 0C01E015 */ jal func_80078054 +/* 0A1270 800A0670 0C01E015 */ jal init_rdp_and_framebuffer /* 0A1274 800A0674 24846CFC */ addiu $a0, %lo(D_80126CFC) # addiu $a0, $a0, 0x6cfc /* 0A1278 800A0678 0C01EB8A */ jal func_8007AE28 /* 0A127C 800A067C 2404FFFF */ li $a0, -1 diff --git a/asm/non_matchings/unknown_09F8F0/func_800A22F4.s b/asm/non_matchings/unknown_09F8F0/func_800A22F4.s index ae5eba3d..3ceca655 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A22F4.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A22F4.s @@ -40,7 +40,7 @@ glabel func_800A22F4 /* 0A2F88 800A2388 3C018012 */ lui $at, %hi(D_80126CD5) # $at, 0x8012 /* 0A2F8C 800A238C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 /* 0A2F90 800A2390 A0206CD5 */ sb $zero, %lo(D_80126CD5)($at) -/* 0A2F94 800A2394 0C01E015 */ jal func_80078054 +/* 0A2F94 800A2394 0C01E015 */ jal init_rdp_and_framebuffer /* 0A2F98 800A2398 24846CFC */ addiu $a0, %lo(D_80126CFC) # addiu $a0, $a0, 0x6cfc /* 0A2F9C 800A239C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 /* 0A2FA0 800A23A0 0C01ECF4 */ jal func_8007B3D0 diff --git a/src/audio.c b/src/audio.c index cd909467..8d1a2793 100644 --- a/src/audio.c +++ b/src/audio.c @@ -281,12 +281,12 @@ void func_80000CBC(void) { set_relative_volume_for_music(musicRelativeVolume); } -void func_80000D00(u8 arg0) { +void func_80000D00(u8 mulFactor) { s32 reg_s2; s32 j; if (D_80115D3C > 0) { - D_80115D38 += arg0; + D_80115D38 += mulFactor; D_800DC650 = ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 > 1.0f) { @@ -297,7 +297,7 @@ void func_80000D00(u8 arg0) { set_relative_volume_for_music(musicRelativeVolume); } else if (D_80115D3C < 0) { - D_80115D38 -= arg0; + D_80115D38 -= mulFactor; D_800DC650 = 1.0f - ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 < 0) { D_80115D38 = 0; @@ -308,9 +308,9 @@ void func_80000D00(u8 arg0) { } if (D_800DC658 > 0) { - //reg_arg0 = arg0; + //reg_arg0 = mulFactor; for (reg_s2 = 0; reg_s2 < D_800DC658;) { - D_80115D48[reg_s2].unk2 -= arg0; + D_80115D48[reg_s2].unk2 -= mulFactor; if (D_80115D48[reg_s2].unk2 <= 0) { j = reg_s2; func_80001D04(D_80115D48[reg_s2].unk0, D_80115D48[reg_s2].unk4); diff --git a/src/controller_pak.c b/src/controller_pak.c index b74fb724..246b8ca7 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -201,7 +201,7 @@ s32 func_8007497C(u64 *arg0) { *arg0 <<= 8; *arg0 >>= 8; *arg0 |= (s64)((s32)func_8007480C(*arg0)) << 56; - if (func_8006EAC0() == 0) { + if (check_reset_pressed() == 0) { osEepromWrite(func_8006A100(), 0xF, (u8 *)arg0); } return 1; diff --git a/src/fade_transition.c b/src/fade_transition.c index 3c37406f..9c73ed56 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -288,12 +288,12 @@ s32 func_800C01D8(FadeTransition *transition) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C01D8.s") #endif -s32 func_800C0494(s32 arg0) { +s32 func_800C0494(s32 mulFactor) { if (D_800E31A4 != 0) { D_800E31A4 = D_800E31A4 - 1; - arg0 = 0; - } else if (arg0 >= 6) { - arg0 = 5; + mulFactor = 0; + } else if (mulFactor >= 6) { + mulFactor = 5; } if (D_800E31AC != 0) { @@ -308,19 +308,19 @@ s32 func_800C0494(s32 arg0) { } switch (gCurFaceTransition) { case FADE_FULLSCREEN: - func_800C0834(arg0); + func_800C0834(mulFactor); break; case FADE_BARNDOOR_HORIZONTAL: case FADE_BARNDOOR_VERTICAL: case FADE_WAVES: case FADE_BARNDOOR_DIAGONAL: - func_800C1130(arg0); + func_800C1130(mulFactor); break; case FADE_CIRCLE: - func_800C1EE8(arg0); + func_800C1EE8(mulFactor); break; case FADE_DISABLED: - func_800C27A0(arg0); + func_800C27A0(mulFactor); break; } } diff --git a/src/menu.c b/src/menu.c index 66c16a29..527bd541 100644 --- a/src/menu.c +++ b/src/menu.c @@ -93,21 +93,21 @@ unk801264A0 D_801264A0[4]; s32 D_801264D0; s32 D_801264D4; -s8 D_801264D8; +s8 sDialogueOption; s32 D_801264DC; s8 D_801264E0; s8 D_801264E1; -s8 D_801264E2; +s8 sCurrentMenuID; -s8 D_801264E2; +s8 sCurrentMenuID; s32 D_801264E4; s32 D_801264E8; s32 D_801264EC; s32 D_801264F0[2]; s32 D_801264F8[2]; s32 D_80126500; -s8 D_80126504; +s8 sDialogueOptionMax; s32 D_80126508; s16 D_8012650C; s8 D_8012650E; @@ -2140,10 +2140,10 @@ void func_800828B8(void) { } } -void func_800829F8(s32 arg0, s32 arg1) { +void func_800829F8(Gfx *dl, s32 mulFactor) { s32 temp; - D_800DF46C += arg1; + D_800DF46C += mulFactor; if (D_800DF46C & 0x10) { load_menu_text(get_language()); @@ -2154,7 +2154,7 @@ void func_800829F8(s32 arg0, s32 arg1) { if (osTvType == TV_TYPE_PAL) { temp = 0xEA; } - draw_text(arg0, -0x8000, temp, gMenuText[151], 0xC); + draw_text(dl, -0x8000, temp, gMenuText[151], 0xC); } } @@ -5935,8 +5935,8 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8009CD7C.s") void func_8009CF68(s32 arg0) { if (D_800DF4E4[arg0] == 0) { if (arg0 != 3) { - D_801264E2 = 0; - D_801264D8 = 0; + sCurrentMenuID = 0; + sDialogueOption = 0; } D_800DF4E0 = 1; D_800DF4E4[arg0] = 1; @@ -5971,19 +5971,19 @@ s32 func_8009CFEC(u32 arg0) { func_800C4FBC(1, 0, 0, 0, 0x80); func_8001F450(); switch (arg0) { - case 0: + case DIALOG_TAJ: result = taj_menu_loop(); // Taj menu break; - case 2: + case DIALOG_TT: result = tt_menu_loop(); // T.T. menu break; - case 3: + case DIALOG_CHALLENGE: result = func_800C3564(); // Taj challenge completed/failed menu break; - case 4: + case DIALOG_TROPHY: result = trophy_race_cabinet_menu_loop(); // Trophy race cabinet menu break; - case 5: + case DIALOG_RACERESULT: result = func_8009D9F4(); break; } @@ -6003,30 +6003,30 @@ void func_8009D118(s32 arg0) { } void func_8009D1B8(s32 arg0, s32 arg1, s32 arg2) { - func_8009D118(D_801264D8 == D_80126504); - if (D_801264D8 == D_80126504) { + func_8009D118(sDialogueOption == sDialogueOptionMax); + if (sDialogueOption == sDialogueOptionMax) { D_80126516 = arg2; } func_800C5168(1, -0x8000, D_8012650E, arg0, 1, 4); D_8012650E = (s8)(D_8012650E + arg1); - D_80126504 = (s8)(D_80126504 + 1); + sDialogueOptionMax = (s8)(sDialogueOptionMax + 1); } void func_8009D26C(void) { if (gControllersYAxisDirection[0] < 0) { - D_801264D8 = D_801264D8 + 1; + sDialogueOption = sDialogueOption + 1; func_80001D04(0xB2, NULL); } else if (gControllersYAxisDirection[0] > 0) { - D_801264D8 = D_801264D8 - 1; + sDialogueOption = sDialogueOption - 1; func_80001D04(0xB2, NULL); } - if (D_801264D8 < 0) { - D_801264D8 = D_80126504 - 1; + if (sDialogueOption < 0) { + sDialogueOption = sDialogueOptionMax - 1; } - if (D_801264D8 >= D_80126504) { - D_801264D8 = 0; + if (sDialogueOption >= sDialogueOptionMax) { + sDialogueOption = 0; } } @@ -6039,8 +6039,8 @@ void func_8009D330(s32 arg0) { } void func_8009D33C(s32 arg0, s32 arg1) { - if (D_801264E2 == arg0) { - D_801264E2 = arg1; + if (sCurrentMenuID == arg0) { + sCurrentMenuID = arg1; } } @@ -6050,21 +6050,21 @@ s32 taj_menu_loop(void) { Settings *settings; // sp24 settings = get_settings(); - if ((D_800DF4DC != 0) && (D_801264E2 == 0)) { - D_801264E2 = -D_800DF4DC; + if ((D_800DF4DC != 0) && (sCurrentMenuID == 0)) { + sCurrentMenuID = -D_800DF4DC; } - if (D_801264E2 == 0) { - D_801264E2 = 1; + if (sCurrentMenuID == 0) { + sCurrentMenuID = 1; } - if ((D_801264E2 > 0) && (D_801264E2 < 4)) { + if ((sCurrentMenuID > 0) && (sCurrentMenuID < 4)) { func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x7C); func_800C4F7C(1, 0); } sp2C = 0; buttonsPressed = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; - switch (D_801264E2) { + switch (sCurrentMenuID) { case 2: case 0x62: func_800C5168(1, -0x8000, 6, gMenuText[40], 1, 4); // VEHICLE SELECT @@ -6094,10 +6094,10 @@ s32 taj_menu_loop(void) { break; } - switch (D_801264E2) { + switch (sCurrentMenuID) { case 0: func_800C31EC(7); - D_801264E2 = 1; + sCurrentMenuID = 1; D_800DF4D8 = 1; break; case 1: @@ -6117,16 +6117,16 @@ s32 taj_menu_loop(void) { func_80001D04(0xEF, 0); switch (D_80126516) { case 1: - D_801264E2 = 3; - D_801264D8 = 0; + sCurrentMenuID = 3; + sDialogueOption = 0; func_8003AC3C(0x239, 1); break; case 2: sp2C = 3; break; case 0: - D_801264E2 = 2; - D_801264D8 = 0; + sCurrentMenuID = 2; + sDialogueOption = 0; func_8003AC3C(0x234, 1); break; } @@ -6137,15 +6137,15 @@ s32 taj_menu_loop(void) { if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); func_8003AC3C(0x238, 1); - D_801264E2 = 1; - D_801264D8 = 0; + sCurrentMenuID = 1; + sDialogueOption = 0; } else if (buttonsPressed & A_BUTTON) { if (D_80126516 != 3) { sp2C = D_80126516 | 0x80; - D_801264E2 = 0x62; + sCurrentMenuID = 0x62; } else { - D_801264E2 = 1; - D_801264D8 = 0; + sCurrentMenuID = 1; + sDialogueOption = 0; func_8003AC3C(0x238, 1); } } @@ -6155,42 +6155,42 @@ s32 taj_menu_loop(void) { if ((buttonsPressed & B_BUTTON) || ((buttonsPressed & A_BUTTON) && (D_80126516 == 3))) { func_80001D04(0x241, 0); func_8003AC3C(0x23A, 1); - D_801264E2 = 1; - D_801264D8 = 3; + sCurrentMenuID = 1; + sDialogueOption = 3; } else if (buttonsPressed & A_BUTTON) { sp2C = D_80126516 | 0x40; func_80001D04(0xEF, 0); - D_801264E2 = 0x63; + sCurrentMenuID = 0x63; } break; case -3: case -2: case -1: - func_800C31EC(8 - D_801264E2); - D_801264E2 = 4; + func_800C31EC(8 - sCurrentMenuID); + sCurrentMenuID = 4; break; case -4: func_800C31EC(0x11); D_800DF4DC = 0; - D_801264E2 = 1; - D_801264D8 = 3; + sCurrentMenuID = 1; + sDialogueOption = 3; break; case -5: func_800C31EC(0x15); D_800DF4DC = 0; - D_801264E2 = 7; - D_801264D8 = 0; + sCurrentMenuID = 7; + sDialogueOption = 0; break; case -8: case -7: case -6: - func_800C31EC(0xC - D_801264E2); - D_801264E2 = 6; - D_801264D8 = 0; + func_800C31EC(0xC - sCurrentMenuID); + sCurrentMenuID = 6; + sDialogueOption = 0; break; case 4: sp2C = (D_800DF4DC - 1) | 0x40; - D_801264E2 = 5; + sCurrentMenuID = 5; func_800C5620(1); break; case 5: @@ -6200,13 +6200,13 @@ s32 taj_menu_loop(void) { case 6: case 7: sp2C = 4; - if (D_801264E2 == 7) { + if (sCurrentMenuID == 7) { sp2C = 3; } D_800DF4E0 = 0; func_800C5620(1); D_800DF4DC = 0; - D_801264E2 = 0; + sCurrentMenuID = 0; break; } return sp2C; @@ -6220,7 +6220,7 @@ s32 func_8009D9F4(void) { func_800C4F7C(1, 0); state = 0; playerInput = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; D_800DF4DC = 0; func_800C5168(1, -0x8000, 6, gMenuText[49], 1, 4); // BETTER LUCK func_800C5168(1, -0x8000, 0x14, gMenuText[50], 1, 4); // NEXT TIME! @@ -6247,7 +6247,7 @@ s32 func_8009D9F4(void) { // Has a couple minor issues, but should be functionally equivalent. s32 tt_menu_loop(void) { Settings *settings; - s32 sp44; + s32 currentOption; s32 buttonsPressed; // sp40 s32 sp3C; s32 sp38; @@ -6261,23 +6261,23 @@ s32 tt_menu_loop(void) { settings->cutsceneFlags |= 2; } if (!(settings->cutsceneFlags & 2)) { - D_801264E2 = TT_MENU_INTRODUCTION; + sCurrentMenuID = TT_MENU_INTRODUCTION; } - if ((D_801264E2 != TT_MENU_GAME_STATUS) && (D_801264E2 != TT_MENU_INTRODUCTION)) { - sp44 = 0x78; + if ((sCurrentMenuID != TT_MENU_GAME_STATUS) && (sCurrentMenuID != TT_MENU_INTRODUCTION)) { + currentOption = 0x78; if (func_8001B780() != 0) { - sp44 = 0x88; + currentOption = 0x88; } - func_800C4EDC(1, 0x18, 0x10, 0xC0, sp44); + func_800C4EDC(1, 0x18, 0x10, 0xC0, currentOption); } else { func_800C4EDC(1, 0x18, 0x10, 0xB8, 0xDC); } func_800C4F7C(1, 0); - sp44 = 0; + currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; D_8012650E = 0x20; - switch (D_801264E2) { + switch (sCurrentMenuID) { case TT_MENU_ROOT: case TT_MENU_EXIT: func_800C5168(1, -0x8000, 6, gMenuText[36], 1, 4); // OPTIONS @@ -6307,13 +6307,13 @@ s32 tt_menu_loop(void) { set_time_trial_enabled(FALSE); } } - if ((buttonsPressed & A_BUTTON) && (D_801264E2 != TT_MENU_EXIT)) { + if ((buttonsPressed & A_BUTTON) && (sCurrentMenuID != TT_MENU_EXIT)) { switch (D_80126516) { case 1: func_80001D04(0xEF, 0); D_80126398 = 0; D_8012639C = TT_MENU_ROOT; - D_801264E2 = TT_MENU_SAVE_GHOST; + sCurrentMenuID = TT_MENU_SAVE_GHOST; break; case 3: func_80001D04(0xEF, 0); @@ -6321,22 +6321,22 @@ s32 tt_menu_loop(void) { func_8009C674(&D_800E1E2C); func_8009C8A4(&D_800E1E40); D_800E1E28 = 1; - D_801264E2 = TT_MENU_GAME_STATUS; + sCurrentMenuID = TT_MENU_GAME_STATUS; break; } - sp44 = D_80126516 + 1; + currentOption = D_80126516 + 1; } else if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); - sp44 = 3; + currentOption = 3; } - if (D_801264E2 == TT_MENU_GAME_STATUS) { - sp44 = 0; + if (sCurrentMenuID == TT_MENU_GAME_STATUS) { + currentOption = 0; } - if (sp44 == 3) { - D_801264E2 = TT_MENU_EXIT; + if (currentOption == 3) { + sCurrentMenuID = TT_MENU_EXIT; } - if (D_801264E2 == TT_MENU_EXIT) { - sp44 = 3; + if (sCurrentMenuID == TT_MENU_EXIT) { + currentOption = 3; } break; case TT_MENU_CONT_PAK_ERROR_1: @@ -6356,12 +6356,12 @@ s32 tt_menu_loop(void) { } } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_GAME_STATUS: if (buttonsPressed & (A_BUTTON | B_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; D_800E1E28 = 0; func_8009C4A8(&D_800E1E2C); func_80036BCC(0x22F, 1); @@ -6375,7 +6375,7 @@ s32 tt_menu_loop(void) { } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { settings->cutsceneFlags |= 2; - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_INSERT_CONT_PAK: @@ -6386,10 +6386,10 @@ s32 tt_menu_loop(void) { func_80001D04(0xEF, 0); D_80126398 = 0; D_8012639C = TT_MENU_INSERT_RUMBLE_PAK; - D_801264E2 = TT_MENU_SAVE_GHOST; + sCurrentMenuID = TT_MENU_SAVE_GHOST; } else if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_INSERT_RUMBLE_PAK: @@ -6397,7 +6397,7 @@ s32 tt_menu_loop(void) { func_800C5168(1, -0x8000, 0x32, gMenuText[161], 1, 4); // the Rumble Pak func_800C5168(1, -0x8000, 0x42, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_SAVE_GHOST: @@ -6410,41 +6410,42 @@ s32 tt_menu_loop(void) { } switch (result) { case 0: - D_801264E2 = D_8012639C; + sCurrentMenuID = D_8012639C; break; case 7: - D_801264E2 = TT_MENU_INSERT_CONT_PAK; + sCurrentMenuID = TT_MENU_INSERT_CONT_PAK; break; case 1: D_801263A4 = &D_800E09D8; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 4: case 6: D_801263A4 = &D_800E09C4; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 9: D_801263A4 = &D_800E09EC; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 2: case 3: case 5: case 8: D_801263A4 = &D_800E09B0; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; } } break; } - if ((D_801264E2 == TT_MENU_CONT_PAK_ERROR_1) || - (D_801264E2 == TT_MENU_CONT_PAK_ERROR_2) || - (D_801264E2 == TT_MENU_CONT_PAK_ERROR_3)) { + if ((sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_1) || + (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_2) || + (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_3)) { func_800C5168(1, -0x8000, 6, gMenuText[64], 1, 4); // PAK ERROR } - return sp44; + + return currentOption; } #else GLOBAL_ASM("asm/non_matchings/menu/tt_menu_loop.s") @@ -6453,36 +6454,36 @@ GLOBAL_ASM("asm/non_matchings/menu/tt_menu_loop.s") GLOBAL_ASM("asm/non_matchings/menu/func_8009E3D0.s") s32 trophy_race_cabinet_menu_loop(void) { - s32 sp24; + s32 currentOption; s32 buttonsPressed; func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x78); func_800C4F7C(1, 0); - sp24 = 0; + currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); func_800C5168(1, -0x8000, 6, gMenuText[70], 1, 4); // TROPHY RACE if (gControllersYAxisDirection[0] < 0) { - D_801264D8++; + sDialogueOption++; } else if (gControllersYAxisDirection[0] > 0) { - D_801264D8--; + sDialogueOption--; } - if (D_801264D8 < 0) { - D_801264D8 = 0; + if (sDialogueOption < 0) { + sDialogueOption = 0; } - if (D_801264D8 > 1) { - D_801264D8 = 1; + if (sDialogueOption > 1) { + sDialogueOption = 1; } - func_8009D118(D_801264D8 == 0); + func_8009D118(sDialogueOption == 0); func_800C5168(1, -0x8000, 0x1E, gMenuText[180], 1, 4); // ENTER TROPHY RACE - func_8009D118(D_801264D8 == 1); + func_8009D118(sDialogueOption == 1); func_800C5168(1, -0x8000, 0x32, gMenuText[51], 1, 4); // EXIT if (buttonsPressed & A_BUTTON) { - sp24 = D_801264D8 + 1; + currentOption = sDialogueOption + 1; } if (buttonsPressed & B_BUTTON) { - sp24 = 2; + currentOption = 2; } - return sp24; + return currentOption; } void func_8009E9A0(void) { @@ -6496,7 +6497,7 @@ f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { D_801263A8 = *arg2; D_801263AC = *arg3; func_80067F2C(&D_801263A0, &D_801263A8); - if (D_800E1E28 != 0 && D_801264E2 == 4) { + if (D_800E1E28 != 0 && sCurrentMenuID == 4) { func_8009E3D0(); } *arg1 = D_801263A0; diff --git a/src/menu.h b/src/menu.h index c8c86129..ddab56fa 100644 --- a/src/menu.h +++ b/src/menu.h @@ -17,6 +17,15 @@ #define TT_MENU_SAVE_GHOST 8 #define TT_MENU_EXIT 10 +enum DialogueMenuCases { + DIALOG_TAJ, + DIALOG_UNK_01, + DIALOG_TT, + DIALOG_CHALLENGE, + DIALOG_TROPHY, + DIALOG_RACERESULT, +}; + #define CHEAT(index) 1 << index typedef enum Cheats { @@ -656,7 +665,7 @@ s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4); void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 arg6); void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); -void func_800829F8(s32 arg0, s32 arg1); +void func_800829F8(Gfx *dl, s32 mulFactor); void menu_logos_screen_init(void); s32 menu_logo_screen_loop(s32 arg0); void func_80082FAC(void); diff --git a/src/thread0_epc.c b/src/thread0_epc.c index c8b104b2..a934fdd0 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -241,8 +241,8 @@ s32 func_800B76DC(void) { } } -void func_800B77D4(s32 arg0) { - D_800E3028 += arg0; +void func_800B77D4(s32 mulFactor) { + D_800E3028 += mulFactor; if (D_800E3028 >= 0x3D) { D_800E3028 = 0; D_800E3024++; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 1c70d66d..b73c9e02 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1284,7 +1284,7 @@ void func_8001E45C(s32 arg0) { D_8011AE7A = arg0; D_8011ADAC = 0; D_8011AE7E = (u8)1; - if (func_8006DA0C() == 1) { + if (get_render_context() == DRAW_MENU) { func_8006F42C(); } } diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 95595428..0ed35143 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -101,7 +101,7 @@ s8 D_800DD3F0 = 0; FadeTransition D_800DD3F4 = FADE_TRANSITION(128, FADE_COLOR_BLACK, 20, 0); // Unused? FadeTransition D_800DD3FC = FADE_TRANSITION(0, FADE_COLOR_WHITE, 20, -1); -s32 D_800DD404 = 12; +s32 sLogicMulFactor = 12; FadeTransition D_800DD408 = FADE_TRANSITION(0, FADE_COLOR_WHITE, 30, -1); // Unused? char *D_800DD410[3] = { @@ -140,10 +140,10 @@ s32 *gHudTriangles[2]; s32 gCurrHudTris; s32 D_80121230[8]; s8 D_80121250[16]; -OSSched *D_80121260; -s32 D_80121268[2208]; //Padding -s32 D_801234E8; -s32 D_801234EC; +OSSched gMainSched; // 0x288 / 648 bytes +s8 D_80121268[8192]; // 0x2000 / 8192 bytes Padding? +s32 gSPTaskNum; +s32 sRenderContext; s32 D_801234F0; s32 D_801234F4; s32 D_801234F8; @@ -166,9 +166,9 @@ s32 gCurrNumF3dCmdsPerPlayer; s32 gCurrNumHudMatPerPlayer; s32 gCurrNumHudTrisPerPlayer; s32 gCurrNumHudVertsPerPlayer; -OSScClient *D_80123538[3]; -OSMesg *D_80123544; -OSMesgQueue *D_80123548; +OSScClient *gNMISched[3]; +OSMesg *gNMIMesgBuf; +OSMesgQueue *gNMIMesgQueue; s32 D_8012354C; s32 D_80123550[4]; s32 D_80123560[8]; @@ -706,7 +706,7 @@ void func_8006BFC8(s8 *arg0) { if ((get_filtered_cheats() << 6) < 0) { phi_s0 = 9; } - if (func_8006DA0C() == 1) { + if (get_render_context() == DRAW_MENU) { phi_s0 = 5; } gTempAssetTable = load_asset_section_from_rom(ASSET_UNKNOWN_0_TABLE); @@ -784,9 +784,9 @@ void thread3_main(s32 arg0) { func_8006C3E0(); D_800DD37C = func_8006A1C4(D_800DD37C, 0); D_80123520 = 0; - D_801234EC = -1; + sRenderContext = DRAW_INTRO; while (1) { - if (func_8006EAC0() != 0) { + if (check_reset_pressed() != 0) { func_80072708(); audioStopThread(); stop_thread30(); @@ -821,15 +821,15 @@ void func_8006C3E0(void) { mode = 28; } - osCreateScheduler(&D_80121260, &D_801234E8, /*priority*/ 13, (u8)mode, 1); + osCreateScheduler(&gMainSched, &gSPTaskNum, /*priority*/ 13, (u8)mode, 1); D_800DD3A0 = 0; if (func_8006EFB8() == 0) { D_800DD3A0 = 1; } - init_video(1, &D_80121260); + init_video(1, &gMainSched); func_80076BA0(); - func_80078100(&D_80121260); - audio_init(&D_80121260); + func_80078100(&gMainSched); + audio_init(&gMainSched); func_80008040(); D_800DD384 = func_8006A10C(); func_8007AC70(); @@ -845,14 +845,14 @@ void func_8006C3E0(void) { func_80075B18(); func_80081218(); create_and_start_thread30(); - osCreateMesgQueue(&D_80123548, &D_80123544, 1); - osScAddClient(&D_80121260, &D_80123538, &D_80123548, 3); + osCreateMesgQueue(&gNMIMesgQueue, &gNMIMesgBuf, 1); + osScAddClient(&gMainSched, &gNMISched, &gNMIMesgQueue, 3); D_80123560[0] = 0; D_80123504 = 0; D_80123508 = 0; - D_801234E8 = 0; + gSPTaskNum = 0; - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); @@ -862,42 +862,42 @@ void func_8006C3E0(void) { void render(void) { s32 phi_v0; s32 phi_v0_2; - s32 temp, temp2; + s32 tempLogicMulFactor, tempLogicMulFactorMax; osSetTime(0); if (D_800DD380 == 8) { - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; set_rsp_segment(&gCurrDisplayList, 0, 0); set_rsp_segment(&gCurrDisplayList, 1, gVideoCurrFramebuffer); set_rsp_segment(&gCurrDisplayList, 2, gVideoLastDepthBuffer); set_rsp_segment(&gCurrDisplayList, 4, gVideoCurrFramebuffer - 0x500); } if (D_800DD3F0 == 0) { - setupOSTasks(gDisplayLists[D_801234E8], gCurrDisplayList, 0); - D_801234E8 += 1; - D_801234E8 &= 1; + setupOSTasks(gDisplayLists[gSPTaskNum], gCurrDisplayList, 0); + gSPTaskNum += 1; + gSPTaskNum &= 1; } if (D_800DD3F0 != 0) { D_800DD3F0 -= 1; } - gCurrDisplayList = gDisplayLists[D_801234E8]; - gCurrHudMat = gHudMatrices[D_801234E8]; - gCurrHudVerts = gHudVertices[D_801234E8]; - gCurrHudTris = gHudTriangles[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; + gCurrHudMat = gHudMatrices[gSPTaskNum]; + gCurrHudVerts = gHudVertices[gSPTaskNum]; + gCurrHudTris = gHudTriangles[gSPTaskNum]; set_rsp_segment(&gCurrDisplayList, 0, 0); set_rsp_segment(&gCurrDisplayList, 1, gVideoLastFramebuffer); set_rsp_segment(&gCurrDisplayList, 2, gVideoLastDepthBuffer); set_rsp_segment(&gCurrDisplayList, 4, gVideoLastFramebuffer - 0x500); - func_800780DC(&gCurrDisplayList); - func_80078054(&gCurrDisplayList); + init_rsp(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_background(&gCurrDisplayList, &gCurrHudMat, 1); - D_800DD37C = func_8006A1C4(D_800DD37C, D_800DD404); + D_800DD37C = func_8006A1C4(D_800DD37C, sLogicMulFactor); if (func_800B76DC() != 0) { render_epc_lock_up_display(); - D_801234EC = 5; + sRenderContext = DRAW_CRASH_SCREEN; } if (D_800DD3A0 != 0) { phi_v0 = 0; @@ -909,34 +909,34 @@ void render(void) { } } - switch (D_801234EC) { - case -1: // Pre-boot screen + switch (sRenderContext) { + case DRAW_INTRO: // Pre-boot screen func_8006F43C(); break; - case 1: // In a menu - func_8006DCF8(D_800DD404); + case DRAW_MENU: // In a menu + func_8006DCF8(sLogicMulFactor); break; - case 0: // In game (Controlling a character) - func_8006CCF0(D_800DD404); + case DRAW_GAME: // In game (Controlling a character) + func_8006CCF0(sLogicMulFactor); break; - case 5: // EPC (lockup display) - func_800B77D4(D_800DD404); + case DRAW_CRASH_SCREEN: // EPC (lockup display) + func_800B77D4(sLogicMulFactor); break; } // This is a good spot to place custom text if you want it to overlay it over ALL the // menus & gameplay. - func_80000D00((u8)D_800DD404); + func_80000D00((u8)sLogicMulFactor); func_800B5F78(&gCurrDisplayList); func_800C56FC(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); func_800C5620(4); func_800C5494(4); - if (func_800C0494(D_800DD404) != 0) { + if (func_800C0494(sLogicMulFactor) != 0) { render_fade_transition(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); } if ((D_80123520 >= 8) && (func_8006F4C8() != 0)) { - func_800829F8(&gCurrDisplayList, D_800DD404); + func_800829F8(&gCurrDisplayList, sLogicMulFactor); } gDPFullSync(gCurrDisplayList++); @@ -962,12 +962,15 @@ void render(void) { } func_80070B04(gVideoLastFramebuffer, gVideoCurrFramebuffer, gVideoCurrFramebuffer + phi_v0_2); } - - temp = func_8007A98C(D_800DD380); - D_800DD404 = temp; - temp2 = 6; - if (temp > temp2) { - D_800DD404 = temp2; + // tempLogicMulFactor will be set to a value 2 or higher, based on the framerate. + // the mul factor is hardcapped at 6, which happens at 10FPS. The mul factor + // affects frameskipping, to maintain consistent game speed, through the (many) + // dropped frames in DKR. + tempLogicMulFactor = func_8007A98C(D_800DD380); + sLogicMulFactor = tempLogicMulFactor; + tempLogicMulFactorMax = 6; + if (tempLogicMulFactor > tempLogicMulFactorMax) { + sLogicMulFactor = tempLogicMulFactorMax; } } @@ -1013,7 +1016,7 @@ void func_8006CC14(void) { func_800AE270(); func_800A003C(); func_800C30CC(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); set_free_queue_state(2); @@ -1021,7 +1024,7 @@ void func_8006CC14(void) { #ifdef NON_MATCHING // Almost matching except for a couple minor issues. -void func_8006CCF0(s32 arg0) { +void func_8006CCF0(s32 mulFactor) { s32 i, buttonHeldInputs, sp40, sp3C, buttonPressedInputs, phi_v1_2; sp40 = 0; @@ -1036,10 +1039,10 @@ void func_8006CCF0(s32 arg0) { buttonPressedInputs |= START_BUTTON; } if (!gIsPaused) { - func_80010994(arg0); + func_80010994(mulFactor); if (func_80066510() == 0 || func_8001139C()) { if ((buttonPressedInputs & START_BUTTON) && (func_8006C2F0() == 0) && (D_800DD390 == 0) - && (D_801234EC == 0) && (D_80123516 == 0) && (D_800DD394 == 0) && (D_800DD398 == 0)) { + && (sRenderContext == DRAW_GAME) && (D_80123516 == 0) && (D_800DD394 == 0) && (D_800DD398 == 0)) { buttonPressedInputs = 0; gIsPaused = TRUE; func_80093A40(); @@ -1048,7 +1051,7 @@ void func_8006CCF0(s32 arg0) { } else { func_80028FA0(1); } - D_800DD398 -= arg0; + D_800DD398 -= mulFactor; if (D_800DD398 < 0) { D_800DD398 = 0; } @@ -1057,13 +1060,13 @@ void func_8006CCF0(s32 arg0) { } gParticlePtrList_flush(); func_8001BF20(); - func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); - if (D_801234EC == 0) { + func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); + if (sRenderContext == DRAW_GAME) { // Ignore the user's L/R/Z buttons. buttonHeldInputs &= ~(L_TRIG | R_TRIG | Z_TRIG); } if (D_80123516 != 0) { - i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, arg0); + i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); switch (i - 1) { case 1: buttonHeldInputs |= (L_TRIG | Z_TRIG); @@ -1108,7 +1111,7 @@ void func_8006CCF0(s32 arg0) { break; } } - func_800C3440(arg0); + func_800C3440(mulFactor); i = func_800C3400(); if (i != 0) { if (i == 2) { @@ -1120,7 +1123,7 @@ void func_8006CCF0(s32 arg0) { } } if (gIsPaused) { - i = func_80094170(&gCurrDisplayList, arg0); + i = func_80094170(&gCurrDisplayList, mulFactor); switch (i - 1) { case 0: gIsPaused = FALSE; @@ -1167,9 +1170,9 @@ void func_8006CCF0(s32 arg0) { break; } } - func_80078054(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); - func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, arg0); + func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); func_80077268(&gCurrDisplayList); if (D_800DD39C != 0) { if (func_800214C4() != 0) { @@ -1181,7 +1184,7 @@ void func_8006CCF0(s32 arg0) { } phi_v1_2 = FALSE; if (D_800DD390 != 0) { - D_800DD390 -= arg0; + D_800DD390 -= mulFactor; if (D_800DD390 <= 0) { D_800DD390 = 0; func_8006C1AC(0, 0, 0, 0); @@ -1190,7 +1193,7 @@ void func_8006CCF0(s32 arg0) { } } if (D_800DD394 > 0) { - D_800DD394 -= arg0; + D_800DD394 -= mulFactor; if (D_800DD394 <= 0) { buttonHeldInputs = L_TRIG; switch (D_80123524) { @@ -1270,7 +1273,7 @@ void func_8006CCF0(s32 arg0) { } } } - if (((buttonHeldInputs & L_TRIG) && (D_801234EC == 0)) || (D_801234FC != 0)) { + if (((buttonHeldInputs & L_TRIG) && (sRenderContext == DRAW_GAME)) || (D_801234FC != 0)) { gIsPaused = FALSE; D_800DD394 = 0; D_80123516 = 0; @@ -1364,9 +1367,9 @@ void func_8006D8E0(s32 arg0) { D_80123516 = arg0 + 1; } -void func_8006D8F0(s32 arg0) { +void func_8006D8F0(UNUSED s32 arg0) { s32 temp; - if (D_801234EC != 4) { + if (sRenderContext != DRAW_UNK_04) { D_801234F4 = D_80121250[0]; D_80123504 = 0; D_80123508 = 0x64; @@ -1383,7 +1386,7 @@ void func_8006D8F0(s32 arg0) { void func_8006D968(s8 *arg0) { s32 i; - if (D_801234EC != 4) { + if (sRenderContext != DRAW_UNK_04) { D_80121250[0] = D_801234F4; for (i = 0; i < 2; i++) { D_80121250[i + 2] = arg0[i + 8]; @@ -1399,18 +1402,18 @@ void func_8006D968(s8 *arg0) { } } -s32 func_8006DA0C(void) { - return D_801234EC; +s32 get_render_context(void) { + return sRenderContext; } -/* Unused? */ -void func_8006DA1C(s32 arg0) { - D_801234EC = arg0; +/* Unused function used to set the render context from outside this file */ +UNUSED void set_render_context(s32 changeTo) { + sRenderContext = changeTo; } void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId) { func_8006ECFC(0); - D_801234EC = 1; + sRenderContext = DRAW_MENU; D_801234F0 = 1; func_80004A60(0, 0x7FFF); func_80004A60(1, 0x7FFF); @@ -1481,7 +1484,7 @@ void func_8006DC58(s32 arg0) { func_8001BF20(); func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); func_800C3440(arg0); - func_80078054(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); func_80077268(&gCurrDisplayList); } @@ -1489,15 +1492,15 @@ void func_8006DC58(s32 arg0) { #ifdef NON_MATCHING // Minor & regalloc issues. -void func_8006DCF8(s32 arg0) { +void func_8006DCF8(s32 mulFactor) { s32 menuLoopResult, temp, temp2, tempResult; gIsPaused = FALSE; D_80123516 = 0; if (!D_80123514 && D_801234F0) { - func_8006DC58(arg0); + func_8006DC58(mulFactor); } - menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); + menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); D_801234F0 = TRUE; if (menuLoopResult == -2) { D_801234F0 = FALSE; @@ -1505,14 +1508,14 @@ void func_8006DCF8(s32 arg0) { } if ((menuLoopResult != -1) && (menuLoopResult & 0x200)) { func_8006DBE4(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); D_801234F4 = menuLoopResult & 0x7F; D_80123518 = func_8006B0AC(D_801234F4); D_80123504 = 0; D_80123508 = 0x64; - D_801234EC = 0; + sRenderContext = DRAW_GAME; gIsPaused = FALSE; D_80123516 = 0; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); @@ -1531,7 +1534,7 @@ void func_8006DCF8(s32 arg0) { D_801234F4 = 0; D_80123504 = 0; D_80123508 = 0x64; - D_801234EC = 0; + sRenderContext = DRAW_GAME; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); func_8006EC48(get_save_file_index()); break; @@ -1539,7 +1542,7 @@ void func_8006DCF8(s32 arg0) { D_80123504 = 0; D_80123508 = 0x64; D_801234F4 = D_80121250[0]; - D_801234EC = 0; + sRenderContext = DRAW_GAME; // Minor issue with these 2 if statements temp2 = D_80121250[D_80121250[1] + 8]; temp = D_80121250[15]; @@ -1553,11 +1556,11 @@ void func_8006DCF8(s32 arg0) { func_8006EC48(get_save_file_index()); break; case 2: - D_801234EC = 0; + sRenderContext = DRAW_GAME; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); break; case 3: - D_801234EC = 0; + sRenderContext = DRAW_GAME; D_801234F4 = D_80121250[0]; D_80123504 = D_80121250[15]; D_80123508 = D_80121250[D_80121250[1] + 8]; @@ -1573,7 +1576,7 @@ void func_8006DCF8(s32 arg0) { if ((menuLoopResult & 0x80) && (menuLoopResult != -1)) { func_8006DBE4(); // Minor issue here. - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); temp = menuLoopResult & 0x7F; @@ -1581,7 +1584,7 @@ void func_8006DCF8(s32 arg0) { D_80121250[0] = D_801234F4; D_801234F4 = D_80121250[temp + 2]; D_80123504 = D_80121250[temp + 4]; - D_801234EC = 0; + sRenderContext = DRAW_GAME; D_80123508 = D_80121250[temp + 12]; temp = get_player_selected_vehicle(0); D_80123500 = gSettingsPtr->gObjectCount - 1; @@ -1592,10 +1595,10 @@ void func_8006DCF8(s32 arg0) { } if (menuLoopResult > 0) { func_8006DBE4(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); - D_801234EC = 0; + sRenderContext = DRAW_GAME; func_8006CAE4(menuLoopResult, -1, D_80123518); if (gSettingsPtr->newGame && !is_in_tracks_mode()) { func_80000B28(); @@ -1612,7 +1615,7 @@ void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId) { if (!D_80123514) { func_8006DBE4(); if (get_thread30_level_id_to_load() == 0) { - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); } @@ -1769,9 +1772,9 @@ s8 func_8006EAB0(void) { return D_80123516; } -s32 func_8006EAC0(void) { +s32 check_reset_pressed(void) { if (D_80123560[0] == 0) { - D_80123560[0] = (s32)((osRecvMesg(&D_80123548, NULL, 0) + 1) != 0); + D_80123560[0] = (s32)((osRecvMesg(&gNMIMesgQueue, NULL, 0) + 1) != 0); } return D_80123560[0]; } @@ -1821,7 +1824,7 @@ void func_8006EC18(s32 arg0) { } void func_8006EC48(s32 arg0) { - if (D_801234EC == 0 && !is_in_tracks_mode()) { + if (sRenderContext == DRAW_GAME && !is_in_tracks_mode()) { D_800DD37C &= -0xC01; D_800DD37C |= (0x40 | ((arg0 & 3) << 0xA)); } diff --git a/src/unknown_06B2B0.h b/src/unknown_06B2B0.h index 78c8aa30..2f74a406 100644 --- a/src/unknown_06B2B0.h +++ b/src/unknown_06B2B0.h @@ -5,6 +5,16 @@ #include "structs.h" #include "fade_transition.h" +enum RenderContext { + DRAW_INTRO = -1, + DRAW_GAME, + DRAW_MENU, + DRAW_UNK_02, + DRAW_UNK_03, + DRAW_UNK_04, + DRAW_CRASH_SCREEN, +}; + /* Size: 6 bytes */ typedef struct unk8012117C { s8 unk0; @@ -129,8 +139,8 @@ void func_8006D8A4(void); void func_8006D8E0(s32 arg0); void func_8006D8F0(s32 arg0); void func_8006D968(s8 *arg0); -s32 func_8006DA0C(void); -void func_8006DA1C(s32 arg0); +s32 get_render_context(void); +UNUSED void func_8006DA1C(s32 arg0); void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId); void func_8006DB14(s32 arg0); void func_8006DB20(s32 vehicleId); @@ -147,7 +157,7 @@ void func_8006EA58(void); Settings *get_settings(void); s8 is_game_paused(void); s8 func_8006EAB0(void); -s32 func_8006EAC0(void); +s32 check_reset_pressed(void); s32 func_8006EB14(void); void func_8006EB24(void); void func_8006EB40(void); diff --git a/src/unknown_078050.c b/src/unknown_078050.c index 107d0bf1..580a6a42 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -29,7 +29,7 @@ s32 D_800DE4D4 = 0; s32 D_800DE4D8 = 0; s32 D_800DE4DC = 0; -Gfx D_800DE4E0[] = { +Gfx dl_rsp_init[] = { gsSPClearGeometryMode(0x001F3204), gsSPTexture(0, 0, 0, 0, 0), gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), @@ -38,7 +38,7 @@ Gfx D_800DE4E0[] = { }; // Default RDP settings -Gfx D_800DE520[] = { +Gfx dl_rdp_init[] = { gsDPSetCycleType(G_CYC_1CYCLE), gsDPPipelineMode(G_PM_1PRIMITIVE), gsDPSetTextureLOD(G_TL_TILE), @@ -266,15 +266,15 @@ void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { GLOBAL_ASM("asm/non_matchings/unknown_078050/render_background.s") #endif -void func_80078054(Gfx **dlist) { +void init_rdp_and_framebuffer(Gfx **dlist) { s32 width = get_video_width_and_height_as_s32() & 0xFFF; gDPSetColorImage((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, 0x01000000); gDPSetDepthImage((*dlist)++, 0x2000000); - gSPDisplayList((*dlist)++, D_800DE520); + gSPDisplayList((*dlist)++, dl_rdp_init); } -void func_800780DC(Gfx **dlist) { - gSPDisplayList((*dlist)++, D_800DE4E0); +void init_rsp(Gfx **dlist) { + gSPDisplayList((*dlist)++, dl_rsp_init); } void func_80078100(OSSched *sc) { diff --git a/src/unknown_078050.h b/src/unknown_078050.h index b10a75ea..30b8af57 100644 --- a/src/unknown_078050.h +++ b/src/unknown_078050.h @@ -32,8 +32,8 @@ s32 func_80077A54(void); void func_80077AAC(void *bufPtr, s32 arg1, s32 arg2); void func_80077B34(u8 arg0, u8 arg1, u8 arg2); void func_80077B5C(s32 red, s32 green, s32 blue); -void func_80078054(Gfx **dlist); -void func_800780DC(Gfx **dlist); +void init_rdp_and_framebuffer(Gfx **dlist); +void init_rsp(Gfx **dlist); void func_80078100(OSSched *sc); void func_80078170(u32 arg0, u32 arg1, u32 arg2); void func_80078778(s32 arg0, s32 arg1, s32 arg2, s32 arg3); diff --git a/src/video.c b/src/video.c index 3515ad7b..5f1c7f1d 100644 --- a/src/video.c +++ b/src/video.c @@ -233,9 +233,9 @@ void func_8007A974(void) { #ifdef NON_MATCHING // regalloc & stack issues s32 func_8007A98C(s32 arg0) { - s32 s0; + s32 tempMulFactor; - s0 = 1; + tempMulFactor = 1; if (D_801262D0 != 0) { D_801262D0--; if (D_801262D0 == 0) { @@ -250,28 +250,28 @@ s32 func_8007A98C(s32 arg0) { s0 &= 0xFF; } - if (s0 < D_80126309) { + if (tempMulFactor < D_80126309) { if (D_80126308 < 0x14) { D_80126308++; } if (D_80126308 == 0x14) { - D_80126309 = s0; + D_80126309 = tempMulFactor; D_80126308 = 0; } } else { D_80126308 = 0; - if ((D_80126309 >= s0) || (D_801262E4 > s0)) { - D_80126309 = s0; + if ((D_80126309 >= tempMulFactor) || (D_801262E4 > tempMulFactor)) { + D_80126309 = tempMulFactor; } } - while (s0 < D_80126309) { + while (tempMulFactor < D_80126309) { osRecvMesg(&D_801261A0, NULL, 1); - s0 += 1; - s0 &= 0xFF; + tempMulFactor += 1; + tempMulFactor &= 0xFF; } osViSwapBuffer(gVideoLastFramebuffer); osRecvMesg(&D_801261A0, NULL, 1); - return s0; + return tempMulFactor; } #else GLOBAL_ASM("asm/non_matchings/video/func_8007A98C.s")