From 0458aa3f06f8c12f1ccdbb84e5b4673d7a315520 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:48:25 +0100 Subject: [PATCH] Identify and label a few things (#250) * Squashed commit of the following: commit 3ab471611006d05553f2fea56ace0a92397344cf Author: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Mon May 23 23:11:46 2022 +0100 Mostly misc labelling, but also weather too (#232) * bit more labelling * identify some weather stuff * Update sound_ids.h * yum * more random identification * last weather stuff for now * Update README.md * Update README.md * Fix non equivalent * I found the 60fps button * match func_80052B64 * match racer_attack_handler * match func_80048C7C * buncha function declaring * e * tweak * match func_8004DE38 oh man oh man * Small bit of labelling * Merge remote-tracking branch 'upstream/master' into the-many-against-the-few * Update README.md * Fix monumentally poor bout of misinformation in the readme we wouldn't want to mislead the readers, would we? * github please * Update README.md * requested changes kinda funny because I knew this struct existed, and knew it was used for this, but never made the connection lol * Update objects.c * match racer_enter_door A nice easy one after the pure hellscape of the last few days :) * names * renames * match func_8005250C * heehee * Update racer.c * identify some misc asset calls * identify some surface types * match func_8005492C * Delete func_8005492C.s * match func_80052D7C * move some enums * label all existing misc asset calls granted I know what almost none of them are lmao, buut will make things slightly easier in the long run * Update README.md * requested changes pain * Update README.md * just a bit of labelling * labbel * more * Update structs.h * file select * file struct * Update menu.c * multiplayer box * texture naming * realised why there's 3 indices lol * rounding * Update menu.c * identify textures * pain * fix non equiv * Update src/menu.c Co-authored-by: Ryan Myers * Update src/unknown_078050.c Co-authored-by: Ryan Myers * Update src/menu.c Co-authored-by: Ryan Myers Co-authored-by: Ryan Myers --- asm/non_matchings/game/func_8006DCF8.s | 32 +- asm/non_matchings/game/load_level.s | 2 +- asm/non_matchings/menu/func_80084854.s | 4 +- asm/non_matchings/menu/func_80085B9C.s | 4 +- asm/non_matchings/menu/func_8008F00C.s | 50 ++-- asm/non_matchings/menu/func_8008FA54.s | 4 +- asm/non_matchings/menu/func_800904E8.s | 2 +- asm/non_matchings/menu/func_80092188.s | 2 +- asm/non_matchings/menu/func_80092E94.s | 8 +- asm/non_matchings/menu/func_80094A5C.s | 2 +- asm/non_matchings/menu/func_80099E8C.s | 20 +- asm/non_matchings/menu/menu_credits_loop.s | 4 +- asm/non_matchings/menu/menu_ghost_data_init.s | 4 +- .../menu/menu_trophy_race_rankings_init.s | 2 +- .../menu/menu_trophy_race_round_init.s | 2 +- .../menu/render_file_select_menu.s | 16 +- .../menu/render_magic_codes_list_menu_text.s | 4 +- .../menu/render_track_select_setup_ui.s | 16 +- asm/non_matchings/objects/func_8000E2B4.s | 2 +- include/structs.h | 6 +- src/game.c | 141 +++++---- src/game.h | 12 +- src/menu.c | 280 +++++++++--------- src/menu.h | 220 +++++++++++--- src/objects.c | 2 +- src/textures_sprites.c | 1 + src/unknown_078050.c | 24 +- src/unknown_078050.h | 6 +- src/video.c | 18 +- src/video.h | 15 + 30 files changed, 547 insertions(+), 358 deletions(-) diff --git a/asm/non_matchings/game/func_8006DCF8.s b/asm/non_matchings/game/func_8006DCF8.s index e6d1c8a0..31706a79 100644 --- a/asm/non_matchings/game/func_8006DCF8.s +++ b/asm/non_matchings/game/func_8006DCF8.s @@ -5,8 +5,8 @@ glabel jpt_800E71D8 .text glabel func_8006DCF8 /* 06E8F8 8006DCF8 3C018012 */ lui $at, %hi(gIsPaused) # $at, 0x8012 -/* 06E8FC 8006DCFC 3C0E8012 */ lui $t6, %hi(D_80123514) # $t6, 0x8012 -/* 06E900 8006DD00 81CE3514 */ lb $t6, %lo(D_80123514)($t6) +/* 06E8FC 8006DCFC 3C0E8012 */ lui $t6, %hi(gIsLoading) # $t6, 0x8012 +/* 06E900 8006DD00 81CE3514 */ lb $t6, %lo(gIsLoading)($t6) /* 06E904 8006DD04 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 06E908 8006DD08 A0203515 */ sb $zero, %lo(gIsPaused)($at) /* 06E90C 8006DD0C 3C018012 */ lui $at, %hi(D_80123516) # $at, 0x8012 @@ -78,10 +78,10 @@ glabel func_8006DCF8 /* 06EA08 8006DE08 0C01AC2B */ jal func_8006B0AC /* 06EA0C 8006DE0C AD040000 */ sw $a0, ($t0) /* 06EA10 8006DE10 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 -/* 06EA14 8006DE14 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 +/* 06EA14 8006DE14 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 /* 06EA18 8006DE18 3C0B8012 */ lui $t3, %hi(D_80123508) # $t3, 0x8012 /* 06EA1C 8006DE1C 256B3508 */ addiu $t3, %lo(D_80123508) # addiu $t3, $t3, 0x3508 -/* 06EA20 8006DE20 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EA20 8006DE20 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EA24 8006DE24 25293504 */ addiu $t1, %lo(D_80123504) # addiu $t1, $t1, 0x3504 /* 06EA28 8006DE28 24180064 */ li $t8, 100 /* 06EA2C 8006DE2C AD420000 */ sw $v0, ($t2) @@ -153,8 +153,8 @@ glabel L8006DF00 /* 06EB28 8006DF28 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EB2C 8006DF2C AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EB30 8006DF30 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 -/* 06EB34 8006DF34 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 -/* 06EB38 8006DF38 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EB34 8006DF34 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 +/* 06EB38 8006DF38 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EB3C 8006DF3C 24633500 */ addiu $v1, %lo(D_80123500) # addiu $v1, $v1, 0x3500 /* 06EB40 8006DF40 8C650000 */ lw $a1, ($v1) /* 06EB44 8006DF44 8D470000 */ lw $a3, ($t2) @@ -187,7 +187,7 @@ glabel L8006DF70 /* 06EBAC 8006DFAC 80A2000F */ lb $v0, 0xf($a1) /* 06EBB0 8006DFB0 80A30001 */ lb $v1, 1($a1) /* 06EBB4 8006DFB4 04400002 */ bltz $v0, .L8006DFC0 -/* 06EBB8 8006DFB8 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 +/* 06EBB8 8006DFB8 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 /* 06EBBC 8006DFBC AD220000 */ sw $v0, ($t1) .L8006DFC0: /* 06EBC0 8006DFC0 00A36021 */ addu $t4, $a1, $v1 @@ -197,7 +197,7 @@ glabel L8006DF70 /* 06EBD0 8006DFD0 24633500 */ addiu $v1, %lo(D_80123500) # addiu $v1, $v1, 0x3500 /* 06EBD4 8006DFD4 AD620000 */ sw $v0, ($t3) .L8006DFD8: -/* 06EBD8 8006DFD8 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EBD8 8006DFD8 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EBDC 8006DFDC 8D470000 */ lw $a3, ($t2) /* 06EBE0 8006DFE0 8D040000 */ lw $a0, ($t0) /* 06EBE4 8006DFE4 8C650000 */ lw $a1, ($v1) @@ -216,8 +216,8 @@ glabel L8006E00C /* 06EC14 8006E014 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 /* 06EC18 8006E018 3C088012 */ lui $t0, %hi(D_801234F4) # $t0, 0x8012 /* 06EC1C 8006E01C 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 -/* 06EC20 8006E020 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 -/* 06EC24 8006E024 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EC20 8006E020 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 +/* 06EC24 8006E024 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EC28 8006E028 25293504 */ addiu $t1, %lo(D_80123504) # addiu $t1, $t1, 0x3504 /* 06EC2C 8006E02C 250834F4 */ addiu $t0, %lo(D_801234F4) # addiu $t0, $t0, 0x34f4 /* 06EC30 8006E030 24633500 */ addiu $v1, %lo(D_80123500) # addiu $v1, $v1, 0x3500 @@ -255,8 +255,8 @@ glabel L8006E054 /* 06ECAC 8006E0AC 25293504 */ addiu $t1, %lo(D_80123504) # addiu $t1, $t1, 0x3504 /* 06ECB0 8006E0B0 250834F4 */ addiu $t0, %lo(D_801234F4) # addiu $t0, $t0, 0x34f4 /* 06ECB4 8006E0B4 24633500 */ addiu $v1, %lo(D_80123500) # addiu $v1, $v1, 0x3500 -/* 06ECB8 8006E0B8 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 -/* 06ECBC 8006E0BC 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06ECB8 8006E0B8 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 +/* 06ECBC 8006E0BC 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06ECC0 8006E0C0 8C650000 */ lw $a1, ($v1) /* 06ECC4 8006E0C4 8D040000 */ lw $a0, ($t0) /* 06ECC8 8006E0C8 8D260000 */ lw $a2, ($t1) @@ -342,9 +342,9 @@ glabel L8006E0E0 /* 06EDF8 8006E1F8 00403825 */ move $a3, $v0 /* 06EDFC 8006E1FC 3C188012 */ lui $t8, %hi(D_8012351C) # $t8, 0x8012 /* 06EE00 8006E200 8F18351C */ lw $t8, %lo(D_8012351C)($t8) -/* 06EE04 8006E204 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 +/* 06EE04 8006E204 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 /* 06EE08 8006E208 3C018012 */ lui $at, %hi(D_801234FC) # $at, 0x8012 -/* 06EE0C 8006E20C 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EE0C 8006E20C 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EE10 8006E210 AC2034FC */ sw $zero, %lo(D_801234FC)($at) /* 06EE14 8006E214 10000030 */ b .L8006E2D8 /* 06EE18 8006E218 AD580000 */ sw $t8, ($t2) @@ -371,9 +371,9 @@ glabel L8006E0E0 /* 06EE68 8006E268 AE180000 */ sw $t8, ($s0) /* 06EE6C 8006E26C AC400004 */ sw $zero, 4($v0) /* 06EE70 8006E270 AC590000 */ sw $t9, ($v0) -/* 06EE74 8006E274 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 +/* 06EE74 8006E274 3C0A8012 */ lui $t2, %hi(gLevelDefaultVehicleID) # $t2, 0x8012 /* 06EE78 8006E278 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 -/* 06EE7C 8006E27C 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 +/* 06EE7C 8006E27C 254A3518 */ addiu $t2, %lo(gLevelDefaultVehicleID) # addiu $t2, $t2, 0x3518 /* 06EE80 8006E280 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EE84 8006E284 8D460000 */ lw $a2, ($t2) /* 06EE88 8006E288 8FA4002C */ lw $a0, 0x2c($sp) diff --git a/asm/non_matchings/game/load_level.s b/asm/non_matchings/game/load_level.s index 03ea7f18..1989654a 100644 --- a/asm/non_matchings/game/load_level.s +++ b/asm/non_matchings/game/load_level.s @@ -433,7 +433,7 @@ glabel load_level /* 06C484 8006B884 00000000 */ nop /* 06C488 8006B888 19A00006 */ blez $t5, .L8006B8A4 /* 06C48C 8006B88C 00000000 */ nop -/* 06C490 8006B890 0C01B6CB */ jal func_8006DB2C +/* 06C490 8006B890 0C01B6CB */ jal get_level_default_vehicle /* 06C494 8006B894 00000000 */ nop /* 06C498 8006B898 3C01800E */ lui $at, %hi(D_800DD314) # $at, 0x800e /* 06C49C 8006B89C 8FA30040 */ lw $v1, 0x40($sp) diff --git a/asm/non_matchings/menu/func_80084854.s b/asm/non_matchings/menu/func_80084854.s index 5b989713..e6ee8214 100644 --- a/asm/non_matchings/menu/func_80084854.s +++ b/asm/non_matchings/menu/func_80084854.s @@ -160,8 +160,8 @@ glabel func_80084854 /* 0856B0 80084AB0 24070007 */ li $a3, 7 /* 0856B4 80084AB4 3C06800E */ lui $a2, %hi(gSfxVolumeSliderValue) # $a2, 0x800e /* 0856B8 80084AB8 8CC6FAC0 */ lw $a2, %lo(gSfxVolumeSliderValue)($a2) -/* 0856BC 80084ABC 3C10800E */ lui $s0, %hi(D_800E042C) # $s0, 0x800e -/* 0856C0 80084AC0 2610042C */ addiu $s0, %lo(D_800E042C) # addiu $s0, $s0, 0x42c +/* 0856BC 80084ABC 3C10800E */ lui $s0, %hi(gMenuSelectionArrowLeft) # $s0, 0x800e +/* 0856C0 80084AC0 2610042C */ addiu $s0, %lo(gMenuSelectionArrowLeft) # addiu $s0, $s0, 0x42c /* 0856C4 80084AC4 240D00FF */ li $t5, 255 /* 0856C8 80084AC8 240E00FF */ li $t6, 255 /* 0856CC 80084ACC 240F00FF */ li $t7, 255 diff --git a/asm/non_matchings/menu/func_80085B9C.s b/asm/non_matchings/menu/func_80085B9C.s index e17beecb..43e0e929 100644 --- a/asm/non_matchings/menu/func_80085B9C.s +++ b/asm/non_matchings/menu/func_80085B9C.s @@ -109,14 +109,14 @@ glabel L80085C30 /* 086914 80085D14 8DEF0300 */ lw $t7, %lo(osTvType)($t7) /* 086918 80085D18 00009025 */ move $s2, $zero /* 08691C 80085D1C 15E00003 */ bnez $t7, .L80085D2C -/* 086920 80085D20 3C11800E */ lui $s1, %hi(D_800E043C) # $s1, 0x800e +/* 086920 80085D20 3C11800E */ lui $s1, %hi(gMenuSelectionArrowDown) # $s1, 0x800e /* 086924 80085D24 10000002 */ b .L80085D30 /* 086928 80085D28 24100084 */ li $s0, 132 .L80085D2C: /* 08692C 80085D2C 24100078 */ li $s0, 120 .L80085D30: /* 086930 80085D30 8F1863BC */ lw $t8, %lo(D_801263BC)($t8) -/* 086934 80085D34 2631043C */ addiu $s1, %lo(D_800E043C) # addiu $s1, $s1, 0x43c +/* 086934 80085D34 2631043C */ addiu $s1, %lo(gMenuSelectionArrowDown) # addiu $s1, $s1, 0x43c /* 086938 80085D38 3319001F */ andi $t9, $t8, 0x1f /* 08693C 80085D3C 00195043 */ sra $t2, $t9, 1 /* 086940 80085D40 020A8021 */ addu $s0, $s0, $t2 diff --git a/asm/non_matchings/menu/func_8008F00C.s b/asm/non_matchings/menu/func_8008F00C.s index e7509c2d..22975968 100644 --- a/asm/non_matchings/menu/func_8008F00C.s +++ b/asm/non_matchings/menu/func_8008F00C.s @@ -70,52 +70,52 @@ glabel func_8008F00C /* 08FD08 8008F108 3C04800E */ lui $a0, %hi(D_800E0830) # $a0, 0x800e /* 08FD0C 8008F10C 0C027229 */ jal allocate_menu_images /* 08FD10 8008F110 24840830 */ addiu $a0, %lo(D_800E0830) # addiu $a0, $a0, 0x830 -/* 08FD14 8008F114 0C023917 */ jal func_8008E45C +/* 08FD14 8008F114 0C023917 */ jal assign_vehicle_icon_textures /* 08FD18 8008F118 00000000 */ nop /* 08FD1C 8008F11C 3C028012 */ lui $v0, %hi(D_80126550) # $v0, 0x8012 /* 08FD20 8008F120 24426550 */ addiu $v0, %lo(D_80126550) # addiu $v0, $v0, 0x6550 -/* 08FD24 8008F124 3C03800E */ lui $v1, %hi(D_800E04A4) # $v1, 0x800e -/* 08FD28 8008F128 3C04800E */ lui $a0, %hi(D_800E04BC) # $a0, 0x800e +/* 08FD24 8008F124 3C03800E */ lui $v1, %hi(gRaceSelectionTTOn) # $v1, 0x800e +/* 08FD28 8008F128 3C04800E */ lui $a0, %hi(gRaceSelectionTTOff) # $a0, 0x800e /* 08FD2C 8008F12C 8C590090 */ lw $t9, 0x90($v0) /* 08FD30 8008F130 8C480094 */ lw $t0, 0x94($v0) /* 08FD34 8008F134 8C490098 */ lw $t1, 0x98($v0) /* 08FD38 8008F138 8C4A009C */ lw $t2, 0x9c($v0) -/* 08FD3C 8008F13C 248404BC */ addiu $a0, %lo(D_800E04BC) # addiu $a0, $a0, 0x4bc -/* 08FD40 8008F140 246304A4 */ addiu $v1, %lo(D_800E04A4) # addiu $v1, $v1, 0x4a4 +/* 08FD3C 8008F13C 248404BC */ addiu $a0, %lo(gRaceSelectionTTOff) # addiu $a0, $a0, 0x4bc +/* 08FD40 8008F140 246304A4 */ addiu $v1, %lo(gRaceSelectionTTOn) # addiu $v1, $v1, 0x4a4 /* 08FD44 8008F144 8C4B007C */ lw $t3, 0x7c($v0) -/* 08FD48 8008F148 3C01800E */ lui $at, %hi(D_800E04D4) # $at, 0x800e +/* 08FD48 8008F148 3C01800E */ lui $at, %hi(gRaceSelectionCarOptHighlight) # $at, 0x800e /* 08FD4C 8008F14C AC790000 */ sw $t9, ($v1) /* 08FD50 8008F150 AC680008 */ sw $t0, 8($v1) /* 08FD54 8008F154 AC890000 */ sw $t1, ($a0) /* 08FD58 8008F158 AC8A0008 */ sw $t2, 8($a0) -/* 08FD5C 8008F15C AC2B04D4 */ sw $t3, %lo(D_800E04D4)($at) +/* 08FD5C 8008F15C AC2B04D4 */ sw $t3, %lo(gRaceSelectionCarOptHighlight)($at) /* 08FD60 8008F160 8C4C0078 */ lw $t4, 0x78($v0) -/* 08FD64 8008F164 3C01800E */ lui $at, %hi(D_800E04E4) # $at, 0x800e -/* 08FD68 8008F168 AC2C04E4 */ sw $t4, %lo(D_800E04E4)($at) +/* 08FD64 8008F164 3C01800E */ lui $at, %hi(gRaceSelectionCarOpt) # $at, 0x800e +/* 08FD68 8008F168 AC2C04E4 */ sw $t4, %lo(gRaceSelectionCarOpt)($at) /* 08FD6C 8008F16C 8C4D0084 */ lw $t5, 0x84($v0) -/* 08FD70 8008F170 3C01800E */ lui $at, %hi(D_800E04F4) # $at, 0x800e -/* 08FD74 8008F174 AC2D04F4 */ sw $t5, %lo(D_800E04F4)($at) +/* 08FD70 8008F170 3C01800E */ lui $at, %hi(gRaceSelectionHoverOptHighlight) # $at, 0x800e +/* 08FD74 8008F174 AC2D04F4 */ sw $t5, %lo(gRaceSelectionHoverOptHighlight)($at) /* 08FD78 8008F178 8C4E0080 */ lw $t6, 0x80($v0) -/* 08FD7C 8008F17C 3C01800E */ lui $at, %hi(D_800E0504) # $at, 0x800e -/* 08FD80 8008F180 AC2E0504 */ sw $t6, %lo(D_800E0504)($at) +/* 08FD7C 8008F17C 3C01800E */ lui $at, %hi(gRaceSelectionHoverOpt) # $at, 0x800e +/* 08FD80 8008F180 AC2E0504 */ sw $t6, %lo(gRaceSelectionHoverOpt)($at) /* 08FD84 8008F184 8C4F008C */ lw $t7, 0x8c($v0) -/* 08FD88 8008F188 3C01800E */ lui $at, %hi(D_800E0514) # $at, 0x800e -/* 08FD8C 8008F18C AC2F0514 */ sw $t7, %lo(D_800E0514)($at) +/* 08FD88 8008F188 3C01800E */ lui $at, %hi(gRaceSelectioPlaneOptHighlight) # $at, 0x800e +/* 08FD8C 8008F18C AC2F0514 */ sw $t7, %lo(gRaceSelectioPlaneOptHighlight)($at) /* 08FD90 8008F190 8C580088 */ lw $t8, 0x88($v0) -/* 08FD94 8008F194 3C01800E */ lui $at, %hi(D_800E0524) # $at, 0x800e -/* 08FD98 8008F198 AC380524 */ sw $t8, %lo(D_800E0524)($at) +/* 08FD94 8008F194 3C01800E */ lui $at, %hi(gRaceSelectioPlaneOpt) # $at, 0x800e +/* 08FD98 8008F198 AC380524 */ sw $t8, %lo(gRaceSelectioPlaneOpt)($at) /* 08FD9C 8008F19C 8C5900A0 */ lw $t9, 0xa0($v0) -/* 08FDA0 8008F1A0 3C01800E */ lui $at, %hi(D_800E0534) # $at, 0x800e -/* 08FDA4 8008F1A4 AC390534 */ sw $t9, %lo(D_800E0534)($at) +/* 08FDA0 8008F1A0 3C01800E */ lui $at, %hi(gRaceSelectionTTOnOptHighlight) # $at, 0x800e +/* 08FDA4 8008F1A4 AC390534 */ sw $t9, %lo(gRaceSelectionTTOnOptHighlight)($at) /* 08FDA8 8008F1A8 8C4800A8 */ lw $t0, 0xa8($v0) -/* 08FDAC 8008F1AC 3C01800E */ lui $at, %hi(D_800E0544) # $at, 0x800e -/* 08FDB0 8008F1B0 AC280544 */ sw $t0, %lo(D_800E0544)($at) +/* 08FDAC 8008F1AC 3C01800E */ lui $at, %hi(gRaceSelectionTTOffOptHighlight) # $at, 0x800e +/* 08FDB0 8008F1B0 AC280544 */ sw $t0, %lo(gRaceSelectionTTOffOptHighlight)($at) /* 08FDB4 8008F1B4 8C4900A4 */ lw $t1, 0xa4($v0) -/* 08FDB8 8008F1B8 3C01800E */ lui $at, %hi(D_800E0554) # $at, 0x800e -/* 08FDBC 8008F1BC AC290554 */ sw $t1, %lo(D_800E0554)($at) +/* 08FDB8 8008F1B8 3C01800E */ lui $at, %hi(gRaceSelectionTTOnOpt) # $at, 0x800e +/* 08FDBC 8008F1BC AC290554 */ sw $t1, %lo(gRaceSelectionTTOnOpt)($at) /* 08FDC0 8008F1C0 8C4A00AC */ lw $t2, 0xac($v0) -/* 08FDC4 8008F1C4 3C01800E */ lui $at, %hi(D_800E0564) # $at, 0x800e -/* 08FDC8 8008F1C8 AC2A0564 */ sw $t2, %lo(D_800E0564)($at) +/* 08FDC4 8008F1C4 3C01800E */ lui $at, %hi(gRaceSelectionTTOffOpt) # $at, 0x800e +/* 08FDC8 8008F1C8 AC2A0564 */ sw $t2, %lo(gRaceSelectionTTOffOpt)($at) /* 08FDCC 8008F1CC 8C4B00B0 */ lw $t3, 0xb0($v0) /* 08FDD0 8008F1D0 3C01800E */ lui $at, %hi(D_800E0574) # $at, 0x800e /* 08FDD4 8008F1D4 AC2B0574 */ sw $t3, %lo(D_800E0574)($at) diff --git a/asm/non_matchings/menu/func_8008FA54.s b/asm/non_matchings/menu/func_8008FA54.s index 9d0a91ea..4a6c0e9f 100644 --- a/asm/non_matchings/menu/func_8008FA54.s +++ b/asm/non_matchings/menu/func_8008FA54.s @@ -280,8 +280,8 @@ glabel func_8008FA54 /* 090A54 8008FE54 032A8021 */ addu $s0, $t9, $t2 /* 090A58 8008FE58 860B0000 */ lh $t3, ($s0) /* 090A5C 8008FE5C 860C0002 */ lh $t4, 2($s0) -/* 090A60 8008FE60 3C08800E */ lui $t0, %hi(D_800E0678) # $t0, 0x800e -/* 090A64 8008FE64 25080678 */ addiu $t0, %lo(D_800E0678) # addiu $t0, $t0, 0x678 +/* 090A60 8008FE60 3C08800E */ lui $t0, %hi(gMenuSelectionArrows) # $t0, 0x800e +/* 090A64 8008FE64 25080678 */ addiu $t0, %lo(gMenuSelectionArrows) # addiu $t0, $t0, 0x678 /* 090A68 8008FE68 0011C080 */ sll $t8, $s1, 2 /* 090A6C 8008FE6C 03089021 */ addu $s2, $t8, $t0 /* 090A70 8008FE70 8E450000 */ lw $a1, ($s2) diff --git a/asm/non_matchings/menu/func_800904E8.s b/asm/non_matchings/menu/func_800904E8.s index d9318cd5..33491f48 100644 --- a/asm/non_matchings/menu/func_800904E8.s +++ b/asm/non_matchings/menu/func_800904E8.s @@ -200,7 +200,7 @@ glabel func_800904E8 /* 0913CC 800907CC 3C018012 */ lui $at, %hi(D_801269F8) # $at, 0x8012 /* 0913D0 800907D0 0C01AC2B */ jal func_8006B0AC /* 0913D4 800907D4 AC2B69F8 */ sw $t3, %lo(D_801269F8)($at) -/* 0913D8 800907D8 0C01B6C5 */ jal func_8006DB14 +/* 0913D8 800907D8 0C01B6C5 */ jal set_level_default_vehicle /* 0913DC 800907DC 00402025 */ move $a0, $v0 /* 0913E0 800907E0 3C038012 */ lui $v1, %hi(D_801269DC) # $v1, 0x8012 /* 0913E4 800907E4 3C088012 */ lui $t0, %hi(D_801269E4) # $t0, 0x8012 diff --git a/asm/non_matchings/menu/func_80092188.s b/asm/non_matchings/menu/func_80092188.s index 0456e9e7..b3639c47 100644 --- a/asm/non_matchings/menu/func_80092188.s +++ b/asm/non_matchings/menu/func_80092188.s @@ -702,7 +702,7 @@ glabel L8009287C .L80092B68: /* 093768 80092B68 3C048012 */ lui $a0, %hi(gPlayerSelectVehicle) # $a0, 0x8012 /* 09376C 80092B6C 808469C0 */ lb $a0, %lo(gPlayerSelectVehicle)($a0) -/* 093770 80092B70 0C01B6C5 */ jal func_8006DB14 +/* 093770 80092B70 0C01B6C5 */ jal set_level_default_vehicle /* 093774 80092B74 00000000 */ nop /* 093778 80092B78 3C0E800E */ lui $t6, %hi(gNumberOfActivePlayers) # $t6, 0x800e /* 09377C 80092B7C 8DCEF4BC */ lw $t6, %lo(gNumberOfActivePlayers)($t6) diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s index f3d5d966..47c64043 100644 --- a/asm/non_matchings/menu/func_80092E94.s +++ b/asm/non_matchings/menu/func_80092E94.s @@ -316,8 +316,8 @@ glabel func_80092E94 /* 093F64 80093364 3C198012 */ lui $t9, %hi(gPlayerSelectVehicle) # $t9, 0x8012 /* 093F68 80093368 833969C0 */ lb $t9, %lo(gPlayerSelectVehicle)($t9) /* 093F6C 8009336C 01104023 */ subu $t0, $t0, $s0 -/* 093F70 80093370 3C18800E */ lui $t8, %hi(D_800E0624) # $t8, 0x800e -/* 093F74 80093374 27180624 */ addiu $t8, %lo(D_800E0624) # addiu $t8, $t8, 0x624 +/* 093F70 80093370 3C18800E */ lui $t8, %hi(gRaceSelectionImages) # $t8, 0x800e +/* 093F74 80093374 27180624 */ addiu $t8, %lo(gRaceSelectionImages) # addiu $t8, $t8, 0x624 /* 093F78 80093378 00086880 */ sll $t5, $t0, 2 /* 093F7C 8009337C 16190010 */ bne $s0, $t9, .L800933C0 /* 093F80 80093380 01B81821 */ addu $v1, $t5, $t8 @@ -366,9 +366,9 @@ glabel func_80092E94 /* 094020 80093420 00026880 */ sll $t5, $v0, 2 /* 094024 80093424 01A26823 */ subu $t5, $t5, $v0 /* 094028 80093428 000DC080 */ sll $t8, $t5, 2 -/* 09402C 8009342C 3C05800E */ lui $a1, %hi(D_800E0624) # $a1, 0x800e +/* 09402C 8009342C 3C05800E */ lui $a1, %hi(gRaceSelectionImages) # $a1, 0x800e /* 094030 80093430 00B82821 */ addu $a1, $a1, $t8 -/* 094034 80093434 8CA50624 */ lw $a1, %lo(D_800E0624)($a1) +/* 094034 80093434 8CA50624 */ lw $a1, %lo(gRaceSelectionImages)($a1) /* 094038 80093438 241900FF */ li $t9, 255 /* 09403C 8009343C 240900FF */ li $t1, 255 /* 094040 80093440 240E00FF */ li $t6, 255 diff --git a/asm/non_matchings/menu/func_80094A5C.s b/asm/non_matchings/menu/func_80094A5C.s index 923caacc..7bfe3958 100644 --- a/asm/non_matchings/menu/func_80094A5C.s +++ b/asm/non_matchings/menu/func_80094A5C.s @@ -21,7 +21,7 @@ glabel func_80094A5C /* 0956A4 80094AA4 3C04800E */ lui $a0, %hi(D_800E0A40) # $a0, 0x800e /* 0956A8 80094AA8 0C027229 */ jal allocate_menu_images /* 0956AC 80094AAC 24840A40 */ addiu $a0, %lo(D_800E0A40) # addiu $a0, $a0, 0xa40 -/* 0956B0 80094AB0 0C025181 */ jal func_80094604 +/* 0956B0 80094AB0 0C025181 */ jal assign_racer_portrait_textures /* 0956B4 80094AB4 00000000 */ nop /* 0956B8 80094AB8 0C01BAA4 */ jal get_settings /* 0956BC 80094ABC 00000000 */ nop diff --git a/asm/non_matchings/menu/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s index 0b72d27a..47618b20 100644 --- a/asm/non_matchings/menu/func_80099E8C.s +++ b/asm/non_matchings/menu/func_80099E8C.s @@ -314,16 +314,16 @@ glabel func_80099E8C /* 09AF28 8009A328 240FFFFF */ li $t7, -1 /* 09AF2C 8009A32C 24010002 */ li $at, 2 /* 09AF30 8009A330 10410007 */ beq $v0, $at, .L8009A350 -/* 09AF34 8009A334 3C05800E */ lui $a1, %hi(D_800E048C) # $a1, 0x800e -/* 09AF38 8009A338 3C05800E */ lui $a1, %hi(D_800E045C) # $a1, 0x800e +/* 09AF34 8009A334 3C05800E */ lui $a1, %hi(gRaceSelectionPlaneTex) # $a1, 0x800e +/* 09AF38 8009A338 3C05800E */ lui $a1, %hi(gRaceSelectionCarTex) # $a1, 0x800e /* 09AF3C 8009A33C 10000005 */ b .L8009A354 -/* 09AF40 8009A340 24A5045C */ addiu $a1, %lo(D_800E045C) # addiu $a1, $a1, 0x45c +/* 09AF40 8009A340 24A5045C */ addiu $a1, %lo(gRaceSelectionCarTex) # addiu $a1, $a1, 0x45c .L8009A344: -/* 09AF44 8009A344 3C05800E */ lui $a1, %hi(D_800E0474) # $a1, 0x800e +/* 09AF44 8009A344 3C05800E */ lui $a1, %hi(gRaceSelectionHoverTex) # $a1, 0x800e /* 09AF48 8009A348 10000002 */ b .L8009A354 -/* 09AF4C 8009A34C 24A50474 */ addiu $a1, %lo(D_800E0474) # addiu $a1, $a1, 0x474 +/* 09AF4C 8009A34C 24A50474 */ addiu $a1, %lo(gRaceSelectionHoverTex) # addiu $a1, $a1, 0x474 .L8009A350: -/* 09AF50 8009A350 24A5048C */ addiu $a1, %lo(D_800E048C) # addiu $a1, $a1, 0x48c +/* 09AF50 8009A350 24A5048C */ addiu $a1, %lo(gRaceSelectionPlaneTex) # addiu $a1, $a1, 0x48c .L8009A354: /* 09AF54 8009A354 862B0008 */ lh $t3, 8($s1) /* 09AF58 8009A358 862D000A */ lh $t5, 0xa($s1) @@ -551,8 +551,8 @@ glabel func_80099E8C /* 09B2B8 8009A6B8 244C0003 */ addiu $t4, $v0, 3 /* 09B2BC 8009A6BC 018B082A */ slt $at, $t4, $t3 /* 09B2C0 8009A6C0 1020001C */ beqz $at, .L8009A734 -/* 09B2C4 8009A6C4 3C10800E */ lui $s0, %hi(D_800E043C) # $s0, 0x800e -/* 09B2C8 8009A6C8 2610043C */ addiu $s0, %lo(D_800E043C) # addiu $s0, $s0, 0x43c +/* 09B2C4 8009A6C4 3C10800E */ lui $s0, %hi(gMenuSelectionArrowDown) # $s0, 0x800e +/* 09B2C8 8009A6C8 2610043C */ addiu $s0, %lo(gMenuSelectionArrowDown) # addiu $s0, $s0, 0x43c /* 09B2CC 8009A6CC 240D0080 */ li $t5, 128 /* 09B2D0 8009A6D0 AFAD001C */ sw $t5, 0x1c($sp) /* 09B2D4 8009A6D4 02002825 */ move $a1, $s0 @@ -581,8 +581,8 @@ glabel func_80099E8C /* 09B330 8009A730 00000000 */ nop .L8009A734: /* 09B334 8009A734 18400019 */ blez $v0, .L8009A79C -/* 09B338 8009A738 3C10800E */ lui $s0, %hi(D_800E041C) # $s0, 0x800e -/* 09B33C 8009A73C 2610041C */ addiu $s0, %lo(D_800E041C) # addiu $s0, $s0, 0x41c +/* 09B338 8009A738 3C10800E */ lui $s0, %hi(gMenuSelectionArrowUp) # $s0, 0x800e +/* 09B33C 8009A73C 2610041C */ addiu $s0, %lo(gMenuSelectionArrowUp) # addiu $s0, $s0, 0x41c /* 09B340 8009A740 24090080 */ li $t1, 128 /* 09B344 8009A744 AFA9001C */ sw $t1, 0x1c($sp) /* 09B348 8009A748 02002825 */ move $a1, $s0 diff --git a/asm/non_matchings/menu/menu_credits_loop.s b/asm/non_matchings/menu/menu_credits_loop.s index 939c9978..5d15dfd2 100644 --- a/asm/non_matchings/menu/menu_credits_loop.s +++ b/asm/non_matchings/menu/menu_credits_loop.s @@ -50,7 +50,7 @@ glabel menu_credits_loop /* 09BFD4 8009B3D4 AFB90010 */ sw $t9, 0x10($sp) /* 09BFD8 8009B3D8 24050026 */ li $a1, 38 /* 09BFDC 8009B3DC 24060140 */ li $a2, 320 -/* 09BFE0 8009B3E0 0C026C79 */ jal func_8009B1E4 +/* 09BFE0 8009B3E0 0C026C79 */ jal render_credits_fade /* 09BFE4 8009B3E4 240700BA */ li $a3, 186 /* 09BFE8 8009B3E8 10000008 */ b .L8009B40C /* 09BFEC 8009B3EC 00000000 */ nop @@ -60,7 +60,7 @@ glabel menu_credits_loop /* 09BFF8 8009B3F8 24060140 */ li $a2, 320 /* 09BFFC 8009B3FC 000950C0 */ sll $t2, $t1, 3 /* 09C000 8009B400 AFAA0010 */ sw $t2, 0x10($sp) -/* 09C004 8009B404 0C026C79 */ jal func_8009B1E4 +/* 09C004 8009B404 0C026C79 */ jal render_credits_fade /* 09C008 8009B408 2407009C */ li $a3, 156 .L8009B40C: /* 09C00C 8009B40C 3C068012 */ lui $a2, %hi(D_801263D8) # $a2, 0x8012 diff --git a/asm/non_matchings/menu/menu_ghost_data_init.s b/asm/non_matchings/menu/menu_ghost_data_init.s index b80b27c9..c62be0c2 100644 --- a/asm/non_matchings/menu/menu_ghost_data_init.s +++ b/asm/non_matchings/menu/menu_ghost_data_init.s @@ -230,9 +230,9 @@ glabel menu_ghost_data_init /* 09A9E8 80099DE8 8FAF0048 */ lw $t7, 0x48($sp) /* 09A9EC 80099DEC AC980040 */ sw $t8, 0x40($a0) /* 09A9F0 80099DF0 00F6C021 */ addu $t8, $a3, $s6 -/* 09A9F4 80099DF4 0C023917 */ jal func_8008E45C +/* 09A9F4 80099DF4 0C023917 */ jal assign_vehicle_icon_textures /* 09A9F8 80099DF8 AF0F0018 */ sw $t7, 0x18($t8) -/* 09A9FC 80099DFC 0C025181 */ jal func_80094604 +/* 09A9FC 80099DFC 0C025181 */ jal assign_racer_portrait_textures /* 09AA00 80099E00 00000000 */ nop /* 09AA04 80099E04 0C02392C */ jal func_8008E4B0 /* 09AA08 80099E08 00000000 */ nop diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s index d3a7fa25..36e6bc6f 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s @@ -77,7 +77,7 @@ glabel menu_trophy_race_rankings_init .L80098B44: /* 099744 80098B44 3C018012 */ lui $at, %hi(D_80126A68) # $at, 0x8012 /* 099748 80098B48 AC206A68 */ sw $zero, %lo(D_80126A68)($at) -/* 09974C 80098B4C 0C025181 */ jal func_80094604 +/* 09974C 80098B4C 0C025181 */ jal assign_racer_portrait_textures /* 099750 80098B50 AFA90040 */ sw $t1, 0x40($sp) /* 099754 80098B54 3C0B800E */ lui $t3, %hi(gNumberOfActivePlayers) # $t3, 0x800e /* 099758 80098B58 256BF4BC */ addiu $t3, %lo(gNumberOfActivePlayers) # addiu $t3, $t3, -0xb44 diff --git a/asm/non_matchings/menu/menu_trophy_race_round_init.s b/asm/non_matchings/menu/menu_trophy_race_round_init.s index 7acb4fbb..9c0516bd 100644 --- a/asm/non_matchings/menu/menu_trophy_race_round_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_init.s @@ -64,7 +64,7 @@ glabel menu_trophy_race_round_init .L80098350: /* 098F50 80098350 0C01AC2B */ jal func_8006B0AC /* 098F54 80098354 02002025 */ move $a0, $s0 -/* 098F58 80098358 0C01B6C5 */ jal func_8006DB14 +/* 098F58 80098358 0C01B6C5 */ jal set_level_default_vehicle /* 098F5C 8009835C 00402025 */ move $a0, $v0 /* 098F60 80098360 02002025 */ move $a0, $s0 /* 098F64 80098364 2405FFFF */ li $a1, -1 diff --git a/asm/non_matchings/menu/render_file_select_menu.s b/asm/non_matchings/menu/render_file_select_menu.s index 1eab6413..00523e2e 100644 --- a/asm/non_matchings/menu/render_file_select_menu.s +++ b/asm/non_matchings/menu/render_file_select_menu.s @@ -27,14 +27,14 @@ glabel render_file_select_menu /* 08D9D0 8008CDD0 0C019FCB */ jal func_80067F2C /* 08D9D4 8008CDD4 02E02025 */ move $a0, $s7 /* 08D9D8 8008CDD8 3C118012 */ lui $s1, %hi(gSavefileInfo) # $s1, 0x8012 -/* 08D9DC 8008CDDC 3C10800E */ lui $s0, %hi(D_800E03CC) # $s0, 0x800e +/* 08D9DC 8008CDDC 3C10800E */ lui $s0, %hi(gFileSelectButtons) # $s0, 0x800e /* 08D9E0 8008CDE0 3C158012 */ lui $s5, %hi(D_80126550) # $s5, 0x8012 /* 08D9E4 8008CDE4 3C13B0E0 */ lui $s3, (0xB0E0C0FF >> 16) # lui $s3, 0xb0e0 /* 08D9E8 8008CDE8 3C12800E */ lui $s2, %hi(gIsInAdventureTwo) # $s2, 0x800e /* 08D9EC 8008CDEC 2652F494 */ addiu $s2, %lo(gIsInAdventureTwo) # addiu $s2, $s2, -0xb6c /* 08D9F0 8008CDF0 3673C0FF */ ori $s3, (0xB0E0C0FF & 0xFFFF) # ori $s3, $s3, 0xc0ff /* 08D9F4 8008CDF4 26B56550 */ addiu $s5, %lo(D_80126550) # addiu $s5, $s5, 0x6550 -/* 08D9F8 8008CDF8 261003CC */ addiu $s0, %lo(D_800E03CC) # addiu $s0, $s0, 0x3cc +/* 08D9F8 8008CDF8 261003CC */ addiu $s0, %lo(gFileSelectButtons) # addiu $s0, $s0, 0x3cc /* 08D9FC 8008CDFC 263164A0 */ addiu $s1, %lo(gSavefileInfo) # addiu $s1, $s1, 0x64a0 /* 08DA00 8008CE00 24140078 */ li $s4, 120 .L8008CE04: @@ -87,12 +87,12 @@ glabel render_file_select_menu /* 08DAB4 8008CEB4 0C0310F3 */ jal set_text_background_colour /* 08DAB8 8008CEB8 00003825 */ move $a3, $zero /* 08DABC 8008CEBC 3C118012 */ lui $s1, %hi(gSavefileInfo) # $s1, 0x8012 -/* 08DAC0 8008CEC0 3C10800E */ lui $s0, %hi(D_800E03CC) # $s0, 0x800e +/* 08DAC0 8008CEC0 3C10800E */ lui $s0, %hi(gFileSelectButtons) # $s0, 0x800e /* 08DAC4 8008CEC4 3C14800E */ lui $s4, %hi(D_800E03FC) # $s4, 0x800e /* 08DAC8 8008CEC8 3C13800E */ lui $s3, %hi(gMenuImageStack) # $s3, 0x800e /* 08DACC 8008CECC 2673F75C */ addiu $s3, %lo(gMenuImageStack) # addiu $s3, $s3, -0x8a4 /* 08DAD0 8008CED0 269403FC */ addiu $s4, %lo(D_800E03FC) # addiu $s4, $s4, 0x3fc -/* 08DAD4 8008CED4 261003CC */ addiu $s0, %lo(D_800E03CC) # addiu $s0, $s0, 0x3cc +/* 08DAD4 8008CED4 261003CC */ addiu $s0, %lo(gFileSelectButtons) # addiu $s0, $s0, 0x3cc /* 08DAD8 8008CED8 263164A0 */ addiu $s1, %lo(gSavefileInfo) # addiu $s1, $s1, 0x64a0 /* 08DADC 8008CEDC 2415000A */ li $s5, 10 .L8008CEE0: @@ -316,8 +316,8 @@ glabel render_file_select_menu .L8008D210: /* 08DE10 8008D210 12400018 */ beqz $s2, .L8008D274 /* 08DE14 8008D214 02E02025 */ move $a0, $s7 -/* 08DE18 8008D218 3C0D800E */ lui $t5, %hi(D_800E03CC) # $t5, 0x800e -/* 08DE1C 8008D21C 25AD03CC */ addiu $t5, %lo(D_800E03CC) # addiu $t5, $t5, 0x3cc +/* 08DE18 8008D218 3C0D800E */ lui $t5, %hi(gFileSelectButtons) # $t5, 0x800e +/* 08DE1C 8008D21C 25AD03CC */ addiu $t5, %lo(gFileSelectButtons) # addiu $t5, $t5, 0x3cc /* 08DE20 8008D220 00136100 */ sll $t4, $s3, 4 /* 08DE24 8008D224 018D8021 */ addu $s0, $t4, $t5 /* 08DE28 8008D228 8FA2007C */ lw $v0, 0x7c($sp) @@ -368,8 +368,8 @@ glabel render_file_select_menu .L8008D2D4: /* 08DED4 8008D2D4 12A00010 */ beqz $s5, .L8008D318 /* 08DED8 8008D2D8 02E02025 */ move $a0, $s7 -/* 08DEDC 8008D2DC 3C18800E */ lui $t8, %hi(D_800E03CC) # $t8, 0x800e -/* 08DEE0 8008D2E0 271803CC */ addiu $t8, %lo(D_800E03CC) # addiu $t8, $t8, 0x3cc +/* 08DEDC 8008D2DC 3C18800E */ lui $t8, %hi(gFileSelectButtons) # $t8, 0x800e +/* 08DEE0 8008D2E0 271803CC */ addiu $t8, %lo(gFileSelectButtons) # addiu $t8, $t8, 0x3cc /* 08DEE4 8008D2E4 00137900 */ sll $t7, $s3, 4 /* 08DEE8 8008D2E8 01F88021 */ addu $s0, $t7, $t8 /* 08DEEC 8008D2EC 860A0002 */ lh $t2, 2($s0) diff --git a/asm/non_matchings/menu/render_magic_codes_list_menu_text.s b/asm/non_matchings/menu/render_magic_codes_list_menu_text.s index e2e536d8..1953b07a 100644 --- a/asm/non_matchings/menu/render_magic_codes_list_menu_text.s +++ b/asm/non_matchings/menu/render_magic_codes_list_menu_text.s @@ -212,7 +212,7 @@ glabel render_magic_codes_list_menu_text /* 08B488 8008A888 02A02025 */ move $a0, $s5 /* 08B48C 8008A88C 31AE0008 */ andi $t6, $t5, 8 /* 08B490 8008A890 11C0000D */ beqz $t6, .L8008A8C8 -/* 08B494 8008A894 3C05800E */ lui $a1, %hi(D_800E043C) # $a1, 0x800e +/* 08B494 8008A894 3C05800E */ lui $a1, %hi(gMenuSelectionArrowDown) # $a1, 0x800e /* 08B498 8008A898 240F00FF */ li $t7, 255 /* 08B49C 8008A89C 241800FF */ li $t8, 255 /* 08B4A0 8008A8A0 241900FF */ li $t9, 255 @@ -221,7 +221,7 @@ glabel render_magic_codes_list_menu_text /* 08B4AC 8008A8AC AFB90018 */ sw $t9, 0x18($sp) /* 08B4B0 8008A8B0 AFB80014 */ sw $t8, 0x14($sp) /* 08B4B4 8008A8B4 AFAF0010 */ sw $t7, 0x10($sp) -/* 08B4B8 8008A8B8 24A5043C */ addiu $a1, %lo(D_800E043C) # addiu $a1, $a1, 0x43c +/* 08B4B8 8008A8B8 24A5043C */ addiu $a1, %lo(gMenuSelectionArrowDown) # addiu $a1, $a1, 0x43c /* 08B4BC 8008A8BC 240600A0 */ li $a2, 160 /* 08B4C0 8008A8C0 0C01E2AE */ jal render_textured_rectangle /* 08B4C4 8008A8C4 26470008 */ addiu $a3, $s2, 8 diff --git a/asm/non_matchings/menu/render_track_select_setup_ui.s b/asm/non_matchings/menu/render_track_select_setup_ui.s index 050a87c4..7660a3bf 100644 --- a/asm/non_matchings/menu/render_track_select_setup_ui.s +++ b/asm/non_matchings/menu/render_track_select_setup_ui.s @@ -659,10 +659,10 @@ glabel render_track_select_setup_ui /* 0924D4 800918D4 0000A025 */ move $s4, $zero /* 0924D8 800918D8 00154880 */ sll $t1, $s5, 2 /* 0924DC 800918DC 01354823 */ subu $t1, $t1, $s5 -/* 0924E0 800918E0 3C0A800E */ lui $t2, %hi(D_800E0624) # $t2, 0x800e +/* 0924E0 800918E0 3C0A800E */ lui $t2, %hi(gRaceSelectionImages) # $t2, 0x800e /* 0924E4 800918E4 3C0C800E */ lui $t4, %hi(D_800E06B0) # $t4, 0x800e /* 0924E8 800918E8 258C06B0 */ addiu $t4, %lo(D_800E06B0) # addiu $t4, $t4, 0x6b0 -/* 0924EC 800918EC 254A0624 */ addiu $t2, %lo(D_800E0624) # addiu $t2, $t2, 0x624 +/* 0924EC 800918EC 254A0624 */ addiu $t2, %lo(gRaceSelectionImages) # addiu $t2, $t2, 0x624 /* 0924F0 800918F0 00094080 */ sll $t0, $t1, 2 /* 0924F4 800918F4 3C118012 */ lui $s1, %hi(gPlayerSelectVehicle) # $s1, 0x8012 /* 0924F8 800918F8 00135840 */ sll $t3, $s3, 1 @@ -767,8 +767,8 @@ glabel render_track_select_setup_ui /* 092660 80091A60 17000019 */ bnez $t8, .L80091AC8 /* 092664 80091A64 00000000 */ nop /* 092668 80091A68 00760019 */ multu $v1, $s6 -/* 09266C 80091A6C 3C11800E */ lui $s1, %hi(D_800E0624) # $s1, 0x800e -/* 092670 80091A70 26310624 */ addiu $s1, %lo(D_800E0624) # addiu $s1, $s1, 0x624 +/* 09266C 80091A6C 3C11800E */ lui $s1, %hi(gRaceSelectionImages) # $s1, 0x800e +/* 092670 80091A70 26310624 */ addiu $s1, %lo(gRaceSelectionImages) # addiu $s1, $s1, 0x624 /* 092674 80091A74 8FCB0000 */ lw $t3, ($fp) /* 092678 80091A78 3C048012 */ lui $a0, %hi(sMenuCurrDisplayList) # $a0, 0x8012 /* 09267C 80091A7C 240900FF */ li $t1, 255 @@ -816,10 +816,10 @@ glabel render_track_select_setup_ui /* 092720 80091B20 8C42F4BC */ lw $v0, %lo(gNumberOfActivePlayers)($v0) /* 092724 80091B24 00000000 */ nop .L80091B28: -/* 092728 80091B28 3C11800E */ lui $s1, %hi(D_800E0624) # $s1, 0x800e +/* 092728 80091B28 3C11800E */ lui $s1, %hi(gRaceSelectionImages) # $s1, 0x800e /* 09272C 80091B2C 24010002 */ li $at, 2 /* 092730 80091B30 14410031 */ bne $v0, $at, .L80091BF8 -/* 092734 80091B34 26310624 */ addiu $s1, %lo(D_800E0624) # addiu $s1, $s1, 0x624 +/* 092734 80091B34 26310624 */ addiu $s1, %lo(gRaceSelectionImages) # addiu $s1, $s1, 0x624 /* 092738 80091B38 8FAA0074 */ lw $t2, 0x74($sp) /* 09273C 80091B3C 3C088012 */ lui $t0, %hi(gPlayerSelectVehicle) # $t0, 0x8012 /* 092740 80091B40 1540002D */ bnez $t2, .L80091BF8 @@ -923,8 +923,8 @@ glabel render_track_select_setup_ui /* 0928B4 80091CB4 8DA40220 */ lw $a0, 0x220($t5) /* 0928B8 80091CB8 0C031368 */ jal func_800C4DA0 /* 0928BC 80091CBC 00003025 */ move $a2, $zero -/* 0928C0 80091CC0 3C12800E */ lui $s2, %hi(D_800E06E4) # $s2, 0x800e -/* 0928C4 80091CC4 265206E4 */ addiu $s2, %lo(D_800E06E4) # addiu $s2, $s2, 0x6e4 +/* 0928C0 80091CC0 3C12800E */ lui $s2, %hi(gTwoPlayerRacerCountMenu) # $s2, 0x800e +/* 0928C4 80091CC4 265206E4 */ addiu $s2, %lo(gTwoPlayerRacerCountMenu) # addiu $s2, $s2, 0x6e4 /* 0928C8 80091CC8 86430004 */ lh $v1, 4($s2) /* 0928CC 80091CCC 3C048012 */ lui $a0, %hi(sMenuCurrDisplayList) # $a0, 0x8012 /* 0928D0 80091CD0 2478FFF4 */ addiu $t8, $v1, -0xc diff --git a/asm/non_matchings/objects/func_8000E2B4.s b/asm/non_matchings/objects/func_8000E2B4.s index 064c2d7f..1281f7d4 100644 --- a/asm/non_matchings/objects/func_8000E2B4.s +++ b/asm/non_matchings/objects/func_8000E2B4.s @@ -47,7 +47,7 @@ glabel func_8000E2B4 /* 00EF44 8000E344 8463C802 */ lh $v1, %lo(D_800DC7B8+0x4A)/*-0x37fe*/($v1) /* 00EF48 8000E348 00000000 */ nop .L8000E34C: -/* 00EF4C 8000E34C 0C01B6C5 */ jal func_8006DB14 +/* 00EF4C 8000E34C 0C01B6C5 */ jal set_level_default_vehicle /* 00EF50 8000E350 A7A30022 */ sh $v1, 0x22($sp) /* 00EF54 8000E354 87A30022 */ lh $v1, 0x22($sp) /* 00EF58 8000E358 93AD002D */ lbu $t5, 0x2d($sp) diff --git a/include/structs.h b/include/structs.h index 860ac11a..e5896c39 100644 --- a/include/structs.h +++ b/include/structs.h @@ -25,11 +25,11 @@ typedef struct Vec3f { /* Size: 0x20 bytes */ typedef struct MenuElement { // Element Position - /* 0x00 */ s16 left; + /* 0x00 */ s16 left; // Where the element spawns on entry. /* 0x02 */ s16 top; - /* 0x04 */ s16 center; + /* 0x04 */ s16 center; // Value of where the element moves to after entry /* 0x06 */ s16 middle; - /* 0x08 */ s16 right; + /* 0x08 */ s16 right; // Value of where the element moves to after exit /* 0x0A */ s16 bottom; // Element Color/Transparency /* 0x0C */ u8 filterRed; diff --git a/src/game.c b/src/game.c index 00082995..12109e4b 100644 --- a/src/game.c +++ b/src/game.c @@ -44,18 +44,18 @@ /************ .rodata ************/ -const char D_800E70B0[] = "LOADLEVEL Error: Level out of range\n"; -const char D_800E70D8[] = "BossLev problem\n"; -const char D_800E70EC[] = "AITABLE Error: Table out of range\n"; -const char D_800E7110[] = "1.1605"; -const char D_800E7118[] = "02/10/97 16:03"; -const char D_800E7128[] = "pmountain"; +UNUSED const char sLevelErrorString[] = "LOADLEVEL Error: Level out of range\n"; +UNUSED const char sBossErrorString[] = "BossLev problem\n"; +UNUSED const char sAITableErrorString[] = "AITABLE Error: Table out of range\n"; +UNUSED const char sDebugVersionInfoString[] = "1.1605"; +UNUSED const char sDebugBuildDateString[] = "02/10/97 16:03"; +UNUSED const char sDebugUsernameString[] = "pmountain"; -const char D_800E7134[] = "BBB\n"; -const char D_800E713C[] = "CAR"; -const char D_800E7140[] = "HOV"; -const char D_800E7144[] = "PLN"; -const char D_800E7148[] = "Swapping\n"; +const char D_800E7134[] = "BBB\n"; // Functionally unused. +UNUSED const char sDebugCarString[] = "CAR"; +UNUSED const char sDebugHovercraftString[] = "HOV"; +UNUSED const char sDebugPlaneString[] = "PLN"; +UNUSED const char sDebugVehicleSwapString[] = "Swapping\n"; /*********************************/ @@ -75,16 +75,14 @@ s16 D_800DD32C = 0; s8 D_800DD330 = 0; -// Unused -char *D_800DD334[6] = { +UNUSED char *sDebugRomBuildInfo[6] = { NULL, NULL, NULL, // These could be a file boundary. - (char *)D_800E7110, - (char *)D_800E7118, - (char *)D_800E7128 + (char *)sDebugVersionInfoString, + (char *)sDebugBuildDateString, + (char *)sDebugUsernameString }; -// Unused -char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman"; +UNUSED char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman"; s8 sAntiPiracyTriggered = 0; s32 D_800DD378 = 1; @@ -113,8 +111,8 @@ s32 sLogicUpdateRate = LOGIC_5FPS; FadeTransition D_800DD408 = FADE_TRANSITION(0, FADE_COLOR_WHITE, 30, -1); // Unused? // CAR / HOV / PLN - So this is vehicle type? -char *D_800DD410[3] = { - (char *)D_800E713C, (char *)D_800E7140, (char *)D_800E7144 +UNUSED char *D_800DD410[3] = { + (char *)sDebugCarString, (char *)sDebugHovercraftString, (char *)sDebugPlaneString }; FadeTransition D_800DD41C = FADE_TRANSITION(0, FADE_COLOR_BLACK, 30, -1); FadeTransition D_800DD424 = FADE_TRANSITION(0, FADE_COLOR_BLACK, 260, -1); @@ -162,11 +160,11 @@ s32 D_80123504; s32 D_80123508; s32 D_8012350C; Settings *gSettingsPtr; -s8 D_80123514; +s8 gIsLoading; s8 gIsPaused; s8 D_80123516; -s32 D_80123518; -s32 D_8012351C; +s32 gLevelDefaultVehicleID; +s32 D_8012351C; // Looks to be the current level's vehicle ID. s32 sBootDelayTimer; s8 D_80123524; s8 D_80123525; @@ -511,7 +509,7 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, } settings->courseId = levelId; if (temp == 0 && settings->worldId > 0) { - D_800DD314 = func_8006DB2C(); + D_800DD314 = get_level_default_vehicle(); } if (settings->worldId == 0 && temp > 0 && D_800DD314 != -1) { vehicleId = D_800DD314; @@ -617,16 +615,25 @@ s32 func_8006BD88(void) { return D_80121164; } +/** + * Return the race type ID of the current level. + */ u8 get_current_level_race_type(void) { return gCurrentLevelHeader->race_type; } +/** + * Return the header data of the current level. + */ LevelHeader *get_current_level_header(void) { return gCurrentLevelHeader; } -/* Unused? */ -u8 func_8006BDC0(void) { +/** + * Returns the amount of level headers there are in the game. + * Goes unused. + */ +UNUSED u8 get_total_level_header_count(void) { return gNumberOfLevelHeaders - 1; } @@ -833,13 +840,13 @@ void init_game(void) { s32 mode; init_main_memory_pool(); - func_800C6170(); + func_800C6170(); // Initialise gzip decompression related things sAntiPiracyTriggered = TRUE; if (check_imem_validity()) { sAntiPiracyTriggered = FALSE; } - D_80123514 = FALSE; - D_80123518 = 0; + gIsLoading = FALSE; + gLevelDefaultVehicleID = VEHICLE_CAR; if (osTvType == TV_TYPE_PAL) { mode = 14; @@ -849,14 +856,14 @@ void init_game(void) { mode = 28; } - osCreateScheduler(&gMainSched, &gSPTaskNum, /*priority*/ 13, (u8)mode, 1); + osCreateScheduler(&gMainSched, &gSPTaskNum, /*priority*/ 13, (u8) mode, 1); D_800DD3A0 = FALSE; if (!func_8006EFB8()) { D_800DD3A0 = TRUE; } - init_video(1, &gMainSched); + init_video(VIDEO_MODE_LOWRES_LPN, &gMainSched); func_80076BA0(); - func_80078100(&gMainSched); + setup_gfx_mesg_queues(&gMainSched); audio_init(&gMainSched); func_80008040(); // Should be very similar to func_8005F850 sControllerStatus = init_controllers(); @@ -978,7 +985,7 @@ void main_game_loop(void) { func_80066610(); if (D_800DD3F0 != 1) { if (D_800DD38C == 0) { - D_800DD380 = func_80077A54(); + D_800DD380 = wait_for_gfx_task(); } } else { D_800DD3F0 = 0; @@ -1041,7 +1048,7 @@ void func_8006CC14(void) { set_free_queue_state(0); if (D_800DD38C == 0) { if (D_800DD3F0 != 1) { - func_80077A54(); + wait_for_gfx_task(); } D_800DD38C = 1; } @@ -1311,7 +1318,7 @@ void func_8006CCF0(s32 updateRate) { func_8006CC14(); func_8006EC48(get_save_file_index()); if (sp40 != 0) { - D_80123514 = FALSE; + gIsLoading = FALSE; switch (sp40) { case 1: // Go to track select menu from "Select Track" option in tracks menu. @@ -1343,9 +1350,9 @@ void func_8006CCF0(s32 updateRate) { load_menu_with_level_background(MENU_CHARACTER_SELECT, 0x16, i); break; case 7: - D_80123514 = TRUE; + gIsLoading = TRUE; load_menu_with_level_background(MENU_UNKNOWN_23, -1, 0); - D_80123514 = FALSE; + gIsLoading = FALSE; break; case 8: load_menu_with_level_background(MENU_CREDITS, -1, 0); @@ -1355,7 +1362,7 @@ void func_8006CCF0(s32 updateRate) { if (D_80121250[2] == -1) { load_menu_with_level_background(MENU_UNUSED_8, -1, 0); } else { - D_80123514 = TRUE; + gIsLoading = TRUE; load_menu_with_level_background(MENU_UNKNOWN_5, -1, -1); } } else if (!(buttonHeldInputs & R_TRIG)) { @@ -1363,12 +1370,12 @@ void func_8006CCF0(s32 updateRate) { D_801234F4 = D_80121250[0]; D_80123504 = D_80121250[15]; D_80123508 = D_80121250[D_80121250[1] + 8]; - D_80123518 = func_8006B0AC(D_801234F4); + gLevelDefaultVehicleID = func_8006B0AC(D_801234F4); if (D_80123508 < 0) { D_80123508 = 0x64; } } - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); } else { func_8006EC48(get_save_file_index()); load_menu_with_level_background(MENU_TITLE, -1, 0); @@ -1378,7 +1385,7 @@ void func_8006CCF0(s32 updateRate) { if (D_801234F8 != 0) { D_80123516 = 0; func_8006CC14(); - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); func_8006EC48(get_save_file_index()); D_801234F8 = 0; } @@ -1448,10 +1455,10 @@ void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId) { func_80004A60(2, 32767); func_80065EA0(); - if (!D_80123514) { - D_80123514 = FALSE; + if (!gIsLoading) { + gIsLoading = FALSE; if (levelId < 0) { - D_80123514 = TRUE; + gIsLoading = TRUE; } else { load_level_3(levelId, -1, 0, 2, cutsceneId); } @@ -1463,16 +1470,22 @@ void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId) { D_80123504 = 0; } -void func_8006DB14(s32 arg0) { - D_80123518 = arg0; +/** + * Set the default vehicle option from the current loaded level. + */ +void set_level_default_vehicle(s32 vehicleID) { + gLevelDefaultVehicleID = vehicleID; } void func_8006DB20(s32 vehicleId) { D_8012351C = vehicleId; } -s32 func_8006DB2C(void) { - return D_80123518; +/** + * Get the default vehicle option, set by a loaded level. + */ +s32 get_level_default_vehicle(void) { + return gLevelDefaultVehicleID; } /** @@ -1492,8 +1505,8 @@ void load_level_3(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleI } void func_8006DBE4(void) { - if (!D_80123514) { - D_80123514 = TRUE; + if (!gIsLoading) { + gIsLoading = TRUE; set_free_queue_state(0); func_8006BEFC(); func_800C01D8(&D_800DD3F4); @@ -1502,7 +1515,7 @@ void func_8006DBE4(void) { func_800C30CC(); set_free_queue_state(2); } - D_80123514 = FALSE; + gIsLoading = FALSE; } void func_8006DC58(s32 updateRate) { @@ -1525,7 +1538,7 @@ void func_8006DCF8(s32 updateRate) { gIsPaused = FALSE; D_80123516 = 0; - if (!D_80123514 && D_801234F0) { + if (!gIsLoading && D_801234F0) { func_8006DC58(updateRate); } menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, updateRate); @@ -1540,13 +1553,13 @@ void func_8006DCF8(s32 updateRate) { gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); D_801234F4 = menuLoopResult & 0x7F; - D_80123518 = func_8006B0AC(D_801234F4); + gLevelDefaultVehicleID = func_8006B0AC(D_801234F4); D_80123504 = 0; D_80123508 = 0x64; sRenderContext = DRAW_GAME; gIsPaused = FALSE; D_80123516 = 0; - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); func_8006EC48(get_save_file_index()); return; } @@ -1563,7 +1576,7 @@ void func_8006DCF8(s32 updateRate) { D_80123504 = 0; D_80123508 = 0x64; sRenderContext = DRAW_GAME; - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); func_8006EC48(get_save_file_index()); break; case 1: @@ -1580,20 +1593,20 @@ void func_8006DCF8(s32 updateRate) { if (temp2 >= 0) { D_80123508 = temp2; } - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); func_8006EC48(get_save_file_index()); break; case 2: sRenderContext = DRAW_GAME; - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); break; case 3: sRenderContext = DRAW_GAME; D_801234F4 = D_80121250[0]; D_80123504 = D_80121250[15]; D_80123508 = D_80121250[D_80121250[1] + 8]; - D_80123518 = func_8006B0AC(D_801234F4); - load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); + gLevelDefaultVehicleID = func_8006B0AC(D_801234F4); + load_level_2(D_801234F4, D_80123500, D_80123504, gLevelDefaultVehicleID); break; default: load_menu_with_level_background(MENU_TITLE, -1, 0); @@ -1618,7 +1631,7 @@ void func_8006DCF8(s32 updateRate) { D_80123500 = gSettingsPtr->gObjectCount - 1; load_level_2(D_801234F4, D_80123500, D_80123504, temp); D_801234FC = 0; - D_80123518 = D_8012351C; + gLevelDefaultVehicleID = D_8012351C; return; } if (menuLoopResult > 0) { @@ -1627,7 +1640,7 @@ void func_8006DCF8(s32 updateRate) { gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); sRenderContext = DRAW_GAME; - func_8006CAE4(menuLoopResult, -1, D_80123518); + func_8006CAE4(menuLoopResult, -1, gLevelDefaultVehicleID); if (gSettingsPtr->newGame && !is_in_tracks_mode()) { func_80000B28(); gSettingsPtr->newGame = FALSE; @@ -1640,7 +1653,7 @@ GLOBAL_ASM("asm/non_matchings/game/func_8006DCF8.s") #endif void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId) { - if (!D_80123514) { + if (!gIsLoading) { func_8006DBE4(); if (get_thread30_level_id_to_load() == 0) { gCurrDisplayList = gDisplayLists[gSPTaskNum]; @@ -1650,10 +1663,10 @@ void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId) { } if (levelId != -1) { load_level_3(levelId, numberOfPlayers, 0, 2, cutsceneId); - D_80123514 = FALSE; + gIsLoading = FALSE; return; } - D_80123514 = TRUE; + gIsLoading = TRUE; } void calc_and_alloc_heap_for_settings(void) { diff --git a/src/game.h b/src/game.h index 0f664722..79ff21b5 100644 --- a/src/game.h +++ b/src/game.h @@ -46,12 +46,6 @@ extern s16 D_800DD32C; extern s8 D_800DD330; -// Unused? -extern char *D_800DD334[6]; - -// Unused? -extern char gBuildString[40]; - extern s8 sAntiPiracyTriggered; extern s32 D_800DD378; extern s32 D_800DD37C; @@ -101,7 +95,7 @@ void func_8006BD10(f32 arg0); s32 func_8006BD88(void); u8 get_current_level_race_type(void); LevelHeader *get_current_level_header(void); -u8 func_8006BDC0(void); +u8 get_total_level_header_count(void); u8 *get_level_name(s32 levelId); void func_8006BEFC(void); void func_8006BFC8(s8 *arg0); @@ -126,9 +120,9 @@ void func_8006D968(s8 *arg0); s32 get_render_context(void); UNUSED void func_8006DA1C(s32 arg0); void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId); -void func_8006DB14(s32 arg0); +void set_level_default_vehicle(s32 arg0); void func_8006DB20(s32 vehicleId); -s32 func_8006DB2C(void); +s32 get_level_default_vehicle(void); void load_level_3(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, s32 cutsceneId); void func_8006DBE4(void); void func_8006DC58(s32 arg0); diff --git a/src/menu.c b/src/menu.c index 3854cac3..054cf9fd 100644 --- a/src/menu.c +++ b/src/menu.c @@ -393,7 +393,18 @@ char gVersionDisplayText[20] = "VERSION XXXXXXXX"; // "Diddy Kong Racing" logo texture indices? s16 sGameTitleTileTextures[12] = { - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, -1 + TEXTURE_TITLE_SEGMENT_01, + TEXTURE_TITLE_SEGMENT_02, + TEXTURE_TITLE_SEGMENT_03, + TEXTURE_TITLE_SEGMENT_04, + TEXTURE_TITLE_SEGMENT_05, + TEXTURE_TITLE_SEGMENT_06, + TEXTURE_TITLE_SEGMENT_07, + TEXTURE_TITLE_SEGMENT_08, + TEXTURE_TITLE_SEGMENT_09, + TEXTURE_TITLE_SEGMENT_10, + TEXTURE_TITLE_SEGMENT_11, + -1 }; DrawTexture sGameTitleTileOffsets[12] = { @@ -665,10 +676,10 @@ u16 D_800E03BC[8] = { 0x00D0, }; -unk800E03CC D_800E03CC[3] = { - { 0x0018, 0x0051, 0x0058, 0x0040, 0x0004, 0x0004, 0x4080, 0xFFC0 }, - { 0x0074, 0x0051, 0x0058, 0x0040, 0x0004, 0x0004, 0x4080, 0xFFC0 }, - { 0x00D0, 0x0051, 0x0058, 0x0040, 0x0004, 0x0004, 0x4080, 0xFFC0 }, +ButtonElement gFileSelectButtons[3] = { + { 24, 81, 88, 64, 4, 4, GPACK_RGBA5551(64, 16, 0, 0), GPACK_RGBA5551(255, 255, 0, 0) }, // File A + { 116, 81, 88, 64, 4, 4, GPACK_RGBA5551(64, 16, 0, 0), GPACK_RGBA5551(255, 255, 0, 0) }, // File B + { 208, 81, 88, 64, 4, 4, GPACK_RGBA5551(64, 16, 0, 0), GPACK_RGBA5551(255, 255, 0, 0) }, // File C }; s16 D_800E03FC[10] = { @@ -680,26 +691,26 @@ s32 gMultiplayerSelectedNumberOfRacers = 0; s32 D_800E0414 = 0; s32 D_800E0418 = 0; -DrawTexture D_800E041C[2] = { { NULL, -12, -8 }, { NULL, 0, 0 }}; -DrawTexture D_800E042C[2] = { { NULL, -8, -12 }, { NULL, 0, 0 }}; -DrawTexture D_800E043C[2] = { { NULL, -12, -8 }, { NULL, 0, 0 }}; -DrawTexture D_800E044C[2] = { { NULL, -8, -12 }, { NULL, 0, 0 }}; +DrawTexture gMenuSelectionArrowUp[2] = { { NULL, -12, -8 }, { NULL, 0, 0 }}; +DrawTexture gMenuSelectionArrowLeft[2] = { { NULL, -8, -12 }, { NULL, 0, 0 }}; +DrawTexture gMenuSelectionArrowDown[2] = { { NULL, -12, -8 }, { NULL, 0, 0 }}; +DrawTexture gMenuSelectionArrowRight[2] = { { NULL, -8, -12 }, { NULL, 0, 0 }}; -DrawTexture D_800E045C[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; -DrawTexture D_800E0474[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; -DrawTexture D_800E048C[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; -DrawTexture D_800E04A4[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; -DrawTexture D_800E04BC[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; -DrawTexture D_800E04D4[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E04E4[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E04F4[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0504[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0514[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0524[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0534[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0544[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0554[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; -DrawTexture D_800E0564[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionCarTex[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionHoverTex[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionPlaneTex[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOn[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOff[3] = { { NULL, 0, 0 }, { NULL, 0, 32 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionCarOptHighlight[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionCarOpt[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionHoverOptHighlight[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionHoverOpt[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectioPlaneOptHighlight[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectioPlaneOpt[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOnOptHighlight[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOffOptHighlight[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOnOpt[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; +DrawTexture gRaceSelectionTTOffOpt[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; DrawTexture D_800E0574[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; DrawTexture D_800E0584[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; DrawTexture D_800E0594[2] = { { NULL, 0, 0 }, { NULL, 0, 0 } }; @@ -713,20 +724,20 @@ s32 D_800E05F4[8] = { 0, 0xFFD0, 0, 0xFFF0, 0, 0x10, 0, 0 }; DrawTexture D_800E0614[2] = { { NULL, -16, -16 }, { NULL, 0, 0 } }; -DrawTexture *D_800E0624[9] = { - D_800E045C, D_800E04D4, D_800E04E4, D_800E0474, D_800E04F4, D_800E0504, D_800E048C, D_800E0514, D_800E0524 +DrawTexture *gRaceSelectionImages[9] = { + gRaceSelectionCarTex, gRaceSelectionCarOptHighlight, gRaceSelectionCarOpt, gRaceSelectionHoverTex, gRaceSelectionHoverOptHighlight, gRaceSelectionHoverOpt, gRaceSelectionPlaneTex, gRaceSelectioPlaneOptHighlight, gRaceSelectioPlaneOpt }; DrawTexture *D_800E0648[6] = { - D_800E04BC, D_800E0544, D_800E0564, D_800E04A4, D_800E0534, D_800E0554 + gRaceSelectionTTOff, gRaceSelectionTTOffOptHighlight, gRaceSelectionTTOffOpt, gRaceSelectionTTOn, gRaceSelectionTTOnOptHighlight, gRaceSelectionTTOnOpt }; DrawTexture *D_800E0660[6] = { D_800E0574, D_800E0584, D_800E0594, D_800E05A4, D_800E05B4, D_800E05C4 }; -DrawTexture *D_800E0678[4] = { - D_800E041C, D_800E042C, D_800E043C, D_800E044C +DrawTexture *gMenuSelectionArrows[4] = { + gMenuSelectionArrowUp, gMenuSelectionArrowLeft, gMenuSelectionArrowDown, gMenuSelectionArrowRight }; u16 D_800E0688[20] = { @@ -751,12 +762,12 @@ s16 D_800E06D4[8] = { 0x0000, 0x004A, 0xFFAB, 0x0000, }; -s16 D_800E06E4[14] = { - 0x50, 0x8C, 0xA0, 0x40, 0x04, 0x04, 0x50, 0x14, 0x3A, 0x28, 0x50, 0x28, 0x66, 0x28 +ButtonTextElement gTwoPlayerRacerCountMenu = { + SCREEN_WIDTH_HALF - 80, 140, 160, 64, 4, 4, 80, 20, 58, 40, 80, 40, 102, 40 }; -s16 D_800E0700[8] = { - 0x50, 0x98, 0xA0, 0x28, 0x04, 0x04, 0x50, 0x0E +ButtonElement D_800E0700 = { + 80, 152, 160, 40, 4, 4, 80, 14 }; s16 D_800E0710[16] = { @@ -1225,7 +1236,7 @@ s16 D_800E1768[12] = { 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, -1, 0 }; -Gfx D_800E1780[11] = { +Gfx dCreditsFade[11] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetTextureLOD(G_TL_TILE), @@ -2387,7 +2398,7 @@ void menu_title_screen_init(void) { for (i = 0; i < 11; i++) { sGameTitleTileOffsets[i].texture = D_80126550[sGameTitleTileTextures[i]]; } - set_music_player_voice_limit(0x1B); + set_music_player_voice_limit(27); func_800660C0(); set_text_font(ASSET_FONTS_FUNFONT); load_font(ASSET_FONTS_BIGFONT); @@ -2429,7 +2440,7 @@ void func_8008377C(UNUSED s32 arg0, f32 arg1) { } if (!is_controller_missing()) { i = 0; - posY = (osTvType == TV_TYPE_PAL) ? 218 : 192; + posY = (osTvType == TV_TYPE_PAL) ? SCREEN_HEIGHT - 22 : SCREEN_HEIGHT - 48; set_text_font(ASSET_FONTS_FUNFONT); set_text_background_colour(0, 0, 0, 0); while(gTitleMenuStrings[i] != NULL) { @@ -2996,12 +3007,12 @@ void menu_save_options_init(void) { allocate_menu_images(D_800DFCAC); func_8007FFEC(0xA); load_font(ASSET_FONTS_BIGFONT); - D_800DFC10[0].texture = D_80126550[71]; - D_800DFC20[0].texture = D_80126550[72]; - D_800DFC30[0].texture = D_80126550[75]; - D_800DFC40[0].texture = D_80126550[74]; - D_800DFC50[0].texture = D_80126550[73]; - D_800DFC60[0].texture = D_80126550[70]; + D_800DFC10[0].texture = D_80126550[TEXTURE_ICON_SAVE_N64]; + D_800DFC20[0].texture = D_80126550[TEXTURE_ICON_SAVE_TT]; + D_800DFC30[0].texture = D_80126550[TEXTURE_ICON_SAVE_GHOSTS]; + D_800DFC40[0].texture = D_80126550[TEXTURE_ICON_SAVE_FILECABINET]; + D_800DFC50[0].texture = D_80126550[TEXTURE_ICON_SAVE_CPAK]; + D_800DFC60[0].texture = D_80126550[TEXTURE_ICON_SAVE_BIN]; func_8008E4B0(); func_8006EBA8(); func_800C01D8(&sMenuTransitionFadeOut); @@ -3069,7 +3080,7 @@ void func_80085B9C(UNUSED s32 updateRate) { yPos = (osTvType == TV_TYPE_PAL) ? SCREEN_HEIGHT_HALF_PAL : SCREEN_HEIGHT_HALF; yPos += ((s32) (D_801263BC & 0x1F) >> 1); var_s2 = 0; - tempTex = &D_800E043C[var_s2]; + tempTex = &gMenuSelectionArrowDown[var_s2]; do { render_textured_rectangle(&sMenuCurrDisplayList, tempTex, SCREEN_WIDTH_HALF, yPos, 255, 255, 255, 255); tempTex++; @@ -3676,7 +3687,7 @@ void render_controller_pak_ui(UNUSED s32 updateRate) { } if (D_801263D8 < (16 - sControllerPakMenuNumberOfRows)) { if ((D_801263BC & 8) != 0) { - render_textured_rectangle(&sMenuCurrDisplayList, D_800E043C, SCREEN_WIDTH_HALF, yPos + 8, 255, 255, 255, 255); + render_textured_rectangle(&sMenuCurrDisplayList, gMenuSelectionArrowDown, SCREEN_WIDTH_HALF, yPos + 8, 255, 255, 255, 255); func_8007B3D0(&sMenuCurrDisplayList); } } else { @@ -4123,7 +4134,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { return; } if (D_801263BC & 8) { - render_textured_rectangle(&sMenuCurrDisplayList, &D_800E043C, SCREEN_WIDTH_HALF, yPos + 8, 255, 255, 255, 255); + render_textured_rectangle(&sMenuCurrDisplayList, &gMenuSelectionArrowDown, SCREEN_WIDTH_HALF, yPos + 8, 255, 255, 255, 255); } } #else @@ -4700,7 +4711,7 @@ void menu_game_select_init(void) { for (i = 0; i <= D_801263E0; i++) { //Fakematch? What's the (i ^ 0)? - D_80126460[((i ^ 0) * 2) + 2].unk14_a.texture = D_80126550[67]; + D_80126460[((i ^ 0) * 2) + 2].unk14_a.texture = D_80126550[TEXTURE_SURFACE_BUTTON_WOOD]; } } @@ -4773,8 +4784,8 @@ s32 menu_game_select_loop(s32 updateRate) { } else { gIsInAdventureTwo = D_800DF460; gIsInTracksMode = FALSE; - gPlayerSelectVehicle[0] = 0; - func_8006DB14(0); + gPlayerSelectVehicle[PLAYER_ONE] = VEHICLE_CAR; + set_level_default_vehicle(VEHICLE_CAR); menu_init(MENU_FILE_SELECT); } return 0; @@ -4920,8 +4931,8 @@ void render_file_select_menu(UNUSED s32 updateRate) { } else { color = 0x6A9073FF; } - func_80080580(0, D_800E03CC[i].unk0 - 0xA0, 0x78 - D_800E03CC[i].unk2, D_800E03CC[i].unk4, - D_800E03CC[i].unk6, D_800E03CC[i].unk8, D_800E03CC[i].unkA, color, D_80126550[67]); + func_80080580(0, gFileSelectButtons[i].x - 0xA0, 0x78 - gFileSelectButtons[i].y, gFileSelectButtons[i].width, + gFileSelectButtons[i].height, gFileSelectButtons[i].borderWidth, gFileSelectButtons[i].borderHeight, color, D_80126550[TEXTURE_SURFACE_BUTTON_WOOD]); } func_80080BC8(&sMenuCurrDisplayList); if (D_801263D8 == 0) { @@ -4935,22 +4946,22 @@ void render_file_select_menu(UNUSED s32 updateRate) { if (gSavefileInfo[i].isAdventure2 != 0) { s2 = 0xC; } - render_menu_image(s2, D_800E03FC[2] + D_800E03CC[i].unk0, D_800E03FC[3] + D_800E03CC[i].unk2, 0, 0, 0, 128); + render_menu_image(s2, D_800E03FC[2] + gFileSelectButtons[i].x, D_800E03FC[3] + gFileSelectButtons[i].y, 0, 0, 0, 128); func_80068508(1); gMenuImageStack->unk18 = gSavefileInfo[i].balloonCount / s5; - render_menu_image(0, (D_800E03FC[6] + D_800E03CC[i].unk0) - 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 128); + render_menu_image(0, (D_800E03FC[6] + gFileSelectButtons[i].x) - 6, D_800E03FC[7] + gFileSelectButtons[i].y, 0, 0, 0, 128); gMenuImageStack->unk18 = gSavefileInfo[i].balloonCount % s5; - render_menu_image(0, D_800E03FC[6] + D_800E03CC[i].unk0 + 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 128); + render_menu_image(0, D_800E03FC[6] + gFileSelectButtons[i].x + 6, D_800E03FC[7] + gFileSelectButtons[i].y, 0, 0, 0, 128); func_80068508(0); sMenuGuiColourG = 64; sMenuGuiColourB = 64; - render_menu_image(s5, D_800E03FC[8] + D_800E03CC[i].unk0, D_800E03FC[9] + D_800E03CC[i].unk2, 0, 0, 0, 128); + render_menu_image(s5, D_800E03FC[8] + gFileSelectButtons[i].x, D_800E03FC[9] + gFileSelectButtons[i].y, 0, 0, 0, 128); sMenuGuiColourG = 255; sMenuGuiColourB = 255; func_8007BF1C(1); } else { set_text_colour(255, 255, 255, 64, 255); - draw_text(&sMenuCurrDisplayList, D_800E03FC[4] + D_800E03CC[i].unk0, D_800E03FC[5] + D_800E03CC[i].unk2 + y, gMenuText[ASSET_MENU_TEXT_NEW], ALIGN_MIDDLE_CENTER); + draw_text(&sMenuCurrDisplayList, D_800E03FC[4] + gFileSelectButtons[i].x, D_800E03FC[5] + gFileSelectButtons[i].y + y, gMenuText[ASSET_MENU_TEXT_NEW], ALIGN_MIDDLE_CENTER); } } } @@ -4976,8 +4987,8 @@ void render_file_select_menu(UNUSED s32 updateRate) { } if (s2) { s32 temp_t0 = phi_v0_2 | ~0xFF; - func_80080E90(&sMenuCurrDisplayList, D_800E03CC[i].unk0, D_800E03CC[i].unk2 + y, D_800E03CC[i].unk4, D_800E03CC[i].unk6, - D_800E03CC[i].unk8, D_800E03CC[i].unkA, temp_t0, temp_t0, temp_t0, temp_t0); + func_80080E90(&sMenuCurrDisplayList, gFileSelectButtons[i].x, gFileSelectButtons[i].y + y, gFileSelectButtons[i].width, gFileSelectButtons[i].height, + gFileSelectButtons[i].borderWidth, gFileSelectButtons[i].borderHeight, temp_t0, temp_t0, temp_t0, temp_t0); } if (D_80126CC0 == 0 || i != gSaveFileIndex) { trim_filename_string(gSavefileInfo[i].name, tempName); @@ -4985,7 +4996,7 @@ void render_file_select_menu(UNUSED s32 updateRate) { trim_filename_string(gFilenames[i], tempName); } if (tempName != NULL) { - draw_text(&sMenuCurrDisplayList, D_800E03FC[0] + D_800E03CC[i].unk0, D_800E03FC[1] + D_800E03CC[i].unk2 + y, tempName, ALIGN_MIDDLE_CENTER); + draw_text(&sMenuCurrDisplayList, D_800E03FC[0] + gFileSelectButtons[i].x, D_800E03FC[1] + gFileSelectButtons[i].y + y, tempName, ALIGN_MIDDLE_CENTER); } } } @@ -5374,8 +5385,8 @@ s32 menu_file_select_loop(s32 updateRate) { if (osTvType == TV_TYPE_PAL) { i = 12; } - func_80097874(i + 187, D_800E03CC[gSaveFileIndex].unk0 + D_800E03FC[0], - D_800E03CC[gSaveFileIndex].unk2 + D_800E03FC[1] + i, 0, &D_800E0FB0, gSavefileInfo[gSaveFileIndex].name, 3); + func_80097874(i + 187, gFileSelectButtons[gSaveFileIndex].x + D_800E03FC[0], + gFileSelectButtons[gSaveFileIndex].y + D_800E03FC[1] + i, 0, &D_800E0FB0, gSavefileInfo[gSaveFileIndex].name, 3); currentMenuDelay = 0; } } @@ -5433,20 +5444,20 @@ void func_8008E428(void) { unload_font(ASSET_FONTS_BIGFONT); } -void func_8008E45C(void) { - D_800E045C[0].texture = D_80126550[24]; - D_800E045C[1].texture = D_80126550[25]; - D_800E0474[0].texture = D_80126550[26]; - D_800E0474[1].texture = D_80126550[27]; - D_800E048C[0].texture = D_80126550[28]; - D_800E048C[1].texture = D_80126550[29]; +void assign_vehicle_icon_textures(void) { + gRaceSelectionCarTex[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_CAR_TOP]; + gRaceSelectionCarTex[1].texture = D_80126550[TEXTURE_ICON_VEHICLE_CAR_BOTTOM]; + gRaceSelectionHoverTex[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_HOVERCRAFT_TOP]; + gRaceSelectionHoverTex[1].texture = D_80126550[TEXTURE_ICON_VEHICLE_HOVERCRAFT_BOTTOM]; + gRaceSelectionPlaneTex[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_PLANE_TOP]; + gRaceSelectionPlaneTex[1].texture = D_80126550[TEXTURE_ICON_VEHICLE_PLANE_BOTTOM]; } void func_8008E4B0(void) { - D_800E041C[0].texture = D_80126550[61]; - D_800E042C[0].texture = D_80126550[60]; - D_800E043C[0].texture = D_80126550[63]; - D_800E044C[0].texture = D_80126550[62]; + gMenuSelectionArrowUp[0].texture = D_80126550[TEXTURE_ICON_ARROW_UP]; + gMenuSelectionArrowLeft[0].texture = D_80126550[TEXTURE_ICON_ARROW_LEFT]; + gMenuSelectionArrowDown[0].texture = D_80126550[TEXTURE_ICON_ARROW_DOWN]; + gMenuSelectionArrowRight[0].texture = D_80126550[TEXTURE_ICON_ARROW_RIGHT]; } GLOBAL_ASM("asm/non_matchings/menu/func_8008E4EC.s") @@ -5644,16 +5655,16 @@ void render_track_select_setup_ui(s32 updateRate) { if (s4 < temp) { s4 = temp; } - if (s4 < D_800E0700[2]) { - s4 = D_800E0700[2]; + if (s4 < D_800E0700.width) { + s4 = D_800E0700.width; } else { s4 += 0xC; } - func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - D_800E0700[1], s4, D_800E0700[3], - D_800E0700[4], D_800E0700[5], sMenuGuiOpacity + 0xB0E0C000, D_8012665C); + func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - D_800E0700.y, s4, D_800E0700.height, + D_800E0700.borderWidth, D_800E0700.borderHeight, sMenuGuiOpacity + 0xB0E0C000, D_8012665C); func_80080E6C(); set_text_font(ASSET_FONTS_FUNFONT); - s7 = D_800E0700[7] + D_800E0700[1] + sp80; + s7 = D_800E0700.colourMax + D_800E0700.y + sp80; s7++; for (i = 0; i < 2; i++) { for (j = 0; j < 4; j += 2) { @@ -5678,12 +5689,12 @@ void render_track_select_setup_ui(s32 updateRate) { draw_text(&sMenuCurrDisplayList, 56, 72 + sp80, gMenuText[ASSET_MENU_TEXT_BESTTIME], ALIGN_MIDDLE_LEFT); // "BEST TIME" draw_text(&sMenuCurrDisplayList, 56, 92 + sp80, gMenuText[ASSET_MENU_TEXT_BESTLAP], ALIGN_MIDDLE_LEFT); // "BEST LAP" set_text_colour(255, 128, 255, 96, sMenuGuiOpacity); - decompress_filename_string(settings->courseInitialsPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], &sp78, 3); + decompress_filename_string(settings->courseInitialsPtr[gPlayerSelectVehicle[PLAYER_ONE]][gTrackIdForPreview], &sp78, 3); draw_text(&sMenuCurrDisplayList, 250, 72 + sp80, &sp78, ALIGN_MIDDLE_CENTER); - decompress_filename_string(settings->flapInitialsPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], &sp78, 3); + decompress_filename_string(settings->flapInitialsPtr[gPlayerSelectVehicle[PLAYER_ONE]][gTrackIdForPreview], &sp78, 3); draw_text(&sMenuCurrDisplayList, 250, 92 + sp80, &sp78, ALIGN_MIDDLE_CENTER); - show_timestamp(settings->courseTimesPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], 22, 53, 128, 255, 255, 0); - show_timestamp(settings->flapTimesPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], 22, 33, 255, 192, 255, 0); + show_timestamp(settings->courseTimesPtr[gPlayerSelectVehicle[PLAYER_ONE]][gTrackIdForPreview], 22, 53, 128, 255, 255, FONT_COLOURFUL); + show_timestamp(settings->flapTimesPtr[gPlayerSelectVehicle[PLAYER_ONE]][gTrackIdForPreview], 22, 33, 255, 192, 255, FONT_COLOURFUL); if (D_801263E0 != -1) { if (gNumberOfActivePlayers == 1) { // Glow effect @@ -5732,13 +5743,13 @@ void render_track_select_setup_ui(s32 updateRate) { for (j = 0; j < gNumberOfActivePlayers; j++) { if (i == gPlayerSelectVehicle[j]) { // Highlighted - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[(i * 3) + 1], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[(i * 3) + 1], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else if (settings->courseFlagsPtr[gTrackIdForPreview] & 2) { // Not highlighted - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { // Not available (Ghosted out) - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity / 2); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity / 2); } } } @@ -5749,13 +5760,13 @@ void render_track_select_setup_ui(s32 updateRate) { } sp80 += 0x8B; s7 = sp80; - if (gPlayerSelectVehicle[0] == 2) { + if (gPlayerSelectVehicle[PLAYER_ONE] == 2) { s7 = sp80 + 2; } if (gNumberOfActivePlayers == 1) { if (D_801263E0 == 0) { // Draw vehicle image for one player - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x95, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[gPlayerSelectVehicle[PLAYER_ONE] * 3], 0x95, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { // Draw T.T. image for one player render_textured_rectangle(&sMenuCurrDisplayList, D_800E0648[D_800E0414 * 3], 0x95, sp80, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); @@ -5764,12 +5775,12 @@ void render_track_select_setup_ui(s32 updateRate) { if ((gNumberOfActivePlayers == 2) && (!sp74)) { s7 = sp80; // Draw vehicle image for first player - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x4F, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); - if (gPlayerSelectVehicle[1] == 2) { + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[gPlayerSelectVehicle[PLAYER_ONE] * 3], 0x4F, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); + if (gPlayerSelectVehicle[PLAYER_TWO] == 2) { s7 = sp80 + 2; } // Draw vehicle image for second player - render_textured_rectangle(&sMenuCurrDisplayList, D_800E0624[gPlayerSelectVehicle[1] * 3], 0xB0, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[gPlayerSelectVehicle[PLAYER_TWO] * 3], 0xB0, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } func_8007B3D0(&sMenuCurrDisplayList); @@ -5792,18 +5803,18 @@ void render_track_select_setup_ui(s32 updateRate) { if (sp74) { s32 temp_v0_12 = func_800C4DA0(gMenuText[ASSET_MENU_TEXT_NUMBEROFRACERS], 0, 0); // "NUMBER OF RACERS" - if ((D_800E06E4[2] - 0xC) < temp_v0_12) { + if ((gTwoPlayerRacerCountMenu.width - 0xC) < temp_v0_12) { s4 = temp_v0_12 + 0xC; } else { - s4 = D_800E06E4[2]; + s4 = gTwoPlayerRacerCountMenu.width; } - func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - D_800E06E4[1], s4, D_800E06E4[3], D_800E06E4[4], D_800E06E4[5], 0xB0E0C0FF, D_8012665C); + func_80080580(&sMenuCurrDisplayList, -(s4 >> 1), 0x78 - gTwoPlayerRacerCountMenu.y, s4, gTwoPlayerRacerCountMenu.height, gTwoPlayerRacerCountMenu.textPos[0], gTwoPlayerRacerCountMenu.textPos[1], 0xB0E0C0FF, D_8012665C); func_80080E6C(); set_text_font(ASSET_FONTS_FUNFONT); set_text_colour(0, 0, 0, 0xFF, 0x80); - draw_text(&sMenuCurrDisplayList, D_800E06E4[6] + D_800E06E4[0] + 1, D_800E06E4[7] + D_800E06E4[1] + 1, gMenuText[ASSET_MENU_TEXT_NUMBEROFRACERS], ALIGN_MIDDLE_CENTER); + draw_text(&sMenuCurrDisplayList, gTwoPlayerRacerCountMenu.textPos[2] + gTwoPlayerRacerCountMenu.x + 1, gTwoPlayerRacerCountMenu.textPos[3] + gTwoPlayerRacerCountMenu.y + 1, gMenuText[ASSET_MENU_TEXT_NUMBEROFRACERS], ALIGN_MIDDLE_CENTER); set_text_colour(0xFF, 0xFF, 0xFF, 0, 0xFF); - draw_text(&sMenuCurrDisplayList, D_800E06E4[6] + D_800E06E4[0] - 1, D_800E06E4[7] + D_800E06E4[1] - 1, gMenuText[ASSET_MENU_TEXT_NUMBEROFRACERS], ALIGN_MIDDLE_CENTER); + draw_text(&sMenuCurrDisplayList, gTwoPlayerRacerCountMenu.textPos[2] + gTwoPlayerRacerCountMenu.x - 1, gTwoPlayerRacerCountMenu.textPos[3] + gTwoPlayerRacerCountMenu.y - 1, gMenuText[ASSET_MENU_TEXT_NUMBEROFRACERS], ALIGN_MIDDLE_CENTER); func_80068508(1); func_8007BF1C(0); for (i = 0; i < 3; i++) { @@ -5818,9 +5829,9 @@ void render_track_select_setup_ui(s32 updateRate) { } } // X position - gMenuImageStack[0].unkC = (D_800E06E4[index + 8] + D_800E06E4[0]) - 0xA0; + gMenuImageStack[0].unkC = (gTwoPlayerRacerCountMenu.textPos[4 + index] + gTwoPlayerRacerCountMenu.x) - 0xA0; // Y position - gMenuImageStack[0].unk10 = (-D_800E06E4[index + 9] - D_800E06E4[1]) + 0x78; + gMenuImageStack[0].unk10 = (-gTwoPlayerRacerCountMenu.textPos[5 + index] - gTwoPlayerRacerCountMenu.y) + 0x78; // Number value to draw. gMenuImageStack[0].unk18 = index + 2; func_8009CA60(0); @@ -5915,7 +5926,7 @@ void menu_5_init(void) { D_801263BC = 0; gMenuDelay = 0; s0 = settings->unk4C->unk2; - gPlayerSelectVehicle[0] = func_8006B0AC(s0); + gPlayerSelectVehicle[PLAYER_ONE] = func_8006B0AC(s0); result = func_8006B14C(s0); if ((result == 5) || (result == 8) || (!(result & 0x40) && (!(settings->courseFlagsPtr[s0] & 2)))) { temp = D_800E0758[s0]; @@ -5934,15 +5945,15 @@ void menu_5_init(void) { D_801263E0 = 0; func_8009C674(D_800E0FB4); allocate_menu_images(D_800E0FD8); - func_8008E45C(); - D_800E04D4[0].texture = D_80126550[31]; - D_800E04E4[0].texture = D_80126550[30]; - D_800E04F4[0].texture = D_80126550[33]; - D_800E0504[0].texture = D_80126550[32]; - D_800E0514[0].texture = D_80126550[35]; - D_800E0524[0].texture = D_80126550[34]; - D_800E05B4[0].texture = D_80126550[48]; - D_800E0614[0].texture = D_80126550[94]; + assign_vehicle_icon_textures(); + gRaceSelectionCarOptHighlight[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_CAR_HIGHLIGHT]; + gRaceSelectionCarOpt[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_CAR]; + gRaceSelectionHoverOptHighlight[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_HOVERCRAFT_HIGHLIGHT]; + gRaceSelectionHoverOpt[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_HOVERCRAFT]; + gRaceSelectioPlaneOptHighlight[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_PLANE_HIGHLIGHT]; + gRaceSelectioPlaneOpt[0].texture = D_80126550[TEXTURE_ICON_VEHICLE_SELECT_PLANE]; + D_800E05B4[0].texture = D_80126550[TEXTURE_UNK_30]; + D_800E0614[0].texture = D_80126550[TEXTURE_UNK_5E]; func_800C01D8(&sMenuTransitionFadeOut); D_801263BC = 0; gMenuDelay = 0; @@ -5995,9 +6006,9 @@ s32 menu_5_loop(s32 updateRate) { D_801263BC = (D_801263BC + updateRate) & 0x3F; func_80092E94(updateRate, sp1C, sp20); if (sp1C < 2) { - gPlayerSelectVehicle[0] = func_8006B0AC(sp24); + gPlayerSelectVehicle[PLAYER_ONE] = func_8006B0AC(sp24); } - vehicle = gPlayerSelectVehicle[0]; + vehicle = gPlayerSelectVehicle[PLAYER_ONE]; sp30 = func_8006B0F8(sp24); vehicle2 = vehicle; func_8008E4EC(); @@ -6046,7 +6057,7 @@ s32 menu_5_loop(s32 updateRate) { } if (vehicle != vehicle2) { play_sound_global(SOUND_MENU_PICK2, NULL); - gPlayerSelectVehicle[0] = vehicle; + gPlayerSelectVehicle[PLAYER_ONE] = vehicle; } } } @@ -6333,17 +6344,17 @@ void n_alSeqpDelete(void) { n_alSynRemovePlayer(); } -void func_80094604(void) { - D_800E0A50[0].texture = D_80126550[50]; - D_800E0A60[0].texture = D_80126550[51]; - D_800E0A70[0].texture = D_80126550[52]; - D_800E0A90[0].texture = D_80126550[54]; - D_800E0A80[0].texture = D_80126550[53]; - D_800E0AA0[0].texture = D_80126550[55]; - D_800E0AB0[0].texture = D_80126550[56]; - D_800E0AC0[0].texture = D_80126550[57]; - D_800E0AD0[0].texture = D_80126550[58]; - D_800E0AE0[0].texture = D_80126550[59]; +void assign_racer_portrait_textures(void) { + D_800E0A50[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_KRUNCH]; + D_800E0A60[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_DIDDY]; + D_800E0A70[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_DRUMSTICK]; + D_800E0A90[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_BANJO]; + D_800E0A80[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_BUMPER]; + D_800E0AA0[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_CONKER]; + D_800E0AB0[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_TIPTUP]; + D_800E0AC0[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_TT]; + D_800E0AD0[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_PIPSY]; + D_800E0AE0[0].texture = D_80126550[TEXTURE_ICON_PORTRAIT_TIMBER]; } GLOBAL_ASM("asm/non_matchings/menu/func_80094688.s") @@ -6462,7 +6473,7 @@ void menu_11_init(void) { D_800E0988 = 0; func_8009C674(D_800E0A24); allocate_menu_images(D_800E0A40); - func_80094604(); + assign_racer_portrait_textures(); load_font(ASSET_FONTS_BIGFONT); func_800C01D8(&sMenuTransitionFadeOut); set_music_player_voice_limit(0x18); @@ -6842,7 +6853,7 @@ void menu_trophy_race_round_init(void) { gPlayerSelectVehicle[i] = func_8006B0AC(levelId); } - func_8006DB14(func_8006B0AC(levelId)); + set_level_default_vehicle(func_8006B0AC(levelId)); load_level_for_menu(levelId, -1, 1); gMenuDelay = 0; @@ -7034,8 +7045,8 @@ void menu_ghost_data_init(void) { D_800E169C[i + 6].texture = D_800E169C[0].texture; } } - func_8008E45C(); - func_80094604(); + assign_vehicle_icon_textures(); + assign_racer_portrait_textures(); func_8008E4B0(); D_801263BC = 0; D_801263E0 = 0; @@ -7196,7 +7207,7 @@ void func_8009ABD8(s8 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { void menu_23_init(void) { if (D_80126804 != 0) { func_8009C674(D_800E1768); - func_80094604(); + assign_racer_portrait_textures(); } load_level_for_menu(D_801267EC[0], D_801267EC[1], D_801267EC[2]); gMenuDelay = 0; @@ -7239,7 +7250,7 @@ void menu_credits_init(void) { func_80066818(0, 1); func_8009C674(D_800E17D8); allocate_menu_images(D_800E17F0); - func_80094604(); + assign_racer_portrait_textures(); load_font(ASSET_FONTS_BIGFONT); set_music_player_voice_limit(0x18); D_800E18F8 = (u16)0x1000; @@ -7278,18 +7289,21 @@ void menu_credits_init(void) { func_8006F564(1); } -void func_8009B1E4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - if (arg4 >= 0x100) { - arg4 = 0xFF; +/** + * Render a fading rectangle over the screen during the credits to serve as a transition between levels. + */ +void render_credits_fade(s32 x1, s32 y1, s32 x2, s32 y2, s32 a) { + if (a > 255) { + a = 255; } - if (arg4 < 0) { - arg4 = 0; + if (a < 0) { + a = 0; } - gSPDisplayList(sMenuCurrDisplayList++, D_800E1780); - gDPSetPrimColor(sMenuCurrDisplayList++, 0, 0, 0, 0, 0, arg4); + gSPDisplayList(sMenuCurrDisplayList++, dCreditsFade); + gDPSetPrimColor(sMenuCurrDisplayList++, 0, 0, 0, 0, 0, a); gDPSetCombineMode(sMenuCurrDisplayList++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - gDPFillRectangle(sMenuCurrDisplayList++, arg0, arg1, arg0 + arg2, arg1 + arg3); + gDPFillRectangle(sMenuCurrDisplayList++, x1, y1, x1 + x2, y1 + y2); gDPPipeSync(sMenuCurrDisplayList++); gDPSetPrimColor(sMenuCurrDisplayList++, 0, 0, 255, 255, 255, 255); diff --git a/src/menu.h b/src/menu.h index 104fdc4e..13f64244 100644 --- a/src/menu.h +++ b/src/menu.h @@ -166,16 +166,26 @@ typedef struct unk800DFA3C { u32* unkC; } unk800DFA3C; -typedef struct unk800E03CC { - s16 unk0; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; - s16 unkC; - s16 unkE; -} unk800E03CC; +typedef struct ButtonElement { + s16 x; + s16 y; + s16 width; + s16 height; + s16 borderWidth; // The glowing border that goes around this button + s16 borderHeight; + s16 colourMin; // The border oscillates between two colours in RGBA5551 format. + s16 colourMax; +} ButtonElement; + +typedef struct ButtonTextElement { + s16 x; + s16 y; + s16 width; + s16 height; + s16 borderWidth; + s16 borderHeight; + s16 textPos[8]; +} ButtonTextElement; /* Size: 0xE bytes. */ typedef struct unk801263CC { @@ -392,7 +402,7 @@ extern s16 D_800E0398[6]; extern s16 D_800E03A4[6]; -extern unk800E03CC D_800E03CC[3]; +extern ButtonElement gFileSelectButtons[3]; extern s16 D_800E03FC[10]; @@ -400,26 +410,26 @@ extern s32 gMultiplayerSelectedNumberOfRacers; extern s32 D_800E0414; extern s32 D_800E0418; -extern DrawTexture D_800E041C[2]; -extern DrawTexture D_800E042C[2]; -extern DrawTexture D_800E043C[2]; -extern DrawTexture D_800E044C[2]; +extern DrawTexture gMenuSelectionArrowUp[2]; +extern DrawTexture gMenuSelectionArrowLeft[2]; +extern DrawTexture gMenuSelectionArrowDown[2]; +extern DrawTexture gMenuSelectionArrowRight[2]; -extern DrawTexture D_800E045C[3]; -extern DrawTexture D_800E0474[3]; -extern DrawTexture D_800E048C[3]; -extern DrawTexture D_800E04A4[3]; -extern DrawTexture D_800E04BC[3]; -extern DrawTexture D_800E04D4[2]; -extern DrawTexture D_800E04E4[2]; -extern DrawTexture D_800E04F4[2]; -extern DrawTexture D_800E0504[2]; -extern DrawTexture D_800E0514[2]; -extern DrawTexture D_800E0524[2]; -extern DrawTexture D_800E0534[2]; -extern DrawTexture D_800E0544[2]; -extern DrawTexture D_800E0554[2]; -extern DrawTexture D_800E0564[2]; +extern DrawTexture gRaceSelectionCarTex[3]; +extern DrawTexture gRaceSelectionHoverTex[3]; +extern DrawTexture gRaceSelectionPlaneTex[3]; +extern DrawTexture gRaceSelectionTTOn[3]; +extern DrawTexture gRaceSelectionTTOff[3]; +extern DrawTexture gRaceSelectionCarOptHighlight[2]; +extern DrawTexture gRaceSelectionCarOpt[2]; +extern DrawTexture gRaceSelectionHoverOptHighlight[2]; +extern DrawTexture gRaceSelectionHoverOpt[2]; +extern DrawTexture gRaceSelectioPlaneOptHighlight[2]; +extern DrawTexture gRaceSelectioPlaneOpt[2]; +extern DrawTexture gRaceSelectionTTOnOptHighlight[2]; +extern DrawTexture gRaceSelectionTTOffOptHighlight[2]; +extern DrawTexture gRaceSelectionTTOnOpt[2]; +extern DrawTexture gRaceSelectionTTOffOpt[2]; extern DrawTexture D_800E0574[2]; extern DrawTexture D_800E0584[2]; extern DrawTexture D_800E0594[2]; @@ -433,13 +443,13 @@ extern s32 D_800E05F4[8]; extern DrawTexture D_800E0614[2]; -extern DrawTexture *D_800E0624[9]; +extern DrawTexture *gRaceSelectionImages[9]; extern DrawTexture *D_800E0648[6]; extern DrawTexture *D_800E0660[6]; -extern DrawTexture *D_800E0678[4]; +extern DrawTexture *gMenuSelectionArrows[4]; extern u16 D_800E0688[20]; @@ -449,9 +459,9 @@ extern s16 D_800E06C4[8]; extern s16 D_800E06D4[8]; -extern s16 D_800E06E4[14]; +extern ButtonTextElement gTwoPlayerRacerCountMenu; -extern s16 D_800E0700[8]; +extern ButtonElement D_800E0700; extern s16 D_800E0710[16]; @@ -563,7 +573,7 @@ extern s16 D_800E1754[10]; extern s16 D_800E1768[12]; -//extern u32 D_800E1780[22]; +//extern u32 dCreditsFade[22]; extern s16 D_800E17D8[12]; @@ -721,7 +731,7 @@ void func_8008CACC(void); void menu_file_select_init(void); void render_menu_image(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); void func_8008E428(void); -void func_8008E45C(void); +void assign_vehicle_icon_textures(void); void func_8008E4B0(void); void func_8008F534(void); void func_80090ED8(s32 updateRate); @@ -730,7 +740,7 @@ void menu_5_init(void); void func_80093A0C(void); void n_alSynRemovePlayer(void); void n_alSeqpDelete(void); -void func_80094604(void); +void assign_racer_portrait_textures(void); void func_80094C14(s32 arg0); void func_80096790(void); void menu_11_init(void); @@ -749,7 +759,7 @@ void func_8009ABD8(s8 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); void menu_23_init(void); void func_8009AF18(void); void menu_credits_init(void); -void func_8009B1E4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void render_credits_fade(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_8009BCF0(void); void func_8009BD5C(void); void func_8009BE54(); @@ -878,4 +888,138 @@ void func_800853D0(unk800861C8 *arg0, s32 arg1, s32 arg2); void render_enter_filename_ui(UNUSED s32 unused); void func_8008D8BC(s32 updateRate); +typedef enum MenuTextures { +/* 0x00 */ TEXTURE_UNK_00, +/* 0x01 */ TEXTURE_UNK_01, +/* 0x02 */ TEXTURE_UNK_02, +/* 0x03 */ TEXTURE_UNK_03, +/* 0x04 */ TEXTURE_UNK_04, +/* 0x05 */ TEXTURE_UNK_05, +/* 0x06 */ TEXTURE_UNK_06, +/* 0x07 */ TEXTURE_UNK_07, +/* 0x08 */ TEXTURE_UNK_08, +/* 0x09 */ TEXTURE_UNK_09, +/* 0x0A */ TEXTURE_UNK_0A, +/* 0x0B */ TEXTURE_UNK_0B, +/* 0x0C */ TEXTURE_UNK_0C, +/* 0x0D */ TEXTURE_UNK_0D, +/* 0x0E */ TEXTURE_UNK_0E, +/* 0x0F */ TEXTURE_UNK_0F, +/* 0x10 */ TEXTURE_UNK_10, +/* 0x11 */ TEXTURE_UNK_11, +/* 0x12 */ TEXTURE_UNK_12, +/* 0x13 */ TEXTURE_UNK_13, +/* 0x14 */ TEXTURE_UNK_14, +/* 0x15 */ TEXTURE_UNK_15, +/* 0x16 */ TEXTURE_UNK_16, +/* 0x17 */ TEXTURE_UNK_17, +/* 0x18 */ TEXTURE_ICON_VEHICLE_CAR_TOP, +/* 0x19 */ TEXTURE_ICON_VEHICLE_CAR_BOTTOM, +/* 0x1A */ TEXTURE_ICON_VEHICLE_HOVERCRAFT_TOP, +/* 0x1B */ TEXTURE_ICON_VEHICLE_HOVERCRAFT_BOTTOM, +/* 0x1C */ TEXTURE_ICON_VEHICLE_PLANE_TOP, +/* 0x1D */ TEXTURE_ICON_VEHICLE_PLANE_BOTTOM, +/* 0x1E */ TEXTURE_ICON_VEHICLE_SELECT_CAR, +/* 0x1F */ TEXTURE_ICON_VEHICLE_SELECT_CAR_HIGHLIGHT, +/* 0x20 */ TEXTURE_ICON_VEHICLE_SELECT_HOVERCRAFT, +/* 0x21 */ TEXTURE_ICON_VEHICLE_SELECT_HOVERCRAFT_HIGHLIGHT, +/* 0x22 */ TEXTURE_ICON_VEHICLE_SELECT_PLANE, +/* 0x23 */ TEXTURE_ICON_VEHICLE_SELECT_PLANE_HIGHLIGHT, +/* 0x24 */ TEXTURE_UNK_24, +/* 0x25 */ TEXTURE_UNK_25, +/* 0x26 */ TEXTURE_UNK_26, +/* 0x27 */ TEXTURE_UNK_27, +/* 0x28 */ TEXTURE_UNK_28, +/* 0x29 */ TEXTURE_UNK_29, +/* 0x2A */ TEXTURE_UNK_2A, +/* 0x2B */ TEXTURE_UNK_2B, +/* 0x2C */ TEXTURE_UNK_2C, +/* 0x2D */ TEXTURE_UNK_2D, +/* 0x2E */ TEXTURE_UNK_2E, +/* 0x2F */ TEXTURE_UNK_2F, +/* 0x30 */ TEXTURE_UNK_30, +/* 0x31 */ TEXTURE_UNK_31, +/* 0x32 */ TEXTURE_ICON_PORTRAIT_KRUNCH, +/* 0x33 */ TEXTURE_ICON_PORTRAIT_DIDDY, +/* 0x34 */ TEXTURE_ICON_PORTRAIT_DRUMSTICK, +/* 0x35 */ TEXTURE_ICON_PORTRAIT_BUMPER, +/* 0x36 */ TEXTURE_ICON_PORTRAIT_BANJO, +/* 0x37 */ TEXTURE_ICON_PORTRAIT_CONKER, +/* 0x38 */ TEXTURE_ICON_PORTRAIT_TIPTUP, +/* 0x39 */ TEXTURE_ICON_PORTRAIT_TT, +/* 0x3A */ TEXTURE_ICON_PORTRAIT_PIPSY, +/* 0x3B */ TEXTURE_ICON_PORTRAIT_TIMBER, +/* 0x3C */ TEXTURE_ICON_ARROW_LEFT, +/* 0x3D */ TEXTURE_ICON_ARROW_UP, +/* 0x3E */ TEXTURE_ICON_ARROW_RIGHT, +/* 0x3F */ TEXTURE_ICON_ARROW_DOWN, +/* 0x40 */ TEXTURE_ICON_BALLOON_GOLD, +/* 0x41 */ TEXTURE_ICON_BALLOON_DIAMOND, +/* 0x42 */ TEXTURE_ICON_MARKER_CROSS, +/* 0x43 */ TEXTURE_SURFACE_BUTTON_WOOD, +/* 0x44 */ TEXTURE_UNK_44, +/* 0x45 */ TEXTURE_UNK_45, +/* 0x46 */ TEXTURE_ICON_SAVE_BIN, +/* 0x47 */ TEXTURE_ICON_SAVE_N64, +/* 0x48 */ TEXTURE_ICON_SAVE_TT, +/* 0x49 */ TEXTURE_ICON_SAVE_CPAK, +/* 0x4A */ TEXTURE_ICON_SAVE_FILECABINET, +/* 0x4B */ TEXTURE_ICON_SAVE_GHOSTS, +/* 0x4C */ TEXTURE_UNK_4C, +/* 0x4D */ TEXTURE_UNK_4D, +/* 0x4E */ TEXTURE_UNK_4E, +/* 0x4F */ TEXTURE_UNK_4F, +/* 0x50 */ TEXTURE_TITLE_SEGMENT_01, +/* 0x51 */ TEXTURE_TITLE_SEGMENT_02, +/* 0x52 */ TEXTURE_TITLE_SEGMENT_03, +/* 0x53 */ TEXTURE_TITLE_SEGMENT_04, +/* 0x54 */ TEXTURE_TITLE_SEGMENT_05, +/* 0x55 */ TEXTURE_TITLE_SEGMENT_06, +/* 0x56 */ TEXTURE_TITLE_SEGMENT_07, +/* 0x57 */ TEXTURE_TITLE_SEGMENT_08, +/* 0x58 */ TEXTURE_TITLE_SEGMENT_09, +/* 0x59 */ TEXTURE_TITLE_SEGMENT_10, +/* 0x5A */ TEXTURE_TITLE_SEGMENT_11, +/* 0x5B */ TEXTURE_UNK_5B, +/* 0x5C */ TEXTURE_UNK_5C, +/* 0x5D */ TEXTURE_UNK_5D, +/* 0x5E */ TEXTURE_UNK_5E, +/* 0x5F */ TEXTURE_UNK_5F, +/* 0x60 */ TEXTURE_UNK_60, +/* 0x61 */ TEXTURE_UNK_61, +/* 0x62 */ TEXTURE_UNK_62, +/* 0x63 */ TEXTURE_UNK_63, +/* 0x64 */ TEXTURE_UNK_64, +/* 0x65 */ TEXTURE_UNK_65, +/* 0x66 */ TEXTURE_UNK_66, +/* 0x67 */ TEXTURE_UNK_67, +/* 0x68 */ TEXTURE_UNK_68, +/* 0x69 */ TEXTURE_UNK_69, +/* 0x6A */ TEXTURE_UNK_6A, +/* 0x6B */ TEXTURE_UNK_6B, +/* 0x6C */ TEXTURE_UNK_6C, +/* 0x6D */ TEXTURE_UNK_6D, +/* 0x6E */ TEXTURE_UNK_6E, +/* 0x6F */ TEXTURE_UNK_6F, +/* 0x70 */ TEXTURE_UNK_70, +/* 0x71 */ TEXTURE_UNK_71, +/* 0x72 */ TEXTURE_UNK_72, +/* 0x73 */ TEXTURE_UNK_73, +/* 0x74 */ TEXTURE_UNK_74, +/* 0x75 */ TEXTURE_UNK_75, +/* 0x76 */ TEXTURE_UNK_76, +/* 0x77 */ TEXTURE_UNK_77, +/* 0x78 */ TEXTURE_UNK_78, +/* 0x79 */ TEXTURE_UNK_79, +/* 0x7A */ TEXTURE_UNK_7A, +/* 0x7B */ TEXTURE_UNK_7B, +/* 0x7C */ TEXTURE_UNK_7C, +/* 0x7D */ TEXTURE_UNK_7D, +/* 0x7E */ TEXTURE_UNK_7E, +/* 0x7F */ TEXTURE_UNK_7F, + + NUM_MENU_TEXTURES + +} MenuTextures; + #endif diff --git a/src/objects.c b/src/objects.c index 61e84ed6..d2cf023b 100644 --- a/src/objects.c +++ b/src/objects.c @@ -650,7 +650,7 @@ void func_8000E2B4(void) { } else { object_id = D_800DC7B8[D_8011AD45 + 37]; } - func_8006DB14(D_8011AD45); + set_level_default_vehicle(D_8011AD45); sp2C.common.size = sp2C.common.size | ((s32) (object_id & 0x100) >> 1); sp2C.unkA = 0; sp2C.unk8 = 0; diff --git a/src/textures_sprites.c b/src/textures_sprites.c index 63c1f464..27385476 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -1073,6 +1073,7 @@ TextureHeader *func_8007B380(s32 arg0) { GLOBAL_ASM("asm/non_matchings/textures_sprites/func_8007B380.s") #endif +// Set after every draw call with ortho tris. Looks to reset some software side render flags. void func_8007B3D0(Gfx **dlist) { D_8012637C = NULL; D_80126374 = 0; diff --git a/src/unknown_078050.c b/src/unknown_078050.c index 6925685c..b71255ed 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -29,7 +29,7 @@ s32 D_800DE4CC = 0; unk800DE4D0 D_800DE4D0 = { NULL }; s32 gfxBufCounter = 0; s32 gfxBufCounter2 = 0; -s32 D_800DE4DC = 0; +s32 gGfxTaskIsRunning = FALSE; Gfx dRspInit[] = { gsSPClearGeometryMode(G_SHADE | G_SHADING_SMOOTH | G_CULL_FRONT | G_CULL_BACK | @@ -182,7 +182,7 @@ OSMesgQueue *osScInterruptQ; s32 setup_ostask_xbus(Gfx* dlBegin, Gfx* dlEnd, UNUSED s32 recvMesg) { DKR_OSTask *dkrtask; - D_800DE4DC = 1; + gGfxTaskIsRunning = TRUE; dkrtask = &gGfxTaskBuf[gfxBufCounter]; gfxBufCounter++; if (gfxBufCounter == 2) { @@ -364,13 +364,18 @@ UNUSED void setup_ostask_fifo_2(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) { } } -s32 func_80077A54(void) { +/** + * Called from the main game loop, will halt until a message comes through saying the graphics task + * has finished. + * Alternatively, if no task is active, then it will just skip. + */ +s32 wait_for_gfx_task(void) { OSMesg *mesg = NULL; - if (D_800DE4DC == 0) { + if (gGfxTaskIsRunning == FALSE) { return 0; } osRecvMesg(&D_80125ED8, &mesg, OS_MESG_BLOCK); - D_800DE4DC = 0; + gGfxTaskIsRunning = FALSE; return mesg[1]; } @@ -465,8 +470,8 @@ GLOBAL_ASM("asm/non_matchings/unknown_078050/render_background.s") #endif /** - * Gets the framebuffer height, then points to the start of segment 0x01 in memory. - * afterwards, alls the draw command that initialises all the rendermodes, ready for use. + * Gets the framebuffer width, then points to the start of segment 0x01 in memory. + * afterwards, calls the draw command that initialises all the rendermodes, ready for use. */ void init_rdp_and_framebuffer(Gfx **dlist) { s32 width = GET_VIDEO_WIDTH(get_video_width_and_height_as_s32()); @@ -482,7 +487,10 @@ void init_rsp(Gfx **dlist) { gSPDisplayList((*dlist)++, dRspInit); } -void func_80078100(OSSched *sc) { +/** + * Initialise the mesg queues for the gfx tasks, that interface with the scheduler. + */ +void setup_gfx_mesg_queues(OSSched *sc) { osScInterruptQ = osScGetInterruptQ(sc); osCreateMesgQueue(&D_80125EA0, &D_80125EB8, 1); osCreateMesgQueue(&D_80125EC0, D_80125EF0, 8); diff --git a/src/unknown_078050.h b/src/unknown_078050.h index b81bade3..3d9979fe 100644 --- a/src/unknown_078050.h +++ b/src/unknown_078050.h @@ -45,7 +45,7 @@ extern s32 D_800DE4CC; extern s32 gfxBufCounter; extern s32 gfxBufCounter2; -extern s32 D_800DE4DC; +extern s32 gGfxTaskIsRunning; // Defined in dkr.ld extern s8 rspF3DDKRDramStart[]; @@ -55,13 +55,13 @@ extern s8 rspF3DDKRDataXbusStart[]; extern s8 rspF3DDKRFifoStart[]; extern s8 rspF3DDKRDataFifoStart[]; -s32 func_80077A54(void); +s32 wait_for_gfx_task(void); void func_80077AAC(void *bufPtr, s32 arg1, UNUSED s32 arg2); void set_background_prim_colour(u8 arg0, u8 arg1, u8 arg2); void set_background_fill_colour(s32 red, s32 green, s32 blue); void init_rdp_and_framebuffer(Gfx **dlist); void init_rsp(Gfx **dlist); -void func_80078100(OSSched *sc); +void setup_gfx_mesg_queues(OSSched *sc); void func_80078170(u32 arg0, u32 arg1, u32 arg2); void func_80078778(s32 arg0, s32 arg1, s32 arg2, s32 arg3); void func_800787F0(void); diff --git a/src/video.c b/src/video.c index 09ebe0a9..73f12c42 100644 --- a/src/video.c +++ b/src/video.c @@ -145,11 +145,11 @@ void init_vi_settings(void) { } switch (gVideoModeIndex & 7) { - case 0: + case VIDEO_MODE_LOWRES_LAN: stubbed_printf("320 by 240 Point sampled, Non interlaced.\n"); osViSetMode(&osViModeTable[viModeTableIndex]); break; - case 1: + case VIDEO_MODE_LOWRES_LPN: //@bug: The video mode being set here is Point sampled //but the printf implies it was intended to be Anti-aliased. //By my understanding, this is the case we will always hit in code, @@ -171,7 +171,7 @@ void init_vi_settings(void) { } osViSetMode(&gTvViMode); break; - case 2: + case VIDEO_MODE_MEDRES_LPN: stubbed_printf("640 by 240 Point sampled, Non interlaced.\n"); tvViMode = &osViModeNtscLpn1; if (osTvType == TV_TYPE_PAL) { @@ -187,7 +187,7 @@ void init_vi_settings(void) { gTvViMode.fldRegs[1].origin = ORIGIN(HIGH_RES_SCREEN_WIDTH * 2); osViSetMode(&gTvViMode); break; - case 3: + case VIDEO_MODE_MEDRES_LAN: stubbed_printf("640 by 240 Anti-aliased, Non interlaced.\n"); tvViMode = &osViModeNtscLan1; if (osTvType == TV_TYPE_PAL) { @@ -202,19 +202,19 @@ void init_vi_settings(void) { gTvViMode.fldRegs[1].origin = ORIGIN(HIGH_RES_SCREEN_WIDTH * 2); osViSetMode(&gTvViMode); break; - case 4: + case VIDEO_MODE_HIGHRES_HPN: stubbed_printf("640 by 480 Point sampled, Interlaced.\n"); osViSetMode(&osViModeTable[viModeTableIndex + OS_VI_NTSC_HPN1]); break; - case 5: + case VIDEO_MODE_HIGHRES_HAN: stubbed_printf("640 by 480 Anti-aliased, Interlaced.\n"); osViSetMode(&osViModeTable[viModeTableIndex + OS_VI_NTSC_HAN1]); break; - case 6: + case VIDEO_MODE_HIGHRES_HPF: stubbed_printf("640 by 480 Point sampled, Interlaced, De-flickered.\n"); osViSetMode(&osViModeTable[viModeTableIndex + OS_VI_NTSC_HPF1]); break; - case 7: + case VIDEO_MODE_HIGHRES_HAF: stubbed_printf("640 by 480 Anti-aliased, Interlaced, De-flickered.\n"); osViSetMode(&osViModeTable[viModeTableIndex + OS_VI_NTSC_HAF1]); break; @@ -235,7 +235,7 @@ void init_framebuffer(s32 index) { } gVideoFbWidths[index] = gVideoModeResolutions[gVideoModeIndex & 7].width; gVideoFbHeights[index] = gVideoModeResolutions[gVideoModeIndex & 7].height; - if (gVideoModeIndex >= 2) { + if (gVideoModeIndex >= VIDEO_MODE_MIDRES_MASK) { gVideoFramebuffers[index] = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOUR_TAG_WHITE); gVideoFramebuffers[index] = (u16 *)(((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F); if (gVideoDepthBuffer == NULL) { diff --git a/src/video.h b/src/video.h index 696be505..9d92d093 100644 --- a/src/video.h +++ b/src/video.h @@ -56,6 +56,21 @@ enum LogicUpdateRates { LOGIC_5FPS = 12 }; +enum VideoModes { + VIDEO_MODE_LOWRES_LAN, + VIDEO_MODE_LOWRES_LPN, + VIDEO_MODE_MEDRES_LPN, + VIDEO_MODE_MEDRES_LAN, + VIDEO_MODE_HIGHRES_HPN, + VIDEO_MODE_HIGHRES_HAN, + VIDEO_MODE_HIGHRES_HPF, + VIDEO_MODE_HIGHRES_HAF, + + VIDEO_MODE_LOWRES_MASK = 0, + VIDEO_MODE_MIDRES_MASK = 2, + VIDEO_MODE_HIGHRES_MASK = 4 +}; + extern s32 gVideoRefreshRate; extern u16 *gVideoCurrFramebuffer;