From 1b40669f0df81ab868cfc9a7b64272f756cf552c Mon Sep 17 00:00:00 2001 From: ChiefFruitcake <96551211+ChiefFruitcake@users.noreply.github.com> Date: Fri, 24 Dec 2021 22:43:17 -0500 Subject: [PATCH] Menu selection global variable (#113) * Rename D_800E86A0 to gMenuSelection. Add menu selection options to defines.h * Other namings --- asm/bss_8001C4D0.s | 6 +- asm/bss_credits.s | 2 +- .../code_800393C0/func_8003A9F0.s | 4 +- .../code_80091750/func_80091B78.s | 8 +- .../code_80091750/func_80094A64.s | 4 +- .../code_80091750/func_80094C60.s | 8 +- .../code_80091750/func_80095574.s | 28 +-- .../code_80091750/func_8009CE64.s | 52 +++--- .../code_800AF9B0/func_800B0350.s | 4 +- .../code_800AF9B0/func_800B20F4.s | 68 +++---- .../code_800AF9B0/func_800B29D8.s | 28 +-- .../code_800AF9B0/func_800B3554.s | 8 +- .../code_800AF9B0/func_800B3B58.s | 12 +- .../code_800AF9B0/func_800B3F74.s | 12 +- data/data_0DD0A0.s | 4 +- data/data_0DD0A0_0.s | 2 +- data/data_0DD0A0_2.s | 2 +- include/defines.h | 45 +++++ include/variables.h | 2 +- src/code_800029B0.c | 4 +- src/code_8001F980.c | 2 +- src/code_80027D00.c | 2 +- src/code_800393C0.c | 10 +- src/code_800431B0.c | 8 +- src/code_80057C60.c | 40 ++-- src/code_8006E9C0.c | 20 +- src/code_80071F00.c | 18 +- src/code_80091750.c | 172 +++++++++--------- src/code_800AF9B0.c | 156 ++++++++-------- src/code_80280000.c | 25 +-- src/code_80281780.c | 2 +- src/code_80281780.h | 2 +- src/code_80281C40.c | 10 +- src/code_80281FA0.c | 4 +- src/code_8028DF00.c | 60 +++--- src/code_80290C20.c | 2 +- src/code_80296A50.c | 8 +- src/code_802A3730.c | 42 ++--- src/main.c | 12 +- src/memory.c | 2 +- 40 files changed, 475 insertions(+), 425 deletions(-) diff --git a/asm/bss_8001C4D0.s b/asm/bss_8001C4D0.s index 00826c5e3..aef5d138a 100644 --- a/asm/bss_8001C4D0.s +++ b/asm/bss_8001C4D0.s @@ -2079,7 +2079,7 @@ glabel D_8018EDED glabel D_8018EDEE .skip 1 -glabel D_8018EDEF +glabel gDebugMenuSelection .skip 1 glabel gPlayerCountSelection2 # 0x8018EDF0 @@ -2112,7 +2112,7 @@ glabel D_8018EDF8 glabel D_8018EDF9 .skip 1 -glabel D_8018EDFA +glabel gDebugGotoScene .skip 1 glabel D_8018EDFB @@ -2121,7 +2121,7 @@ glabel D_8018EDFB glabel D_8018EDFC .skip 4 -glabel D_8018EE00 +glabel gStartMenuCounterForDemos .skip 4 glabel D_8018EE04 diff --git a/asm/bss_credits.s b/asm/bss_credits.s index 761a4954e..ee6e76f5f 100644 --- a/asm/bss_credits.s +++ b/asm/bss_credits.s @@ -53,7 +53,7 @@ glabel D_80287500 glabel D_80287540 .skip 16 -glabel D_80287550 +glabel gMenuSelectionFromEndingSequence .skip 4 glabel D_80287554 diff --git a/asm/non_matchings/code_800393C0/func_8003A9F0.s b/asm/non_matchings/code_800393C0/func_8003A9F0.s index 0fc1d8777..cc7f66dba 100644 --- a/asm/non_matchings/code_800393C0/func_8003A9F0.s +++ b/asm/non_matchings/code_800393C0/func_8003A9F0.s @@ -19,10 +19,10 @@ glabel func_8003A9F0 /* 03B634 8003AA34 00000000 */ nop /* 03B638 8003AA38 95EFC51C */ lhu $t7, %lo(D_800DC51C)($t7) /* 03B63C 8003AA3C 24010001 */ li $at, 1 -/* 03B640 8003AA40 3C188019 */ lui $t8, %hi(D_8018EDEF) # $t8, 0x8019 +/* 03B640 8003AA40 3C188019 */ lui $t8, %hi(gDebugMenuSelection) # $t8, 0x8019 /* 03B644 8003AA44 11E10004 */ beq $t7, $at, .L8003AA58 /* 03B648 8003AA48 00000000 */ nop -/* 03B64C 8003AA4C 8318EDEF */ lb $t8, %lo(D_8018EDEF)($t8) +/* 03B64C 8003AA4C 8318EDEF */ lb $t8, %lo(gDebugMenuSelection)($t8) /* 03B650 8003AA50 24010040 */ li $at, 64 /* 03B654 8003AA54 17010028 */ bne $t8, $at, .L8003AAF8 .L8003AA58: diff --git a/asm/non_matchings/code_80091750/func_80091B78.s b/asm/non_matchings/code_80091750/func_80091B78.s index 38f2099ec..755bb4b81 100644 --- a/asm/non_matchings/code_80091750/func_80091B78.s +++ b/asm/non_matchings/code_80091750/func_80091B78.s @@ -28,11 +28,11 @@ glabel func_80091B78 /* 0927DC 80091BDC 00000000 */ nop /* 0927E0 80091BE0 10400003 */ beqz $v0, .L80091BF0 /* 0927E4 80091BE4 24180009 */ li $t8, 9 -/* 0927E8 80091BE8 3C01800F */ lui $at, %hi(D_800E86A0) # $at, 0x800f -/* 0927EC 80091BEC AC3886A0 */ sw $t8, %lo(D_800E86A0)($at) +/* 0927E8 80091BE8 3C01800F */ lui $at, %hi(gMenuSelection) # $at, 0x800f +/* 0927EC 80091BEC AC3886A0 */ sw $t8, %lo(gMenuSelection)($at) .L80091BF0: -/* 0927F0 80091BF0 3C19800F */ lui $t9, %hi(D_800E86A0) # $t9, 0x800f -/* 0927F4 80091BF4 8F3986A0 */ lw $t9, %lo(D_800E86A0)($t9) +/* 0927F0 80091BF0 3C19800F */ lui $t9, %hi(gMenuSelection) # $t9, 0x800f +/* 0927F4 80091BF4 8F3986A0 */ lw $t9, %lo(gMenuSelection)($t9) /* 0927F8 80091BF8 24110008 */ li $s1, 8 /* 0927FC 80091BFC 1639000C */ bne $s1, $t9, .L80091C30 /* 092800 80091C00 3C088016 */ lui $t0, %hi(D_8015F734) # $t0, 0x8016 diff --git a/asm/non_matchings/code_80091750/func_80094A64.s b/asm/non_matchings/code_80091750/func_80094A64.s index 1455106b1..f554a4c09 100644 --- a/asm/non_matchings/code_80091750/func_80094A64.s +++ b/asm/non_matchings/code_80091750/func_80094A64.s @@ -79,8 +79,8 @@ glabel func_80094A64 /* 095798 80094B98 00000000 */ nop /* 09579C 80094B9C 0C027246 */ jal func_8009C918 /* 0957A0 80094BA0 00000000 */ nop -/* 0957A4 80094BA4 3C09800F */ lui $t1, %hi(D_800E86A0) # $t1, 0x800f -/* 0957A8 80094BA8 8D2986A0 */ lw $t1, %lo(D_800E86A0)($t1) +/* 0957A4 80094BA4 3C09800F */ lui $t1, %hi(gMenuSelection) # $t1, 0x800f +/* 0957A8 80094BA8 8D2986A0 */ lw $t1, %lo(gMenuSelection)($t1) /* 0957AC 80094BAC 252AFFFB */ addiu $t2, $t1, -5 /* 0957B0 80094BB0 2D410009 */ sltiu $at, $t2, 9 /* 0957B4 80094BB4 10200010 */ beqz $at, .L80094BF8 diff --git a/asm/non_matchings/code_80091750/func_80094C60.s b/asm/non_matchings/code_80091750/func_80094C60.s index 8eb168406..be1df4de4 100644 --- a/asm/non_matchings/code_80091750/func_80094C60.s +++ b/asm/non_matchings/code_80091750/func_80094C60.s @@ -19,11 +19,11 @@ glabel func_80094C60 /* 0958A4 80094CA4 00000000 */ nop /* 0958A8 80094CA8 0C02D805 */ jal func_800B6014 /* 0958AC 80094CAC 00000000 */ nop -/* 0958B0 80094CB0 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f +/* 0958B0 80094CB0 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f /* 0958B4 80094CB4 0C02CFDD */ jal func_800B3F74 -/* 0958B8 80094CB8 8C8486A0 */ lw $a0, %lo(D_800E86A0)($a0) -/* 0958BC 80094CBC 3C0F800F */ lui $t7, %hi(D_800E86A0) # $t7, 0x800f -/* 0958C0 80094CC0 8DEF86A0 */ lw $t7, %lo(D_800E86A0)($t7) +/* 0958B8 80094CB8 8C8486A0 */ lw $a0, %lo(gMenuSelection)($a0) +/* 0958BC 80094CBC 3C0F800F */ lui $t7, %hi(gMenuSelection) # $t7, 0x800f +/* 0958C0 80094CC0 8DEF86A0 */ lw $t7, %lo(gMenuSelection)($t7) /* 0958C4 80094CC4 2DE1000E */ sltiu $at, $t7, 0xe /* 0958C8 80094CC8 10200219 */ beqz $at, .L80095530 /* 0958CC 80094CCC 000F7880 */ sll $t7, $t7, 2 diff --git a/asm/non_matchings/code_80091750/func_80095574.s b/asm/non_matchings/code_80091750/func_80095574.s index fd554b390..1b9e922cc 100644 --- a/asm/non_matchings/code_80091750/func_80095574.s +++ b/asm/non_matchings/code_80091750/func_80095574.s @@ -13,8 +13,8 @@ glabel func_80095574 /* 09619C 8009559C 0C02A08C */ jal func_800A8230 /* 0961A0 800955A0 00000000 */ nop .L800955A4: -/* 0961A4 800955A4 3C028019 */ lui $v0, %hi(D_8018EDEF) # $v0, 0x8019 -/* 0961A8 800955A8 8042EDEF */ lb $v0, %lo(D_8018EDEF)($v0) +/* 0961A4 800955A4 3C028019 */ lui $v0, %hi(gDebugMenuSelection) # $v0, 0x8019 +/* 0961A8 800955A8 8042EDEF */ lb $v0, %lo(gDebugMenuSelection)($v0) /* 0961AC 800955AC 28410002 */ slti $at, $v0, 2 /* 0961B0 800955B0 5420009F */ bnel $at, $zero, .L80095830 /* 0961B4 800955B4 24010001 */ li $at, 1 @@ -25,8 +25,8 @@ glabel func_80095574 /* 0961C8 800955C8 24040050 */ li $a0, 80 /* 0961CC 800955CC 0C015DE9 */ jal debug_print_str2 /* 0961D0 800955D0 24050064 */ li $a1, 100 -/* 0961D4 800955D4 3C188019 */ lui $t8, %hi(D_8018EDEF) # $t8, 0x8019 -/* 0961D8 800955D8 8318EDEF */ lb $t8, %lo(D_8018EDEF)($t8) +/* 0961D4 800955D4 3C188019 */ lui $t8, %hi(gDebugMenuSelection) # $t8, 0x8019 +/* 0961D8 800955D8 8318EDEF */ lb $t8, %lo(gDebugMenuSelection)($t8) /* 0961DC 800955DC 2719FFFE */ addiu $t9, $t8, -2 /* 0961E0 800955E0 2F210006 */ sltiu $at, $t9, 6 /* 0961E4 800955E4 1020002E */ beqz $at, .L800956A0 @@ -175,8 +175,8 @@ glabel L8009568C /* 0963EC 800957EC 8CC67700 */ lw $a2, %lo(gDebugSoundModeNames)($a2) /* 0963F0 800957F0 0C015DE9 */ jal debug_print_str2 /* 0963F4 800957F4 2405008C */ li $a1, 140 -/* 0963F8 800957F8 3C188019 */ lui $t8, %hi(D_8018EDEF) # $t8, 0x8019 -/* 0963FC 800957FC 8318EDEF */ lb $t8, %lo(D_8018EDEF)($t8) +/* 0963F8 800957F8 3C188019 */ lui $t8, %hi(gDebugMenuSelection) # $t8, 0x8019 +/* 0963FC 800957FC 8318EDEF */ lb $t8, %lo(gDebugMenuSelection)($t8) /* 096400 80095800 24010007 */ li $at, 7 /* 096404 80095804 24040050 */ li $a0, 80 /* 096408 80095808 17010004 */ bne $t8, $at, .L8009581C @@ -187,20 +187,20 @@ glabel L8009568C .L8009581C: /* 09641C 8009581C 0C015DDE */ jal func_80057778 /* 096420 80095820 00000000 */ nop -/* 096424 80095824 3C028019 */ lui $v0, %hi(D_8018EDEF) # $v0, 0x8019 -/* 096428 80095828 8042EDEF */ lb $v0, %lo(D_8018EDEF)($v0) +/* 096424 80095824 3C028019 */ lui $v0, %hi(gDebugMenuSelection) # $v0, 0x8019 +/* 096428 80095828 8042EDEF */ lb $v0, %lo(gDebugMenuSelection)($v0) /* 09642C 8009582C 24010001 */ li $at, 1 .L80095830: /* 096430 80095830 14410007 */ bne $v0, $at, .L80095850 -/* 096434 80095834 3C038019 */ lui $v1, %hi(D_8018EE00) # 0x8019 -/* 096438 80095838 3C038019 */ lui $v1, %hi(D_8018EE00) # $v1, 0x8019 -/* 09643C 8009583C 2463EE00 */ addiu $v1, %lo(D_8018EE00) # addiu $v1, $v1, -0x1200 +/* 096434 80095834 3C038019 */ lui $v1, %hi(gStartMenuCounterForDemos) # 0x8019 +/* 096438 80095838 3C038019 */ lui $v1, %hi(gStartMenuCounterForDemos) # $v1, 0x8019 +/* 09643C 8009583C 2463EE00 */ addiu $v1, %lo(gStartMenuCounterForDemos) # addiu $v1, $v1, -0x1200 /* 096440 80095840 8C790000 */ lw $t9, ($v1) /* 096444 80095844 27280001 */ addiu $t0, $t9, 1 /* 096448 80095848 10000004 */ b .L8009585C /* 09644C 8009584C AC680000 */ sw $t0, ($v1) .L80095850: -/* 096450 80095850 2463EE00 */ addiu $v1, $v1, %lo(D_8018EE00) # -0x1200 +/* 096450 80095850 2463EE00 */ addiu $v1, $v1, %lo(gStartMenuCounterForDemos) # -0x1200 /* 096454 80095854 24090003 */ li $t1, 3 /* 096458 80095858 AC690000 */ sw $t1, ($v1) .L8009585C: @@ -211,8 +211,8 @@ glabel L8009568C /* 09646C 8009586C 2841012D */ slti $at, $v0, 0x12d /* 096470 80095870 0C032384 */ jal play_sound2 /* 096474 80095874 34849009 */ ori $a0, (0x49009009 & 0xFFFF) # ori $a0, $a0, 0x9009 -/* 096478 80095878 3C028019 */ lui $v0, %hi(D_8018EE00) # $v0, 0x8019 -/* 09647C 8009587C 8C42EE00 */ lw $v0, %lo(D_8018EE00)($v0) +/* 096478 80095878 3C028019 */ lui $v0, %hi(gStartMenuCounterForDemos) # $v0, 0x8019 +/* 09647C 8009587C 8C42EE00 */ lw $v0, %lo(gStartMenuCounterForDemos)($v0) /* 096480 80095880 2841012D */ slti $at, $v0, 0x12d .L80095884: /* 096484 80095884 14200005 */ bnez $at, .L8009589C diff --git a/asm/non_matchings/code_80091750/func_8009CE64.s b/asm/non_matchings/code_80091750/func_8009CE64.s index c97bf4985..8f3290a76 100644 --- a/asm/non_matchings/code_80091750/func_8009CE64.s +++ b/asm/non_matchings/code_80091750/func_8009CE64.s @@ -30,19 +30,19 @@ glabel func_8009CE64 /* 09DAD0 8009CED0 24050001 */ li $a1, 1 .L8009CED4: /* 09DAD4 8009CED4 10A00008 */ beqz $a1, .L8009CEF8 -/* 09DAD8 8009CED8 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f +/* 09DAD8 8009CED8 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f /* 09DADC 8009CEDC 24180009 */ li $t8, 9 -/* 09DAE0 8009CEE0 3C018028 */ lui $at, %hi(D_80287550) # $at, 0x8028 -/* 09DAE4 8009CEE4 AC387550 */ sw $t8, %lo(D_80287550)($at) -/* 09DAE8 8009CEE8 3C01800E */ lui $at, %hi(D_800DC644) # $at, 0x800e +/* 09DAE0 8009CEE0 3C018028 */ lui $at, %hi(gMenuSelectionFromEndingSequence) # $at, 0x8028 +/* 09DAE4 8009CEE4 AC387550 */ sw $t8, %lo(gMenuSelectionFromEndingSequence)($at) +/* 09DAE8 8009CEE8 3C01800E */ lui $at, %hi(gCreditsCourseId) # $at, 0x800e /* 09DAEC 8009CEEC 24190008 */ li $t9, 8 /* 09DAF0 8009CEF0 1000021E */ b .L8009D76C -/* 09DAF4 8009CEF4 A439C644 */ sh $t9, %lo(D_800DC644)($at) +/* 09DAF4 8009CEF4 A439C644 */ sh $t9, %lo(gCreditsCourseId)($at) .L8009CEF8: /* 09DAF8 8009CEF8 24050001 */ li $a1, 1 -/* 09DAFC 8009CEFC 3C018028 */ lui $at, %hi(D_80287550) # $at, 0x8028 -/* 09DB00 8009CF00 248486A0 */ addiu $a0, %lo(D_800E86A0) # addiu $a0, $a0, -0x7960 -/* 09DB04 8009CF04 AC257550 */ sw $a1, %lo(D_80287550)($at) +/* 09DAFC 8009CEFC 3C018028 */ lui $at, %hi(gMenuSelectionFromEndingSequence) # $at, 0x8028 +/* 09DB00 8009CF00 248486A0 */ addiu $a0, %lo(gMenuSelection) # addiu $a0, $a0, -0x7960 +/* 09DB04 8009CF04 AC257550 */ sw $a1, %lo(gMenuSelectionFromEndingSequence)($at) /* 09DB08 8009CF08 240E000B */ li $t6, 11 /* 09DB0C 8009CF0C 10000217 */ b .L8009D76C /* 09DB10 8009CF10 AC8E0000 */ sw $t6, ($a0) @@ -233,8 +233,8 @@ glabel L8009D170 /* 09DD94 8009D194 10000175 */ b .L8009D76C /* 09DD98 8009D198 A1EE0000 */ sb $t6, ($t7) .L8009D19C: -/* 09DD9C 8009D19C 3C188019 */ lui $t8, %hi(D_8018EDEF) # $t8, 0x8019 -/* 09DDA0 8009D1A0 8318EDEF */ lb $t8, %lo(D_8018EDEF)($t8) +/* 09DD9C 8009D19C 3C188019 */ lui $t8, %hi(gDebugMenuSelection) # $t8, 0x8019 +/* 09DDA0 8009D1A0 8318EDEF */ lb $t8, %lo(gDebugMenuSelection)($t8) /* 09DDA4 8009D1A4 00240821 */ addu $at, $at, $a0 /* 09DDA8 8009D1A8 A020E7AC */ sb $zero, %lo(D_8018E7AC)($at) /* 09DDAC 8009D1AC 24010040 */ li $at, 64 @@ -250,8 +250,8 @@ glabel L8009D170 /* 09DDD4 8009D1D4 03200008 */ jr $t9 /* 09DDD8 8009D1D8 00000000 */ nop glabel L8009D1DC -/* 09DDDC 8009D1DC 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f -/* 09DDE0 8009D1E0 248486A0 */ addiu $a0, %lo(D_800E86A0) # addiu $a0, $a0, -0x7960 +/* 09DDDC 8009D1DC 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f +/* 09DDE0 8009D1E0 248486A0 */ addiu $a0, %lo(gMenuSelection) # addiu $a0, $a0, -0x7960 /* 09DDE4 8009D1E4 8C820000 */ lw $v0, ($a0) /* 09DDE8 8009D1E8 24010008 */ li $at, 8 /* 09DDEC 8009D1EC 24060002 */ li $a2, 2 @@ -266,8 +266,8 @@ glabel L8009D1DC /* 09DE0C 8009D20C 100000CB */ b .L8009D53C /* 09DE10 8009D210 AC8F0000 */ sw $t7, ($a0) glabel L8009D214 -/* 09DE14 8009D214 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f -/* 09DE18 8009D218 248486A0 */ addiu $a0, %lo(D_800E86A0) # addiu $a0, $a0, -0x7960 +/* 09DE14 8009D214 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f +/* 09DE18 8009D218 248486A0 */ addiu $a0, %lo(gMenuSelection) # addiu $a0, $a0, -0x7960 /* 09DE1C 8009D21C 8C980000 */ lw $t8, ($a0) /* 09DE20 8009D220 2719FFFF */ addiu $t9, $t8, -1 /* 09DE24 8009D224 100000C5 */ b .L8009D53C @@ -453,8 +453,8 @@ glabel L8009D414 /* 09E0D0 8009D4D0 1000001A */ b .L8009D53C /* 09E0D4 8009D4D4 A039EE0B */ sb $t9, %lo(gCupCourseSelection)($at) glabel L8009D4D8 -/* 09E0D8 8009D4D8 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f -/* 09E0DC 8009D4DC 248486A0 */ addiu $a0, %lo(D_800E86A0) # addiu $a0, $a0, -0x7960 +/* 09E0D8 8009D4D8 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f +/* 09E0DC 8009D4DC 248486A0 */ addiu $a0, %lo(gMenuSelection) # addiu $a0, $a0, -0x7960 /* 09E0E0 8009D4E0 8C830000 */ lw $v1, ($a0) /* 09E0E4 8009D4E4 24080006 */ li $t0, 6 /* 09E0E8 8009D4E8 2401000B */ li $at, 11 @@ -468,8 +468,8 @@ glabel L8009D4D8 /* 09E104 8009D504 1000000D */ b .L8009D53C /* 09E108 8009D508 AC8E0000 */ sw $t6, ($a0) glabel L8009D50C -/* 09E10C 8009D50C 3C04800F */ lui $a0, %hi(D_800E86A0) # $a0, 0x800f -/* 09E110 8009D510 248486A0 */ addiu $a0, %lo(D_800E86A0) # addiu $a0, $a0, -0x7960 +/* 09E10C 8009D50C 3C04800F */ lui $a0, %hi(gMenuSelection) # $a0, 0x800f +/* 09E110 8009D510 248486A0 */ addiu $a0, %lo(gMenuSelection) # addiu $a0, $a0, -0x7960 /* 09E114 8009D514 8C830000 */ lw $v1, ($a0) /* 09E118 8009D518 2401000B */ li $at, 11 /* 09E11C 8009D51C 240F000B */ li $t7, 11 @@ -484,11 +484,11 @@ glabel L8009D50C /* 09E13C 8009D53C 3C18800F */ lui $t8, %hi(D_800E86A4) # $t8, 0x800f /* 09E140 8009D540 8F1886A4 */ lw $t8, %lo(D_800E86A4)($t8) /* 09E144 8009D544 3C0C800E */ lui $t4, %hi(gModeSelection) # $t4, 0x800e -/* 09E148 8009D548 3C02800F */ lui $v0, %hi(D_800E86A0) # $v0, 0x800f +/* 09E148 8009D548 3C02800F */ lui $v0, %hi(gMenuSelection) # $v0, 0x800f /* 09E14C 8009D54C 258CC53C */ addiu $t4, %lo(gModeSelection) # addiu $t4, $t4, -0x3ac4 /* 09E150 8009D550 24050001 */ li $a1, 1 /* 09E154 8009D554 17000003 */ bnez $t8, .L8009D564 -/* 09E158 8009D558 8C4286A0 */ lw $v0, %lo(D_800E86A0)($v0) +/* 09E158 8009D558 8C4286A0 */ lw $v0, %lo(gMenuSelection)($v0) /* 09E15C 8009D55C 3C01800F */ lui $at, %hi(D_800E86A4) # $at, 0x800f /* 09E160 8009D560 AC2586A4 */ sw $a1, %lo(D_800E86A4)($at) .L8009D564: @@ -509,8 +509,8 @@ glabel L8009D50C /* 09E194 8009D594 10000075 */ b .L8009D76C /* 09E198 8009D598 A020EE0C */ sb $zero, %lo(D_8018EE0C)($at) .L8009D59C: -/* 09E19C 8009D59C 3C038019 */ lui $v1, %hi(D_8018EDFA) # $v1, 0x8019 -/* 09E1A0 8009D5A0 8063EDFA */ lb $v1, %lo(D_8018EDFA)($v1) +/* 09E19C 8009D59C 3C038019 */ lui $v1, %hi(gDebugGotoScene) # $v1, 0x8019 +/* 09E1A0 8009D5A0 8063EDFA */ lb $v1, %lo(gDebugGotoScene)($v1) /* 09E1A4 8009D5A4 24050001 */ li $a1, 1 /* 09E1A8 8009D5A8 24060002 */ li $a2, 2 /* 09E1AC 8009D5AC 10650008 */ beq $v1, $a1, .L8009D5D0 @@ -528,10 +528,10 @@ glabel L8009D50C .L8009D5D8: /* 09E1D8 8009D5D8 3C01800E */ lui $at, %hi(D_800DC524) # $at, 0x800e /* 09E1DC 8009D5DC AC2EC524 */ sw $t6, %lo(D_800DC524)($at) -/* 09E1E0 8009D5E0 3C01800E */ lui $at, %hi(D_800DC644) # $at, 0x800e +/* 09E1E0 8009D5E0 3C01800E */ lui $at, %hi(gCreditsCourseId) # $at, 0x800e /* 09E1E4 8009D5E4 240F0008 */ li $t7, 8 /* 09E1E8 8009D5E8 10000008 */ b .L8009D60C -/* 09E1EC 8009D5EC A42FC644 */ sh $t7, %lo(D_800DC644)($at) +/* 09E1EC 8009D5EC A42FC644 */ sh $t7, %lo(gCreditsCourseId)($at) .L8009D5F0: /* 09E1F0 8009D5F0 3C01800E */ lui $at, %hi(D_800DC524) # $at, 0x800e /* 09E1F4 8009D5F4 AC29C524 */ sw $t1, %lo(D_800DC524)($at) @@ -608,8 +608,8 @@ glabel L8009D50C /* 09E2F4 8009D6F4 A0590000 */ sb $t9, ($v0) /* 09E2F8 8009D6F8 804E0000 */ lb $t6, ($v0) /* 09E2FC 8009D6FC 3C0F800F */ lui $t7, %hi(gPerCupIndexByCourseId) -/* 09E300 8009D700 3C038019 */ lui $v1, %hi(D_8018EDFA) # $v1, 0x8019 -/* 09E304 8009D704 8063EDFA */ lb $v1, %lo(D_8018EDFA)($v1) +/* 09E300 8009D700 3C038019 */ lui $v1, %hi(gDebugGotoScene) # $v1, 0x8019 +/* 09E304 8009D704 8063EDFA */ lb $v1, %lo(gDebugGotoScene)($v1) /* 09E308 8009D708 3C01800E */ lui $at, %hi(D_800DC540) # $at, 0x800e /* 09E30C 8009D70C 01E47821 */ addu $t7, $t7, $a0 /* 09E310 8009D710 81EFFD50 */ lb $t7, %lo(gPerCupIndexByCourseId)($t7) diff --git a/asm/non_matchings/code_800AF9B0/func_800B0350.s b/asm/non_matchings/code_800AF9B0/func_800B0350.s index c839dc2a7..d0bb45c25 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B0350.s +++ b/asm/non_matchings/code_800AF9B0/func_800B0350.s @@ -7,10 +7,10 @@ glabel func_800B0350 /* 0B0F64 800B0364 AFB1001C */ sw $s1, 0x1c($sp) /* 0B0F68 800B0368 15C0006E */ bnez $t6, .L800B0524 /* 0B0F6C 800B036C AFB00018 */ sw $s0, 0x18($sp) -/* 0B0F70 800B0370 3C12800F */ lui $s2, %hi(D_800E86A0) # $s2, 0x800f +/* 0B0F70 800B0370 3C12800F */ lui $s2, %hi(gMenuSelection) # $s2, 0x800f /* 0B0F74 800B0374 3C11800F */ lui $s1, %hi(gControllers) # $s1, 0x800f /* 0B0F78 800B0378 26316910 */ addiu $s1, %lo(gControllers) # addiu $s1, $s1, 0x6910 -/* 0B0F7C 800B037C 265286A0 */ addiu $s2, %lo(D_800E86A0) # addiu $s2, $s2, -0x7960 +/* 0B0F7C 800B037C 265286A0 */ addiu $s2, %lo(gMenuSelection) # addiu $s2, $s2, -0x7960 /* 0B0F80 800B0380 00008025 */ move $s0, $zero .L800B0384: /* 0B0F84 800B0384 0C02D148 */ jal func_800B4520 diff --git a/asm/non_matchings/code_800AF9B0/func_800B20F4.s b/asm/non_matchings/code_800AF9B0/func_800B20F4.s index c64cb26d2..aa919e0ee 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B20F4.s +++ b/asm/non_matchings/code_800AF9B0/func_800B20F4.s @@ -13,7 +13,7 @@ glabel func_800B20F4 /* 0B2D20 800B2120 0C02D148 */ jal func_800B4520 /* 0B2D24 800B2124 A7B9002E */ sh $t9, 0x2e($sp) /* 0B2D28 800B2128 144001E2 */ bnez $v0, .L800B28B4 -/* 0B2D2C 800B212C 3C0A8019 */ lui $t2, %hi(D_8018EDEF) # $t2, 0x8019 +/* 0B2D2C 800B212C 3C0A8019 */ lui $t2, %hi(gDebugMenuSelection) # $t2, 0x8019 /* 0B2D30 800B2130 16000005 */ bnez $s0, .L800B2148 /* 0B2D34 800B2134 3C028019 */ lui $v0, %hi(D_8018EE04) # $v0, 0x8019 /* 0B2D38 800B2138 2442EE04 */ addiu $v0, %lo(D_8018EE04) # addiu $v0, $v0, -0x11fc @@ -21,7 +21,7 @@ glabel func_800B20F4 /* 0B2D40 800B2140 25090001 */ addiu $t1, $t0, 1 /* 0B2D44 800B2144 AC490000 */ sw $t1, ($v0) .L800B2148: -/* 0B2D48 800B2148 814AEDEF */ lb $t2, %lo(D_8018EDEF)($t2) +/* 0B2D48 800B2148 814AEDEF */ lb $t2, %lo(gDebugMenuSelection)($t2) /* 0B2D4C 800B214C 3C028019 */ lui $v0, %hi(D_8018EE04) # $v0, 0x8019 /* 0B2D50 800B2150 2442EE04 */ addiu $v0, %lo(D_8018EE04) # addiu $v0, $v0, -0x11fc /* 0B2D54 800B2154 254BFFFF */ addiu $t3, $t2, -1 @@ -83,8 +83,8 @@ glabel L800B21CC /* 0B2E20 800B2220 0C032384 */ jal play_sound2 /* 0B2E24 800B2224 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B2E28 800B2228 24090003 */ li $t1, 3 -/* 0B2E2C 800B222C 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 -/* 0B2E30 800B2230 A029EDEF */ sb $t1, %lo(D_8018EDEF)($at) +/* 0B2E2C 800B222C 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 +/* 0B2E30 800B2230 A029EDEF */ sb $t1, %lo(gDebugMenuSelection)($at) .L800B2234: /* 0B2E34 800B2234 3C028019 */ lui $v0, %hi(D_8018EDF1) # $v0, 0x8019 /* 0B2E38 800B2238 1000014D */ b .L800B2770 @@ -135,9 +135,9 @@ glabel L800B2240 /* 0B2ED8 800B22D8 0C032384 */ jal play_sound2 /* 0B2EDC 800B22DC AFA30024 */ sw $v1, 0x24($sp) /* 0B2EE0 800B22E0 24180002 */ li $t8, 2 -/* 0B2EE4 800B22E4 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B2EE4 800B22E4 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B2EE8 800B22E8 8FA30024 */ lw $v1, 0x24($sp) -/* 0B2EEC 800B22EC A038EDEF */ sb $t8, %lo(D_8018EDEF)($at) +/* 0B2EEC 800B22EC A038EDEF */ sb $t8, %lo(gDebugMenuSelection)($at) .L800B22F0: /* 0B2EF0 800B22F0 30790400 */ andi $t9, $v1, 0x400 /* 0B2EF4 800B22F4 13200006 */ beqz $t9, .L800B2310 @@ -145,8 +145,8 @@ glabel L800B2240 /* 0B2EFC 800B22FC 0C032384 */ jal play_sound2 /* 0B2F00 800B2300 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B2F04 800B2304 24080004 */ li $t0, 4 -/* 0B2F08 800B2308 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 -/* 0B2F0C 800B230C A028EDEF */ sb $t0, %lo(D_8018EDEF)($at) +/* 0B2F08 800B2308 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 +/* 0B2F0C 800B230C A028EDEF */ sb $t0, %lo(gDebugMenuSelection)($at) .L800B2310: /* 0B2F10 800B2310 3C028019 */ lui $v0, %hi(D_8018EDF1) # $v0, 0x8019 /* 0B2F14 800B2314 10000116 */ b .L800B2770 @@ -198,9 +198,9 @@ glabel L800B231C /* 0B2FC0 800B23C0 30790800 */ andi $t9, $v1, 0x800 /* 0B2FC4 800B23C4 13200008 */ beqz $t9, .L800B23E8 /* 0B2FC8 800B23C8 24080003 */ li $t0, 3 -/* 0B2FCC 800B23CC 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B2FCC 800B23CC 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B2FD0 800B23D0 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B2FD4 800B23D4 A028EDEF */ sb $t0, %lo(D_8018EDEF)($at) +/* 0B2FD4 800B23D4 A028EDEF */ sb $t0, %lo(gDebugMenuSelection)($at) /* 0B2FD8 800B23D8 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B2FDC 800B23DC 0C032384 */ jal play_sound2 /* 0B2FE0 800B23E0 AFA30024 */ sw $v1, 0x24($sp) @@ -209,9 +209,9 @@ glabel L800B231C /* 0B2FE8 800B23E8 30690400 */ andi $t1, $v1, 0x400 /* 0B2FEC 800B23EC 11200006 */ beqz $t1, .L800B2408 /* 0B2FF0 800B23F0 240A0005 */ li $t2, 5 -/* 0B2FF4 800B23F4 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B2FF4 800B23F4 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B2FF8 800B23F8 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B2FFC 800B23FC A02AEDEF */ sb $t2, %lo(D_8018EDEF)($at) +/* 0B2FFC 800B23FC A02AEDEF */ sb $t2, %lo(gDebugMenuSelection)($at) /* 0B3000 800B2400 0C032384 */ jal play_sound2 /* 0B3004 800B2404 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 .L800B2408: @@ -253,9 +253,9 @@ glabel L800B2414 /* 0B3088 800B2488 306F0800 */ andi $t7, $v1, 0x800 /* 0B308C 800B248C 11E00008 */ beqz $t7, .L800B24B0 /* 0B3090 800B2490 24180004 */ li $t8, 4 -/* 0B3094 800B2494 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B3094 800B2494 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B3098 800B2498 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B309C 800B249C A038EDEF */ sb $t8, %lo(D_8018EDEF)($at) +/* 0B309C 800B249C A038EDEF */ sb $t8, %lo(gDebugMenuSelection)($at) /* 0B30A0 800B24A0 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B30A4 800B24A4 0C032384 */ jal play_sound2 /* 0B30A8 800B24A8 AFA30024 */ sw $v1, 0x24($sp) @@ -264,9 +264,9 @@ glabel L800B2414 /* 0B30B0 800B24B0 30790400 */ andi $t9, $v1, 0x400 /* 0B30B4 800B24B4 13200006 */ beqz $t9, .L800B24D0 /* 0B30B8 800B24B8 24080006 */ li $t0, 6 -/* 0B30BC 800B24BC 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B30BC 800B24BC 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B30C0 800B24C0 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B30C4 800B24C4 A028EDEF */ sb $t0, %lo(D_8018EDEF)($at) +/* 0B30C4 800B24C4 A028EDEF */ sb $t0, %lo(gDebugMenuSelection)($at) /* 0B30C8 800B24C8 0C032384 */ jal play_sound2 /* 0B30CC 800B24CC 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 .L800B24D0: @@ -334,9 +334,9 @@ glabel L800B24DC /* 0B31B0 800B25B0 30690800 */ andi $t1, $v1, 0x800 /* 0B31B4 800B25B4 11200008 */ beqz $t1, .L800B25D8 /* 0B31B8 800B25B8 240A0005 */ li $t2, 5 -/* 0B31BC 800B25BC 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B31BC 800B25BC 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B31C0 800B25C0 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B31C4 800B25C4 A02AEDEF */ sb $t2, %lo(D_8018EDEF)($at) +/* 0B31C4 800B25C4 A02AEDEF */ sb $t2, %lo(gDebugMenuSelection)($at) /* 0B31C8 800B25C8 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B31CC 800B25CC 0C032384 */ jal play_sound2 /* 0B31D0 800B25D0 AFA30024 */ sw $v1, 0x24($sp) @@ -345,9 +345,9 @@ glabel L800B24DC /* 0B31D8 800B25D8 306B0400 */ andi $t3, $v1, 0x400 /* 0B31DC 800B25DC 11600006 */ beqz $t3, .L800B25F8 /* 0B31E0 800B25E0 240C0007 */ li $t4, 7 -/* 0B31E4 800B25E4 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B31E4 800B25E4 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B31E8 800B25E8 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B31EC 800B25EC A02CEDEF */ sb $t4, %lo(D_8018EDEF)($at) +/* 0B31EC 800B25EC A02CEDEF */ sb $t4, %lo(gDebugMenuSelection)($at) /* 0B31F0 800B25F0 0C032384 */ jal play_sound2 /* 0B31F4 800B25F4 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 .L800B25F8: @@ -357,11 +357,11 @@ glabel L800B24DC glabel L800B2604 /* 0B3204 800B2604 97A3002E */ lhu $v1, 0x2e($sp) /* 0B3208 800B2608 240E0006 */ li $t6, 6 -/* 0B320C 800B260C 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B320C 800B260C 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B3210 800B2610 306D0800 */ andi $t5, $v1, 0x800 /* 0B3214 800B2614 11A00006 */ beqz $t5, .L800B2630 /* 0B3218 800B2618 3C044900 */ lui $a0, (0x49008000 >> 16) # lui $a0, 0x4900 -/* 0B321C 800B261C A02EEDEF */ sb $t6, %lo(D_8018EDEF)($at) +/* 0B321C 800B261C A02EEDEF */ sb $t6, %lo(gDebugMenuSelection)($at) /* 0B3220 800B2620 34848000 */ ori $a0, (0x49008000 & 0xFFFF) # ori $a0, $a0, 0x8000 /* 0B3224 800B2624 0C032384 */ jal play_sound2 /* 0B3228 800B2628 AFA30024 */ sw $v1, 0x24($sp) @@ -481,8 +481,8 @@ glabel L800B2604 /* 0B33B8 800B27B8 24040019 */ li $a0, 25 /* 0B33BC 800B27BC 8FA20030 */ lw $v0, 0x30($sp) /* 0B33C0 800B27C0 24180040 */ li $t8, 64 -/* 0B33C4 800B27C4 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 -/* 0B33C8 800B27C8 A038EDEF */ sb $t8, %lo(D_8018EDEF)($at) +/* 0B33C4 800B27C4 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 +/* 0B33C8 800B27C8 A038EDEF */ sb $t8, %lo(gDebugMenuSelection)($at) /* 0B33CC 800B27CC 94590004 */ lhu $t9, 4($v0) /* 0B33D0 800B27D0 8FA30024 */ lw $v1, 0x24($sp) /* 0B33D4 800B27D4 3C01800E */ lui $at, %hi(D_800DC51C) # 0x800e @@ -504,12 +504,12 @@ glabel L800B2604 /* 0B340C 800B280C 11800005 */ beqz $t4, .L800B2824 /* 0B3410 800B2810 240E0003 */ li $t6, 3 /* 0B3414 800B2814 240D0001 */ li $t5, 1 -/* 0B3418 800B2818 3C018019 */ lui $at, %hi(D_8018EDFA) # $at, 0x8019 +/* 0B3418 800B2818 3C018019 */ lui $at, %hi(gDebugGotoScene) # $at, 0x8019 /* 0B341C 800B281C 10000003 */ b .L800B282C -/* 0B3420 800B2820 A02DEDFA */ sb $t5, %lo(D_8018EDFA)($at) +/* 0B3420 800B2820 A02DEDFA */ sb $t5, %lo(gDebugGotoScene)($at) .L800B2824: -/* 0B3424 800B2824 3C018019 */ lui $at, %hi(D_8018EDFA) # $at, 0x8019 -/* 0B3428 800B2828 A02EEDFA */ sb $t6, %lo(D_8018EDFA)($at) +/* 0B3424 800B2824 3C018019 */ lui $at, %hi(gDebugGotoScene) # $at, 0x8019 +/* 0B3428 800B2828 A02EEDFA */ sb $t6, %lo(gDebugGotoScene)($at) .L800B282C: /* 0B342C 800B282C 0C032384 */ jal play_sound2 /* 0B3430 800B2830 34848016 */ ori $a0, (0x49008016 & 0xFFFF) # ori $a0, $a0, 0x8016 @@ -528,12 +528,12 @@ glabel L800B2604 /* 0B3460 800B2860 0C0328CC */ jal func_800CA330 /* 0B3464 800B2864 24040019 */ li $a0, 25 /* 0B3468 800B2868 24090040 */ li $t1, 64 -/* 0B346C 800B286C 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 -/* 0B3470 800B2870 A029EDEF */ sb $t1, %lo(D_8018EDEF)($at) -/* 0B3474 800B2874 3C018019 */ lui $at, %hi(D_8018EDFA) # $at, 0x8019 +/* 0B346C 800B286C 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 +/* 0B3470 800B2870 A029EDEF */ sb $t1, %lo(gDebugMenuSelection)($at) +/* 0B3474 800B2874 3C018019 */ lui $at, %hi(gDebugGotoScene) # $at, 0x8019 /* 0B3478 800B2878 240A0002 */ li $t2, 2 /* 0B347C 800B287C 3C044900 */ lui $a0, (0x49008016 >> 16) # lui $a0, 0x4900 -/* 0B3480 800B2880 A02AEDFA */ sb $t2, %lo(D_8018EDFA)($at) +/* 0B3480 800B2880 A02AEDFA */ sb $t2, %lo(gDebugGotoScene)($at) /* 0B3484 800B2884 0C032384 */ jal play_sound2 /* 0B3488 800B2888 34848016 */ ori $a0, (0x49008016 & 0xFFFF) # ori $a0, $a0, 0x8016 /* 0B348C 800B288C 1000000A */ b .L800B28B8 @@ -543,9 +543,9 @@ glabel L800B2604 .L800B2898: /* 0B3498 800B2898 11600006 */ beqz $t3, .L800B28B4 /* 0B349C 800B289C 240C0001 */ li $t4, 1 -/* 0B34A0 800B28A0 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 +/* 0B34A0 800B28A0 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 /* 0B34A4 800B28A4 3C044900 */ lui $a0, (0x49008001 >> 16) # lui $a0, 0x4900 -/* 0B34A8 800B28A8 A02CEDEF */ sb $t4, %lo(D_8018EDEF)($at) +/* 0B34A8 800B28A8 A02CEDEF */ sb $t4, %lo(gDebugMenuSelection)($at) /* 0B34AC 800B28AC 0C032384 */ jal play_sound2 /* 0B34B0 800B28B0 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 .L800B28B4: diff --git a/asm/non_matchings/code_800AF9B0/func_800B29D8.s b/asm/non_matchings/code_800AF9B0/func_800B29D8.s index 3319c25af..fe634e643 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B29D8.s +++ b/asm/non_matchings/code_800AF9B0/func_800B29D8.s @@ -368,9 +368,9 @@ glabel L800B2D30 /* 0B3B2C 800B2F2C 000C6080 */ sll $t4, $t4, 2 /* 0B3B30 800B2F30 000DC080 */ sll $t8, $t5, 2 /* 0B3B34 800B2F34 01987021 */ addu $t6, $t4, $t8 -/* 0B3B38 800B2F38 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 +/* 0B3B38 800B2F38 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 /* 0B3B3C 800B2F3C 006E1821 */ addu $v1, $v1, $t6 -/* 0B3B40 800B2F40 AC20EE00 */ sw $zero, %lo(D_8018EE00)($at) +/* 0B3B40 800B2F40 AC20EE00 */ sw $zero, %lo(gStartMenuCounterForDemos)($at) /* 0B3B44 800B2F44 10000162 */ b .L800B34D0 /* 0B3B48 800B2F48 8C632B70 */ lw $v1, %lo(D_800F2B70)($v1) # 0x2b70($v1) .L800B2F4C: @@ -386,12 +386,12 @@ glabel L800B2D30 glabel L800B2F70 /* 0B3B70 800B2F70 14A00023 */ bnez $a1, .L800B3000 /* 0B3B74 800B2F74 00603025 */ move $a2, $v1 -/* 0B3B78 800B2F78 3C0A8019 */ lui $t2, %hi(D_8018EE00) # $t2, 0x8019 -/* 0B3B7C 800B2F7C 8D4AEE00 */ lw $t2, %lo(D_8018EE00)($t2) -/* 0B3B80 800B2F80 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 +/* 0B3B78 800B2F78 3C0A8019 */ lui $t2, %hi(gStartMenuCounterForDemos) # $t2, 0x8019 +/* 0B3B7C 800B2F7C 8D4AEE00 */ lw $t2, %lo(gStartMenuCounterForDemos)($t2) +/* 0B3B80 800B2F80 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 /* 0B3B84 800B2F84 3C028019 */ lui $v0, %hi(D_8018EDF3) # $v0, 0x8019 /* 0B3B88 800B2F88 254F0001 */ addiu $t7, $t2, 1 -/* 0B3B8C 800B2F8C AC2FEE00 */ sw $t7, %lo(D_8018EE00)($at) +/* 0B3B8C 800B2F8C AC2FEE00 */ sw $t7, %lo(gStartMenuCounterForDemos)($at) /* 0B3B90 800B2F90 24010064 */ li $at, 100 /* 0B3B94 800B2F94 11E10005 */ beq $t7, $at, .L800B2FAC /* 0B3B98 800B2F98 2401012C */ li $at, 300 @@ -579,8 +579,8 @@ glabel L800B2F70 /* 0B3E48 800B3248 A02AEDED */ sb $t2, %lo(D_8018EDED)($at) /* 0B3E4C 800B324C 0C032384 */ jal play_sound2 /* 0B3E50 800B3250 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 -/* 0B3E54 800B3254 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 -/* 0B3E58 800B3258 AC20EE00 */ sw $zero, %lo(D_8018EE00)($at) +/* 0B3E54 800B3254 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 +/* 0B3E58 800B3258 AC20EE00 */ sw $zero, %lo(gStartMenuCounterForDemos)($at) .L800B325C: /* 0B3E5C 800B325C 3C0F8019 */ lui $t7, %hi(D_8018EDF3) # $t7, 0x8019 /* 0B3E60 800B3260 81EFEDF3 */ lb $t7, %lo(D_8018EDF3)($t7) @@ -608,12 +608,12 @@ glabel L800B2F70 glabel L800B32B4 /* 0B3EB4 800B32B4 14A00014 */ bnez $a1, .L800B3308 /* 0B3EB8 800B32B8 00603025 */ move $a2, $v1 -/* 0B3EBC 800B32BC 3C0A8019 */ lui $t2, %hi(D_8018EE00) # $t2, 0x8019 -/* 0B3EC0 800B32C0 8D4AEE00 */ lw $t2, %lo(D_8018EE00)($t2) -/* 0B3EC4 800B32C4 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 +/* 0B3EBC 800B32BC 3C0A8019 */ lui $t2, %hi(gStartMenuCounterForDemos) # $t2, 0x8019 +/* 0B3EC0 800B32C0 8D4AEE00 */ lw $t2, %lo(gStartMenuCounterForDemos)($t2) +/* 0B3EC4 800B32C4 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 /* 0B3EC8 800B32C8 3C044900 */ lui $a0, (0x4900900F >> 16) # lui $a0, 0x4900 /* 0B3ECC 800B32CC 254F0001 */ addiu $t7, $t2, 1 -/* 0B3ED0 800B32D0 AC2FEE00 */ sw $t7, %lo(D_8018EE00)($at) +/* 0B3ED0 800B32D0 AC2FEE00 */ sw $t7, %lo(gStartMenuCounterForDemos)($at) /* 0B3ED4 800B32D4 2401003C */ li $at, 60 /* 0B3ED8 800B32D8 11E10006 */ beq $t7, $at, .L800B32F4 /* 0B3EDC 800B32DC 3484900F */ ori $a0, (0x4900900F & 0xFFFF) # ori $a0, $a0, 0x900f @@ -680,9 +680,9 @@ glabel L800B32B4 /* 0B3FB8 800B33B8 000C6080 */ sll $t4, $t4, 2 /* 0B3FBC 800B33BC 000D7080 */ sll $t6, $t5, 2 /* 0B3FC0 800B33C0 018EC021 */ addu $t8, $t4, $t6 -/* 0B3FC4 800B33C4 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 +/* 0B3FC4 800B33C4 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 /* 0B3FC8 800B33C8 00781821 */ addu $v1, $v1, $t8 -/* 0B3FCC 800B33CC AC20EE00 */ sw $zero, %lo(D_8018EE00)($at) +/* 0B3FCC 800B33CC AC20EE00 */ sw $zero, %lo(gStartMenuCounterForDemos)($at) /* 0B3FD0 800B33D0 1000003F */ b .L800B34D0 /* 0B3FD4 800B33D4 8C632B70 */ lw $v1, %lo(D_800F2B70)($v1) # 0x2b70($v1) .L800B33D8: diff --git a/asm/non_matchings/code_800AF9B0/func_800B3554.s b/asm/non_matchings/code_800AF9B0/func_800B3554.s index f5d1f6217..bda0d4c3a 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B3554.s +++ b/asm/non_matchings/code_800AF9B0/func_800B3554.s @@ -138,8 +138,8 @@ glabel func_800B3554 /* 0B4348 800B3748 AFA6002C */ sw $a2, 0x2c($sp) /* 0B434C 800B374C 0C02D12B */ jal func_800B44AC /* 0B4350 800B3750 AFA70020 */ sw $a3, 0x20($sp) -/* 0B4354 800B3754 3C038019 */ lui $v1, %hi(D_8018EE00) # $v1, 0x8019 -/* 0B4358 800B3758 2463EE00 */ addiu $v1, %lo(D_8018EE00) # addiu $v1, $v1, -0x1200 +/* 0B4354 800B3754 3C038019 */ lui $v1, %hi(gStartMenuCounterForDemos) # $v1, 0x8019 +/* 0B4358 800B3758 2463EE00 */ addiu $v1, %lo(gStartMenuCounterForDemos) # addiu $v1, $v1, -0x1200 /* 0B435C 800B375C 8FA6002C */ lw $a2, 0x2c($sp) /* 0B4360 800B3760 8FA70020 */ lw $a3, 0x20($sp) /* 0B4364 800B3764 AC600000 */ sw $zero, ($v1) @@ -353,8 +353,8 @@ glabel func_800B3554 .L800B3A5C: /* 0B465C 800B3A5C 15200011 */ bnez $t1, .L800B3AA4 /* 0B4660 800B3A60 00603025 */ move $a2, $v1 -/* 0B4664 800B3A64 3C038019 */ lui $v1, %hi(D_8018EE00) # $v1, 0x8019 -/* 0B4668 800B3A68 2463EE00 */ addiu $v1, %lo(D_8018EE00) # addiu $v1, $v1, -0x1200 +/* 0B4664 800B3A64 3C038019 */ lui $v1, %hi(gStartMenuCounterForDemos) # $v1, 0x8019 +/* 0B4668 800B3A68 2463EE00 */ addiu $v1, %lo(gStartMenuCounterForDemos) # addiu $v1, $v1, -0x1200 /* 0B466C 800B3A6C 8C6A0000 */ lw $t2, ($v1) /* 0B4670 800B3A70 2401003C */ li $at, 60 /* 0B4674 800B3A74 3C044900 */ lui $a0, (0x4900900F >> 16) # lui $a0, 0x4900 diff --git a/asm/non_matchings/code_800AF9B0/func_800B3B58.s b/asm/non_matchings/code_800AF9B0/func_800B3B58.s index b53ab6664..df3e109a9 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B3B58.s +++ b/asm/non_matchings/code_800AF9B0/func_800B3B58.s @@ -123,12 +123,12 @@ glabel func_800B3B58 /* 0B4924 800B3D24 3C0F8019 */ lui $t7, %hi(gCupSelection) # $t7, 0x8019 /* 0B4928 800B3D28 81EFEE09 */ lb $t7, %lo(gCupSelection)($t7) /* 0B492C 800B3D2C 3C18800F */ lui $t8, %hi(gCupCourseOrder) # 0x800f -/* 0B4930 800B3D30 3C048019 */ lui $a0, %hi(D_8018EE00) # $a0, 0x8019 +/* 0B4930 800B3D30 3C048019 */ lui $a0, %hi(gStartMenuCounterForDemos) # $a0, 0x8019 /* 0B4934 800B3D34 000F70C0 */ sll $t6, $t7, 3 /* 0B4938 800B3D38 030EC021 */ addu $t8, $t8, $t6 /* 0B493C 800B3D3C 87182BB4 */ lh $t8, %lo(gCupCourseOrder)($t8) # 0x2bb4($t8) /* 0B4940 800B3D40 3C01800E */ lui $at, %hi(gCurrentCourseId) # $at, 0x800e -/* 0B4944 800B3D44 2484EE00 */ addiu $a0, %lo(D_8018EE00) # addiu $a0, $a0, -0x1200 +/* 0B4944 800B3D44 2484EE00 */ addiu $a0, %lo(gStartMenuCounterForDemos) # addiu $a0, $a0, -0x1200 /* 0B4948 800B3D48 A438C5A0 */ sh $t8, %lo(gCurrentCourseId)($at) /* 0B494C 800B3D4C AC800000 */ sw $zero, ($a0) .L800B3D50: @@ -214,15 +214,15 @@ glabel func_800B3B58 /* 0B4A74 800B3E74 34848001 */ ori $a0, (0x49008001 & 0xFFFF) # ori $a0, $a0, 0x8001 /* 0B4A78 800B3E78 0C02D12B */ jal func_800B44AC /* 0B4A7C 800B3E7C 00000000 */ nop -/* 0B4A80 800B3E80 3C048019 */ lui $a0, %hi(D_8018EE00) # $a0, 0x8019 -/* 0B4A84 800B3E84 2484EE00 */ addiu $a0, %lo(D_8018EE00) # addiu $a0, $a0, -0x1200 +/* 0B4A80 800B3E80 3C048019 */ lui $a0, %hi(gStartMenuCounterForDemos) # $a0, 0x8019 +/* 0B4A84 800B3E84 2484EE00 */ addiu $a0, %lo(gStartMenuCounterForDemos) # addiu $a0, $a0, -0x1200 /* 0B4A88 800B3E88 10000036 */ b .L800B3F64 /* 0B4A8C 800B3E8C AC800000 */ sw $zero, ($a0) .L800B3E90: /* 0B4A90 800B3E90 15600013 */ bnez $t3, .L800B3EE0 /* 0B4A94 800B3E94 00C01825 */ move $v1, $a2 -/* 0B4A98 800B3E98 3C048019 */ lui $a0, %hi(D_8018EE00) # $a0, 0x8019 -/* 0B4A9C 800B3E9C 2484EE00 */ addiu $a0, %lo(D_8018EE00) # addiu $a0, $a0, -0x1200 +/* 0B4A98 800B3E98 3C048019 */ lui $a0, %hi(gStartMenuCounterForDemos) # $a0, 0x8019 +/* 0B4A9C 800B3E9C 2484EE00 */ addiu $a0, %lo(gStartMenuCounterForDemos) # addiu $a0, $a0, -0x1200 /* 0B4AA0 800B3EA0 8C8C0000 */ lw $t4, ($a0) /* 0B4AA4 800B3EA4 2401003C */ li $at, 60 /* 0B4AA8 800B3EA8 258D0001 */ addiu $t5, $t4, 1 diff --git a/asm/non_matchings/code_800AF9B0/func_800B3F74.s b/asm/non_matchings/code_800AF9B0/func_800B3F74.s index 25e2d2285..e5d0a220d 100644 --- a/asm/non_matchings/code_800AF9B0/func_800B3F74.s +++ b/asm/non_matchings/code_800AF9B0/func_800B3F74.s @@ -1,9 +1,9 @@ glabel func_800B3F74 /* 0B4B74 800B3F74 24030001 */ li $v1, 1 -/* 0B4B78 800B3F78 3C018019 */ lui $at, %hi(D_8018EDEF) # $at, 0x8019 -/* 0B4B7C 800B3F7C A023EDEF */ sb $v1, %lo(D_8018EDEF)($at) -/* 0B4B80 800B3F80 3C018019 */ lui $at, %hi(D_8018EE00) # $at, 0x8019 -/* 0B4B84 800B3F84 AC20EE00 */ sw $zero, %lo(D_8018EE00)($at) +/* 0B4B78 800B3F78 3C018019 */ lui $at, %hi(gDebugMenuSelection) # $at, 0x8019 +/* 0B4B7C 800B3F7C A023EDEF */ sb $v1, %lo(gDebugMenuSelection)($at) +/* 0B4B80 800B3F80 3C018019 */ lui $at, %hi(gStartMenuCounterForDemos) # $at, 0x8019 +/* 0B4B84 800B3F84 AC20EE00 */ sw $zero, %lo(gStartMenuCounterForDemos)($at) /* 0B4B88 800B3F88 3C018019 */ lui $at, %hi(D_8018EE04) # $at, 0x8019 /* 0B4B8C 800B3F8C AC20EE04 */ sw $zero, %lo(D_8018EE04)($at) /* 0B4B90 800B3F90 3C018019 */ lui $at, %hi(D_8018EE08) # $at, 0x8019 @@ -12,8 +12,8 @@ glabel func_800B3F74 /* 0B4B9C 800B3F9C A420F890 */ sh $zero, %lo(D_8015F890)($at) /* 0B4BA0 800B3FA0 3C018016 */ lui $at, %hi(D_8015F892) # $at, 0x8016 /* 0B4BA4 800B3FA4 A420F892 */ sh $zero, %lo(D_8015F892)($at) -/* 0B4BA8 800B3FA8 3C018019 */ lui $at, %hi(D_8018EDFA) # $at, 0x8019 -/* 0B4BAC 800B3FAC A020EDFA */ sb $zero, %lo(D_8018EDFA)($at) +/* 0B4BA8 800B3FA8 3C018019 */ lui $at, %hi(gDebugGotoScene) # $at, 0x8019 +/* 0B4BAC 800B3FAC A020EDFA */ sb $zero, %lo(gDebugGotoScene)($at) /* 0B4BB0 800B3FB0 3C018019 */ lui $at, %hi(D_8018EDFB) # $at, 0x8019 /* 0B4BB4 800B3FB4 A020EDFB */ sb $zero, %lo(D_8018EDFB)($at) /* 0B4BB8 800B3FB8 3C018016 */ lui $at, %hi(D_8016556E) # $at, 0x8016 diff --git a/data/data_0DD0A0.s b/data/data_0DD0A0.s index b4ad8e181..d24d4632a 100644 --- a/data/data_0DD0A0.s +++ b/data/data_0DD0A0.s @@ -29,10 +29,10 @@ glabel D_800DC5B8 glabel D_800DC5BC .hword 0x0000, 0x0000 -glabel D_800DC5C0 +glabel gIsInQuitToMenuTransition .hword 0x0000, 0x0000 -glabel D_800DC5C4 +glabel gQuitToMenuTransitionCounter .hword 0x0000, 0x0000 glabel D_800DC5C8 diff --git a/data/data_0DD0A0_0.s b/data/data_0DD0A0_0.s index a8528f6ce..5b502a3a9 100644 --- a/data/data_0DD0A0_0.s +++ b/data/data_0DD0A0_0.s @@ -26,7 +26,7 @@ #.word 0xffffff00, 0xffffff00, 0x00007800, 0x00000000 #.word 0x80000000 -#glabel D_800DC644 +#glabel gCreditsCourseId #.hword 0x0008, 0x0000 #glabel D_800DC648 diff --git a/data/data_0DD0A0_2.s b/data/data_0DD0A0_2.s index 79b7edd25..db5ac4cb8 100644 --- a/data/data_0DD0A0_2.s +++ b/data/data_0DD0A0_2.s @@ -2279,7 +2279,7 @@ glabel D_800E8688 .word 0x28281400 # light brightness (stops) .word 0x00000000, 0x00000000, 0x00000000 -glabel D_800E86A0 # menu counter +glabel gMenuSelection # menu counter .word 0x00000008 glabel D_800E86A4 # on change menu? diff --git a/include/defines.h b/include/defines.h index f48a6e253..6b099f550 100644 --- a/include/defines.h +++ b/include/defines.h @@ -70,6 +70,51 @@ #define PEACH 6 #define BOWSER 7 +/** + * Options for gMenuSelection +**/ +#define OPTIONS_MENU 5 +#define DATA_MENU 6 +#define COURSE_DATA_MENU 7 +#define LOGO_INTRO_MENU 8 +#define CONTROLLER_PAK_MENU 9 +#define START_MENU 10 +#define GAME_SELECT_MENU 11 +#define PLAYER_SELECT_MENU 12 +#define COURSE_SELECT_MENU 13 +#define RACING_DUPLICATE 14 + +/** + * Options for gMenuSelectionFromQuit and gMenuSelectionFromEndingSequence +**/ +#define START_MENU_FROM_QUIT 0 +#define GAME_SELECT_MENU_FROM_QUIT 1 +#define PLAYER_SELECT_MENU_FROM_QUIT 2 +#define COURSE_SELECT_MENU_FROM_QUIT 3 +#define RACING 4 +#define ENDING_SEQUENCE 5 +#define CREDITS_SEQUENCE 9 + +/** + * Options for gStartMenuDebugRowSelection + */ +#define DEBUG_MENU_DISABLED 1 +#define DEBUG_MENU_DEBUG_MODE 2 +#define DEBUG_MENU_COURSE 3 +#define DEBUG_MENU_SCREEN_MODE 4 +#define DEBUG_MENU_PLAYER 5 +#define DEBUG_MENU_SOUND_MODE 6 +#define DEBUG_MENU_GIVE_ALL_GOLD_CUP 7 +#define DEBUG_MENU_EXITED 64 + +/** + * Options for gDebugGotoScene + */ +#define DEBUG_GOTO_RACING 0 +#define DEBUG_GOTO_ENDING_SEQUENCE 1 +#define DEBUG_GOTO_CREDITS_SEQUENCE_CC_50 2 +#define DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA 3 + /** * Indexes for accessing Time Trial records **/ diff --git a/include/variables.h b/include/variables.h index fdc018153..11ae08d14 100644 --- a/include/variables.h +++ b/include/variables.h @@ -69,7 +69,7 @@ extern Player* D_800DC4F4; extern Player* D_800DC4F8; extern Player* D_800DC4FC; extern u16 D_800DC51C; -extern s8 D_8018EDEF; +extern s8 gDebugMenuSelection; //D_8018EDEF extern s32 D_80164A28; extern s32 D_801643B8[]; extern s16 D_8016556E; diff --git a/src/code_800029B0.c b/src/code_800029B0.c index 99145952e..f6569a4a2 100644 --- a/src/code_800029B0.c +++ b/src/code_800029B0.c @@ -110,7 +110,7 @@ Lights1 D_800DC610[] = { }, }; static s32 pad = 0x80000000; -s16 D_800DC644 = 8; +s16 gCreditsCourseId = COURSE_LUIGI_RACEWAY; s16 D_800DC648 = 1; void func_800029B0(void) { @@ -132,7 +132,7 @@ void func_80002A18(void) { int tmp; gPlayerCountSelection1 = D_8018EDF3; - if (D_800DC50C != 4) { + if (D_800DC50C != RACING) { gIsMirrorMode = 0; } if (gIsMirrorMode != 0) { diff --git a/src/code_8001F980.c b/src/code_8001F980.c index 7c9e4bc59..1298bd10a 100644 --- a/src/code_8001F980.c +++ b/src/code_8001F980.c @@ -854,7 +854,7 @@ void func_80021B0C(void) { func_8006E7CC(D_800DC4F4, 6, 0); func_8006E7CC(D_800DC4F8, 7, 0); } - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { temp_a0 = D_800DC4DC; if ((temp_a0->unk_044 & 0x2000) != 0) { func_80024374(temp_a0, 0, 0); diff --git a/src/code_80027D00.c b/src/code_80027D00.c index 24837c6f1..53ad862dd 100644 --- a/src/code_80027D00.c +++ b/src/code_80027D00.c @@ -737,7 +737,7 @@ void func_80028E70(void *arg0, s32 arg1, s8 arg2, s8 arg3) { temp_v0 = arg0->unk0; if ((temp_v0 & 0x8000) == 0x8000) { - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { if ((temp_v0 & 0x2000) == 0) { func_80038C6C(arg3, arg2); return; diff --git a/src/code_800393C0.c b/src/code_800393C0.c index a50c7c7e3..340a4b2d7 100644 --- a/src/code_800393C0.c +++ b/src/code_800393C0.c @@ -303,7 +303,7 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4, void func_80039AE4(void) { switch (D_800DC52C) { case 0: - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { D_80165578 = 0x898; D_8016557A = 0; D_8016557C = 0x384; @@ -408,7 +408,7 @@ void func_80039DA4(void) { if (((gCupCourseSelection == CUP_COURSE_ONE) && (D_8016556E == 0)) || (D_800DC51C == 1) || - (D_8018EDEF == 0x40)) { + (gDebugMenuSelection == DEBUG_MENU_EXITED)) { for (i = 0; i < 8; i++) { D_80165270[i] = sp2C.unk00[i]; } @@ -423,7 +423,7 @@ void func_80039F44(f32 *arg0, f32 *arg1, f32 arg2) { func_80039DA4(); if (((gCupCourseSelection == CUP_COURSE_ONE) && (D_8016556E == 0)) || (D_800DC51C == 1) || - (D_8018EDEF == 0x40)) { + (gDebugMenuSelection == DEBUG_MENU_EXITED)) { s16 rand; s16 i; @@ -509,7 +509,7 @@ void func_8003A59C(f32 *arg0, f32 *arg1, f32 arg2) { void func_8003A9F0(f32* arg0, f32* arg1, f32 arg2) { func_80039DA4(); - if ((gCupCourseSelection == CUP_COURSE_ONE) || (D_800DC51C == 1) || (D_8018EDEF == 0x40)) { + if ((gCupCourseSelection == CUP_COURSE_ONE) || (D_800DC51C == 1) || (gDebugMenuSelection == DEBUG_MENU_EXITED)) { s16 rand; s16 i; @@ -1078,7 +1078,7 @@ void func_8003D080(void) { Player* ptr; func_8005D290(); - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { func_8003CD78(); } else { func_8003C0F0(); diff --git a/src/code_800431B0.c b/src/code_800431B0.c index 7b89c437d..c629347ac 100644 --- a/src/code_800431B0.c +++ b/src/code_800431B0.c @@ -8104,7 +8104,7 @@ void func_80053870(s32 arg0) { do { temp_s1_2 = *phi_s0_2; temp_v0 = (&D_80165C18 + (temp_s1_2 * 0xE0))->unkDF; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { temp_v0_2 = *(&D_8018CF68 + (arg0 * 2)); if ((temp_v0_2 >= (temp_v0 - 1)) && ((temp_v0 + 1) >= temp_v0_2) && (func_8008A140(temp_s1_2, sp84, 0x8000) != 0)) { func_800536C8(temp_s1_2); @@ -9501,7 +9501,7 @@ void func_80055E68(s32 arg0) { s32 temp_s0; temp_s0 = D_80183EA0; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_8008A1D0(temp_s0, arg0, 0x5DC, 0xBB8); if (func_8007223C(temp_s0, 0x40000) != 0) { func_80055CCC(temp_s0, arg0); @@ -10092,7 +10092,7 @@ void func_80057114(s32 arg0) { s32 phi_s2_2; phi_fp = arg0; - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { phi_fp = 0; } temp_s7 = (phi_fp * 0xB8) + camera1; @@ -10103,7 +10103,7 @@ void func_80057114(s32 arg0) { temp_s0 = *phi_s1; if (func_8007223C(temp_s0, 0x200000) != 0) { (&D_80163DE8 + (phi_s2 * 0x54))->unk4A = 0; - } else if (D_800DC50C != 5) { + } else if (D_800DC50C != ENDING_SEQUENCE) { (&D_80163DE8 + (phi_s2 * 0x54))->unk4A = 1; } func_800721E8(temp_s0, 0x200000); diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 488fe43a3..e6227bf1a 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -199,7 +199,7 @@ void func_800581C8(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->buffer[56]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); func_8001C3C4(0); - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { func_80055F48(0); func_80056160(0); func_8005217C(0); @@ -303,7 +303,7 @@ void func_80058640(void) { gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->buffer[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->buffer[56]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - if (D_800DC50C != 5) { + if (D_800DC50C != ENDING_SEQUENCE) { func_80058B58(0); } } @@ -369,7 +369,7 @@ void func_800588F4(s32 arg0) { func_80054664(arg0); break; case 3: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800527D8(arg0); func_80052590(arg0); func_8005217C(arg0); @@ -378,12 +378,12 @@ void func_800588F4(s32 arg0) { break; case 4: func_80055228(arg0); - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_8005568C(arg0); } break; case 5: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_8005327C(arg0); } break; @@ -409,7 +409,7 @@ void func_800588F4(s32 arg0) { } break; case 9: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800550A4(arg0); } break; @@ -417,19 +417,19 @@ void func_800588F4(s32 arg0) { func_800541BC(arg0); break; case 12: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80052E30(arg0); } func_8005592C(arg0); break; case 13: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80056188(arg0); func_80055C38(arg0); } break; case 18: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80054414(arg0); } break; @@ -464,7 +464,7 @@ void func_80058B58(s32 arg0) { } return;// Duplicate return node #9. Try simplifying control flow for better match } - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { if ((D_8015F894 == 0) && (gPlayerCountSelection1 == COURSE_CHOCO_MOUNTAIN)) { func_800517C8(); //return; @@ -1333,7 +1333,7 @@ void func_80059AC8(void) { func_80059A88(0); func_80059A88(1); } - } else if (D_800DC50C != 9) { + } else if (D_800DC50C != CREDITS_SEQUENCE) { func_80059A88(0); if (gModeSelection == TIME_TRIALS) { func_8005995C(); @@ -1833,7 +1833,7 @@ void func_8005A74C(void) { func_80076B84(); break; case 3: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_8007E1AC(); func_8007E4C4(); if (gModeSelection != TIME_TRIALS) { @@ -1845,22 +1845,22 @@ void func_8005A74C(void) { break; case 4: func_80083080(); - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800834B8(); } break; case 5: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80083D60(); } func_80078838(); break; case 6: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80082E5C(); } temp_v0 = D_8018EDF3; - if ((temp_v0 == 1) || (temp_v0 == 2) || (D_800DC50C == 9)) { + if ((temp_v0 == 1) || (temp_v0 == 2) || (D_800DC50C == CREDITS_SEQUENCE)) { func_80082870(); } break; @@ -1870,7 +1870,7 @@ void func_8005A74C(void) { } break; case 9: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800821FC(); } break; @@ -1878,13 +1878,13 @@ void func_8005A74C(void) { func_80075838(); break; case 12: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800842C8(); } func_80085214(); break; case 13: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800861E0(); func_80085AA8(); } @@ -12222,7 +12222,7 @@ void func_8006E420(u16 *arg0, s8 arg1, s8 arg2) { phi_s0 = 0; do { func_8006CEC0(arg0, phi_s0, arg1, arg2); - if (((*arg0 & 0x4000) == 0x4000) || (D_800DC50C == 5)) { + if (((*arg0 & 0x4000) == 0x4000) || (D_800DC50C == ENDING_SEQUENCE)) { func_8006C9B8(arg0, phi_s0, arg1, arg2); } func_8006C6AC(arg0, phi_s0, arg1, arg2); diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index 35c626faf..ae57792a5 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -1462,7 +1462,7 @@ void func_80070780(void) { temp_t6 = gCurrentCourseId; switch (temp_t6) { case 0: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { if (gModeSelection == GRAND_PRIX) { func_80070714(); } @@ -1553,7 +1553,7 @@ void func_80070780(void) { } while (temp_s0_4 != &D_8018C0B0); return; case 3: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { temp_s0_5 = D_80183EA0.unk0; func_80073444(temp_s0_5, &D_06007BB8, &D_06007DB8, 0x20, 0x40); temp_v0_5 = &D_80165C18 + (temp_s0_5 * 0xE0); @@ -1574,7 +1574,7 @@ void func_80070780(void) { phi_s1_3 = temp_s1; } while (temp_s1 < &D_80183EB0); phi_s2_3 = &D_80183F28; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { phi_v1 = D_800E5E8C; phi_s1_4 = &D_800E5E14; do { @@ -1612,7 +1612,7 @@ void func_80070780(void) { phi_s1_5 = temp_s1_2; } while (temp_s1_2 < &D_8018C278); phi_s1_6 = &D_80183EA0; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { phi_v1_2 = &D_800E5EE8; phi_s2_4 = &D_80183F28; do { @@ -1641,7 +1641,7 @@ void func_80070780(void) { return; case 6: phi_s1_7 = &D_80183EA0; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { phi_v1_3 = D_800E5F80; do { temp_s0_9 = *phi_s1_7; @@ -1676,7 +1676,7 @@ void func_80070780(void) { } while (temp_s2 != &D_80183F50); return; case 7: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { if (gModeSelection == GRAND_PRIX) { func_80070714(); } @@ -1698,7 +1698,7 @@ void func_80070780(void) { /* Duplicate return node #106. Try simplifying control flow for better match */ return; case 8: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { if (gModeSelection == GRAND_PRIX) { func_80070714(); } @@ -1722,7 +1722,7 @@ void func_80070780(void) { /* Duplicate return node #106. Try simplifying control flow for better match */ return; case 9: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { temp_v0_10 = D_8018EDF3; phi_s1_8 = &D_80183EA0; if ((temp_v0_10 == 1) || ((temp_v0_10 == 2) && (gModeSelection == VERSUS))) { @@ -1811,7 +1811,7 @@ block_75: /* Duplicate return node #106. Try simplifying control flow for better match */ return; case 11: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { find_unused_obj_index(&D_8018CF10); func_800723A4(D_8018CF10, 0); phi_s1_12 = &D_8018C1B0; @@ -1846,7 +1846,7 @@ block_75: return; case 13: phi_s1_14 = &D_80183EA0; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { do { func_800723A4(*phi_s1_14, 0); temp_s1_5 = phi_s1_14 + 4; diff --git a/src/code_80071F00.c b/src/code_80071F00.c index bd73c899d..5d5ac4c65 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -4551,7 +4551,7 @@ void func_80078288(s32 arg0) { temp_s0->unkB4 = func_800872D8(arg0, camera1); return; } - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { sp3A = ((D_800DC4FC->unk_094 / 18.0f) * 216.0f) / 2.0f; sp3E = (random_int(0xF) - sp3A) + 0x2D; sp3C = random_int(0x12C) + 0x1E; @@ -4709,7 +4709,7 @@ void func_80078838(void) { s32 temp_a0; s32 *phi_s0; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80078790(); } else { func_80078790(); @@ -9789,7 +9789,7 @@ void func_80080524(s32 arg0) { temp_s0->unk14 = 70.0f; temp_s0->unk20 = 0.0f; func_8008B888(arg0, 0, 0, 0); - if ((gIsMirrorMode != 0) || (D_800DC50C == 9)) { + if ((gIsMirrorMode != 0) || (D_800DC50C == CREDITS_SEQUENCE)) { func_8008B8BC(arg0, 0, 0xC000, 0); } else { func_8008B8BC(arg0, 0, 0x4000, 0); @@ -9975,7 +9975,7 @@ block_6: func_8007E63C(arg0); func_8008085C(arg0); func_80073514(arg0); - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { if ((D_8018D40C == 0) && (phi_t0->unkA6 == 2)) { func_800C98B8(phi_t0 + 4, phi_t0 + 0x38, 0x19036045); return; @@ -11172,7 +11172,7 @@ void func_8008241C(s32 arg0, s32 arg1) { phi_f10 = temp_f10 + 4294967296.0; } temp_f4 = phi_f10 + -100.0; - if (D_800DC50C == 9) { + if (D_800DC50C == CREDITS_SEQUENCE) { func_8008B7D4(arg0, sp22 + D_800EF170, sp20 + 60.0, temp_f4 + D_800EF178); } else if (temp_s0->unkD5 != 0) { func_8008B7D4(arg0, (sp22 + D_800EF180) * D_8018D01C, sp20 + 20.0, temp_f4 + D_800EF188); @@ -11293,7 +11293,7 @@ void func_80082870(void) { D_80183E40.unk0 = 0.0f; D_80183E40.unk4 = 0.0f; D_80183E40.unk8 = 0.0f; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_800C98B8(temp_s1 + 4, &D_80183E40, 0x19017043); } else if (D_802876D2 < 0x97) { func_800C98B8(&D_80165C18 + (D_80183F2C * 0xE0) + 4, &D_80183E40, 0x19017043); @@ -11309,7 +11309,7 @@ void func_80082870(void) { if (temp_v0 != 0) { D_80165900 = temp_v0 - 1; } else { - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { D_80165900 = 0x3C; } else { D_80165900 = 0xF; @@ -12517,7 +12517,7 @@ block_14: } else if ((arg1 >= 9) && (arg1 < 0xF)) { switch (arg1) { case 9: - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_8008B7D4(arg0, D_8018D01C * 146.0, 0, 0xC3BE0000); } else { func_8008B7D4(arg0, D_8018D01C * 380.0, 0, 0xC405C000); @@ -12936,7 +12936,7 @@ void func_800853DC(s32 arg0) { temp_v0 = (arg0 * 0xE0) + &D_80165C18; temp_v0->unk70 = &D_0600F960; temp_v0->unk0 = 1.0f; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { sp2C = temp_v0; func_8008B7D4(D_8018D01C * -176.0, 0.0f, -2323.0f); func_8008B80C(arg0, 0.0f, 0x43960000, 0.0f); diff --git a/src/code_80091750.c b/src/code_80091750.c index a103716ea..86cd7db91 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -223,7 +223,7 @@ s32 func_80091D74(); // extern ? func_800C97C4(s32); // extern ? func_800C9D0C(s32); // extern extern s8 D_800E852C; -extern s32 D_800E86A0; +extern s32 gMenuSelection; extern s32 D_800E86A4; extern s32 D_8018D9B0; extern s32 D_8018D9B4; @@ -260,10 +260,10 @@ void func_80091B78(void) { func_800B4A10(); } if (func_80091D74() != 0) { - D_800E86A0 = 9; + gMenuSelection = CONTROLLER_PAK_MENU; } } - if (D_800E86A0 == 8) { + if (gMenuSelection == LOGO_INTRO_MENU) { gPrevLoadedAddress = D_8015F734; set_segment_base_addr(6, func_802AA88C(&_data_825800SegmentRomStart, &_course_mario_raceway_dl_mio0SegmentRomStart)); } @@ -1145,6 +1145,7 @@ void print_text1(s32 column, s32 row, char *text, s32 tracking, f32 x_scale, f32 arg6 = 2; } + gSPDisplayList(gDisplayListHead++, D_020077A8); if (*text != 0) { do{ @@ -1889,20 +1890,20 @@ void func_80094A64(s32 arg0) { func_80092290(5, &D_8018E854, &D_8018E85C); func_80099A70(); func_8009C918(); - temp_t1 = D_800E86A0; + temp_t1 = gMenuSelection; switch (temp_t1) { - case 10: + case START_MENU: func_80095574(); func_80093E40(); break; - case 5: - case 6: - case 7: - case 8: - case 9: - case 11: - case 12: - case 13: + case OPTIONS_MENU: + case DATA_MENU: + case COURSE_DATA_MENU: + case LOGO_INTRO_MENU: + case CONTROLLER_PAK_MENU: + case GAME_SELECT_MENU: + case PLAYER_SELECT_MENU: + case COURSE_SELECT_MENU: func_800A8230(); func_80099AEC(); break; @@ -1949,15 +1950,15 @@ void func_80094C60(void) { func_80092258(); func_800B5F30(); func_800B6014(); - func_800B3F74(D_800E86A0); - temp_t7 = D_800E86A0; + func_800B3F74(gMenuSelection); + temp_t7 = gMenuSelection; switch (temp_t7) { - case 5: + case OPTIONS_MENU: func_8009E650(0x23, 0, 0, 2); func_8009E650(0xF1, 0, 0, 4); func_8009E650(0xF0, 0, 0, 2); break; - case 6: + case DATA_MENU: func_8009E650(0x23, 0, 0, 2); func_8009E650(0x8C, 0, 0, 6); func_8009E650(0x7C, 0, 0, 6); @@ -1978,17 +1979,17 @@ void func_80094C60(void) { func_8009E650(0x8B, 0, 0, 6); func_8009E650(0x8D, 0, 0, 8); break; - case 7: + case COURSE_DATA_MENU: func_8009E650(0xE6, 0, 0, 8); func_8009E650(0xE7, 0, 0, 8); func_8009E650(0xE8, 0, 0, 8); func_8009E650(0xE9, 0, 0, 8); func_8009E650(0xEA, 0, 0, 8); break; - case 8: + case LOGO_INTRO_MENU: func_8009E650(0xFA, 0, 0, 0); break; - case 9: + case CONTROLLER_PAK_MENU: func_8009E650(0xDA, 0, 0, 0); func_8009E650(0xD2, 0, 0, 4); func_8009E650(0xD4, 0, 0, 6); @@ -1999,7 +2000,7 @@ void func_80094C60(void) { func_8009E650(0xD8, 0, 0, 0xA); func_8009E650(0xD9, 0, 0, 0xA); break; - case 10: + case START_MENU: func_8009E650(2, 0, 0, 4); func_8009E650(1, 0, 0, 0); func_8009E650(0xFB, 0, 0, 0); @@ -2012,7 +2013,7 @@ void func_80094C60(void) { D_800DC51C = 0; D_8018EE08 = 0; break; - case 11: + case GAME_SELECT_MENU: func_8009E650(0x23, 0, 0, 2); func_8009E650(0xA, 0x15E, 0x11, 6); func_8009E650(0xE, 0x15E, 0x3E, 6); @@ -2032,7 +2033,7 @@ void func_80094C60(void) { func_8009E650(0x18, 0, 0, 6); func_8009E650(0x1B, 0, 0, 0xC); break; - case 12: + case PLAYER_SELECT_MENU: func_8009E650(0x24, 0, 0, 2); func_8009E650(0x2A, 0, 0, 6); func_8009E650(0x33, 0, 0, 6); @@ -2049,7 +2050,7 @@ void func_80094C60(void) { func_8009E650(0x36, 0, 0, 0xC); func_8009E650(0x37, 0, 0, 0xC); break; - case 13: + case COURSE_SELECT_MENU: func_8009E650(0x25, 0, 0, 2); func_8009E650(0x52, 0, 0, 6); if (gModeSelection != BATTLE) { @@ -2129,29 +2130,30 @@ void func_80095574(void) { if ((D_8018EE0C < 3) || (D_8018E7B0 != 0)) { func_800A8230(); } - temp_v0 = D_8018EDEF; + temp_v0 = gDebugMenuSelection; phi_v0_2 = temp_v0; - if (temp_v0 >= 2) { + if (temp_v0 >= DEBUG_MENU_DEBUG_MODE) { load_debug_font(); debug_print_str2(0x50, 0x64, "debug_mode"); - temp_t8 = D_8018EDEF; + temp_t8 = gDebugMenuSelection; + // Draw asterisk next to selected debug menu option switch (temp_t8) { - case 2: + case DEBUG_MENU_DEBUG_MODE: debug_print_str2(0x46, 0x64, "*"); break; - case 3: + case DEBUG_MENU_COURSE: debug_print_str2(0x46, 0x6E, "*"); break; - case 4: + case DEBUG_MENU_SCREEN_MODE: debug_print_str2(0x46, 0x78, "*"); break; - case 5: + case DEBUG_MENU_PLAYER: debug_print_str2(0x46, 0x82, "*"); break; - case 6: + case DEBUG_MENU_SOUND_MODE: debug_print_str2(0x46, 0x8C, "*"); break; - case 7: + case DEBUG_MENU_GIVE_ALL_GOLD_CUP: debug_print_str2(0x46, 0x96, "*"); break; } @@ -2178,22 +2180,22 @@ void func_80095574(void) { debug_print_str2(0xAA, 0x82, *(&gDebugCharacterNames + (D_800E86A8 * 4))); debug_print_str2(0x50, 0x8C, "sound mode"); debug_print_str2(0xAA, 0x8C, gDebugSoundModeNames[gSoundMode]); - if (D_8018EDEF == 7) { + if (gDebugMenuSelection == DEBUG_MENU_GIVE_ALL_GOLD_CUP) { debug_print_str2(0x50, 0x96, "push b to get all goldcup"); } func_80057778(); - phi_v0_2 = D_8018EDEF; + phi_v0_2 = gDebugMenuSelection; } - if (phi_v0_2 == 1) { - D_8018EE00 += 1; + if (phi_v0_2 == DEBUG_MENU_DISABLED) { + gStartMenuCounterForDemos += 1; } else { - D_8018EE00 = 3; + gStartMenuCounterForDemos = 3; } - temp_v0_2 = D_8018EE00; + temp_v0_2 = gStartMenuCounterForDemos; phi_v0_3 = temp_v0_2; if (temp_v0_2 == 2) { play_sound2(0x49009009); - phi_v0_3 = D_8018EE00; + phi_v0_3 = gStartMenuCounterForDemos; } if (phi_v0_3 >= 0x12D) { func_8009E230(); @@ -4672,7 +4674,7 @@ void func_80099AEC(void) { s8 phi_s5_2; s8 phi_s5_3; - if (D_800DC50C == 4) { + if (D_800DC50C == RACING) { sp60 = 0x500; } else { sp60 = 0x1000; @@ -6382,7 +6384,7 @@ void func_8009CBE4(s32 arg0, s32 arg1, s32 arg2) { sp40 = temp_t4; gDisplayListHead = draw_box(gDisplayListHead, phi_t2 - temp_v1_3, phi_t3 - temp_t0, temp_v1_3 + phi_t2, temp_t0 + phi_t3, temp_v0_5->unk0, temp_v0_5->unk2, temp_v0_5->unk4, 0xFF - ((*temp_t4 * 0xFF) / *temp_t9)); if ((arg1 == 0) && (temp_t6 = *temp_t4 + 1, *temp_t4 = temp_t6, ((temp_t6 < *sp3C) == 0))) { - if (D_800DC50C == 4) { + if (D_800DC50C == RACING) { *(&D_8018E7AC + arg0) = 6; return; } @@ -6445,7 +6447,7 @@ extern ? D_8018E7B0; static ? gCupSelectionByCourseId; /* unable to generate initializer; const */ static ? D_800E86A8; /* unable to generate initializer; const */ static ? gPerCupIndexByCourseId; /* unable to generate initializer; const */ -s16 D_800DC644; /* unable to generate initializer */ +s16 gCreditsCourseId; /* unable to generate initializer */ s16 gCurrentCourseId; /* unable to generate initializer */ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) { @@ -6489,7 +6491,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) { phi_a2 = arg3; phi_a2 = arg3; phi_a2 = arg3; - if (temp_v0 == 5) { + if (temp_v0 == ENDING_SEQUENCE) { temp_v1 = gCCSelection; if ((temp_v1 != CC_150) && (temp_v1 != CC_EXTRA)) { @@ -6497,15 +6499,15 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) { phi_a1 = 1; } if (phi_a1 != 0) { - D_80287550 = 9; - D_800DC644 = 8; + gMenuSelectionFromEndingSequence = CREDITS_SEQUENCE; + gCreditsCourseId = COURSE_LUIGI_RACEWAY; return; } - D_80287550 = 1; - D_800E86A0 = 0xB; + gMenuSelectionFromEndingSequence = GAME_SELECT_MENU_FROM_QUIT; + gMenuSelection = GAME_SELECT_MENU; return; } - if (temp_v0 == 4) { + if (temp_v0 == RACING) { temp_v0_2 = arg0 + &D_8018E7AC; if (*temp_v0_2 == 2) { if (temp_v0_2 != &D_8018E7B0) { @@ -6625,33 +6627,34 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) { } } else { *(&D_8018E7AC + arg0) = 0; - if (D_8018EDEF != 0x40) { + if (gDebugMenuSelection != DEBUG_MENU_EXITED) { temp_t9 = D_8018EDE0; switch (temp_t9) { /* switch 3 */ case 0: /* switch 3 */ - temp_v0_7 = D_800E86A0; + temp_v0_7 = gMenuSelection; phi_t7 = temp_v0_7 + 1; - phi_a0 = &D_800E86A0; + phi_a0 = &gMenuSelection; phi_a2 = 2; phi_a2 = 2; - if (temp_v0_7 == 8) { - D_800E86A0 = 0xA; + if (temp_v0_7 == LOGO_INTRO_MENU) { + gMenuSelection = START_MENU; D_800E86A4 = 2; } else { block_74: - D_800E86A0 = phi_t7; - phi_a0 = &D_800E86A0; + gMenuSelection = phi_t7; + phi_a0 = &gMenuSelection; } break; case 1: /* switch 3 */ - D_800E86A0 += -1; - phi_a0 = &D_800E86A0; + gMenuSelection += -1; + phi_a0 = &gMenuSelection; break; // Setting up game state for title screen demos case 2: /* switch 3 */ D_800DC51C = 1; D_8018EE08 = 1; - D_800DC524 = 4; + + D_800DC524 = RACING; gCCSelection = CC_100; switch (gNextDemoId) { /* switch 4 */ case DEMO_ONE: /* switch 4 */ @@ -6723,23 +6726,23 @@ block_74: phi_a0 = gCurrentCourseId; break; case 3: /* switch 3 */ - temp_v1_5 = D_800E86A0; - phi_a0 = &D_800E86A0; - if (temp_v1_5 != 6) { - if (temp_v1_5 == 0xB) { - D_800E86A0 = 6; + temp_v1_5 = gMenuSelection; + phi_a0 = &gMenuSelection; + if (temp_v1_5 != DATA_MENU) { + if (temp_v1_5 == GAME_SELECT_MENU) { + gMenuSelection = DATA_MENU; } } else { - D_800E86A0 = 0xB; + gMenuSelection = GAME_SELECT_MENU; } break; case 4: /* switch 3 */ - temp_v1_6 = D_800E86A0; + temp_v1_6 = gMenuSelection; phi_t7 = 0xB; - phi_a0 = &D_800E86A0; - if (temp_v1_6 != 5) { - if (temp_v1_6 == 0xB) { - D_800E86A0 = 5; + phi_a0 = &gMenuSelection; + if (temp_v1_6 != OPTIONS_MENU) { + if (temp_v1_6 == GAME_SELECT_MENU) { + gMenuSelection = OPTIONS_MENU; } } else { goto block_74; @@ -6749,8 +6752,8 @@ block_74: if (D_800E86A4 == 0) { D_800E86A4 = 1; } - if (D_800E86A0 >= 0xE) { - D_800DC524 = 4; + if (gMenuSelection >= RACING_DUPLICATE) { + D_800DC524 = RACING; if (gModeSelection == TIME_TRIALS) { D_8018EDFB = 1; } @@ -6759,19 +6762,19 @@ block_74: D_8018EE0C = 0; return; } - temp_v1_7 = D_8018EDFA; - if (temp_v1_7 != 1) { - if ((temp_v1_7 != 2) && (temp_v1_7 != 3)) { - D_800DC524 = 4; + temp_v1_7 = gDebugGotoScene; + if (temp_v1_7 != DEBUG_GOTO_ENDING_SEQUENCE) { + if ((temp_v1_7 != DEBUG_GOTO_CREDITS_SEQUENCE_CC_50) && (temp_v1_7 != DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA)) { + D_800DC524 = RACING; if (gModeSelection == TIME_TRIALS) { D_8018EDFB = 1; } } else { - D_800DC524 = 9; - D_800DC644 = 8; + D_800DC524 = CREDITS_SEQUENCE; + gCreditsCourseId = COURSE_LUIGI_RACEWAY; } } else { - D_800DC524 = 5; + D_800DC524 = ENDING_SEQUENCE; } func_8000F124(1, 2); if ((D_800DC530 == 3) && ((temp_v1_8 = gModeSelection, (temp_v1_8 == 0)) || (temp_v1_8 == 1))) { @@ -6779,6 +6782,7 @@ block_74: } temp_a0_2 = gCurrentCourseId; if ((temp_a0_2 != 0xF) && (temp_a0_2 != 0x10) && (temp_a0_2 != 0x11) && (temp_a0_2 != 0x13)) { + // Selected course is not one of the battle courses temp_v0_8 = gModeSelection; phi_v0 = temp_v0_8; if (temp_v0_8 == 3) { @@ -6797,12 +6801,12 @@ block_74: } } gCupSelection = gCupSelectionByCourseId[gCurrentCourseId]; - temp_v1_9 = D_8018EDFA; + temp_v1_9 = gDebugGotoScene; D_800DC540 = gCupSelection; gCupCourseSelection = gPerCupIndexByCourseId[gCurrentCourseId]; - if (temp_v1_9 != 1) { - if (temp_v1_9 != 2) { - if (temp_v1_9 != 3) { + if (temp_v1_9 != DEBUG_GOTO_ENDING_SEQUENCE) { + if (temp_v1_9 != DEBUG_GOTO_CREDITS_SEQUENCE_CC_50) { + if (temp_v1_9 != DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA) { if (gCCSelection == CC_EXTRA) { gIsMirrorMode = 1; return; @@ -11304,7 +11308,7 @@ void func_800A474C(s32 arg0, s32 arg1, s32 arg2) { u32 phi_v0_2; u32 phi_v0_3; - if (D_800DC50C == 4) { + if (D_800DC50C == RACING) { sp30 = 0; } else { sp30 = 1; diff --git a/src/code_800AF9B0.c b/src/code_800AF9B0.c index 1a08180ce..2570b3d62 100644 --- a/src/code_800AF9B0.c +++ b/src/code_800AF9B0.c @@ -420,9 +420,9 @@ void func_800B0350(void) { phi_s0 = 0; do { if ((func_800B4520() == 0) && (gEnableDebugMode != 0) && ((gControllers[phi_s0].buttonPressed & 0x1000) != 0)) { - temp_v0 = D_800E86A0; - if ((temp_v0 != 0xB) && (temp_v0 != 0xC)) { - if (temp_v0 == 0xD) { + temp_v0 = gMenuSelection; + if ((temp_v0 != GAME_SELECT_MENU) && (temp_v0 != PLAYER_SELECT_MENU)) { + if (temp_v0 == COURSE_SELECT_MENU) { func_800CA330(0x19); goto block_9; } @@ -430,44 +430,44 @@ void func_800B0350(void) { block_9: play_sound2(0x49008016); } - if ((D_800E86A0 != 9) && (D_800E86A0 != 0xA)) { + if ((gMenuSelection != CONTROLLER_PAK_MENU) && (gMenuSelection != START_MENU)) { func_8009E1C0(); } } osViSetSpecialFeatures(D_800E86E4); - temp_t2 = D_800E86A0; + temp_t2 = gMenuSelection; switch (temp_t2) { - case 5: + case OPTIONS_MENU: func_800B053C(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 6: + case DATA_MENU: func_800B13B0(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 7: + case COURSE_DATA_MENU: func_800B15AC(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 8: + case LOGO_INTRO_MENU: func_800B1C40(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 9: + case CONTROLLER_PAK_MENU: if (phi_s0 == 0) { func_800B1C90(&gControllers[phi_s0], phi_s0 & 0xFFFF); } break; - case 0: - case 10: + case START_MENU_FROM_QUIT: + case START_MENU: func_800B20F4(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 1: - case 11: + case GAME_SELECT_MENU_FROM_QUIT: + case GAME_SELECT_MENU: func_800B29D8(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 2: - case 12: + case PLAYER_SELECT_MENU_FROM_QUIT: + case PLAYER_SELECT_MENU: func_800B3554(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; - case 3: - case 13: + case COURSE_SELECT_MENU_FROM_QUIT: + case COURSE_SELECT_MENU: func_800B3B58(&gControllers[phi_s0], phi_s0 & 0xFFFF); break; } @@ -1651,9 +1651,9 @@ void func_800B20F4(void *arg0, s32 arg1) { if ((arg1 & 0xFFFF) == 0) { D_8018EE04 += 1; } - temp_t2 = D_8018EDEF; + temp_t2 = gDebugMenuSelection; switch (temp_t2) { - case 1: + case DEBUG_MENU_DISABLED: sp28 = 0; if ((D_8018EE04 >= 0x2E) && ((sp2E & 0x9000) != 0)) { func_8009E1C0(); @@ -1661,7 +1661,7 @@ void func_800B20F4(void *arg0, s32 arg1) { play_sound2(0x4900801A); } break; - case 2: + case DEBUG_MENU_DEBUG_MODE: if ((sp2E & 0x300) != 0) { sp24 = sp2E; play_sound2(0x49008000); @@ -1673,10 +1673,10 @@ void func_800B20F4(void *arg0, s32 arg1) { } if ((sp2E & 0x400) != 0) { play_sound2(0x49008000); - D_8018EDEF = 3; + gDebugMenuSelection = DEBUG_MENU_COURSE; } break; - case 3: + case DEBUG_MENU_COURSE: if ((sp2E & 0x100) != 0) { sp24 = sp2E; play_sound2(0x49008000); @@ -1700,14 +1700,14 @@ void func_800B20F4(void *arg0, s32 arg1) { if ((sp2E & 0x800) != 0) { sp24 = sp2E; play_sound2(0x49008000); - D_8018EDEF = 2; + gDebugMenuSelection = DEBUG_MENU_DEBUG_MODE; } if ((sp2E & 0x400) != 0) { play_sound2(0x49008000); - D_8018EDEF = 4; + gDebugMenuSelection = DEBUG_MENU_SCREEN_MODE; } break; - case 4: + case DEBUG_MENU_SCREEN_MODE: if ((sp2E & 0x100) != 0) { temp_v0_3 = D_8018EDF1; if (temp_v0_3 < 4) { @@ -1727,16 +1727,16 @@ void func_800B20F4(void *arg0, s32 arg1) { } } if ((sp2E & 0x800) != 0) { - D_8018EDEF = 3; + gDebugMenuSelection = DEBUG_MENU_COURSE; sp24 = sp2E; play_sound2(0x49008000); } if ((sp2E & 0x400) != 0) { - D_8018EDEF = 5; + gDebugMenuSelection = DEBUG_MENU_PLAYER; play_sound2(0x49008000); } break; - case 5: + case DEBUG_MENU_PLAYER: if ((sp2E & 0x100) != 0) { temp_v0_5 = D_800E86A8; if (temp_v0_5 < 7) { @@ -1754,16 +1754,16 @@ void func_800B20F4(void *arg0, s32 arg1) { } } if ((sp2E & 0x800) != 0) { - D_8018EDEF = 4; + gDebugMenuSelection = DEBUG_MENU_SCREEN_MODE; sp24 = sp2E; play_sound2(0x49008000); } if ((sp2E & 0x400) != 0) { - D_8018EDEF = 6; + gDebugMenuSelection = DEBUG_MENU_SOUND_MODE; play_sound2(0x49008000); } break; - case 6: + case DEBUG_MENU_SOUND_MODE: if ((sp2E & 0x100) != 0) { if (gSoundMode < SOUND_MONO) { gSoundMode += 1; @@ -1792,18 +1792,18 @@ void func_800B20F4(void *arg0, s32 arg1) { } } if ((sp2E & 0x800) != 0) { - D_8018EDEF = 5; + gDebugMenuSelection = DEBUG_MENU_PLAYER; sp24 = sp2E; play_sound2(0x49008000); } if ((sp2E & 0x400) != 0) { - D_8018EDEF = 7; + gDebugMenuSelection = DEBUG_MENU_GIVE_ALL_GOLD_CUP; play_sound2(0x49008000); } break; - case 7: + case DEBUG_MENU_GIVE_ALL_GOLD_CUP: if ((sp2E & 0x800) != 0) { - D_8018EDEF = 6; + gDebugMenuSelection = DEBUG_MENU_SOUND_MODE; sp24 = sp2E; play_sound2(0x49008000); } @@ -1851,36 +1851,36 @@ void func_800B20F4(void *arg0, s32 arg1) { D_8018EDF3 = *(&D_800F2B58 + D_8018EDF1); gPlayerCountSelection1 = D_8018EDF3; if (sp28 != 0) { - if ((sp2E & 0x9000) != 0) { + if ((sp2E & 0x9000) != 0) { // A or Start pressed sp24 = sp2E; func_8009E1C0(); func_800CA330(0x19); - D_8018EDEF = 0x40; - if ((arg0->unk4 & 0x20) != 0) { + gDebugMenuSelection = DEBUG_MENU_EXITED; + if ((arg0->unk4 & 0x20) != 0) { // L held D_800DC51C = 1; } else { D_800DC51C = 0; } - if ((arg0->unk4 & 0x2000) != 0) { - if ((sp2E & 0x8000) != 0) { - D_8018EDFA = 1; + if ((arg0->unk4 & 0x2000) != 0) { // Z is held + if ((sp2E & 0x8000) != 0) { + gDebugGotoScene = DEBUG_GOTO_ENDING_SEQUENCE; // Go to ending ceremony if A is not pressed } else { - D_8018EDFA = 3; + gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA; // Go to credits, set gCCSelection to CC_EXTRA } } play_sound2(0x49008016); return; } - if (((sp2E & 0x4000) != 0) && ((arg0->unk4 & 0x2000) != 0)) { + if (((sp2E & 0x4000) != 0) && ((arg0->unk4 & 0x2000) != 0)) { // B pressed and Z held func_8009E1C0(); func_800CA330(0x19); - D_8018EDEF = 0x40; - D_8018EDFA = 2; + gDebugMenuSelection = DEBUG_MENU_EXITED; + gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_50; // Go to credits, set gCCSelection to CC_50 play_sound2(0x49008016); return; } - if ((sp2E & 0x10) != 0) { - D_8018EDEF = 1; + if ((sp2E & 0x10) != 0) { // R pressed + gDebugMenuSelection = DEBUG_MENU_DISABLED; // Close out of debug menu play_sound2(0x49008001); } /* Duplicate return node #100. Try simplifying control flow for better match */ @@ -2169,7 +2169,7 @@ void func_800B29D8(void *arg0, u16 arg1) { } func_800B44AC(); temp_t7_2 = D_8018EDF3; - D_8018EE00 = 0; + gStartMenuCounterForDemos = 0; phi_v1_3 = &D_800F2B70 + ((temp_t7_2 * 0xC) + (*(&D_800E86AB + temp_t7_2) * 4)); } else { phi_v1_3 = &D_800F2B70 + ((temp_v0_4 * 0xC) + (temp_a0_3 * 4)); @@ -2178,7 +2178,7 @@ void func_800B29D8(void *arg0, u16 arg1) { break; case 5: case 8: - if ((arg1 == 0) && ((temp_t7_3 = D_8018EE00 + 1, D_8018EE00 = temp_t7_3, (temp_t7_3 == 0x64)) || ((temp_t7_3 % 300) == 0)) && ((temp_v0_5 = D_8018EDF3, temp_v1_4 = *(&D_800F2B70 + ((temp_v0_5 * 0xC) + (*(&D_800E86AB + temp_v0_5) * 4))), (temp_v1_4 == 0)) || (temp_v1_4 == 2))) { + if ((arg1 == 0) && ((temp_t7_3 = gStartMenuCounterForDemos + 1, gStartMenuCounterForDemos = temp_t7_3, (temp_t7_3 == 0x64)) || ((temp_t7_3 % 300) == 0)) && ((temp_v0_5 = D_8018EDF3, temp_v1_4 = *(&D_800F2B70 + ((temp_v0_5 * 0xC) + (*(&D_800E86AB + temp_v0_5) * 4))), (temp_v1_4 == 0)) || (temp_v1_4 == 2))) { sp1C = phi_v1; play_sound2(0x4900900E, arg1, phi_v1); } @@ -2248,7 +2248,7 @@ block_64: } else { D_8018EDED = 6; play_sound2(0x49008001, temp_a1); - D_8018EE00 = 0; + gStartMenuCounterForDemos = 0; } temp_t7_4 = D_8018EDF3; phi_v1_3 = &D_800F2B70 + ((temp_t7_4 * 0xC) + (*(&D_800E86AB + temp_t7_4) * 4)); @@ -2258,7 +2258,7 @@ block_64: break; case 6: case 7: - if ((arg1 == 0) && ((temp_t7_5 = D_8018EE00 + 1, D_8018EE00 = temp_t7_5, (temp_t7_5 == 0x3C)) || ((temp_t7_5 % 300) == 0))) { + if ((arg1 == 0) && ((temp_t7_5 = gStartMenuCounterForDemos + 1, gStartMenuCounterForDemos = temp_t7_5, (temp_t7_5 == 0x3C)) || ((temp_t7_5 % 300) == 0))) { sp1C = phi_v1; play_sound2(0x4900900F, arg1, phi_v1); } @@ -2276,7 +2276,7 @@ block_64: func_800B44AC(); play_sound2(0x49008002); temp_t7_6 = D_8018EDF3; - D_8018EE00 = 0; + gStartMenuCounterForDemos = 0; phi_v1_3 = &D_800F2B70 + ((temp_t7_6 * 0xC) + (*(&D_800E86AB + temp_t7_6) * 4)); } else if ((phi_v1 & 0x8000) != 0) { func_8009E1C0(); @@ -2355,7 +2355,7 @@ s32 func_800B4520(u16); // extern ? play_sound2(?, s8 *, u16); // extern extern s32 D_800DC540; extern s8 D_8018EDEC; -extern s32 D_8018EE00; +extern s32 gStartMenuCounterForDemos; extern s8 D_8018EE0A; extern s8 gCupSelection; extern ? gCupCourseOrder; @@ -2395,7 +2395,7 @@ void func_800B3B58(void *arg0, u16 arg1) { } goto block_22; } - if ((arg1 == 0) && ((temp_t5 = D_8018EE00 + 1, D_8018EE00 = temp_t5, (temp_t5 == 0x3C)) || ((temp_t5 % 0x12C) == 0))) { + if ((arg1 == 0) && ((temp_t5 = gStartMenuCounterForDemos + 1, gStartMenuCounterForDemos = temp_t5, (temp_t5 == 0x3C)) || ((temp_t5 % 0x12C) == 0))) { sp1C = phi_a2; play_sound2(0x4900900F, &D_8018EDEC, phi_a2); } @@ -2460,7 +2460,7 @@ block_22: *phi_a1 = 3; play_sound2(0x49008001, phi_a1); func_800B44AC(); - D_8018EE00 = 0; + gStartMenuCounterForDemos = 0; return; } // Duplicate return node #48. Try simplifying control flow for better match @@ -2505,7 +2505,7 @@ block_22: *phi_a1_2 = 3; play_sound2(0x49008001, phi_a1_2); gCurrentCourseId = *(&gCupCourseOrder + (gCupSelection * 8)); - D_8018EE00 = 0; + gStartMenuCounterForDemos = 0; } func_800B44AC(); return; @@ -2546,14 +2546,14 @@ extern s8 D_8018EDEB; extern s8 D_8018EDEC; extern s8 D_8018EDED; extern s8 D_8018EDEE; -extern s8 D_8018EDEF; +extern s8 gDebugMenuSelection; extern s8 D_8018EDF1; extern s8 D_8018EDF3; extern s8 D_8018EDF7; -extern s8 D_8018EDFA; +extern s8 gDebugGotoScene; extern s8 D_8018EDFB; extern s8 D_8018EDFC; -extern s32 D_8018EE00; +extern s32 gStartMenuCounterForDemos; extern s32 D_8018EE04; extern s8 D_8018EE08; extern s8 D_8018EE0A; @@ -2581,13 +2581,13 @@ void func_800B3F74(u32 arg0) { s32 phi_a0; s8 *phi_v0_2; - D_8018EDEF = 1; - D_8018EE00 = 0; + gDebugMenuSelection = DEBUG_MENU_DISABLED; + gStartMenuCounterForDemos = 0; D_8018EE04 = 0; D_8018EE08 = 0; D_8015F890 = 0; D_8015F892 = 0; - D_8018EDFA = 0; + gDebugGotoScene = DEBUG_GOTO_RACING; D_8018EDFB = 0; D_8016556E = 0; D_80162DD4 = 1; @@ -2596,24 +2596,24 @@ void func_800B3F74(u32 arg0) { D_80162DC8 = 1; D_80162DCC = 0; switch (arg0) { - case 5: + case OPTIONS_MENU: D_8018EDEC = 0x15; break; - case 6: + case DATA_MENU: D_8018EDEC = 1; break; - case 7: + case COURSE_DATA_MENU: D_8018EDEC = 0xB; break; - case 8: + case LOGO_INTRO_MENU: func_800CA008(0, 0); break; - case 9: + case CONTROLLER_PAK_MENU: gPlayerCountSelection2 = 1; func_800CA008(0, 0); break; - case 0: - case 10: + case START_MENU_FROM_QUIT: + case START_MENU: gIsMirrorMode = 0; gEnableDebugMode = 0; gCupSelection = MUSHROOM_CUP; @@ -2632,8 +2632,8 @@ void func_800B3F74(u32 arg0) { func_800C8EAC(1); D_8018EDFC = 0; break; - case 1: - case 11: + case GAME_SELECT_MENU_FROM_QUIT: + case GAME_SELECT_MENU: gEnableDebugMode = 0; gIsMirrorMode = 0; D_8018EDFC = 0; @@ -2676,8 +2676,8 @@ void func_800B3F74(u32 arg0) { } } break; - case 2: - case 12: + case PLAYER_SELECT_MENU_FROM_QUIT: + case PLAYER_SELECT_MENU: temp_v0_4 = D_8018EDE0; if (temp_v0_4 != 0) { if (temp_v0_4 != 1) { @@ -2746,8 +2746,8 @@ void func_800B3F74(u32 arg0) { } } break; - case 3: - case 13: + case COURSE_SELECT_MENU_FROM_QUIT: + case COURSE_SELECT_MENU: if (gModeSelection == BATTLE) { gCupSelection = BATTLE_CUP; D_800DC540 = 4; @@ -4156,7 +4156,7 @@ s32 func_800B6178(s32 arg0) { if ((arg0 != 0) && (arg0 != 1)) { return -1; } - if (D_800DC50C == 4) { + if (D_800DC50C == RACING) { func_800051C4(); } temp_s3 = (arg0 << 7) + &D_8018EE10; @@ -4183,7 +4183,7 @@ s32 func_800B6178(s32 arg0) { phi_v1 = temp_v0_2; if (temp_v0_2 == 0) { temp_s3->unk4 = 1; - if (D_800DC50C == 4) { + if (D_800DC50C == RACING) { temp_s3->unk5 = (gCupSelection * 4) + gCupCourseSelection; } temp_s3->unk0 = D_80162DFC; diff --git a/src/code_80280000.c b/src/code_80280000.c index 67a600a6b..9a31c8b40 100644 --- a/src/code_80280000.c +++ b/src/code_80280000.c @@ -1,5 +1,6 @@ #include #include +#include #include #include "main.h" @@ -12,13 +13,13 @@ extern Camera cameras[];//, *camera1, *camera2, *camera3, *camera4; extern f32 D_80150130, D_80150148, D_8015014C, D_80150150; -extern s16 D_800DC644; +extern s16 gCreditsCourseId; extern u16 D_80150112; extern u16 D_80164AF0; extern u32 D_8018D120; extern s32 gPrevLoadedAddress; -extern u16 D_800DC5C0, D_800DC5C4; +extern u16 gIsInQuitToMenuTransition, gQuitToMenuTransitionCounter; extern s32 D_802874A0; extern u16 func_802B7830(f32, f32); @@ -54,7 +55,7 @@ void func_80280038(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->buffer[8]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->buffer[56], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->buffer[56]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - gCurrentCourseId = D_800DC644; + gCurrentCourseId = gCreditsCourseId; mtxf_identity(&sp44); func_802B4FF8(&sp44, 0); func_80295A38(D_800DC5EC); @@ -69,13 +70,13 @@ void func_80280038(void) { } void func_80280268(s32 arg0) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; D_802874A0 = 1; if ((arg0 < 0) || ((arg0 >= 0x14))) { arg0 = 0; } - D_800DC644 = arg0; + gCreditsCourseId = arg0; } void func_802802AC(void) { @@ -86,11 +87,11 @@ void func_802802AC(void) { f32 temp_f14; D_802874A0 = 0; - if (D_800DC5C0 != 0) { - D_800DC5C4--; - if (D_800DC5C4 == 0) { - D_800DC5C0 = 0; - D_800DC524 = 9; + if (gIsInQuitToMenuTransition != 0) { + gQuitToMenuTransitionCounter--; + if (gQuitToMenuTransitionCounter == 0) { + gIsInQuitToMenuTransition = 0; + D_800DC524 = CREDITS_SEQUENCE; D_800DC50C = 255; } } else { @@ -117,7 +118,7 @@ void func_802802AC(void) { void func_80280420(void) { Camera *camera = &cameras[0]; - gCurrentCourseId = D_800DC644; + gCurrentCourseId = gCreditsCourseId; D_800DC5B4 = 1; D_800DC518 = 1; func_802A4D18(); diff --git a/src/code_80281780.c b/src/code_80281780.c index a6d02223f..575856256 100644 --- a/src/code_80281780.c +++ b/src/code_80281780.c @@ -79,7 +79,7 @@ void load_ending_sequence_royalraceway(void) { gCurrentCourseId = COURSE_ROYAL_RACEWAY; D_800DC5B4 = (u16)1; gIsMirrorMode = 0; - D_80287550 = 0xFFFF; + gMenuSelectionFromEndingSequence = 0xFFFF; D_80287554 = 0; func_802A4D18(); func_802A74BC(); diff --git a/src/code_80281780.h b/src/code_80281780.h index ab2e0b344..04a51037c 100644 --- a/src/code_80281780.h +++ b/src/code_80281780.h @@ -30,7 +30,7 @@ extern u16 D_800DC5BC; extern u16 D_800DC5C8; extern struct UnkStruct_800DC5EC *D_800DC5EC; -extern s32 D_80287550; +extern s32 gMenuSelectionFromEndingSequence; //D_80287550; extern s32 D_80287554; extern f32 D_801647A4; extern f32 D_80150130; diff --git a/src/code_80281C40.c b/src/code_80281C40.c index 58c68b968..b2ef6bf8d 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -15,9 +15,9 @@ struct UnkStruct80287560 { extern struct UnkStruct80287560 D_80287560[]; extern s32 D_802874FC; -extern u32 D_80287550; +extern u32 gMenuSelectionFromEndingSequence; extern s32 D_80287554; -extern u16 D_800DC5C0; +extern u16 gIsInQuitToMenuTransition; extern u32 D_800DC524; extern Gfx D_00284F70[]; extern Gfx D_00284EE0[]; @@ -53,11 +53,11 @@ void func_80281D00(void) { func_802A53A4(); func_802A3E3C(); - if (D_80287550 != 0xFFFF) { + if (gMenuSelectionFromEndingSequence != 0xFFFF) { clear_framebuffer(0); if (D_80287554 >= 4) { - D_800DC5C0 = 0; - D_800DC524 = D_80287550; + gIsInQuitToMenuTransition = 0; + D_800DC524 = gMenuSelectionFromEndingSequence; } D_80287554++; return; diff --git a/src/code_80281FA0.c b/src/code_80281FA0.c index 5908ca386..7b50e2fa3 100644 --- a/src/code_80281FA0.c +++ b/src/code_80281FA0.c @@ -837,7 +837,7 @@ void func_80283430(void) { phi_s0 = temp_s0; } while (temp_s0 != &D_80287824); D_802856C0 = 0.0f; - if (D_800DC50C == 5) { + if (D_800DC50C == ENDING_SEQUENCE) { D_802856B0 = 120.0f; D_802856B4 = 12.0f; D_802856B8 = 120.0f; @@ -944,7 +944,7 @@ s32 func_80283648(? *arg0) { arg0->unk20 = sins((bitwise f32) sp6C) * -sp38; func_80282008(arg0, &D_802876EC); func_80282008(sp34, &D_802876E0); - if ((D_800DC50C == 9) && (gIsMirrorMode != 0)) { + if ((D_800DC50C == CREDITS_SEQUENCE) && (gIsMirrorMode != 0)) { arg0->unk0 = -arg0->unk0; arg0->unkC = -arg0->unkC; } diff --git a/src/code_8028DF00.c b/src/code_8028DF00.c index 3b38a87de..4907aef9b 100644 --- a/src/code_8028DF00.c +++ b/src/code_8028DF00.c @@ -52,11 +52,11 @@ extern s32 gPlayerCountSelection1; extern u16 D_802BA048; extern s32 D_800DC510; -extern s32 D_80150124; +extern s32 gMenuSelectionFromQuit; extern u16 D_800DC5B4; extern u16 D_800DC5B0; extern u16 D_800DC5B8; -extern s32 D_800E86A0; +extern s32 gMenuSelection; extern s8 D_8018EE08; extern u16 D_800DC51C; @@ -74,7 +74,7 @@ extern u16 D_8015F890; extern u32 D_800DC5AC; extern u16 gEnableDebugMode; extern s32 D_800DC5E8; -extern u16 D_800DC5C0, D_800DC5C4; +extern u16 gIsInQuitToMenuTransition, gQuitToMenuTransitionCounter; extern s32 D_802B91E0; extern s16 D_8015F8F2[]; @@ -234,16 +234,16 @@ void func_8028E3A0(void) { if (D_80150120) { if (gCupCourseSelection == CUP_COURSE_FOUR) { - D_80150124 = 5; + gMenuSelectionFromQuit = ENDING_SEQUENCE; } else { D_800DC544++; gCupCourseSelection++; - D_80150124 = 4; + gMenuSelectionFromQuit = RACING; } } else { D_800DC544++; gCupCourseSelection++; - D_80150124 = 4; + gMenuSelectionFromQuit = RACING; } } @@ -484,8 +484,8 @@ void func_8028E678(void) { } break; case 4: - D_800DC5C0 = 1; - D_800DC5C4 = 5; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; D_800DC510 = 7; func_8028E3A0(); break; @@ -493,7 +493,7 @@ void func_8028E678(void) { } void func_8028EC38(s32 arg0) { - D_80150124 = arg0; + gMenuSelectionFromQuit = arg0; D_800DC510 = 6; func_800CA330(25); func_800CA388(25); @@ -772,7 +772,7 @@ void func_8028F4E8(void) { func_800CA330(0x19); func_800CA388(0x19); - D_80150124 = 0; + gMenuSelectionFromQuit = START_MENU_FROM_QUIT; D_800DC510 = 6; D_800DC5B4 = 1; D_800DC5B0 = 1; @@ -1020,7 +1020,7 @@ GLOBAL_ASM("asm/non_matchings/code_8028DF00/func_8028F970.s") #endif void func_8028FBD4(void) { - D_80150124 = 0; + gMenuSelectionFromQuit = START_MENU_FROM_QUIT; D_800DC510 = 6; func_800CA330(25); func_800CA388(25); @@ -1038,12 +1038,12 @@ void func_8028FC34(void) { D_802BA038--; if (D_800DC4CC->buttonPressed != 0) { func_8028FBD4(); - D_800E86A0 = 10; + gMenuSelection = START_MENU; return; } if (D_802BA038 == 0) { func_8028FBD4(); - D_800E86A0 = 8; + gMenuSelection = LOGO_INTRO_MENU; } } extern u16 D_80162DD6; @@ -1217,8 +1217,8 @@ void func_8028FCBC(void) { case 6: func_8028F8BC(); if (D_802BA034 <= 0) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; } break; case 7: @@ -1227,33 +1227,33 @@ void func_8028FCBC(void) { } UNUSED void func_80290314(void) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; - D_80150124 = 0; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; + gMenuSelectionFromQuit = START_MENU_FROM_QUIT; } void func_80290338(void) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; - D_80150124 = 1; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; + gMenuSelectionFromQuit = GAME_SELECT_MENU_FROM_QUIT; } void func_80290360(void) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; - D_80150124 = 2; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; + gMenuSelectionFromQuit = PLAYER_SELECT_MENU_FROM_QUIT; } void func_80290388(void) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; - D_80150124 = 3; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; + gMenuSelectionFromQuit = COURSE_SELECT_MENU_FROM_QUIT; } void func_802903B0(void) { - D_800DC5C0 = 1; - D_800DC5C4 = 5; - D_80150124 = 4; + gIsInQuitToMenuTransition = 1; + gQuitToMenuTransitionCounter = 5; + gMenuSelectionFromQuit = RACING; } #ifdef MIPS_TO_C diff --git a/src/code_80290C20.c b/src/code_80290C20.c index 367765a55..600d84591 100644 --- a/src/code_80290C20.c +++ b/src/code_80290C20.c @@ -2420,7 +2420,7 @@ block_29: func_802AF8BC(0x7002068, -0x6A, 0xFF, 0xFF, 0xFF); func_802AF8BC(0x7001E18, -0x6A, 0xFF, 0xFF, 0xFF); func_802AF8BC(0x7001318, -1, 0xFF, 0xFF, 0); - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_802AF8BC(0x7001FB8, -0x6A, 0xFF, 0xFF, 0xFF); return; } diff --git a/src/code_80296A50.c b/src/code_80296A50.c index b740d9b83..642922da7 100644 --- a/src/code_80296A50.c +++ b/src/code_80296A50.c @@ -431,7 +431,7 @@ void func_80297340(void *arg0) { void *temp_v0_6; sp36 = D_8015F8D0.unk8; - if ((D_800DC50C != 9) && (mtxf_translate(&sp38, &D_8015F8D0), (func_802B4FF8(&sp38, 0) != 0))) { + if ((D_800DC50C != CREDITS_SEQUENCE) && (mtxf_translate(&sp38, &D_8015F8D0), (func_802B4FF8(&sp38, 0) != 0))) { if (sp36 < arg0->unk8) { if (D_800DC5BC != 0) { temp_v0 = gDisplayListHead; @@ -1447,7 +1447,7 @@ void func_80298D7C(void *arg0, ? *arg1, ? arg2) { sp88.unk0 = D_802B87E0.unk0; sp88.unk4 = D_802B87E0.unk4; phi_s1 = temp_s1; - if (D_800DC50C == 9) { + if (D_800DC50C == CREDITS_SEQUENCE) { phi_f22 = D_802B9650; } else { phi_f22 = D_802B9654; @@ -4322,7 +4322,7 @@ void place_segment_06(u32 arg0) { break; } temp_s0 = &D_8015F9B8 + (func_8029EC88(&sp8C, &sp78, &sp80, phi_s2) * 0x70); - if (D_800DC50C == 9) { + if (D_800DC50C == CREDITS_SEQUENCE) { func_802976D8(temp_s0 + 0x10); } else { temp_s1 = temp_s0 + 0x30; @@ -7279,7 +7279,7 @@ void func_802A27A0(void *arg0, ? *arg1, void *arg2, u16 arg3) { void *temp_v0_5; f32 phi_f2; - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { temp_f0 = func_802B80D0(arg2 + 0x18, arg0->unk26, 0x43480000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A2C); phi_f2 = temp_f0; if (temp_f0 < 0.0f) { diff --git a/src/code_802A3730.c b/src/code_802A3730.c index fc7eea9b7..8417fb14c 100644 --- a/src/code_802A3730.c +++ b/src/code_802A3730.c @@ -20,11 +20,11 @@ extern u16 D_800DC5B0; void func_802A3E3C(); extern s32 D_800DC524; -extern s16 D_800DC5C0; -extern u16 D_800DC5C4; -extern s32 D_800E86A0; +extern s16 gIsInQuitToMenuTransition; +extern u16 gQuitToMenuTransitionCounter; +extern s32 gMenuSelection; extern s32 D_800E86A4; -extern s32 D_80150124; +extern s32 gMenuSelectionFromQuit; extern s32 D_801502B4; extern uintptr_t *gPhysicalFramebuffers[]; @@ -138,30 +138,30 @@ void func_802A38B4(void) { gDPFullSync(gDisplayListHead++); gSPEndDisplayList(gDisplayListHead++); - if (D_800DC5C4 != 0) { - D_800DC5C4--; + if (gQuitToMenuTransitionCounter != 0) { + gQuitToMenuTransitionCounter--; return; } - D_800DC524 = D_80150124; + D_800DC524 = gMenuSelectionFromQuit; D_800DC50C = 255; - D_800DC5C0 = 0; - D_800DC5C4 = 0; + gIsInQuitToMenuTransition = 0; + gQuitToMenuTransitionCounter = 0; D_800E86A4 = 1; - switch(D_80150124) { - case 0: - if (D_800E86A0 != 8) { - D_800E86A0 = 10; + switch(gMenuSelectionFromQuit) { + case START_MENU_FROM_QUIT: + if (gMenuSelection != LOGO_INTRO_MENU) { + gMenuSelection = START_MENU; } break; - case 1: - D_800E86A0 = 11; + case GAME_SELECT_MENU_FROM_QUIT: + gMenuSelection = GAME_SELECT_MENU; break; - case 2: - D_800E86A0 = 12; + case PLAYER_SELECT_MENU_FROM_QUIT: + gMenuSelection = PLAYER_SELECT_MENU; break; - case 3: - D_800E86A0 = 13; + case COURSE_SELECT_MENU_FROM_QUIT: + gMenuSelection = COURSE_SELECT_MENU; break; } } @@ -681,7 +681,7 @@ extern s32 D_800DC530; void func_802A4D18(void) { f32 phi_f10; - if (D_800DC50C != 4) { + if (D_800DC50C != RACING) { D_8015014C = 6800.0f; // D_802B9BB4 D_80150150 = 3.0f; } else { @@ -867,7 +867,7 @@ void func_802A53A4(void) { func_802A41D4(); if (D_800DC5B4 != 0) { func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); - if (D_800DC50C != 9) { + if (D_800DC50C != CREDITS_SEQUENCE) { func_80057FC4(0); } func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); diff --git a/src/main.c b/src/main.c index 71560a8a4..01daa034f 100644 --- a/src/main.c +++ b/src/main.c @@ -112,7 +112,7 @@ u16 D_8015011C; u16 D_8015011E; s32 D_80150120; -s32 D_80150124; +s32 gMenuSelectionFromQuit; UNUSED s32 D_80150128; UNUSED s32 D_8015012C; s32 D_80150130; @@ -168,7 +168,7 @@ u16 D_800DC514 = 0; u16 D_800DC518 = 0; u16 D_800DC51C = 0; u16 gEnableDebugMode = 0; -s32 D_800DC524 = 7; +s32 D_800DC524 = 7; // = COURSE_DATA_MENU?; UNUSED s32 D_800DC528 = 1; s32 D_800DC52C = 0; @@ -228,7 +228,7 @@ extern s16 gCurrentCourseId; extern u16 D_80164AF0; extern u16 D_800DC5FC; -extern u16 D_800DC5C0; +extern u16 gIsInQuitToMenuTransition; extern s32 D_8015F788; @@ -320,7 +320,7 @@ void func_800006E8(void) { gGfxSPTask->task.t.flags = (1 << 1); gGfxSPTask->task.t.ucode_boot = rspbootTextStart; gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspbootTextEnd - (u8 *) rspbootTextStart); - if (D_800DC50C != 4 || gPlayerCountSelection1 - 1 == 0) { + if (D_800DC50C != RACING || gPlayerCountSelection1 - 1 == 0) { gGfxSPTask->task.t.ucode = gspF3DEXTextStart; gGfxSPTask->task.t.ucode_data = gspF3DEXDataStart; } else { @@ -570,7 +570,7 @@ void init_game(void) { } void func_80001404(void) { - D_800DC524 = 0; + D_800DC524 = 0; // = START_MENU_FROM_QUIT? clear_framebuffer(0); } @@ -585,7 +585,7 @@ void func_8000142C(void) { if (D_800DC5FC != 0) { func_80290B14(); } - if (D_800DC5C0 != 0) { + if (gIsInQuitToMenuTransition != 0) { func_802A38B4(); return; } diff --git a/src/memory.c b/src/memory.c index 505e4d839..76a77629b 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1758,7 +1758,7 @@ void load_course(s32 arg0) { gHeapEndPtr = 0x8028DF00; } set_segment_base_addr(9, func_802A7D70(temp_a2, temp_v0->offsetRomEnd, temp_a2)); - if (D_800DC50C != 5) { + if (D_800DC50C != ENDING_SEQUENCE) { set_segment_base_addr(6, func_802AA88C(sp48, sp44)); } sp18 = gPrevLoadedAddress;