From 6e1ac97c3af8e4bcaf48a77770407c469335638e Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Fri, 10 Dec 2021 09:40:34 +0000 Subject: [PATCH 01/11] Update generate_ld.py --- tools/python/generate_ld.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/python/generate_ld.py b/tools/python/generate_ld.py index 1164ad4c..3591922a 100644 --- a/tools/python/generate_ld.py +++ b/tools/python/generate_ld.py @@ -228,9 +228,7 @@ class GenerateLD: files.sort(key = lambda x: (x[2], x[3])) # Sort tuples by RAM address and prioritize src files first. return files -if os.path.exists('./dkr.ld'): - print("") -else: +if not os.path.exists('./dkr.ld') and os.path.exists('./assets/' + VERSION + '/md5.txt'): os.remove('./assets/' + VERSION + '/md5.txt') if os.path.exists('./assets/' + VERSION + '/md5.txt'): From 9286bad8b49cfb577134418a032a3073aa6f5f73 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:22:55 +0000 Subject: [PATCH 02/11] Menu, viewports and camera --- asm/non_matchings/menu/MenuBootLoop.s | 8 +- asm/non_matchings/menu/draw_menu_elements.s | 40 +- asm/non_matchings/menu/func_80080580.s | 20 +- asm/non_matchings/menu/func_80080BC8.s | 20 +- asm/non_matchings/menu/func_80080E90.s | 12 +- asm/non_matchings/menu/func_80081C04.s | 36 +- asm/non_matchings/menu/func_8008377C.s | 12 +- asm/non_matchings/menu/func_800853D0.s | 16 +- asm/non_matchings/menu/func_800890AC.s | 16 +- asm/non_matchings/menu/func_8008B4C8.s | 4 +- asm/non_matchings/menu/func_8008B758.s | 4 +- asm/non_matchings/menu/func_8008F00C.s | 2 +- asm/non_matchings/menu/func_8008FA54.s | 6 +- asm/non_matchings/menu/func_800904E8.s | 2 +- asm/non_matchings/menu/func_80090918.s | 16 +- asm/non_matchings/menu/func_80092188.s | 16 +- asm/non_matchings/menu/func_80092E94.s | 8 +- asm/non_matchings/menu/func_80094A5C.s | 2 +- asm/non_matchings/menu/func_80094D28.s | 8 +- asm/non_matchings/menu/func_80095728.s | 24 +- asm/non_matchings/menu/func_80096978.s | 24 +- asm/non_matchings/menu/func_80099E8C.s | 12 +- asm/non_matchings/menu/func_8009CA60.s | 36 +- asm/non_matchings/menu/func_8009CD7C.s | 4 +- asm/non_matchings/menu/func_8009E3D0.s | 4 +- asm/non_matchings/menu/menu_5_loop.s | 12 +- .../menu/menu_audio_options_loop.s | 4 +- asm/non_matchings/menu/menu_credits_loop.s | 4 +- .../menu/menu_file_select_loop.s | 8 +- .../menu/menu_game_select_init.s | 4 +- .../menu/menu_game_select_loop.s | 8 +- asm/non_matchings/menu/menu_ghost_data_init.s | 6 +- asm/non_matchings/menu/menu_ghost_data_loop.s | 8 +- .../menu/menu_magic_codes_list_loop.s | 4 +- .../menu/menu_magic_codes_loop.s | 4 +- asm/non_matchings/menu/menu_options_loop.s | 4 +- asm/non_matchings/menu/menu_results_loop.s | 8 +- .../menu/menu_save_options_loop.s | 4 +- .../menu/menu_title_screen_loop.s | 20 +- .../menu/menu_track_select_init.s | 12 +- .../menu/menu_track_select_loop.s | 4 +- .../menu/menu_trophy_race_rankings_init.s | 2 +- .../menu/menu_trophy_race_rankings_loop.s | 4 +- .../menu/menu_trophy_race_round_loop.s | 4 +- .../menu/render_file_select_menu.s | 28 +- .../menu/render_track_select_setup_ui.s | 44 +- asm/non_matchings/menu/tt_menu_loop.s | 4 +- .../unknown_032760/func_80039330.s | 4 +- asm/non_matchings/unknown_06B2B0/load_level.s | 2 +- .../unknown_078050/render_background.s | 30 +- src/camera.c | 286 ++++---- src/camera.h | 50 +- src/font.c | 6 +- src/font.h | 1 + src/menu.c | 653 ++++++++++-------- src/menu.h | 47 +- src/unknown_06B2B0.c | 8 +- src/unknown_078050.c | 55 +- src/unknown_078050.h | 12 +- 59 files changed, 899 insertions(+), 807 deletions(-) diff --git a/asm/non_matchings/menu/MenuBootLoop.s b/asm/non_matchings/menu/MenuBootLoop.s index 68cdeb1c..7334a874 100644 --- a/asm/non_matchings/menu/MenuBootLoop.s +++ b/asm/non_matchings/menu/MenuBootLoop.s @@ -81,8 +81,8 @@ glabel menu_boot_loop /* 08932C 8008872C AFA50030 */ sw $a1, 0x30($sp) /* 089330 80088730 8FA50030 */ lw $a1, 0x30($sp) /* 089334 80088734 14400006 */ bnez $v0, .L80088750 -/* 089338 80088738 3C04800E */ lui $a0, %hi(D_800DF76C) # $a0, 0x800e -/* 08933C 8008873C 2484F76C */ addiu $a0, %lo(D_800DF76C) # addiu $a0, $a0, -0x894 +/* 089338 80088738 3C04800E */ lui $a0, %hi(sMenuTransitionFadeInFast) # $a0, 0x800e +/* 08933C 8008873C 2484F76C */ addiu $a0, %lo(sMenuTransitionFadeInFast) # addiu $a0, $a0, -0x894 /* 089340 80088740 0C030076 */ jal func_800C01D8 /* 089344 80088744 AFA50030 */ sw $a1, 0x30($sp) /* 089348 80088748 8FA50030 */ lw $a1, 0x30($sp) @@ -100,7 +100,7 @@ glabel menu_boot_loop .L8008876C: /* 08936C 8008876C 10200011 */ beqz $at, .L800887B4 /* 089370 80088770 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 -/* 089374 80088774 3C05800E */ lui $a1, %hi(D_800DF7DC) # $a1, 0x800e +/* 089374 80088774 3C05800E */ lui $a1, %hi(sGameTitleTileOffsets) # $a1, 0x800e /* 089378 80088778 240D00FF */ li $t5, 255 /* 08937C 8008877C 240E00FF */ li $t6, 255 /* 089380 80088780 240F00FF */ li $t7, 255 @@ -109,7 +109,7 @@ glabel menu_boot_loop /* 08938C 8008878C AFAF0018 */ sw $t7, 0x18($sp) /* 089390 80088790 AFAE0014 */ sw $t6, 0x14($sp) /* 089394 80088794 AFAD0010 */ sw $t5, 0x10($sp) -/* 089398 80088798 24A5F7DC */ addiu $a1, %lo(D_800DF7DC) # addiu $a1, $a1, -0x824 +/* 089398 80088798 24A5F7DC */ addiu $a1, %lo(sGameTitleTileOffsets) # addiu $a1, $a1, -0x824 /* 08939C 8008879C 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 0893A0 800887A0 0C01E2AE */ jal render_textured_rectangle /* 0893A4 800887A4 240600A0 */ li $a2, 160 diff --git a/asm/non_matchings/menu/draw_menu_elements.s b/asm/non_matchings/menu/draw_menu_elements.s index 8add2aae..41c146e0 100644 --- a/asm/non_matchings/menu/draw_menu_elements.s +++ b/asm/non_matchings/menu/draw_menu_elements.s @@ -36,10 +36,10 @@ glabel draw_menu_elements /* 082E60 80082260 12200175 */ beqz $s1, .L80082838 /* 082E64 80082264 3C17800E */ lui $s7, %hi(D_800DF7A0) # $s7, 0x800e /* 082E68 80082268 3C1E800E */ lui $fp, %hi(D_800DF79C) # $fp, 0x800e -/* 082E6C 8008226C 3C14800E */ lui $s4, %hi(D_800DF75C) # $s4, 0x800e +/* 082E6C 8008226C 3C14800E */ lui $s4, %hi(gMenuImageStack) # $s4, 0x800e /* 082E70 80082270 4481B000 */ mtc1 $at, $f22 /* 082E74 80082274 8FA40070 */ lw $a0, 0x70($sp) -/* 082E78 80082278 2694F75C */ addiu $s4, %lo(D_800DF75C) # addiu $s4, $s4, -0x8a4 +/* 082E78 80082278 2694F75C */ addiu $s4, %lo(gMenuImageStack) # addiu $s4, $s4, -0x8a4 /* 082E7C 8008227C 27DEF79C */ addiu $fp, %lo(D_800DF79C) # addiu $fp, $fp, -0x864 /* 082E80 80082280 26F7F7A0 */ addiu $s7, %lo(D_800DF7A0) # addiu $s7, $s7, -0x860 .L80082284: @@ -171,8 +171,8 @@ glabel L80082454 /* 083060 80082460 0000A825 */ move $s5, $zero .L80082464: /* 083064 80082464 92180010 */ lbu $t8, 0x10($s0) -/* 083068 80082468 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e -/* 08306C 8008246C AC38F764 */ sw $t8, %lo(D_800DF764)($at) +/* 083068 80082468 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e +/* 08306C 8008246C AC38F764 */ sw $t8, %lo(sMenuGuiOpacity)($at) /* 083070 80082470 8E190014 */ lw $t9, 0x14($s0) /* 083074 80082474 920A000D */ lbu $t2, 0xd($s0) /* 083078 80082478 9207000C */ lbu $a3, 0xc($s0) @@ -340,23 +340,23 @@ glabel L80082608 /* 0832E8 800826E8 000E7940 */ sll $t7, $t6, 5 /* 0832EC 800826EC 01AFC821 */ addu $t9, $t5, $t7 /* 0832F0 800826F0 46169102 */ mul.s $f4, $f18, $f22 -/* 0832F4 800826F4 3C01800E */ lui $at, %hi(D_800DF4A4) # $at, 0x800e +/* 0832F4 800826F4 3C01800E */ lui $at, %hi(sMenuGuiColourR) # $at, 0x800e /* 0832F8 800826F8 E7240008 */ swc1 $f4, 8($t9) /* 0832FC 800826FC 920C000C */ lbu $t4, 0xc($s0) /* 083300 80082700 00000000 */ nop -/* 083304 80082704 A02CF4A4 */ sb $t4, %lo(D_800DF4A4)($at) +/* 083304 80082704 A02CF4A4 */ sb $t4, %lo(sMenuGuiColourR)($at) /* 083308 80082708 920B000D */ lbu $t3, 0xd($s0) -/* 08330C 8008270C 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 083310 80082710 A02BF4A8 */ sb $t3, %lo(D_800DF4A8)($at) +/* 08330C 8008270C 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 083310 80082710 A02BF4A8 */ sb $t3, %lo(sMenuGuiColourG)($at) /* 083314 80082714 9208000E */ lbu $t0, 0xe($s0) -/* 083318 80082718 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e -/* 08331C 8008271C A028F4AC */ sb $t0, %lo(D_800DF4AC)($at) +/* 083318 80082718 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e +/* 08331C 8008271C A028F4AC */ sb $t0, %lo(sMenuGuiColourB)($at) /* 083320 80082720 9209000F */ lbu $t1, 0xf($s0) /* 083324 80082724 3C01800E */ lui $at, %hi(D_800DF4B0) # $at, 0x800e /* 083328 80082728 A029F4B0 */ sb $t1, %lo(D_800DF4B0)($at) /* 08332C 8008272C 920A0010 */ lbu $t2, 0x10($s0) -/* 083330 80082730 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e -/* 083334 80082734 AC2AF764 */ sw $t2, %lo(D_800DF764)($at) +/* 083330 80082730 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e +/* 083334 80082734 AC2AF764 */ sw $t2, %lo(sMenuGuiOpacity)($at) /* 083338 80082738 8E040014 */ lw $a0, 0x14($s0) /* 08333C 8008273C 0C027298 */ jal func_8009CA60 /* 083340 80082740 00000000 */ nop @@ -432,17 +432,17 @@ glabel L800827C0 /* 083444 80082844 02C02025 */ move $a0, $s6 /* 083448 80082848 240200FF */ li $v0, 255 .L8008284C: -/* 08344C 8008284C 3C01800E */ lui $at, %hi(D_800DF4A4) # $at, 0x800e -/* 083450 80082850 A022F4A4 */ sb $v0, %lo(D_800DF4A4)($at) -/* 083454 80082854 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 083458 80082858 A022F4A8 */ sb $v0, %lo(D_800DF4A8)($at) -/* 08345C 8008285C 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e -/* 083460 80082860 A022F4AC */ sb $v0, %lo(D_800DF4AC)($at) +/* 08344C 8008284C 3C01800E */ lui $at, %hi(sMenuGuiColourR) # $at, 0x800e +/* 083450 80082850 A022F4A4 */ sb $v0, %lo(sMenuGuiColourR)($at) +/* 083454 80082854 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 083458 80082858 A022F4A8 */ sb $v0, %lo(sMenuGuiColourG)($at) +/* 08345C 8008285C 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e +/* 083460 80082860 A022F4AC */ sb $v0, %lo(sMenuGuiColourB)($at) /* 083464 80082864 3C01800E */ lui $at, %hi(D_800DF4B0) # $at, 0x800e /* 083468 80082868 A020F4B0 */ sb $zero, %lo(D_800DF4B0)($at) -/* 08346C 8008286C 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e +/* 08346C 8008286C 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e /* 083470 80082870 240D00FF */ li $t5, 255 -/* 083474 80082874 AC2DF764 */ sw $t5, %lo(D_800DF764)($at) +/* 083474 80082874 AC2DF764 */ sw $t5, %lo(sMenuGuiOpacity)($at) .L80082878: /* 083478 80082878 8FBF006C */ lw $ra, 0x6c($sp) /* 08347C 8008287C C7B50038 */ lwc1 $f21, 0x38($sp) diff --git a/asm/non_matchings/menu/func_80080580.s b/asm/non_matchings/menu/func_80080580.s index 53598c02..197f48c1 100644 --- a/asm/non_matchings/menu/func_80080580.s +++ b/asm/non_matchings/menu/func_80080580.s @@ -274,10 +274,10 @@ glabel func_80080580 /* 0815B0 800809B0 24190001 */ li $t9, 1 /* 0815B4 800809B4 ADF90018 */ sw $t9, 0x18($t7) /* 0815B8 800809B8 8EE20000 */ lw $v0, ($s7) -/* 0815BC 800809BC 3C19800E */ lui $t9, %hi(D_800E1C70) # $t9, 0x800e +/* 0815BC 800809BC 3C19800E */ lui $t9, %hi(dMenuHudSettings) # $t9, 0x800e /* 0815C0 800809C0 244E0008 */ addiu $t6, $v0, 8 /* 0815C4 800809C4 AEEE0000 */ sw $t6, ($s7) -/* 0815C8 800809C8 27391C70 */ addiu $t9, %lo(D_800E1C70) # addiu $t9, $t9, 0x1c70 +/* 0815C8 800809C8 27391C70 */ addiu $t9, %lo(dMenuHudSettings) # addiu $t9, $t9, 0x1c70 /* 0815CC 800809CC 3C180600 */ lui $t8, 0x600 /* 0815D0 800809D0 AC580000 */ sw $t8, ($v0) /* 0815D4 800809D4 10C0001C */ beqz $a2, .L80080A48 @@ -286,10 +286,10 @@ glabel func_80080580 /* 0815E0 800809E0 3C0E0702 */ lui $t6, (0x07020010 >> 16) # lui $t6, 0x702 /* 0815E4 800809E4 244F0008 */ addiu $t7, $v0, 8 /* 0815E8 800809E8 AEEF0000 */ sw $t7, ($s7) - # D_800E1C70 - 0x7FFFFFC0 = 0xE1CB0 -/* 0815EC 800809EC 3C18000E */ lui $t8, %hi(D_800E1C70 - 0x7FFFFFC0) # $t8, 0xe - # D_800E1C70 - 0x7FFFFFC0 = 0xE1CB0 -/* 0815F0 800809F0 27181CB0 */ addiu $t8, %lo(D_800E1C70 - 0x7FFFFFC0) # addiu $t8, $t8, 0x1cb0 + # dMenuHudSettings - 0x7FFFFFC0 = 0xE1CB0 +/* 0815EC 800809EC 3C18000E */ lui $t8, %hi(dMenuHudSettings - 0x7FFFFFC0) # $t8, 0xe + # dMenuHudSettings - 0x7FFFFFC0 = 0xE1CB0 +/* 0815F0 800809F0 27181CB0 */ addiu $t8, %lo(dMenuHudSettings - 0x7FFFFFC0) # addiu $t8, $t8, 0x1cb0 /* 0815F4 800809F4 35CE0010 */ ori $t6, (0x07020010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 0815F8 800809F8 AC4E0000 */ sw $t6, ($v0) /* 0815FC 800809FC AC580004 */ sw $t8, 4($v0) @@ -316,10 +316,10 @@ glabel func_80080580 /* 08164C 80080A4C 3C0E0702 */ lui $t6, (0x07020010 >> 16) # lui $t6, 0x702 /* 081650 80080A50 244F0008 */ addiu $t7, $v0, 8 /* 081654 80080A54 AEEF0000 */ sw $t7, ($s7) - # D_800E1C70 - 0x7FFFFFD0 = 0xE1CA0 -/* 081658 80080A58 3C19000E */ lui $t9, %hi(D_800E1C70 - 0x7FFFFFD0) # $t9, 0xe - # D_800E1C70 - 0x7FFFFFD0 = 0xE1CA0 -/* 08165C 80080A5C 27391CA0 */ addiu $t9, %lo(D_800E1C70 - 0x7FFFFFD0) # addiu $t9, $t9, 0x1ca0 + # dMenuHudSettings - 0x7FFFFFD0 = 0xE1CA0 +/* 081658 80080A58 3C19000E */ lui $t9, %hi(dMenuHudSettings - 0x7FFFFFD0) # $t9, 0xe + # dMenuHudSettings - 0x7FFFFFD0 = 0xE1CA0 +/* 08165C 80080A5C 27391CA0 */ addiu $t9, %lo(dMenuHudSettings - 0x7FFFFFD0) # addiu $t9, $t9, 0x1ca0 /* 081660 80080A60 35CE0010 */ ori $t6, (0x07020010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 081664 80080A64 0000F825 */ move $ra, $zero /* 081668 80080A68 3C098000 */ lui $t1, 0x8000 diff --git a/asm/non_matchings/menu/func_80080BC8.s b/asm/non_matchings/menu/func_80080BC8.s index 4f307d8f..758f9301 100644 --- a/asm/non_matchings/menu/func_80080BC8.s +++ b/asm/non_matchings/menu/func_80080BC8.s @@ -9,10 +9,10 @@ glabel func_80080BC8 /* 0817E4 80080BE4 AFB1001C */ sw $s1, 0x1c($sp) /* 0817E8 80080BE8 AFB00018 */ sw $s0, 0x18($sp) /* 0817EC 80080BEC 8C820000 */ lw $v0, ($a0) -/* 0817F0 80080BF0 3C18800E */ lui $t8, %hi(D_800E1C70) # $t8, 0x800e +/* 0817F0 80080BF0 3C18800E */ lui $t8, %hi(dMenuHudSettings) # $t8, 0x800e /* 0817F4 80080BF4 244E0008 */ addiu $t6, $v0, 8 /* 0817F8 80080BF8 AC8E0000 */ sw $t6, ($a0) -/* 0817FC 80080BFC 27181C70 */ addiu $t8, %lo(D_800E1C70) # addiu $t8, $t8, 0x1c70 +/* 0817FC 80080BFC 27181C70 */ addiu $t8, %lo(dMenuHudSettings) # addiu $t8, $t8, 0x1c70 /* 081800 80080C00 3C0F0600 */ lui $t7, 0x600 /* 081804 80080C04 3C09800E */ lui $t1, %hi(D_800E1DB8) # $t1, 0x800e /* 081808 80080C08 AC4F0000 */ sw $t7, ($v0) @@ -23,20 +23,20 @@ glabel func_80080BC8 /* 08181C 80080C1C 00006825 */ move $t5, $zero /* 081820 80080C20 1920007E */ blez $t1, .L80080E1C /* 081824 80080C24 00003825 */ move $a3, $zero - # D_800E1C70 - 0x7FFFFFD0 = 0xE1CA0 -/* 081828 80080C28 3C16000E */ lui $s6, %hi(D_800E1C70 - 0x7FFFFFD0) # $s6, 0xe - # D_800E1C70 - 0x7FFFFFC0 = 0xE1CB0 -/* 08182C 80080C2C 3C11000E */ lui $s1, %hi(D_800E1C70 - 0x7FFFFFC0) # $s1, 0xe + # dMenuHudSettings - 0x7FFFFFD0 = 0xE1CA0 +/* 081828 80080C28 3C16000E */ lui $s6, %hi(dMenuHudSettings - 0x7FFFFFD0) # $s6, 0xe + # dMenuHudSettings - 0x7FFFFFC0 = 0xE1CB0 +/* 08182C 80080C2C 3C11000E */ lui $s1, %hi(dMenuHudSettings - 0x7FFFFFC0) # $s1, 0xe /* 081830 80080C30 3C1F0702 */ lui $ra, (0x07020010 >> 16) # lui $ra, 0x702 /* 081834 80080C34 3C0B8012 */ lui $t3, %hi(D_80126C2C) # $t3, 0x8012 /* 081838 80080C38 3C0A800E */ lui $t2, %hi(D_800E1DB4) # $t2, 0x800e /* 08183C 80080C3C 254A1DB4 */ addiu $t2, %lo(D_800E1DB4) # addiu $t2, $t2, 0x1db4 /* 081840 80080C40 256B6C2C */ addiu $t3, %lo(D_80126C2C) # addiu $t3, $t3, 0x6c2c /* 081844 80080C44 37FF0010 */ ori $ra, (0x07020010 & 0xFFFF) # ori $ra, $ra, 0x10 - # D_800E1C70 - 0x7FFFFFC0 = 0xE1CB0 -/* 081848 80080C48 26311CB0 */ addiu $s1, %lo(D_800E1C70 - 0x7FFFFFC0) # addiu $s1, $s1, 0x1cb0 - # D_800E1C70 - 0x7FFFFFD0 = 0xE1CA0 -/* 08184C 80080C4C 26D61CA0 */ addiu $s6, %lo(D_800E1C70 - 0x7FFFFFD0) # addiu $s6, $s6, 0x1ca0 + # dMenuHudSettings - 0x7FFFFFC0 = 0xE1CB0 +/* 081848 80080C48 26311CB0 */ addiu $s1, %lo(dMenuHudSettings - 0x7FFFFFC0) # addiu $s1, $s1, 0x1cb0 + # dMenuHudSettings - 0x7FFFFFD0 = 0xE1CA0 +/* 08184C 80080C4C 26D61CA0 */ addiu $s6, %lo(dMenuHudSettings - 0x7FFFFFD0) # addiu $s6, $s6, 0x1ca0 /* 081850 80080C50 3C150500 */ lui $s5, 0x500 /* 081854 80080C54 3C140400 */ lui $s4, 0x400 /* 081858 80080C58 3C13E700 */ lui $s3, 0xe700 diff --git a/asm/non_matchings/menu/func_80080E90.s b/asm/non_matchings/menu/func_80080E90.s index 0886cc4d..4820e0ba 100644 --- a/asm/non_matchings/menu/func_80080E90.s +++ b/asm/non_matchings/menu/func_80080E90.s @@ -11,22 +11,22 @@ glabel func_80080E90 /* 081AB4 80080EB4 AFB1001C */ sw $s1, 0x1c($sp) /* 081AB8 80080EB8 AFB00018 */ sw $s0, 0x18($sp) /* 081ABC 80080EBC 8C830000 */ lw $v1, ($a0) -/* 081AC0 80080EC0 3C18800E */ lui $t8, %hi(D_800E1C70) # $t8, 0x800e +/* 081AC0 80080EC0 3C18800E */ lui $t8, %hi(dMenuHudSettings) # $t8, 0x800e /* 081AC4 80080EC4 246E0008 */ addiu $t6, $v1, 8 /* 081AC8 80080EC8 AC8E0000 */ sw $t6, ($a0) -/* 081ACC 80080ECC 27181C70 */ addiu $t8, %lo(D_800E1C70) # addiu $t8, $t8, 0x1c70 +/* 081ACC 80080ECC 27181C70 */ addiu $t8, %lo(dMenuHudSettings) # addiu $t8, $t8, 0x1c70 /* 081AD0 80080ED0 3C0F0600 */ lui $t7, 0x600 /* 081AD4 80080ED4 AC6F0000 */ sw $t7, ($v1) /* 081AD8 80080ED8 AC780004 */ sw $t8, 4($v1) /* 081ADC 80080EDC 8C830000 */ lw $v1, ($a0) - # D_800E1C70 - 0x7FFFFFB0 = 0xE1CC0 -/* 081AE0 80080EE0 3C0F000E */ lui $t7, %hi(D_800E1C70 - 0x7FFFFFB0) # $t7, 0xe + # dMenuHudSettings - 0x7FFFFFB0 = 0xE1CC0 +/* 081AE0 80080EE0 3C0F000E */ lui $t7, %hi(dMenuHudSettings - 0x7FFFFFB0) # $t7, 0xe /* 081AE4 80080EE4 24790008 */ addiu $t9, $v1, 8 /* 081AE8 80080EE8 AC990000 */ sw $t9, ($a0) /* 081AEC 80080EEC 3C0E0702 */ lui $t6, (0x07020010 >> 16) # lui $t6, 0x702 /* 081AF0 80080EF0 35CE0010 */ ori $t6, (0x07020010 & 0xFFFF) # ori $t6, $t6, 0x10 - # D_800E1C70 - 0x7FFFFFB0 = 0xE1CC0 -/* 081AF4 80080EF4 25EF1CC0 */ addiu $t7, %lo(D_800E1C70 - 0x7FFFFFB0) # addiu $t7, $t7, 0x1cc0 + # dMenuHudSettings - 0x7FFFFFB0 = 0xE1CC0 +/* 081AF4 80080EF4 25EF1CC0 */ addiu $t7, %lo(dMenuHudSettings - 0x7FFFFFB0) # addiu $t7, $t7, 0x1cc0 /* 081AF8 80080EF8 AC6F0004 */ sw $t7, 4($v1) /* 081AFC 80080EFC AC6E0000 */ sw $t6, ($v1) /* 081B00 80080F00 8FB70058 */ lw $s7, 0x58($sp) diff --git a/asm/non_matchings/menu/func_80081C04.s b/asm/non_matchings/menu/func_80081C04.s index dcda4470..716c7f82 100644 --- a/asm/non_matchings/menu/func_80081C04.s +++ b/asm/non_matchings/menu/func_80081C04.s @@ -90,7 +90,7 @@ glabel func_80081C04 .L80081D40: /* 082940 80081D40 304B0008 */ andi $t3, $v0, 8 /* 082944 80081D44 11600003 */ beqz $t3, .L80081D54 -/* 082948 80081D48 3C01800E */ lui $at, %hi(D_800DF4A4) # $at, 0x800e +/* 082948 80081D48 3C01800E */ lui $at, %hi(sMenuGuiColourR) # $at, 0x800e /* 08294C 80081D4C 10000005 */ b .L80081D64 /* 082950 80081D50 24C60007 */ addiu $a2, $a2, 7 .L80081D54: @@ -101,24 +101,24 @@ glabel func_80081C04 .L80081D64: /* 082964 80081D64 8FAD0070 */ lw $t5, 0x70($sp) .L80081D68: -/* 082968 80081D68 A027F4A4 */ sb $a3, %lo(D_800DF4A4)($at) -/* 08296C 80081D6C 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e +/* 082968 80081D68 A027F4A4 */ sb $a3, %lo(sMenuGuiColourR)($at) +/* 08296C 80081D6C 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e /* 082970 80081D70 8FAE0074 */ lw $t6, 0x74($sp) -/* 082974 80081D74 A02DF4A8 */ sb $t5, %lo(D_800DF4A8)($at) -/* 082978 80081D78 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e +/* 082974 80081D74 A02DF4A8 */ sb $t5, %lo(sMenuGuiColourG)($at) +/* 082978 80081D78 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e /* 08297C 80081D7C 8FAF0078 */ lw $t7, 0x78($sp) -/* 082980 80081D80 A02EF4AC */ sb $t6, %lo(D_800DF4AC)($at) -/* 082984 80081D84 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e +/* 082980 80081D80 A02EF4AC */ sb $t6, %lo(sMenuGuiColourB)($at) +/* 082984 80081D84 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e /* 082988 80081D88 00002025 */ move $a0, $zero /* 08298C 80081D8C AFA60068 */ sw $a2, 0x68($sp) /* 082990 80081D90 0C01EFC7 */ jal func_8007BF1C -/* 082994 80081D94 AC2FF764 */ sw $t7, %lo(D_800DF764)($at) +/* 082994 80081D94 AC2FF764 */ sw $t7, %lo(sMenuGuiOpacity)($at) /* 082998 80081D98 0C01A142 */ jal func_80068508 /* 08299C 80081D9C 24040001 */ li $a0, 1 /* 0829A0 80081DA0 8FA60068 */ lw $a2, 0x68($sp) -/* 0829A4 80081DA4 3C12800E */ lui $s2, %hi(D_800DF75C) # $s2, 0x800e +/* 0829A4 80081DA4 3C12800E */ lui $s2, %hi(gMenuImageStack) # $s2, 0x800e /* 0829A8 80081DA8 44862000 */ mtc1 $a2, $f4 -/* 0829AC 80081DAC 2652F75C */ addiu $s2, %lo(D_800DF75C) # addiu $s2, $s2, -0x8a4 +/* 0829AC 80081DAC 2652F75C */ addiu $s2, %lo(gMenuImageStack) # addiu $s2, $s2, -0x8a4 /* 0829B0 80081DB0 468021A0 */ cvt.s.w $f6, $f4 /* 0829B4 80081DB4 8E580000 */ lw $t8, ($s2) /* 0829B8 80081DB8 00008025 */ move $s0, $zero @@ -145,21 +145,21 @@ glabel func_80081C04 /* 082A04 80081E04 0C01A142 */ jal func_80068508 /* 082A08 80081E08 00002025 */ move $a0, $zero /* 082A0C 80081E0C 240200FF */ li $v0, 255 -/* 082A10 80081E10 3C01800E */ lui $at, %hi(D_800DF4A4) # $at, 0x800e -/* 082A14 80081E14 A022F4A4 */ sb $v0, %lo(D_800DF4A4)($at) -/* 082A18 80081E18 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 082A1C 80081E1C A022F4A8 */ sb $v0, %lo(D_800DF4A8)($at) -/* 082A20 80081E20 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e +/* 082A10 80081E10 3C01800E */ lui $at, %hi(sMenuGuiColourR) # $at, 0x800e +/* 082A14 80081E14 A022F4A4 */ sb $v0, %lo(sMenuGuiColourR)($at) +/* 082A18 80081E18 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 082A1C 80081E1C A022F4A8 */ sb $v0, %lo(sMenuGuiColourG)($at) +/* 082A20 80081E20 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e /* 082A24 80081E24 8FBF002C */ lw $ra, 0x2c($sp) -/* 082A28 80081E28 A022F4AC */ sb $v0, %lo(D_800DF4AC)($at) -/* 082A2C 80081E2C 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e +/* 082A28 80081E28 A022F4AC */ sb $v0, %lo(sMenuGuiColourB)($at) +/* 082A2C 80081E2C 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e /* 082A30 80081E30 240B00FF */ li $t3, 255 /* 082A34 80081E34 8FB00018 */ lw $s0, 0x18($sp) /* 082A38 80081E38 8FB1001C */ lw $s1, 0x1c($sp) /* 082A3C 80081E3C 8FB20020 */ lw $s2, 0x20($sp) /* 082A40 80081E40 8FB30024 */ lw $s3, 0x24($sp) /* 082A44 80081E44 8FB40028 */ lw $s4, 0x28($sp) -/* 082A48 80081E48 AC2BF764 */ sw $t3, %lo(D_800DF764)($at) +/* 082A48 80081E48 AC2BF764 */ sw $t3, %lo(sMenuGuiOpacity)($at) /* 082A4C 80081E4C 03E00008 */ jr $ra /* 082A50 80081E50 27BD0060 */ addiu $sp, $sp, 0x60 diff --git a/asm/non_matchings/menu/func_8008377C.s b/asm/non_matchings/menu/func_8008377C.s index 4badf1e7..9da16249 100644 --- a/asm/non_matchings/menu/func_8008377C.s +++ b/asm/non_matchings/menu/func_8008377C.s @@ -26,10 +26,10 @@ glabel func_8008377C /* 0843DC 800837DC 44822000 */ mtc1 $v0, $f4 /* 0843E0 800837E0 44814000 */ mtc1 $at, $f8 /* 0843E4 800837E4 468021A0 */ cvt.s.w $f6, $f4 -/* 0843E8 800837E8 3C17800E */ lui $s7, %hi(D_800DF764) # $s7, 0x800e +/* 0843E8 800837E8 3C17800E */ lui $s7, %hi(sMenuGuiOpacity) # $s7, 0x800e /* 0843EC 800837EC 000278C0 */ sll $t7, $v0, 3 /* 0843F0 800837F0 46083002 */ mul.s $f0, $f6, $f8 -/* 0843F4 800837F4 26F7F764 */ addiu $s7, %lo(D_800DF764) # addiu $s7, $s7, -0x89c +/* 0843F4 800837F4 26F7F764 */ addiu $s7, %lo(sMenuGuiOpacity) # addiu $s7, $s7, -0x89c /* 0843F8 800837F8 25F8FFFF */ addiu $t8, $t7, -1 /* 0843FC 800837FC AEF80000 */ sw $t8, ($s7) /* 084400 80083800 E7A00048 */ swc1 $f0, 0x48($sp) @@ -38,17 +38,17 @@ glabel func_8008377C /* 08440C 8008380C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 084410 80083810 C7A00048 */ lwc1 $f0, 0x48($sp) /* 084414 80083814 44815000 */ mtc1 $at, $f10 -/* 084418 80083818 3C05800E */ lui $a1, %hi(D_800DF7DC) # $a1, 0x800e +/* 084418 80083818 3C05800E */ lui $a1, %hi(sGameTitleTileOffsets) # $a1, 0x800e /* 08441C 8008381C 460A0032 */ c.eq.s $f0, $f10 -/* 084420 80083820 24A5F7DC */ addiu $a1, %lo(D_800DF7DC) # addiu $a1, $a1, -0x824 +/* 084420 80083820 24A5F7DC */ addiu $a1, %lo(sGameTitleTileOffsets) # addiu $a1, $a1, -0x824 /* 084424 80083824 4501000F */ bc1t .L80083864 /* 084428 80083828 02C02025 */ move $a0, $s6 -/* 08442C 8008382C 3C05800E */ lui $a1, %hi(D_800DF7DC) # $a1, 0x800e +/* 08442C 8008382C 3C05800E */ lui $a1, %hi(sGameTitleTileOffsets) # $a1, 0x800e /* 084430 80083830 2419FFFE */ li $t9, -2 /* 084434 80083834 24080001 */ li $t0, 1 /* 084438 80083838 AFA8001C */ sw $t0, 0x1c($sp) /* 08443C 8008383C AFB90018 */ sw $t9, 0x18($sp) -/* 084440 80083840 24A5F7DC */ addiu $a1, %lo(D_800DF7DC) # addiu $a1, $a1, -0x824 +/* 084440 80083840 24A5F7DC */ addiu $a1, %lo(sGameTitleTileOffsets) # addiu $a1, $a1, -0x824 /* 084444 80083844 02C02025 */ move $a0, $s6 /* 084448 80083848 3C064320 */ lui $a2, 0x4320 /* 08444C 8008384C 3C074250 */ lui $a3, 0x4250 diff --git a/asm/non_matchings/menu/func_800853D0.s b/asm/non_matchings/menu/func_800853D0.s index e6982d9a..5a83ac16 100644 --- a/asm/non_matchings/menu/func_800853D0.s +++ b/asm/non_matchings/menu/func_800853D0.s @@ -366,11 +366,11 @@ glabel L80085828 /* 08650C 8008590C AFA5007C */ sw $a1, 0x7c($sp) /* 086510 80085910 8FA5007C */ lw $a1, 0x7c($sp) /* 086514 80085914 8FAC0088 */ lw $t4, 0x88($sp) -/* 086518 80085918 3C03800E */ lui $v1, %hi(D_800DF75C) # $v1, 0x800e +/* 086518 80085918 3C03800E */ lui $v1, %hi(gMenuImageStack) # $v1, 0x800e /* 08651C 8008591C 00AC1023 */ subu $v0, $a1, $t4 /* 086520 80085920 244EFFCF */ addiu $t6, $v0, -0x31 /* 086524 80085924 448E2000 */ mtc1 $t6, $f4 -/* 086528 80085928 2463F75C */ addiu $v1, %lo(D_800DF75C) # addiu $v1, $v1, -0x8a4 +/* 086528 80085928 2463F75C */ addiu $v1, %lo(gMenuImageStack) # addiu $v1, $v1, -0x8a4 /* 08652C 8008592C 468021A0 */ cvt.s.w $f6, $f4 /* 086530 80085930 8C6D0000 */ lw $t5, ($v1) /* 086534 80085934 2458FFE8 */ addiu $t8, $v0, -0x18 @@ -386,10 +386,10 @@ glabel L80085828 /* 08655C 8008595C 0C01EFC7 */ jal func_8007BF1C /* 086560 80085960 00002025 */ move $a0, $zero /* 086564 80085964 8FAB0084 */ lw $t3, 0x84($sp) -/* 086568 80085968 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e +/* 086568 80085968 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e /* 08656C 8008596C 256CFF7B */ addiu $t4, $t3, -0x85 /* 086570 80085970 448C8000 */ mtc1 $t4, $f16 -/* 086574 80085974 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 086574 80085974 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 086578 80085978 468084A0 */ cvt.s.w $f18, $f16 /* 08657C 8008597C 8C4E0000 */ lw $t6, ($v0) /* 086580 80085980 24040002 */ li $a0, 2 @@ -399,10 +399,10 @@ glabel L80085828 /* 086590 80085990 0C027298 */ jal func_8009CA60 /* 086594 80085994 A5ED0058 */ sh $t5, 0x58($t7) /* 086598 80085998 8FB80084 */ lw $t8, 0x84($sp) -/* 08659C 8008599C 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e +/* 08659C 8008599C 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e /* 0865A0 800859A0 270AFF83 */ addiu $t2, $t8, -0x7d /* 0865A4 800859A4 448A2000 */ mtc1 $t2, $f4 -/* 0865A8 800859A8 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 0865A8 800859A8 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 0865AC 800859AC 468021A0 */ cvt.s.w $f6, $f4 /* 0865B0 800859B0 8C590000 */ lw $t9, ($v0) /* 0865B4 800859B4 24040002 */ li $a0, 2 @@ -414,10 +414,10 @@ glabel L80085828 /* 0865CC 800859CC 0C01EFC7 */ jal func_8007BF1C /* 0865D0 800859D0 24040001 */ li $a0, 1 /* 0865D4 800859D4 8FAE0084 */ lw $t6, 0x84($sp) -/* 0865D8 800859D8 3C0F800E */ lui $t7, %hi(D_800DF75C) # $t7, 0x800e +/* 0865D8 800859D8 3C0F800E */ lui $t7, %hi(gMenuImageStack) # $t7, 0x800e /* 0865DC 800859DC 25CDFF80 */ addiu $t5, $t6, -0x80 /* 0865E0 800859E0 448D4000 */ mtc1 $t5, $f8 -/* 0865E4 800859E4 8DEFF75C */ lw $t7, %lo(D_800DF75C)($t7) +/* 0865E4 800859E4 8DEFF75C */ lw $t7, %lo(gMenuImageStack)($t7) /* 0865E8 800859E8 468042A0 */ cvt.s.w $f10, $f8 /* 0865EC 800859EC 01F0C021 */ addu $t8, $t7, $s0 /* 0865F0 800859F0 E70A000C */ swc1 $f10, 0xc($t8) diff --git a/asm/non_matchings/menu/func_800890AC.s b/asm/non_matchings/menu/func_800890AC.s index dbc41455..13cd5c84 100644 --- a/asm/non_matchings/menu/func_800890AC.s +++ b/asm/non_matchings/menu/func_800890AC.s @@ -94,11 +94,11 @@ glabel func_800890AC /* 089E0C 8008920C 15E000C0 */ bnez $t7, .L80089510 /* 089E10 80089210 24190001 */ li $t9, 1 /* 089E14 80089214 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 089E18 80089218 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 089E18 80089218 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 089E1C 8008921C AFB80030 */ sw $t8, 0x30($sp) /* 089E20 80089220 AC39F47C */ sw $t9, %lo(gMenuDelay)($at) /* 089E24 80089224 0C030076 */ jal func_800C01D8 -/* 089E28 80089228 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 089E28 80089228 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 089E2C 8008922C 100000B9 */ b .L80089514 /* 089E30 80089230 8FAF0030 */ lw $t7, 0x30($sp) .L80089234: @@ -126,11 +126,11 @@ glabel func_800890AC /* 089E88 80089288 240E0001 */ li $t6, 1 /* 089E8C 8008928C 240F0001 */ li $t7, 1 /* 089E90 80089290 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 089E94 80089294 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 089E94 80089294 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 089E98 80089298 AFAE0030 */ sw $t6, 0x30($sp) /* 089E9C 8008929C AC2FF47C */ sw $t7, %lo(gMenuDelay)($at) /* 089EA0 800892A0 0C030076 */ jal func_800C01D8 -/* 089EA4 800892A4 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 089EA4 800892A4 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 089EA8 800892A8 3C0A8012 */ lui $t2, %hi(D_801263E0) # $t2, 0x8012 /* 089EAC 800892AC 10000013 */ b .L800892FC /* 089EB0 800892B0 254A63E0 */ addiu $t2, %lo(D_801263E0) # addiu $t2, $t2, 0x63e0 @@ -146,11 +146,11 @@ glabel func_800890AC /* 089ED4 800892D4 24190001 */ li $t9, 1 /* 089ED8 800892D8 240C0001 */ li $t4, 1 /* 089EDC 800892DC 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 089EE0 800892E0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 089EE0 800892E0 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 089EE4 800892E4 AFB90030 */ sw $t9, 0x30($sp) /* 089EE8 800892E8 AC2CF47C */ sw $t4, %lo(gMenuDelay)($at) /* 089EEC 800892EC 0C030076 */ jal func_800C01D8 -/* 089EF0 800892F0 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 089EF0 800892F0 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 089EF4 800892F4 3C0A8012 */ lui $t2, %hi(D_801263E0) # $t2, 0x8012 /* 089EF8 800892F8 254A63E0 */ addiu $t2, %lo(D_801263E0) # addiu $t2, $t2, 0x63e0 .L800892FC: @@ -206,11 +206,11 @@ glabel func_800890AC /* 089FA4 800893A4 240C0001 */ li $t4, 1 /* 089FA8 800893A8 240D0001 */ li $t5, 1 /* 089FAC 800893AC 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 089FB0 800893B0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 089FB0 800893B0 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 089FB4 800893B4 AFAC0030 */ sw $t4, 0x30($sp) /* 089FB8 800893B8 AC2DF47C */ sw $t5, %lo(gMenuDelay)($at) /* 089FBC 800893BC 0C030076 */ jal func_800C01D8 -/* 089FC0 800893C0 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 089FC0 800893C0 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 089FC4 800893C4 10000053 */ b .L80089514 /* 089FC8 800893C8 8FAF0030 */ lw $t7, 0x30($sp) .L800893CC: diff --git a/asm/non_matchings/menu/func_8008B4C8.s b/asm/non_matchings/menu/func_8008B4C8.s index 5b79d560..cf14a99a 100644 --- a/asm/non_matchings/menu/func_8008B4C8.s +++ b/asm/non_matchings/menu/func_8008B4C8.s @@ -36,9 +36,9 @@ glabel func_8008B4C8 /* 08C148 8008B548 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08C14C 8008B54C 0C01BAEA */ jal func_8006EBA8 /* 08C150 8008B550 AC32F47C */ sw $s2, %lo(gMenuDelay)($at) -/* 08C154 8008B554 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08C154 8008B554 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08C158 8008B558 0C030076 */ jal func_800C01D8 -/* 08C15C 8008B55C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08C15C 8008B55C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08C160 8008B560 3C028012 */ lui $v0, %hi(D_801267D8) # $v0, 0x8012 /* 08C164 8008B564 2411FFFF */ li $s1, -1 /* 08C168 8008B568 244267D8 */ addiu $v0, %lo(D_801267D8) # addiu $v0, $v0, 0x67d8 diff --git a/asm/non_matchings/menu/func_8008B758.s b/asm/non_matchings/menu/func_8008B758.s index dfb66d3d..15834f04 100644 --- a/asm/non_matchings/menu/func_8008B758.s +++ b/asm/non_matchings/menu/func_8008B758.s @@ -128,10 +128,10 @@ glabel func_8008B758 /* 08C534 8008B934 A24B0000 */ sb $t3, ($s2) /* 08C538 8008B938 240FFFFF */ li $t7, -1 /* 08C53C 8008B93C 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 08C540 8008B940 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08C540 8008B940 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08C544 8008B944 AC2FF47C */ sw $t7, %lo(gMenuDelay)($at) /* 08C548 8008B948 0C030076 */ jal func_800C01D8 -/* 08C54C 8008B94C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08C54C 8008B94C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08C550 8008B950 1000006A */ b .L8008BAFC /* 08C554 8008B954 8FA2004C */ lw $v0, 0x4c($sp) .L8008B958: diff --git a/asm/non_matchings/menu/func_8008F00C.s b/asm/non_matchings/menu/func_8008F00C.s index b75eb561..e7509c2d 100644 --- a/asm/non_matchings/menu/func_8008F00C.s +++ b/asm/non_matchings/menu/func_8008F00C.s @@ -68,7 +68,7 @@ glabel func_8008F00C /* 08FD00 8008F100 0C02719D */ jal func_8009C674 /* 08FD04 8008F104 248407E8 */ addiu $a0, %lo(D_800E07E8) # addiu $a0, $a0, 0x7e8 /* 08FD08 8008F108 3C04800E */ lui $a0, %hi(D_800E0830) # $a0, 0x800e -/* 08FD0C 8008F10C 0C027229 */ jal func_8009C8A4 +/* 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 /* 08FD18 8008F118 00000000 */ nop diff --git a/asm/non_matchings/menu/func_8008FA54.s b/asm/non_matchings/menu/func_8008FA54.s index 938f9fda..eef02572 100644 --- a/asm/non_matchings/menu/func_8008FA54.s +++ b/asm/non_matchings/menu/func_8008FA54.s @@ -154,7 +154,7 @@ glabel func_8008FA54 /* 090880 8008FC80 00002025 */ move $a0, $zero /* 090884 8008FC84 27A50068 */ addiu $a1, $sp, 0x68 /* 090888 8008FC88 27A60064 */ addiu $a2, $sp, 0x64 -/* 09088C 8008FC8C 0C019B0B */ jal func_80066C2C +/* 09088C 8008FC8C 0C019B0B */ jal copy_viewport_frame_size_to_coords /* 090890 8008FC90 27A70060 */ addiu $a3, $sp, 0x60 /* 090894 8008FC94 8FA20068 */ lw $v0, 0x68($sp) /* 090898 8008FC98 8FAB0060 */ lw $t3, 0x60($sp) @@ -230,10 +230,10 @@ glabel func_8008FA54 .L8008FDA0: /* 0909A0 8008FDA0 8FAD0080 */ lw $t5, 0x80($sp) .L8008FDA4: -/* 0909A4 8008FDA4 3C03800E */ lui $v1, %hi(D_800DF75C) # $v1, 0x800e +/* 0909A4 8008FDA4 3C03800E */ lui $v1, %hi(gMenuImageStack) # $v1, 0x800e /* 0909A8 8008FDA8 448D3000 */ mtc1 $t5, $f6 /* 0909AC 8008FDAC 8FA40094 */ lw $a0, 0x94($sp) -/* 0909B0 8008FDB0 2463F75C */ addiu $v1, %lo(D_800DF75C) # addiu $v1, $v1, -0x8a4 +/* 0909B0 8008FDB0 2463F75C */ addiu $v1, %lo(gMenuImageStack) # addiu $v1, $v1, -0x8a4 /* 0909B4 8008FDB4 46803220 */ cvt.s.w $f8, $f6 /* 0909B8 8008FDB8 8C6E0000 */ lw $t6, ($v1) /* 0909BC 8008FDBC 00041140 */ sll $v0, $a0, 5 diff --git a/asm/non_matchings/menu/func_800904E8.s b/asm/non_matchings/menu/func_800904E8.s index 72ccfc38..d9318cd5 100644 --- a/asm/non_matchings/menu/func_800904E8.s +++ b/asm/non_matchings/menu/func_800904E8.s @@ -272,7 +272,7 @@ glabel func_800904E8 /* 0914E8 800908E8 00002025 */ move $a0, $zero /* 0914EC 800908EC 27A50044 */ addiu $a1, $sp, 0x44 /* 0914F0 800908F0 27A60040 */ addiu $a2, $sp, 0x40 -/* 0914F4 800908F4 0C019AEA */ jal func_80066BA8 +/* 0914F4 800908F4 0C019AEA */ jal copy_viewport_background_size_to_coords /* 0914F8 800908F8 27A7003C */ addiu $a3, $sp, 0x3c /* 0914FC 800908FC 00002025 */ move $a0, $zero /* 091500 80090900 0C019A06 */ jal func_80066818 diff --git a/asm/non_matchings/menu/func_80090918.s b/asm/non_matchings/menu/func_80090918.s index 98607ead..fa7b14a8 100644 --- a/asm/non_matchings/menu/func_80090918.s +++ b/asm/non_matchings/menu/func_80090918.s @@ -129,11 +129,11 @@ glabel func_80090918 /* 0916FC 80090AFC 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 091700 80090B00 44818000 */ mtc1 $at, $f16 /* 091704 80090B04 460A2203 */ div.s $f8, $f4, $f10 -/* 091708 80090B08 3C03800E */ lui $v1, %hi(D_800DF510) # $v1, 0x800e -/* 09170C 80090B0C 2463F510 */ addiu $v1, %lo(D_800DF510) # addiu $v1, $v1, -0xaf0 +/* 091708 80090B08 3C03800E */ lui $v1, %hi(sMenuImageProperties) # $v1, 0x800e +/* 09170C 80090B0C 2463F510 */ addiu $v1, %lo(sMenuImageProperties) # addiu $v1, $v1, -0xaf0 /* 091710 80090B10 C4720088 */ lwc1 $f18, 0x88($v1) -/* 091714 80090B14 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e -/* 091718 80090B18 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 091714 80090B14 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e +/* 091718 80090B18 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 09171C 80090B1C 8C580000 */ lw $t8, ($v0) /* 091720 80090B20 46088000 */ add.s $f0, $f16, $f8 /* 091724 80090B24 46009182 */ mul.s $f6, $f18, $f0 @@ -158,9 +158,9 @@ glabel func_80090918 /* 09176C 80090B6C 3C0A8012 */ lui $t2, %hi(D_801269C8) # $t2, 0x8012 /* 091770 80090B70 04610008 */ bgez $v1, .L80090B94 /* 091774 80090B74 254A69C8 */ addiu $t2, %lo(D_801269C8) # addiu $t2, $t2, 0x69c8 -/* 091778 80090B78 3C02800E */ lui $v0, %hi(D_800DF760) # $v0, 0x800e +/* 091778 80090B78 3C02800E */ lui $v0, %hi(sMenuMusicVolume) # $v0, 0x800e /* 09177C 80090B7C 8FAF0048 */ lw $t7, 0x48($sp) -/* 091780 80090B80 2442F760 */ addiu $v0, %lo(D_800DF760) # addiu $v0, $v0, -0x8a0 +/* 091780 80090B80 2442F760 */ addiu $v0, %lo(sMenuMusicVolume) # addiu $v0, $v0, -0x8a0 /* 091784 80090B84 8C4E0000 */ lw $t6, ($v0) /* 091788 80090B88 000FC080 */ sll $t8, $t7, 2 /* 09178C 80090B8C 01D8C823 */ subu $t9, $t6, $t8 @@ -287,9 +287,9 @@ glabel func_80090918 /* 09193C 80090D3C 3C048012 */ lui $a0, %hi(D_80126820) # $a0, 0x8012 /* 091940 80090D40 0C030060 */ jal func_800C0180 /* 091944 80090D44 00000000 */ nop -/* 091948 80090D48 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 091948 80090D48 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 09194C 80090D4C 0C030076 */ jal func_800C01D8 -/* 091950 80090D50 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 091950 80090D50 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 091954 80090D54 0C03005C */ jal func_800C0170 /* 091958 80090D58 00000000 */ nop /* 09195C 80090D5C 240FFFFF */ li $t7, -1 diff --git a/asm/non_matchings/menu/func_80092188.s b/asm/non_matchings/menu/func_80092188.s index 43aea1ce..52782c75 100644 --- a/asm/non_matchings/menu/func_80092188.s +++ b/asm/non_matchings/menu/func_80092188.s @@ -116,11 +116,11 @@ glabel func_80092188 /* 092F24 80092324 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 092F28 80092328 44818000 */ mtc1 $at, $f16 /* 092F2C 8009232C 46083283 */ div.s $f10, $f6, $f8 -/* 092F30 80092330 3C04800E */ lui $a0, %hi(D_800DF510) # $a0, 0x800e -/* 092F34 80092334 2484F510 */ addiu $a0, %lo(D_800DF510) # addiu $a0, $a0, -0xaf0 +/* 092F30 80092330 3C04800E */ lui $a0, %hi(sMenuImageProperties) # $a0, 0x800e +/* 092F34 80092334 2484F510 */ addiu $a0, %lo(sMenuImageProperties) # addiu $a0, $a0, -0xaf0 /* 092F38 80092338 C4920088 */ lwc1 $f18, 0x88($a0) -/* 092F3C 8009233C 3C03800E */ lui $v1, %hi(D_800DF75C) # $v1, 0x800e -/* 092F40 80092340 2463F75C */ addiu $v1, %lo(D_800DF75C) # addiu $v1, $v1, -0x8a4 +/* 092F3C 8009233C 3C03800E */ lui $v1, %hi(gMenuImageStack) # $v1, 0x800e +/* 092F40 80092340 2463F75C */ addiu $v1, %lo(gMenuImageStack) # addiu $v1, $v1, -0x8a4 /* 092F44 80092344 8C6E0000 */ lw $t6, ($v1) /* 092F48 80092348 3C02800E */ lui $v0, %hi(gMenuDelay) # $v0, 0x800e /* 092F4C 8009234C 460A8000 */ add.s $f0, $f16, $f10 @@ -139,9 +139,9 @@ glabel func_80092188 .L80092380: /* 092F80 80092380 18400008 */ blez $v0, .L800923A4 /* 092F84 80092384 28410029 */ slti $at, $v0, 0x29 -/* 092F88 80092388 3C03800E */ lui $v1, %hi(D_800DF760) # $v1, 0x800e +/* 092F88 80092388 3C03800E */ lui $v1, %hi(sMenuMusicVolume) # $v1, 0x800e /* 092F8C 8009238C 8FAE0058 */ lw $t6, 0x58($sp) -/* 092F90 80092390 2463F760 */ addiu $v1, %lo(D_800DF760) # addiu $v1, $v1, -0x8a0 +/* 092F90 80092390 2463F760 */ addiu $v1, %lo(sMenuMusicVolume) # addiu $v1, $v1, -0x8a0 /* 092F94 80092394 8C790000 */ lw $t9, ($v1) /* 092F98 80092398 000E7880 */ sll $t7, $t6, 2 /* 092F9C 8009239C 032FC023 */ subu $t8, $t9, $t7 @@ -577,9 +577,9 @@ glabel L8009287C /* 0935A8 800929A8 3C01800E */ lui $at, %hi(D_800E097C) # $at, 0x800e /* 0935AC 800929AC 0C030060 */ jal func_800C0180 /* 0935B0 800929B0 AC20097C */ sw $zero, %lo(D_800E097C)($at) -/* 0935B4 800929B4 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 0935B4 800929B4 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 0935B8 800929B8 0C030076 */ jal func_800C01D8 -/* 0935BC 800929BC 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 0935BC 800929BC 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 0935C0 800929C0 3C198012 */ lui $t9, %hi(D_801269C8) # $t9, 0x8012 /* 0935C4 800929C4 8F3969C8 */ lw $t9, %lo(D_801269C8)($t9) /* 0935C8 800929C8 24010005 */ li $at, 5 diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s index a0877356..c899695f 100644 --- a/asm/non_matchings/menu/func_80092E94.s +++ b/asm/non_matchings/menu/func_80092E94.s @@ -104,8 +104,8 @@ glabel func_80092E94 /* 093C28 80093028 0C024AF8 */ jal func_80092BE0 /* 093C2C 8009302C 00000000 */ nop /* 093C30 80093030 04400010 */ bltz $v0, .L80093074 -/* 093C34 80093034 3C0A800E */ lui $t2, %hi(D_800DF764) # $t2, 0x800e -/* 093C38 80093038 8D4AF764 */ lw $t2, %lo(D_800DF764)($t2) +/* 093C34 80093034 3C0A800E */ lui $t2, %hi(sMenuGuiOpacity) # $t2, 0x800e +/* 093C38 80093038 8D4AF764 */ lw $t2, %lo(sMenuGuiOpacity)($t2) /* 093C3C 8009303C 8FA70060 */ lw $a3, 0x60($sp) /* 093C40 80093040 3C05800E */ lui $a1, %hi(D_800E0614) # $a1, 0x800e /* 093C44 80093044 241900FF */ li $t9, 255 @@ -382,8 +382,8 @@ glabel func_80092E94 /* 094060 80093460 02203825 */ move $a3, $s1 /* 094064 80093464 0C01ECF4 */ jal func_8007B3D0 /* 094068 80093468 02402025 */ move $a0, $s2 -/* 09406C 8009346C 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e -/* 094070 80093470 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 09406C 8009346C 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e +/* 094070 80093470 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 094074 80093474 3C0141A8 */ li $at, 0x41A80000 # 21.000000 /* 094078 80093478 44812000 */ mtc1 $at, $f4 /* 09407C 8009347C 8C4F0000 */ lw $t7, ($v0) diff --git a/asm/non_matchings/menu/func_80094A5C.s b/asm/non_matchings/menu/func_80094A5C.s index e5cfdde5..923caacc 100644 --- a/asm/non_matchings/menu/func_80094A5C.s +++ b/asm/non_matchings/menu/func_80094A5C.s @@ -19,7 +19,7 @@ glabel func_80094A5C /* 09569C 80094A9C 14810052 */ bne $a0, $at, .L80094BE8 /* 0956A0 80094AA0 00000000 */ nop /* 0956A4 80094AA4 3C04800E */ lui $a0, %hi(D_800E0A40) # $a0, 0x800e -/* 0956A8 80094AA8 0C027229 */ jal func_8009C8A4 +/* 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 /* 0956B4 80094AB4 00000000 */ nop diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 28e7c3bd..a1710f36 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -154,9 +154,9 @@ glabel L80094DD0 /* 095B34 80094F34 01A53823 */ subu $a3, $t5, $a1 /* 095B38 80094F38 0C019A50 */ jal func_80066940 /* 095B3C 80094F3C 00000000 */ nop -/* 095B40 80094F40 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e +/* 095B40 80094F40 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e /* 095B44 80094F44 44905000 */ mtc1 $s0, $f10 -/* 095B48 80094F48 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 095B48 80094F48 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 095B4C 80094F4C 8C4E0000 */ lw $t6, ($v0) /* 095B50 80094F50 44802000 */ mtc1 $zero, $f4 /* 095B54 80094F54 46805420 */ cvt.s.w $f16, $f10 @@ -174,9 +174,9 @@ glabel L80094DD0 /* 095B84 80094F84 3C014000 */ li $at, 0x40000000 # 2.000000 /* 095B88 80094F88 46803220 */ cvt.s.w $f8, $f6 /* 095B8C 80094F8C 44813000 */ mtc1 $at, $f6 -/* 095B90 80094F90 3C01800E */ lui $at, %hi(D_800DF510+0x88) # $at, 0x800e +/* 095B90 80094F90 3C01800E */ lui $at, %hi(sMenuImageProperties+0x88) # $at, 0x800e /* 095B94 80094F94 E5880090 */ swc1 $f8, 0x90($t4) -/* 095B98 80094F98 C42AF598 */ lwc1 $f10, %lo(D_800DF510+0x88)($at) +/* 095B98 80094F98 C42AF598 */ lwc1 $f10, %lo(sMenuImageProperties+0x88)($at) /* 095B9C 80094F9C 46043201 */ sub.s $f8, $f6, $f4 /* 095BA0 80094FA0 8C4D0000 */ lw $t5, ($v0) /* 095BA4 80094FA4 46085402 */ mul.s $f16, $f10, $f8 diff --git a/asm/non_matchings/menu/func_80095728.s b/asm/non_matchings/menu/func_80095728.s index 845aa1a6..0b899a0b 100644 --- a/asm/non_matchings/menu/func_80095728.s +++ b/asm/non_matchings/menu/func_80095728.s @@ -206,18 +206,18 @@ glabel L80095964 /* 096600 80095A00 0302C821 */ addu $t9, $t8, $v0 /* 096604 80095A04 0C019A50 */ jal func_80066940 /* 096608 80095A08 AFB90010 */ sw $t9, 0x10($sp) -/* 09660C 80095A0C 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e -/* 096610 80095A10 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 09660C 80095A0C 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e +/* 096610 80095A10 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 096614 80095A14 8C4C0000 */ lw $t4, ($v0) /* 096618 80095A18 44802000 */ mtc1 $zero, $f4 /* 09661C 80095A1C 3C014210 */ li $at, 0x42100000 # 36.000000 /* 096620 80095A20 E584008C */ swc1 $f4, 0x8c($t4) /* 096624 80095A24 8C4D0000 */ lw $t5, ($v0) /* 096628 80095A28 44813000 */ mtc1 $at, $f6 -/* 09662C 80095A2C 3C01800E */ lui $at, %hi(D_800DF510+0x88) # $at, 0x800e +/* 09662C 80095A2C 3C01800E */ lui $at, %hi(sMenuImageProperties+0x88) # $at, 0x800e /* 096630 80095A30 E5A60090 */ swc1 $f6, 0x90($t5) /* 096634 80095A34 8C4E0000 */ lw $t6, ($v0) -/* 096638 80095A38 C428F598 */ lwc1 $f8, %lo(D_800DF510+0x88)($at) +/* 096638 80095A38 C428F598 */ lwc1 $f8, %lo(sMenuImageProperties+0x88)($at) /* 09663C 80095A3C 00000000 */ nop /* 096640 80095A40 E5C80088 */ swc1 $f8, 0x88($t6) /* 096644 80095A44 8FAF002C */ lw $t7, 0x2c($sp) @@ -294,9 +294,9 @@ glabel L80095B34 /* 096754 80095B54 00000000 */ nop /* 096758 80095B58 0C000326 */ jal set_music_fade_timer /* 09675C 80095B5C 2404FF80 */ li $a0, -128 -/* 096760 80095B60 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 096760 80095B60 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 096764 80095B64 0C030076 */ jal func_800C01D8 -/* 096768 80095B68 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 096768 80095B68 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 09676C 80095B6C 240D0008 */ li $t5, 8 /* 096770 80095B70 3C018012 */ lui $at, %hi(D_801263E0) # $at, 0x8012 /* 096774 80095B74 100002E7 */ b .L80096714 @@ -628,9 +628,9 @@ glabel L80095EC8 /* 096C40 80096040 AFB80050 */ sw $t8, 0x50($sp) /* 096C44 80096044 0C000326 */ jal set_music_fade_timer /* 096C48 80096048 2404FF80 */ li $a0, -128 -/* 096C4C 8009604C 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 096C4C 8009604C 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 096C50 80096050 0C030076 */ jal func_800C01D8 -/* 096C54 80096054 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 096C54 80096054 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 096C58 80096058 240D0008 */ li $t5, 8 /* 096C5C 8009605C 3C018012 */ lui $at, %hi(D_801263E0) # $at, 0x8012 /* 096C60 80096060 100000FC */ b .L80096454 @@ -786,9 +786,9 @@ glabel L80095EC8 .L8009626C: /* 096E6C 8009626C 0C000326 */ jal set_music_fade_timer /* 096E70 80096270 2404FF80 */ li $a0, -128 -/* 096E74 80096274 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 096E74 80096274 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 096E78 80096278 0C030076 */ jal func_800C01D8 -/* 096E7C 8009627C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 096E7C 8009627C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 096E80 80096280 24190008 */ li $t9, 8 /* 096E84 80096284 3C018012 */ lui $at, %hi(D_801263E0) # $at, 0x8012 /* 096E88 80096288 10000072 */ b .L80096454 @@ -952,9 +952,9 @@ glabel L800964AC /* 0970B4 800964B4 00000000 */ nop /* 0970B8 800964B8 0C000326 */ jal set_music_fade_timer /* 0970BC 800964BC 2404FF80 */ li $a0, -128 -/* 0970C0 800964C0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 0970C0 800964C0 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 0970C4 800964C4 0C030076 */ jal func_800C01D8 -/* 0970C8 800964C8 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 0970C8 800964C8 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 0970CC 800964CC 24180008 */ li $t8, 8 /* 0970D0 800964D0 3C018012 */ lui $at, %hi(D_801263E0) # $at, 0x8012 /* 0970D4 800964D4 1000008F */ b .L80096714 diff --git a/asm/non_matchings/menu/func_80096978.s b/asm/non_matchings/menu/func_80096978.s index 1f946ea7..b3c0fd93 100644 --- a/asm/non_matchings/menu/func_80096978.s +++ b/asm/non_matchings/menu/func_80096978.s @@ -48,9 +48,9 @@ glabel func_80096978 .L80096A28: /* 097628 80096A28 46142181 */ sub.s $f6, $f4, $f20 /* 09762C 80096A2C 44814000 */ mtc1 $at, $f8 -/* 097630 80096A30 3C10800E */ lui $s0, %hi(D_800DF764) # $s0, 0x800e +/* 097630 80096A30 3C10800E */ lui $s0, %hi(sMenuGuiOpacity) # $s0, 0x800e /* 097634 80096A34 46083282 */ mul.s $f10, $f6, $f8 -/* 097638 80096A38 2610F764 */ addiu $s0, %lo(D_800DF764) # addiu $s0, $s0, -0x89c +/* 097638 80096A38 2610F764 */ addiu $s0, %lo(sMenuGuiOpacity) # addiu $s0, $s0, -0x89c /* 09763C 80096A3C 24040002 */ li $a0, 2 /* 097640 80096A40 444FF800 */ cfc1 $t7, $31 /* 097644 80096A44 00000000 */ nop @@ -185,14 +185,14 @@ glabel func_80096978 /* 097834 80096C34 246E0004 */ addiu $t6, $v1, 4 /* 097838 80096C38 24790002 */ addiu $t9, $v1, 2 /* 09783C 80096C3C 241800FF */ li $t8, 255 -/* 097840 80096C40 3C13800E */ lui $s3, %hi(D_800DF75C) # $s3, 0x800e +/* 097840 80096C40 3C13800E */ lui $s3, %hi(gMenuImageStack) # $s3, 0x800e /* 097844 80096C44 2448FFDE */ addiu $t0, $v0, -0x22 /* 097848 80096C48 2449FFE0 */ addiu $t1, $v0, -0x20 /* 09784C 80096C4C 4481A000 */ mtc1 $at, $f20 /* 097850 80096C50 AFAC00A8 */ sw $t4, 0xa8($sp) /* 097854 80096C54 AFA90064 */ sw $t1, 0x64($sp) /* 097858 80096C58 AFA80068 */ sw $t0, 0x68($sp) -/* 09785C 80096C5C 2673F75C */ addiu $s3, %lo(D_800DF75C) # addiu $s3, $s3, -0x8a4 +/* 09785C 80096C5C 2673F75C */ addiu $s3, %lo(gMenuImageStack) # addiu $s3, $s3, -0x8a4 /* 097860 80096C60 AFB80070 */ sw $t8, 0x70($sp) /* 097864 80096C64 AFB90074 */ sw $t9, 0x74($sp) /* 097868 80096C68 AFAE007C */ sw $t6, 0x7c($sp) @@ -243,15 +243,15 @@ glabel func_80096978 /* 097918 80096D18 0C01EFC7 */ jal func_8007BF1C /* 09791C 80096D1C 00002025 */ move $a0, $zero /* 097920 80096D20 240200FF */ li $v0, 255 -/* 097924 80096D24 3C01800E */ lui $at, %hi(D_800DF4A4) # $at, 0x800e +/* 097924 80096D24 3C01800E */ lui $at, %hi(sMenuGuiColourR) # $at, 0x800e /* 097928 80096D28 8FB90070 */ lw $t9, 0x70($sp) -/* 09792C 80096D2C A022F4A4 */ sb $v0, %lo(D_800DF4A4)($at) -/* 097930 80096D30 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 097934 80096D34 A039F4A8 */ sb $t9, %lo(D_800DF4A8)($at) -/* 097938 80096D38 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e +/* 09792C 80096D2C A022F4A4 */ sb $v0, %lo(sMenuGuiColourR)($at) +/* 097930 80096D30 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 097934 80096D34 A039F4A8 */ sb $t9, %lo(sMenuGuiColourG)($at) +/* 097938 80096D38 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e /* 09793C 80096D3C 3C18800E */ lui $t8, %hi(gNumberOfActivePlayers) # $t8, 0x800e /* 097940 80096D40 8F18F4BC */ lw $t8, %lo(gNumberOfActivePlayers)($t8) -/* 097944 80096D44 A022F4AC */ sb $v0, %lo(D_800DF4AC)($at) +/* 097944 80096D44 A022F4AC */ sb $v0, %lo(sMenuGuiColourB)($at) /* 097948 80096D48 3C01800E */ lui $at, %hi(D_800DF4B0) # $at, 0x800e /* 09794C 80096D4C 1B00006E */ blez $t8, .L80096F08 /* 097950 80096D50 A022F4B0 */ sb $v0, %lo(D_800DF4B0)($at) @@ -388,9 +388,9 @@ glabel func_80096978 /* 097B34 80096F34 0C01EFC7 */ jal func_8007BF1C /* 097B38 80096F38 24040001 */ li $a0, 1 /* 097B3C 80096F3C 240E00FF */ li $t6, 255 -/* 097B40 80096F40 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e +/* 097B40 80096F40 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e /* 097B44 80096F44 8FAF00A0 */ lw $t7, 0xa0($sp) -/* 097B48 80096F48 A02EF4A8 */ sb $t6, %lo(D_800DF4A8)($at) +/* 097B48 80096F48 A02EF4A8 */ sb $t6, %lo(sMenuGuiColourG)($at) /* 097B4C 80096F4C 8FB80078 */ lw $t8, 0x78($sp) /* 097B50 80096F50 8FA80070 */ lw $t0, 0x70($sp) /* 097B54 80096F54 3C01800E */ lui $at, %hi(D_800DF4B0) # $at, 0x800e diff --git a/asm/non_matchings/menu/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s index befda9d0..95fd3a3f 100644 --- a/asm/non_matchings/menu/func_80099E8C.s +++ b/asm/non_matchings/menu/func_80099E8C.s @@ -345,10 +345,10 @@ glabel func_80099E8C /* 09AF98 8009A398 0C01ECF4 */ jal func_8007B3D0 /* 09AF9C 8009A39C 02E02025 */ move $a0, $s7 /* 09AFA0 8009A3A0 8638000C */ lh $t8, 0xc($s1) -/* 09AFA4 8009A3A4 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e +/* 09AFA4 8009A3A4 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e /* 09AFA8 8009A3A8 2719FF88 */ addiu $t9, $t8, -0x78 /* 09AFAC 8009A3AC 44993000 */ mtc1 $t9, $f6 -/* 09AFB0 8009A3B0 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 09AFB0 8009A3B0 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 09AFB4 8009A3B4 46803220 */ cvt.s.w $f8, $f6 /* 09AFB8 8009A3B8 8C490000 */ lw $t1, ($v0) /* 09AFBC 8009A3BC 3C01800F */ lui $at, %hi(D_800E8570) # $at, 0x800f @@ -369,8 +369,8 @@ glabel func_80099E8C /* 09AFF8 8009A3F8 0C027298 */ jal func_8009CA60 /* 09AFFC 8009A3FC E73200E8 */ swc1 $f18, 0xe8($t9) /* 09B000 8009A400 24090080 */ li $t1, 128 -/* 09B004 8009A404 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e -/* 09B008 8009A408 AC29F764 */ sw $t1, %lo(D_800DF764)($at) +/* 09B004 8009A404 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e +/* 09B008 8009A408 AC29F764 */ sw $t1, %lo(sMenuGuiOpacity)($at) /* 09B00C 8009A40C 862B0012 */ lh $t3, 0x12($s1) /* 09B010 8009A410 8FAA006C */ lw $t2, 0x6c($sp) /* 09B014 8009A414 8FAE00D0 */ lw $t6, 0xd0($sp) @@ -387,8 +387,8 @@ glabel func_80099E8C /* 09B040 8009A440 0C020600 */ jal func_80081800 /* 09B044 8009A444 24A5FF89 */ addiu $a1, $a1, -0x77 /* 09B048 8009A448 240F00FF */ li $t7, 255 -/* 09B04C 8009A44C 3C01800E */ lui $at, %hi(D_800DF764) # $at, 0x800e -/* 09B050 8009A450 AC2FF764 */ sw $t7, %lo(D_800DF764)($at) +/* 09B04C 8009A44C 3C01800E */ lui $at, %hi(sMenuGuiOpacity) # $at, 0x800e +/* 09B050 8009A450 AC2FF764 */ sw $t7, %lo(sMenuGuiOpacity)($at) /* 09B054 8009A454 86390012 */ lh $t9, 0x12($s1) /* 09B058 8009A458 8FB8006C */ lw $t8, 0x6c($sp) /* 09B05C 8009A45C 8FAB00D0 */ lw $t3, 0xd0($sp) diff --git a/asm/non_matchings/menu/func_8009CA60.s b/asm/non_matchings/menu/func_8009CA60.s index bbcc171d..80fb8719 100644 --- a/asm/non_matchings/menu/func_8009CA60.s +++ b/asm/non_matchings/menu/func_8009CA60.s @@ -1,6 +1,6 @@ glabel func_8009CA60 -/* 09D660 8009CA60 3C0B800E */ lui $t3, %hi(D_800DF75C) # $t3, 0x800e -/* 09D664 8009CA64 256BF75C */ addiu $t3, %lo(D_800DF75C) # addiu $t3, $t3, -0x8a4 +/* 09D660 8009CA60 3C0B800E */ lui $t3, %hi(gMenuImageStack) # $t3, 0x800e +/* 09D664 8009CA64 256BF75C */ addiu $t3, %lo(gMenuImageStack) # addiu $t3, $t3, -0x8a4 /* 09D668 8009CA68 27BDFFA0 */ addiu $sp, $sp, -0x60 /* 09D66C 8009CA6C 8D630000 */ lw $v1, ($t3) /* 09D670 8009CA70 00044140 */ sll $t0, $a0, 5 @@ -47,7 +47,7 @@ glabel func_8009CA60 /* 09D714 8009CB14 260463A0 */ addiu $a0, $s0, %lo(D_801263A0) /* 09D718 8009CB18 E5480014 */ swc1 $f8, 0x14($t2) /* 09D71C 8009CB1C C44A0008 */ lwc1 $f10, 8($v0) -/* 09D720 8009CB20 3C0C800E */ lui $t4, %hi(D_800DF764) # $t4, 0x800e +/* 09D720 8009CB20 3C0C800E */ lui $t4, %hi(sMenuGuiOpacity) # $t4, 0x800e /* 09D724 8009CB24 E54A0008 */ swc1 $f10, 8($t2) /* 09D728 8009CB28 8DEFF468 */ lw $t7, %lo(D_800DF468)($t7) /* 09D72C 8009CB2C 24C663AC */ addiu $a2, %lo(D_801263AC) # addiu $a2, $a2, 0x63ac @@ -60,7 +60,7 @@ glabel func_8009CA60 /* 09D748 8009CB48 00000000 */ nop /* 09D74C 8009CB4C A159003A */ sb $t9, 0x3a($t2) .L8009CB50: -/* 09D750 8009CB50 8D8CF764 */ lw $t4, %lo(D_800DF764)($t4) +/* 09D750 8009CB50 8D8CF764 */ lw $t4, %lo(sMenuGuiOpacity)($t4) /* 09D754 8009CB54 0C004B57 */ jal func_80012D5C /* 09D758 8009CB58 A0EC0039 */ sb $t4, 0x39($a3) /* 09D75C 8009CB5C 10000084 */ b .L8009CD70 @@ -73,18 +73,18 @@ glabel func_8009CA60 /* 09D774 8009CB74 3C0FFA00 */ lui $t7, 0xfa00 /* 09D778 8009CB78 244E0008 */ addiu $t6, $v0, 8 /* 09D77C 8009CB7C AE0E0000 */ sw $t6, ($s0) -/* 09D780 8009CB80 3C18800E */ lui $t8, %hi(D_800DF4A4) # $t8, 0x800e +/* 09D780 8009CB80 3C18800E */ lui $t8, %hi(sMenuGuiColourR) # $t8, 0x800e /* 09D784 8009CB84 AC4F0000 */ sw $t7, ($v0) -/* 09D788 8009CB88 9319F4A4 */ lbu $t9, %lo(D_800DF4A4)($t8) -/* 09D78C 8009CB8C 3C0D800E */ lui $t5, %hi(D_800DF4A8) # $t5, 0x800e -/* 09D790 8009CB90 91AEF4A8 */ lbu $t6, %lo(D_800DF4A8)($t5) +/* 09D788 8009CB88 9319F4A4 */ lbu $t9, %lo(sMenuGuiColourR)($t8) +/* 09D78C 8009CB8C 3C0D800E */ lui $t5, %hi(sMenuGuiColourG) # $t5, 0x800e +/* 09D790 8009CB90 91AEF4A8 */ lbu $t6, %lo(sMenuGuiColourG)($t5) /* 09D794 8009CB94 00196600 */ sll $t4, $t9, 0x18 /* 09D798 8009CB98 000E7C00 */ sll $t7, $t6, 0x10 /* 09D79C 8009CB9C 018FC025 */ or $t8, $t4, $t7 -/* 09D7A0 8009CBA0 3C19800E */ lui $t9, %hi(D_800DF4AC) # $t9, 0x800e -/* 09D7A4 8009CBA4 932DF4AC */ lbu $t5, %lo(D_800DF4AC)($t9) -/* 09D7A8 8009CBA8 3C0F800E */ lui $t7, %hi(D_800DF764) # $t7, 0x800e -/* 09D7AC 8009CBAC 8DEFF764 */ lw $t7, %lo(D_800DF764)($t7) +/* 09D7A0 8009CBA0 3C19800E */ lui $t9, %hi(sMenuGuiColourB) # $t9, 0x800e +/* 09D7A4 8009CBA4 932DF4AC */ lbu $t5, %lo(sMenuGuiColourB)($t9) +/* 09D7A8 8009CBA8 3C0F800E */ lui $t7, %hi(sMenuGuiOpacity) # $t7, 0x800e +/* 09D7AC 8009CBAC 8DEFF764 */ lw $t7, %lo(sMenuGuiOpacity)($t7) /* 09D7B0 8009CBB0 000D7200 */ sll $t6, $t5, 8 /* 09D7B4 8009CBB4 030E6025 */ or $t4, $t8, $t6 /* 09D7B8 8009CBB8 31F900FF */ andi $t9, $t7, 0xff @@ -120,8 +120,8 @@ glabel func_8009CA60 /* 09D830 8009CC30 1000004E */ b .L8009CD6C /* 09D834 8009CC34 AC4F0000 */ sw $t7, ($v0) .L8009CC38: -/* 09D838 8009CC38 3C09800E */ lui $t1, %hi(D_800DF764) # $t1, 0x800e -/* 09D83C 8009CC3C 2529F764 */ addiu $t1, %lo(D_800DF764) # addiu $t1, $t1, -0x89c +/* 09D838 8009CC38 3C09800E */ lui $t1, %hi(sMenuGuiOpacity) # $t1, 0x800e +/* 09D83C 8009CC3C 2529F764 */ addiu $t1, %lo(sMenuGuiOpacity) # addiu $t1, $t1, -0x89c /* 09D840 8009CC40 8D390000 */ lw $t9, ($t1) /* 09D844 8009CC44 3C058012 */ lui $a1, %hi(D_801263A8) # $a1, 0x8012 /* 09D848 8009CC48 2B2100FF */ slti $at, $t9, 0xff @@ -169,8 +169,8 @@ glabel func_8009CA60 /* 09D8E8 8009CCE8 01B83021 */ addu $a2, $t5, $t8 /* 09D8EC 8009CCEC 0C01A521 */ jal func_80069484 /* 09D8F0 8009CCF0 E7B00010 */ swc1 $f16, 0x10($sp) -/* 09D8F4 8009CCF4 3C0B800E */ lui $t3, %hi(D_800DF75C) # $t3, 0x800e -/* 09D8F8 8009CCF8 256BF75C */ addiu $t3, %lo(D_800DF75C) # addiu $t3, $t3, -0x8a4 +/* 09D8F4 8009CCF4 3C0B800E */ lui $t3, %hi(gMenuImageStack) # $t3, 0x800e +/* 09D8F8 8009CCF8 256BF75C */ addiu $t3, %lo(gMenuImageStack) # addiu $t3, $t3, -0x8a4 /* 09D8FC 8009CCFC 8FA8002C */ lw $t0, 0x2c($sp) /* 09D900 8009CD00 8D6E0000 */ lw $t6, ($t3) /* 09D904 8009CD04 3C028012 */ lui $v0, %hi(D_80126550) # $v0, 0x8012 @@ -186,8 +186,8 @@ glabel func_8009CA60 /* 09D92C 8009CD2C 00000000 */ nop /* 09D930 8009CD30 0C01A690 */ jal func_80069A40 /* 09D934 8009CD34 02002025 */ move $a0, $s0 -/* 09D938 8009CD38 3C0D800E */ lui $t5, %hi(D_800DF764) # $t5, 0x800e -/* 09D93C 8009CD3C 8DADF764 */ lw $t5, %lo(D_800DF764)($t5) +/* 09D938 8009CD38 3C0D800E */ lui $t5, %hi(sMenuGuiOpacity) # $t5, 0x800e +/* 09D93C 8009CD3C 8DADF764 */ lw $t5, %lo(sMenuGuiOpacity)($t5) /* 09D940 8009CD40 00000000 */ nop /* 09D944 8009CD44 29A100FF */ slti $at, $t5, 0xff /* 09D948 8009CD48 10200009 */ beqz $at, .L8009CD70 diff --git a/asm/non_matchings/menu/func_8009CD7C.s b/asm/non_matchings/menu/func_8009CD7C.s index 948f472a..3182035e 100644 --- a/asm/non_matchings/menu/func_8009CD7C.s +++ b/asm/non_matchings/menu/func_8009CD7C.s @@ -1,7 +1,7 @@ glabel func_8009CD7C /* 09D97C 8009CD7C 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 09D980 8009CD80 3C0F800E */ lui $t7, %hi(D_800DF764) # $t7, 0x800e -/* 09D984 8009CD84 8DEFF764 */ lw $t7, %lo(D_800DF764)($t7) +/* 09D980 8009CD80 3C0F800E */ lui $t7, %hi(sMenuGuiOpacity) # $t7, 0x800e +/* 09D984 8009CD84 8DEFF764 */ lw $t7, %lo(sMenuGuiOpacity)($t7) /* 09D988 8009CD88 AFB5002C */ sw $s5, 0x2c($sp) /* 09D98C 8009CD8C 240E0009 */ li $t6, 9 /* 09D990 8009CD90 240100FF */ li $at, 255 diff --git a/asm/non_matchings/menu/func_8009E3D0.s b/asm/non_matchings/menu/func_8009E3D0.s index 6e2e38b5..5f0b4aca 100644 --- a/asm/non_matchings/menu/func_8009E3D0.s +++ b/asm/non_matchings/menu/func_8009E3D0.s @@ -27,7 +27,7 @@ glabel func_8009E3D0 /* 09F030 8009E430 8DEF0300 */ lw $t7, %lo(osTvType)($t7) /* 09F034 8009E434 8FB80048 */ lw $t8, 0x48($sp) /* 09F038 8009E438 15E00003 */ bnez $t7, .L8009E448 -/* 09F03C 8009E43C 3C12800E */ lui $s2, %hi(D_800DF75C) # $s2, 0x800e +/* 09F03C 8009E43C 3C12800E */ lui $s2, %hi(gMenuImageStack) # $s2, 0x800e /* 09F040 8009E440 10000002 */ b .L8009E44C /* 09F044 8009E444 2415000A */ li $s5, 10 .L8009E448: @@ -37,7 +37,7 @@ glabel func_8009E3D0 /* 09F050 8009E450 24130008 */ li $s3, 8 /* 09F054 8009E454 33280004 */ andi $t0, $t9, 4 /* 09F058 8009E458 11000002 */ beqz $t0, .L8009E464 -/* 09F05C 8009E45C 2652F75C */ addiu $s2, %lo(D_800DF75C) # addiu $s2, $s2, -0x8a4 +/* 09F05C 8009E45C 2652F75C */ addiu $s2, %lo(gMenuImageStack) # addiu $s2, $s2, -0x8a4 /* 09F060 8009E460 24130009 */ li $s3, 9 .L8009E464: /* 09F064 8009E464 2409FFB6 */ li $t1, -74 diff --git a/asm/non_matchings/menu/menu_5_loop.s b/asm/non_matchings/menu/menu_5_loop.s index 18a137a9..3504220c 100644 --- a/asm/non_matchings/menu/menu_5_loop.s +++ b/asm/non_matchings/menu/menu_5_loop.s @@ -129,10 +129,10 @@ glabel menu_5_loop /* 0943DC 800937DC 24C6F47C */ addiu $a2, %lo(gMenuDelay) # addiu $a2, $a2, -0xb84 /* 0943E0 800937E0 240B0001 */ li $t3, 1 .L800937E4: -/* 0943E4 800937E4 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 0943E4 800937E4 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 0943E8 800937E8 ACCB0000 */ sw $t3, ($a2) /* 0943EC 800937EC 0C030076 */ jal func_800C01D8 -/* 0943F0 800937F0 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 0943F0 800937F0 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 0943F4 800937F4 240400EF */ li $a0, 239 /* 0943F8 800937F8 0C000741 */ jal func_80001D04 /* 0943FC 800937FC 00002825 */ move $a1, $zero @@ -157,9 +157,9 @@ glabel menu_5_loop /* 094440 80093840 0C030C7B */ jal func_800C31EC /* 094444 80093844 24042710 */ li $a0, 10000 .L80093848: -/* 094448 80093848 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 094448 80093848 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 09444C 8009384C 0C030076 */ jal func_800C01D8 -/* 094450 80093850 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 094450 80093850 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 094454 80093854 2418FFFF */ li $t8, -1 /* 094458 80093858 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 09445C 8009385C 10000064 */ b .L800939F0 @@ -177,9 +177,9 @@ glabel menu_5_loop /* 094484 80093884 24040241 */ li $a0, 577 /* 094488 80093888 0C000741 */ jal func_80001D04 /* 09448C 8009388C 00002825 */ move $a1, $zero -/* 094490 80093890 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 094490 80093890 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 094494 80093894 0C030076 */ jal func_800C01D8 -/* 094498 80093898 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 094498 80093898 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 09449C 8009389C 2419FFFF */ li $t9, -1 /* 0944A0 800938A0 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 0944A4 800938A4 10000052 */ b .L800939F0 diff --git a/asm/non_matchings/menu/menu_audio_options_loop.s b/asm/non_matchings/menu/menu_audio_options_loop.s index 6b7a728b..4c9db625 100644 --- a/asm/non_matchings/menu/menu_audio_options_loop.s +++ b/asm/non_matchings/menu/menu_audio_options_loop.s @@ -113,10 +113,10 @@ glabel menu_audio_options_loop /* 085A10 80084E10 2418FFFF */ li $t8, -1 .L80084E14: /* 085A14 80084E14 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 085A18 80084E18 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 085A18 80084E18 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 085A1C 80084E1C AC38F47C */ sw $t8, %lo(gMenuDelay)($at) /* 085A20 80084E20 0C030076 */ jal func_800C01D8 -/* 085A24 80084E24 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 085A24 80084E24 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 085A28 80084E28 3C198012 */ lui $t9, %hi(D_801263D8) # $t9, 0x8012 /* 085A2C 80084E2C 8F3963D8 */ lw $t9, %lo(D_801263D8)($t9) /* 085A30 80084E30 00000000 */ nop diff --git a/asm/non_matchings/menu/menu_credits_loop.s b/asm/non_matchings/menu/menu_credits_loop.s index 2018fadb..e8e750a3 100644 --- a/asm/non_matchings/menu/menu_credits_loop.s +++ b/asm/non_matchings/menu/menu_credits_loop.s @@ -634,9 +634,9 @@ glabel L8009BB9C /* 09C828 8009BC28 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 09C82C 8009BC2C 0C030060 */ jal func_800C0180 /* 09C830 8009BC30 AC2EF47C */ sw $t6, %lo(gMenuDelay)($at) -/* 09C834 8009BC34 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 09C834 8009BC34 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 09C838 8009BC38 0C030076 */ jal func_800C01D8 -/* 09C83C 8009BC3C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 09C83C 8009BC3C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 09C840 8009BC40 0C03005C */ jal func_800C0170 /* 09C844 8009BC44 00000000 */ nop /* 09C848 8009BC48 0C000326 */ jal set_music_fade_timer diff --git a/asm/non_matchings/menu/menu_file_select_loop.s b/asm/non_matchings/menu/menu_file_select_loop.s index b2853807..a057cba3 100644 --- a/asm/non_matchings/menu/menu_file_select_loop.s +++ b/asm/non_matchings/menu/menu_file_select_loop.s @@ -199,9 +199,9 @@ glabel menu_file_select_loop /* 08ED54 8008E154 00000000 */ nop /* 08ED58 8008E158 0C000326 */ jal set_music_fade_timer /* 08ED5C 8008E15C 2404FF80 */ li $a0, -128 -/* 08ED60 8008E160 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08ED60 8008E160 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08ED64 8008E164 0C030076 */ jal func_800C01D8 -/* 08ED68 8008E168 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08ED68 8008E168 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08ED6C 8008E16C 240D0001 */ li $t5, 1 /* 08ED70 8008E170 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08ED74 8008E174 10000045 */ b .L8008E28C @@ -271,11 +271,11 @@ glabel menu_file_select_loop .L8008E268: /* 08EE68 8008E268 8FB80040 */ lw $t8, 0x40($sp) .L8008E26C: -/* 08EE6C 8008E26C 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08EE6C 8008E26C 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08EE70 8008E270 13000006 */ beqz $t8, .L8008E28C /* 08EE74 8008E274 00000000 */ nop /* 08EE78 8008E278 0C030076 */ jal func_800C01D8 -/* 08EE7C 8008E27C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08EE7C 8008E27C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08EE80 8008E280 8FB90040 */ lw $t9, 0x40($sp) /* 08EE84 8008E284 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08EE88 8008E288 AC39F47C */ sw $t9, %lo(gMenuDelay)($at) diff --git a/asm/non_matchings/menu/menu_game_select_init.s b/asm/non_matchings/menu/menu_game_select_init.s index eb66887b..7bdc46f9 100644 --- a/asm/non_matchings/menu/menu_game_select_init.s +++ b/asm/non_matchings/menu/menu_game_select_init.s @@ -11,14 +11,14 @@ glabel menu_game_select_init /* 08D12C 8008C52C AFBF002C */ sw $ra, 0x2c($sp) /* 08D130 8008C530 AC20F460 */ sw $zero, %lo(D_800DF460)($at) /* 08D134 8008C534 240E0002 */ li $t6, 2 -/* 08D138 8008C538 3C04800E */ lui $a0, %hi(D_800DF77C) # $a0, 0x800e +/* 08D138 8008C538 3C04800E */ lui $a0, %hi(sMenuTransitionFadeOut) # $a0, 0x800e /* 08D13C 8008C53C AFB30024 */ sw $s3, 0x24($sp) /* 08D140 8008C540 AFB20020 */ sw $s2, 0x20($sp) /* 08D144 8008C544 AFB1001C */ sw $s1, 0x1c($sp) /* 08D148 8008C548 AFB00018 */ sw $s0, 0x18($sp) /* 08D14C 8008C54C AE8E0000 */ sw $t6, ($s4) /* 08D150 8008C550 0C030076 */ jal func_800C01D8 -/* 08D154 8008C554 2484F77C */ addiu $a0, %lo(D_800DF77C) # addiu $a0, $a0, -0x884 +/* 08D154 8008C554 2484F77C */ addiu $a0, %lo(sMenuTransitionFadeOut) # addiu $a0, $a0, -0x884 /* 08D158 8008C558 0C01BAEA */ jal func_8006EBA8 /* 08D15C 8008C55C 00000000 */ nop /* 08D160 8008C560 0C006DE4 */ jal func_8001B790 diff --git a/asm/non_matchings/menu/menu_game_select_loop.s b/asm/non_matchings/menu/menu_game_select_loop.s index e0f6e3d7..d3e9260f 100644 --- a/asm/non_matchings/menu/menu_game_select_loop.s +++ b/asm/non_matchings/menu/menu_game_select_loop.s @@ -154,9 +154,9 @@ glabel menu_game_select_loop /* 08D5F4 8008C9F4 0C000326 */ jal set_music_fade_timer /* 08D5F8 8008C9F8 2404FF80 */ li $a0, -128 .L8008C9FC: -/* 08D5FC 8008C9FC 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08D5FC 8008C9FC 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08D600 8008CA00 0C030076 */ jal func_800C01D8 -/* 08D604 8008CA04 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08D604 8008CA04 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08D608 8008CA08 240B0001 */ li $t3, 1 /* 08D60C 8008CA0C 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08D610 8008CA10 AC2BF47C */ sw $t3, %lo(gMenuDelay)($at) @@ -167,9 +167,9 @@ glabel menu_game_select_loop /* 08D624 8008CA24 00000000 */ nop .L8008CA28: /* 08D628 8008CA28 11800007 */ beqz $t4, .L8008CA48 -/* 08D62C 8008CA2C 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08D62C 8008CA2C 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08D630 8008CA30 0C030076 */ jal func_800C01D8 -/* 08D634 8008CA34 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08D634 8008CA34 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08D638 8008CA38 240DFFFF */ li $t5, -1 /* 08D63C 8008CA3C 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08D640 8008CA40 1000001B */ b .L8008CAB0 diff --git a/asm/non_matchings/menu/menu_ghost_data_init.s b/asm/non_matchings/menu/menu_ghost_data_init.s index 58118dca..ff1ec4fe 100644 --- a/asm/non_matchings/menu/menu_ghost_data_init.s +++ b/asm/non_matchings/menu/menu_ghost_data_init.s @@ -31,7 +31,7 @@ glabel menu_ghost_data_init /* 09A6CC 80099ACC 0C02719D */ jal func_8009C674 /* 09A6D0 80099AD0 24841708 */ addiu $a0, %lo(D_800E1708) # addiu $a0, $a0, 0x1708 /* 09A6D4 80099AD4 3C04800E */ lui $a0, %hi(D_800E174C) # $a0, 0x800e -/* 09A6D8 80099AD8 0C027229 */ jal func_8009C8A4 +/* 09A6D8 80099AD8 0C027229 */ jal allocate_menu_images /* 09A6DC 80099ADC 2484174C */ addiu $a0, %lo(D_800E174C) # addiu $a0, $a0, 0x174c /* 09A6E0 80099AE0 0C03105C */ jal func_800C4170 /* 09A6E4 80099AE4 24040002 */ li $a0, 2 @@ -249,9 +249,9 @@ glabel menu_ghost_data_init /* 09AA34 80099E34 3C018012 */ lui $at, %hi(D_80126498) # $at, 0x8012 /* 09AA38 80099E38 17200006 */ bnez $t9, .L80099E54 /* 09AA3C 80099E3C AC206498 */ sw $zero, %lo(D_80126498)($at) -/* 09AA40 80099E40 3C04800E */ lui $a0, %hi(D_800DF77C) # $a0, 0x800e +/* 09AA40 80099E40 3C04800E */ lui $a0, %hi(sMenuTransitionFadeOut) # $a0, 0x800e /* 09AA44 80099E44 0C030076 */ jal func_800C01D8 -/* 09AA48 80099E48 2484F77C */ addiu $a0, %lo(D_800DF77C) # addiu $a0, $a0, -0x884 +/* 09AA48 80099E48 2484F77C */ addiu $a0, %lo(sMenuTransitionFadeOut) # addiu $a0, $a0, -0x884 /* 09AA4C 80099E4C 10000004 */ b .L80099E60 /* 09AA50 80099E50 8FBF0044 */ lw $ra, 0x44($sp) .L80099E54: diff --git a/asm/non_matchings/menu/menu_ghost_data_loop.s b/asm/non_matchings/menu/menu_ghost_data_loop.s index bb206f25..f32a73ed 100644 --- a/asm/non_matchings/menu/menu_ghost_data_loop.s +++ b/asm/non_matchings/menu/menu_ghost_data_loop.s @@ -113,10 +113,10 @@ glabel menu_ghost_data_loop /* 09B574 8009A974 1540000A */ bnez $t2, .L8009A9A0 .L8009A978: /* 09B578 8009A978 24030001 */ li $v1, 1 -/* 09B57C 8009A97C 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 09B57C 8009A97C 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 09B580 8009A980 AD230000 */ sw $v1, ($t1) /* 09B584 8009A984 0C030076 */ jal func_800C01D8 -/* 09B588 8009A988 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 09B588 8009A988 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 09B58C 8009A98C 24040241 */ li $a0, 577 /* 09B590 8009A990 0C000741 */ jal func_80001D04 /* 09B594 8009A994 00002825 */ move $a1, $zero @@ -213,10 +213,10 @@ glabel menu_ghost_data_loop /* 09B6DC 8009AADC 24C663E0 */ addiu $a2, %lo(D_801263E0) # addiu $a2, $a2, 0x63e0 .L8009AAE0: /* 09B6E0 8009AAE0 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 09B6E4 8009AAE4 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 09B6E4 8009AAE4 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 09B6E8 8009AAE8 AC23F47C */ sw $v1, %lo(gMenuDelay)($at) /* 09B6EC 8009AAEC 0C030076 */ jal func_800C01D8 -/* 09B6F0 8009AAF0 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 09B6F0 8009AAF0 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 09B6F4 8009AAF4 24040241 */ li $a0, 577 /* 09B6F8 8009AAF8 0C000741 */ jal func_80001D04 /* 09B6FC 8009AAFC 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/menu_magic_codes_list_loop.s b/asm/non_matchings/menu/menu_magic_codes_list_loop.s index 6104383a..a1824d6f 100644 --- a/asm/non_matchings/menu/menu_magic_codes_list_loop.s +++ b/asm/non_matchings/menu/menu_magic_codes_list_loop.s @@ -240,10 +240,10 @@ glabel menu_magic_codes_list_loop /* 08B8A0 8008ACA0 8FA90048 */ lw $t1, 0x48($sp) /* 08B8A4 8008ACA4 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 08B8A8 8008ACA8 11200007 */ beqz $t1, .L8008ACC8 -/* 08B8AC 8008ACAC 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 08B8AC 8008ACAC 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 08B8B0 8008ACB0 AC29F47C */ sw $t1, %lo(gMenuDelay)($at) /* 08B8B4 8008ACB4 0C030076 */ jal func_800C01D8 -/* 08B8B8 8008ACB8 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08B8B8 8008ACB8 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08B8BC 8008ACBC 24040241 */ li $a0, 577 /* 08B8C0 8008ACC0 0C000741 */ jal func_80001D04 /* 08B8C4 8008ACC4 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/menu_magic_codes_loop.s b/asm/non_matchings/menu/menu_magic_codes_loop.s index 6a44c5bc..a902ad69 100644 --- a/asm/non_matchings/menu/menu_magic_codes_loop.s +++ b/asm/non_matchings/menu/menu_magic_codes_loop.s @@ -488,8 +488,8 @@ glabel menu_magic_codes_loop /* 08AFAC 8008A3AC AFB8003C */ sw $t8, 0x3c($sp) .L8008A3B0: /* 08AFB0 8008A3B0 8FB90040 */ lw $t9, 0x40($sp) -/* 08AFB4 8008A3B4 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e -/* 08AFB8 8008A3B8 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 08AFB4 8008A3B4 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e +/* 08AFB8 8008A3B8 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 08AFBC 8008A3BC 0C030076 */ jal func_800C01D8 /* 08AFC0 8008A3C0 AC39F47C */ sw $t9, %lo(gMenuDelay)($at) .L8008A3C4: diff --git a/asm/non_matchings/menu/menu_options_loop.s b/asm/non_matchings/menu/menu_options_loop.s index 5eed90fb..76f449b5 100644 --- a/asm/non_matchings/menu/menu_options_loop.s +++ b/asm/non_matchings/menu/menu_options_loop.s @@ -86,10 +86,10 @@ glabel menu_options_loop /* 085094 80084494 2404FF80 */ li $a0, -128 /* 085098 80084498 2419FFFF */ li $t9, -1 /* 08509C 8008449C 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 0850A0 800844A0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 0850A0 800844A0 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 0850A4 800844A4 AC39F47C */ sw $t9, %lo(gMenuDelay)($at) /* 0850A8 800844A8 0C030076 */ jal func_800C01D8 -/* 0850AC 800844AC 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 0850AC 800844AC 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 0850B0 800844B0 24040241 */ li $a0, 577 /* 0850B4 800844B4 0C000741 */ jal func_80001D04 /* 0850B8 800844B8 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/menu_results_loop.s b/asm/non_matchings/menu/menu_results_loop.s index 82e160f4..57aa80ba 100644 --- a/asm/non_matchings/menu/menu_results_loop.s +++ b/asm/non_matchings/menu/menu_results_loop.s @@ -115,9 +115,9 @@ glabel menu_results_loop /* 098058 80097458 AFA80020 */ sw $t0, 0x20($sp) /* 09805C 8009745C 0C000326 */ jal set_music_fade_timer /* 098060 80097460 2404FF80 */ li $a0, -128 -/* 098064 80097464 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 098064 80097464 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 098068 80097468 0C030076 */ jal func_800C01D8 -/* 09806C 8009746C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 09806C 8009746C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 098070 80097470 24080001 */ li $t0, 1 /* 098074 80097474 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 098078 80097478 10000050 */ b .L800975BC @@ -177,10 +177,10 @@ glabel menu_results_loop /* 098138 80097538 10000020 */ b .L800975BC /* 09813C 8009753C AC8F0000 */ sw $t7, ($a0) .L80097540: -/* 098140 80097540 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 098140 80097540 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 098144 80097544 AD280000 */ sw $t0, ($t1) /* 098148 80097548 0C030076 */ jal func_800C01D8 -/* 09814C 8009754C 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 09814C 8009754C 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 098150 80097550 0C000326 */ jal set_music_fade_timer /* 098154 80097554 2404FF80 */ li $a0, -128 /* 098158 80097558 10000019 */ b .L800975C0 diff --git a/asm/non_matchings/menu/menu_save_options_loop.s b/asm/non_matchings/menu/menu_save_options_loop.s index b600ab56..ef436535 100644 --- a/asm/non_matchings/menu/menu_save_options_loop.s +++ b/asm/non_matchings/menu/menu_save_options_loop.s @@ -224,11 +224,11 @@ glabel L80087E1C .L80087E70: /* 088A70 80087E70 3C08800E */ lui $t0, %hi(gMenuDelay) # $t0, 0x800e /* 088A74 80087E74 8D08F47C */ lw $t0, %lo(gMenuDelay)($t0) -/* 088A78 80087E78 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 088A78 80087E78 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 088A7C 80087E7C 11000003 */ beqz $t0, .L80087E8C /* 088A80 80087E80 00000000 */ nop /* 088A84 80087E84 0C030076 */ jal func_800C01D8 -/* 088A88 80087E88 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 088A88 80087E88 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c .L80087E8C: /* 088A8C 80087E8C 3C018012 */ lui $at, %hi(gIgnorePlayerInput) # $at, 0x8012 /* 088A90 80087E90 AC2063C4 */ sw $zero, %lo(gIgnorePlayerInput)($at) diff --git a/asm/non_matchings/menu/menu_title_screen_loop.s b/asm/non_matchings/menu/menu_title_screen_loop.s index ccb31e16..4ae68efe 100644 --- a/asm/non_matchings/menu/menu_title_screen_loop.s +++ b/asm/non_matchings/menu/menu_title_screen_loop.s @@ -280,12 +280,12 @@ glabel menu_title_screen_loop /* 0849DC 80083DDC 4500004B */ bc1f .L80083F0C /* 0849E0 80083DE0 00000000 */ nop /* 0849E4 80083DE4 44818000 */ mtc1 $at, $f16 -/* 0849E8 80083DE8 3C0A800E */ lui $t2, %hi(D_800DF760) # $t2, 0x800e +/* 0849E8 80083DE8 3C0A800E */ lui $t2, %hi(sMenuMusicVolume) # $t2, 0x800e /* 0849EC 80083DEC 4610003C */ c.lt.s $f0, $f16 /* 0849F0 80083DF0 3C014090 */ li $at, 0x40900000 # 4.500000 /* 0849F4 80083DF4 45000017 */ bc1f .L80083E54 /* 0849F8 80083DF8 00000000 */ nop -/* 0849FC 80083DFC 8D4AF760 */ lw $t2, %lo(D_800DF760)($t2) +/* 0849FC 80083DFC 8D4AF760 */ lw $t2, %lo(sMenuMusicVolume)($t2) /* 084A00 80083E00 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 084A04 80083E04 448A9000 */ mtc1 $t2, $f18 /* 084A08 80083E08 44813000 */ mtc1 $at, $f6 @@ -309,12 +309,12 @@ glabel menu_title_screen_loop /* 084A50 80083E50 2463686C */ addiu $v1, %lo(D_8012686C) # addiu $v1, $v1, 0x686c .L80083E54: /* 084A54 80083E54 44819000 */ mtc1 $at, $f18 -/* 084A58 80083E58 3C04800E */ lui $a0, %hi(D_800DF760) # $a0, 0x800e +/* 084A58 80083E58 3C04800E */ lui $a0, %hi(sMenuMusicVolume) # $a0, 0x800e /* 084A5C 80083E5C 4612003C */ c.lt.s $f0, $f18 /* 084A60 80083E60 3C0140A0 */ li $at, 0x40A00000 # 5.000000 /* 084A64 80083E64 45000009 */ bc1f .L80083E8C /* 084A68 80083E68 00000000 */ nop -/* 084A6C 80083E6C 8C84F760 */ lw $a0, %lo(D_800DF760)($a0) +/* 084A6C 80083E6C 8C84F760 */ lw $a0, %lo(sMenuMusicVolume)($a0) /* 084A70 80083E70 00000000 */ nop /* 084A74 80083E74 00046843 */ sra $t5, $a0, 1 /* 084A78 80083E78 0C000664 */ jal set_relative_volume_for_music @@ -326,10 +326,10 @@ glabel menu_title_screen_loop /* 084A8C 80083E8C 44813000 */ mtc1 $at, $f6 /* 084A90 80083E90 3C014080 */ li $at, 0x40800000 # 4.000000 /* 084A94 80083E94 4606003C */ c.lt.s $f0, $f6 -/* 084A98 80083E98 3C0F800E */ lui $t7, %hi(D_800DF760) # $t7, 0x800e +/* 084A98 80083E98 3C0F800E */ lui $t7, %hi(sMenuMusicVolume) # $t7, 0x800e /* 084A9C 80083E9C 45000016 */ bc1f .L80083EF8 -/* 084AA0 80083EA0 3C04800E */ lui $a0, %hi(D_800DF760+3) # $a0, 0x800e -/* 084AA4 80083EA4 8DEFF760 */ lw $t7, %lo(D_800DF760)($t7) +/* 084AA0 80083EA0 3C04800E */ lui $a0, %hi(sMenuMusicVolume+3) # $a0, 0x800e +/* 084AA4 80083EA4 8DEFF760 */ lw $t7, %lo(sMenuMusicVolume)($t7) /* 084AA8 80083EA8 44815000 */ mtc1 $at, $f10 /* 084AAC 80083EAC 448F2000 */ mtc1 $t7, $f4 /* 084AB0 80083EB0 460A0401 */ sub.s $f16, $f0, $f10 @@ -351,7 +351,7 @@ glabel menu_title_screen_loop /* 084AF0 80083EF0 10000006 */ b .L80083F0C /* 084AF4 80083EF4 2463686C */ addiu $v1, %lo(D_8012686C) # addiu $v1, $v1, 0x686c .L80083EF8: -/* 084AF8 80083EF8 9084F763 */ lbu $a0, %lo(D_800DF760+3)($a0) +/* 084AF8 80083EF8 9084F763 */ lbu $a0, %lo(sMenuMusicVolume+3)($a0) /* 084AFC 80083EFC 0C000664 */ jal set_relative_volume_for_music /* 084B00 80083F00 00000000 */ nop /* 084B04 80083F04 3C038012 */ lui $v1, %hi(D_8012686C) # $v1, 0x8012 @@ -434,10 +434,10 @@ glabel menu_title_screen_loop /* 084C1C 8008401C 00C02025 */ move $a0, $a2 /* 084C20 80084020 240F0001 */ li $t7, 1 /* 084C24 80084024 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e -/* 084C28 80084028 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 084C28 80084028 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 084C2C 8008402C AC2FF47C */ sw $t7, %lo(gMenuDelay)($at) /* 084C30 80084030 0C030076 */ jal func_800C01D8 -/* 084C34 80084034 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 084C34 80084034 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 084C38 80084038 0C03005C */ jal func_800C0170 /* 084C3C 8008403C 00000000 */ nop /* 084C40 80084040 240400EF */ li $a0, 239 diff --git a/asm/non_matchings/menu/menu_track_select_init.s b/asm/non_matchings/menu/menu_track_select_init.s index cec61731..a09b35e3 100644 --- a/asm/non_matchings/menu/menu_track_select_init.s +++ b/asm/non_matchings/menu/menu_track_select_init.s @@ -90,14 +90,14 @@ glabel menu_track_select_init /* 08F4FC 8008E8FC 3C018012 */ lui $at, %hi(D_801267D0) # $at, 0x8012 /* 08F500 8008E900 0C023C03 */ jal func_8008F00C /* 08F504 8008E904 AC3567D0 */ sw $s5, %lo(D_801267D0)($at) -/* 08F508 8008E908 3C04800E */ lui $a0, %hi(D_800DF77C) # $a0, 0x800e +/* 08F508 8008E908 3C04800E */ lui $a0, %hi(sMenuTransitionFadeOut) # $a0, 0x800e /* 08F50C 8008E90C 0C030076 */ jal func_800C01D8 -/* 08F510 8008E910 2484F77C */ addiu $a0, %lo(D_800DF77C) # addiu $a0, $a0, -0x884 +/* 08F510 8008E910 2484F77C */ addiu $a0, %lo(sMenuTransitionFadeOut) # addiu $a0, $a0, -0x884 /* 08F514 8008E914 0C03005C */ jal func_800C0170 /* 08F518 8008E918 00000000 */ nop /* 08F51C 8008E91C 24040032 */ li $a0, 50 /* 08F520 8008E920 24050069 */ li $a1, 105 -/* 08F524 8008E924 0C01DED7 */ jal func_80077B5C +/* 08F524 8008E924 0C01DED7 */ jal set_background_fill_colour /* 08F528 8008E928 240600DF */ li $a2, 223 /* 08F52C 8008E92C 3C11800E */ lui $s1, %hi(D_800E0710) # $s1, 0x800e /* 08F530 8008E930 3C168012 */ lui $s6, %hi(D_80126550) # $s6, 0x8012 @@ -334,7 +334,7 @@ glabel menu_track_select_init /* 08F8B0 8008ECB0 0C02719D */ jal func_8009C674 /* 08F8B4 8008ECB4 248407C4 */ addiu $a0, %lo(D_800E07C4) # addiu $a0, $a0, 0x7c4 /* 08F8B8 8008ECB8 3C04800E */ lui $a0, %hi(D_800E07E0) # $a0, 0x800e -/* 08F8BC 8008ECBC 0C027229 */ jal func_8009C8A4 +/* 08F8BC 8008ECBC 0C027229 */ jal allocate_menu_images /* 08F8C0 8008ECC0 248407E0 */ addiu $a0, %lo(D_800E07E0) # addiu $a0, $a0, 0x7e0 /* 08F8C4 8008ECC4 0C02392C */ jal func_8008E4B0 /* 08F8C8 8008ECC8 00000000 */ nop @@ -520,9 +520,9 @@ glabel menu_track_select_init /* 08FB68 8008EF68 24040002 */ li $a0, 2 /* 08FB6C 8008EF6C 3C018012 */ lui $at, %hi(D_80126840) # $at, 0x8012 /* 08FB70 8008EF70 AC206840 */ sw $zero, %lo(D_80126840)($at) -/* 08FB74 8008EF74 3C10800E */ lui $s0, %hi(D_800DF760) # $s0, 0x800e +/* 08FB74 8008EF74 3C10800E */ lui $s0, %hi(sMenuMusicVolume) # $s0, 0x800e /* 08FB78 8008EF78 3C018012 */ lui $at, %hi(D_80126848) # $at, 0x8012 -/* 08FB7C 8008EF7C 2610F760 */ addiu $s0, %lo(D_800DF760) # addiu $s0, $s0, -0x8a0 +/* 08FB7C 8008EF7C 2610F760 */ addiu $s0, %lo(sMenuMusicVolume) # addiu $s0, $s0, -0x8a0 /* 08FB80 8008EF80 AC206848 */ sw $zero, %lo(D_80126848)($at) /* 08FB84 8008EF84 AE000000 */ sw $zero, ($s0) /* 08FB88 8008EF88 0C0002F8 */ jal set_music_player_voice_limit diff --git a/asm/non_matchings/menu/menu_track_select_loop.s b/asm/non_matchings/menu/menu_track_select_loop.s index 318b57ee..319cef00 100644 --- a/asm/non_matchings/menu/menu_track_select_loop.s +++ b/asm/non_matchings/menu/menu_track_select_loop.s @@ -75,8 +75,8 @@ glabel menu_track_select_loop /* 08FF48 8008F348 0C024862 */ jal func_80092188 /* 08FF4C 8008F34C 00000000 */ nop .L8008F350: -/* 08FF50 8008F350 3C03800E */ lui $v1, %hi(D_800DF760) # $v1, 0x800e -/* 08FF54 8008F354 2463F760 */ addiu $v1, %lo(D_800DF760) # addiu $v1, $v1, -0x8a0 +/* 08FF50 8008F350 3C03800E */ lui $v1, %hi(sMenuMusicVolume) # $v1, 0x800e +/* 08FF54 8008F354 2463F760 */ addiu $v1, %lo(sMenuMusicVolume) # addiu $v1, $v1, -0x8a0 /* 08FF58 8008F358 8C620000 */ lw $v0, ($v1) /* 08FF5C 8008F35C 8FAF0020 */ lw $t7, 0x20($sp) /* 08FF60 8008F360 04410005 */ bgez $v0, .L8008F378 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 2c09bef4..019dbc3a 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_init.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s @@ -20,7 +20,7 @@ glabel menu_trophy_race_rankings_init /* 09966C 80098A6C 0C02719D */ jal func_8009C674 /* 099670 80098A70 24841024 */ addiu $a0, %lo(D_800E1024) # addiu $a0, $a0, 0x1024 /* 099674 80098A74 3C04800E */ lui $a0, %hi(D_800E1040) # $a0, 0x800e -/* 099678 80098A78 0C027229 */ jal func_8009C8A4 +/* 099678 80098A78 0C027229 */ jal allocate_menu_images /* 09967C 80098A7C 24841040 */ addiu $a0, %lo(D_800E1040) # addiu $a0, $a0, 0x1040 /* 099680 80098A80 3C03800E */ lui $v1, %hi(D_800E0FEC) # $v1, 0x800e /* 099684 80098A84 24630FEC */ addiu $v1, %lo(D_800E0FEC) # addiu $v1, $v1, 0xfec diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s index c59d92ba..e77f5c80 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s @@ -199,9 +199,9 @@ glabel menu_trophy_race_rankings_loop /* 099EAC 800992AC AFA0004C */ sw $zero, 0x4c($sp) /* 099EB0 800992B0 0C000326 */ jal set_music_fade_timer /* 099EB4 800992B4 AFAB002C */ sw $t3, 0x2c($sp) -/* 099EB8 800992B8 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 099EB8 800992B8 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 099EBC 800992BC 0C030076 */ jal func_800C01D8 -/* 099EC0 800992C0 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 099EC0 800992C0 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 099EC4 800992C4 3C0D800E */ lui $t5, %hi(D_800E0FE4) # $t5, 0x800e /* 099EC8 800992C8 8DAD0FE4 */ lw $t5, %lo(D_800E0FE4)($t5) /* 099ECC 800992CC 8FA5004C */ lw $a1, 0x4c($sp) diff --git a/asm/non_matchings/menu/menu_trophy_race_round_loop.s b/asm/non_matchings/menu/menu_trophy_race_round_loop.s index 3f64a0b6..e5b867df 100644 --- a/asm/non_matchings/menu/menu_trophy_race_round_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_loop.s @@ -68,12 +68,12 @@ glabel menu_trophy_race_round_loop /* 099294 80098694 00000000 */ nop /* 099298 80098698 3C198012 */ lui $t9, %hi(D_801267E8) # $t9, 0x8012 /* 09929C 8009869C 8F3967E8 */ lw $t9, %lo(D_801267E8)($t9) -/* 0992A0 800986A0 3C04800E */ lui $a0, %hi(D_800DF774) # $a0, 0x800e +/* 0992A0 800986A0 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e /* 0992A4 800986A4 33289000 */ andi $t0, $t9, 0x9000 /* 0992A8 800986A8 11000008 */ beqz $t0, .L800986CC /* 0992AC 800986AC 00000000 */ nop /* 0992B0 800986B0 0C030076 */ jal func_800C01D8 -/* 0992B4 800986B4 2484F774 */ addiu $a0, %lo(D_800DF774) # addiu $a0, $a0, -0x88c +/* 0992B4 800986B4 2484F774 */ addiu $a0, %lo(sMenuTransitionFadeIn) # addiu $a0, $a0, -0x88c /* 0992B8 800986B8 24090001 */ li $t1, 1 /* 0992BC 800986BC 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e /* 0992C0 800986C0 AC29F47C */ sw $t1, %lo(gMenuDelay)($at) diff --git a/asm/non_matchings/menu/render_file_select_menu.s b/asm/non_matchings/menu/render_file_select_menu.s index a0aee289..90bc01d5 100644 --- a/asm/non_matchings/menu/render_file_select_menu.s +++ b/asm/non_matchings/menu/render_file_select_menu.s @@ -89,8 +89,8 @@ glabel render_file_select_menu /* 08DABC 8008CEBC 3C118012 */ lui $s1, %hi(gSavefileInfo) # $s1, 0x8012 /* 08DAC0 8008CEC0 3C10800E */ lui $s0, %hi(D_800E03CC) # $s0, 0x800e /* 08DAC4 8008CEC4 3C14800E */ lui $s4, %hi(D_800E03FC) # $s4, 0x800e -/* 08DAC8 8008CEC8 3C13800E */ lui $s3, %hi(D_800DF75C) # $s3, 0x800e -/* 08DACC 8008CECC 2673F75C */ addiu $s3, %lo(D_800DF75C) # addiu $s3, $s3, -0x8a4 +/* 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 /* 08DAD8 8008CED8 263164A0 */ addiu $s1, %lo(gSavefileInfo) # addiu $s1, $s1, 0x64a0 @@ -118,7 +118,7 @@ glabel render_file_select_menu /* 08DB28 8008CF28 AFA00014 */ sw $zero, 0x14($sp) /* 08DB2C 8008CF2C AFAB0018 */ sw $t3, 0x18($sp) /* 08DB30 8008CF30 03282821 */ addu $a1, $t9, $t0 -/* 08DB34 8008CF34 0C02330A */ jal func_8008CC28 +/* 08DB34 8008CF34 0C02330A */ jal render_menu_image /* 08DB38 8008CF38 012A3021 */ addu $a2, $t1, $t2 /* 08DB3C 8008CF3C 0C01A142 */ jal func_80068508 /* 08DB40 8008CF40 24040001 */ li $a0, 1 @@ -150,7 +150,7 @@ glabel render_file_select_menu /* 08DBA0 8008CFA0 AFA90018 */ sw $t1, 0x18($sp) /* 08DBA4 8008CFA4 AFA00014 */ sw $zero, 0x14($sp) /* 08DBA8 8008CFA8 AFA00010 */ sw $zero, 0x10($sp) -/* 08DBAC 8008CFAC 0C02330A */ jal func_8008CC28 +/* 08DBAC 8008CFAC 0C02330A */ jal render_menu_image /* 08DBB0 8008CFB0 03283021 */ addu $a2, $t9, $t0 /* 08DBB4 8008CFB4 962A0002 */ lhu $t2, 2($s1) /* 08DBB8 8008CFB8 8E6C0000 */ lw $t4, ($s3) @@ -180,15 +180,15 @@ glabel render_file_select_menu /* 08DC10 8008D010 AFB90018 */ sw $t9, 0x18($sp) /* 08DC14 8008D014 AFA00014 */ sw $zero, 0x14($sp) /* 08DC18 8008D018 AFA00010 */ sw $zero, 0x10($sp) -/* 08DC1C 8008D01C 0C02330A */ jal func_8008CC28 +/* 08DC1C 8008D01C 0C02330A */ jal render_menu_image /* 08DC20 8008D020 01F83021 */ addu $a2, $t7, $t8 /* 08DC24 8008D024 0C01A142 */ jal func_80068508 /* 08DC28 8008D028 00002025 */ move $a0, $zero /* 08DC2C 8008D02C 24020040 */ li $v0, 64 -/* 08DC30 8008D030 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 08DC34 8008D034 A022F4A8 */ sb $v0, %lo(D_800DF4A8)($at) -/* 08DC38 8008D038 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e -/* 08DC3C 8008D03C A022F4AC */ sb $v0, %lo(D_800DF4AC)($at) +/* 08DC30 8008D030 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 08DC34 8008D034 A022F4A8 */ sb $v0, %lo(sMenuGuiColourG)($at) +/* 08DC38 8008D038 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e +/* 08DC3C 8008D03C A022F4AC */ sb $v0, %lo(sMenuGuiColourB)($at) /* 08DC40 8008D040 860B0002 */ lh $t3, 2($s0) /* 08DC44 8008D044 868A0012 */ lh $t2, 0x12($s4) /* 08DC48 8008D048 86090000 */ lh $t1, ($s0) @@ -200,13 +200,13 @@ glabel render_file_select_menu /* 08DC60 8008D060 AFA00010 */ sw $zero, 0x10($sp) /* 08DC64 8008D064 AFA00014 */ sw $zero, 0x14($sp) /* 08DC68 8008D068 014B3021 */ addu $a2, $t2, $t3 -/* 08DC6C 8008D06C 0C02330A */ jal func_8008CC28 +/* 08DC6C 8008D06C 0C02330A */ jal render_menu_image /* 08DC70 8008D070 01092821 */ addu $a1, $t0, $t1 /* 08DC74 8008D074 240200FF */ li $v0, 255 -/* 08DC78 8008D078 3C01800E */ lui $at, %hi(D_800DF4A8) # $at, 0x800e -/* 08DC7C 8008D07C A022F4A8 */ sb $v0, %lo(D_800DF4A8)($at) -/* 08DC80 8008D080 3C01800E */ lui $at, %hi(D_800DF4AC) # $at, 0x800e -/* 08DC84 8008D084 A022F4AC */ sb $v0, %lo(D_800DF4AC)($at) +/* 08DC78 8008D078 3C01800E */ lui $at, %hi(sMenuGuiColourG) # $at, 0x800e +/* 08DC7C 8008D07C A022F4A8 */ sb $v0, %lo(sMenuGuiColourG)($at) +/* 08DC80 8008D080 3C01800E */ lui $at, %hi(sMenuGuiColourB) # $at, 0x800e +/* 08DC84 8008D084 A022F4AC */ sb $v0, %lo(sMenuGuiColourB)($at) /* 08DC88 8008D088 0C01EFC7 */ jal func_8007BF1C /* 08DC8C 8008D08C 24040001 */ li $a0, 1 /* 08DC90 8008D090 10000014 */ b .L8008D0E4 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 a89951db..430154f4 100644 --- a/asm/non_matchings/menu/render_track_select_setup_ui.s +++ b/asm/non_matchings/menu/render_track_select_setup_ui.s @@ -57,9 +57,9 @@ glabel render_track_select_setup_ui /* 091BF0 80090FF0 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 /* 091BF4 80090FF4 3C02800E */ lui $v0, %hi(gMenuDelay) # $v0, 0x800e /* 091BF8 80090FF8 8C42F47C */ lw $v0, %lo(gMenuDelay)($v0) -/* 091BFC 80090FFC 3C03800E */ lui $v1, %hi(D_800DF75C) # $v1, 0x800e +/* 091BFC 80090FFC 3C03800E */ lui $v1, %hi(gMenuImageStack) # $v1, 0x800e /* 091C00 80091000 04410029 */ bgez $v0, .L800910A8 -/* 091C04 80091004 2463F75C */ addiu $v1, %lo(D_800DF75C) # addiu $v1, $v1, -0x8a4 +/* 091C04 80091004 2463F75C */ addiu $v1, %lo(gMenuImageStack) # addiu $v1, $v1, -0x8a4 /* 091C08 80091008 3C028012 */ lui $v0, %hi(D_801269F4) # $v0, 0x8012 /* 091C0C 8009100C 8C4269F4 */ lw $v0, %lo(D_801269F4)($v0) /* 091C10 80091010 24010004 */ li $at, 4 @@ -111,15 +111,15 @@ glabel render_track_select_setup_ui /* 091CB4 800910B4 10200428 */ beqz $at, .L80092158 /* 091CB8 800910B8 3C04800E */ lui $a0, %hi(gTrackIdForPreview) # $a0, 0x800e /* 091CBC 800910BC 04410006 */ bgez $v0, .L800910D8 -/* 091CC0 800910C0 3C1E800E */ lui $fp, %hi(D_800DF764) # $fp, 0x800e +/* 091CC0 800910C0 3C1E800E */ lui $fp, %hi(sMenuGuiOpacity) # $fp, 0x800e /* 091CC4 800910C4 0002C900 */ sll $t9, $v0, 4 /* 091CC8 800910C8 272800FF */ addiu $t0, $t9, 0xff -/* 091CCC 800910CC 27DEF764 */ addiu $fp, %lo(D_800DF764) # addiu $fp, $fp, -0x89c +/* 091CCC 800910CC 27DEF764 */ addiu $fp, %lo(sMenuGuiOpacity) # addiu $fp, $fp, -0x89c /* 091CD0 800910D0 10000005 */ b .L800910E8 /* 091CD4 800910D4 AFC80000 */ sw $t0, ($fp) .L800910D8: -/* 091CD8 800910D8 3C1E800E */ lui $fp, %hi(D_800DF764) # $fp, 0x800e -/* 091CDC 800910DC 27DEF764 */ addiu $fp, %lo(D_800DF764) # addiu $fp, $fp, -0x89c +/* 091CD8 800910D8 3C1E800E */ lui $fp, %hi(sMenuGuiOpacity) # $fp, 0x800e +/* 091CDC 800910DC 27DEF764 */ addiu $fp, %lo(sMenuGuiOpacity) # addiu $fp, $fp, -0x89c /* 091CE0 800910E0 240900FF */ li $t1, 255 /* 091CE4 800910E4 AFC90000 */ sw $t1, ($fp) .L800910E8: @@ -880,8 +880,8 @@ glabel render_track_select_setup_ui /* 092814 80091C14 10200022 */ beqz $at, .L80091CA0 /* 092818 80091C18 8FAC0074 */ lw $t4, 0x74($sp) /* 09281C 80091C1C 15E0001F */ bnez $t7, .L80091C9C -/* 092820 80091C20 3C02800E */ lui $v0, %hi(D_800DF75C) # $v0, 0x800e -/* 092824 80091C24 2442F75C */ addiu $v0, %lo(D_800DF75C) # addiu $v0, $v0, -0x8a4 +/* 092820 80091C20 3C02800E */ lui $v0, %hi(gMenuImageStack) # $v0, 0x800e +/* 092824 80091C24 2442F75C */ addiu $v0, %lo(gMenuImageStack) # addiu $v0, $v0, -0x8a4 /* 092828 80091C28 3C01C250 */ li $at, 0xC2500000 # -52.000000 /* 09282C 80091C2C 44814000 */ mtc1 $at, $f8 /* 092830 80091C30 8C590000 */ lw $t9, ($v0) @@ -906,8 +906,8 @@ glabel render_track_select_setup_ui /* 092878 80091C78 0C027298 */ jal func_8009CA60 /* 09287C 80091C7C E51000EC */ swc1 $f16, 0xec($t0) /* 092880 80091C80 3C014240 */ li $at, 0x42400000 # 48.000000 -/* 092884 80091C84 3C0B800E */ lui $t3, %hi(D_800DF75C) # $t3, 0x800e -/* 092888 80091C88 8D6BF75C */ lw $t3, %lo(D_800DF75C)($t3) +/* 092884 80091C84 3C0B800E */ lui $t3, %hi(gMenuImageStack) # $t3, 0x800e +/* 092888 80091C88 8D6BF75C */ lw $t3, %lo(gMenuImageStack)($t3) /* 09288C 80091C8C 44819000 */ mtc1 $at, $f18 /* 092890 80091C90 24040007 */ li $a0, 7 /* 092894 80091C94 0C027298 */ jal func_8009CA60 @@ -1014,10 +1014,10 @@ glabel render_track_select_setup_ui /* 092A18 80091E18 0C01EFC7 */ jal func_8007BF1C /* 092A1C 80091E1C 00002025 */ move $a0, $zero /* 092A20 80091E20 3C15800E */ lui $s5, %hi(gMultiplayerSelectedNumberOfRacers) # $s5, 0x800e -/* 092A24 80091E24 3C11800E */ lui $s1, %hi(D_800DF4AC) # $s1, 0x800e -/* 092A28 80091E28 3C10800E */ lui $s0, %hi(D_800DF4A8) # $s0, 0x800e -/* 092A2C 80091E2C 2610F4A8 */ addiu $s0, %lo(D_800DF4A8) # addiu $s0, $s0, -0xb58 -/* 092A30 80091E30 2631F4AC */ addiu $s1, %lo(D_800DF4AC) # addiu $s1, $s1, -0xb54 +/* 092A24 80091E24 3C11800E */ lui $s1, %hi(sMenuGuiColourB) # $s1, 0x800e +/* 092A28 80091E28 3C10800E */ lui $s0, %hi(sMenuGuiColourG) # $s0, 0x800e +/* 092A2C 80091E2C 2610F4A8 */ addiu $s0, %lo(sMenuGuiColourG) # addiu $s0, $s0, -0xb58 +/* 092A30 80091E30 2631F4AC */ addiu $s1, %lo(sMenuGuiColourB) # addiu $s1, $s1, -0xb54 /* 092A34 80091E34 26B50410 */ addiu $s5, %lo(gMultiplayerSelectedNumberOfRacers) # addiu $s5, $s5, 0x410 /* 092A38 80091E38 0000A025 */ move $s4, $zero /* 092A3C 80091E3C 241300FF */ li $s3, 255 @@ -1045,11 +1045,11 @@ glabel render_track_select_setup_ui /* 092A84 80091E84 02581821 */ addu $v1, $s2, $t8 /* 092A88 80091E88 846F0010 */ lh $t7, 0x10($v1) /* 092A8C 80091E8C 864E0000 */ lh $t6, ($s2) -/* 092A90 80091E90 3C05800E */ lui $a1, %hi(D_800DF75C) # $a1, 0x800e +/* 092A90 80091E90 3C05800E */ lui $a1, %hi(gMenuImageStack) # $a1, 0x800e /* 092A94 80091E94 01EEC821 */ addu $t9, $t7, $t6 /* 092A98 80091E98 2729FF60 */ addiu $t1, $t9, -0xa0 /* 092A9C 80091E9C 44892000 */ mtc1 $t1, $f4 -/* 092AA0 80091EA0 24A5F75C */ addiu $a1, %lo(D_800DF75C) # addiu $a1, $a1, -0x8a4 +/* 092AA0 80091EA0 24A5F75C */ addiu $a1, %lo(gMenuImageStack) # addiu $a1, $a1, -0x8a4 /* 092AA4 80091EA4 468021A0 */ cvt.s.w $f6, $f4 /* 092AA8 80091EA8 8CAA0000 */ lw $t2, ($a1) /* 092AAC 80091EAC 244E0002 */ addiu $t6, $v0, 2 @@ -1091,8 +1091,8 @@ glabel render_track_select_setup_ui /* 092B38 80091F38 3C014228 */ li $at, 0x42280000 # 42.000000 /* 092B3C 80091F3C 2415000C */ li $s5, 12 .L80091F40: -/* 092B40 80091F40 3C08800E */ lui $t0, %hi(D_800DF75C) # $t0, 0x800e -/* 092B44 80091F44 8D08F75C */ lw $t0, %lo(D_800DF75C)($t0) +/* 092B40 80091F40 3C08800E */ lui $t0, %hi(gMenuImageStack) # $t0, 0x800e +/* 092B44 80091F44 8D08F75C */ lw $t0, %lo(gMenuImageStack)($t0) /* 092B48 80091F48 44818000 */ mtc1 $at, $f16 /* 092B4C 80091F4C 00158140 */ sll $s0, $s5, 5 /* 092B50 80091F50 01105821 */ addu $t3, $t0, $s0 @@ -1112,8 +1112,8 @@ glabel render_track_select_setup_ui /* 092B88 80091F88 00000000 */ nop /* 092B8C 80091F8C 10400008 */ beqz $v0, .L80091FB0 .L80091F90: -/* 092B90 80091F90 3C0A800E */ lui $t2, %hi(D_800DF75C) # $t2, 0x800e -/* 092B94 80091F94 8D4AF75C */ lw $t2, %lo(D_800DF75C)($t2) +/* 092B90 80091F90 3C0A800E */ lui $t2, %hi(gMenuImageStack) # $t2, 0x800e +/* 092B94 80091F94 8D4AF75C */ lw $t2, %lo(gMenuImageStack)($t2) /* 092B98 80091F98 3C01C300 */ li $at, 0xC3000000 # -128.000000 /* 092B9C 80091F9C 44819000 */ mtc1 $at, $f18 /* 092BA0 80091FA0 01504021 */ addu $t0, $t2, $s0 @@ -1136,8 +1136,8 @@ glabel render_track_select_setup_ui /* 092BE0 80091FE0 00000000 */ nop /* 092BE4 80091FE4 10400008 */ beqz $v0, .L80092008 .L80091FE8: -/* 092BE8 80091FE8 3C09800E */ lui $t1, %hi(D_800DF75C) # $t1, 0x800e -/* 092BEC 80091FEC 8D29F75C */ lw $t1, %lo(D_800DF75C)($t1) +/* 092BE8 80091FE8 3C09800E */ lui $t1, %hi(gMenuImageStack) # $t1, 0x800e +/* 092BEC 80091FEC 8D29F75C */ lw $t1, %lo(gMenuImageStack)($t1) /* 092BF0 80091FF0 3C0142F0 */ li $at, 0x42F00000 # 120.000000 /* 092BF4 80091FF4 44812000 */ mtc1 $at, $f4 /* 092BF8 80091FF8 01305021 */ addu $t2, $t1, $s0 diff --git a/asm/non_matchings/menu/tt_menu_loop.s b/asm/non_matchings/menu/tt_menu_loop.s index ce00811b..69a093d5 100644 --- a/asm/non_matchings/menu/tt_menu_loop.s +++ b/asm/non_matchings/menu/tt_menu_loop.s @@ -141,7 +141,7 @@ glabel L8009DC60 /* 09E928 8009DD28 8DC40014 */ lw $a0, 0x14($t6) /* 09E92C 8009DD2C 0C02746E */ jal render_dialogue_option /* 09E930 8009DD30 24060002 */ li $a2, 2 -/* 09E934 8009DD34 0C02749B */ jal func_8009D26C +/* 09E934 8009DD34 0C02749B */ jal handle_menu_joystick_input /* 09E938 8009DD38 00000000 */ nop /* 09E93C 8009DD3C 3C0F8012 */ lui $t7, %hi(D_80126516) # $t7, 0x8012 /* 09E940 8009DD40 81EF6516 */ lb $t7, %lo(D_80126516)($t7) @@ -220,7 +220,7 @@ glabel L8009DC60 /* 09EA4C 8009DE4C 0C02719D */ jal func_8009C674 /* 09EA50 8009DE50 24841E2C */ addiu $a0, %lo(D_800E1E2C) # addiu $a0, $a0, 0x1e2c /* 09EA54 8009DE54 3C04800E */ lui $a0, %hi(D_800E1E40) # $a0, 0x800e -/* 09EA58 8009DE58 0C027229 */ jal func_8009C8A4 +/* 09EA58 8009DE58 0C027229 */ jal allocate_menu_images /* 09EA5C 8009DE5C 24841E40 */ addiu $a0, %lo(D_800E1E40) # addiu $a0, $a0, 0x1e40 /* 09EA60 8009DE60 240B0001 */ li $t3, 1 /* 09EA64 8009DE64 3C01800E */ lui $at, %hi(D_800E1E28) # $at, 0x800e diff --git a/asm/non_matchings/unknown_032760/func_80039330.s b/asm/non_matchings/unknown_032760/func_80039330.s index fa8c5cb6..606a17af 100644 --- a/asm/non_matchings/unknown_032760/func_80039330.s +++ b/asm/non_matchings/unknown_032760/func_80039330.s @@ -705,7 +705,7 @@ glabel L80039BB8 /* 03A908 80039D08 10000005 */ b .L80039D20 /* 03A90C 80039D0C 00000000 */ nop .L80039D10: -/* 03A910 80039D10 0C0274CF */ jal func_8009D33C +/* 03A910 80039D10 0C0274CF */ jal set_menu_id_if_option_equal /* 03A914 80039D14 24050002 */ li $a1, 2 /* 03A918 80039D18 8FA6007C */ lw $a2, 0x7c($sp) /* 03A91C 80039D1C 00000000 */ nop @@ -893,7 +893,7 @@ glabel L80039ED8 /* 03ABC4 80039FC4 E62A0004 */ swc1 $f10, 4($s1) .L80039FC8: /* 03ABC8 80039FC8 AE190078 */ sw $t9, 0x78($s0) -/* 03ABCC 80039FCC 0C0274CF */ jal func_8009D33C +/* 03ABCC 80039FCC 0C0274CF */ jal set_menu_id_if_option_equal /* 03ABD0 80039FD0 24050002 */ li $a1, 2 .L80039FD4: /* 03ABD4 80039FD4 100002CB */ b .L8003AB04 diff --git a/asm/non_matchings/unknown_06B2B0/load_level.s b/asm/non_matchings/unknown_06B2B0/load_level.s index 02844f6c..03ea7f18 100644 --- a/asm/non_matchings/unknown_06B2B0/load_level.s +++ b/asm/non_matchings/unknown_06B2B0/load_level.s @@ -726,7 +726,7 @@ glabel load_level /* 06C8C4 8006BCC4 9064009D */ lbu $a0, 0x9d($v1) /* 06C8C8 8006BCC8 9065009E */ lbu $a1, 0x9e($v1) /* 06C8CC 8006BCCC 9066009F */ lbu $a2, 0x9f($v1) -/* 06C8D0 8006BCD0 0C01DECD */ jal func_80077B34 +/* 06C8D0 8006BCD0 0C01DECD */ jal set_background_prim_colour /* 06C8D4 8006BCD4 00000000 */ nop /* 06C8D8 8006BCD8 0C01EA5D */ jal func_8007A974 /* 06C8DC 8006BCDC 00000000 */ nop diff --git a/asm/non_matchings/unknown_078050/render_background.s b/asm/non_matchings/unknown_078050/render_background.s index 43213722..31825785 100644 --- a/asm/non_matchings/unknown_078050/render_background.s +++ b/asm/non_matchings/unknown_078050/render_background.s @@ -129,7 +129,7 @@ glabel render_background /* 078994 80077D94 27AF0084 */ addiu $t7, $sp, 0x84 .L80077D98: /* 078998 80077D98 8C42E4D0 */ lw $v0, %lo(D_800DE4D0)($v0) -/* 07899C 80077D9C 3C18800E */ lui $t8, %hi(D_800DE4BC) # $t8, 0x800e +/* 07899C 80077D9C 3C18800E */ lui $t8, %hi(sBackgroundFillColour) # $t8, 0x800e /* 0789A0 80077DA0 10400006 */ beqz $v0, .L80077DBC /* 0789A4 80077DA4 2599FFFF */ addiu $t9, $t4, -1 /* 0789A8 80077DA8 8FA500A4 */ lw $a1, 0xa4($sp) @@ -143,7 +143,7 @@ glabel render_background /* 0789C4 80077DC4 246F0008 */ addiu $t7, $v1, 8 /* 0789C8 80077DC8 AE0F0000 */ sw $t7, ($s0) /* 0789CC 80077DCC AC670000 */ sw $a3, ($v1) -/* 0789D0 80077DD0 8F18E4BC */ lw $t8, %lo(D_800DE4BC)($t8) +/* 0789D0 80077DD0 8F18E4BC */ lw $t8, %lo(sBackgroundFillColour)($t8) /* 0789D4 80077DD4 332F03FF */ andi $t7, $t9, 0x3ff /* 0789D8 80077DD8 AC780004 */ sw $t8, 4($v1) /* 0789DC 80077DDC 8E030000 */ lw $v1, ($s0) @@ -163,7 +163,7 @@ glabel render_background /* 078A10 80077E10 00002025 */ move $a0, $zero /* 078A14 80077E14 27A50090 */ addiu $a1, $sp, 0x90 /* 078A18 80077E18 27A6008C */ addiu $a2, $sp, 0x8c -/* 078A1C 80077E1C 0C019AEA */ jal func_80066BA8 +/* 078A1C 80077E1C 0C019AEA */ jal copy_viewport_background_size_to_coords /* 078A20 80077E20 27A70088 */ addiu $a3, $sp, 0x88 /* 078A24 80077E24 1040007F */ beqz $v0, .L80078024 /* 078A28 80077E28 3C18BA00 */ lui $t8, (0xBA001402 >> 16) # lui $t8, 0xba00 @@ -177,16 +177,16 @@ glabel render_background /* 078A48 80077E48 3C0FFA00 */ lui $t7, 0xfa00 /* 078A4C 80077E4C 24790008 */ addiu $t9, $v1, 8 /* 078A50 80077E50 AE190000 */ sw $t9, ($s0) -/* 078A54 80077E54 3C0E800E */ lui $t6, %hi(D_800DE4B0) # $t6, 0x800e +/* 078A54 80077E54 3C0E800E */ lui $t6, %hi(sBackgroundPrimColourR) # $t6, 0x800e /* 078A58 80077E58 AC6F0000 */ sw $t7, ($v1) -/* 078A5C 80077E5C 91D8E4B0 */ lbu $t8, %lo(D_800DE4B0)($t6) -/* 078A60 80077E60 3C0F800E */ lui $t7, %hi(D_800DE4B4) # $t7, 0x800e -/* 078A64 80077E64 91EEE4B4 */ lbu $t6, %lo(D_800DE4B4)($t7) +/* 078A5C 80077E5C 91D8E4B0 */ lbu $t8, %lo(sBackgroundPrimColourR)($t6) +/* 078A60 80077E60 3C0F800E */ lui $t7, %hi(sBackgroundPrimColourG) # $t7, 0x800e +/* 078A64 80077E64 91EEE4B4 */ lbu $t6, %lo(sBackgroundPrimColourG)($t7) /* 078A68 80077E68 0018CE00 */ sll $t9, $t8, 0x18 /* 078A6C 80077E6C 000EC400 */ sll $t8, $t6, 0x10 /* 078A70 80077E70 03387825 */ or $t7, $t9, $t8 -/* 078A74 80077E74 3C0E800E */ lui $t6, %hi(D_800DE4B8) # $t6, 0x800e -/* 078A78 80077E78 91D9E4B8 */ lbu $t9, %lo(D_800DE4B8)($t6) +/* 078A74 80077E74 3C0E800E */ lui $t6, %hi(sBackgroundPrimColourB) # $t6, 0x800e +/* 078A78 80077E78 91D9E4B8 */ lbu $t9, %lo(sBackgroundPrimColourB)($t6) /* 078A7C 80077E7C 3C01F600 */ lui $at, 0xf600 /* 078A80 80077E80 0019C200 */ sll $t8, $t9, 8 /* 078A84 80077E84 01F87025 */ or $t6, $t7, $t8 @@ -256,7 +256,7 @@ glabel render_background /* 078B78 80077F78 8C42E4D0 */ lw $v0, %lo(D_800DE4D0)($v0) /* 078B7C 80077F7C 8FA500A4 */ lw $a1, 0xa4($sp) /* 078B80 80077F80 10400005 */ beqz $v0, .L80077F98 -/* 078B84 80077F84 3C19800E */ lui $t9, %hi(D_800DE4B0) # $t9, 0x800e +/* 078B84 80077F84 3C19800E */ lui $t9, %hi(sBackgroundPrimColourR) # $t9, 0x800e /* 078B88 80077F88 0040F809 */ jalr $v0 /* 078B8C 80077F8C 02002025 */ move $a0, $s0 /* 078B90 80077F90 10000025 */ b .L80078028 @@ -267,15 +267,15 @@ glabel render_background /* 078BA0 80077FA0 246E0008 */ addiu $t6, $v1, 8 /* 078BA4 80077FA4 AE0E0000 */ sw $t6, ($s0) /* 078BA8 80077FA8 AC670000 */ sw $a3, ($v1) -/* 078BAC 80077FAC 9339E4B0 */ lbu $t9, %lo(D_800DE4B0)($t9) -/* 078BB0 80077FB0 3C0E800E */ lui $t6, %hi(D_800DE4B4) # $t6, 0x800e -/* 078BB4 80077FB4 91CEE4B4 */ lbu $t6, %lo(D_800DE4B4)($t6) +/* 078BAC 80077FAC 9339E4B0 */ lbu $t9, %lo(sBackgroundPrimColourR)($t9) +/* 078BB0 80077FB0 3C0E800E */ lui $t6, %hi(sBackgroundPrimColourG) # $t6, 0x800e +/* 078BB4 80077FB4 91CEE4B4 */ lbu $t6, %lo(sBackgroundPrimColourG)($t6) /* 078BB8 80077FB8 00197A00 */ sll $t7, $t9, 8 /* 078BBC 80077FBC 31F8F800 */ andi $t8, $t7, 0xf800 /* 078BC0 80077FC0 000EC8C0 */ sll $t9, $t6, 3 /* 078BC4 80077FC4 332F07C0 */ andi $t7, $t9, 0x7c0 -/* 078BC8 80077FC8 3C19800E */ lui $t9, %hi(D_800DE4B8) # $t9, 0x800e -/* 078BCC 80077FCC 9339E4B8 */ lbu $t9, %lo(D_800DE4B8)($t9) +/* 078BC8 80077FC8 3C19800E */ lui $t9, %hi(sBackgroundPrimColourB) # $t9, 0x800e +/* 078BCC 80077FCC 9339E4B8 */ lbu $t9, %lo(sBackgroundPrimColourB)($t9) /* 078BD0 80077FD0 030F7025 */ or $t6, $t8, $t7 /* 078BD4 80077FD4 0019C083 */ sra $t8, $t9, 2 /* 078BD8 80077FD8 330F003E */ andi $t7, $t8, 0x3e diff --git a/src/camera.c b/src/camera.c index 1b749f97..ce8f89bd 100644 --- a/src/camera.c +++ b/src/camera.c @@ -120,7 +120,7 @@ u16 perspNorm[12]; Mtx *D_80120D70[6]; s32 D_80120D88[6]; Mtx D_80120DA0[5]; -Matrix D_80120EE0; +Matrix D_80120EE0; // Perspective matrix? Matrix D_80120F20; Matrix D_80120F60; Matrix D_80120FA0; @@ -193,11 +193,17 @@ void func_800660C0(void) { void func_800660D0(void) { D_80120D18 = 0; } -/* Unused? */ -f32 get_current_camera_fov(void) { + +/** + * Unused function that will return the current camera's FoV. + */ +UNUSED f32 get_current_camera_fov(void) { return gCurCamFOV; } +/** + * Set the FoV of the viewspace, then recalculate the perspective matrix. + */ void update_camera_fov(f32 camFieldOfView) { if (CAMERA_MIN_FOV < camFieldOfView && camFieldOfView < CAMERA_MAX_FOV && camFieldOfView != gCurCamFOV) { gCurCamFOV = camFieldOfView; @@ -206,7 +212,10 @@ void update_camera_fov(f32 camFieldOfView) { } } -void func_80066194(void) { +/** + * Unused function that recalculates the perspective matrix. + */ +UNUSED void calculate_camera_perspective(void) { guPerspectiveF(D_80120EE0, &perspNorm[10], CAMERA_DEFAULT_FOV, CAMERA_ASPECT, CAMERA_NEAR, CAMERA_FAR, CAMERA_SCALE); func_8006F870(D_80120EE0, D_80120FE0); } @@ -352,62 +361,63 @@ void func_800665E8(s32 arg0) { #ifdef NON_MATCHING // Has regalloc/stack issues +// Proposed name: init_viewports void func_80066610(void) { - s32 s1; - s32 s2; + s32 width; + s32 height; s32 s3; - s32 s4; - s32 s5; + s32 yPos; + s32 xPos; s32 i; D_800DD134 = 1 - D_800DD134; for (i = 0; i < 4; i++) { - if (gScreenViewports[i].flags & 4) { - gScreenViewports[i].flags &= ~1; - } else if (gScreenViewports[i].flags & 2) { - gScreenViewports[i].flags |= 1; + if (gScreenViewports[i].flags & VIEWPORT_UNK_04) { + gScreenViewports[i].flags &= ~VIEWPORT_UNK_01; + } else if (gScreenViewports[i].flags & VIEWPORT_UNK_02) { + gScreenViewports[i].flags |= VIEWPORT_UNK_01; } - gScreenViewports[i].flags &= ~6; + gScreenViewports[i].flags &= ~VIEWPORT_UNK_02 | VIEWPORT_UNK_04; if (gScreenViewports[i].flags & 1) { - if (!(gScreenViewports[i].flags & 8)) { + if (!(gScreenViewports[i].flags & VIEWPORT_X_CUSTOM)) { // Issue here - s5 = (gScreenViewports[i].unk0 * 4) + (((gScreenViewports[i].unk8 - gScreenViewports[i].unk0) + 1) * 2); + xPos = (gScreenViewports[i].x1 * 4) + (((gScreenViewports[i].x2 - gScreenViewports[i].x1) + 1) * 2); } else { - s5 = gScreenViewports[i].unk10; - s5 *= 4; + xPos = gScreenViewports[i].posX; + xPos *= 4; } - if (!(gScreenViewports[i].flags & 0x10)) { + if (!(gScreenViewports[i].flags & VIEWPORT_Y_CUSTOM)) { // Issue here - s4 = (gScreenViewports[i].unk4 * 4) + (((gScreenViewports[i].unkC - gScreenViewports[i].unk4) + 1) * 2); + yPos = (gScreenViewports[i].y1 * 4) + (((gScreenViewports[i].y2 - gScreenViewports[i].y1) + 1) * 2); } else { - s4 = gScreenViewports[i].unk14; - s4 *= 4; + yPos = gScreenViewports[i].posY; + yPos *= 4; } - if (!(gScreenViewports[i].flags & 0x20)) { - s1 = gScreenViewports[i].unk8 - gScreenViewports[i].unk0; - s1 += 1; - s1 *= 2; + if (!(gScreenViewports[i].flags & VIEWPORT_WIDTH_CUSTOM)) { + width = gScreenViewports[i].x2 - gScreenViewports[i].x1; + width += 1; + width *= 2; } else { - s1 = gScreenViewports[i].unk18; - s1 *= 2; + width = gScreenViewports[i].width; + width *= 2; } - if (!(gScreenViewports[i].flags & 0x40)) { - s2 = gScreenViewports[i].unkC - gScreenViewports[i].unk4; - s2 += 1; - s2 *= 2; + if (!(gScreenViewports[i].flags & VIEWPORT_HEIGHT_CUSTOM)) { + height = gScreenViewports[i].y2 - gScreenViewports[i].y1; + height += 1; + height *= 2; } else { - s2 = gScreenViewports[i].unk1C; - s2 *= 2; + height = gScreenViewports[i].height; + height *= 2; } s3 = i + (D_800DD134 * 5); s3 += 10; if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) { - s2 = -s2; + height = -height; } - D_800DD148[s3].vp.vtrans[0] = s5; - D_800DD148[s3].vp.vtrans[1] = s4; - D_800DD148[s3].vp.vscale[0] = s1; - D_800DD148[s3].vp.vscale[1] = s2; + D_800DD148[s3].vp.vtrans[0] = xPos; + D_800DD148[s3].vp.vtrans[1] = yPos; + D_800DD148[s3].vp.vscale[0] = width; + D_800DD148[s3].vp.vscale[1] = height; } } } @@ -417,139 +427,155 @@ GLOBAL_ASM("asm/non_matchings/camera/func_80066610.s") void func_80066818(s32 viewPortIndex, s32 arg1) { if (arg1 != 0) { - gScreenViewports[viewPortIndex].flags |= 1; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_UNK_01; } else { - gScreenViewports[viewPortIndex].flags |= 2; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_UNK_02; } - gScreenViewports[viewPortIndex].flags &= ~4; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_UNK_04; } void func_80066894(s32 viewPortIndex, s32 arg1) { if (arg1 != 0) { - gScreenViewports[viewPortIndex].flags &= ~1; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_UNK_01; } else { - gScreenViewports[viewPortIndex].flags |= 4; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_UNK_04; } - gScreenViewports[viewPortIndex].flags &= ~2; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_UNK_02; } s32 func_80066910(s32 viewPortIndex) { - return gScreenViewports[viewPortIndex].flags & 0x1; + return gScreenViewports[viewPortIndex].flags & VIEWPORT_UNK_01; } #ifdef NON_MATCHING // Should be functionally equivalent. -void func_80066940(s32 viewPortIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +// proposed name: reesize_viewport +void func_80066940(s32 viewPortIndex, s32 x1, s32 x2, s32 y1, s32 y2) { s32 widthAndHeight, width, height; - s32 phi_a1; - s32 phi_a2; - s32 phi_a3; + s32 tempX1; + s32 tempY2; + s32 tempX2; widthAndHeight = get_video_width_and_height_as_s32(); width = widthAndHeight & 0xFFFF; // Placement issues with the height variable. height = (widthAndHeight >> 0x10) & 0xFFFF; - phi_a2 = arg4; - phi_a3 = arg3; - phi_a1 = arg1; - if (arg3 < arg1) { - phi_a1 = arg3; - phi_a3 = arg1; + tempY2 = y2; + tempX2 = x2; + tempX1 = x1; + if (x2 < x1) { + tempX1 = x2; + tempX2 = x1; } - if (arg4 < arg2) { - arg2 = arg4; - phi_a2 = arg2; + if (y2 < y1) { + y1 = y2; + tempY2 = y1; } - if ((phi_a1 >= width) || (phi_a3 < 0) || (arg2 >= height) || (phi_a2 < 0)) { - gScreenViewports[viewPortIndex].upperLeftX = 0; - gScreenViewports[viewPortIndex].upperLeftY = 0; - gScreenViewports[viewPortIndex].lowerRightX = 0; - gScreenViewports[viewPortIndex].lowerRightY = 0; + if ((tempX1 >= width) || (tempX2 < 0) || (y1 >= height) || (tempY2 < 0)) { + gScreenViewports[viewPortIndex].scissorX1 = 0; + gScreenViewports[viewPortIndex].scissorY1 = 0; + gScreenViewports[viewPortIndex].scissorX2 = 0; + gScreenViewports[viewPortIndex].scissorY2 = 0; } else { - if (phi_a1 < 0) { - gScreenViewports[viewPortIndex].upperLeftX = 0; + if (tempX1 < 0) { + gScreenViewports[viewPortIndex].scissorX1 = 0; } else { - gScreenViewports[viewPortIndex].upperLeftX = phi_a1; + gScreenViewports[viewPortIndex].scissorX1 = tempX1; } - if (arg2 < 0) { - gScreenViewports[viewPortIndex].upperLeftY = 0; + if (y1 < 0) { + gScreenViewports[viewPortIndex].scissorY1 = 0; } else { - gScreenViewports[viewPortIndex].upperLeftY = arg2; + gScreenViewports[viewPortIndex].scissorY1 = y1; } - if (phi_a3 >= width) { - gScreenViewports[viewPortIndex].lowerRightX = width - 1; + if (tempX2 >= width) { + gScreenViewports[viewPortIndex].scissorX2 = width - 1; } else { - gScreenViewports[viewPortIndex].lowerRightX = phi_a3; + gScreenViewports[viewPortIndex].scissorX2 = tempX2; } - if (phi_a2 >= height) { - gScreenViewports[viewPortIndex].lowerRightY = height - 1; + if (tempY2 >= height) { + gScreenViewports[viewPortIndex].scissorY2 = height - 1; } else { - gScreenViewports[viewPortIndex].lowerRightY = phi_a2; + gScreenViewports[viewPortIndex].scissorY2 = tempY2; } } - gScreenViewports[viewPortIndex].unk4 = arg2; - gScreenViewports[viewPortIndex].unk0 = phi_a1; - gScreenViewports[viewPortIndex].unk8 = phi_a3; - gScreenViewports[viewPortIndex].unkC = phi_a2; + gScreenViewports[viewPortIndex].y1 = y1; + gScreenViewports[viewPortIndex].x1 = tempX1; + gScreenViewports[viewPortIndex].x2 = tempX2; + gScreenViewports[viewPortIndex].y2 = tempY2; } #else GLOBAL_ASM("asm/non_matchings/camera/func_80066940.s") #endif -void func_80066AA8(s32 viewPortIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - if (arg1 != 0x8000) { - gScreenViewports[viewPortIndex].unk10 = arg1; - gScreenViewports[viewPortIndex].flags |= 8; +/** + * Set the selected viewport's coordinate offsets and view size. + * If you pass VIEWPORT_AUTO through, then the property will be automatically set when the game creates the viewports. + */ +void set_viewport_properties(s32 viewPortIndex, s32 posX, s32 posY, s32 width, s32 height) { + if (posX != VIEWPORT_AUTO) { + gScreenViewports[viewPortIndex].posX = posX; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_X_CUSTOM; } else { - gScreenViewports[viewPortIndex].flags &= ~8; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_X_CUSTOM; } - if (arg2 != 0x8000) { - gScreenViewports[viewPortIndex].unk10 = arg2; - gScreenViewports[viewPortIndex].flags |= 0x10; + if (posY != VIEWPORT_AUTO) { +// !@bug Viewport Y writes to the X value. Luckily, all cases this function is called use VIEWPORT_AUTO, +// so this bug doesn't happen in practice. + gScreenViewports[viewPortIndex].posX = posY; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_Y_CUSTOM; } else { - gScreenViewports[viewPortIndex].flags &= ~0x10; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_Y_CUSTOM; } - if (arg3 != 0x8000) { - gScreenViewports[viewPortIndex].unk18 = arg3; - gScreenViewports[viewPortIndex].flags |= 0x20; + if (width != VIEWPORT_AUTO) { + gScreenViewports[viewPortIndex].width = width; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_WIDTH_CUSTOM; } else { - gScreenViewports[viewPortIndex].flags &= ~0x20; + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_WIDTH_CUSTOM; } - if (arg4 != 0x8000) { - gScreenViewports[viewPortIndex].unk1C = arg4; - gScreenViewports[viewPortIndex].flags |= 0x40; - return; + if (height != VIEWPORT_AUTO) { + gScreenViewports[viewPortIndex].height = height; + gScreenViewports[viewPortIndex].flags |= VIEWPORT_HEIGHT_CUSTOM; + } else { + gScreenViewports[viewPortIndex].flags &= ~VIEWPORT_HEIGHT_CUSTOM; } - gScreenViewports[viewPortIndex].flags &= ~0x40; } -s32 func_80066BA8(s32 viewPortIndex, s32 *upperLeftX, s32 *upperLeftY, s32 *lowerRightX, s32 *lowerRightY) { +/** + * Sets the passed values to be equal to the selected viewports scissor size, before drawing the background elements. + * Usually, this is the same size as the viewport's size. + */ +s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2) { //gDPFillRectangle values - *upperLeftX = gScreenViewports[viewPortIndex].upperLeftX; - *lowerRightX = gScreenViewports[viewPortIndex].lowerRightX; - *upperLeftY = gScreenViewports[viewPortIndex].upperLeftY; - *lowerRightY = gScreenViewports[viewPortIndex].lowerRightY; - if ((*upperLeftX | *lowerRightX | *upperLeftY | *lowerRightY) == 0) { + *x1 = gScreenViewports[viewPortIndex].scissorX1; + *x2 = gScreenViewports[viewPortIndex].scissorX2; + *y1 = gScreenViewports[viewPortIndex].scissorY1; + *y2 = gScreenViewports[viewPortIndex].scissorY2; + if ((*x1 | *x2 | *y1 | *y2) == 0) { return 0; } return 1; } -void func_80066C2C(s32 viewPortIndex, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4) { - *arg1 = gScreenViewports[viewPortIndex].unk0; - *arg2 = gScreenViewports[viewPortIndex].unk4; - *arg3 = gScreenViewports[viewPortIndex].unk8; - *arg4 = gScreenViewports[viewPortIndex].unkC; +/** + * Sets the passed values to the coordinate size of the passed viewport. + */ +void copy_viewport_frame_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2) { + *x1 = gScreenViewports[viewPortIndex].x1; + *y1 = gScreenViewports[viewPortIndex].x2; + *x2 = gScreenViewports[viewPortIndex].y1; + *y2 = gScreenViewports[viewPortIndex].y2; } -// Unused? -void func_80066C80(s32 *arg0, s32 *arg1, s32 *arg2, s32 *arg3) { - u32 temp_v0 = get_video_width_and_height_as_s32(); - *arg0 = 0; - *arg1 = 0; - *arg2 = temp_v0 & 0xFFFF; - *arg3 = temp_v0 >> 0x10; +/** + * Unused function that sets the passed values to the framebuffer's size in coordinates. + */ +UNUSED void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2) { + u32 width = get_video_width_and_height_as_s32(); + *x1 = 0; + *y1 = 0; + *x2 = width & 0xFFFF; + *y2 = width >> 16; } #ifdef NON_MATCHING @@ -580,12 +606,12 @@ void func_80066CDC(Gfx **dlist, s32 arg1) { widthAndHeight = get_video_width_and_height_as_s32(); temp_t0 = widthAndHeight >> 16; temp_a3 = temp_t0 >> 1; - if (gScreenViewports[D_80120CE4].flags & 1) { + if (gScreenViewports[D_80120CE4].flags & VIEWPORT_UNK_01) { gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, - gScreenViewports[D_80120CE4].upperLeftX, - gScreenViewports[D_80120CE4].upperLeftY, - gScreenViewports[D_80120CE4].lowerRightX, - gScreenViewports[D_80120CE4].lowerRightY + gScreenViewports[D_80120CE4].scissorX1, + gScreenViewports[D_80120CE4].scissorY1, + gScreenViewports[D_80120CE4].scissorX2, + gScreenViewports[D_80120CE4].scissorY2 ); func_80068158(dlist, 0, 0, 0, 0); if (arg1 != 0) { @@ -749,17 +775,17 @@ void func_8006807C(Gfx **dlist, s32 *arg1) { D_80120D08 = 0; } -void func_80068158(Gfx **dlist, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - s32 tempArg1 = (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) ? -arg1 : arg1; +void func_80068158(Gfx **dlist, s32 width, s32 height, s32 posX, s32 posY) { + s32 tempWidth = (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) ? -width : width; if (D_800DD060 != 0) { - arg2 = -arg2; - tempArg1 = -arg1; + height = -height; + tempWidth = -width; } - if (!(gScreenViewports[D_80120CE4].flags & 1)) { - D_800DD148[D_80120CE4].vp.vtrans[0] = arg3 * 4; - D_800DD148[D_80120CE4].vp.vtrans[1] = arg4 * 4; - D_800DD148[D_80120CE4].vp.vscale[0] = tempArg1 * 4; - D_800DD148[D_80120CE4].vp.vscale[1] = arg2 * 4; + if (!(gScreenViewports[D_80120CE4].flags & VIEWPORT_UNK_01)) { + D_800DD148[D_80120CE4].vp.vtrans[0] = posX * 4; + D_800DD148[D_80120CE4].vp.vtrans[1] = posY * 4; + D_800DD148[D_80120CE4].vp.vscale[0] = tempWidth * 4; + D_800DD148[D_80120CE4].vp.vscale[1] = height * 4; gSPViewport((*dlist)++, (u8 *)&D_800DD148[D_80120CE4] + 0x80000000); } else { gSPViewport((*dlist)++, (u8 *)&D_800DD148[D_80120CE4 + 10 + (D_800DD134 * 5)] + 0x80000000); @@ -772,7 +798,7 @@ void func_800682AC(Gfx **dlist) { widthAndHeight = get_video_width_and_height_as_s32(); height = widthAndHeight >> 0x10; width = widthAndHeight & 0xFFFF; - if (!(gScreenViewports[D_80120CE4].flags & 1)) { + if (!(gScreenViewports[D_80120CE4].flags & VIEWPORT_UNK_01)) { gDPSetScissor((*dlist)++, G_SC_NON_INTERLACE, 0, 0, width - 1, height - 1); func_80068158(dlist, width >> 1, height >> 1, width >> 1, height >> 1); } else { diff --git a/src/camera.h b/src/camera.h index 9086ca11..b8955939 100644 --- a/src/camera.h +++ b/src/camera.h @@ -30,6 +30,8 @@ #define JOYSTICK_DEADZONE 8 #define JOYSTICK_MAX_RANGE 70 +#define VIEWPORT_AUTO 0x8000 + enum ViewportCount { VIEWPORTS_COUNT_1_PLAYER, VIEWPORTS_COUNT_2_PLAYERS, @@ -37,22 +39,32 @@ enum ViewportCount { VIEWPORTS_COUNT_4_PLAYERS }; +enum ViewPortFlags { + VIEWPORT_UNK_01 = 0x0001, + VIEWPORT_UNK_02 = 0x0002, + VIEWPORT_UNK_04 = 0x0004, + VIEWPORT_X_CUSTOM = 0x0008, + VIEWPORT_Y_CUSTOM = 0x0010, + VIEWPORT_WIDTH_CUSTOM = 0x0020, + VIEWPORT_HEIGHT_CUSTOM = 0x0040, +}; + extern s8 D_800DD060; /* Size: 0x34 bytes. */ typedef struct ScreenViewport { - /* 0x00 */ s32 unk0; - /* 0x04 */ s32 unk4; - /* 0x08 */ s32 unk8; - /* 0x0C */ s32 unkC; - /* 0x10 */ s32 unk10; - /* 0x14 */ s32 unk14; - /* 0x18 */ s32 unk18; - /* 0x1C */ s32 unk1C; - /* 0x20 */ s32 upperLeftX; //gDPFillRectangle values - /* 0x24 */ s32 upperLeftY; - /* 0x28 */ s32 lowerRightX; - /* 0x2C */ s32 lowerRightY; + /* 0x00 */ s32 x1; + /* 0x04 */ s32 x2; + /* 0x08 */ s32 y1; + /* 0x0C */ s32 y2; + /* 0x10 */ s32 posX; + /* 0x14 */ s32 posY; + /* 0x18 */ s32 width; + /* 0x1C */ s32 height; + /* 0x20 */ s32 scissorX1; + /* 0x24 */ s32 scissorY1; + /* 0x28 */ s32 scissorX2; + /* 0x2C */ s32 scissorY2; /* 0x30 */ s32 flags; } ScreenViewport; @@ -97,9 +109,9 @@ void func_80066060(s32 arg0, s32 arg1); void func_80066098(s8 arg0); void func_800660C0(void); void func_800660D0(void); -f32 get_current_camera_fov(void); +UNUSED f32 get_current_camera_fov(void); void update_camera_fov(f32 camFieldOfView); -void func_80066194(void); +UNUSED void calculate_camera_perspective(void); Matrix *func_80066204(void); s32 get_viewport_count(void); s32 func_80066220(void); @@ -115,11 +127,11 @@ void func_800665E8(s32 arg0); void func_80066818(s32 viewPortIndex, s32 arg1); void func_80066894(s32 viewPortIndex, s32 arg1); s32 func_80066910(s32 viewPortIndex); -void func_80066940(s32 viewPortIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -void func_80066AA8(s32 viewPortIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -s32 func_80066BA8(s32 viewPortIndex, s32 *upperLeftX, s32 *upperLeftY, s32 *lowerRightX, s32 *lowerRightY); -void func_80066C2C(s32 viewPortIndex, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4); -void func_80066C80(s32 *arg0, s32 *arg1, s32 *arg2, s32 *arg3); +void func_80066940(s32 viewPortIndex, s32 posX, s32 posY, s32 width, s32 height); +void set_viewport_properties(s32 viewPortIndex, s32 x1, s32 x2, s32 y1, s32 y2); +s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2); +void copy_viewport_frame_size_to_coords(s32 viewPortIndex, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4); +void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2); void func_80066CDC(Gfx **dlist, s32 arg1); void set_ortho_matrix_height(f32 value); void func_80067F2C(Gfx **dlist, s32 *arg1); diff --git a/src/font.c b/src/font.c index f39915f3..f8c34f4d 100644 --- a/src/font.c +++ b/src/font.c @@ -180,9 +180,9 @@ GLOBAL_ASM("asm/non_matchings/font/func_800C4170.s") #ifdef NON_MATCHING // Mostly has regalloc issues. -void func_800C422C(s32 arg0) { - if (arg0 < gNumberOfFonts) { - FontData *fontData = &gFonts[arg0]; +void func_800C422C(s32 fontID) { + if (fontID < gNumberOfFonts) { + FontData *fontData = &gFonts[fontID]; if (fontData->unk28[0] > 0) { fontData->unk28[0]--; if ((fontData->unk28[0] & 0xFF) == 0) { diff --git a/src/font.h b/src/font.h index 3b842021..b81f8baf 100644 --- a/src/font.h +++ b/src/font.h @@ -21,6 +21,7 @@ enum TextFonts { FONT_COLOURFUL, FONT_SMALL, + FONT_LARGE, FONT_UNK_FF = 255, }; diff --git a/src/menu.c b/src/menu.c index f7dcdc71..a378ea78 100644 --- a/src/menu.c +++ b/src/menu.c @@ -48,7 +48,7 @@ s32 D_801263BC; unk801263C0 D_801263C0; s32 gIgnorePlayerInput; -s32 D_801263C8; +UNUSED s32 sUnused_801263C8; // Set to 0 in menu_init, and never again. unk801263CC (*D_801263CC)[8]; s32 D_801263D0; @@ -68,7 +68,7 @@ s8 D_80126431; s32 D_80126434; s32 D_80126438[4]; s64 D_80126448; -f32 D_80126450; +f32 sBootScreenTimer; s8 gControllersXAxisDelay[4]; s8 gControllersYAxisDelay[4]; s8 gControllersXAxisDirection[4]; // X axis (-1 = left, 1 = right) for controller @@ -76,7 +76,7 @@ MenuElement **D_80126460; s8 gControllersYAxisDirection[4]; // Y axis (-1 = down, 1 = up) for controller s8 gControllersXAxis[4]; s8 gControllersYAxis[4]; -s32 D_80126470; +s32 sUnused_80126470; // Set to 0 in the magic codes menu and 0xD000 elsewhere, otherwise unused. s32 D_80126474; s32 D_80126478; s32 D_8012647C; @@ -144,7 +144,7 @@ s32 D_80126818; s32 D_8012681C; s32 D_80126820; s32 D_80126824; -s8 D_80126828; +UNUSED s8 sUnused_80126828; // Set to 0 in menu_init, and never used again. s32 D_8012682C; s16 D_80126830; s32 D_80126834; @@ -298,9 +298,9 @@ s32 *gMenuTextLangTable = NULL; char **gMenuText = NULL; -u8 D_800DF4A4 = 0xFF; -u8 D_800DF4A8 = 0xFF; -u8 D_800DF4AC = 0xFF; +u8 sMenuGuiColourR = 0xFF; +u8 sMenuGuiColourG = 0xFF; +u8 sMenuGuiColourB = 0xFF; u8 D_800DF4B0 = 0; s32 D_800DF4B4 = 0; @@ -328,7 +328,7 @@ s32 D_800DF4F0[] = { 0x4000, 0x8000, 0x1000, 0x2000, 0x8000, 0x10, 0x400, 0x00 }; -unk800DF510 D_800DF510[18] = { +unk800DF510 sMenuImageProperties[18] = { { 0, 0, 0, 0x00, 1.0f, 0.0f, 0.0f, -32.0f, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0x01, 1.0f, 0.0f, 0.0f, -32.0f, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0x02, 1.0f, 0.0f, 0.0f, -32.0f, 0, 0, 0, 0, 0 }, @@ -352,19 +352,17 @@ unk800DF510 D_800DF510[18] = { s16 *D_800DF750[1] = { NULL }; // This is probably not correct. s16 D_800DF754 = 0; s16 D_800DF758 = 0; -unk800DF510 *D_800DF75C = NULL; +unk800DF510 *gMenuImageStack = NULL; -s32 D_800DF760 = 0x7F; -s32 D_800DF764 = 0xFF; +s32 sMenuMusicVolume = 0x7F; +s32 sMenuGuiOpacity = 0xFF; s32 D_800DF768 = 1; -FadeTransition D_800DF76C = FADE_TRANSITION(0, FADE_COLOR_BLACK, 10, -1); -FadeTransition D_800DF774 = FADE_TRANSITION(0, FADE_COLOR_BLACK, 18, -1); -FadeTransition D_800DF77C = FADE_TRANSITION(0x80, FADE_COLOR_BLACK, 18, 0); - -// These two are unused? -FadeTransition D_800DF784 = FADE_TRANSITION(0, FADE_COLOR_WHITE, 18, -1); -FadeTransition D_800DF78C = FADE_TRANSITION(0x80, FADE_COLOR_WHITE, 18, 0); +FadeTransition sMenuTransitionFadeInFast = FADE_TRANSITION(0, FADE_COLOR_BLACK, 10, -1); +FadeTransition sMenuTransitionFadeIn = FADE_TRANSITION(0, FADE_COLOR_BLACK, 18, -1); +FadeTransition sMenuTransitionFadeOut = FADE_TRANSITION(0x80, FADE_COLOR_BLACK, 18, 0); +UNUSED FadeTransition sMenuTransitionFadeInWhite = FADE_TRANSITION(0, FADE_COLOR_WHITE, 18, -1); +UNUSED FadeTransition sMenuTransitionFadeOutWhite = FADE_TRANSITION(0x80, FADE_COLOR_WHITE, 18, 0); s32 D_800DF794 = 4; s32 D_800DF798 = 0; @@ -377,11 +375,11 @@ char *gTitleMenuStrings[3] = { 0, 0, 0 }; char gVersionDisplayText[20] = "VERSION XXXXXXXX"; // "Diddy Kong Racing" logo texture indices? -s16 D_800DF7C4[12] = { +s16 sGameTitleTileTextures[12] = { 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, -1 }; -DrawTexture D_800DF7DC[12] = { +DrawTexture sGameTitleTileOffsets[12] = { { NULL, -75, -32 }, { NULL, -60, -32 }, { NULL, -45, -32 }, @@ -420,7 +418,7 @@ char *gOptionMenuStrings[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -s16 D_800DFA2C[8] = { +s16 gOptionMenuTextures[8] = { 0x3D, 0x3C, 0x3F, 0x3E, 0x44, -1, -1, 0 }; @@ -1351,7 +1349,7 @@ MenuElement D_800E1B50[9] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0 }, }; -Gfx D_800E1C70[] = { +Gfx dMenuHudSettings[] = { gsDPPipeSync(), gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureLUT(G_TT_NONE), @@ -1360,8 +1358,7 @@ Gfx D_800E1C70[] = { gsSPEndDisplayList(), }; -// Unused? -Gfx D_800E1CA0[][2] = { +UNUSED Gfx dMenuHudDrawModes[][2] = { { gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2), @@ -1451,10 +1448,12 @@ s8 D_800E1E20[8] = { s8 D_800E1E28 = 0; +// TT Game Status textures, think these are potentially multi-part images. s16 D_800E1E2C[10] = { 0x4C, 0x4D, 0x4E, 0x4F, 0x5B, 0x5C, 0x00, 0x42, -1, 0 }; +// TT game status textures. And these maybe just standalone ones. s16 D_800E1E40[10] = { 0x0D, 0x0E, 0x0F, 0x10, 0x08, 0x09, 0x00, 0x0A, -1, 0 }; @@ -1702,6 +1701,10 @@ void func_800813C0(void) { D_800DF458 = 1; } +/** + * Core function for initialising all menu elements. + * Gets the current menu ID, then runs the init function of the respective menu element. + */ void menu_init(u32 menuId) { s32 i; @@ -1709,8 +1712,8 @@ void menu_init(u32 menuId) { reset_controller_sticks(); gIgnorePlayerInput = 1; D_801263BC = 0; - D_801263C8 = 0; - D_80126828 = 0; + sUnused_801263C8 = 0; + sUnused_80126828 = 0; // Does not match with a for loop i = 0; @@ -1781,7 +1784,7 @@ void menu_init(u32 menuId) { menu_caution_init(); break; } - D_80126470 = 0xD000; + sUnused_80126470 = 0xD000; } /** @@ -1874,12 +1877,12 @@ void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 a s32 sp44; s32 sp40; - D_800DF4A4 = arg3; - D_800DF4A8 = arg4; - D_800DF4AC = arg5; + sMenuGuiColourR = arg3; + sMenuGuiColourG = arg4; + sMenuGuiColourB = arg5; if (arg6 == 0) { - D_800DF75C[0].unk10 = arg2; - D_800DF75C[1].unk10 = arg2 - 2; + gMenuImageStack[0].unk10 = arg2; + gMenuImageStack[1].unk10 = arg2 - 2; phi_s3 = 0; phi_s5 = 1; arg1 -= 0x27; @@ -1887,8 +1890,8 @@ void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 a sp44 = 0xB; sp40 = 0xA; } else { - D_800DF75C[2].unk10 = arg2; - D_800DF75C[3].unk10 = arg2 - 1; + gMenuImageStack[2].unk10 = arg2; + gMenuImageStack[3].unk10 = arg2 - 1; phi_s3 = 2; phi_s5 = 3; arg1 -= 0x1C; @@ -1899,40 +1902,40 @@ void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 a func_80059790(arg0, &sp5C, &sp58, &sp54); func_80068508(1); func_8007BF1C(0); - D_800DF75C[phi_s3].unk18 = sp5C / 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp5C / 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); arg1 += phi_s6; - D_800DF75C[phi_s3].unk18 = sp5C % 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp5C % 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); arg1 += sp44; - D_800DF75C[phi_s5].unkC = arg1; + gMenuImageStack[phi_s5].unkC = arg1; func_8009CA60(phi_s5); arg1 += sp40; - D_800DF75C[phi_s3].unk18 = sp58 / 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp58 / 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); arg1 += phi_s6; - D_800DF75C[phi_s3].unk18 = sp58 % 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp58 % 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); arg1 += sp44; - D_800DF75C[phi_s5].unkC = arg1; + gMenuImageStack[phi_s5].unkC = arg1; func_8009CA60(phi_s5); arg1 += sp40; - D_800DF75C[phi_s3].unk18 = sp54 / 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp54 / 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); arg1 += phi_s6; - D_800DF75C[phi_s3].unk18 = sp54 % 10; - D_800DF75C[phi_s3].unkC = arg1; + gMenuImageStack[phi_s3].unk18 = sp54 % 10; + gMenuImageStack[phi_s3].unkC = arg1; func_8009CA60(phi_s3); func_80068508(0); func_8007BF1C(1); - D_800DF4A4 = (u8)0xFF; - D_800DF4A8 = (u8)0xFF; - D_800DF4AC = (u8)0xFF; + sMenuGuiColourR = (u8)0xFF; + sMenuGuiColourG = (u8)0xFF; + sMenuGuiColourB = (u8)0xFF; } GLOBAL_ASM("asm/non_matchings/menu/func_80081C04.s") @@ -1995,7 +1998,7 @@ void draw_menu_elements(s32 arg0, MenuElement *elem, f32 arg2) { s5 = FALSE; func_8007B3D0(&D_801263A0); } - D_800DF764 = elem->opacity; + sMenuGuiOpacity = elem->opacity; func_80081800( *elem->unk14_a.numberU16, xPos - 0xA0, @@ -2052,18 +2055,18 @@ void draw_menu_elements(s32 arg0, MenuElement *elem, f32 arg2) { } func_80068508(1); func_8007BF1C(0); - D_800DF75C[elem->unk14_a.value].unkC = xPos - 0xA0; - D_800DF75C[elem->unk14_a.value].unk10 = (-yPos - D_800DF7A0) + 0x78; - D_800DF75C[elem->unk14_a.value].unk18 = elem->textFont; - D_800DF75C[elem->unk14_a.value].unk4 = elem->backgroundRed; - D_800DF75C[elem->unk14_a.value].unk2 = elem->backgroundGreen; - D_800DF75C[elem->unk14_a.value].unk0 = elem->backgroundBlue; - D_800DF75C[elem->unk14_a.value].unk8 = elem->backgroundAlpha / 256.0f; - D_800DF4A4 = elem->filterRed; - D_800DF4A8 = elem->filterGreen; - D_800DF4AC = elem->filterBlue; + gMenuImageStack[elem->unk14_a.value].unkC = xPos - 0xA0; + gMenuImageStack[elem->unk14_a.value].unk10 = (-yPos - D_800DF7A0) + 0x78; + gMenuImageStack[elem->unk14_a.value].unk18 = elem->textFont; + gMenuImageStack[elem->unk14_a.value].unk4 = elem->backgroundRed; + gMenuImageStack[elem->unk14_a.value].unk2 = elem->backgroundGreen; + gMenuImageStack[elem->unk14_a.value].unk0 = elem->backgroundBlue; + gMenuImageStack[elem->unk14_a.value].unk8 = elem->backgroundAlpha / 256.0f; + sMenuGuiColourR = elem->filterRed; + sMenuGuiColourG = elem->filterGreen; + sMenuGuiColourB = elem->filterBlue; D_800DF4B0 = elem->filterAlpha; - D_800DF764 = elem->opacity; + sMenuGuiOpacity = elem->opacity; func_8009CA60(elem->unk14_a.value); func_80068508(0); func_8007BF1C(1); @@ -2101,11 +2104,11 @@ void draw_menu_elements(s32 arg0, MenuElement *elem, f32 arg2) { if (s5) { func_8007B3D0(&D_801263A0); } - D_800DF4A4 = 0xFF; - D_800DF4A8 = 0xFF; - D_800DF4AC = 0xFF; + sMenuGuiColourR = 0xFF; + sMenuGuiColourG = 0xFF; + sMenuGuiColourB = 0xFF; D_800DF4B0 = 0; - D_800DF764 = 0xFF; + sMenuGuiOpacity = 0xFF; } } #else @@ -2147,7 +2150,7 @@ void print_missing_controller_text(Gfx *dl, s32 updateRate) { if (D_800DF46C & 0x10) { load_menu_text(get_language()); - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_color(255, 255, 255, 0, 0xFF); set_text_background_color(0, 0, 0, 0); posY = 208; @@ -2158,79 +2161,90 @@ void print_missing_controller_text(Gfx *dl, s32 updateRate) { } } +/** + * Initialises the viewport and background settings for the screen with the rotating N64 and Rareware Logo. + * It then sets a 16 second timer that will count down. + */ void menu_logos_screen_init(void) { gMenuDelay = 0; - D_80126450 = 16.0f; // 16 seconds - func_80077B5C(0, 0, 0); + sBootScreenTimer = 16.0f; + set_background_fill_colour(0, 0, 0); if (osTvType == TV_TYPE_PAL) { - func_80066940(0, 0, 0x26, 0x140, 0xE0); - func_80066AA8(0, 0x8000, 0x8000, 0x140, 0x11C); + func_80066940(0, 0, 38, SCREEN_WIDTH, 224); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, SCREEN_WIDTH, SCREEN_HEIGHT + 44); } else { - func_80066940(0, 0, 0x28, 0x140, 0xC4); - func_80066AA8(0, 0x8000, 0x8000, 0x140, 0xF0); + func_80066940(0, 0, 40, SCREEN_WIDTH, 196); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, SCREEN_WIDTH, SCREEN_HEIGHT); } func_80066610(); func_80066818(0, 1); } +/** + * Handler of everything that happens in the space of those 16 seconds. + */ s32 menu_logo_screen_loop(s32 updateRate) { - s32 phi_v0; // sp24? - s32 yOffset; // sp28 - s32 sp20; + s32 opacity; + s32 yOffset; + s32 yOffsetShadow; if (osTvType == TV_TYPE_PAL) { - yOffset = 0x1A; - if (D_80126450 < 2.6f && gMenuDelay == 0) { + yOffset = 26; + if (sBootScreenTimer < 2.6f && gMenuDelay == 0) { func_800C01D8(&D_800E1DE8); gMenuDelay = 1; } - D_80126450 -= updateRate / 50.0f; + sBootScreenTimer -= updateRate / 50.0f; } else { yOffset = 0; - if (D_80126450 < 2.17f && gMenuDelay == 0) { + if (sBootScreenTimer < 2.17f && gMenuDelay == 0) { func_800C01D8(&D_800E1DE8); gMenuDelay = 1; } - D_80126450 -= updateRate / 60.0f; + sBootScreenTimer -= updateRate / 60.0f; } - if (D_80126450 <= 0.0f) { + if (sBootScreenTimer <= 0.0f) { func_80066894(0, 0); - func_80066AA8(0, 0x8000, 0x8000, 0x8000, 0x8000); - func_80082FAC(); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO); + init_title_screen_variables(); menu_init(MENU_TITLE); } - if (8.5 > D_80126450) { // This is a little weird, but it matches. - set_text_font(1); +// This uses doubles instead of floats for precision in the counting. + if (sBootScreenTimer < 8.5) { + set_text_font(FONT_SMALL); set_text_background_color(0, 0, 0, 0); - if ((D_80126450 < 8.0) && (D_80126450 >= 7.5)) { - phi_v0 = (8.0 - D_80126450) * 510.0; + if ((sBootScreenTimer < 8.0) && (sBootScreenTimer >= 7.5)) { + opacity = (8.0 - sBootScreenTimer) * 510.0; } else { - if ((D_80126450 < 7.5) && (D_80126450 >= 7.0)) { - phi_v0 = (D_80126450 - 7.0) * 510.0; + if ((sBootScreenTimer < 7.5) && (sBootScreenTimer >= 7.0)) { + opacity = (sBootScreenTimer - 7.0) * 510.0; } else { - phi_v0 = 0; + opacity = 0; } } - if (phi_v0 != 0) { - set_text_color(0xFF, 0xFF, 0, 0xFF, phi_v0); - draw_text(&D_801263A0, 0x9F, yOffset + 0xD4, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, 0xA1, yOffset + 0xD4, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, POS_CENTRED, yOffset + 0xD3, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, POS_CENTRED, yOffset + 0xD5, gRareCopyrightString, 0xC); + if (opacity != 0) { + set_text_color(0xFF, 0xFF, 0, 0xFF, opacity); + draw_text(&D_801263A0, 159, yOffset + 212, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, 161, yOffset + 212, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_CENTRED, yOffset + 211, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_CENTRED, yOffset + 213, gRareCopyrightString, 0xC); } - sp20 = yOffset + 0xD4; - if (D_80126450 > 8.0) { - phi_v0 = (8.5 - D_80126450) * 510.0; + yOffsetShadow = yOffset + 212; + if (sBootScreenTimer > 8.0) { + opacity = (8.5 - sBootScreenTimer) * 510.0; } else { - phi_v0 = 0xFF; + opacity = 0xFF; } - set_text_color(0xFF, 0xFF, 0xFF, 0xFF, phi_v0); - draw_text(&D_801263A0, POS_CENTRED, sp20, gRareCopyrightString, 0xC); + set_text_color(0xFF, 0xFF, 0xFF, 0xFF, opacity); + draw_text(&D_801263A0, POS_CENTRED, yOffsetShadow, gRareCopyrightString, 0xC); } return 0; } -void func_80082FAC(void) { +/** + * Sets some things needed after the title screen from the save buffer. + */ +void init_title_screen_variables(void) { if (D_80126448 & 2) { set_magic_code_flags(2); } @@ -2264,8 +2278,8 @@ void menu_title_screen_init(void) { gNumberOfActivePlayers = 4; initialise_player_ids(); play_music(1); - D_800DF760 = musicGetRelativeVolume(); - if (D_800DF458 != 0) { + sMenuMusicVolume = musicGetRelativeVolume(); + if (D_800DF458) { D_8012686C = 0; D_800DF458 = 0; } else { @@ -2273,13 +2287,13 @@ void menu_title_screen_init(void) { } D_80126870 = 0; D_801263E0 = 0; - func_8009C674(D_800DF7C4); + func_8009C674(sGameTitleTileTextures); for (i = 0; i < 11; i++) { - D_800DF7DC[i].texture = D_80126550[D_800DF7C4[i]]; + sGameTitleTileOffsets[i].texture = D_80126550[sGameTitleTileTextures[i]]; } set_music_player_voice_limit(0x1B); func_800660C0(); - set_text_font(0); + set_text_font(FONT_COLOURFUL); func_800C4170(2); func_80000890(0); set_time_trial_enabled(FALSE); @@ -2304,7 +2318,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8008377C.s") GLOBAL_ASM("asm/non_matchings/menu/menu_title_screen_loop.s") void func_80084118(void) { - func_8009C4A8(D_800DF7C4); + func_8009C4A8(sGameTitleTileTextures); set_music_player_voice_limit(0x10); func_800660D0(); func_800C422C(2); @@ -2314,9 +2328,9 @@ void func_80084118(void) { void menu_options_init(void) { D_801263BC = 0; gMenuDelay = 0; - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); func_800C4170(2); - set_text_font(2); + set_text_font(FONT_LARGE); set_music_player_voice_limit(0x18); play_music(0x18); func_80000B18(); @@ -2327,7 +2341,7 @@ void func_800841B8(s32 arg0) { s32 phi_a3; s32 phi_s2; - set_text_font(2); + set_text_font(FONT_LARGE); set_text_background_color(0, 0, 0, 0); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, 0xA1, 0x23, gMenuText[36], 0xC); @@ -2337,7 +2351,7 @@ void func_800841B8(s32 arg0) { phi_s1 = 0; phi_s2 = 0x4C; - set_text_font(0); + set_text_font(FONT_COLOURFUL); while (gOptionMenuStrings[phi_s1] != NULL) { if (phi_s1 == D_800DF460) { @@ -2394,7 +2408,7 @@ s32 menu_options_loop(s32 arg0) { // Leave the option menu set_music_fade_timer(-0x80); gMenuDelay = -1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); func_80001D04(0x241, 0); } else if ((buttonsPressed & 0x9000) && D_800DF460 >= 2) { // Go to a sub-menu @@ -2483,10 +2497,10 @@ void menu_audio_options_init(void) { gMenuDelay = 0; D_801269FC = NULL; D_801263D8 = -1; - func_8009C674(D_800DFA2C); - func_8009C8A4(&D_800DFA2C[6]); + func_8009C674(gOptionMenuTextures); + allocate_menu_images(&gOptionMenuTextures[6]); func_8008E4B0(); - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); func_8007FFEC(2); gMusicVolumeSliderValue = musicGetVolSliderPercentage(); gSfxVolumeSliderValue = sfxGetVolumeSlider(); @@ -2556,7 +2570,7 @@ s32 menu_audio_options_loop(s32 arg0) { if (((buttonInputs & (A_BUTTON | START_BUTTON)) && (D_801263E0 == gOptionsMenuItemIndex + 1)) || (buttonInputs & B_BUTTON)) { gMenuDelay = -1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); if (D_801263D8 >= 0) { set_music_fade_timer(-0x80); } @@ -2664,7 +2678,7 @@ void func_800851FC(void) { set_music_fade_timer(0x100); func_80000B18(); } - func_8009C4A8(D_800DFA2C); + func_8009C4A8(gOptionMenuTextures); func_800C422C(2); } @@ -2688,7 +2702,7 @@ void menu_save_options_init(void) { D_80126BE4 = 0; D_80126BEC = 0.0f; func_8009C674(D_800DFC78); - func_8009C8A4(D_800DFCAC); + allocate_menu_images(D_800DFCAC); func_8007FFEC(0xA); func_800C4170(2); D_800DFC10.unk0 = D_80126550[71]; @@ -2699,7 +2713,7 @@ void menu_save_options_init(void) { D_800DFC60.unk0 = D_80126550[70]; func_8008E4B0(); func_8006EBA8(); - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); } GLOBAL_ASM("asm/non_matchings/menu/func_800853D0.s") @@ -2847,13 +2861,13 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8008832C.s") void menu_boot_init(void) { s32 i; - func_800C01D8(&D_800DF77C); - func_80077B34(0, 0, 0); - func_8009C674(&D_800DF7C4); + func_800C01D8(&sMenuTransitionFadeOut); + set_background_prim_colour(0, 0, 0); + func_8009C674(&sGameTitleTileTextures); // Sets up the 11 texture pointers for the "Diddy Kong Racing" logo. for (i = 0; i < 11; i++) { - D_800DF7DC[i].texture = D_80126550[D_800DF7C4[i]]; + sGameTitleTileOffsets[i].texture = D_80126550[sGameTitleTileTextures[i]]; } // Reset variables for menu_boot_loop() @@ -2910,7 +2924,7 @@ s32 menu_boot_loop(s32 arg0) { break; case 2: if (gMenuDelay && func_800C018C() == 0) { - func_800C01D8(&D_800DF76C); + func_800C01D8(&sMenuTransitionFadeInFast); } y = 300; out = func_800890AC(arg0); @@ -2918,7 +2932,7 @@ s32 menu_boot_loop(s32 arg0) { } if (y < 300) { - render_textured_rectangle(&D_801263A0, &D_800DF7DC, 160, y, 255, 255, 255, 255); + render_textured_rectangle(&D_801263A0, &sGameTitleTileOffsets, 160, y, 255, 255, 255, 255); func_8007B3D0(&D_801263A0); } @@ -2929,7 +2943,7 @@ GLOBAL_ASM("asm/non_matchings/menu/MenuBootLoop.s") #endif void func_800887C4(void) { - func_8009C4A8((s16 *)D_800DF7C4); + func_8009C4A8((s16 *)sGameTitleTileTextures); } void func_800887E8(void) { @@ -2986,14 +3000,14 @@ void menu_magic_codes_init(void) { gCheatInputCurrentColumn = 0; gOptionsMenuItemIndex = 0; gCheatInputStringLength = 0; - D_80126470 = 0; + sUnused_80126470 = 0; D_80126C4C = -1; D_80126C58[0] = 0; D_801263BC = 0; gMenuDelay = 0; D_801263D8 = 0; D_801263E0 = 0; - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); set_current_dialogue_box_coords(7, 0x32, 0x32, 0x10E, 0x84); set_current_dialogue_background_colour(7, 0, 0, 0, 0x80); assign_dialogue_box_id(7); @@ -3012,12 +3026,12 @@ void render_magic_codes_ui(s32 arg0) { set_text_background_color(0, 0, 0, 0); render_dialogue_box(&D_801263A0, 0, 0, 7); - set_text_font(2); + set_text_font(FONT_LARGE); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, 0xA1, 0x23, gMenuText[17], 0xC); // gMenuText[17] = "MAGIC CODES" set_text_color(0xFF, 0xFF, 0xFF, 0, 0xFF); draw_text(&D_801263A0, 0xA0, 0x20, gMenuText[17], 0xC); // gMenuText[17] = "MAGIC CODES" - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_color(0xFF, 0xFF, 0xFF, 0, 0xFF); c = 'A'; @@ -3054,7 +3068,7 @@ void render_magic_codes_ui(s32 arg0) { temp = 0x1FF - temp; } - set_text_font(0); + set_text_font(FONT_COLOURFUL); yPos = 0xA4; yIncr = 16; if (osTvType == TV_TYPE_PAL) { @@ -3070,7 +3084,7 @@ void render_magic_codes_ui(s32 arg0) { draw_text(&D_801263A0, POS_CENTRED, yPos, gMagicCodeMenuStrings[i], 0xC); yPos += yIncr; } - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_color(0xFF, 0xFF, 0x80, 0x80, 0xFF); set_text_background_color(0, 0, 0x80, 0x80); if (gOptionsMenuItemIndex == 4) { @@ -3139,7 +3153,7 @@ void menu_magic_codes_list_init(void) { func_800C4170(2); func_8009C6D4(0x3F); func_8008E4B0(); - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); if (osTvType == TV_TYPE_PAL) { D_80126C70 = 0xB; } else { @@ -3158,7 +3172,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { s32 i; set_text_background_color(0, 0, 0, 0); - set_text_font(2); + set_text_font(FONT_LARGE); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, 0xA1, 0x23, gMenuText[20], 0xC); // MAGIC CODES LIST set_text_color(0xFF, 0xFF, 0xFF, 0, 0xFF); @@ -3178,7 +3192,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { if (fp >= 0x100) { fp = 0x1FF - fp; } - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_color(0xFF, 0xFF, 0xFF, 0, 0xFF); for (i = D_801263E0; (i < D_801263E0 + D_80126C70) && (i < numOfUnlockedCheats); i++) { if (i == gOptionsMenuItemIndex) { @@ -3312,7 +3326,7 @@ s32 menu_magic_codes_list_loop(s32 arg0) { } if (sp48 != 0) { gMenuDelay = sp48; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); func_80001D04(0x241, NULL); } if (gMenuDelay < -0x1E) { @@ -3457,8 +3471,8 @@ void menu_character_select_init(void) { func_80001114(6); func_80000B18(); func_8009C674(D_800DFDC8); - func_8009C8A4(D_800DFDCC); - func_800C01D8(&D_800DF77C); + allocate_menu_images(D_800DFDCC); + func_800C01D8(&sMenuTransitionFadeOut); func_800C4170(2); } @@ -3468,7 +3482,7 @@ void menu_character_select_init(void) { void draw_character_select_text(s32 arg0) { s32 yPos; if (gMenuDelay >= -0x16 && gMenuDelay < 0x17) { - set_text_font(2); // Set font to the Big Yellow Text + set_text_font(FONT_LARGE); set_text_background_color(0, 0, 0, 0); set_text_color(0, 0, 0, 0xFF, 0x80); // Draw "Player Select" text drop shadow @@ -3667,27 +3681,35 @@ void func_8008C128(void) { GLOBAL_ASM("asm/non_matchings/menu/func_8008C168.s") +/** + * Initialises the timer and transition for the controller pak warning screen. + * Only seen once per game session, as set by gPlayerHasSeenCautionMenu. + */ void menu_caution_init(void) { - gIgnorePlayerInput = 0x3C; + gIgnorePlayerInput = 60; gMenuDelay = 0; func_800C4170(2); - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); gPlayerHasSeenCautionMenu = 1; } +/** + * Loops through the display of the caution screen. + * Blocks player input for one second. + */ s32 menu_caution_loop(s32 updateRate) { - if (gMenuDelay != 0) { + if (gMenuDelay) { gMenuDelay += updateRate; } else if (gIgnorePlayerInput <= 0 && (get_buttons_pressed_from_player(0) & (A_BUTTON | B_BUTTON | START_BUTTON))) { func_80001D04(0xEF, NULL); gMenuDelay = 1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); } - if (gMenuDelay < 0x14) { + if (gMenuDelay < 20) { draw_menu_elements(1, gCautionMenuTextElements, 1.0f); } - if (gMenuDelay >= 0x1F) { - func_8008C4E8(); + if (gMenuDelay > 30) { + unload_large_font(); menu_init(MENU_GAME_SELECT); } if (gIgnorePlayerInput > 0) { @@ -3696,8 +3718,11 @@ s32 menu_caution_loop(s32 updateRate) { return 0; } -void func_8008C4E8(void) { - func_800C422C(2); +/** + * Explicitly says to unload the FONT_LARGE type. + */ +void unload_large_font(void) { + func_800C422C(FONT_LARGE); } #ifdef NON_MATCHING @@ -3709,7 +3734,7 @@ void menu_game_select_init(void) { D_801263BC = 0; D_800DF460 = 0; D_801263E0 = 2; - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); func_8006EBA8(); func_8001B790(); D_801263D8 = 1; @@ -3856,11 +3881,11 @@ s32 menu_game_select_loop(s32 arg0) { if (D_800DF460 == D_801263E0) { set_music_fade_timer(-0x80); } - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); gMenuDelay = 1; func_80001D04(0xEF, 0); } else if (playerInputs & B_BUTTON) { - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); gMenuDelay = -1; } else { if (playerYDir < 0) { @@ -3898,7 +3923,7 @@ void menu_file_select_init(void) { get_number_of_levels_and_worlds(&numLevels, &numWorlds); func_8009C674(D_800E0398); - func_8009C8A4(D_800E03A4); + allocate_menu_images(D_800E03A4); func_8007FFEC(6); func_8006EBA8(); D_801263D8 = 1; @@ -3909,7 +3934,7 @@ void menu_file_select_init(void) { D_80126484 = 0; D_80126488 = 0; D_80126CC0 = 0; - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); func_800C4170(2); play_music(0x1A); for (i = 0; i < 10; i++) { @@ -3922,30 +3947,36 @@ void menu_file_select_init(void) { func_80000B18(); } -void func_8008CC28(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { - s32 saved0 = D_800DF4A4; - s32 saved1 = D_800DF4A8; - s32 saved2 = D_800DF4AC; - s32 saved3 = D_800DF764; - D_800DF4A4 = arg3; - D_800DF4A8 = arg4; - D_800DF4AC = arg5; - D_800DF764 = arg6; - D_800DF75C[arg0].unkC = arg1 - 0x9F; - D_800DF75C[arg0].unk10 = 0x77 - arg2; - func_8009CA60(arg0); - D_800DF4A4 = saved0; - D_800DF4A8 = saved1; - D_800DF4AC = saved2; - D_800DF764 = saved3; - D_800DF75C[arg0].unkC = arg1 - 0xA1; - D_800DF75C[arg0].unk10 = 0x79 - arg2; - func_8009CA60(arg0); +/** + * Sets the colour properties of the selected image index in the menu texture stack, then renders it on screen. + * Rendering it twice using different colour settings, it casts a shadow. + */ +void render_menu_image(s32 imageID, s32 xOffset, s32 yOffset, s32 red, s32 green, s32 blue, s32 opacity) { + s32 tempRed = sMenuGuiColourR; + s32 tempGreen = sMenuGuiColourG; + s32 tempBlue = sMenuGuiColourB; + s32 tempOpacity = sMenuGuiOpacity; +// This first section is the shadow + sMenuGuiColourR = red; + sMenuGuiColourG = green; + sMenuGuiColourB = blue; + sMenuGuiOpacity = opacity; + gMenuImageStack[imageID].unkC = xOffset - 159; + gMenuImageStack[imageID].unk10 = 119 - yOffset; + func_8009CA60(imageID); +// And this then draws it again, with colour + sMenuGuiColourR = tempRed; + sMenuGuiColourG = tempGreen; + sMenuGuiColourB = tempBlue; + sMenuGuiOpacity = tempOpacity; + gMenuImageStack[imageID].unkC = xOffset - 161; + gMenuImageStack[imageID].unk10 = 121 - yOffset; + func_8009CA60(imageID); } #ifdef NON_MATCHING // Shouldn't have any major issues. -void render_file_select_menu(s32 arg0) { +void render_file_select_menu(UNUSED s32 updateRate) { s32 s2; s32 s5; s32 y; @@ -3973,7 +4004,7 @@ void render_file_select_menu(s32 arg0) { } func_80080BC8(&D_801263A0); if (D_801263D8 == 0) { - set_text_font(2); + set_text_font(FONT_LARGE); set_text_background_color(0, 0, 0, 0); s5 = 10; for (i = 0; i < 3; i++) { @@ -3983,18 +4014,18 @@ void render_file_select_menu(s32 arg0) { if (gSavefileInfo[i].isAdventure2 != 0) { s2 = 0xC; } - func_8008CC28(s2, D_800E03FC[2] + D_800E03CC[i].unk0, D_800E03FC[3] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); + render_menu_image(s2, D_800E03FC[2] + D_800E03CC[i].unk0, D_800E03FC[3] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); func_80068508(1); - D_800DF75C->unk18 = gSavefileInfo[i].balloonCount / s5; - func_8008CC28(0, (D_800E03FC[6] + D_800E03CC[i].unk0) - 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); - D_800DF75C->unk18 = gSavefileInfo[i].balloonCount % s5; - func_8008CC28(0, D_800E03FC[6] + D_800E03CC[i].unk0 + 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); + 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, 0x80); + 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, 0x80); func_80068508(0); - D_800DF4A8 = 0x40; - D_800DF4AC = 0x40; - func_8008CC28(s5, D_800E03FC[8] + D_800E03CC[i].unk0, D_800E03FC[9] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); - D_800DF4A8 = 0xFF; - D_800DF4AC = 0xFF; + sMenuGuiColourG = 0x40; + sMenuGuiColourB = 0x40; + render_menu_image(s5, D_800E03FC[8] + D_800E03CC[i].unk0, D_800E03FC[9] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); + sMenuGuiColourG = 0xFF; + sMenuGuiColourB = 0xFF; func_8007BF1C(1); } else { set_text_color(255, 255, 255, 64, 255); @@ -4006,7 +4037,7 @@ void render_file_select_menu(s32 arg0) { if (phi_v0_2 >= 0x100) { phi_v0_2 = 0x1FF - phi_v0_2; } - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_background_color(0, 0, 0, 0); set_text_color(255, 255, 255, 0, 255); for (i = 0; i < 3; i++) { @@ -4037,7 +4068,7 @@ void render_file_select_menu(s32 arg0) { } } } - set_text_font(2); + set_text_font(FONT_LARGE); set_text_color(0, 0, 0, 255, 128); draw_text(&D_801263A0, 0xA1, 0x13, gMenuText[76], 4); set_text_color(255, 255, 255, 0, 255); @@ -4046,10 +4077,10 @@ void render_file_select_menu(s32 arg0) { y += 0xBB; if (D_80126484 != 0) { if (D_80126494 == 0) { - set_text_font(0); + set_text_font(FONT_COLOURFUL); draw_text(&D_801263A0, 0xA0, y, gMenuText[77], 0xC); } else if (D_80126494 == 1) { - set_text_font(0); + set_text_font(FONT_COLOURFUL); draw_text(&D_801263A0, 0xA0, y, gMenuText[78], 0xC); } else { draw_text(&D_801263A0, 0xA0, y, &D_800E8234, 0xC); @@ -4058,7 +4089,7 @@ void render_file_select_menu(s32 arg0) { } if (D_80126488 != 0) { if (D_80126494 == 0) { - set_text_font(0); + set_text_font(FONT_COLOURFUL); draw_text(&D_801263A0, 0xA0, y, gMenuText[79], 0xC); } else { draw_text(&D_801263A0, 0xA0, y, &D_800E8238, 0xC); @@ -4223,14 +4254,14 @@ s32 menu_track_select_loop(s32 arg0) { break; } - if (D_800DF760 < 0) { + if (sMenuMusicVolume < 0) { set_relative_volume_for_music(0); } else { - D_800DF760 += arg0 * 2; - if (D_800DF760 >= 0x51) { - D_800DF760 = 0x50; + sMenuMusicVolume += arg0 * 2; + if (sMenuMusicVolume >= 0x51) { + sMenuMusicVolume = 0x50; } - set_relative_volume_for_music((u8)D_800DF760); + set_relative_volume_for_music((u8)sMenuMusicVolume); } if (D_801267D0 < 0) { func_8008F534(); @@ -4350,8 +4381,8 @@ void render_track_select_setup_ui(s32 arg0) { } else { sp84 = 4; } - D_800DF75C[sp84].unkC = 0.0f; - D_800DF75C[sp84].unk10 = 0.0f; + gMenuImageStack[sp84].unkC = 0.0f; + gMenuImageStack[sp84].unk10 = 0.0f; if (osTvType == TV_TYPE_PAL) { D_800DF454 = 1.2f; } @@ -4360,23 +4391,23 @@ void render_track_select_setup_ui(s32 arg0) { } if ((gMenuDelay >= -0x16) && (gMenuDelay < 0x1F)) { if (gMenuDelay < 0) { - D_800DF764 = (gMenuDelay * 0x10) + 0xFF; + sMenuGuiOpacity = (gMenuDelay * 0x10) + 0xFF; } else { - D_800DF764 = 0xFF; + sMenuGuiOpacity = 0xFF; } - if (D_800DF764 < 0) { - D_800DF764 = 0; + if (sMenuGuiOpacity < 0) { + sMenuGuiOpacity = 0; } sp7C = func_8006B0F8(gTrackIdForPreview); - set_text_font(2); - set_text_color(0xC0, 0xC0, 0xFF, 0, D_800DF764); + set_text_font(FONT_LARGE); + set_text_color(0xC0, 0xC0, 0xFF, 0, sMenuGuiOpacity); set_text_background_color(0, 0, 0, 0); draw_text(&D_801263A0, POS_CENTRED, 0x2B, func_8006BDDC(gTrackIdForPreview), 0xC); // Draw track name? sp84 = D_801263BC * 8; if (sp84 >= 0x100) { sp84 = 0x1FF - sp84; } - set_current_dialogue_background_colour(7, 0xFF, sp84, 0, D_800DF764); + set_current_dialogue_background_colour(7, 0xFF, sp84, 0, sMenuGuiOpacity); if ((D_801263E0 == -1) || ((D_801263E0 == 2) && (D_801269C8 == 4) && is_adventure_two_unlocked())) { s4 = func_800C4DA0(gMenuText[146], 0, 0); // gMenuText[146] = "ADVENTURE" temp = func_800C4DA0(gMenuText[147], 0, 0); // gMenuText[147] = "ADVENTURE TWO" @@ -4389,21 +4420,21 @@ void render_track_select_setup_ui(s32 arg0) { s4 += 0xC; } func_80080580(&D_801263A0, -(s4 >> 1), 0x78 - D_800E0700[1], s4, D_800E0700[3], - D_800E0700[4], D_800E0700[5], D_800DF764 + 0xB0E0C000, D_8012665C); + D_800E0700[4], D_800E0700[5], sMenuGuiOpacity + 0xB0E0C000, D_8012665C); func_80080E6C(); - set_text_font(0); + set_text_font(FONT_COLOURFUL); s7 = D_800E0700[7] + D_800E0700[1] + sp80; s7++; for (i = 0; i < 2; i++) { for (j = 0; j < 4; j += 2) { if (j == 0) { - set_text_color(0, 0, 0, 0xFF, D_800DF764 >> 1); + set_text_color(0, 0, 0, 0xFF, sMenuGuiOpacity >> 1); } else { s32 alpha = i; if (i == D_800E0418) { alpha = sp84; } - set_text_color(0xFF, 0xFF, 0xFF, alpha, D_800DF764); + set_text_color(0xFF, 0xFF, 0xFF, alpha, sMenuGuiOpacity); } // gMenuText[146] = "ADVENTURE", gMenuText[147] = "ADVENTURE TWO" draw_text(&D_801263A0, 0xA1 - j, s7 - j, gMenuText[146 + i], 0xC); @@ -4412,11 +4443,11 @@ void render_track_select_setup_ui(s32 arg0) { } } if (D_801269C8 < 4) { - set_text_font(0); - set_text_color(0xFF, 0x40, 0x40, 0x60, D_800DF764); + set_text_font(FONT_COLOURFUL); + set_text_color(0xFF, 0x40, 0x40, 0x60, sMenuGuiOpacity); draw_text(&D_801263A0, 0x38, 0x48 + sp80, gMenuText[9], 8); // gMenuText[9] = "BEST TIME" draw_text(&D_801263A0, 0x38, 0x5C + sp80, gMenuText[10], 8); // gMenuText[10] = "BEST LAP" - set_text_color(0xFF, 0x80, 0xFF, 0x60, D_800DF764); + set_text_color(0xFF, 0x80, 0xFF, 0x60, sMenuGuiOpacity); decompress_filename_string(settings->courseInitialsPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], &sp78, 3); draw_text(&D_801263A0, 0xFA, 0x48 + sp80, &sp78, 0xC); decompress_filename_string(settings->flapInitialsPtr[gPlayerSelectVehicle[0]][gTrackIdForPreview], &sp78, 3); @@ -4429,15 +4460,15 @@ void render_track_select_setup_ui(s32 arg0) { set_current_dialogue_box_coords(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); render_dialogue_box(&D_801263A0, 0, 0, 7); if (D_801263E0 <= 0) { - render_textured_rectangle(&D_801263A0, &D_800E05B4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, &D_800E05B4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { - render_textured_rectangle(&D_801263A0, &D_800E05C4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, &D_800E05C4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); for (i = 0; i < 2; i++) { s32 yTemp = 0x97 + sp80 + (i * 0x18); if (i == D_800E0414) { - render_textured_rectangle(&D_801263A0, D_800E0648[(i * 3) + 1], 0x68, yTemp, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0648[(i * 3) + 1], 0x68, yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { - render_textured_rectangle(&D_801263A0, D_800E0648[(i * 3) + 2], 0x68, yTemp, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0648[(i * 3) + 2], 0x68, yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } } } @@ -4455,7 +4486,7 @@ void render_track_select_setup_ui(s32 arg0) { } // "Player" text image - render_textured_rectangle(&D_801263A0, D_800E0660[i], D_800E0688[s3 + (i * 2)], D_800E0688[s3 + (i * 2) + 1] + sp80, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0660[i], D_800E0688[s3 + (i * 2)], D_800E0688[s3 + (i * 2) + 1] + sp80, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } } } @@ -4471,13 +4502,13 @@ void render_track_select_setup_ui(s32 arg0) { for (j = 0; j < gNumberOfActivePlayers; j++) { if (i == gPlayerSelectVehicle[j]) { // Highlighted - render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 1], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 1], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else if (settings->courseFlagsPtr[gTrackIdForPreview] & 2) { // Not highlighted - render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { // Not available (Ghosted out) - render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, D_800DF764 / 2); + render_textured_rectangle(&D_801263A0, D_800E0624[(i * 3) + 2], D_800E06B0[s3 + j], yTemp, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity / 2); } } } @@ -4494,21 +4525,21 @@ void render_track_select_setup_ui(s32 arg0) { if (gNumberOfActivePlayers == 1) { if (D_801263E0 == 0) { // Draw vehicle image for one player - render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x95, s7, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x95, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } else { // Draw T.T. image for one player - render_textured_rectangle(&D_801263A0, D_800E0648[D_800E0414 * 3], 0x95, sp80, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0648[D_800E0414 * 3], 0x95, sp80, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } } if ((gNumberOfActivePlayers == 2) && (!sp74)) { s7 = sp80; // Draw vehicle image for first player - render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x4F, s7, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[0] * 3], 0x4F, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); if (gPlayerSelectVehicle[1] == 2) { s7 = sp80 + 2; } // Draw vehicle image for second player - render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[1] * 3], 0xB0, s7, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, D_800E0624[gPlayerSelectVehicle[1] * 3], 0xB0, s7, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); } func_8007B3D0(&D_801263A0); @@ -4516,14 +4547,14 @@ void render_track_select_setup_ui(s32 arg0) { if (gNumberOfActivePlayers < 3) { // Draw border around vehicle images if (!sp74) { - D_800DF75C[7].unk10 = -52.0f; + gMenuImageStack[7].unk10 = -52.0f; if (gNumberOfActivePlayers == 1) { - D_800DF75C[7].unkC = 21.0f; + gMenuImageStack[7].unkC = 21.0f; func_8009CA60(7); } else { - D_800DF75C[7].unkC = -48.0f; + gMenuImageStack[7].unkC = -48.0f; func_8009CA60(7); - D_800DF75C[7].unkC = 48.0f; + gMenuImageStack[7].unkC = 48.0f; func_8009CA60(7); } } @@ -4538,7 +4569,7 @@ void render_track_select_setup_ui(s32 arg0) { } func_80080580(&D_801263A0, -(s4 >> 1), 0x78 - D_800E06E4[1], s4, D_800E06E4[3], D_800E06E4[4], D_800E06E4[5], 0xB0E0C0FF, D_8012665C); func_80080E6C(); - set_text_font(0); + set_text_font(FONT_COLOURFUL); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, D_800E06E4[6] + D_800E06E4[0] + 1, D_800E06E4[7] + D_800E06E4[1] + 1, gMenuText[136], 0xC); set_text_color(0xFF, 0xFF, 0xFF, 0, 0xFF); @@ -4550,22 +4581,22 @@ void render_track_select_setup_ui(s32 arg0) { s32 index = i * 2; if (i == gMultiplayerSelectedNumberOfRacers) { if (D_801263E0 < 3) { - D_800DF4A8 = 0xFF - sp84; - D_800DF4AC = 0xFF - sp84; + sMenuGuiColourG = 0xFF - sp84; + sMenuGuiColourB = 0xFF - sp84; } else { - D_800DF4A8 = 0; - D_800DF4AC = 0; + sMenuGuiColourG = 0; + sMenuGuiColourB = 0; } } // X position - D_800DF75C[0].unkC = (D_800E06E4[index + 8] + D_800E06E4[0]) - 0xA0; + gMenuImageStack[0].unkC = (D_800E06E4[index + 8] + D_800E06E4[0]) - 0xA0; // Y position - D_800DF75C[0].unk10 = (-D_800E06E4[index + 9] - D_800E06E4[1]) + 0x78; + gMenuImageStack[0].unk10 = (-D_800E06E4[index + 9] - D_800E06E4[1]) + 0x78; // Number value to draw. - D_800DF75C[0].unk18 = index + 2; + gMenuImageStack[0].unk18 = index + 2; func_8009CA60(0); - D_800DF4A8 = 0xFF; - D_800DF4AC = 0xFF; + sMenuGuiColourG = 0xFF; + sMenuGuiColourB = 0xFF; } func_8007BF1C(1); func_80068508(0); @@ -4578,33 +4609,33 @@ void render_track_select_setup_ui(s32 arg0) { if (gIsInAdventureTwo) { i = 12; } - D_800DF75C[i].unk10 = 42.0f; + gMenuImageStack[i].unk10 = 42.0f; if ((settings->courseFlagsPtr[gTrackIdForPreview] & 2) || is_adventure_two_unlocked()) { - D_800DF75C[i].unkC = -128.0f; + gMenuImageStack[i].unkC = -128.0f; func_8009CA60(i); } if ((settings->courseFlagsPtr[gTrackIdForPreview] & 4) || is_adventure_two_unlocked()) { - D_800DF75C[i].unkC = 120.0f; + gMenuImageStack[i].unkC = 120.0f; func_8009CA60(i); } func_8007BF1C(1); } if ((gNumberOfActivePlayers == 1) && (D_801263E0 >= 0) && (func_80092BE0(gTrackIdForPreview) >= 0)) { // Render small T.T. icon. - render_textured_rectangle(&D_801263A0, &D_800E0614, 0xCC, 0x7A, 0xFF, 0xFF, 0xFF, D_800DF764); + render_textured_rectangle(&D_801263A0, &D_800E0614, 0xCC, 0x7A, 0xFF, 0xFF, 0xFF, sMenuGuiOpacity); func_8007B3D0(&D_801263A0); } if (D_801269C8 != 5) { if (((D_801263E0 == 2) && !sp74) || ((D_801263E0 == 3) && sp74) || (D_801263E0 == 4)) { - set_text_font(2); - set_text_color(0xFF, 0xFF, 0xFF, 0, D_800DF764); + set_text_font(FONT_LARGE); + set_text_color(0xFF, 0xFF, 0xFF, 0, sMenuGuiOpacity); if (D_801269C8 >= 4) { sp80 += 0x18; } draw_text(&D_801263A0, 0xA0, 0xAC, D_800E823C, 0xC); // D_800E823C = "OK?" } } - D_800DF764 = 0xFF; + sMenuGuiOpacity = 0xFF; } } #else @@ -4673,7 +4704,7 @@ void menu_5_init(void) { func_80000B18(); D_801263E0 = 0; func_8009C674(&D_800E0FB4); - func_8009C8A4(&D_800E0FD8); + allocate_menu_images(&D_800E0FD8); func_8008E45C(); D_800E04D4.unk0 = D_80126550[31]; D_800E04E4.unk0 = D_80126550[30]; @@ -4683,7 +4714,7 @@ void menu_5_init(void) { D_800E0524.unk0 = D_80126550[34]; D_800E05B4.unk0 = D_80126550[48]; D_800E0614.unk0 = D_80126550[94]; - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); D_801263BC = 0; gMenuDelay = 0; D_800E0980 = 0x1E; @@ -4752,7 +4783,7 @@ s32 menu_5_loop(s32 arg0) { func_800C31EC(0x2710); } gMenuDelay = 1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); func_80001D04(0xEF, NULL); } else if (D_801267D8[0] & 0x4000) { func_80001D04(0x241, NULL); @@ -4760,7 +4791,7 @@ s32 menu_5_loop(s32 arg0) { if (sp28) { func_800C31EC(0x2710); } - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); gMenuDelay = -1; } else { D_801263E0 = 0; @@ -4769,7 +4800,7 @@ s32 menu_5_loop(s32 arg0) { } else { if (D_801267D8[0] & 0x4000) { func_80001D04(0x241, NULL); - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); gMenuDelay = -1; } else if (D_801267D8[0] & 0x9000) { D_801263E0 = 1; @@ -4966,10 +4997,10 @@ void menu_11_init(void) { gIgnorePlayerInput = 1; D_800E0988 = 0; func_8009C674(D_800E0A24); - func_8009C8A4(D_800E0A40); + allocate_menu_images(D_800E0A40); func_80094604(); func_800C4170(2); - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); set_music_player_voice_limit(0x18); play_music(0x18); set_music_fade_timer(0x80); @@ -5162,7 +5193,7 @@ void func_800983C0(s32 arg0) { sp28 = func_8006BDDC(func_8006B1D4(gTrophyRaceWorldId)); sp24 = func_8006BDDC(sp20[((gTrophyRaceWorldId - 1) * 6) + D_800E0FEC]); set_text_background_color(0, 0, 0, 0); - set_text_font(2); + set_text_font(FONT_LARGE); set_text_color(0, 0, 0, 0xFF, 0x80); draw_text(&D_801263A0, 0xA1, 0x23, sp28, 0xC); draw_text(&D_801263A0, 0xA1, 0x43, gMenuText[70], 0xC); @@ -5242,7 +5273,7 @@ void menu_ghost_data_init(void) { func_8009963C(); } func_8009C674(&D_800E1708); - func_8009C8A4(&D_800E174C); + allocate_menu_images(&D_800E174C); func_800C4170(2); D_800E153C[0].texture = D_80126550[14]; D_800E153C[5].texture = D_80126550[15]; @@ -5285,7 +5316,7 @@ void menu_ghost_data_init(void) { gMenuDelay = 0; D_80126498 = 0; if (sp70 == 0) { - func_800C01D8(&D_800DF77C); + func_800C01D8(&sMenuTransitionFadeOut); return; } gMenuDelay = 0x1E; @@ -5336,7 +5367,7 @@ s32 menu_ghost_data_loop(s32 arg0) { func_80001D04(0xEF, 0); } else if ((pressedButtons & B_BUTTON) || ((pressedButtons & (START_BUTTON | A_BUTTON)) && (D_801264D4 == 0))) { gMenuDelay = 1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); func_80001D04(0x241, 0); } else { temp = D_80126498; @@ -5376,7 +5407,7 @@ s32 menu_ghost_data_loop(s32 arg0) { func_80001D04(0xEF, 0); } else { gMenuDelay = 1; - func_800C01D8(&D_800DF774); + func_800C01D8(&sMenuTransitionFadeIn); func_80001D04(0x241, 0); } D_801263E0 = 0; @@ -5472,18 +5503,18 @@ void menu_credits_init(void) { D_80126BD0 = 0; D_80126BD8 = 0; D_80126BE0 = 0; - func_80077B5C(0, 0, 0); + set_background_fill_colour(0, 0, 0); if (osTvType == TV_TYPE_PAL) { - func_80066940(0, 0, 0x26, 0x140, 0xE0); - func_80066AA8(0, 0x8000, 0x8000, 0x140, 0x11C); + func_80066940(0, 0, 38, SCREEN_WIDTH, 224); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, SCREEN_WIDTH, SCREEN_HEIGHT + 44); } else { - func_80066940(0, 0, 0x28, 0x140, 0xC4); - func_80066AA8(0, 0x8000, 0x8000, 0x140, 0xF0); + func_80066940(0, 0, 40, SCREEN_WIDTH, 196); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, SCREEN_WIDTH, SCREEN_HEIGHT); } func_80066610(); func_80066818(0, 1); func_8009C674(D_800E17D8); - func_8009C8A4(D_800E17F0); + allocate_menu_images(D_800E17F0); func_80094604(); func_800C4170(2); set_music_player_voice_limit(0x18); @@ -5547,7 +5578,7 @@ void func_8009BCF0(void) { set_music_player_voice_limit(0x12); func_800C0180(); func_80066894(0, 0); - func_80066AA8(0, 0x8000, 0x8000, 0x8000, 0x8000); + set_viewport_properties(0, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO, VIEWPORT_AUTO); func_8009C4A8(D_800E17D8); func_800C422C(2); func_8006F564(0); @@ -5875,9 +5906,9 @@ void func_8009C508(s32 arg0) { gParticlePtrList_flush(); } if (D_800DF758 == 0) { - if (D_800DF75C != NULL) { - free_from_memory_pool(D_800DF75C); - D_800DF75C = NULL; + if (gMenuImageStack != NULL) { + free_from_memory_pool(gMenuImageStack); + gMenuImageStack = NULL; } if (*D_800DF750 != NULL) { free_from_memory_pool(*D_800DF750); @@ -5887,40 +5918,41 @@ void func_8009C508(s32 arg0) { } } -void func_8009C674(s16 *arg0) { +void func_8009C674(s16 *textureIndex) { s32 index = 0; - while (arg0[index] != -1) { - func_8009C6D4(arg0[index++]); + while (textureIndex[index] != -1) { + func_8009C6D4(textureIndex[index++]); } } +// Educated guess says this is a function that renders texture tiles on screen. GLOBAL_ASM("asm/non_matchings/menu/func_8009C6D4.s") -void func_8009C8A4(s16 *arg0) { +void allocate_menu_images(s16 *imageSet) { s32 index = 0; - while (arg0[index] != -1) { - func_8009C904(arg0[index++]); + while (imageSet[index] != -1) { + allocate_and_set_menu_image_properties(imageSet[index++]); } } -void func_8009C904(s32 arg0) { - if (D_800DF75C == NULL) { - D_800DF75C = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, COLOR_TAG_RED); +void allocate_and_set_menu_image_properties(s32 imageID) { + if (gMenuImageStack == NULL) { + gMenuImageStack = allocate_from_main_pool_safe(sizeof(unk800DF510) * 18, COLOR_TAG_RED); } - D_800DF75C[arg0].unk0 = D_800DF510[arg0].unk0; - D_800DF75C[arg0].unk2 = D_800DF510[arg0].unk2; - D_800DF75C[arg0].unk4 = D_800DF510[arg0].unk4; - D_800DF75C[arg0].unk6 = D_800DF510[arg0].unk6; - D_800DF75C[arg0].unkC = D_800DF510[arg0].unkC; - D_800DF75C[arg0].unk10 = D_800DF510[arg0].unk10; - D_800DF75C[arg0].unk14 = D_800DF510[arg0].unk14; - D_800DF75C[arg0].unk8 = D_800DF510[arg0].unk8; - D_800DF75C[arg0].unk18 = D_800DF510[arg0].unk18; - D_800DF75C[arg0].unk1A = get_random_number_from_range(0, 0xFFFF); - D_800DF75C[arg0].unk1B = get_random_number_from_range(0, 0xFFFF); - D_800DF75C[arg0].unk1C = get_random_number_from_range(0, 0xFFFF); - D_800DF75C[arg0].unk1D = D_800DF510[arg0].unk1D; + gMenuImageStack[imageID].unk0 = sMenuImageProperties[imageID].unk0; + gMenuImageStack[imageID].unk2 = sMenuImageProperties[imageID].unk2; + gMenuImageStack[imageID].unk4 = sMenuImageProperties[imageID].unk4; + gMenuImageStack[imageID].unk6 = sMenuImageProperties[imageID].unk6; + gMenuImageStack[imageID].unkC = sMenuImageProperties[imageID].unkC; + gMenuImageStack[imageID].unk10 = sMenuImageProperties[imageID].unk10; + gMenuImageStack[imageID].unk14 = sMenuImageProperties[imageID].unk14; + gMenuImageStack[imageID].unk8 = sMenuImageProperties[imageID].unk8; + gMenuImageStack[imageID].unk18 = sMenuImageProperties[imageID].unk18; + gMenuImageStack[imageID].unk1A = get_random_number_from_range(0, 0xFFFF); + gMenuImageStack[imageID].unk1B = get_random_number_from_range(0, 0xFFFF); + gMenuImageStack[imageID].unk1C = get_random_number_from_range(0, 0xFFFF); + gMenuImageStack[imageID].unk1D = sMenuImageProperties[imageID].unk1D; } void func_8009CA58(void) { @@ -5958,7 +5990,7 @@ s32 func_8009CFEC(u32 dialogueOption) { if (D_800DF4E0 != 0) { return 0; } - if (dialogueOption != 3) { + if (dialogueOption != DIALOG_CHALLENGE) { func_8006F388(1); } result = 0; @@ -5981,7 +6013,7 @@ s32 func_8009CFEC(u32 dialogueOption) { result = trophy_race_cabinet_menu_loop(); // Trophy race cabinet menu break; case DIALOG_RACERESULT: - result = func_8009D9F4(); + result = dialogue_race_defeat(); break; } return result; @@ -6016,7 +6048,11 @@ void render_dialogue_option(char *text, s32 yOffset, s32 optionID) { sDialogueOptionMax = (s8)(sDialogueOptionMax + 1); } -void func_8009D26C(void) { +/** + * Sets dialogue option when the joystick is moved. + * Will wrap around if it goes out of bounds. + */ +void handle_menu_joystick_input(void) { if (gControllersYAxisDirection[0] < 0) { sDialogueOption = sDialogueOption + 1; func_80001D04(0xB2, NULL); @@ -6042,9 +6078,12 @@ void func_8009D330(s32 arg0) { D_800DF4DC = arg0; } -void func_8009D33C(s32 arg0, s32 arg1) { - if (sCurrentMenuID == arg0) { - sCurrentMenuID = arg1; +/** + * Sets the menu ID to the second passed number if it's equal to the first. + */ +void set_menu_id_if_option_equal(s32 IDToCheck, s32 IDToSet) { + if (sCurrentMenuID == IDToCheck) { + sCurrentMenuID = IDToSet; } } @@ -6116,7 +6155,7 @@ s32 taj_menu_loop(void) { render_dialogue_option(gMenuText[39], 0x14, 1); // CHALLENGES } render_dialogue_option(gMenuText[5], 0x14, 2); // RETURN - func_8009D26C(); + handle_menu_joystick_input(); if (buttonsPressed & B_BUTTON) { sp2C = 3; func_80001D04(0x241, 0); @@ -6140,7 +6179,7 @@ s32 taj_menu_loop(void) { } break; case 2: - func_8009D26C(); + handle_menu_joystick_input(); if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); func_8003AC3C(0x238, 1); @@ -6158,7 +6197,7 @@ s32 taj_menu_loop(void) { } break; case 3: - func_8009D26C(); + handle_menu_joystick_input(); if ((buttonsPressed & B_BUTTON) || ((buttonsPressed & A_BUTTON) && (D_80126516 == 3))) { func_80001D04(0x241, 0); func_8003AC3C(0x23A, 1); @@ -6219,7 +6258,10 @@ s32 taj_menu_loop(void) { return sp2C; } -s32 func_8009D9F4(void) { +/** + * Shows the dialogue options after you finish an unbeaten race in P2 or lower. + */ +s32 dialogue_race_defeat(void) { s32 state; s32 playerInput; @@ -6234,7 +6276,7 @@ s32 func_8009D9F4(void) { gDialogOptionYOffset = 50; render_dialogue_option(gMenuText[23], 20, 0); // TRY AGAIN render_dialogue_option(gMenuText[51], 20, 1); // EXIT - func_8009D26C(); + handle_menu_joystick_input(); if (playerInput & A_BUTTON) { func_80001D04(0xEF, NULL); switch (D_80126516) { @@ -6300,7 +6342,7 @@ s32 tt_menu_loop(void) { } } render_dialogue_option(gMenuText[5], 0x14, 2); // RETURN - func_8009D26C(); + handle_menu_joystick_input(); if (D_80126516 == 0) { if (gControllersXAxisDirection[0] > 0) { if (!is_time_trial_enabled()) { @@ -6326,7 +6368,7 @@ s32 tt_menu_loop(void) { func_80001D04(0xEF, 0); func_80036BCC(0x22E, 1); func_8009C674(&D_800E1E2C); - func_8009C8A4(&D_800E1E40); + allocate_menu_images(&D_800E1E40); D_800E1E28 = 1; sCurrentMenuID = TT_MENU_GAME_STATUS; break; @@ -6499,14 +6541,12 @@ s32 trophy_race_cabinet_menu_loop(void) { /** * Blank function called when a dialogue box is opened. */ - void dialogue_open_stub(void) { } /** * Blank function called when a dialogue box is closed. */ - void dialogue_close_stub(void) { } @@ -6514,7 +6554,6 @@ void dialogue_close_stub(void) { * Renders a textbox with a displaylist. * Return value goes completely unused. */ - f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, Gfx **mat, VertexList **verts) { D_801263A0 = *dlist; D_801263A8 = *mat; diff --git a/src/menu.h b/src/menu.h index 78ec1a24..bcd279b4 100644 --- a/src/menu.h +++ b/src/menu.h @@ -101,14 +101,15 @@ enum Language { }; /* Size: 0x20 bytes */ +// So this is looking to be a struct for menu images. typedef struct unk800DF510 { - s16 unk0; - s16 unk2; + s16 unk0; //X1 + s16 unk2; //Y1 s16 unk4; s16 unk6; f32 unk8; - f32 unkC; - f32 unk10; + f32 unkC; // X offset + f32 unk10; // Y offset f32 unk14; s16 unk18; s8 unk1A; @@ -257,9 +258,9 @@ extern s32 *gMenuTextLangTable; extern char **gMenuText; -extern u8 D_800DF4A4; -extern u8 D_800DF4A8; -extern u8 D_800DF4AC; +extern u8 sMenuGuiColourR; +extern u8 sMenuGuiColourG; +extern u8 sMenuGuiColourB; extern u8 D_800DF4B0; extern s32 D_800DF4B4; @@ -282,15 +283,15 @@ extern s8 gDialogOptionTangible; // Unused? extern s32 D_800DF4F0[]; -extern unk800DF510 D_800DF510[18]; +extern unk800DF510 sMenuImageProperties[18]; extern s16 *D_800DF750[1]; extern s16 D_800DF754; extern s16 D_800DF758; -extern unk800DF510 *D_800DF75C; +extern unk800DF510 *gMenuImageStack; -extern s32 D_800DF760; -extern s32 D_800DF764; +extern s32 sMenuMusicVolume; +extern s32 sMenuGuiOpacity; extern s32 D_800DF768; extern s32 D_800DF794; @@ -303,9 +304,9 @@ extern char *gTitleMenuStrings[3]; // Version text shown on the title screen? See 1:15 in https://www.youtube.com/watch?v=OHSCLcA74ao. extern char gVersionDisplayText[20]; -extern s16 D_800DF7C4[12]; +extern s16 sGameTitleTileTextures[12]; -extern DrawTexture D_800DF7DC[12]; +extern DrawTexture sGameTitleTileOffsets[12]; // Title screen cinematic text extern unk800DF83C D_800DF83C[10]; @@ -316,7 +317,7 @@ extern u16 D_800DF9F8[12]; extern char *gOptionMenuStrings[7]; -extern s16 D_800DFA2C[8]; +extern s16 gOptionMenuTextures[8]; extern unk800DFA3C gAudioMenuStrings[8]; @@ -613,7 +614,7 @@ extern s32 gViewingCreditsFromCheat; extern MenuElement D_800E1B50[9]; -//extern u32 D_800E1C70[24]; +//extern u32 dMenuHudSettings[24]; extern s8 D_800E1CD0[32]; @@ -669,7 +670,7 @@ void func_800828B8(void); void print_missing_controller_text(Gfx *dl, s32 updateRate); void menu_logos_screen_init(void); s32 menu_logo_screen_loop(s32 arg0); -void func_80082FAC(void); +void init_title_screen_variables(void); void menu_title_screen_init(void); void func_80084118(void); void menu_options_init(void); @@ -699,10 +700,10 @@ void draw_character_select_text(s32 arg0); void func_8008BFE8(s32 arg0, s8 *arg1, s32 arg2, u16 arg3, u16 arg4); void func_8008C128(void); void menu_caution_init(void); -void func_8008C4E8(void); +void unload_large_font(void); void func_8008CACC(void); void menu_file_select_init(void); -void func_8008CC28(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); +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 func_8008E4B0(void); @@ -758,20 +759,20 @@ void func_8009C49C(void); void func_8009C4A8(s16 *arg0); void func_8009C508(s32 arg0); void func_8009C674(s16 *arg0); -void func_8009C8A4(s16 *arg0); -void func_8009C904(s32 arg0); +void allocate_menu_images(s16 *imageSet); +void allocate_and_set_menu_image_properties(s32 imageID); void func_8009CA58(void); void func_8009CF68(s32 arg0); void func_8009CFB0(void); s32 func_8009CFEC(u32 arg0); void set_option_text_colour(s32 condition); void render_dialogue_option(char *text, s32 yOffset, s32 optionID); -void func_8009D26C(void); +void handle_menu_joystick_input(void); void func_8009D324(void); void func_8009D330(s32 arg0); -void func_8009D33C(s32 arg0, s32 arg1); +void set_menu_id_if_option_equal(s32 IDToCheck, s32 IDToSet); s32 taj_menu_loop(void); -s32 func_8009D9F4(void); +s32 dialogue_race_defeat(void); s32 trophy_race_cabinet_menu_loop(void); void dialogue_open_stub(void); void dialogue_close_stub(void); diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 253c8826..ac3acc6d 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -585,7 +585,7 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, s32 vehicleId, init_pulsating_light_data(gCurrentLevelHeader->pulseLightData); } update_camera_fov(gCurrentLevelHeader->cameraFOV); - func_80077B34(gCurrentLevelHeader->bgColorRed, gCurrentLevelHeader->bgColorGreen, gCurrentLevelHeader->bgColorBlue); + set_background_prim_colour(gCurrentLevelHeader->bgColorRed, gCurrentLevelHeader->bgColorGreen, gCurrentLevelHeader->bgColorBlue); func_8007A974(); func_8007AB24(gCurrentLevelHeader->unk4[numberOfPlayers]); } @@ -656,7 +656,7 @@ u8 *func_8006BDDC(s32 arg0) { void func_8006BEFC(void) { func_8006C164(); - func_80077B34(0, 0, 0); + set_background_prim_colour(0, 0, 0); free_from_memory_pool(gCurrentLevelHeader); func_800049D8(); func_80001844(); @@ -1964,8 +1964,8 @@ void func_8006F338(s32 arg0) { } } -void func_8006F388(u8 arg0) { - D_800DD398 = arg0; +void func_8006F388(u8 time) { + D_800DD398 = time; } void func_8006F398(void) { diff --git a/src/unknown_078050.c b/src/unknown_078050.c index 9387e3fb..2ea9dc83 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -14,10 +14,10 @@ s16 D_800DE490[16] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -u8 D_800DE4B0 = 0; -u8 D_800DE4B4 = 0; -u8 D_800DE4B8 = 0; -s32 D_800DE4BC = 0x00010001; +u8 sBackgroundPrimColourR = 0; +u8 sBackgroundPrimColourG = 0; +u8 sBackgroundPrimColourB = 0; +s32 sBackgroundFillColour = 0x00010001; u32 D_800DE4C0 = 0x40; u32 D_800DE4C4 = 0; @@ -189,25 +189,31 @@ void func_80077AAC(void *bufPtr, s32 arg1, s32 arg2) { while (osDpGetStatus() & DPC_CLR_CMD_CTR) {} } -//Probable red, green, blue -void func_80077B34(u8 arg0, u8 arg1, u8 arg2) { - D_800DE4B0 = arg0; - D_800DE4B4 = arg1; - D_800DE4B8 = arg2; +/** + * Sets the primitive colour for the cyclemode fillrect background. + */ +void set_background_prim_colour(u8 red, u8 green, u8 blue) { + sBackgroundPrimColourR = red; + sBackgroundPrimColourG = green; + sBackgroundPrimColourB = blue; } -void func_80077B5C(s32 red, s32 green, s32 blue) { - D_800DE4BC = ((red << 8) & 0xF800) | ((green * 8) & 0x7C0) | ((blue >> 2) & 0x3E) | 1; - D_800DE4BC |= (D_800DE4BC << 0x10); +/** + * Sets the fill colour for the fillmode fillrect background. + * Uses RGBA5551 + */ +void set_background_fill_colour(s32 red, s32 green, s32 blue) { + sBackgroundFillColour = ((red << 8) & 0xF800) | ((green * 8) & 0x7C0) | ((blue >> 2) & 0x3E) | 1; + sBackgroundFillColour |= (sBackgroundFillColour << 16); } #ifdef NON_MATCHING // Stack issues void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { - s32 sp90; - s32 sp8C; - s32 sp88; - s32 sp84; + s32 x1; + s32 y1; + s32 x2; + s32 y2; s32 widthAndHeight; s32 w, h; s32 rgba16Color; @@ -233,15 +239,15 @@ void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { } else if (D_800DE4D0.ptr != NULL) { D_800DE4D0.function(dlist, arg1); } else { - gDPSetFillColor((*dlist)++, D_800DE4BC); + gDPSetFillColor((*dlist)++, sBackgroundFillColour); gDPFillRectangle((*dlist)++, 0, 0, w - 1, h - 1); } - if (func_80066BA8(0, &sp90, &sp8C, &sp88, &sp84)) { + if (copy_viewport_background_size_to_coords(0, &x1, &y1, &x2, &y2)) { gDPSetCycleType((*dlist)++, G_CYC_1CYCLE); - gDPSetPrimColor((*dlist)++, 0, 0, D_800DE4B0, D_800DE4B4, D_800DE4B8, 0xFF); + gDPSetPrimColor((*dlist)++, 0, 0, sBackgroundPrimColourR, sBackgroundPrimColourG, sBackgroundPrimColourB, 0xFF); gDPSetCombineMode((*dlist)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetRenderMode((*dlist)++, G_RM_OPA_SURF, G_RM_OPA_SURF2); - gDPFillRectangle((*dlist)++, sp90, sp8C, sp88, sp84); + gDPFillRectangle((*dlist)++, x1, y1, x2, y2); } } else { if (D_800DE4CC) { @@ -252,7 +258,7 @@ void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { D_800DE4D0.function(dlist, arg1); } else { //Also has an issue here. - rgba16Color = ((D_800DE4B0 << 8) & 0xF800) | ((D_800DE4B4 * 8) & 0x7C0) | ((D_800DE4B8 >> 2) & 0x3E) | 1; + rgba16Color = ((sBackgroundPrimColourR << 8) & 0xF800) | ((sBackgroundPrimColourG * 8) & 0x7C0) | ((sBackgroundPrimColourB >> 2) & 0x3E) | 1; rgba16Color |= rgba16Color << 0x10; gDPSetFillColor((*dlist)++, rgba16Color); gDPFillRectangle((*dlist)++, 0, 0, w - 1, h - 1); @@ -266,6 +272,10 @@ void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { 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. + */ void init_rdp_and_framebuffer(Gfx **dlist) { s32 width = get_video_width_and_height_as_s32() & 0xFFF; gDPSetColorImage((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, 0x01000000); @@ -273,6 +283,9 @@ void init_rdp_and_framebuffer(Gfx **dlist) { gSPDisplayList((*dlist)++, dRdpInit); } +/** + * Calls the draw command that sets all the OtherModes, ready for use. + */ void init_rsp(Gfx **dlist) { gSPDisplayList((*dlist)++, dRspInit); } diff --git a/src/unknown_078050.h b/src/unknown_078050.h index 30b8af57..c8e8c053 100644 --- a/src/unknown_078050.h +++ b/src/unknown_078050.h @@ -14,10 +14,10 @@ typedef union { extern s16 D_800DE490[16]; -extern u8 D_800DE4B0; -extern u8 D_800DE4B4; -extern u8 D_800DE4B8; -extern s32 D_800DE4BC; +extern u8 sBackgroundPrimColourR; +extern u8 sBackgroundPrimColourG; +extern u8 sBackgroundPrimColourB; +extern s32 sBackgroundFillColour; extern u32 D_800DE4C0; extern u32 D_800DE4C4; @@ -30,8 +30,8 @@ extern s32 D_800DE4DC; s32 func_80077A54(void); void func_80077AAC(void *bufPtr, s32 arg1, s32 arg2); -void func_80077B34(u8 arg0, u8 arg1, u8 arg2); -void func_80077B5C(s32 red, s32 green, s32 blue); +void 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); From de6ca6bf50d1fb3063eb7a4273976eb45ec32b2f Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 12 Apr 2022 23:54:22 -0700 Subject: [PATCH 03/11] Refactor Object_64. --- include/structs.h | 638 ++++++++++++++++++++++++++++++++++------- src/game_ui.c | 4 +- src/object_functions.c | 274 ++++++++---------- src/object_functions.h | 300 +------------------ src/objects.c | 34 +-- src/racer.c | 84 ++---- 6 files changed, 693 insertions(+), 641 deletions(-) diff --git a/include/structs.h b/include/structs.h index e06375d3..f5640a21 100644 --- a/include/structs.h +++ b/include/structs.h @@ -575,10 +575,9 @@ typedef struct Object_60 { void *unk4; // Object* pointer } Object_60; -// This REALLY needs to be refactored at some point. -// This structure differs based on the type of object being loaded. -// See functions in object_functions.c for how these get loaded. -typedef struct Object_64 { +struct Object; + +typedef struct Object_Original { union { f32 unk0; struct { @@ -653,6 +652,435 @@ typedef struct Object_64 { u8 unk1F3; u8 pad1F4[3]; u8 unk1F7; // Used in func_8002A900 +} Object_Original; + +// from object_functions.c + +typedef struct Object_80034860 { + s16 unk0; + u8 unk4[0x185]; + s8 unk187; +} Object_80034860; + +typedef struct Object_80034E9C { + s32 unk0; + s16 unk4; +} Object_80034E9C; + +typedef struct Object_Animator { + /* 0x00 */ s16 segmentId; + /* 0x02 */ s16 batchId; + /* 0x04 */ s16 xSpeedFactor; + /* 0x06 */ s16 ySpeedFactor; + /* 0x08 */ s16 xSpeed; + /* 0x0A */ s16 ySpeed; +} Object_Animator; + +typedef struct Object_8003DFCC { + f32 unk0; + s16 unk4; + s8 unk6[0x2]; +} Object_8003DFCC; + +typedef struct Object_Butterfly { + /* 0x00 */ Triangle triangles[8]; + /* 0x80 */ Vertex vertices[12]; + /* 0xF8 */ TextureHeader *texture; + /* 0xFC */ u8 unkFC; + /* 0xFD */ u8 unkFD; + /* 0xFE */ u8 unkFE; + /* 0xFF */ u8 unkFF; + /* 0x100 */ s32 unk100; + /* 0x104 */ s16 unk104; + /* 0x106 */ s16 unk106; + /* 0x108 */ f32 unk108; +} Object_Butterfly; + +// from object_functions.h + +typedef struct Object_80034B74 { + u8 pad0[0x1FE]; + u8 unk1FE; + u8 unk1FF; +} Object_80034B74; + +typedef struct Object_8003564C { + u8 pad0[4]; + struct Object *unk4; +} Object_8003564C; + +typedef struct Object_80035E34 { + u8 pad0[0x1D6]; + s8 unk1D6; +} Object_80035E34; + +typedef struct Object_80035F6C { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; + s16 *unk20; + u8 *unk24; +} Object_80035F6C; + +typedef struct Object_80035F6C_2 { + u8 pad0[3]; + s8 unk3; +} Object_80035F6C_2; + +typedef struct Object_800376E0 { + s16 segmentId; + s16 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; +} Object_800376E0; + +typedef struct Object_Snowball { + u8 pad0[0x20]; + u32 unk20; + s16 unk24; + u8 pad28[0x12]; + s8 unk38; +} Object_Snowball; + +typedef struct Object_80038710 { + u8 pad0[0x30]; + s8 unk30; + u8 pad31[0x13]; + s8 unk44; +} Object_80038710; + +typedef struct Object_800387CC { + u8 pad0[0x148]; + struct Object *unk148; +} Object_800387CC; + +typedef struct Object_800388D4 { + s16 unk0; +} Object_800388D4; + +typedef struct Object_80038E3C { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + s32 unk10; + s8 unk14; +} Object_80038E3C; + +typedef struct Object_8003C1E0 { + f32 unk0; + u8 pad4[4]; + s32 unk8; + u8 padC[3]; + s8 unkF; + u8 pad10[2]; + u8 unk12; + u8 unk13; +} Object_8003C1E0; + +typedef struct Object_8003DF08 { + s16 unk0; +} Object_8003DF08; + +typedef struct Object_8003FEF4 { + u8 unk0; + u8 pad1; + u16 unk2; + u16 unk4; + u16 unk6; + union { + struct { + u8 unk8; + u8 unk9; + u8 unkA; + u8 padB; + } unk_struct; + s32 unk8_word; + } unk_union; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + u8 unk10; + u8 unk11; + u8 unk12; +} Object_8003FEF4; + +typedef struct Object_8004001C { + u16 pad0; + s16 unk2; + u8 unk4; + u8 unk5; +} Object_8004001C; + +typedef struct Object_800400A4 { + s16 unk0; + s16 pad2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; +} Object_800400A4; + +typedef struct Object_80042210 { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + u8 unk14; + u8 unk15; + u8 pad16[3]; + u8 unk19; + u8 pad1A[6]; + f32 unk20; + f32 unk24; + u8 pad28[8]; + f32 unk30; +} Object_80042210; + +typedef struct Object_Wizpig2 { + u8 pad0[0x70]; + u8 unk70; + u8 pad71; + u8 unk72; + u8 pad73; + f32 unk74; +} Object_Wizpig2; + +typedef struct Object_Exit { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + s32 unk10; + s8 unk14; +} Object_Exit; + +typedef struct Object_Racer { + s16 unk0; + u8 pad2; + s8 unk3; + u8 pad4[0x104]; + s32 unk108; + u8 pad10C[0x40]; + struct Object *unk14C; + u8 pad150[0x33]; + s8 unk183; + s8 pad184; + s8 unk185; + u8 pad186[0x4D]; + s8 unk1D3; + u8 pad1D4[0x4]; + s8 unk1D8; + u8 pad1D9[0x9]; + s8 unk1E2; + u8 pad1E3[0x12]; + u8 unk1F5; + u8 pad1F6[0xA]; + s8 unk200; + u8 pad201[0x2]; + s8 unk203; + u8 pad204[0x8]; + u8 unk20C; +} Object_Racer; + +typedef struct Object_Bonus { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + s32 unk10; + s8 unk14; +} Object_Bonus; + +typedef struct Object_ModeChange { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + s32 unk10; + s8 unk14; +} Object_ModeChange; + +typedef struct Object_GoldenBalloon { + f32 unk0; + u8 pad4[0x8]; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + s8 unk10; + f32 unk14; +} Object_GoldenBalloon; + +typedef struct Object_Door { + f32 unk0; + u8 pad4[0x4]; + s32 unk8; + s16 padA; + s8 unkE; + u8 unkF; + u8 unk10; + u8 unk11; + u8 unk12; + u8 unk13; + u8 unk14; +} Object_Door; + +typedef struct Object_Trigger { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + s32 unk10; + s8 unk14; +} Object_Trigger; + +typedef struct Object_Audio { + /* 0x00 */ u16 unk0; + /* 0x02 */ u16 unk2; + /* 0x04 */ u8 unk4; + /* 0x05 */ u8 unk5; + /* 0x06 */ u8 unk6; + /* 0x07 */ u8 unk7; + /* 0x08 */ s32 unk8; + /* 0x0C */ u8 unkC; + /* 0x0D */ u8 unkD; +} Object_Audio; + +typedef struct Object_MidiFade { + u8 unk0; + u8 unk1; + u8 unk2; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24; + f32 unk28; + f32 unk2C; + u8 unk2F[16]; + u8 unk40; +} Object_MidiFade; + +typedef struct Object_MidiFadePoint { + u16 unk0; + u16 unk2; + f32 unk4; + f32 unk8; + u8 unkC[16]; + u8 unk1C; +} Object_MidiFadePoint; + +typedef struct Object_PosArrow { + s16 unk0; + u8 pad4[0x14E]; + struct Object *unk150; +} Object_PosArrow; + +typedef struct Object_Banana { + u8 pad0[4]; + struct Object *spawner; +} Object_Banana; + +// from racer.c + +typedef struct Object_80044170 { + char unk0[0x2C]; + f32 unk2C; + char unk30[0x124]; + s32 unk154; + char unk158[0x72]; + s8 unk1CA; + char unk1CB[0x3]; + u8 unk1CE; + char unk1CF[0x13]; + s8 unk1E2; + char unk1E3[0x30]; + s8 unk213; + s8 unk214; + s8 unk215; +} Object_80044170; + +typedef struct Object_80050754 { + u8 unk0[0x2C]; + f32 unk2C; + f32 unk30; + u8 unk34[0x114]; + /* 0x148 */ struct Object *someObj; + u8 unk14C[0x54]; + /* 0x1A0 */ s16 unk1A0; + /* 0x1A2 */ s16 unk1A2; + /* 0x1A4 */ s16 unk1A4; + u8 unk1A6[0x4C]; + /* 0x1F2 */ s8 unk1F2; +} Object_80050754; + +typedef struct Object_800570B8 { + u8 pad0[3]; + s8 unk3; + u8 pad4[0x20]; + s32 unk24; + u16 unk28; + u16 unk2A; + u8 pad2C[0xDC]; + s32 unk108; +} Object_800570B8; + +typedef struct Object_64 { + union { + Object_Original original; + Object_80034860 obj80034860; + Object_80034E9C obj80034E9C; + Object_Animator animator; + Object_8003DFCC obj8003DFCC; + Object_Butterfly butterfly; + Object_80034B74 obj80034B74; + Object_8003564C obj8003564C; + Object_80035E34 obj80035E34; + Object_80035F6C obj80035F6C; + Object_80035F6C_2 obj80035F6C_2; + Object_800376E0 obj800376E0; + Object_Snowball snowball; + Object_80038710 obj80038710; + Object_800387CC obj800387CC; + Object_800388D4 obj800388D4; + Object_80038E3C obj80038E3C; + Object_8003C1E0 obj8003C1E0; + Object_8003DF08 obj8003DF08; + Object_8003FEF4 obj8003FEF4; + Object_8004001C obj8004001C; + Object_800400A4 obj800400A4; + Object_80042210 obj80042210; + Object_Wizpig2 wizpig2; + Object_Exit exit; + Object_Racer racer; + Object_Bonus bonus; + Object_ModeChange mode_change; + Object_GoldenBalloon golden_balloon; + Object_Door door; + Object_Trigger trigger; + Object_Audio audio; + Object_MidiFade midi_fade; + Object_MidiFadePoint midi_fade_point; + Object_PosArrow pos_arrow; + Object_Banana banana; + Object_80044170 obj80044170; + Object_80050754 obj80050754; + Object_800570B8 obj800570B8; + }; } Object_64; typedef struct Object_68 { @@ -764,129 +1192,133 @@ typedef struct Object { /* 0x0090 */ u32 unk90; /* 0x0094 */ u32 unk94; - /* 0x0098 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled - /* 0x009A */ u8 unk9A; - /* 0x009B */ u8 characterId; // Affects minimap color, horn, voice, etc. + /* 0x0098 */ Object_64 obj; + + //------------------------------ REMOVE BEGIN ------------------------------ +// /* 0x0098 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled +// /* 0x009A */ u8 unk9A; +// /* 0x009B */ u8 characterId; // Affects minimap color, horn, voice, etc. - /* 0x009C */ u32 unk9C; +// /* 0x009C */ u32 unk9C; - /* 0x00A0 */ f32 unkA0; +// /* 0x00A0 */ f32 unkA0; - /* 0x00A4 */ u32 unkA4; - /* 0x00A8 */ u32 unkA8; - /* 0x00AC */ u32 unkAC; - /* 0x00B0 */ u32 unkB0; - /* 0x00B4 */ u32 unkB4; - /* 0x00B8 */ u32 unkB8; - /* 0x00BC */ u32 unkBC; - /* 0x00C0 */ u32 unkc0; +// /* 0x00A4 */ u32 unkA4; +// /* 0x00A8 */ u32 unkA8; +// /* 0x00AC */ u32 unkAC; +// /* 0x00B0 */ u32 unkB0; +// /* 0x00B4 */ u32 unkB4; +// /* 0x00B8 */ u32 unkB8; +// /* 0x00BC */ u32 unkBC; +// /* 0x00C0 */ u32 unkc0; - /* 0x00C4 */ f32 velocity; - /* 0x00C8 */ f32 lateral_velocity; +// /* 0x00C4 */ f32 velocity; +// /* 0x00C8 */ f32 lateral_velocity; - u32 unkCC[10]; // Not an array. Unknown values. +// u32 unkCC[10]; // Not an array. Unknown values. - /* 0x00F4 */ f32 prev_x_position; - /* 0x00F8 */ f32 prev_y_position; - /* 0x00FC */ f32 prev_z_position; +// /* 0x00F4 */ f32 prev_x_position; +// /* 0x00F8 */ f32 prev_y_position; +// /* 0x00FC */ f32 prev_z_position; - /* 0x0100 */ u32 unk100; - /* 0x0104 */ u32 unk104; - /* 0x0108 */ u32 unk108; - /* 0x010C */ u32 unk10C; +// /* 0x0100 */ u32 unk100; +// /* 0x0104 */ u32 unk104; +// /* 0x0108 */ u32 unk108; +// /* 0x010C */ u32 unk10C; - /* 0x0110 */ f32 unk110; - /* 0x0114 */ f32 unk114; - /* 0x0118 */ f32 unk118; - /* 0x011C */ f32 unk11C; - /* 0x0120 */ u32 unk120; - /* 0x0124 */ f32 stretch_height; - /* 0x0128 */ f32 stretch_height_cap; - /* 0x012C */ f32 camera_zoom; - /* 0x0130 */ u32 unk130; - /* 0x0134 */ f32 pitch; - /* 0x0138 */ u32 unk138; - /* 0x013C */ u32 unk13C; - /* 0x0140 */ f32 checkpoint_distance; - /* 0x0144 */ u32 unk144; - /* 0x0148 */ f32 unk148; - /* 0x014C */ f32 throttle; - /* 0x0150 */ f32 brake; - /* 0x0154 */ u32 unk154; - /* 0x0158 */ u32 unk158; - /* 0x015C */ u32 unk15C; - /* 0x0160 */ f32 unk160; - /* 0x0164 */ u32 unk164; - /* 0x0168 */ u32 unk168; - /* 0x016C */ u32 unk16C; - /* 0x0170 */ f32 unk170; - /* 0x0174 */ f32 unk174; - /* 0x0178 */ f32 unk178; - /* 0x017C */ f32 unk17C; - /* 0x0180 */ f32 unk180; - /* 0x0184 */ f32 unk184; - /* 0x0188 */ f32 unk188; - /* 0x018C */ f32 unk18C; - /* 0x0190 */ f32 unk190; - /* 0x0194 */ f32 unk194; - /* 0x0198 */ f32 unk198; - /* 0x019C */ f32 unk19C; +// /* 0x0110 */ f32 unk110; +// /* 0x0114 */ f32 unk114; +// /* 0x0118 */ f32 unk118; +// /* 0x011C */ f32 unk11C; +// /* 0x0120 */ u32 unk120; +// /* 0x0124 */ f32 stretch_height; +// /* 0x0128 */ f32 stretch_height_cap; +// /* 0x012C */ f32 camera_zoom; +// /* 0x0130 */ u32 unk130; +// /* 0x0134 */ f32 pitch; +// /* 0x0138 */ u32 unk138; +// /* 0x013C */ u32 unk13C; +// /* 0x0140 */ f32 checkpoint_distance; +// /* 0x0144 */ u32 unk144; +// /* 0x0148 */ f32 unk148; +// /* 0x014C */ f32 throttle; +// /* 0x0150 */ f32 brake; +// /* 0x0154 */ u32 unk154; +// /* 0x0158 */ u32 unk158; +// /* 0x015C */ u32 unk15C; +// /* 0x0160 */ f32 unk160; +// /* 0x0164 */ u32 unk164; +// /* 0x0168 */ u32 unk168; +// /* 0x016C */ u32 unk16C; +// /* 0x0170 */ f32 unk170; +// /* 0x0174 */ f32 unk174; +// /* 0x0178 */ f32 unk178; +// /* 0x017C */ f32 unk17C; +// /* 0x0180 */ f32 unk180; +// /* 0x0184 */ f32 unk184; +// /* 0x0188 */ f32 unk188; +// /* 0x018C */ f32 unk18C; +// /* 0x0190 */ f32 unk190; +// /* 0x0194 */ f32 unk194; +// /* 0x0198 */ f32 unk198; +// /* 0x019C */ f32 unk19C; - u32 unk1A0[8]; // Not an array. Unknown values. +// u32 unk1A0[8]; // Not an array. Unknown values. - /* 0x01C0 */ u32 lap_times[3]; +// /* 0x01C0 */ u32 lap_times[3]; - /* 0x01CC */ u32 unk1CC; - /* 0x01D0 */ u32 unk1D0; - /* 0x01D4 */ u32 unk1D4; - /* 0x01D8 */ u32 unk1D8; +// /* 0x01CC */ u32 unk1CC; +// /* 0x01D0 */ u32 unk1D0; +// /* 0x01D4 */ u32 unk1D4; +// /* 0x01D8 */ u32 unk1D8; - /* 0x01DC */ void *held_obj_ptr; +// /* 0x01DC */ void *held_obj_ptr; - u32 unk1E0[10]; // Not an array. Unknown values. +// u32 unk1E0[10]; // Not an array. Unknown values. - /* 0x0208 */ u16 unk208; - /* 0x020A */ u8 balloon_type; - /* 0x020B */ u8 balloon_quantity; - /* 0x020C */ u8 balloon_level; +// /* 0x0208 */ u16 unk208; +// /* 0x020A */ u8 balloon_type; +// /* 0x020B */ u8 balloon_quantity; +// /* 0x020C */ u8 balloon_level; - /* 0x020D */ u8 unk20D; - /* 0x020E */ u8 unk20E; - /* 0x020F */ u8 unk20F; - /* 0x0210 */ u32 unk210; - /* 0x0214 */ u32 unk214; - /* 0x0218 */ u32 unk218; - /* 0x021A */ u16 unk21A; - /* 0x021B */ u8 unk21B; +// /* 0x020D */ u8 unk20D; +// /* 0x020E */ u8 unk20E; +// /* 0x020F */ u8 unk20F; +// /* 0x0210 */ u32 unk210; +// /* 0x0214 */ u32 unk214; +// /* 0x0218 */ u32 unk218; +// /* 0x021A */ u16 unk21A; +// /* 0x021B */ u8 unk21B; - /* 0x021D */ s8 bananas; - /* 0x021E */ u8 unk21E; +// /* 0x021D */ s8 bananas; +// /* 0x021E */ u8 unk21E; - /* 0x0270 */ u8 unk270; - /* 0x0271 */ u8 unk271; - /* 0x0272 */ u8 unk272; +// /* 0x0270 */ u8 unk270; +// /* 0x0271 */ u8 unk271; +// /* 0x0272 */ u8 unk272; - /* 0x0273 */ u8 spinout_timer; - /* 0x0274 */ u8 wheel_surfaces[4]; +// /* 0x0273 */ u8 spinout_timer; +// /* 0x0274 */ u8 wheel_surfaces[4]; - /* 0x0278 */ u32 unk278; - /* 0x027C */ u16 unk27C; +// /* 0x0278 */ u32 unk278; +// /* 0x027C */ u16 unk27C; - /* 0x027E */ u8 drift_direction; - /* 0x027F */ u8 unk27F; +// /* 0x027E */ u8 drift_direction; +// /* 0x027F */ u8 unk27F; - /* 0x0280 */ u32 unk280; - /* 0x0284 */ u8 unk284; +// /* 0x0280 */ u32 unk280; +// /* 0x0284 */ u8 unk284; - /* 0x0285 */ s8 squish_timer; - /* 0x0286 */ u8 unk286; - /* 0x0287 */ u8 boost_sound; - /* 0x0288 */ u32 unk288; +// /* 0x0285 */ s8 squish_timer; +// /* 0x0286 */ u8 unk286; +// /* 0x0287 */ u8 boost_sound; +// /* 0x0288 */ u32 unk288; - /* 0x028C */ u16 unk28C; - /* 0x028E */ u8 unk28E; +// /* 0x028C */ u16 unk28C; +// /* 0x028E */ u8 unk28E; - /* 0x028F */ u8 transparency; +// /* 0x028F */ u8 transparency; + //------------------------------ REMOVE END ------------------------------ /* 0x0290 */ u8 indicator_type; /* 0x0291 */ s8 indicator_timer; /* 0x0292 */ u16 unk292; diff --git a/src/game_ui.c b/src/game_ui.c index fc007c0c..a5be8017 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -285,7 +285,7 @@ void func_800A0DC0(s32 arg0, Object *arg1, s32 arg2) { func_800A4C44(temp, arg2); func_800A3884(arg1, arg2); - if (D_80127188 != 0 && temp->unk1D8 == 0) { + if (D_80127188 != 0 && temp->original.unk1D8 == 0) { func_800A47A0(temp, arg2); } @@ -298,7 +298,7 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A1248.s") void func_800A1428(s32 arg0, Object *arg1, s32 arg2) { Object_64 *temp = arg1->unk64; - if (temp->unk1D8 == 0) { + if (temp->original.unk1D8 == 0) { func_80068508(1); func_800A3CE4(arg0, arg2); func_800A7520(arg1, arg2); diff --git a/src/object_functions.c b/src/object_functions.c index 047d74f5..01d223d9 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -341,11 +341,11 @@ void obj_init_lasergun(Object *obj, LevelObjectEntry_Lasergun *entry) { obj->unk4C->unk14 = 0x22; obj->unk4C->unk11 = 0; obj64 = obj->unk64; - obj64->unkE = entry->unkA; - obj64->unkF = entry->unkB; - obj64->unk10 = entry->unkC; - obj64->unk11 = entry->unkD; - obj64->unkCD.half = obj64->unkF; + obj64->original.unkE = entry->unkA; + obj64->original.unkF = entry->unkB; + obj64->original.unk10 = entry->unkC; + obj64->original.unk11 = entry->unkD; + obj64->original.unkCD.half = obj64->original.unkF; obj->segment.trans.y_rotation = entry->unk8 << 4 << 4; // Not sure about the shift amounts here, but it obj->segment.trans.x_rotation = entry->unk9 << 4 << 4; // just needs to be 2 left shifts that add up to 8. } @@ -366,19 +366,13 @@ typedef struct Object_7C_80034860 { s16 unkC; } Object_7C_80034860; -typedef struct Object_64_80034860 { - s16 unk0; - u8 unk4[0x185]; - s8 unk187; -} Object_64_80034860; - void obj_loop_laserbolt(Object *obj, s32 speed) { f32 sp5C; Object *obj4C_obj; Object_7C_80034860 *obj7C; - Object_64_80034860 *obj4C_obj64; + Object_80034860 *obj4C_obj64; s8 sp4F; // Boolean s8 sp4E; @@ -422,7 +416,7 @@ void obj_loop_laserbolt(Object *obj, s32 speed) { if (obj->unk4C->unk13 < 80) { obj4C_obj = (Object*)obj->unk4C->unk0; if (obj4C_obj && (obj4C_obj->behaviorId == 1)) { - obj4C_obj64 = obj4C_obj->unk64; + obj4C_obj64 = &obj4C_obj->unk64->obj80034860; sp4F = TRUE; if (obj4C_obj64->unk0 != -1) { obj4C_obj64->unk187 = 1; @@ -468,7 +462,7 @@ Object **get_object_struct_array(s32 *count); void obj_loop_effectbox(Object *obj, s32 speed) { Object **objList; Object_3C_80034B74 *obj3C; - Object_64_80034B74 *curObj64; + Object_80034B74 *curObj64; s32 i; s32 numberOfObjects; f32 xDiff; @@ -553,11 +547,6 @@ void play_sound(u8 arg0); void set_music_fade_timer(s32 time); void set_sndfx_player_voice_limit(u8 voiceLimit); -typedef struct Object_64_80034E9C { - s32 unk0; - s16 unk4; -} Object_64_80034E9C; - typedef struct Object_54_80034E9C { u8 pad0[0x28]; f32 unk28; @@ -573,7 +562,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { unk80027FC4 sp44; Settings *settings; LevelHeader *curLevelHeader; - Object_64_80034E9C *obj64; + Object_80034E9C *obj64; Object *trophyObj; Object *playerObj; f32 xDiff; @@ -582,7 +571,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { settings = get_settings(); curLevelHeader = get_current_level_header(); - obj64 = obj->unk64; + obj64 = &obj->unk64->obj80034E9C; // Show trophy inside the cabinet if (obj->unk7C.word == 0) { @@ -720,7 +709,7 @@ void obj_loop_eggcreator(Object *obj, UNUSED s32 speed) { sp20.unk0 = 0x34; someObj = spawn_object(&sp20, 1); if (someObj != NULL) { - Object_64_8003564C *someObj64 = someObj->unk64; + Object_8003564C *someObj64 = &someObj->unk64->obj8003564C; someObj64->unk4 = obj; obj->unk78 = someObj; someObj->segment.unk3C_a.unk3C = 0; @@ -791,7 +780,7 @@ void obj_init_airzippers_waterzippers(Object *obj, LevelObjectEntry_AirZippers_W void obj_loop_airzippers_waterzippers(Object *obj, UNUSED s32 speed) { Object *curRacerObj; - Object_64_Racer *racerObj64; + Object_Racer *racerObj64; f32 xDiff; f32 yDiff; f32 zDiff; @@ -808,7 +797,7 @@ void obj_loop_airzippers_waterzippers(Object *obj, UNUSED s32 speed) { racerObjs = get_object_struct_array(&numObjects); for (i = 0; i < numObjects; i++) { curRacerObj = racerObjs[i]; - racerObj64 = (Object_64_Racer*)curRacerObj->unk64; + racerObj64 = &curRacerObj->unk64->racer; if ((racerObj64->unk1F5 == 0) && (racerObj64->unk1D3 < 15)) { xDiff = curRacerObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = curRacerObj->segment.trans.y_position - obj->segment.trans.y_position; @@ -858,7 +847,7 @@ void obj_init_groundzipper(Object *arg0, LevelObjectEntry_GroundZipper *entry) { void obj_loop_groundzipper(Object *obj, UNUSED s32 speed) { Object *curRacerObj; - Object_64_Racer *racerObj64; + Object_Racer *racerObj64; f32 xDiff; f32 yDiff; s32 numObjects; @@ -873,7 +862,7 @@ void obj_loop_groundzipper(Object *obj, UNUSED s32 speed) { racerObjs = get_object_struct_array(&numObjects); for (i = 0; i < numObjects; i++) { curRacerObj = racerObjs[i]; - racerObj64 = (Object_64_Racer*)curRacerObj->unk64; + racerObj64 = &curRacerObj->unk64->racer; if ((racerObj64->unk1D3 < 15) && (racerObj64->unk1E2 != 0)) { xDiff = curRacerObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = curRacerObj->segment.trans.y_position - obj->segment.trans.y_position; @@ -904,7 +893,7 @@ void obj_init_unknown58(Object *obj, LevelObjectEntry_Unknown58 *entry) { void obj_loop_unknown58(Object *obj, s32 speed) { Object *someObj; Object *someOtherObj; - Object_64_80035E34 *someOtherObj64; + Object_80035E34 *someOtherObj64; Object_60 *obj60; obj->segment.unk3B = 0; @@ -915,7 +904,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) { set_ghost_position_and_rotation(obj); func_800AFC3C(obj, speed); someOtherObj = get_object_struct(0); - someOtherObj64 = someOtherObj->unk64; + someOtherObj64 = &someOtherObj->unk64->obj80035E34; obj60 = obj->unk60; if (obj60->unk0 == 1) { s8 temp = someOtherObj64->unk1D6; @@ -945,14 +934,14 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { s32 temp_t4; s32 temp_t5; Object *someObj; - Object_64_80035F6C *obj64; - Object_64_80035F6C_2 *someObj64; + Object_80035F6C *obj64; + Object_80035F6C_2 *someObj64; if (obj->unk7C.word < 0) { someObj = get_object_struct(obj->unk78); if (someObj != NULL) { - obj64 = obj->unk64; - someObj64 = someObj->unk64; + obj64 = &obj->unk64->obj80035F6C; + someObj64 = &someObj->unk64->obj80035F6C_2; obj->unk7C.word = someObj64->unk3; if (obj->unk7C.word < 0 || obj->unk7C.word >= 0xA) { obj->unk7C.word = 0; @@ -982,8 +971,8 @@ void obj_init_stopwatchman(Object *obj, UNUSED LevelObjectEntry_StopWatchMan *en obj->unk4C->unk10 = 0x1E; obj->unk4C->unk12 = 0; temp = obj->unk64; - temp->unkCD.bytes.byteD = 0xFF; - temp->unk0_a.unk0 = 0.0f; + temp->original.unkCD.bytes.byteD = 0xFF; + temp->original.unk0_a.unk0 = 0.0f; D_8011D4D8 = 0; } @@ -1026,7 +1015,7 @@ void obj_init_posarrow(Object *obj, UNUSED LevelObjectEntry_PosArrow *entry) { } void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { - Object_64_PosArrow *someObj64; + Object_PosArrow *someObj64; Object **someObjList; Object *someObj; s32 numberOfObjects; @@ -1035,7 +1024,7 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { someObjList = func_8001BAAC(&numberOfObjects); if (obj->unk78 < numberOfObjects) { someObj = someObjList[obj->unk78]; - someObj64 = someObj->unk64; + someObj64 = &someObj->unk64->pos_arrow; if (someObj64->unk0 == -1) { obj->segment.trans.unk6 &= ~0x4000; someObj64->unk150 = obj; @@ -1045,11 +1034,11 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { } void obj_init_animator(Object *obj, LevelObjectEntry_Animator *entry, s32 arg2) { - Object_64_800376E0 *obj64; + Object_800376E0 *obj64; LevelModel *levelModel; s16 segmentBatchCount; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj800376E0; levelModel = func_8002C7C4(); obj64->unk2 = entry->unk8; obj64->unk4 = entry->unk9; @@ -1073,21 +1062,12 @@ void obj_init_animator(Object *obj, LevelObjectEntry_Animator *entry, s32 arg2) #ifdef NON_EQUIVALENT -typedef struct Object_64_Animator { - /* 0x00 */ s16 segmentId; - /* 0x02 */ s16 batchId; - /* 0x04 */ s16 xSpeedFactor; - /* 0x06 */ s16 ySpeedFactor; - /* 0x08 */ s16 xSpeed; - /* 0x0A */ s16 ySpeed; -} Object_64_Animator; - #define TEX_INDEX_NO_TEXTURE 255 // Has minor issues void obj_loop_animator(Object* obj, s32 speed) { - Object_64_Animator* obj64; // 3C + Object_Animator* obj64; // 3C s32 sp20; s32 sp1C; LevelModel* levelModel; @@ -1104,7 +1084,7 @@ void obj_loop_animator(Object* obj, s32 speed) { TextureHeader *tex; s32 maxSpeed; - obj64 = (Object_64_Animator*)obj->unk64; + obj64 = &obj->unk64->animator; temp = obj64->xSpeedFactor * speed; obj64->xSpeed += temp << 4; @@ -1312,7 +1292,7 @@ void obj_init_snowball(Object *obj, UNUSED LevelObjectEntry_Snowball *entry) { } void obj_loop_snowball(Object *obj, s32 speed) { - Object_64_Snowball *obj64 = obj->unk64; + Object_Snowball *obj64 = &obj->unk64->snowball; if (obj64->unk24 == 0) { if (obj64->unk38 != 0) { obj64->unk24 = (s16)(obj64->unk38 & 0xFF); @@ -1336,11 +1316,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_char_select.s") void obj_loop_animcamera(Object *obj, s32 speed) { s32 temp_v0; s32 phi_v1; - Object_64_80038710 *obj64; + Object_80038710 *obj64; temp_v0 = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj80038710; if (temp_v0 == 0) { if (get_viewport_count() == VIEWPORTS_COUNT_1_PLAYER) { phi_v1 = func_800210CC(obj64->unk44); @@ -1367,7 +1347,7 @@ void obj_loop_animcar(Object *obj, s32 speed) { obj->unk7C.word = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; if (obj->unk7C.word == 0 && someObj != NULL) { - Object_64_800387CC *someObj64 = someObj->unk64; + Object_800387CC *someObj64 = &someObj->unk64->obj800387CC; someObj64->unk148 = obj; } } @@ -1401,7 +1381,7 @@ void obj_loop_infopoint(Object *obj, UNUSED s32 speed) { if (obj4C->unk13 < ((obj->unk78 >> 16) & 0xFF)) { playerObj = obj4C->unk0; if (playerObj->segment.header->behaviorId == 1) { - Object_64_800388D4 *playerObj64 = playerObj->unk64; + Object_800388D4 *playerObj64 = &playerObj->unk64->obj800388D4; temp_a0 = playerObj64->unk0; if ((temp_a0 != -1) && (get_buttons_pressed_from_player(temp_a0) & Z_TRIG)) { func_800C31EC(obj->unk78 & 0xFF); @@ -1497,12 +1477,12 @@ void obj_loop_teleport(Object *obj, UNUSED s32 speed) { void obj_init_exit(Object *obj, LevelObjectEntry_Exit *entry) { f32 phi_f0; - Object_64_80038E3C *obj64; + Object_80038E3C *obj64; phi_f0 = entry->unk10 & 0xFF; if (phi_f0 < 5) { phi_f0 = 5; } - obj64 = obj->unk64; + obj64 = &obj->unk64->obj80038E3C; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->unk11 << 6 << 4; @@ -1520,20 +1500,20 @@ void obj_init_exit(Object *obj, LevelObjectEntry_Exit *entry) { void obj_loop_exit(Object *obj, UNUSED s32 speed) { Object *racerObj; - Object_64_Racer *racerObj64; + Object_Racer *racerObj64; s32 numberOfRacers; Settings *settings; f32 xDiff; f32 zDiff; f32 dist; f32 yDiff; - Object_64_Exit *obj64; + Object_Exit *obj64; s32 someBool; Object** racerObjects; s32 i; f32 temp; - obj64 = (Object_64_Exit*)obj->unk64; + obj64 = &obj->unk64->exit; someBool = TRUE; settings = get_settings(); if ((obj64->unk14 == 0) && (settings->balloonsPtr[settings->worldId] == 8)) { @@ -1548,7 +1528,7 @@ void obj_loop_exit(Object *obj, UNUSED s32 speed) { racerObjects = get_object_struct_array(&numberOfRacers); for (i = 0; i < numberOfRacers; i++) { racerObj = racerObjects[i]; - racerObj64 = (Object_64_Racer*)racerObj->unk64; + racerObj64 = &racerObj->unk64->racer; if ((racerObj64->unk0 != -1) && (racerObj64->unk108 == 0)) { xDiff = racerObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = racerObj->segment.trans.y_position - obj->segment.trans.y_position; @@ -1619,12 +1599,12 @@ void obj_init_parkwarden(Object *obj, UNUSED LevelObjectEntry_Parkwarden *entry) obj->unk4C->unk10 = (u8)0x1E; obj->unk4C->unk12 = (u8)0; temp = obj->unk64; - temp->unkCD.bytes.byteD = 0xFF; - temp->unk0_a.unk0 = 0.0f; - temp->unk28 = 0; - temp->unk2C = 0; - temp->unk34 = 0; - temp->unk36 = 0; + temp->original.unkCD.bytes.byteD = 0xFF; + temp->original.unk0_a.unk0 = 0.0f; + temp->original.unk28 = 0; + temp->original.unk2C = 0; + temp->original.unk34 = 0; + temp->original.unk36 = 0; D_8011D4D4 = 0; D_8011D4E2 = 0x10F; } @@ -1668,12 +1648,12 @@ void obj_loop_checkpoint(UNUSED Object *obj, UNUSED s32 speed) { void obj_init_modechange(Object *obj, LevelObjectEntry_ModeChange *entry) { f32 phi_f0; - Object_64_ModeChange *obj64; + Object_ModeChange *obj64; phi_f0 = entry->unk8 & 0xFF; if (phi_f0 < 5) { phi_f0 = 5; } - obj64 = obj->unk64; + obj64 = &obj->unk64->mode_change; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->unk9 << 6 << 4; @@ -1693,12 +1673,12 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_modechange.s") void obj_init_bonus(Object *obj, LevelObjectEntry_Bonus *entry) { f32 phi_f0; - Object_64_Bonus *obj64; + Object_Bonus *obj64; phi_f0 = entry->unk8 & 0xFF; if (phi_f0 < 5) { phi_f0 = 5; } - obj64 = obj->unk64; + obj64 = &obj->unk64->bonus; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->unk9 << 6 << 4; @@ -1716,25 +1696,25 @@ void obj_init_bonus(Object *obj, LevelObjectEntry_Bonus *entry) { void obj_loop_bonus(Object *obj, UNUSED s32 speed) { Object *racerObj; - Object_64_Racer *racerObj64; + Object_Racer *racerObj64; s32 numberOfRacers; f32 xDiff; f32 yDiff; f32 halfDist; f32 dist; f32 zDiff; - Object_64_Bonus *obj64; + Object_Bonus *obj64; Object **racerObjects; s32 i; - obj64 = (Object_64_Bonus *)obj->unk64; + obj64 = &obj->unk64->bonus; if (obj->unk4C->unk13 < obj64->unk10) { dist = obj64->unk10; halfDist = dist * 0.5; racerObjects = get_object_struct_array(&numberOfRacers); for (i = 0; i < numberOfRacers; i++) { racerObj = racerObjects[i]; - racerObj64 = (Object_64_Racer *)racerObj->unk64; + racerObj64 = &racerObj->unk64->racer; yDiff = racerObj->segment.trans.y_position - obj->segment.trans.y_position; if ((yDiff < halfDist) && (-halfDist < yDiff)) { xDiff = racerObj->segment.trans.x_position - obj->segment.trans.x_position; @@ -1754,7 +1734,7 @@ void obj_loop_bonus(Object *obj, UNUSED s32 speed) { } } void obj_init_goldenballoon(Object *obj, LevelObjectEntry_GoldenBalloon *entry) { - Object_64_GoldenBalloon *obj64; + Object_GoldenBalloon *obj64; f32 scalef; if (entry->unk8 == -1) { @@ -1775,7 +1755,7 @@ void obj_init_goldenballoon(Object *obj, LevelObjectEntry_GoldenBalloon *entry) } scalef /= 64; obj->segment.trans.scale = obj->segment.header->scale * scalef; - obj64 = obj->unk64; + obj64 = &obj->unk64->golden_balloon; obj64->unkD = 255; obj64->unk0 = 0.0f; obj->unk78 = 0; @@ -1797,7 +1777,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed) { s32 padding[1]; Object_3C *obj3C; Object_4C *obj4C; - Object_64_GoldenBalloon *obj64; + Object_GoldenBalloon *obj64; Settings *settings; s32 flag; s32 doubleSpeed; @@ -1839,7 +1819,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed) { obj4C = obj->unk4C; if ((obj4C->unk13 < 45) && (someBool == FALSE)) { racerObj = obj4C->unk0; - if (racerObj && (racerObj->segment.header->behaviorId == 1) && (((Object_64_Racer *)racerObj->unk64)->unk0 == 0)) { + if (racerObj && (racerObj->segment.header->behaviorId == 1) && (racerObj->unk64->racer->unk0 == 0)) { settings->balloonsPtr[settings->worldId]++; if (settings->worldId != 0) { settings->balloonsPtr[0]++; @@ -1852,7 +1832,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed) { func_800AFC3C(obj, speed); } } - obj64 = (Object_64_GoldenBalloon *)obj->unk64; + obj64 = obj->unk64->golden_balloon; obj->segment.unk3B = 0; obj64->unk14 = 0.0f; if (obj->segment.unk38.half.lower < 255) { @@ -1881,10 +1861,10 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_goldenballoon.s") #endif void obj_init_door(Object *obj, LevelObjectEntry_Door *entry) { - Object_64_Door *obj64; + Object_Door *obj64; f32 phi_f0; - obj64 = (Object_64_Door *)obj->unk64; + obj64 = &obj->unk64->door; if (entry->unkC == -1) { entry->unkC = func_8000CC20(obj); } else { @@ -1925,11 +1905,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_door.s") void obj_init_ttdoor(Object *obj, LevelObjectEntry_TTDoor *entry) { f32 temp_f0; - Object_64_8003C1E0 *obj64; + Object_8003C1E0 *obj64; f32 phi_f0; obj->segment.unk3A = 0; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj8003C1E0; obj->segment.trans.y_rotation = entry->unk8 << 6 << 4; obj64->unkF = entry->unkE; obj64->unk13 = entry->unkB; @@ -1957,7 +1937,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_ttdoor.s") void obj_init_trigger(Object *obj, LevelObjectEntry_Trigger *entry) { f32 phi_f0; - Object_64_Trigger *obj64; + Object_Trigger *obj64; if (entry->unk9 == -1) { entry->unk9 = func_8000CC20(obj); @@ -1971,7 +1951,7 @@ void obj_init_trigger(Object *obj, LevelObjectEntry_Trigger *entry) { if (phi_f0 < 5.0f) { phi_f0 = 5.0f; } - obj64 = (Object_64_Trigger*)obj->unk64; + obj64 = &obj->unk64->trigger; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->rotation << 6 << 4; @@ -1994,12 +1974,12 @@ void obj_init_bridge_whaleramp(Object *obj, LevelObjectEntry_Bridge_WhaleRamp *e Object_64 *temp = obj->unk64; obj->segment.unk3A = entry->unk8; obj->segment.trans.y_rotation = entry->unk9 << 6 << 4; - temp->unk0_a.unk0 = obj->segment.trans.y_position; + temp->original.unk0_a.unk0 = obj->segment.trans.y_position; obj->unk4C->unk14 = 0x21; obj->unk4C->unk11 = 2; obj->unk4C->unk10 = 0x14; obj->unk4C->unk12 = 0; - temp->unk4 = 0; + temp->original.unk4 = 0; if (obj->segment.unk3A >= obj->segment.header->numberOfModelIds) { obj->segment.unk3A = 0; } @@ -2079,7 +2059,7 @@ void obj_init_bananacreator(Object *obj, UNUSED LevelObjectEntry_BananaCreator * void obj_loop_bananacreator(Object *obj, s32 speed) { LevelObjectEntryCommon newEntry; Object *newBananaObj; - Object_64_Banana *newBananaObj64; + Object_Banana *newBananaObj64; if (obj->unk7C.word != 0) { obj->unk78 -= speed; @@ -2095,7 +2075,7 @@ void obj_loop_bananacreator(Object *obj, s32 speed) { obj->unk7C.word = 1; if (newBananaObj) { newBananaObj->segment.unk3C_a.unk3C = 0; - newBananaObj64 = (Object_64_Banana *) newBananaObj->unk64; + newBananaObj64 = &newBananaObj->unk64->banana; newBananaObj64->spawner = obj; func_8003FC44(obj->segment.trans.x_position, obj->segment.trans.y_position - 14.0f, obj->segment.trans.z_position, 44, 34, 0.25f, 0); obj->unk7C.word = 0; @@ -2187,7 +2167,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { playerObj = worldKeyObj->unk4C->unk0; if (playerObj != NULL) { if (playerObj->segment.header->behaviorId == 1) { // Is the player a racer? - Object_64_8003DF08 *obj64 = playerObj->unk64; + Object_8003DF08 *obj64 = &playerObj->unk64->obj8003DF08; if (obj64->unk0 != -1) { // Player has grabbed the key! play_sound(SOUND_WORLD_KEY_GRAB); @@ -2203,15 +2183,9 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { worldKeyObj->segment.trans.y_rotation += speed * 256; } -typedef struct Object_64_8003DFCC { - f32 unk0; - s16 unk4; - s8 unk6[0x2]; -} Object_64_8003DFCC; - void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) { s32 cheats; - Object_64_8003DFCC *obj64; + Object_8003DFCC *obj64; f32 scalef; obj->unk4C->unk14 = 2; @@ -2250,7 +2224,7 @@ void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) } scalef /= 64; - obj64 = (Object_64_8003DFCC*)obj->unk64; + obj64 = &obj->unk64->obj8003DFCC; obj->segment.trans.scale = obj->segment.header->scale * scalef; obj64->unk0 = obj->segment.trans.scale; @@ -2281,7 +2255,7 @@ void obj_init_weapon(Object *obj, UNUSED LevelObjectEntry_Weapon *entry) { void obj_loop_weapon(Object *obj, s32 speed) { Object_64 *obj64 = obj->unk64; - switch (obj64->unk18) { + switch (obj64->original.unk18) { case 0: case 1: func_8003E694(obj, speed); @@ -2340,9 +2314,9 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003FC44.s") #endif void obj_init_audio(Object *obj, LevelObjectEntry_Audio *entry) { - Object_64_Audio *obj64; + Object_Audio *obj64; - obj64 = (Object_64_Audio*)obj->unk64; + obj64 = &obj->unk64->audio; obj64->unk0 = entry->unk8; obj64->unk2 = entry->unkA; obj64->unkC = entry->unkF; @@ -2364,9 +2338,9 @@ void obj_init_audio(Object *obj, LevelObjectEntry_Audio *entry) { } void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { - Object_64_8003FEF4 *obj64; + Object_8003FEF4 *obj64; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj8003FEF4; obj64->unk0 = entry->unk8; obj64->unk2 = entry->unkA; obj64->unkC = entry->unkC; @@ -2386,7 +2360,7 @@ void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { s32 temp; - Object_64_8004001C *obj64 = (Object_64_8004001C *)obj->unk64; + Object_8004001C *obj64 = &obj->unk64->obj8004001C; obj64->unk2 = entry->unk8; temp = entry->unk9; obj64->unk4 = temp & 0xFF; @@ -2396,11 +2370,11 @@ void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { } void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2) { - Object_64_800400A4 *obj64; + Object_800400A4 *obj64; LevelModel *levelModel; s16 numberOfTexturesInLevel; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj800400A4; levelModel = func_8002C7C4(); obj64->unk0 = entry->unk8; if (obj64->unk0 < 0) { @@ -2484,35 +2458,35 @@ typedef struct Object_3C_Weather { // Has stack & regalloc issues. void obj_loop_weather(Object *obj, s32 speed) { - s32 sp54; - s32 numberOfObjects; - Object_64_Racer *curObj64; - Object **objects; - Object **lastObj; - Object *curObj; - Object_3C_Weather *obj3c; - f32 temp_f0; - f32 new_var; - f32 temp_f2; - s32 i; - s32 temp[3]; - sp54 = func_80066220(); - objects = get_object_struct_array(&numberOfObjects); - if (numberOfObjects != 0) { - lastObj = &objects[numberOfObjects - 1]; - objects--; - do { - curObj = objects[1]; - curObj64 = (Object_64_Racer *) curObj->unk64; - } while (((++objects) < lastObj) && (sp54 != curObj64->unk0)); - temp_f0 = obj->segment.trans.x_position - curObj->segment.trans.x_position; - temp_f2 = obj->segment.trans.z_position - curObj->segment.trans.z_position; - new_var = obj->unk78f; - obj3c = obj->segment.unk3C_a.unk3C; - if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) <= (new_var * 1.0f)){ - func_800ABC5C(obj3c->unkA * 256, obj3c->unkC * 256, obj3c->unkE * 256, obj3c->unk10 * 257, obj3c->unk11 * 257, (s32) obj3c->unk12); + s32 sp54; + s32 numberOfObjects; + Object_Racer *curObj64; + Object **objects; + Object **lastObj; + Object *curObj; + Object_3C_Weather *obj3c; + f32 temp_f0; + f32 new_var; + f32 temp_f2; + s32 i; + s32 temp[3]; + sp54 = func_80066220(); + objects = get_object_struct_array(&numberOfObjects); + if (numberOfObjects != 0) { + lastObj = &objects[numberOfObjects - 1]; + objects--; + do { + curObj = objects[1]; + curObj64 = &curObj->unk64->racer; + } while (((++objects) < lastObj) && (sp54 != curObj64->unk0)); + temp_f0 = obj->segment.trans.x_position - curObj->segment.trans.x_position; + temp_f2 = obj->segment.trans.z_position - curObj->segment.trans.z_position; + new_var = obj->unk78f; + obj3c = obj->segment.unk3C_a.unk3C; + if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) <= (new_var * 1.0f)){ + func_800ABC5C(obj3c->unkA * 256, obj3c->unkC * 256, obj3c->unkE * 256, obj3c->unk10 * 257, obj3c->unk11 * 257, (s32) obj3c->unk12); + } } - } } #else @@ -2535,26 +2509,12 @@ void obj_init_wavegenerator(Object *obj, UNUSED LevelObjectEntry_WaveGenerator * #ifdef NON_EQUIVALENT -typedef struct Object_64_Butterfly { -/* 0x00 */ Triangle triangles[8]; -/* 0x80 */ Vertex vertices[12]; -/* 0xF8 */ TextureHeader *texture; -/* 0xFC */ u8 unkFC; -/* 0xFD */ u8 unkFD; -/* 0xFE */ u8 unkFE; -/* 0xFF */ u8 unkFF; -/* 0x100 */ s32 unk100; -/* 0x104 */ s16 unk104; -/* 0x106 */ s16 unk106; -/* 0x108 */ f32 unk108; -} Object_64_Butterfly; - void obj_init_butterfly(Object *obj, LevelObjectEntry_Butterfly *entry, s32 arg2) { - Object_64_Butterfly *obj64; + Object_Butterfly *obj64; s32 i, j; s32 uMask, vMask; - obj64 = (Object_64_Butterfly*)obj->unk64; + obj64 = &obj->unk64->butterfly; if (arg2 == 0) { obj->segment.y_velocity = 0.0f; obj64->unkFE = 0; @@ -2624,7 +2584,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_butterfly.s") GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_init_midifade.s") void obj_init_midifadepoint(Object *obj, LevelObjectEntry_MidiFadePoint *entry) { - Object_64_MidiFadePoint *obj64; + Object_MidiFadePoint *obj64; ObjectModel **models; ObjectModel *objModel; Vertex *vertex; @@ -2634,7 +2594,7 @@ void obj_init_midifadepoint(Object *obj, LevelObjectEntry_MidiFadePoint *entry) f32 z; f32 dist; - obj64 = (LevelObjectEntry_MidiFadePoint *) obj->unk64; + obj64 = &obj->unk64->midi_fade_point; obj64->unk2 = entry->unkA; obj64->unk0 = entry->unk8; obj64->unk1C = entry->unk1C; @@ -2713,9 +2673,9 @@ void obj_loop_rangetrigger(Object *obj, s32 speed) { } void obj_init_frog(Object *obj, LevelObjectEntry_Frog *entry) { - Object_64_80042210 *obj64; + Object_80042210 *obj64; - obj64 = (Object_64_80042210 *)obj->unk64; + obj64 = &obj->unk64->obj80042210; obj64->unk15 = entry->unkA; obj64->unk0 = obj->segment.trans.x_position; obj64->unk4 = obj->segment.trans.y_position; @@ -2755,9 +2715,9 @@ void obj_loop_pigrocketeer(Object *obj, s32 speed) { obj64 = someObj->unk64; someObj->unk78 = 0; if (obj64 != 0) { - obj64->unk72 += speed; - obj64->unk70 = 2; - obj64->unk74 = 1.0f; + obj64->original.unk72 += speed; + obj64->original.unk70 = 2; + obj64->original.unk74 = 1.0f; func_8000B750(obj, -1, 2, 1, 1); } } diff --git a/src/object_functions.h b/src/object_functions.h index b7e0c664..6d279628 100644 --- a/src/object_functions.h +++ b/src/object_functions.h @@ -35,12 +35,6 @@ typedef struct Object_3C_80034B74 { u8 unkD; } Object_3C_80034B74; -typedef struct Object_64_80034B74 { - u8 pad0[0x1FE]; - u8 unk1FE; - u8 unk1FF; -} Object_64_80034B74; - typedef struct unk8003564C { s8 unk0; s8 unk1; @@ -49,11 +43,6 @@ typedef struct unk8003564C { s16 unk6; } unk8003564C; -typedef struct Object_64_8003564C { - u8 pad0[4]; - Object *unk4; -} Object_64_8003564C; - typedef struct unk80035E20 { u8 pad0[0x40]; s32 unk40; @@ -62,29 +51,6 @@ typedef struct unk80035E20 { s32 unk7C; } unk80035E20; -typedef struct Object_64_80035E34 { - u8 pad0[0x1D6]; - s8 unk1D6; -} Object_64_80035E34; - -typedef struct Object_64_80035F6C { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; - s32 unk10; - s32 unk14; - s32 unk18; - s32 unk1C; - s16 *unk20; - u8 *unk24; -} Object_64_80035F6C; - -typedef struct Object_64_80035F6C_2 { - u8 pad0[3]; - s8 unk3; -} Object_64_80035F6C_2; - typedef struct unk80037578 { u8 pad0[0x78]; s32 unk78; @@ -104,15 +70,6 @@ typedef struct LevelObjectEntry800376E0 { s8 unkA; } LevelObjectEntry800376E0; -typedef struct Object_64_800376E0 { - s16 segmentId; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; -} Object_64_800376E0; - typedef struct unk80037D08_arg0_64 { u8 pad0[0x2A]; s16 unk2A; @@ -131,30 +88,6 @@ typedef struct Object_60_800380F8 { Object *unkC; } Object_60_800380F8; -typedef struct Object_64_Snowball { - u8 pad0[0x20]; - u32 unk20; - s16 unk24; - u8 pad28[0x12]; - s8 unk38; -} Object_64_Snowball; - -typedef struct Object_64_80038710 { - u8 pad0[0x30]; - s8 unk30; - u8 pad31[0x13]; - s8 unk44; -} Object_64_80038710; - -typedef struct Object_64_800387CC { - u8 pad0[0x148]; - Object *unk148; -} Object_64_800387CC; - -typedef struct Object_64_800388D4 { - s16 unk0; -} Object_64_800388D4; - typedef struct unk80038B74 { u8 pad0[8]; s8 unk8; @@ -165,15 +98,6 @@ typedef struct Object_3C_80038DC4 { s8 unk8; } Object_3C_80038DC4; -typedef struct Object_64_80038E3C { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_64_80038E3C; - typedef struct unk80039160 { u8 pad0[0x78]; s32 unk78; @@ -186,17 +110,6 @@ typedef struct unk80039190 { s32 unk7C; } unk80039190; -typedef struct Object_64_8003C1E0 { - f32 unk0; - u8 pad4[4]; - s32 unk8; - u8 padC[3]; - s8 unkF; - u8 pad10[2]; - u8 unk12; - u8 unk13; -} Object_64_8003C1E0; - typedef struct unk8003CF18 { u8 pad1A[0x78]; f32 unk78; @@ -214,10 +127,6 @@ typedef struct unk8003D3EC { u16 unk18; } unk8003D3EC; -typedef struct Object_64_8003DF08 { - s16 unk0; -} Object_64_8003DF08; - typedef struct unk8003FC44 { s8 unk0; s8 unk1; @@ -227,31 +136,6 @@ typedef struct unk8003FC44 { s8 unk7; } unk8003FC44; - -typedef struct Object_64_8003FEF4 { - u8 unk0; - u8 pad1; - u16 unk2; - u16 unk4; - u16 unk6; - union { - struct { - u8 unk8; - u8 unk9; - u8 unkA; - u8 padB; - } unk_struct; - s32 unk8_word; - } unk_union; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; - u8 unk10; - u8 unk11; - u8 unk12; -} Object_64_8003FEF4; - typedef struct LevelObjectEntry8003FEF4 { LevelObjectEntryCommon common; u8 unk8; @@ -273,22 +157,6 @@ typedef struct LevelObjectEntry8004001C { u8 unkA; } LevelObjectEntry8004001C; -typedef struct Object_64_8004001C { - u16 pad0; - s16 unk2; - u8 unk4; - u8 unk5; -} Object_64_8004001C; - -typedef struct Object_64_800400A4 { - s16 unk0; - s16 pad2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; -} Object_64_800400A4; - typedef struct unk80040800 { u8 pad0[0x78]; f32 unk78; @@ -325,32 +193,6 @@ typedef struct Object_3C_80042178 { u16 unkA; } Object_3C_80042178; -typedef struct Object_64_80042210 { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - f32 unk10; - u8 unk14; - u8 unk15; - u8 pad16[3]; - u8 unk19; - u8 pad1A[6]; - f32 unk20; - f32 unk24; - u8 pad28[8]; - f32 unk30; -} Object_64_80042210; - -typedef struct Object_64_80042998 { - u8 pad0[0x70]; - u8 unk70; - u8 pad71; - u8 unk72; - u8 pad73; - f32 unk74; -} Object_64_80042998; - typedef struct unk80042A1C { u8 pad0[0x78]; f32 unk78; @@ -369,128 +211,8 @@ typedef struct Object_50_Scenery { //void func_80072348(s16 obj, u8 arg1); -typedef struct Object_64_Exit { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_64_Exit; - -typedef struct Object_64_Racer { - s16 unk0; - u8 pad2; - s8 unk3; - u8 pad4[0x104]; - s32 unk108; - u8 pad10C[0x40]; - Object *unk14C; - u8 pad150[0x33]; - s8 unk183; - s8 pad184; - s8 unk185; - u8 pad186[0x4D]; - s8 unk1D3; - u8 pad1D4[0x4]; - s8 unk1D8; - u8 pad1D9[0x9]; - s8 unk1E2; - u8 pad1E3[0x12]; - u8 unk1F5; - u8 pad1F6[0xA]; - s8 unk200; - u8 pad201[0x2]; - s8 unk203; - u8 pad204[0x8]; - u8 unk20C; -} Object_64_Racer; - -typedef struct Object_64_Bonus { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_64_Bonus; - -typedef struct Object_64_ModeChange { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_64_ModeChange; - -typedef struct Object_64_GoldenBalloon { - f32 unk0; - u8 pad4[0x8]; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; - s8 unk10; - f32 unk14; -} Object_64_GoldenBalloon; - -typedef struct Object_64_Door { - f32 unk0; - u8 pad4[0x4]; - s32 unk8; - s16 padA; - s8 unkE; - u8 unkF; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 unk14; -} Object_64_Door; - -typedef struct Object_64_Trigger { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_64_Trigger; - typedef Object Object_64_Animation; -typedef struct Object_64_Audio { - /* 0x00 */ u16 unk0; - /* 0x02 */ u16 unk2; - /* 0x04 */ u8 unk4; - /* 0x05 */ u8 unk5; - /* 0x06 */ u8 unk6; - /* 0x07 */ u8 unk7; - /* 0x08 */ s32 unk8; - /* 0x0C */ u8 unkC; - /* 0x0D */ u8 unkD; -} Object_64_Audio; - -typedef struct Object_64_MidiFade { - u8 unk0; - u8 unk1; - u8 unk2; - f32 unk4; - f32 unk8; - f32 unkC; - f32 unk10; - f32 unk14; - f32 unk18; - f32 unk1C; - f32 unk20; - f32 unk24; - f32 unk28; - f32 unk2C; - u8 unk2F[16]; - u8 unk40; -} Object_64_MidiFade; - typedef struct unk80041A90_MidiFade { s16 unk0; // Y rotation s16 unk2; // X rotation @@ -501,26 +223,6 @@ typedef struct unk80041A90_MidiFade { f32 unk14; } unk80041A90_MidiFade; -typedef struct Object_64_MidiFadePoint { - u16 unk0; - u16 unk2; - f32 unk4; - f32 unk8; - u8 unkC[16]; - u8 unk1C; -} Object_64_MidiFadePoint; - -typedef struct Object_64_PosArrow { - s16 unk0; - u8 pad4[0x14E]; - Object *unk150; -} Object_64_PosArrow; - -typedef struct Object_64_Banana { - u8 pad0[4]; - Object *spawner; -} Object_64_Banana; - // Unsure about the signed/unsigned with these arrays. extern u16 D_800DC970[4]; extern u16 D_800DC978[4]; @@ -668,7 +370,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed); s32 func_8001C524(f32 x, f32 y, f32 z, s32 arg3); s32 func_8001CC48(s32, s32, s32); -void func_8001C6C4(Object_64_GoldenBalloon *obj64, Object *obj, f32, f32, s32); +void func_8001C6C4(Object_GoldenBalloon *obj64, Object *obj, f32, f32, s32); void func_8000CBF0(Object*, s32); diff --git a/src/objects.c b/src/objects.c index 97390c64..76997326 100644 --- a/src/objects.c +++ b/src/objects.c @@ -945,19 +945,19 @@ void func_80012E28(Object *this) { if (this->behaviorId == 1) { sp_20 = this->unk64; - this->segment.trans.y_rotation += sp_20->unk160; - this->segment.trans.x_rotation += sp_20->unk162; - this->segment.trans.z_rotation += sp_20->unk164; + this->segment.trans.y_rotation += sp_20->original.unk160; + this->segment.trans.x_rotation += sp_20->original.unk162; + this->segment.trans.z_rotation += sp_20->original.unk164; sp_1c = 0.0f; - if (sp_20->unk1D7 < 5) { + if (sp_20->original.unk1D7 < 5) { - sp_1c = func_800707F8(sp_20->unk164); + sp_1c = func_800707F8(sp_20->original.unk164); tmp_f2 = sp_1c; - tmp_f0 = func_800707F8(sp_20->unk162 - sp_20->unk166) * tmp_f2; + tmp_f0 = func_800707F8(sp_20->original.unk162 - sp_20->original.unk166) * tmp_f2; tmp_f0 = (tmp_f0 < 0.0f) ? 0.0f : tmp_f0 * tmp_f0; - temp = (1.0f - tmp_f0) * 24.0f + sp_20->unkD0; + temp = (1.0f - tmp_f0) * 24.0f + sp_20->original.unkD0; if(0){} sp_1c = temp; } @@ -969,9 +969,9 @@ void func_80012E28(Object *this) { void func_80012F30(Object *arg0) { if (arg0->behaviorId == 1) { Object_64 *object_64 = arg0->unk64; - arg0->segment.trans.y_rotation -= object_64->unk160; - arg0->segment.trans.x_rotation -= object_64->unk162; - arg0->segment.trans.z_rotation -= object_64->unk164; + arg0->segment.trans.y_rotation -= object_64->original.unk160; + arg0->segment.trans.x_rotation -= object_64->original.unk162; + arg0->segment.trans.z_rotation -= object_64->original.unk164; arg0->segment.trans.y_position -= D_8011ADD0; } } @@ -995,9 +995,9 @@ void render_object(Object *this) { void func_80013548(Object *arg0) { if ((arg0->segment.trans.unk6 & 0x8000) == 0 && arg0->segment.header->behaviorId == 1) { - arg0->segment.trans.x_position -= arg0->unk64->unk78; - arg0->segment.trans.y_position -= arg0->unk64->unk7C; - arg0->segment.trans.z_position -= arg0->unk64->unk80; + arg0->segment.trans.x_position -= arg0->unk64->original.unk78; + arg0->segment.trans.y_position -= arg0->unk64->original.unk7C; + arg0->segment.trans.z_position -= arg0->unk64->original.unk80; } } @@ -1436,10 +1436,10 @@ void func_800228EC(s32 arg0) { D_8011AEF7 = 3; object_64 = get_object_struct(0)->unk64; - object_64->unk190 = 0; - object_64->unk192 = 0; - object_64->unk193 = 0; - object_64->unk1BA = 0; + object_64->original.unk190 = 0; + object_64->original.unk192 = 0; + object_64->original.unk193 = 0; + object_64->original.unk1BA = 0; func_80017E74(arg0); func_8006F388(10); } diff --git a/src/racer.c b/src/racer.c index 8ca91474..09576ba5 100644 --- a/src/racer.c +++ b/src/racer.c @@ -197,24 +197,7 @@ s8 D_8011D5BC; GLOBAL_ASM("asm/non_matchings/racer/func_80042D20.s") GLOBAL_ASM("asm/non_matchings/racer/func_80043ECC.s") -typedef struct Object_64_80044170 { - char unk0[0x2C]; - f32 unk2C; - char unk30[0x124]; - s32 unk154; - char unk158[0x72]; - s8 unk1CA; - char unk1CB[0x3]; - u8 unk1CE; - char unk1CF[0x13]; - s8 unk1E2; - char unk1E3[0x30]; - s8 unk213; - s8 unk214; - s8 unk215; -} Object_64_80044170; - -void func_80044170(Object *arg0, Object_64_80044170 *arg1, s32 arg2) { +void func_80044170(Object *arg0, Object_80044170 *arg1, s32 arg2) { s32 raceType; raceType = get_current_level_race_type(); @@ -452,22 +435,8 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8004F7F4.s") #ifdef NON_EQUIVALENT -typedef struct Object_64_80050754 { - u8 unk0[0x2C]; - f32 unk2C; - f32 unk30; - u8 unk34[0x114]; -/* 0x148 */ Object *someObj; - u8 unk14C[0x54]; -/* 0x1A0 */ s16 unk1A0; -/* 0x1A2 */ s16 unk1A2; -/* 0x1A4 */ s16 unk1A4; - u8 unk1A6[0x4C]; -/* 0x1F2 */ s8 unk1F2; -} Object_64_80050754; - // Mainly has regalloc issues. -void func_80050754(Object *obj, Object_64_80050754 *obj64, f32 arg2) { +void func_80050754(Object *obj, Object_80050754 *obj64, f32 arg2) { f32 xDiff, yDiff, zDiff; Object *someObj; @@ -526,7 +495,7 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, if ((D_8011D55C == -1) && (arg2 >= 3)) { arg0->segment.unk3B = 0; - arg1->unk1F2 = 0; + arg1->original.unk1F2 = 0; } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { if (arg0->segment.unk18 >= 0x29) { @@ -545,24 +514,24 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, } else { arg0->segment.unk3B = arg2; arg0->segment.unk18 = arg3; - arg1->unk1F3 &= ~0x80; + arg1->original.unk1F3 &= ~0x80; } } else if (arg0->segment.unk3B == arg2) { if (arg6 & 2) { - if (arg1->unk1F3 & 0x80) { + if (arg1->original.unk1F3 & 0x80) { arg0->segment.unk18 -= arg5; if (arg0->segment.unk18 <= 0) { arg0->segment.unk3B = 0; - arg1->unk1F2 = 0; + arg1->original.unk1F2 = 0; arg0->segment.unk18 = 0x28; - arg1->unk1F3 = 0; + arg1->original.unk1F3 = 0; } } else { arg0->segment.unk18 += arg5; if (arg0->segment.unk18 >= arg4) { arg0->segment.unk18 = arg4 - 1; if ((arg6 & 4) == 0) { - arg1->unk1F3 |= 0x80; + arg1->original.unk1F3 |= 0x80; } } } @@ -570,9 +539,9 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, arg0->segment.unk18 += arg5; if (arg0->segment.unk18 >= arg4) { arg0->segment.unk3B = 0; - arg1->unk1F2 = 0; + arg1->original.unk1F2 = 0; arg0->segment.unk18 = 0x28; - arg1->unk1F3 = 0; + arg1->original.unk1F3 = 0; } } } else { @@ -625,22 +594,22 @@ void func_800535C4(unk800535C4 *arg0, unk800535C4_2 *arg1) { } void func_80053664(Object_64 *arg0) { - if (arg0->throttle > 0.0) { - arg0->throttle -= 0.1; + if (arg0->original.throttle > 0.0) { + arg0->original.throttle -= 0.1; } if (D_8011D528 & 0x8000) { - arg0->throttle = 1.0f; + arg0->original.throttle = 1.0f; } if (D_8011D528 & 0x4000) { - if (arg0->brake < 1.0) { - arg0->brake += 0.2; + if (arg0->original.brake < 1.0) { + arg0->original.brake += 0.2; } } else { //! @bug Will cause a negative brake value resulting in higher velocity - if (arg0->brake > 0.05) { - arg0->brake -= 0.1; + if (arg0->original.brake > 0.05) { + arg0->original.brake -= 0.1; } } } @@ -659,7 +628,7 @@ void play_char_horn_sound(Object *obj, Object_64 *obj64) { func_800570B8(obj, 0x162, 8, 0x82); } else { // Play character's horn sound - func_80057048(obj, obj64->unk0_a.unk0_b.unk3 + 0x156); + func_80057048(obj, obj64->original.unk0_a.unk0_b.unk3 + 0x156); } } @@ -668,7 +637,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_80056E2C.s") void func_80057048(Object *obj, s32 arg1) { Object_64 *obj64 = obj->unk64; - if (D_8011D55C != -1 && obj64->unk108 == 0) { + if (D_8011D55C != -1 && obj64->original.unk108 == 0) { func_80001EA8(arg1, obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position, NULL); } } @@ -680,22 +649,11 @@ void func_800570A4(Object *obj, s32 arg1, s32 arg2) { } #ifdef NON_EQUIVALENT -typedef struct Object_64_800570B8 { - u8 pad0[3]; - s8 unk3; - u8 pad4[0x20]; - s32 unk24; - u16 unk28; - u16 unk2A; - u8 pad2C[0xDC]; - s32 unk108; -} Object_64_800570B8; - void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3) { s32 phi_t0; - Object_64_800570B8 *obj64; + Object_800570B8 *obj64; - obj64 = obj->unk64; + obj64 = &obj->unk64->obj800570B8; if ((obj64->unk108 == 0) && ((!(arg3 & 0x80)) || (D_8011D55C != -1))) { if (arg3 == 2) { if ((obj64->unk24 != 0) && (arg1 != obj64->unk2A)) { From e9ebe20607e3352f00baa5ad3174bb4b17cf8e5a Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 13 Apr 2022 19:13:50 -0700 Subject: [PATCH 04/11] Merge Object's inlined Object_64 into Object_Racer. --- include/structs.h | 225 +++++++++++++---------------------------- src/object_functions.c | 8 +- 2 files changed, 74 insertions(+), 159 deletions(-) diff --git a/include/structs.h b/include/structs.h index f5640a21..a575bff4 100644 --- a/include/structs.h +++ b/include/structs.h @@ -865,31 +865,74 @@ typedef struct Object_Exit { } Object_Exit; typedef struct Object_Racer { - s16 unk0; - u8 pad2; - s8 unk3; - u8 pad4[0x104]; - s32 unk108; - u8 pad10C[0x40]; - struct Object *unk14C; - u8 pad150[0x33]; - s8 unk183; - s8 pad184; - s8 unk185; - u8 pad186[0x4D]; - s8 unk1D3; - u8 pad1D4[0x4]; - s8 unk1D8; - u8 pad1D9[0x9]; - s8 unk1E2; - u8 pad1E3[0x12]; - u8 unk1F5; - u8 pad1F6[0xA]; - s8 unk200; - u8 pad201[0x2]; - s8 unk203; - u8 pad204[0x8]; - u8 unk20C; + /* 0x000 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled + /* 0x002 */ u8 pad2; + /* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc. + /* 0x004 */ u8 pad4[0x28]; + /* 0x02C */ f32 velocity; + /* 0x030 */ f32 lateral_velocity; + /* 0x034 */ u8 pad34[0x28]; + /* 0x05C */ f32 prev_x_position; + /* 0x060 */ f32 prev_y_position; + /* 0x064 */ f32 prev_z_position; + /* 0x068 */ u8 pad68[0x24]; + /* 0x08C */ f32 stretch_height; + /* 0x090 */ f32 stretch_height_cap; + /* 0x094 */ f32 camera_zoom; + /* 0x098 */ u8 pad98[0x4]; + /* 0x09C */ f32 pitch; + /* 0x0A0 */ u8 padA0[0x8]; + /* 0x0A8 */ f32 checkpoint_distance; + /* 0x0AC */ u8 padAC[0x8]; + /* 0x0B4 */ f32 throttle; + /* 0x0B8 */ f32 brake; + /* 0x0BC */ u8 padBC[0x4C]; + /* 0x108 */ s32 unk108; + /* 0x10C */ u8 pad10C[0x1C]; + /* 0x128 */ u32 lap_times[3]; + /* 0x134 */ u8 pad134[0x10]; + /* 0x144 */ struct Object *held_obj; + /* 0x148 */ u8 pad148[0x4]; + /* 0x14C */ struct Object *unk14C; + /* 0x150 */ u8 pad150[0x22]; + /* 0x172 */ u8 balloon_type; + /* 0x173 */ u8 balloon_quantity; + /* 0x174 */ u8 balloon_level; + /* 0x175 */ u8 pad175[0xE]; + /* 0x183 */ s8 unk183; + /* 0x184 */ s8 pad184; + /* 0x185 */ s8 bananas; + /* 0x186 */ u8 pad186[0x4D]; + /* 0x1D3 */ s8 unk1D3; + /* 0x1D4 */ u8 pad1D4[0x4]; + /* 0x1D8 */ s8 unk1D8; + /* 0x1D9 */ u8 pad1D9[0x2]; + /* 0x1DB */ u8 spinout_timer; + /* 0x1DC */ u8 wheel_surfaces[4]; + /* 0x1E0 */ u8 pad1E0[0x2]; + /* 0x1E2 */ s8 unk1E2; + /* 0x1E3 */ u8 pad1E3[0x3]; + /* 0x1E6 */ u8 drift_direction; + /* 0x1E7 */ u8 pad1E7[0x6]; + /* 0x1ED */ s8 squish_timer; + /* 0x1EE */ u8 pad1EE[0x1]; + /* 0x1EF */ u8 boost_sound; + /* 0x1F0 */ u8 pad1F1[0x5]; + /* 0x1F5 */ u8 unk1F5; + /* 0x1F6 */ u8 pad1F6[0x1]; + /* 0x1F7 */ u8 transparency; + /* 0x0290 */ u8 indicator_type; + /* 0x0291 */ s8 indicator_timer; + /* 0x1FA */ u8 pad1FA[0x6]; + /* 0x200 */ s8 unk200; + /* 0x201 */ u8 pad201[0x2]; + /* 0x203 */ s8 unk203; + /* 0x204 */ u8 pad204[0x8]; + /* 0x20C */ u8 unk20C; + /* 0x20D */ u8 pad20D[0x1]; + /* 0x20E */ u16 unk20E; + /* 0x210 */ u8 pad210[0xC]; + /* 0x21C */ u8 unk21C; } Object_Racer; typedef struct Object_Bonus { @@ -1193,137 +1236,9 @@ typedef struct Object { /* 0x0094 */ u32 unk94; /* 0x0098 */ Object_64 obj; - - //------------------------------ REMOVE BEGIN ------------------------------ -// /* 0x0098 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled -// /* 0x009A */ u8 unk9A; -// /* 0x009B */ u8 characterId; // Affects minimap color, horn, voice, etc. -// /* 0x009C */ u32 unk9C; - -// /* 0x00A0 */ f32 unkA0; - -// /* 0x00A4 */ u32 unkA4; -// /* 0x00A8 */ u32 unkA8; -// /* 0x00AC */ u32 unkAC; -// /* 0x00B0 */ u32 unkB0; -// /* 0x00B4 */ u32 unkB4; -// /* 0x00B8 */ u32 unkB8; -// /* 0x00BC */ u32 unkBC; -// /* 0x00C0 */ u32 unkc0; - -// /* 0x00C4 */ f32 velocity; -// /* 0x00C8 */ f32 lateral_velocity; - -// u32 unkCC[10]; // Not an array. Unknown values. - -// /* 0x00F4 */ f32 prev_x_position; -// /* 0x00F8 */ f32 prev_y_position; -// /* 0x00FC */ f32 prev_z_position; - -// /* 0x0100 */ u32 unk100; -// /* 0x0104 */ u32 unk104; -// /* 0x0108 */ u32 unk108; -// /* 0x010C */ u32 unk10C; - -// /* 0x0110 */ f32 unk110; -// /* 0x0114 */ f32 unk114; -// /* 0x0118 */ f32 unk118; -// /* 0x011C */ f32 unk11C; -// /* 0x0120 */ u32 unk120; -// /* 0x0124 */ f32 stretch_height; -// /* 0x0128 */ f32 stretch_height_cap; -// /* 0x012C */ f32 camera_zoom; -// /* 0x0130 */ u32 unk130; -// /* 0x0134 */ f32 pitch; -// /* 0x0138 */ u32 unk138; -// /* 0x013C */ u32 unk13C; -// /* 0x0140 */ f32 checkpoint_distance; -// /* 0x0144 */ u32 unk144; -// /* 0x0148 */ f32 unk148; -// /* 0x014C */ f32 throttle; -// /* 0x0150 */ f32 brake; -// /* 0x0154 */ u32 unk154; -// /* 0x0158 */ u32 unk158; -// /* 0x015C */ u32 unk15C; -// /* 0x0160 */ f32 unk160; -// /* 0x0164 */ u32 unk164; -// /* 0x0168 */ u32 unk168; -// /* 0x016C */ u32 unk16C; -// /* 0x0170 */ f32 unk170; -// /* 0x0174 */ f32 unk174; -// /* 0x0178 */ f32 unk178; -// /* 0x017C */ f32 unk17C; -// /* 0x0180 */ f32 unk180; -// /* 0x0184 */ f32 unk184; -// /* 0x0188 */ f32 unk188; -// /* 0x018C */ f32 unk18C; -// /* 0x0190 */ f32 unk190; -// /* 0x0194 */ f32 unk194; -// /* 0x0198 */ f32 unk198; -// /* 0x019C */ f32 unk19C; - -// u32 unk1A0[8]; // Not an array. Unknown values. - -// /* 0x01C0 */ u32 lap_times[3]; - -// /* 0x01CC */ u32 unk1CC; -// /* 0x01D0 */ u32 unk1D0; -// /* 0x01D4 */ u32 unk1D4; -// /* 0x01D8 */ u32 unk1D8; - -// /* 0x01DC */ void *held_obj_ptr; - -// u32 unk1E0[10]; // Not an array. Unknown values. - -// /* 0x0208 */ u16 unk208; -// /* 0x020A */ u8 balloon_type; -// /* 0x020B */ u8 balloon_quantity; -// /* 0x020C */ u8 balloon_level; - -// /* 0x020D */ u8 unk20D; -// /* 0x020E */ u8 unk20E; -// /* 0x020F */ u8 unk20F; -// /* 0x0210 */ u32 unk210; -// /* 0x0214 */ u32 unk214; -// /* 0x0218 */ u32 unk218; -// /* 0x021A */ u16 unk21A; -// /* 0x021B */ u8 unk21B; - -// /* 0x021D */ s8 bananas; -// /* 0x021E */ u8 unk21E; - -// /* 0x0270 */ u8 unk270; -// /* 0x0271 */ u8 unk271; -// /* 0x0272 */ u8 unk272; - -// /* 0x0273 */ u8 spinout_timer; -// /* 0x0274 */ u8 wheel_surfaces[4]; - -// /* 0x0278 */ u32 unk278; -// /* 0x027C */ u16 unk27C; - -// /* 0x027E */ u8 drift_direction; -// /* 0x027F */ u8 unk27F; - -// /* 0x0280 */ u32 unk280; -// /* 0x0284 */ u8 unk284; - -// /* 0x0285 */ s8 squish_timer; -// /* 0x0286 */ u8 unk286; -// /* 0x0287 */ u8 boost_sound; -// /* 0x0288 */ u32 unk288; - -// /* 0x028C */ u16 unk28C; -// /* 0x028E */ u8 unk28E; - -// /* 0x028F */ u8 transparency; - //------------------------------ REMOVE END ------------------------------ - /* 0x0290 */ u8 indicator_type; - /* 0x0291 */ s8 indicator_timer; - /* 0x0292 */ u16 unk292; - - u32 unk294[11]; // Not an array. Unknown values. + // May be a part of obj (likely Object_Player). + /* 0x02B8 */ u8 pad2A8[0x8]; /* 0x02C0 */ f32 unk2C0; diff --git a/src/object_functions.c b/src/object_functions.c index 01d223d9..739a8066 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -868,7 +868,7 @@ void obj_loop_groundzipper(Object *obj, UNUSED s32 speed) { yDiff = curRacerObj->segment.trans.y_position - obj->segment.trans.y_position; zDiff = curRacerObj->segment.trans.z_position - obj->segment.trans.z_position; if ((s32) sqrtf((xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff)) < obj->unk78) { - if (racerObj64->unk0 != -1) { + if (racerObj64->playerIndex != -1) { func_80001EA8(263, curRacerObj->segment.trans.x_position, curRacerObj->segment.trans.y_position, curRacerObj->segment.trans.z_position, NULL); } racerObj64->unk1D3 = func_8000C8B4(45); @@ -877,7 +877,7 @@ void obj_loop_groundzipper(Object *obj, UNUSED s32 speed) { racerObj64->unk203 |= 4; } if (racerObj64->unk1D8 == 0) { - func_80072348(racerObj64->unk0, 8); + func_80072348(racerObj64->playerIndex, 8); } } } @@ -1529,7 +1529,7 @@ void obj_loop_exit(Object *obj, UNUSED s32 speed) { for (i = 0; i < numberOfRacers; i++) { racerObj = racerObjects[i]; racerObj64 = &racerObj->unk64->racer; - if ((racerObj64->unk0 != -1) && (racerObj64->unk108 == 0)) { + if ((racerObj64->playerIndex != -1) && (racerObj64->unk108 == 0)) { xDiff = racerObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = racerObj->segment.trans.y_position - obj->segment.trans.y_position; zDiff = racerObj->segment.trans.z_position - obj->segment.trans.z_position; @@ -1725,7 +1725,7 @@ void obj_loop_bonus(Object *obj, UNUSED s32 speed) { if ((s32) racerObj64->unk185 < 10) { racerObj64->unk185 = 10; func_80009558(34, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, 4, NULL); - func_80001EA8(racerObj64->unk3 + 123, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, NULL); + func_80001EA8(racerObj64->characterId + 123, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, NULL); } } } From a3c4d99b882cb93196ebd9d3947d3c104c853bf5 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 13 Apr 2022 20:15:46 -0700 Subject: [PATCH 05/11] Name unnamed Object_64 types. --- include/structs.h | 192 ++++++++++++++++------------------------- src/object_functions.c | 84 +++++++++--------- src/racer.c | 26 +++--- 3 files changed, 128 insertions(+), 174 deletions(-) diff --git a/include/structs.h b/include/structs.h index a575bff4..e30e9a50 100644 --- a/include/structs.h +++ b/include/structs.h @@ -656,16 +656,16 @@ typedef struct Object_Original { // from object_functions.c -typedef struct Object_80034860 { +typedef struct Object_Laser { s16 unk0; u8 unk4[0x185]; s8 unk187; -} Object_80034860; +} Object_Laser; -typedef struct Object_80034E9C { +typedef struct Object_TrophyCabinet { s32 unk0; s16 unk4; -} Object_80034E9C; +} Object_TrophyCabinet; typedef struct Object_Animator { /* 0x00 */ s16 segmentId; @@ -676,11 +676,11 @@ typedef struct Object_Animator { /* 0x0A */ s16 ySpeed; } Object_Animator; -typedef struct Object_8003DFCC { +typedef struct Object_WeaponBalloon { f32 unk0; s16 unk4; s8 unk6[0x2]; -} Object_8003DFCC; +} Object_WeaponBalloon; typedef struct Object_Butterfly { /* 0x00 */ Triangle triangles[8]; @@ -698,23 +698,23 @@ typedef struct Object_Butterfly { // from object_functions.h -typedef struct Object_80034B74 { +typedef struct Object_EffectBox { u8 pad0[0x1FE]; u8 unk1FE; u8 unk1FF; -} Object_80034B74; +} Object_EffectBox; -typedef struct Object_8003564C { +typedef struct Object_EggCreator { u8 pad0[4]; struct Object *unk4; -} Object_8003564C; +} Object_EggCreator; -typedef struct Object_80035E34 { +typedef struct Object_UnkId58 { u8 pad0[0x1D6]; s8 unk1D6; -} Object_80035E34; +} Object_UnkId58; -typedef struct Object_80035F6C { +typedef struct Object_CharacterFlag { s32 unk0; s32 unk4; s32 unk8; @@ -725,22 +725,13 @@ typedef struct Object_80035F6C { s32 unk1C; s16 *unk20; u8 *unk24; -} Object_80035F6C; +} Object_CharacterFlag; typedef struct Object_80035F6C_2 { u8 pad0[3]; s8 unk3; } Object_80035F6C_2; -typedef struct Object_800376E0 { - s16 segmentId; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; -} Object_800376E0; - typedef struct Object_Snowball { u8 pad0[0x20]; u32 unk20; @@ -749,32 +740,23 @@ typedef struct Object_Snowball { s8 unk38; } Object_Snowball; -typedef struct Object_80038710 { +typedef struct Object_AnimCamera { u8 pad0[0x30]; s8 unk30; u8 pad31[0x13]; s8 unk44; -} Object_80038710; +} Object_AnimCamera; -typedef struct Object_800387CC { +typedef struct Object_AnimCar { u8 pad0[0x148]; struct Object *unk148; -} Object_800387CC; +} Object_AnimCar; -typedef struct Object_800388D4 { +typedef struct Object_InfoPoint { s16 unk0; -} Object_800388D4; +} Object_InfoPoint; -typedef struct Object_80038E3C { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_80038E3C; - -typedef struct Object_8003C1E0 { +typedef struct Object_TTDoor { f32 unk0; u8 pad4[4]; s32 unk8; @@ -783,13 +765,13 @@ typedef struct Object_8003C1E0 { u8 pad10[2]; u8 unk12; u8 unk13; -} Object_8003C1E0; +} Object_TTDoor; -typedef struct Object_8003DF08 { +typedef struct Object_WorldKey { s16 unk0; -} Object_8003DF08; +} Object_WorldKey; -typedef struct Object_8003FEF4 { +typedef struct Object_AudioLine { u8 unk0; u8 pad1; u16 unk2; @@ -811,25 +793,25 @@ typedef struct Object_8003FEF4 { u8 unk10; u8 unk11; u8 unk12; -} Object_8003FEF4; +} Object_AudioLine; -typedef struct Object_8004001C { +typedef struct Object_AudioReverb { u16 pad0; s16 unk2; u8 unk4; u8 unk5; -} Object_8004001C; +} Object_AudioReverb; -typedef struct Object_800400A4 { +typedef struct Object_TexScroll { s16 unk0; s16 pad2; s16 unk4; s16 unk6; s16 unk8; s16 unkA; -} Object_800400A4; +} Object_TexScroll; -typedef struct Object_80042210 { +typedef struct Object_Frog { f32 unk0; f32 unk4; f32 unk8; @@ -844,7 +826,7 @@ typedef struct Object_80042210 { f32 unk24; u8 pad28[8]; f32 unk30; -} Object_80042210; +} Object_Frog; typedef struct Object_Wizpig2 { u8 pad0[0x70]; @@ -868,7 +850,10 @@ typedef struct Object_Racer { /* 0x000 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled /* 0x002 */ u8 pad2; /* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc. - /* 0x004 */ u8 pad4[0x28]; + /* 0x004 */ u8 pad4[0x20]; + /* 0x024 */ s32 unk24; + /* 0x028 */ u16 unk28; + /* 0x02A */ u16 unk2A; /* 0x02C */ f32 velocity; /* 0x030 */ f32 lateral_velocity; /* 0x034 */ u8 pad34[0x28]; @@ -892,9 +877,11 @@ typedef struct Object_Racer { /* 0x128 */ u32 lap_times[3]; /* 0x134 */ u8 pad134[0x10]; /* 0x144 */ struct Object *held_obj; - /* 0x148 */ u8 pad148[0x4]; + /* 0x148 */ struct Object *unk148; /* 0x14C */ struct Object *unk14C; - /* 0x150 */ u8 pad150[0x22]; + /* 0x150 */ u8 pad150[0x4]; + /* 0x154 */ s32 unk154; + /* 0x158 */ u8 pad158[0x1A]; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; /* 0x174 */ u8 balloon_level; @@ -902,7 +889,15 @@ typedef struct Object_Racer { /* 0x183 */ s8 unk183; /* 0x184 */ s8 pad184; /* 0x185 */ s8 bananas; - /* 0x186 */ u8 pad186[0x4D]; + /* 0x186 */ u8 pad186[0x1A]; + /* 0x1A0 */ s16 unk1A0; + /* 0x1A2 */ s16 unk1A2; + /* 0x1A4 */ s16 unk1A4; + /* 0x1A6 */ u8 pad1A6[0x24]; + /* 0x1CA */ s8 unk1CA; + /* 0x1CB */ u8 pad1CB[0x3]; + /* 0x1CE */ u8 unk1CE; + /* 0x1CF */ u8 pad1CF[0x4]; /* 0x1D3 */ s8 unk1D3; /* 0x1D4 */ u8 pad1D4[0x4]; /* 0x1D8 */ s8 unk1D8; @@ -917,7 +912,9 @@ typedef struct Object_Racer { /* 0x1ED */ s8 squish_timer; /* 0x1EE */ u8 pad1EE[0x1]; /* 0x1EF */ u8 boost_sound; - /* 0x1F0 */ u8 pad1F1[0x5]; + /* 0x1F0 */ u8 pad1F0[0x2]; + /* 0x1F2 */ s8 unk1F2; + /* 0x1F3 */ u8 pad1F3[0x2]; /* 0x1F5 */ u8 unk1F5; /* 0x1F6 */ u8 pad1F6[0x1]; /* 0x1F7 */ u8 transparency; @@ -931,7 +928,11 @@ typedef struct Object_Racer { /* 0x20C */ u8 unk20C; /* 0x20D */ u8 pad20D[0x1]; /* 0x20E */ u16 unk20E; - /* 0x210 */ u8 pad210[0xC]; + /* 0x210 */ u8 pad210[0x3]; + /* 0x213 */ s8 unk213; + /* 0x214 */ s8 unk214; + /* 0x215 */ s8 unk215; + /* 0x216 */ u8 pad216[0x6]; /* 0x21C */ u8 unk21C; } Object_Racer; @@ -1040,73 +1041,29 @@ typedef struct Object_Banana { // from racer.c -typedef struct Object_80044170 { - char unk0[0x2C]; - f32 unk2C; - char unk30[0x124]; - s32 unk154; - char unk158[0x72]; - s8 unk1CA; - char unk1CB[0x3]; - u8 unk1CE; - char unk1CF[0x13]; - s8 unk1E2; - char unk1E3[0x30]; - s8 unk213; - s8 unk214; - s8 unk215; -} Object_80044170; - -typedef struct Object_80050754 { - u8 unk0[0x2C]; - f32 unk2C; - f32 unk30; - u8 unk34[0x114]; - /* 0x148 */ struct Object *someObj; - u8 unk14C[0x54]; - /* 0x1A0 */ s16 unk1A0; - /* 0x1A2 */ s16 unk1A2; - /* 0x1A4 */ s16 unk1A4; - u8 unk1A6[0x4C]; - /* 0x1F2 */ s8 unk1F2; -} Object_80050754; - -typedef struct Object_800570B8 { - u8 pad0[3]; - s8 unk3; - u8 pad4[0x20]; - s32 unk24; - u16 unk28; - u16 unk2A; - u8 pad2C[0xDC]; - s32 unk108; -} Object_800570B8; - typedef struct Object_64 { union { Object_Original original; - Object_80034860 obj80034860; - Object_80034E9C obj80034E9C; + Object_Laser laser; + Object_TrophyCabinet trophy_cabinet; Object_Animator animator; - Object_8003DFCC obj8003DFCC; + Object_WeaponBalloon weapon_balloon; Object_Butterfly butterfly; - Object_80034B74 obj80034B74; - Object_8003564C obj8003564C; - Object_80035E34 obj80035E34; - Object_80035F6C obj80035F6C; + Object_EffectBox effect_box; + Object_EggCreator egg_creator; + Object_UnkId58 unkid58; + Object_CharacterFlag character_flag; Object_80035F6C_2 obj80035F6C_2; - Object_800376E0 obj800376E0; Object_Snowball snowball; - Object_80038710 obj80038710; - Object_800387CC obj800387CC; - Object_800388D4 obj800388D4; - Object_80038E3C obj80038E3C; - Object_8003C1E0 obj8003C1E0; - Object_8003DF08 obj8003DF08; - Object_8003FEF4 obj8003FEF4; - Object_8004001C obj8004001C; - Object_800400A4 obj800400A4; - Object_80042210 obj80042210; + Object_AnimCamera anim_camera; + Object_AnimCar anim_car; + Object_InfoPoint info_point; + Object_TTDoor tt_door; + Object_WorldKey world_key; + Object_AudioLine audio_line; + Object_AudioReverb audio_reverb; + Object_TexScroll tex_scroll; + Object_Frog frog; Object_Wizpig2 wizpig2; Object_Exit exit; Object_Racer racer; @@ -1120,9 +1077,6 @@ typedef struct Object_64 { Object_MidiFadePoint midi_fade_point; Object_PosArrow pos_arrow; Object_Banana banana; - Object_80044170 obj80044170; - Object_80050754 obj80050754; - Object_800570B8 obj800570B8; }; } Object_64; diff --git a/src/object_functions.c b/src/object_functions.c index 739a8066..0246d7a4 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -372,7 +372,7 @@ void obj_loop_laserbolt(Object *obj, s32 speed) { Object *obj4C_obj; Object_7C_80034860 *obj7C; - Object_80034860 *obj4C_obj64; + Object_Laser *obj4C_obj64; s8 sp4F; // Boolean s8 sp4E; @@ -416,7 +416,7 @@ void obj_loop_laserbolt(Object *obj, s32 speed) { if (obj->unk4C->unk13 < 80) { obj4C_obj = (Object*)obj->unk4C->unk0; if (obj4C_obj && (obj4C_obj->behaviorId == 1)) { - obj4C_obj64 = &obj4C_obj->unk64->obj80034860; + obj4C_obj64 = &obj4C_obj->unk64->laser; sp4F = TRUE; if (obj4C_obj64->unk0 != -1) { obj4C_obj64->unk187 = 1; @@ -462,7 +462,7 @@ Object **get_object_struct_array(s32 *count); void obj_loop_effectbox(Object *obj, s32 speed) { Object **objList; Object_3C_80034B74 *obj3C; - Object_80034B74 *curObj64; + Object_EffectBox *curObj64; s32 i; s32 numberOfObjects; f32 xDiff; @@ -498,7 +498,7 @@ void obj_loop_effectbox(Object *obj, s32 speed) { if (((-temp4) < (((-xDiff) * temp1) + (zDiff * temp0))) && (temp5 < temp4)) { temp5 = temp3 / 2; - curObj64 = objList[i]->unk64; + curObj64 = &objList[i]->unk64->effect_box; curObj64->unk1FE = obj3C->unkC; curObj64->unk1FF = obj3C->unkD; if ((temp5 < yDiff) && (curObj64->unk1FE == 1)) @@ -562,7 +562,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { unk80027FC4 sp44; Settings *settings; LevelHeader *curLevelHeader; - Object_80034E9C *obj64; + Object_TrophyCabinet *obj64; Object *trophyObj; Object *playerObj; f32 xDiff; @@ -571,7 +571,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { settings = get_settings(); curLevelHeader = get_current_level_header(); - obj64 = &obj->unk64->obj80034E9C; + obj64 = &obj->unk64->trophy_cabinet; // Show trophy inside the cabinet if (obj->unk7C.word == 0) { @@ -709,7 +709,7 @@ void obj_loop_eggcreator(Object *obj, UNUSED s32 speed) { sp20.unk0 = 0x34; someObj = spawn_object(&sp20, 1); if (someObj != NULL) { - Object_8003564C *someObj64 = &someObj->unk64->obj8003564C; + Object_EggCreator *someObj64 = &someObj->unk64->egg_creator; someObj64->unk4 = obj; obj->unk78 = someObj; someObj->segment.unk3C_a.unk3C = 0; @@ -893,7 +893,7 @@ void obj_init_unknown58(Object *obj, LevelObjectEntry_Unknown58 *entry) { void obj_loop_unknown58(Object *obj, s32 speed) { Object *someObj; Object *someOtherObj; - Object_80035E34 *someOtherObj64; + Object_UnkId58 *someOtherObj64; Object_60 *obj60; obj->segment.unk3B = 0; @@ -904,7 +904,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) { set_ghost_position_and_rotation(obj); func_800AFC3C(obj, speed); someOtherObj = get_object_struct(0); - someOtherObj64 = &someOtherObj->unk64->obj80035E34; + someOtherObj64 = &someOtherObj->unk64->unkid58; obj60 = obj->unk60; if (obj60->unk0 == 1) { s8 temp = someOtherObj64->unk1D6; @@ -934,13 +934,13 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { s32 temp_t4; s32 temp_t5; Object *someObj; - Object_80035F6C *obj64; + Object_CharacterFlag *obj64; Object_80035F6C_2 *someObj64; if (obj->unk7C.word < 0) { someObj = get_object_struct(obj->unk78); if (someObj != NULL) { - obj64 = &obj->unk64->obj80035F6C; + obj64 = &obj->unk64->character_flag; someObj64 = &someObj->unk64->obj80035F6C_2; obj->unk7C.word = someObj64->unk3; if (obj->unk7C.word < 0 || obj->unk7C.word >= 0xA) { @@ -1034,27 +1034,27 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { } void obj_init_animator(Object *obj, LevelObjectEntry_Animator *entry, s32 arg2) { - Object_800376E0 *obj64; + Object_Animator *obj64; LevelModel *levelModel; s16 segmentBatchCount; - obj64 = &obj->unk64->obj800376E0; + obj64 = &obj->unk64->animator; levelModel = func_8002C7C4(); - obj64->unk2 = entry->unk8; - obj64->unk4 = entry->unk9; - obj64->unk6 = entry->unkA; + obj64->batchId = entry->unk8; + obj64->xSpeedFactor = entry->unk9; + obj64->ySpeedFactor = entry->unkA; obj64->segmentId = get_level_segment_index_from_position(obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position); if (arg2 == 0) { - obj64->unk8 = 0; - obj64->unkA = 0; + obj64->xSpeed = 0; + obj64->ySpeed = 0; } if (obj64->segmentId != -1) { - if (obj64->unk2 < 0) { - obj64->unk2 = 0; + if (obj64->batchId < 0) { + obj64->batchId = 0; } segmentBatchCount = levelModel->segments[obj64->segmentId].numberOfBatches; - if (obj64->unk2 >= segmentBatchCount) { - obj64->unk2 = segmentBatchCount - 1; + if (obj64->batchId >= segmentBatchCount) { + obj64->batchId = segmentBatchCount - 1; } } obj_loop_animator(obj, 0x20000); @@ -1316,11 +1316,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_char_select.s") void obj_loop_animcamera(Object *obj, s32 speed) { s32 temp_v0; s32 phi_v1; - Object_80038710 *obj64; + Object_AnimCamera *obj64; temp_v0 = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; - obj64 = &obj->unk64->obj80038710; + obj64 = &obj->unk64->anim_camera; if (temp_v0 == 0) { if (get_viewport_count() == VIEWPORTS_COUNT_1_PLAYER) { phi_v1 = func_800210CC(obj64->unk44); @@ -1347,7 +1347,7 @@ void obj_loop_animcar(Object *obj, s32 speed) { obj->unk7C.word = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; if (obj->unk7C.word == 0 && someObj != NULL) { - Object_800387CC *someObj64 = &someObj->unk64->obj800387CC; + Object_AnimCar *someObj64 = &someObj->unk64->anim_car; someObj64->unk148 = obj; } } @@ -1381,7 +1381,7 @@ void obj_loop_infopoint(Object *obj, UNUSED s32 speed) { if (obj4C->unk13 < ((obj->unk78 >> 16) & 0xFF)) { playerObj = obj4C->unk0; if (playerObj->segment.header->behaviorId == 1) { - Object_800388D4 *playerObj64 = &playerObj->unk64->obj800388D4; + Object_InfoPoint *playerObj64 = &playerObj->unk64->info_point; temp_a0 = playerObj64->unk0; if ((temp_a0 != -1) && (get_buttons_pressed_from_player(temp_a0) & Z_TRIG)) { func_800C31EC(obj->unk78 & 0xFF); @@ -1477,12 +1477,12 @@ void obj_loop_teleport(Object *obj, UNUSED s32 speed) { void obj_init_exit(Object *obj, LevelObjectEntry_Exit *entry) { f32 phi_f0; - Object_80038E3C *obj64; + Object_Exit *obj64; phi_f0 = entry->unk10 & 0xFF; if (phi_f0 < 5) { phi_f0 = 5; } - obj64 = &obj->unk64->obj80038E3C; + obj64 = &obj->unk64->exit; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->unk11 << 6 << 4; @@ -1722,8 +1722,8 @@ void obj_loop_bonus(Object *obj, UNUSED s32 speed) { if ((sqrtf((xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff)) < dist)) { f32 temp = (obj64->unk0 * racerObj->segment.trans.x_position) + (obj64->unk8 * racerObj->segment.trans.z_position) + obj64->unkC; if (temp < 0.0f) { - if ((s32) racerObj64->unk185 < 10) { - racerObj64->unk185 = 10; + if ((s32) racerObj64->bananas < 10) { + racerObj64->bananas = 10; func_80009558(34, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, 4, NULL); func_80001EA8(racerObj64->characterId + 123, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, NULL); } @@ -1905,11 +1905,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_door.s") void obj_init_ttdoor(Object *obj, LevelObjectEntry_TTDoor *entry) { f32 temp_f0; - Object_8003C1E0 *obj64; + Object_TTDoor *obj64; f32 phi_f0; obj->segment.unk3A = 0; - obj64 = &obj->unk64->obj8003C1E0; + obj64 = &obj->unk64->tt_door; obj->segment.trans.y_rotation = entry->unk8 << 6 << 4; obj64->unkF = entry->unkE; obj64->unk13 = entry->unkB; @@ -2167,7 +2167,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { playerObj = worldKeyObj->unk4C->unk0; if (playerObj != NULL) { if (playerObj->segment.header->behaviorId == 1) { // Is the player a racer? - Object_8003DF08 *obj64 = &playerObj->unk64->obj8003DF08; + Object_WorldKey *obj64 = &playerObj->unk64->world_key; if (obj64->unk0 != -1) { // Player has grabbed the key! play_sound(SOUND_WORLD_KEY_GRAB); @@ -2185,7 +2185,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) { s32 cheats; - Object_8003DFCC *obj64; + Object_WeaponBalloon *obj64; f32 scalef; obj->unk4C->unk14 = 2; @@ -2224,7 +2224,7 @@ void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) } scalef /= 64; - obj64 = &obj->unk64->obj8003DFCC; + obj64 = &obj->unk64->weapon_balloon; obj->segment.trans.scale = obj->segment.header->scale * scalef; obj64->unk0 = obj->segment.trans.scale; @@ -2338,9 +2338,9 @@ void obj_init_audio(Object *obj, LevelObjectEntry_Audio *entry) { } void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { - Object_8003FEF4 *obj64; + Object_AudioLine *obj64; - obj64 = &obj->unk64->obj8003FEF4; + obj64 = &obj->unk64->audio_line; obj64->unk0 = entry->unk8; obj64->unk2 = entry->unkA; obj64->unkC = entry->unkC; @@ -2360,7 +2360,7 @@ void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { s32 temp; - Object_8004001C *obj64 = &obj->unk64->obj8004001C; + Object_AudioReverb *obj64 = &obj->unk64->audio_reverb; obj64->unk2 = entry->unk8; temp = entry->unk9; obj64->unk4 = temp & 0xFF; @@ -2370,11 +2370,11 @@ void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { } void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2) { - Object_800400A4 *obj64; + Object_TexScroll *obj64; LevelModel *levelModel; s16 numberOfTexturesInLevel; - obj64 = &obj->unk64->obj800400A4; + obj64 = &obj->unk64->tex_scroll; levelModel = func_8002C7C4(); obj64->unk0 = entry->unk8; if (obj64->unk0 < 0) { @@ -2673,9 +2673,9 @@ void obj_loop_rangetrigger(Object *obj, s32 speed) { } void obj_init_frog(Object *obj, LevelObjectEntry_Frog *entry) { - Object_80042210 *obj64; + Object_Frog *obj64; - obj64 = &obj->unk64->obj80042210; + obj64 = &obj->unk64->frog; obj64->unk15 = entry->unkA; obj64->unk0 = obj->segment.trans.x_position; obj64->unk4 = obj->segment.trans.y_position; diff --git a/src/racer.c b/src/racer.c index 09576ba5..5ad03d6e 100644 --- a/src/racer.c +++ b/src/racer.c @@ -197,7 +197,7 @@ s8 D_8011D5BC; GLOBAL_ASM("asm/non_matchings/racer/func_80042D20.s") GLOBAL_ASM("asm/non_matchings/racer/func_80043ECC.s") -void func_80044170(Object *arg0, Object_80044170 *arg1, s32 arg2) { +void func_80044170(Object *arg0, Object_Racer *arg1, s32 arg2) { s32 raceType; raceType = get_current_level_race_type(); @@ -216,14 +216,14 @@ void func_80044170(Object *arg0, Object_80044170 *arg1, s32 arg2) { break; } - if (arg1->unk214 == 0 && arg1->unk2C < -0.5) { + if (arg1->unk214 == 0 && arg1->velocity < -0.5) { arg1->unk215 -= arg2; if (arg1->unk215 < 0) { arg1->unk215 = 0; } } - if (arg1->unk2C > -1.0 && arg1->unk214 == 0 && D_8011D540 == 0 && D_8011D544 == 0.0f && arg1->unk1E2 != 0 && arg1->unk215 == 0) { + if (arg1->velocity > -1.0 && arg1->unk214 == 0 && D_8011D540 == 0 && D_8011D544 == 0.0f && arg1->unk1E2 != 0 && arg1->unk215 == 0) { arg1->unk213 += arg2; if (arg1->unk213 > 60) { @@ -436,28 +436,28 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8004F7F4.s") #ifdef NON_EQUIVALENT // Mainly has regalloc issues. -void func_80050754(Object *obj, Object_80050754 *obj64, f32 arg2) { +void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) { f32 xDiff, yDiff, zDiff; Object *someObj; obj->segment.unk3B = 0; obj->segment.unk18 = 0x28; - someObj = obj64->someObj; + someObj = obj64->unk148; xDiff = someObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = someObj->segment.trans.y_position - obj->segment.trans.y_position; zDiff = someObj->segment.trans.z_position - obj->segment.trans.z_position; func_80011570(obj, xDiff, yDiff, zDiff); - obj->segment.trans.y_rotation = obj64->someObj->segment.trans.y_rotation; - obj->segment.trans.x_rotation = obj64->someObj->segment.trans.x_rotation; - obj->segment.trans.z_rotation = obj64->someObj->segment.trans.z_rotation; + obj->segment.trans.y_rotation = obj64->unk148->segment.trans.y_rotation; + obj->segment.trans.x_rotation = obj64->unk148->segment.trans.x_rotation; + obj->segment.trans.z_rotation = obj64->unk148->segment.trans.z_rotation; obj64->unk1A4 = obj->segment.trans.z_rotation; obj64->unk1A0 = obj->segment.trans.y_rotation; obj->segment.x_velocity = xDiff / arg2; obj->segment.y_velocity = yDiff / arg2; obj->segment.z_velocity = zDiff / arg2; obj64->unk1F2 = 0; - obj64->unk2C = 0.0f; - obj64->unk30 = 0.0f; + obj64->velocity = 0.0f; + obj64->lateral_velocity = 0.0f; } #else GLOBAL_ASM("asm/non_matchings/racer/func_80050754.s") @@ -651,9 +651,9 @@ void func_800570A4(Object *obj, s32 arg1, s32 arg2) { #ifdef NON_EQUIVALENT void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3) { s32 phi_t0; - Object_800570B8 *obj64; + Object_Racer *obj64; - obj64 = &obj->unk64->obj800570B8; + obj64 = &obj->unk64->racer; if ((obj64->unk108 == 0) && ((!(arg3 & 0x80)) || (D_8011D55C != -1))) { if (arg3 == 2) { if ((obj64->unk24 != 0) && (arg1 != obj64->unk2A)) { @@ -664,7 +664,7 @@ void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3) { if (obj64->unk24 == 0) { if (arg3 != 3 || get_random_number_from_range(0, 1) != 0) { obj64->unk2A = arg1; - arg1 += obj64->unk3; + arg1 += obj64->characterId; arg2--; phi_t0 = (get_random_number_from_range(0, arg2) * 12) + arg1; if (arg2 > 0) { From 76b0fde74da9aa177c80fe0e538cbd87d6a72ab1 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 13 Apr 2022 21:38:07 -0700 Subject: [PATCH 06/11] Migrate remaining Object_64 definitions. --- include/structs.h | 63 ++++++++++++++++++++--------- src/object_functions.c | 4 +- src/object_functions.h | 4 +- src/racer.c | 48 +++++++++++----------- src/racer.h | 92 ++++-------------------------------------- src/unknown_0255E0.c | 6 +-- 6 files changed, 81 insertions(+), 136 deletions(-) diff --git a/include/structs.h b/include/structs.h index e30e9a50..d6320cfc 100644 --- a/include/structs.h +++ b/include/structs.h @@ -654,8 +654,6 @@ typedef struct Object_Original { u8 unk1F7; // Used in func_8002A900 } Object_Original; -// from object_functions.c - typedef struct Object_Laser { s16 unk0; u8 unk4[0x185]; @@ -676,6 +674,11 @@ typedef struct Object_Animator { /* 0x0A */ s16 ySpeed; } Object_Animator; +typedef struct Object_Animation { + /* 0x00 */ u8 pad0[0x4A]; + /* 0x4A */ s16 unk4A; +} Object_Animation; + typedef struct Object_WeaponBalloon { f32 unk0; s16 unk4; @@ -696,8 +699,6 @@ typedef struct Object_Butterfly { /* 0x108 */ f32 unk108; } Object_Butterfly; -// from object_functions.h - typedef struct Object_EffectBox { u8 pad0[0x1FE]; u8 unk1FE; @@ -856,7 +857,16 @@ typedef struct Object_Racer { /* 0x02A */ u16 unk2A; /* 0x02C */ f32 velocity; /* 0x030 */ f32 lateral_velocity; - /* 0x034 */ u8 pad34[0x28]; + /* 0x034 */ u8 pad[0x4]; + /* 0x038 */ f32 ox1; + /* 0x03C */ f32 oy1; + /* 0x040 */ f32 oz1; + /* 0x044 */ f32 ox2; + /* 0x048 */ f32 oy2; + /* 0x04C */ f32 oz2; + /* 0x050 */ f32 ox3; + /* 0x054 */ f32 oy3; + /* 0x058 */ f32 oz3; /* 0x05C */ f32 prev_x_position; /* 0x060 */ f32 prev_y_position; /* 0x064 */ f32 prev_z_position; @@ -873,14 +883,16 @@ typedef struct Object_Racer { /* 0x0B8 */ f32 brake; /* 0x0BC */ u8 padBC[0x4C]; /* 0x108 */ s32 unk108; - /* 0x10C */ u8 pad10C[0x1C]; + /* 0x10C */ u8 pad10C[0xC]; + /* 0x118 */ s32 unk118; + /* 0x11C */ u8 pad11C[0xC]; /* 0x128 */ u32 lap_times[3]; /* 0x134 */ u8 pad134[0x10]; /* 0x144 */ struct Object *held_obj; /* 0x148 */ struct Object *unk148; /* 0x14C */ struct Object *unk14C; /* 0x150 */ u8 pad150[0x4]; - /* 0x154 */ s32 unk154; + /* 0x154 */ struct Object *unk154; /* 0x158 */ u8 pad158[0x1A]; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; @@ -889,31 +901,40 @@ typedef struct Object_Racer { /* 0x183 */ s8 unk183; /* 0x184 */ s8 pad184; /* 0x185 */ s8 bananas; - /* 0x186 */ u8 pad186[0x1A]; + /* 0x186 */ u8 unk186; + /* 0x187 */ s8 unk187; + /* 0x188 */ u8 pad188[0x4]; + /* 0x18C */ s16 unk18C; + /* 0x18E */ s16 unk18E; + /* 0x190 */ u8 pad190[0x10]; /* 0x1A0 */ s16 unk1A0; /* 0x1A2 */ s16 unk1A2; /* 0x1A4 */ s16 unk1A4; - /* 0x1A6 */ u8 pad1A6[0x24]; + /* 0x1A6 */ u8 pad1A6[0x23]; + /* 0x1C9 */ u8 unk1C9; /* 0x1CA */ s8 unk1CA; /* 0x1CB */ u8 pad1CB[0x3]; /* 0x1CE */ u8 unk1CE; /* 0x1CF */ u8 pad1CF[0x4]; /* 0x1D3 */ s8 unk1D3; - /* 0x1D4 */ u8 pad1D4[0x4]; + /* 0x1D4 */ u8 pad1D4[0x2]; + /* 0x1D6 */ s8 unk1D6; + /* 0x1D7 */ s8 unk1D7; /* 0x1D8 */ s8 unk1D8; /* 0x1D9 */ u8 pad1D9[0x2]; - /* 0x1DB */ u8 spinout_timer; + /* 0x1DB */ s8 spinout_timer; /* 0x1DC */ u8 wheel_surfaces[4]; - /* 0x1E0 */ u8 pad1E0[0x2]; + /* 0x1E0 */ u8 pad1E0[0x1]; + /* 0x1E1 */ s8 unk1E1; /* 0x1E2 */ s8 unk1E2; /* 0x1E3 */ u8 pad1E3[0x3]; - /* 0x1E6 */ u8 drift_direction; + /* 0x1E6 */ s8 drift_direction; /* 0x1E7 */ u8 pad1E7[0x6]; /* 0x1ED */ s8 squish_timer; /* 0x1EE */ u8 pad1EE[0x1]; /* 0x1EF */ u8 boost_sound; /* 0x1F0 */ u8 pad1F0[0x2]; - /* 0x1F2 */ s8 unk1F2; + /* 0x1F2 */ u8 unk1F2; /* 0x1F3 */ u8 pad1F3[0x2]; /* 0x1F5 */ u8 unk1F5; /* 0x1F6 */ u8 pad1F6[0x1]; @@ -924,11 +945,13 @@ typedef struct Object_Racer { /* 0x200 */ s8 unk200; /* 0x201 */ u8 pad201[0x2]; /* 0x203 */ s8 unk203; - /* 0x204 */ u8 pad204[0x8]; + /* 0x204 */ s16 unk204; + /* 0x206 */ u8 pad206[0x6]; /* 0x20C */ u8 unk20C; /* 0x20D */ u8 pad20D[0x1]; - /* 0x20E */ u16 unk20E; - /* 0x210 */ u8 pad210[0x3]; + /* 0x20E */ s16 unk20E; + /* 0x210 */ s8 unk210; + /* 0x211 */ u8 pad211[0x2]; /* 0x213 */ s8 unk213; /* 0x214 */ s8 unk214; /* 0x215 */ s8 unk215; @@ -1039,7 +1062,9 @@ typedef struct Object_Banana { struct Object *spawner; } Object_Banana; -// from racer.c +typedef struct Object_FogChanger { + s16 unk0; +} Object_FogChanger; typedef struct Object_64 { union { @@ -1047,6 +1072,7 @@ typedef struct Object_64 { Object_Laser laser; Object_TrophyCabinet trophy_cabinet; Object_Animator animator; + Object_Animation animation; Object_WeaponBalloon weapon_balloon; Object_Butterfly butterfly; Object_EffectBox effect_box; @@ -1077,6 +1103,7 @@ typedef struct Object_64 { Object_MidiFadePoint midi_fade_point; Object_PosArrow pos_arrow; Object_Banana banana; + Object_FogChanger fog_changer; }; } Object_64; diff --git a/src/object_functions.c b/src/object_functions.c index 0246d7a4..a867be8a 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -1149,7 +1149,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_animator.s") #endif void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2) { - Object_64_Animation* obj64; + Object_Animation* obj64; Object* sp24; s8 tempOrderIndex; f32 scalef; @@ -1200,7 +1200,7 @@ void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2 if (((func_8001E440() == entry->channel) || (entry->channel == 20)) && (obj->unk64 == NULL) && (entry->order == 0) && (entry->objectIdToSpawn != -1)) { func_8001F23C(obj, entry); } - obj64 = (Object_64_Animation*)obj->unk64; + obj64 = &obj->unk64->animation; if (obj->unk64 != 0) { func_8001EFA4(obj, obj64); if (entry->order != 0 || obj64->unk4A != entry->objectIdToSpawn) { diff --git a/src/object_functions.h b/src/object_functions.h index 6d279628..baee3195 100644 --- a/src/object_functions.h +++ b/src/object_functions.h @@ -211,8 +211,6 @@ typedef struct Object_50_Scenery { //void func_80072348(s16 obj, u8 arg1); -typedef Object Object_64_Animation; - typedef struct unk80041A90_MidiFade { s16 unk0; // Y rotation s16 unk2; // X rotation @@ -375,7 +373,7 @@ void func_8000CBF0(Object*, s32); void func_8001EE74(); -void func_8001EFA4(Object*, Object_64_Animation*); +void func_8001EFA4(Object*, Object_Animation*); void func_8001F23C(Object *obj, LevelObjectEntry_Animation *entry); s32 func_8001F3EC(s32); s32 func_80021600(s32); diff --git a/src/racer.c b/src/racer.c index 5ad03d6e..f50c652e 100644 --- a/src/racer.c +++ b/src/racer.c @@ -287,7 +287,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_800494E0.s") GLOBAL_ASM("asm/non_matchings/racer/func_80049794.s") // Something Plane related. -void func_8004C0A0(s32 arg0, Object *planeObj, Object_64_8004C0A0 *planeObj64) { +void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) { s32 temp_v1; s32 phi_v0; @@ -322,13 +322,13 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_64_8004C0A0 *planeObj64) { } } -void func_8004C140(Object *obj, Object_64_8004C140 *obj64) { +void func_8004C140(Object *obj, Object_Racer *obj64) { s8 phi_v1; s8 temp; - if (obj64->unk0 == -1) { + if (obj64->playerIndex == -1) { phi_v1 = 0; } else { - phi_v1 = obj64->unk185; + phi_v1 = obj64->bananas; } temp = obj64->unk187; if (temp == 0 || obj64->unk18E > 0) { @@ -348,16 +348,16 @@ void func_8004C140(Object *obj, Object_64_8004C140 *obj64) { case 1: case 2: if (phi_v1 != 0) { - obj64->unk1DB = 0x28; + obj64->spinout_timer = 0x28; } else { - obj64->unk1DB = 0x3C; + obj64->spinout_timer = 0x3C; } break; case 3: if (phi_v1 != 0) { - obj64->unk1DB = 0x28; + obj64->spinout_timer = 0x28; } else { - obj64->unk1DB = 0x3C; + obj64->spinout_timer = 0x3C; } break; case 6: @@ -374,7 +374,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8004C2B0.s") GLOBAL_ASM("asm/non_matchings/racer/func_8004CC20.s") GLOBAL_ASM("asm/non_matchings/racer/func_8004D590.s") -void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_64_8004D95C *obj64) { +void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { s16 sp26; if (obj64->unk118 != 0) { @@ -389,14 +389,14 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_64_8004D95C *obj64) { obj64->unk1D6 = obj64->unk1D7; obj->segment.unk3B = 0; if (obj64->unk1D6 == 0xA) { - if (obj64->someObject != NULL) { - obj64->someObject->segment.trans.x_position = obj->segment.trans.x_position; - obj64->someObject->segment.trans.y_position = obj->segment.trans.y_position; - obj64->someObject->segment.trans.z_position = obj->segment.trans.z_position; - obj64->someObject->segment.unk2C.half.lower = obj->segment.unk2C.half.lower; - obj64->someObject->segment.trans.y_rotation = obj->segment.trans.y_rotation; - obj64->someObject->segment.trans.x_rotation = obj->segment.trans.x_rotation; - obj64->someObject->segment.trans.z_rotation = obj->segment.trans.z_rotation; + if (obj64->unk154 != NULL) { + obj64->unk154->segment.trans.x_position = obj->segment.trans.x_position; + obj64->unk154->segment.trans.y_position = obj->segment.trans.y_position; + obj64->unk154->segment.trans.z_position = obj->segment.trans.z_position; + obj64->unk154->segment.unk2C.half.lower = obj->segment.unk2C.half.lower; + obj64->unk154->segment.trans.y_rotation = obj->segment.trans.y_rotation; + obj64->unk154->segment.trans.x_rotation = obj->segment.trans.x_rotation; + obj64->unk154->segment.trans.z_rotation = obj->segment.trans.z_rotation; obj->segment.unk3B = 0; obj->segment.unk18 = sp26 + arg0; func_80061C0C(obj); @@ -553,9 +553,9 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, GLOBAL_ASM("asm/non_matchings/racer/func_80052B64.s") GLOBAL_ASM("asm/non_matchings/racer/func_80052D7C.s") -void func_80053478(Object_64_80053478 *obj) { +void func_80053478(Object_Racer *obj) { s32 phi_v0; - f32 phi_f0 = obj->unk2C; + f32 phi_f0 = obj->velocity; if (phi_f0 < 0.0) { phi_f0 = -phi_f0; @@ -567,13 +567,13 @@ void func_80053478(Object_64_80053478 *obj) { if (phi_f0 < 0.0) { phi_f0 = 0.0f; } - if (obj->unk1E6 != 0) { + if (obj->drift_direction != 0) { phi_v0 = phi_f0 * 68.0f; } else { phi_v0 = phi_f0 * 58.0f; } D_8011D554 -= (obj->unk1E1 * phi_v0); - if (obj->unk2C > 0.0f) { + if (obj->velocity > 0.0f) { D_8011D554 = -D_8011D554; } } @@ -643,7 +643,7 @@ void func_80057048(Object *obj, s32 arg1) { } void func_800570A4(Object *obj, s32 arg1, s32 arg2) { - Object_64_unk800570A4 *temp = obj->unk64; + Object_Racer *temp = &obj->unk64->racer; temp->unk20E = arg1; temp->unk210 = arg2; } @@ -685,7 +685,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_800570B8.s") GLOBAL_ASM("asm/non_matchings/racer/func_80057220.s") -void func_800575EC(Object *obj, Object_64_800575EC *obj64) { +void func_800575EC(Object *obj, Object_Racer *obj64) { Matrix mf; D_8011D510.y_rotation = obj->segment.trans.y_rotation; @@ -723,7 +723,7 @@ void func_800579B0(unk800579B0 *arg0, UNUSED s32 arg1, f32 arg2) { GLOBAL_ASM("asm/non_matchings/racer/func_80057A40.s") -void func_800580B4(Object *obj, Object_64_800580B4 *obj64, s32 arg2, f32 arg3) { +void func_800580B4(Object *obj, Object_Racer *obj64, s32 arg2, f32 arg3) { f32 xPos, yPos, zPos; if ((D_8011D55C != -1) && (obj64->unk1D8 != 1)) { if (arg2 != gCameraObject->unk36) { diff --git a/src/racer.h b/src/racer.h index 02a9d625..d7ba0de7 100644 --- a/src/racer.h +++ b/src/racer.h @@ -22,45 +22,6 @@ typedef struct ObjectCamera { /* 0x0036 */ s16 unk36; } ObjectCamera; -/* Unknown size */ -typedef struct Object_64_8004C0A0 { - u8 pad0[0x1D7]; - s8 unk1D7; - u8 pad1D8[9]; - s8 unk1E1; - u8 pad1E2[0x10]; - u8 unk1F2; -} Object_64_8004C0A0; - -typedef struct Object_64_8004C140 { - s16 unk0; - u8 pad2[0x183]; - s8 unk185; - u8 unk186; - s8 unk187; - u8 pad188[4]; - s16 unk18C; - s16 unk18E; - u8 pad190[0x39]; - u8 unk1C9; - u8 pad1CA[0xC]; - s8 unk1D6; - u8 pad1D7[4]; - s8 unk1DB; - u8 pad1DC[0x28]; - s16 unk204; -} Object_64_8004C140; - -typedef struct Object_64_8004D95C { - u8 unk0[0x118]; - s32 unk118; - u8 unk11C[0x38]; - Object *someObject; - u8 unk158[0x7E]; - s8 unk1D6; - s8 unk1D7; -} Object_64_8004D95C; - typedef struct unk8004F77C { u8 unk0[0x20A]; u8 unk20A; @@ -72,15 +33,6 @@ typedef struct unk8005234C { s16 unk16C; } unk8005234C; -typedef struct Object_64_80053478 { - u8 unk0[0x2C]; - f32 unk2C; - u8 unk30[0x1B1]; - s8 unk1E1; - u8 unk1E2[4]; - s8 unk1E6; -} Object_64_80053478; - /* Unknown Size */ typedef struct unk800535C4 { s16 unk0; @@ -99,46 +51,18 @@ typedef struct unk800535C4_2 { /* 0x1A4 */ s16 unk1A4; } unk800535C4_2; -/* Unknown Size */ -typedef struct Object_64_unk800570A4 { - u8 unk0[0x108]; - s32 unk108; - u8 unk10C[0x102]; - s16 unk20E; - s8 unk210; -} Object_64_unk800570A4; - /* Unknown Size */ typedef struct unk80056930 { u8 unk0[0x3]; s8 unk3; } unk80056930; -/* Unknown size */ -typedef struct Object_64_800575EC { - /* 0x00 */ u8 pad0[0x38]; - /* 0x38 */ f32 ox1; - /* 0x3C */ f32 oy1; - /* 0x40 */ f32 oz1; - /* 0x44 */ f32 ox2; - /* 0x48 */ f32 oy2; - /* 0x4C */ f32 oz2; - /* 0x50 */ f32 ox3; - /* 0x54 */ f32 oy3; - /* 0x58 */ f32 oz3; -} Object_64_800575EC; - /* Unknown Size */ typedef struct unk800579B0 { u8 unk0[0x1E1]; s8 unk1E1; } unk800579B0; -typedef struct Object_64_800580B4 { - u8 unk0[0x1D8]; - s8 unk1D8; -} Object_64_800580B4; - /* Unknown Size */ typedef struct unk8005C270 { u8 unk0[0x190]; @@ -198,23 +122,23 @@ void func_8006FC30(Matrix, ObjectTransform *); // asm func void func_8006FE74(Matrix *, ObjectTransform *); // Non Matching ? s32 func_80044450(s32 arg0); -void func_8004C0A0(s32 arg0, Object *planeObj, Object_64_8004C0A0 *planeObj64); -void func_8004C140(Object *obj, Object_64_8004C140 *obj64); -void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_64_8004D95C *obj64); +void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64); +void func_8004C140(Object *obj, Object_Racer *obj64); +void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64); void func_8004F77C(unk8004F77C *arg0); s32 func_80052188(void); void func_800521B8(s32 arg0); void func_8005234C(unk8005234C *arg0); void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7); -void func_80053478(Object_64_80053478 *obj); +void func_80053478(Object_Racer *obj); void func_800535C4(unk800535C4 *arg0, unk800535C4_2 *arg1); void func_80053664(Object_64 *arg0); void play_char_horn_sound(Object *obj, Object_64 *obj64); void func_80057048(Object *obj, s32 arg1); void func_800570A4(Object *obj, s32 arg1, s32 arg2); -void func_800575EC(Object *obj, Object_64_800575EC *obj64); +void func_800575EC(Object *obj, Object_Racer *obj64); void func_800579B0(unk800579B0 *arg0, s32 arg1, f32 arg2); -void func_800580B4(Object *obj, Object_64_800580B4 *obj64, s32 arg2, f32 arg3); +void func_800580B4(Object *obj, Object_Racer *obj64, s32 arg2, f32 arg3); void get_timestamp_from_frames(s32 frameCount, s32 *minutes, s32 *seconds, s32 *hundredths); void func_800598D0(void); void func_80059944(void); @@ -233,7 +157,7 @@ void func_8005C25C(void); //Non Matching void set_ghost_position_and_rotation(Object *obj); void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3); -void func_800576E0(Object *obj, Object_64_8004C140 *obj64, s32 arg2); -void func_80057A40(Object *obj, Object_64_800580B4 *obj64, f32 arg2); +void func_800576E0(Object *obj, Object_Racer *obj64, s32 arg2); +void func_80057A40(Object *obj, Object_Racer *obj64, f32 arg2); #endif diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index f69ce029..252c9a5c 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -1178,10 +1178,6 @@ void func_8003093C(s32 arg0) { #ifdef NON_EQUIVALENT //unk8011D388 D_8011D388[4]; -typedef struct Object_64_FogChanger { - s16 unk0; -} Object_64_FogChanger; - typedef struct Object_3C_FogChanger { u8 pad0[0x2]; s16 unk2; @@ -1227,7 +1223,7 @@ void obj_loop_fogchanger(Object* obj) { index = -1; if (sp40 != NULL) { tempObj = sp40[i]; // Might be a player object? - temp_v0 = ((Object_64_FogChanger*)tempObj->unk64)->unk0; + temp_v0 = tempObj->unk64->fog_changer.unk0; if ((temp_v0 >= 0) && (temp_v0 < MAXCONTROLLERS) && (obj != D_8011D388[i].unk34)) { index = temp_v0; x = tempObj->segment.trans.x_position; From d32215d5eb46f41eba66814dd15500f42cca45de Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 13 Apr 2022 23:15:54 -0700 Subject: [PATCH 07/11] Migrate objects off of Object_Original. --- include/structs.h | 140 ++++++++++++++++++----------------------- src/game_ui.c | 8 +-- src/object_functions.c | 58 ++++++++--------- src/objects.c | 44 ++++++------- src/racer.c | 42 ++++++------- src/racer.h | 6 +- 6 files changed, 140 insertions(+), 158 deletions(-) diff --git a/include/structs.h b/include/structs.h index d6320cfc..0047f202 100644 --- a/include/structs.h +++ b/include/structs.h @@ -577,82 +577,14 @@ typedef struct Object_60 { struct Object; -typedef struct Object_Original { - union { - f32 unk0; - struct { - s8 unk0; - s8 unk1; - s8 unk2; - s8 unk3; - } unk0_b; - } unk0_a; - s32 unk4; - u8 pad8[4]; - union { - struct { - u8 byteC; - u8 byteD; - } bytes; - s16 half; - } unkCD; +typedef struct Object_LaserGun { + u8 pad0[0xC]; + s16 unkC; u8 unkE; s8 unkF; u8 unk10; u8 unk11; - u8 pad12[6]; - u8 unk18; - u8 pad19[7]; - u32 unk20; - u32 unk24; - s16 unk28; - s16 unk2A; - s32 unk2C; - s32 unk30; - s16 unk34; - s8 unk36; - u8 pad37[0x39]; - u8 unk70; - u8 unk71; - u8 unk72; - u8 unk73; - f32 unk74; - f32 unk78; - f32 unk7C; - f32 unk80; - u8 pad84[0x30]; - /* 0xB4 */ f32 throttle; - /* 0xB8 */ f32 brake; - u8 padBC[0x14]; - f32 unkD0; - u8 padD0[0x24]; - u32 unkF8; - u8 unkFC; - u8 padFD[0xB]; - s32 unk108; - u8 pad10C[0xC]; - s32 unk118; - u8 pad11C[0x44]; - s16 unk160; - s16 unk162; - s16 unk164; - s16 unk166; - u8 pad166[0x28]; - u16 unk190; - u8 unk192; - u8 unk193; - u8 pad194[0x26]; - u16 unk1BA; - u8 pad1BC[0x1A]; - s8 unk1D6; - s8 unk1D7; - s8 unk1D8; - u8 pad1D9[0x19]; - u8 unk1F2; - u8 unk1F3; - u8 pad1F4[3]; - u8 unk1F7; // Used in func_8002A900 -} Object_Original; +} Object_LaserGun; typedef struct Object_Laser { s16 unk0; @@ -685,6 +617,11 @@ typedef struct Object_WeaponBalloon { s8 unk6[0x2]; } Object_WeaponBalloon; +typedef struct Object_Weapon { + u8 pad0[0x18]; + u8 unk18; +} Object_Weapon; + typedef struct Object_Butterfly { /* 0x00 */ Triangle triangles[8]; /* 0x80 */ Vertex vertices[12]; @@ -870,7 +807,11 @@ typedef struct Object_Racer { /* 0x05C */ f32 prev_x_position; /* 0x060 */ f32 prev_y_position; /* 0x064 */ f32 prev_z_position; - /* 0x068 */ u8 pad68[0x24]; + /* 0x068 */ u8 pad68[0x10]; + /* 0x078 */ f32 unk78; + /* 0x07C */ f32 unk7C; + /* 0x080 */ f32 unk80; + /* 0x084 */ u8 pad84[0x8]; /* 0x08C */ f32 stretch_height; /* 0x090 */ f32 stretch_height_cap; /* 0x094 */ f32 camera_zoom; @@ -881,7 +822,9 @@ typedef struct Object_Racer { /* 0x0AC */ u8 padAC[0x8]; /* 0x0B4 */ f32 throttle; /* 0x0B8 */ f32 brake; - /* 0x0BC */ u8 padBC[0x4C]; + /* 0x0BC */ u8 padBC[0x14]; + /* 0x0D0 */ f32 unkD0; + /* 0x0D4 */ u8 padD4[0x34]; /* 0x108 */ s32 unk108; /* 0x10C */ u8 pad10C[0xC]; /* 0x118 */ s32 unk118; @@ -893,7 +836,12 @@ typedef struct Object_Racer { /* 0x14C */ struct Object *unk14C; /* 0x150 */ u8 pad150[0x4]; /* 0x154 */ struct Object *unk154; - /* 0x158 */ u8 pad158[0x1A]; + /* 0x158 */ u8 pad158[0x8]; + /* 0x160 */ s16 unk160; + /* 0x162 */ s16 unk162; + /* 0x164 */ s16 unk164; + /* 0x166 */ s16 unk166; + /* 0x168 */ u8 pad168[0xA]; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; /* 0x174 */ u8 balloon_level; @@ -906,11 +854,16 @@ typedef struct Object_Racer { /* 0x188 */ u8 pad188[0x4]; /* 0x18C */ s16 unk18C; /* 0x18E */ s16 unk18E; - /* 0x190 */ u8 pad190[0x10]; + /* 0x190 */ u16 unk190; + /* 0x192 */ u8 unk192; + /* 0x193 */ u8 unk193; + /* 0x194 */ u8 pad194[0xC]; /* 0x1A0 */ s16 unk1A0; /* 0x1A2 */ s16 unk1A2; /* 0x1A4 */ s16 unk1A4; - /* 0x1A6 */ u8 pad1A6[0x23]; + /* 0x1A6 */ u8 pad1A6[0x14]; + /* 0x1BA */ u16 unk1BA; + /* 0x1BC */ u8 pad1BC[0xD]; /* 0x1C9 */ u8 unk1C9; /* 0x1CA */ s8 unk1CA; /* 0x1CB */ u8 pad1CB[0x3]; @@ -935,7 +888,8 @@ typedef struct Object_Racer { /* 0x1EF */ u8 boost_sound; /* 0x1F0 */ u8 pad1F0[0x2]; /* 0x1F2 */ u8 unk1F2; - /* 0x1F3 */ u8 pad1F3[0x2]; + /* 0x1F3 */ u8 unk1F3; + /* 0x1F4 */ u8 pad1F4[0x1]; /* 0x1F5 */ u8 unk1F5; /* 0x1F6 */ u8 pad1F6[0x1]; /* 0x1F7 */ u8 transparency; @@ -1066,14 +1020,39 @@ typedef struct Object_FogChanger { s16 unk0; } Object_FogChanger; +typedef struct Object_Taj { + f32 unk0; + u8 pad4[0x9]; + u8 unkD; + u8 padE[0x1A]; + s16 unk28; + u8 pad2A[0x2]; + s32 unk2C; + u8 pad30[0x4]; + s16 unk34; + s8 unk36; +} Object_Taj; + +typedef struct Object_TT { + f32 unk0; + u8 pad4[0x9]; + u8 unkD; +} Object_TT; + +typedef struct Object_Bridge_WhaleRamp { + f32 unk0; + s32 unk4; +} Object_Bridge_WhaleRamp; + typedef struct Object_64 { union { - Object_Original original; + Object_LaserGun laser_gun; Object_Laser laser; Object_TrophyCabinet trophy_cabinet; Object_Animator animator; Object_Animation animation; Object_WeaponBalloon weapon_balloon; + Object_Weapon weapon; Object_Butterfly butterfly; Object_EffectBox effect_box; Object_EggCreator egg_creator; @@ -1104,6 +1083,9 @@ typedef struct Object_64 { Object_PosArrow pos_arrow; Object_Banana banana; Object_FogChanger fog_changer; + Object_Taj taj; + Object_TT tt; + Object_Bridge_WhaleRamp bridge_whale_ramp; }; } Object_64; diff --git a/src/game_ui.c b/src/game_ui.c index a5be8017..a4f9bc72 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -269,7 +269,7 @@ void func_800A0B74(void) { GLOBAL_ASM("asm/non_matchings/game_ui/func_800A0BD4.s") void func_800A0DC0(s32 arg0, Object *arg1, s32 arg2) { - Object_64 *temp = arg1->unk64; + Object_Racer *temp = &arg1->unk64->racer; func_80068508(1); func_800A0EB4(temp, arg2); @@ -285,7 +285,7 @@ void func_800A0DC0(s32 arg0, Object *arg1, s32 arg2) { func_800A4C44(temp, arg2); func_800A3884(arg1, arg2); - if (D_80127188 != 0 && temp->original.unk1D8 == 0) { + if (D_80127188 != 0 && temp->unk1D8 == 0) { func_800A47A0(temp, arg2); } @@ -297,8 +297,8 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A0EB4.s") GLOBAL_ASM("asm/non_matchings/game_ui/func_800A1248.s") void func_800A1428(s32 arg0, Object *arg1, s32 arg2) { - Object_64 *temp = arg1->unk64; - if (temp->original.unk1D8 == 0) { + Object_Racer *temp = &arg1->unk64->racer; + if (temp->unk1D8 == 0) { func_80068508(1); func_800A3CE4(arg0, arg2); func_800A7520(arg1, arg2); diff --git a/src/object_functions.c b/src/object_functions.c index a867be8a..b3f11ca1 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -337,15 +337,15 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_fireball_octoweapon.s") #endif void obj_init_lasergun(Object *obj, LevelObjectEntry_Lasergun *entry) { - Object_64 *obj64; + Object_LaserGun *obj64; obj->unk4C->unk14 = 0x22; obj->unk4C->unk11 = 0; - obj64 = obj->unk64; - obj64->original.unkE = entry->unkA; - obj64->original.unkF = entry->unkB; - obj64->original.unk10 = entry->unkC; - obj64->original.unk11 = entry->unkD; - obj64->original.unkCD.half = obj64->original.unkF; + obj64 = &obj->unk64->laser_gun; + obj64->unkE = entry->unkA; + obj64->unkF = entry->unkB; + obj64->unk10 = entry->unkC; + obj64->unk11 = entry->unkD; + obj64->unkC = obj64->unkF; obj->segment.trans.y_rotation = entry->unk8 << 4 << 4; // Not sure about the shift amounts here, but it obj->segment.trans.x_rotation = entry->unk9 << 4 << 4; // just needs to be 2 left shifts that add up to 8. } @@ -965,14 +965,14 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80036040.s") void obj_init_stopwatchman(Object *obj, UNUSED LevelObjectEntry_StopWatchMan *entry) { - Object_64 *temp; + Object_TT *temp; obj->unk4C->unk14 = 1; obj->unk4C->unk11 = 0; obj->unk4C->unk10 = 0x1E; obj->unk4C->unk12 = 0; - temp = obj->unk64; - temp->original.unkCD.bytes.byteD = 0xFF; - temp->original.unk0_a.unk0 = 0.0f; + temp = &obj->unk64->tt; + temp->unkD = 0xFF; + temp->unk0 = 0.0f; D_8011D4D8 = 0; } @@ -1593,18 +1593,18 @@ void obj_loop_dino_whale(Object *obj, s32 speed) { } void obj_init_parkwarden(Object *obj, UNUSED LevelObjectEntry_Parkwarden *entry) { - Object_64 *temp; + Object_Taj *temp; obj->unk4C->unk14 = (u16)1; obj->unk4C->unk11 = (u8)0; obj->unk4C->unk10 = (u8)0x1E; obj->unk4C->unk12 = (u8)0; - temp = obj->unk64; - temp->original.unkCD.bytes.byteD = 0xFF; - temp->original.unk0_a.unk0 = 0.0f; - temp->original.unk28 = 0; - temp->original.unk2C = 0; - temp->original.unk34 = 0; - temp->original.unk36 = 0; + temp = &obj->unk64->taj; + temp->unkD = 0xFF; + temp->unk0 = 0.0f; + temp->unk28 = 0; + temp->unk2C = 0; + temp->unk34 = 0; + temp->unk36 = 0; D_8011D4D4 = 0; D_8011D4E2 = 0x10F; } @@ -1971,15 +1971,15 @@ void obj_init_trigger(Object *obj, LevelObjectEntry_Trigger *entry) { GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_trigger.s") void obj_init_bridge_whaleramp(Object *obj, LevelObjectEntry_Bridge_WhaleRamp *entry) { - Object_64 *temp = obj->unk64; + Object_Bridge_WhaleRamp *temp = &obj->unk64->bridge_whale_ramp; obj->segment.unk3A = entry->unk8; obj->segment.trans.y_rotation = entry->unk9 << 6 << 4; - temp->original.unk0_a.unk0 = obj->segment.trans.y_position; + temp->unk0 = obj->segment.trans.y_position; obj->unk4C->unk14 = 0x21; obj->unk4C->unk11 = 2; obj->unk4C->unk10 = 0x14; obj->unk4C->unk12 = 0; - temp->original.unk4 = 0; + temp->unk4 = 0; if (obj->segment.unk3A >= obj->segment.header->numberOfModelIds) { obj->segment.unk3A = 0; } @@ -2254,8 +2254,8 @@ void obj_init_weapon(Object *obj, UNUSED LevelObjectEntry_Weapon *entry) { } void obj_loop_weapon(Object *obj, s32 speed) { - Object_64 *obj64 = obj->unk64; - switch (obj64->original.unk18) { + Object_Weapon *obj64 = &obj->unk64->weapon; + switch (obj64->unk18) { case 0: case 1: func_8003E694(obj, speed); @@ -2706,18 +2706,18 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_frog.s") void obj_loop_pigrocketeer(Object *obj, s32 speed) { Object *someObj; - Object_64 *obj64; + Object_Wizpig2 *obj64; func_8001F460(obj, speed, obj); someObj = func_8000BF44(-1); if (someObj != NULL) { - obj64 = someObj->unk64; + obj64 = &someObj->unk64->wizpig2; someObj->unk78 = 0; if (obj64 != 0) { - obj64->original.unk72 += speed; - obj64->original.unk70 = 2; - obj64->original.unk74 = 1.0f; + obj64->unk72 += speed; + obj64->unk70 = 2; + obj64->unk74 = 1.0f; func_8000B750(obj, -1, 2, 1, 1); } } diff --git a/src/objects.c b/src/objects.c index 76997326..db679de6 100644 --- a/src/objects.c +++ b/src/objects.c @@ -936,7 +936,7 @@ void func_80012D5C(Gfx **dlist, Mtx **mats, VertexList **verts, Object *object) void func_80012E28(Object *this) { s32 unused1; - Object_64 *sp_20; + Object_Racer *sp_20; f32 tmp_f2; f32 sp_1c; f32 tmp_f0; @@ -944,20 +944,20 @@ void func_80012E28(Object *this) { if (this->behaviorId == 1) { - sp_20 = this->unk64; - this->segment.trans.y_rotation += sp_20->original.unk160; - this->segment.trans.x_rotation += sp_20->original.unk162; - this->segment.trans.z_rotation += sp_20->original.unk164; + sp_20 = &this->unk64->racer; + this->segment.trans.y_rotation += sp_20->unk160; + this->segment.trans.x_rotation += sp_20->unk162; + this->segment.trans.z_rotation += sp_20->unk164; sp_1c = 0.0f; - if (sp_20->original.unk1D7 < 5) { + if (sp_20->unk1D7 < 5) { - sp_1c = func_800707F8(sp_20->original.unk164); + sp_1c = func_800707F8(sp_20->unk164); tmp_f2 = sp_1c; - tmp_f0 = func_800707F8(sp_20->original.unk162 - sp_20->original.unk166) * tmp_f2; + tmp_f0 = func_800707F8(sp_20->unk162 - sp_20->unk166) * tmp_f2; tmp_f0 = (tmp_f0 < 0.0f) ? 0.0f : tmp_f0 * tmp_f0; - temp = (1.0f - tmp_f0) * 24.0f + sp_20->original.unkD0; + temp = (1.0f - tmp_f0) * 24.0f + sp_20->unkD0; if(0){} sp_1c = temp; } @@ -968,10 +968,10 @@ void func_80012E28(Object *this) { void func_80012F30(Object *arg0) { if (arg0->behaviorId == 1) { - Object_64 *object_64 = arg0->unk64; - arg0->segment.trans.y_rotation -= object_64->original.unk160; - arg0->segment.trans.x_rotation -= object_64->original.unk162; - arg0->segment.trans.z_rotation -= object_64->original.unk164; + Object_Racer *object_64 = &arg0->unk64->racer; + arg0->segment.trans.y_rotation -= object_64->unk160; + arg0->segment.trans.x_rotation -= object_64->unk162; + arg0->segment.trans.z_rotation -= object_64->unk164; arg0->segment.trans.y_position -= D_8011ADD0; } } @@ -995,9 +995,9 @@ void render_object(Object *this) { void func_80013548(Object *arg0) { if ((arg0->segment.trans.unk6 & 0x8000) == 0 && arg0->segment.header->behaviorId == 1) { - arg0->segment.trans.x_position -= arg0->unk64->original.unk78; - arg0->segment.trans.y_position -= arg0->unk64->original.unk7C; - arg0->segment.trans.z_position -= arg0->unk64->original.unk80; + arg0->segment.trans.x_position -= arg0->unk64->racer.unk78; + arg0->segment.trans.y_position -= arg0->unk64->racer.unk7C; + arg0->segment.trans.z_position -= arg0->unk64->racer.unk80; } } @@ -1432,14 +1432,14 @@ UNUSED void func_800228DC(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2) { } void func_800228EC(s32 arg0) { - Object_64 *object_64; + Object_Racer *object_64; D_8011AEF7 = 3; - object_64 = get_object_struct(0)->unk64; - object_64->original.unk190 = 0; - object_64->original.unk192 = 0; - object_64->original.unk193 = 0; - object_64->original.unk1BA = 0; + object_64 = &get_object_struct(0)->unk64->racer; + object_64->unk190 = 0; + object_64->unk192 = 0; + object_64->unk193 = 0; + object_64->unk1BA = 0; func_80017E74(arg0); func_8006F388(10); } diff --git a/src/racer.c b/src/racer.c index f50c652e..f6379989 100644 --- a/src/racer.c +++ b/src/racer.c @@ -490,12 +490,12 @@ void func_8005234C(unk8005234C *arg0) { GLOBAL_ASM("asm/non_matchings/racer/func_80052388.s") GLOBAL_ASM("asm/non_matchings/racer/func_8005250C.s") -void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { +void func_80052988(Object *arg0, Object_Racer *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { arg5 *= arg7; if ((D_8011D55C == -1) && (arg2 >= 3)) { arg0->segment.unk3B = 0; - arg1->original.unk1F2 = 0; + arg1->unk1F2 = 0; } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { if (arg0->segment.unk18 >= 0x29) { @@ -514,24 +514,24 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, } else { arg0->segment.unk3B = arg2; arg0->segment.unk18 = arg3; - arg1->original.unk1F3 &= ~0x80; + arg1->unk1F3 &= ~0x80; } } else if (arg0->segment.unk3B == arg2) { if (arg6 & 2) { - if (arg1->original.unk1F3 & 0x80) { + if (arg1->unk1F3 & 0x80) { arg0->segment.unk18 -= arg5; if (arg0->segment.unk18 <= 0) { arg0->segment.unk3B = 0; - arg1->original.unk1F2 = 0; + arg1->unk1F2 = 0; arg0->segment.unk18 = 0x28; - arg1->original.unk1F3 = 0; + arg1->unk1F3 = 0; } } else { arg0->segment.unk18 += arg5; if (arg0->segment.unk18 >= arg4) { arg0->segment.unk18 = arg4 - 1; if ((arg6 & 4) == 0) { - arg1->original.unk1F3 |= 0x80; + arg1->unk1F3 |= 0x80; } } } @@ -539,9 +539,9 @@ void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, arg0->segment.unk18 += arg5; if (arg0->segment.unk18 >= arg4) { arg0->segment.unk3B = 0; - arg1->original.unk1F2 = 0; + arg1->unk1F2 = 0; arg0->segment.unk18 = 0x28; - arg1->original.unk1F3 = 0; + arg1->unk1F3 = 0; } } } else { @@ -593,23 +593,23 @@ void func_800535C4(unk800535C4 *arg0, unk800535C4_2 *arg1) { guMtxXFMF(mf, 0.0f, -1.0f, 0.0f, &arg1->ox, &arg1->oy, &arg1->oz); } -void func_80053664(Object_64 *arg0) { - if (arg0->original.throttle > 0.0) { - arg0->original.throttle -= 0.1; +void func_80053664(Object_Racer *arg0) { + if (arg0->throttle > 0.0) { + arg0->throttle -= 0.1; } if (D_8011D528 & 0x8000) { - arg0->original.throttle = 1.0f; + arg0->throttle = 1.0f; } if (D_8011D528 & 0x4000) { - if (arg0->original.brake < 1.0) { - arg0->original.brake += 0.2; + if (arg0->brake < 1.0) { + arg0->brake += 0.2; } } else { //! @bug Will cause a negative brake value resulting in higher velocity - if (arg0->original.brake > 0.05) { - arg0->original.brake -= 0.1; + if (arg0->brake > 0.05) { + arg0->brake -= 0.1; } } } @@ -622,13 +622,13 @@ GLOBAL_ASM("asm/non_matchings/racer/func_80054FD0.s") GLOBAL_ASM("asm/non_matchings/racer/func_80055A84.s") GLOBAL_ASM("asm/non_matchings/racer/func_80055EC0.s") -void play_char_horn_sound(Object *obj, Object_64 *obj64) { +void play_char_horn_sound(Object *obj, Object_Racer *obj64) { if (get_filtered_cheats() & CHEAT_HORN_CHEAT) { // Play character voice instead of horn. func_800570B8(obj, 0x162, 8, 0x82); } else { // Play character's horn sound - func_80057048(obj, obj64->original.unk0_a.unk0_b.unk3 + 0x156); + func_80057048(obj, obj64->characterId + 0x156); } } @@ -636,8 +636,8 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8005698C.s") GLOBAL_ASM("asm/non_matchings/racer/func_80056E2C.s") void func_80057048(Object *obj, s32 arg1) { - Object_64 *obj64 = obj->unk64; - if (D_8011D55C != -1 && obj64->original.unk108 == 0) { + Object_Racer *obj64 = &obj->unk64->racer; + if (D_8011D55C != -1 && obj64->unk108 == 0) { func_80001EA8(arg1, obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position, NULL); } } diff --git a/src/racer.h b/src/racer.h index d7ba0de7..dd396d73 100644 --- a/src/racer.h +++ b/src/racer.h @@ -129,11 +129,11 @@ void func_8004F77C(unk8004F77C *arg0); s32 func_80052188(void); void func_800521B8(s32 arg0); void func_8005234C(unk8005234C *arg0); -void func_80052988(Object *arg0, Object_64 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7); +void func_80052988(Object *arg0, Object_Racer *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7); void func_80053478(Object_Racer *obj); void func_800535C4(unk800535C4 *arg0, unk800535C4_2 *arg1); -void func_80053664(Object_64 *arg0); -void play_char_horn_sound(Object *obj, Object_64 *obj64); +void func_80053664(Object_Racer *arg0); +void play_char_horn_sound(Object *obj, Object_Racer *obj64); void func_80057048(Object *obj, s32 arg1); void func_800570A4(Object *obj, s32 arg1, s32 arg2); void func_800575EC(Object *obj, Object_Racer *obj64); From 83c9de2db6c7d8ac08ac4ec71265b75cba315f67 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 14 Apr 2022 00:09:23 -0700 Subject: [PATCH 08/11] Minor rename. --- include/structs.h | 6 +++--- src/object_functions.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/structs.h b/include/structs.h index 0047f202..f3cbc83a 100644 --- a/include/structs.h +++ b/include/structs.h @@ -665,10 +665,10 @@ typedef struct Object_CharacterFlag { u8 *unk24; } Object_CharacterFlag; -typedef struct Object_80035F6C_2 { +typedef struct Object_80035F6C { u8 pad0[3]; s8 unk3; -} Object_80035F6C_2; +} Object_80035F6C; typedef struct Object_Snowball { u8 pad0[0x20]; @@ -1058,7 +1058,7 @@ typedef struct Object_64 { Object_EggCreator egg_creator; Object_UnkId58 unkid58; Object_CharacterFlag character_flag; - Object_80035F6C_2 obj80035F6C_2; + Object_80035F6C obj80035F6C; Object_Snowball snowball; Object_AnimCamera anim_camera; Object_AnimCar anim_car; diff --git a/src/object_functions.c b/src/object_functions.c index b3f11ca1..0601a45d 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -935,13 +935,13 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { s32 temp_t5; Object *someObj; Object_CharacterFlag *obj64; - Object_80035F6C_2 *someObj64; + Object_80035F6C *someObj64; if (obj->unk7C.word < 0) { someObj = get_object_struct(obj->unk78); if (someObj != NULL) { obj64 = &obj->unk64->character_flag; - someObj64 = &someObj->unk64->obj80035F6C_2; + someObj64 = &someObj->unk64->obj80035F6C; obj->unk7C.word = someObj64->unk3; if (obj->unk7C.word < 0 || obj->unk7C.word >= 0xA) { obj->unk7C.word = 0; From 5b6eeefc02d060ef1626ad801f9acb0137f91f97 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 14 Apr 2022 00:25:36 -0700 Subject: [PATCH 09/11] Make consistent offset comments. --- include/structs.h | 434 +++++++++++++++++++++++----------------------- 1 file changed, 217 insertions(+), 217 deletions(-) diff --git a/include/structs.h b/include/structs.h index f3cbc83a..2129258c 100644 --- a/include/structs.h +++ b/include/structs.h @@ -578,32 +578,32 @@ typedef struct Object_60 { struct Object; typedef struct Object_LaserGun { - u8 pad0[0xC]; - s16 unkC; - u8 unkE; - s8 unkF; - u8 unk10; - u8 unk11; + /* 0x00 */ u8 pad0[0xC]; + /* 0x0C */ s16 unkC; + /* 0x0E */ u8 unkE; + /* 0x0F */ s8 unkF; + /* 0x10 */ u8 unk10; + /* 0x11 */ u8 unk11; } Object_LaserGun; typedef struct Object_Laser { - s16 unk0; - u8 unk4[0x185]; - s8 unk187; + /* 0x000 */ s16 unk0; + /* 0x004 */ u8 unk4[0x185]; + /* 0x187 */ s8 unk187; } Object_Laser; typedef struct Object_TrophyCabinet { - s32 unk0; - s16 unk4; + /* 0x0 */ s32 unk0; + /* 0x4 */ s16 unk4; } Object_TrophyCabinet; typedef struct Object_Animator { - /* 0x00 */ s16 segmentId; - /* 0x02 */ s16 batchId; - /* 0x04 */ s16 xSpeedFactor; - /* 0x06 */ s16 ySpeedFactor; - /* 0x08 */ s16 xSpeed; - /* 0x0A */ s16 ySpeed; + /* 0x00 */ s16 segmentId; + /* 0x02 */ s16 batchId; + /* 0x04 */ s16 xSpeedFactor; + /* 0x06 */ s16 ySpeedFactor; + /* 0x08 */ s16 xSpeed; + /* 0x0A */ s16 ySpeed; } Object_Animator; typedef struct Object_Animation { @@ -612,24 +612,24 @@ typedef struct Object_Animation { } Object_Animation; typedef struct Object_WeaponBalloon { - f32 unk0; - s16 unk4; - s8 unk6[0x2]; + /* 0x0 */ f32 unk0; + /* 0x4 */ s16 unk4; + /* 0x6 */ s8 unk6[0x2]; } Object_WeaponBalloon; typedef struct Object_Weapon { - u8 pad0[0x18]; - u8 unk18; + /* 0x00 */ u8 pad0[0x18]; + /* 0x18 */ u8 unk18; } Object_Weapon; typedef struct Object_Butterfly { - /* 0x00 */ Triangle triangles[8]; - /* 0x80 */ Vertex vertices[12]; - /* 0xF8 */ TextureHeader *texture; - /* 0xFC */ u8 unkFC; - /* 0xFD */ u8 unkFD; - /* 0xFE */ u8 unkFE; - /* 0xFF */ u8 unkFF; + /* 0x000 */ Triangle triangles[8]; + /* 0x080 */ Vertex vertices[12]; + /* 0x0F8 */ TextureHeader *texture; + /* 0x0FC */ u8 unkFC; + /* 0x0FD */ u8 unkFD; + /* 0x0FE */ u8 unkFE; + /* 0x0FF */ u8 unkFF; /* 0x100 */ s32 unk100; /* 0x104 */ s16 unk104; /* 0x106 */ s16 unk106; @@ -637,151 +637,151 @@ typedef struct Object_Butterfly { } Object_Butterfly; typedef struct Object_EffectBox { - u8 pad0[0x1FE]; - u8 unk1FE; - u8 unk1FF; + /* 0x000 */ u8 pad0[0x1FE]; + /* 0x1FE */ u8 unk1FE; + /* 0x1FF */ u8 unk1FF; } Object_EffectBox; typedef struct Object_EggCreator { - u8 pad0[4]; - struct Object *unk4; + /* 0x0 */ u8 pad0[4]; + /* 0x4 */ struct Object *unk4; } Object_EggCreator; typedef struct Object_UnkId58 { - u8 pad0[0x1D6]; - s8 unk1D6; + /* 0x000 */ u8 pad0[0x1D6]; + /* 0x1D6 */ s8 unk1D6; } Object_UnkId58; typedef struct Object_CharacterFlag { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; - s32 unk10; - s32 unk14; - s32 unk18; - s32 unk1C; - s16 *unk20; - u8 *unk24; + /* 0x00 */ s32 unk0; + /* 0x04 */ s32 unk4; + /* 0x08 */ s32 unk8; + /* 0x0C */ s32 unkC; + /* 0x10 */ s32 unk10; + /* 0x14 */ s32 unk14; + /* 0x18 */ s32 unk18; + /* 0x1C */ s32 unk1C; + /* 0x20 */ s16 *unk20; + /* 0x24 */ u8 *unk24; } Object_CharacterFlag; typedef struct Object_80035F6C { - u8 pad0[3]; - s8 unk3; + /* 0x0 */ u8 pad0[3]; + /* 0x3 */ s8 unk3; } Object_80035F6C; typedef struct Object_Snowball { - u8 pad0[0x20]; - u32 unk20; - s16 unk24; - u8 pad28[0x12]; - s8 unk38; + /* 0x00 */ u8 pad0[0x20]; + /* 0x20 */ u32 unk20; + /* 0x24 */ s16 unk24; + /* 0x28 */ u8 pad28[0x12]; + /* 0x38 */ s8 unk38; } Object_Snowball; typedef struct Object_AnimCamera { - u8 pad0[0x30]; - s8 unk30; - u8 pad31[0x13]; - s8 unk44; + /* 0x00 */ u8 pad0[0x30]; + /* 0x30 */ s8 unk30; + /* 0x31 */ u8 pad31[0x13]; + /* 0x44 */ s8 unk44; } Object_AnimCamera; typedef struct Object_AnimCar { - u8 pad0[0x148]; - struct Object *unk148; + /* 0x000 */ u8 pad0[0x148]; + /* 0x148 */ struct Object *unk148; } Object_AnimCar; typedef struct Object_InfoPoint { - s16 unk0; + /* 0x0 */ s16 unk0; } Object_InfoPoint; typedef struct Object_TTDoor { - f32 unk0; - u8 pad4[4]; - s32 unk8; - u8 padC[3]; - s8 unkF; - u8 pad10[2]; - u8 unk12; - u8 unk13; + /* 0x00 */ f32 unk0; + /* 0x04 */ u8 pad4[4]; + /* 0x08 */ s32 unk8; + /* 0x0C */ u8 padC[3]; + /* 0x0F */ s8 unkF; + /* 0x10 */ u8 pad10[2]; + /* 0x12 */ u8 unk12; + /* 0x13 */ u8 unk13; } Object_TTDoor; typedef struct Object_WorldKey { - s16 unk0; + /* 0x0 */ s16 unk0; } Object_WorldKey; typedef struct Object_AudioLine { - u8 unk0; - u8 pad1; - u16 unk2; - u16 unk4; - u16 unk6; - union { - struct { - u8 unk8; - u8 unk9; - u8 unkA; - u8 padB; - } unk_struct; - s32 unk8_word; - } unk_union; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; - u8 unk10; - u8 unk11; - u8 unk12; + /* 0x00 */ u8 unk0; + /* 0x01 */ u8 pad1; + /* 0x02 */ u16 unk2; + /* 0x04 */ u16 unk4; + /* 0x06 */ u16 unk6; + /* 0x08 */ union { + struct { + u8 unk8; + u8 unk9; + u8 unkA; + u8 padB; + } unk_struct; + s32 unk8_word; + } unk_union; + /* 0x0C */ u8 unkC; + /* 0x0D */ u8 unkD; + /* 0x0E */ u8 unkE; + /* 0x0F */ u8 unkF; + /* 0x10 */ u8 unk10; + /* 0x11 */ u8 unk11; + /* 0x12 */ u8 unk12; } Object_AudioLine; typedef struct Object_AudioReverb { - u16 pad0; - s16 unk2; - u8 unk4; - u8 unk5; + /* 0x0 */ u16 pad0; + /* 0x2 */ s16 unk2; + /* 0x4 */ u8 unk4; + /* 0x5 */ u8 unk5; } Object_AudioReverb; typedef struct Object_TexScroll { - s16 unk0; - s16 pad2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; + /* 0x0 */ s16 unk0; + /* 0x2 */ s16 pad2; + /* 0x4 */ s16 unk4; + /* 0x6 */ s16 unk6; + /* 0x8 */ s16 unk8; + /* 0xA */ s16 unkA; } Object_TexScroll; typedef struct Object_Frog { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - f32 unk10; - u8 unk14; - u8 unk15; - u8 pad16[3]; - u8 unk19; - u8 pad1A[6]; - f32 unk20; - f32 unk24; - u8 pad28[8]; - f32 unk30; + /* 0x00 */ f32 unk0; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ f32 unk10; + /* 0x14 */ u8 unk14; + /* 0x15 */ u8 unk15; + /* 0x16 */ u8 pad16[3]; + /* 0x19 */ u8 unk19; + /* 0x1A */ u8 pad1A[6]; + /* 0x20 */ f32 unk20; + /* 0x24 */ f32 unk24; + /* 0x28 */ u8 pad28[8]; + /* 0x30 */ f32 unk30; } Object_Frog; typedef struct Object_Wizpig2 { - u8 pad0[0x70]; - u8 unk70; - u8 pad71; - u8 unk72; - u8 pad73; - f32 unk74; + /* 0x00 */ u8 pad0[0x70]; + /* 0x70 */ u8 unk70; + /* 0x71 */ u8 pad71; + /* 0x72 */ u8 unk72; + /* 0x73 */ u8 pad73; + /* 0x74 */ f32 unk74; } Object_Wizpig2; typedef struct Object_Exit { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ s32 unk10; + /* 0x14 */ s8 unk14; } Object_Exit; typedef struct Object_Racer { @@ -893,8 +893,8 @@ typedef struct Object_Racer { /* 0x1F5 */ u8 unk1F5; /* 0x1F6 */ u8 pad1F6[0x1]; /* 0x1F7 */ u8 transparency; - /* 0x0290 */ u8 indicator_type; - /* 0x0291 */ s8 indicator_timer; + /* 0x290 */ u8 indicator_type; + /* 0x291 */ s8 indicator_timer; /* 0x1FA */ u8 pad1FA[0x6]; /* 0x200 */ s8 unk200; /* 0x201 */ u8 pad201[0x2]; @@ -914,134 +914,134 @@ typedef struct Object_Racer { } Object_Racer; typedef struct Object_Bonus { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ s32 unk10; + /* 0x14 */ s8 unk14; } Object_Bonus; typedef struct Object_ModeChange { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ s32 unk10; + /* 0x14 */ s8 unk14; } Object_ModeChange; typedef struct Object_GoldenBalloon { - f32 unk0; - u8 pad4[0x8]; - u8 unkC; - u8 unkD; - u8 unkE; - u8 unkF; - s8 unk10; - f32 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ u8 pad4[0x8]; + /* 0x0C */ u8 unkC; + /* 0x0D */ u8 unkD; + /* 0x0E */ u8 unkE; + /* 0x0F */ u8 unkF; + /* 0x10 */ s8 unk10; + /* 0x14 */ f32 unk14; } Object_GoldenBalloon; typedef struct Object_Door { - f32 unk0; - u8 pad4[0x4]; - s32 unk8; - s16 padA; - s8 unkE; - u8 unkF; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ u8 pad4[0x4]; + /* 0x08 */ s32 unk8; + /* 0x0A */ s16 padA; + /* 0x0E */ s8 unkE; + /* 0x0F */ u8 unkF; + /* 0x10 */ u8 unk10; + /* 0x11 */ u8 unk11; + /* 0x12 */ u8 unk12; + /* 0x13 */ u8 unk13; + /* 0x14 */ u8 unk14; } Object_Door; typedef struct Object_Trigger { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; + /* 0x00 */ f32 unk0; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ s32 unk10; + /* 0x14 */ s8 unk14; } Object_Trigger; typedef struct Object_Audio { - /* 0x00 */ u16 unk0; - /* 0x02 */ u16 unk2; - /* 0x04 */ u8 unk4; - /* 0x05 */ u8 unk5; - /* 0x06 */ u8 unk6; - /* 0x07 */ u8 unk7; - /* 0x08 */ s32 unk8; - /* 0x0C */ u8 unkC; - /* 0x0D */ u8 unkD; + /* 0x00 */ u16 unk0; + /* 0x02 */ u16 unk2; + /* 0x04 */ u8 unk4; + /* 0x05 */ u8 unk5; + /* 0x06 */ u8 unk6; + /* 0x07 */ u8 unk7; + /* 0x08 */ s32 unk8; + /* 0x0C */ u8 unkC; + /* 0x0D */ u8 unkD; } Object_Audio; typedef struct Object_MidiFade { - u8 unk0; - u8 unk1; - u8 unk2; - f32 unk4; - f32 unk8; - f32 unkC; - f32 unk10; - f32 unk14; - f32 unk18; - f32 unk1C; - f32 unk20; - f32 unk24; - f32 unk28; - f32 unk2C; - u8 unk2F[16]; - u8 unk40; + /* 0x00 */ u8 unk0; + /* 0x01 */ u8 unk1; + /* 0x02 */ u8 unk2; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ f32 unkC; + /* 0x10 */ f32 unk10; + /* 0x14 */ f32 unk14; + /* 0x18 */ f32 unk18; + /* 0x1C */ f32 unk1C; + /* 0x20 */ f32 unk20; + /* 0x24 */ f32 unk24; + /* 0x28 */ f32 unk28; + /* 0x2C */ f32 unk2C; + /* 0x2F */ u8 unk2F[16]; + /* 0x40 */ u8 unk40; } Object_MidiFade; typedef struct Object_MidiFadePoint { - u16 unk0; - u16 unk2; - f32 unk4; - f32 unk8; - u8 unkC[16]; - u8 unk1C; + /* 0x00 */ u16 unk0; + /* 0x02 */ u16 unk2; + /* 0x04 */ f32 unk4; + /* 0x08 */ f32 unk8; + /* 0x0C */ u8 unkC[16]; + /* 0x1C */ u8 unk1C; } Object_MidiFadePoint; typedef struct Object_PosArrow { - s16 unk0; - u8 pad4[0x14E]; - struct Object *unk150; + /* 0x000 */ s16 unk0; + /* 0x004 */ u8 pad4[0x14E]; + /* 0x150 */ struct Object *unk150; } Object_PosArrow; typedef struct Object_Banana { - u8 pad0[4]; - struct Object *spawner; + /* 0x0 */ u8 pad0[4]; + /* 0x4 */ struct Object *spawner; } Object_Banana; typedef struct Object_FogChanger { - s16 unk0; + /* 0x0 */ s16 unk0; } Object_FogChanger; typedef struct Object_Taj { - f32 unk0; - u8 pad4[0x9]; - u8 unkD; - u8 padE[0x1A]; - s16 unk28; - u8 pad2A[0x2]; - s32 unk2C; - u8 pad30[0x4]; - s16 unk34; - s8 unk36; + /* 0x00 */ f32 unk0; + /* 0x04 */ u8 pad4[0x9]; + /* 0x0D */ u8 unkD; + /* 0x0E */ u8 padE[0x1A]; + /* 0x28 */ s16 unk28; + /* 0x2A */ u8 pad2A[0x2]; + /* 0x2C */ s32 unk2C; + /* 0x30 */ u8 pad30[0x4]; + /* 0x34 */ s16 unk34; + /* 0x36 */ s8 unk36; } Object_Taj; typedef struct Object_TT { - f32 unk0; - u8 pad4[0x9]; - u8 unkD; + /* 0x0 */ f32 unk0; + /* 0x4 */ u8 pad4[0x9]; + /* 0xD */ u8 unkD; } Object_TT; typedef struct Object_Bridge_WhaleRamp { - f32 unk0; - s32 unk4; + /* 0x0 */ f32 unk0; + /* 0x4 */ s32 unk4; } Object_Bridge_WhaleRamp; typedef struct Object_64 { From 4328930d91dd340d34afd5e5675ccd79dcdab1cd Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 14 Apr 2022 18:48:14 -0700 Subject: [PATCH 10/11] Remove Object_80035F6C. --- include/structs.h | 6 ------ src/object_functions.c | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/structs.h b/include/structs.h index 2129258c..eb049bcf 100644 --- a/include/structs.h +++ b/include/structs.h @@ -665,11 +665,6 @@ typedef struct Object_CharacterFlag { /* 0x24 */ u8 *unk24; } Object_CharacterFlag; -typedef struct Object_80035F6C { - /* 0x0 */ u8 pad0[3]; - /* 0x3 */ s8 unk3; -} Object_80035F6C; - typedef struct Object_Snowball { /* 0x00 */ u8 pad0[0x20]; /* 0x20 */ u32 unk20; @@ -1058,7 +1053,6 @@ typedef struct Object_64 { Object_EggCreator egg_creator; Object_UnkId58 unkid58; Object_CharacterFlag character_flag; - Object_80035F6C obj80035F6C; Object_Snowball snowball; Object_AnimCamera anim_camera; Object_AnimCar anim_car; diff --git a/src/object_functions.c b/src/object_functions.c index 0601a45d..42c6cc98 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -935,14 +935,14 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { s32 temp_t5; Object *someObj; Object_CharacterFlag *obj64; - Object_80035F6C *someObj64; + Object_Racer *someObj64; if (obj->unk7C.word < 0) { someObj = get_object_struct(obj->unk78); if (someObj != NULL) { obj64 = &obj->unk64->character_flag; - someObj64 = &someObj->unk64->obj80035F6C; - obj->unk7C.word = someObj64->unk3; + someObj64 = &someObj->unk64->racer; + obj->unk7C.word = someObj64->characterId; if (obj->unk7C.word < 0 || obj->unk7C.word >= 0xA) { obj->unk7C.word = 0; } From 739568a63b1132f5b5314e4b05ca4450fc64273e Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 14 Apr 2022 21:45:04 -0700 Subject: [PATCH 11/11] Make NON_EQUIVALENT compile. --- include/structs.h | 16 +++++++++++++++- src/object_functions.c | 6 +++--- src/objects.c | 24 ++++++++++++------------ src/unknown_0255E0.c | 1 + src/unknown_032760.c | 20 ++++++++++---------- 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/include/structs.h b/include/structs.h index eb049bcf..67834438 100644 --- a/include/structs.h +++ b/include/structs.h @@ -781,7 +781,7 @@ typedef struct Object_Exit { typedef struct Object_Racer { /* 0x000 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled - /* 0x002 */ u8 pad2; + /* 0x002 */ u8 unk2; /* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc. /* 0x004 */ u8 pad4[0x20]; /* 0x024 */ s32 unk24; @@ -1039,6 +1039,19 @@ typedef struct Object_Bridge_WhaleRamp { /* 0x4 */ s32 unk4; } Object_Bridge_WhaleRamp; +typedef struct Object_80011AD0 { + /* 0x00 */ u8 pad0[0x20]; + /* 0x20 */ u32 unk20; + /* 0x24 */ u32 unk24; + /* 0x28 */ u8 pad28[0x48]; + /* 0x70 */ u8 unk70; + /* 0x71 */ u8 pad71[0x3]; + /* 0x74 */ f32 unk74; + /* 0x78 */ u8 pad78[0x80]; + /* 0xF8 */ u32 unkF8; + /* 0xFC */ u8 unkFC; +} Object_80011AD0; + typedef struct Object_64 { union { Object_LaserGun laser_gun; @@ -1080,6 +1093,7 @@ typedef struct Object_64 { Object_Taj taj; Object_TT tt; Object_Bridge_WhaleRamp bridge_whale_ramp; + Object_80011AD0 obj80011AD0; }; } Object_64; diff --git a/src/object_functions.c b/src/object_functions.c index 42c6cc98..fbb3635f 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -1819,7 +1819,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed) { obj4C = obj->unk4C; if ((obj4C->unk13 < 45) && (someBool == FALSE)) { racerObj = obj4C->unk0; - if (racerObj && (racerObj->segment.header->behaviorId == 1) && (racerObj->unk64->racer->unk0 == 0)) { + if (racerObj && (racerObj->segment.header->behaviorId == 1) && (racerObj->unk64->racer.playerIndex == 0)) { settings->balloonsPtr[settings->worldId]++; if (settings->worldId != 0) { settings->balloonsPtr[0]++; @@ -1832,7 +1832,7 @@ void obj_loop_goldenballoon(Object *obj, s32 speed) { func_800AFC3C(obj, speed); } } - obj64 = obj->unk64->golden_balloon; + obj64 = &obj->unk64->golden_balloon; obj->segment.unk3B = 0; obj64->unk14 = 0.0f; if (obj->segment.unk38.half.lower < 255) { @@ -2478,7 +2478,7 @@ void obj_loop_weather(Object *obj, s32 speed) { do { curObj = objects[1]; curObj64 = &curObj->unk64->racer; - } while (((++objects) < lastObj) && (sp54 != curObj64->unk0)); + } while (((++objects) < lastObj) && (sp54 != curObj64->playerIndex)); temp_f0 = obj->segment.trans.x_position - curObj->segment.trans.x_position; temp_f2 = obj->segment.trans.z_position - curObj->segment.trans.z_position; new_var = obj->unk78f; diff --git a/src/objects.c b/src/objects.c index db679de6..0116830a 100644 --- a/src/objects.c +++ b/src/objects.c @@ -620,7 +620,7 @@ void func_8000E2B4(void) { LevelObjectEntry8000E2B4 sp2C; Settings *settings; Object *player; - Object_64 *player_64; + Object_Racer *player_64; s16 object_id; if (D_8011AD44 == 0) { @@ -653,13 +653,13 @@ void func_8000E2B4(void) { (*gObjectStructArrayPtr)[0] = (s32) player; *D_8011AEEC = (s32) player; *D_8011AEE8 = player; - player_64 = player->unk64; + player_64 = &player->unk64->racer; player_64->unk1D6 = (s8) D_8011AD45; - player_64->unk0_a.unk0_b.unk2 = (u8)0; + player_64->unk2 = (u8)0; player_64->unk1D7 = (s8) D_8011AD45; - player_64->unk0_a.unk0_b.unk0 = (u16)0; + player_64->playerIndex = (u16)0; player_64->unk118 = 0; - player_64->unk0_a.unk0_b.unk3 = (s8) settings->racers[0].character; + player_64->characterId = (s8) settings->racers[0].character; if (get_filtered_cheats() & CHEAT_BIG_CHARACTERS) { player->segment.trans.scale *= 1.4f; } @@ -850,16 +850,16 @@ void func_80011AD0(Object *this) { //L80011B10 if (this->unk7C.word < 0) break; - func_80011960(this, this->unk64->unk20, 4, this->unk64, - 2, this->unk64->unk24, 11, 0, 1.0f); + func_80011960(this, this->unk64->obj80011AD0.unk20, 4, this->unk64, + 2, this->unk64->obj80011AD0.unk24, 11, 0, 1.0f); break; case 61: //L80011B58 - offset = (this->unk64->unkFC * 6); + offset = (this->unk64->obj80011AD0.unkFC * 6); offset *= 5; offset = offset * 2 + 0x80; - func_80011960(this, offset, 6, this->unk64, 8, this->unk64->unkF8, 10, 0, 1.0f); + func_80011960(this, offset, 6, this->unk64, 8, this->unk64->obj80011AD0.unkF8, 10, 0, 1.0f); break; case 3: //L80011BB4 @@ -867,16 +867,16 @@ void func_80011AD0(Object *this) { if (this->segment.unk3C_a.unk3C->unkD < 0) { tmp_f0 += 4294967296.0f; } - offset = (this->unk64->unkFC * 6); + offset = (this->unk64->obj80011AD0.unkFC * 6); offset *= 5; offset = offset * 2 + 0x80; - func_80011960(this, offset, 6, this->unk64, 8, this->unk64->unkF8, 26, 0, tmp_f0 * D_800E5550); + func_80011960(this, offset, 6, this->unk64, 8, this->unk64->obj80011AD0.unkF8, 26, 0, tmp_f0 * D_800E5550); break; case 89: //L80011C38 if (this->unk78 == 0) break; - if (this->unk64->unk70 > 0 || 0.0f < this->unk64->unk74) { + if (this->unk64->obj80011AD0.unk70 > 0 || 0.0f < this->unk64->obj80011AD0.unk74) { func_800135B8(this); } break; diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 252c9a5c..33efbc21 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -181,6 +181,7 @@ s32 func_800249E0(s32 arg0) { } #ifdef NON_EQUIVALENT +void func_8002C0C4(s32 modelId); void func_800249F0(u32 arg0, u32 arg1, s32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 arg6) { s32 i; s32 tmp_a2; diff --git a/src/unknown_032760.c b/src/unknown_032760.c index 346b6a42..65246d53 100644 --- a/src/unknown_032760.c +++ b/src/unknown_032760.c @@ -149,8 +149,8 @@ void func_80032C7C(Object *object) { s16 phi_a0, phi_a1; unk800DC950 *entry; - if (object->header->unk3D == 0) { - switch (object->header->modelType) { + if (object->segment.header->unk3D == 0) { + switch (object->segment.header->modelType) { case OBJECT_MODEL_TYPE_3D_MODEL: // 3D Model sp64 = 2; break; @@ -164,9 +164,9 @@ void func_80032C7C(Object *object) { break; } - sp82 = object->trans.x_position; - sp80 = object->trans.y_position; - sp7E = object->trans.z_position; + sp82 = object->segment.trans.x_position; + sp80 = object->segment.trans.y_position; + sp7E = object->segment.trans.z_position; D_800DC968 = 0; for (i = 0; i < D_800DC95C; i++) { entry = D_800DC950[i]; @@ -183,9 +183,9 @@ void func_80032C7C(Object *object) { D_800DC968 = D_800DC968 + 1; } } else { - D_8011D4C4 = entry->unk10 - object->trans.x_position; - D_8011D4C8 = entry->unk14 - object->trans.y_position; - D_8011D4CC = entry->unk18 - object->trans.z_position; + D_8011D4C4 = entry->unk10 - object->segment.trans.x_position; + D_8011D4C8 = entry->unk14 - object->segment.trans.y_position; + D_8011D4CC = entry->unk18 - object->segment.trans.z_position; if (entry->unk0 == 2) { D_8011D4C8 = 0.0f; } @@ -199,7 +199,7 @@ void func_80032C7C(Object *object) { if (f20 > 0.0f) { f20 *= func_80033A14(entry); if (f20 > 0.0f) { - if (object->header->unk71 != 0) { + if (object->segment.header->unk71 != 0) { if (D_8011D4C0 > 0.0f) { temp = 1.0f / sqrtf(D_8011D4C0); D_8011D4C4 *= temp; @@ -227,7 +227,7 @@ void func_80032C7C(Object *object) { } } - if (object->header->unk71 != 0) { + if (object->segment.header->unk71 != 0) { if (D_800DC968 == 0) { object->unk54->unk7 = 0; object->unk54->unk11 = 0;