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/25] 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/25] 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 a3a4d42e7c3927c075b402a6110e88df2eb81393 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 13 Apr 2022 12:53:29 +0100 Subject: [PATCH 03/25] Labelled trig tables --- asm/unknown_070110.s | 4 ++-- asm/unknown_070110/func_8007066C.s | 8 ++++---- asm/unknown_070110/func_8007082C.s | 4 ++-- asm/unknown_070110/func_80070890.s | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/asm/unknown_070110.s b/asm/unknown_070110.s index 84875cd2..f0aac61d 100644 --- a/asm/unknown_070110.s +++ b/asm/unknown_070110.s @@ -52,9 +52,9 @@ glabel D_800DD434 glabel D_800DD438 .word 0x5141564D -glabel D_800DD43C +glabel gSineTable .half 0x0000, 0x0032, 0x0065, 0x0097, 0x00C9, 0x00FB, 0x012E, 0x0160, 0x0192, 0x01C4, 0x01F7, 0x0229, 0x025B, 0x028D, 0x02C0, 0x02F2, 0x0324, 0x0356, 0x0389, 0x03BB, 0x03ED, 0x041F, 0x0452, 0x0484, 0x04B6, 0x04E8, 0x051B, 0x054D, 0x057F, 0x05B1, 0x05E3, 0x0616, 0x0648, 0x067A, 0x06AC, 0x06DE, 0x0711, 0x0743, 0x0775, 0x07A7, 0x07D9, 0x080C, 0x083E, 0x0870, 0x08A2, 0x08D4, 0x0906, 0x0938, 0x096B, 0x099D, 0x09CF, 0x0A01, 0x0A33, 0x0A65, 0x0A97, 0x0AC9, 0x0AFB, 0x0B2D, 0x0B60, 0x0B92, 0x0BC4, 0x0BF6, 0x0C28, 0x0C5A, 0x0C8C, 0x0CBE, 0x0CF0, 0x0D22, 0x0D54, 0x0D86, 0x0DB8, 0x0DEA, 0x0E1C, 0x0E4E, 0x0E80, 0x0EB2, 0x0EE4, 0x0F15, 0x0F47, 0x0F79, 0x0FAB, 0x0FDD, 0x100F, 0x1041, 0x1073, 0x10A4, 0x10D6, 0x1108, 0x113A, 0x116C, 0x119E, 0x11CF, 0x1201, 0x1233, 0x1265, 0x1296, 0x12C8, 0x12FA, 0x132B, 0x135D, 0x138F, 0x13C1, 0x13F2, 0x1424, 0x1455, 0x1487, 0x14B9, 0x14EA, 0x151C, 0x154D, 0x157F, 0x15B1, 0x15E2, 0x1614, 0x1645, 0x1677, 0x16A8, 0x16DA, 0x170B, 0x173C, 0x176E, 0x179F, 0x17D1, 0x1802, 0x1833, 0x1865, 0x1896, 0x18C7, 0x18F9, 0x192A, 0x195B, 0x198D, 0x19BE, 0x19EF, 0x1A20, 0x1A51, 0x1A83, 0x1AB4, 0x1AE5, 0x1B16, 0x1B47, 0x1B78, 0x1BA9, 0x1BDA, 0x1C0C, 0x1C3D, 0x1C6E, 0x1C9F, 0x1CD0, 0x1D01, 0x1D31, 0x1D62, 0x1D93, 0x1DC4, 0x1DF5, 0x1E26, 0x1E57, 0x1E88, 0x1EB8, 0x1EE9, 0x1F1A, 0x1F4B, 0x1F7B, 0x1FAC, 0x1FDD, 0x200E, 0x203E, 0x206F, 0x209F, 0x20D0, 0x2101, 0x2131, 0x2162, 0x2192, 0x21C3, 0x21F3, 0x2224, 0x2254, 0x2284, 0x22B5, 0x22E5, 0x2316, 0x2346, 0x2376, 0x23A7, 0x23D7, 0x2407, 0x2437, 0x2467, 0x2498, 0x24C8, 0x24F8, 0x2528, 0x2558, 0x2588, 0x25B8, 0x25E8, 0x2618, 0x2648, 0x2678, 0x26A8, 0x26D8, 0x2708, 0x2738, 0x2768, 0x2797, 0x27C7, 0x27F7, 0x2827, 0x2856, 0x2886, 0x28B6, 0x28E5, 0x2915, 0x2945, 0x2974, 0x29A4, 0x29D3, 0x2A03, 0x2A32, 0x2A62, 0x2A91, 0x2AC1, 0x2AF0, 0x2B1F, 0x2B4F, 0x2B7E, 0x2BAD, 0x2BDC, 0x2C0C, 0x2C3B, 0x2C6A, 0x2C99, 0x2CC8, 0x2CF7, 0x2D26, 0x2D55, 0x2D84, 0x2DB3, 0x2DE2, 0x2E11, 0x2E40, 0x2E6F, 0x2E9E, 0x2ECC, 0x2EFB, 0x2F2A, 0x2F59, 0x2F87, 0x2FB6, 0x2FE5, 0x3013, 0x3042, 0x3070, 0x309F, 0x30CD, 0x30FC, 0x312A, 0x3159, 0x3187, 0x31B5, 0x31E4, 0x3212, 0x3240, 0x326E, 0x329D, 0x32CB, 0x32F9, 0x3327, 0x3355, 0x3383, 0x33B1, 0x33DF, 0x340D, 0x343B, 0x3469, 0x3497, 0x34C4, 0x34F2, 0x3520, 0x354E, 0x357B, 0x35A9, 0x35D7, 0x3604, 0x3632, 0x365F, 0x368D, 0x36BA, 0x36E8, 0x3715, 0x3742, 0x3770, 0x379D, 0x37CA, 0x37F7, 0x3825, 0x3852, 0x387F, 0x38AC, 0x38D9, 0x3906, 0x3933, 0x3960, 0x398D, 0x39BA, 0x39E7, 0x3A13, 0x3A40, 0x3A6D, 0x3A9A, 0x3AC6, 0x3AF3, 0x3B20, 0x3B4C, 0x3B79, 0x3BA5, 0x3BD2, 0x3BFE, 0x3C2A, 0x3C57, 0x3C83, 0x3CAF, 0x3CDC, 0x3D08, 0x3D34, 0x3D60, 0x3D8C, 0x3DB8, 0x3DE4, 0x3E10, 0x3E3C, 0x3E68, 0x3E94, 0x3EC0, 0x3EEC, 0x3F17, 0x3F43, 0x3F6F, 0x3F9A, 0x3FC6, 0x3FF1, 0x401D, 0x4048, 0x4074, 0x409F, 0x40CB, 0x40F6, 0x4121, 0x414D, 0x4178, 0x41A3, 0x41CE, 0x41F9, 0x4224, 0x424F, 0x427A, 0x42A5, 0x42D0, 0x42FB, 0x4326, 0x4351, 0x437B, 0x43A6, 0x43D1, 0x43FB, 0x4426, 0x4450, 0x447B, 0x44A5, 0x44D0, 0x44FA, 0x4524, 0x454F, 0x4579, 0x45A3, 0x45CD, 0x45F7, 0x4621, 0x464B, 0x4675, 0x469F, 0x46C9, 0x46F3, 0x471D, 0x4747, 0x4770, 0x479A, 0x47C4, 0x47ED, 0x4817, 0x4840, 0x486A, 0x4893, 0x48BD, 0x48E6, 0x490F, 0x4939, 0x4962, 0x498B, 0x49B4, 0x49DD, 0x4A06, 0x4A2F, 0x4A58, 0x4A81, 0x4AAA, 0x4AD3, 0x4AFB, 0x4B24, 0x4B4D, 0x4B75, 0x4B9E, 0x4BC7, 0x4BEF, 0x4C17, 0x4C40, 0x4C68, 0x4C91, 0x4CB9, 0x4CE1, 0x4D09, 0x4D31, 0x4D59, 0x4D81, 0x4DA9, 0x4DD1, 0x4DF9, 0x4E21, 0x4E49, 0x4E71, 0x4E98, 0x4EC0, 0x4EE8, 0x4F0F, 0x4F37, 0x4F5E, 0x4F85, 0x4FAD, 0x4FD4, 0x4FFB, 0x5023, 0x504A, 0x5071, 0x5098, 0x50BF, 0x50E6, 0x510D, 0x5134, 0x515B, 0x5181, 0x51A8, 0x51CF, 0x51F5, 0x521C, 0x5243, 0x5269, 0x5290, 0x52B6, 0x52DC, 0x5303, 0x5329, 0x534F, 0x5375, 0x539B, 0x53C1, 0x53E7, 0x540D, 0x5433, 0x5459, 0x547F, 0x54A4, 0x54CA, 0x54F0, 0x5515, 0x553B, 0x5560, 0x5586, 0x55AB, 0x55D0, 0x55F6, 0x561B, 0x5640, 0x5665, 0x568A, 0x56AF, 0x56D4, 0x56F9, 0x571E, 0x5743, 0x5767, 0x578C, 0x57B1, 0x57D5, 0x57FA, 0x581E, 0x5843, 0x5867, 0x588C, 0x58B0, 0x58D4, 0x58F8, 0x591C, 0x5940, 0x5964, 0x5988, 0x59AC, 0x59D0, 0x59F4, 0x5A18, 0x5A3B, 0x5A5F, 0x5A82, 0x5AA6, 0x5AC9, 0x5AED, 0x5B10, 0x5B34, 0x5B57, 0x5B7A, 0x5B9D, 0x5BC0, 0x5BE3, 0x5C06, 0x5C29, 0x5C4C, 0x5C6F, 0x5C91, 0x5CB4, 0x5CD7, 0x5CF9, 0x5D1C, 0x5D3E, 0x5D61, 0x5D83, 0x5DA5, 0x5DC8, 0x5DEA, 0x5E0C, 0x5E2E, 0x5E50, 0x5E72, 0x5E94, 0x5EB6, 0x5ED7, 0x5EF9, 0x5F1B, 0x5F3C, 0x5F5E, 0x5F80, 0x5FA1, 0x5FC2, 0x5FE4, 0x6005, 0x6026, 0x6047, 0x6068, 0x6089, 0x60AA, 0x60CB, 0x60EC, 0x610D, 0x612E, 0x614E, 0x616F, 0x6190, 0x61B0, 0x61D1, 0x61F1, 0x6211, 0x6232, 0x6252, 0x6272, 0x6292, 0x62B2, 0x62D2, 0x62F2, 0x6312, 0x6332, 0x6351, 0x6371, 0x6391, 0x63B0, 0x63D0, 0x63EF, 0x640F, 0x642E, 0x644D, 0x646C, 0x648B, 0x64AB, 0x64CA, 0x64E9, 0x6507, 0x6526, 0x6545, 0x6564, 0x6582, 0x65A1, 0x65C0, 0x65DE, 0x65FC, 0x661B, 0x6639, 0x6657, 0x6675, 0x6693, 0x66B2, 0x66D0, 0x66ED, 0x670B, 0x6729, 0x6747, 0x6764, 0x6782, 0x67A0, 0x67BD, 0x67DA, 0x67F8, 0x6815, 0x6832, 0x6850, 0x686D, 0x688A, 0x68A7, 0x68C4, 0x68E0, 0x68FD, 0x691A, 0x6937, 0x6953, 0x6970, 0x698C, 0x69A9, 0x69C5, 0x69E1, 0x69FD, 0x6A1A, 0x6A36, 0x6A52, 0x6A6E, 0x6A89, 0x6AA5, 0x6AC1, 0x6ADD, 0x6AF8, 0x6B14, 0x6B30, 0x6B4B, 0x6B66, 0x6B82, 0x6B9D, 0x6BB8, 0x6BD3, 0x6BEE, 0x6C09, 0x6C24, 0x6C3F, 0x6C5A, 0x6C75, 0x6C8F, 0x6CAA, 0x6CC4, 0x6CDF, 0x6CF9, 0x6D14, 0x6D2E, 0x6D48, 0x6D62, 0x6D7C, 0x6D96, 0x6DB0, 0x6DCA, 0x6DE4, 0x6DFE, 0x6E17, 0x6E31, 0x6E4A, 0x6E64, 0x6E7D, 0x6E97, 0x6EB0, 0x6EC9, 0x6EE2, 0x6EFB, 0x6F14, 0x6F2D, 0x6F46, 0x6F5F, 0x6F78, 0x6F90, 0x6FA9, 0x6FC2, 0x6FDA, 0x6FF2, 0x700B, 0x7023, 0x703B, 0x7053, 0x706B, 0x7083, 0x709B, 0x70B3, 0x70CB, 0x70E3, 0x70FA, 0x7112, 0x712A, 0x7141, 0x7158, 0x7170, 0x7187, 0x719E, 0x71B5, 0x71CC, 0x71E3, 0x71FA, 0x7211, 0x7228, 0x723F, 0x7255, 0x726C, 0x7282, 0x7299, 0x72AF, 0x72C5, 0x72DC, 0x72F2, 0x7308, 0x731E, 0x7334, 0x734A, 0x735F, 0x7375, 0x738B, 0x73A0, 0x73B6, 0x73CB, 0x73E1, 0x73F6, 0x740B, 0x7421, 0x7436, 0x744B, 0x7460, 0x7475, 0x7489, 0x749E, 0x74B3, 0x74C7, 0x74DC, 0x74F0, 0x7505, 0x7519, 0x752D, 0x7542, 0x7556, 0x756A, 0x757E, 0x7592, 0x75A6, 0x75B9, 0x75CD, 0x75E1, 0x75F4, 0x7608, 0x761B, 0x762E, 0x7642, 0x7655, 0x7668, 0x767B, 0x768E, 0x76A1, 0x76B4, 0x76C7, 0x76D9, 0x76EC, 0x76FE, 0x7711, 0x7723, 0x7736, 0x7748, 0x775A, 0x776C, 0x777E, 0x7790, 0x77A2, 0x77B4, 0x77C6, 0x77D8, 0x77E9, 0x77FB, 0x780C, 0x781E, 0x782F, 0x7840, 0x7851, 0x7863, 0x7874, 0x7885, 0x7895, 0x78A6, 0x78B7, 0x78C8, 0x78D8, 0x78E9, 0x78F9, 0x790A, 0x791A, 0x792A, 0x793A, 0x794A, 0x795B, 0x796A, 0x797A, 0x798A, 0x799A, 0x79AA, 0x79B9, 0x79C9, 0x79D8, 0x79E7, 0x79F7, 0x7A06, 0x7A15, 0x7A24, 0x7A33, 0x7A42, 0x7A51, 0x7A60, 0x7A6E, 0x7A7D, 0x7A8C, 0x7A9A, 0x7AA8, 0x7AB7, 0x7AC5, 0x7AD3, 0x7AE1, 0x7AEF, 0x7AFD, 0x7B0B, 0x7B19, 0x7B27, 0x7B34, 0x7B42, 0x7B50, 0x7B5D, 0x7B6A, 0x7B78, 0x7B85, 0x7B92, 0x7B9F, 0x7BAC, 0x7BB9, 0x7BC6, 0x7BD3, 0x7BDF, 0x7BEC, 0x7BF9, 0x7C05, 0x7C11, 0x7C1E, 0x7C2A, 0x7C36, 0x7C42, 0x7C4E, 0x7C5A, 0x7C66, 0x7C72, 0x7C7E, 0x7C89, 0x7C95, 0x7CA0, 0x7CAC, 0x7CB7, 0x7CC2, 0x7CCE, 0x7CD9, 0x7CE4, 0x7CEF, 0x7CFA, 0x7D05, 0x7D0F, 0x7D1A, 0x7D25, 0x7D2F, 0x7D3A, 0x7D44, 0x7D4E, 0x7D58, 0x7D63, 0x7D6D, 0x7D77, 0x7D81, 0x7D8A, 0x7D94, 0x7D9E, 0x7DA7, 0x7DB1, 0x7DBA, 0x7DC4, 0x7DCD, 0x7DD6, 0x7DE0, 0x7DE9, 0x7DF2, 0x7DFB, 0x7E03, 0x7E0C, 0x7E15, 0x7E1E, 0x7E26, 0x7E2F, 0x7E37, 0x7E3F, 0x7E48, 0x7E50, 0x7E58, 0x7E60, 0x7E68, 0x7E70, 0x7E78, 0x7E7F, 0x7E87, 0x7E8E, 0x7E96, 0x7E9D, 0x7EA5, 0x7EAC, 0x7EB3, 0x7EBA, 0x7EC1, 0x7EC8, 0x7ECF, 0x7ED6, 0x7EDD, 0x7EE3, 0x7EEA, 0x7EF0, 0x7EF7, 0x7EFD, 0x7F03, 0x7F0A, 0x7F10, 0x7F16, 0x7F1C, 0x7F22, 0x7F27, 0x7F2D, 0x7F33, 0x7F38, 0x7F3E, 0x7F43, 0x7F49, 0x7F4E, 0x7F53, 0x7F58, 0x7F5D, 0x7F62, 0x7F67, 0x7F6C, 0x7F71, 0x7F75, 0x7F7A, 0x7F7E, 0x7F83, 0x7F87, 0x7F8B, 0x7F90, 0x7F94, 0x7F98, 0x7F9C, 0x7FA0, 0x7FA3, 0x7FA7, 0x7FAB, 0x7FAE, 0x7FB2, 0x7FB5, 0x7FB9, 0x7FBC, 0x7FBF, 0x7FC2, 0x7FC5, 0x7FC8, 0x7FCB, 0x7FCE, 0x7FD1, 0x7FD3, 0x7FD6, 0x7FD9, 0x7FDB, 0x7FDD, 0x7FE0, 0x7FE2, 0x7FE4, 0x7FE6, 0x7FE8, 0x7FEA, 0x7FEC, 0x7FED, 0x7FEF, 0x7FF1, 0x7FF2, 0x7FF4, 0x7FF5, 0x7FF6, 0x7FF7, 0x7FF8, 0x7FF9, 0x7FFA, 0x7FFB, 0x7FFC, 0x7FFD, 0x7FFE, 0x7FFE, 0x7FFF, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x8000, 0x8000 -glabel D_800DDC3E +glabel gArcTanTable .half 0x0000, 0x000A, 0x0014, 0x001F, 0x0029, 0x0033, 0x003D, 0x0047, 0x0051, 0x005C, 0x0066, 0x0070, 0x007A, 0x0084, 0x008F, 0x0099, 0x00A3, 0x00AD, 0x00B7, 0x00C2, 0x00CC, 0x00D6, 0x00E0, 0x00EA, 0x00F4, 0x00FF, 0x0109, 0x0113, 0x011D, 0x0127, 0x0131, 0x013C, 0x0146, 0x0150, 0x015A, 0x0164, 0x016F, 0x0179, 0x0183, 0x018D, 0x0197, 0x01A1, 0x01AC, 0x01B6, 0x01C0, 0x01CA, 0x01D4, 0x01DE, 0x01E9, 0x01F3, 0x01FD, 0x0207, 0x0211, 0x021B, 0x0226, 0x0230, 0x023A, 0x0244, 0x024E, 0x0258, 0x0262, 0x026D, 0x0277, 0x0281, 0x028B, 0x0295, 0x029F, 0x02A9, 0x02B4, 0x02BE, 0x02C8, 0x02D2, 0x02DC, 0x02E6, 0x02F0, 0x02FB, 0x0305, 0x030F, 0x0319, 0x0323, 0x032D, 0x0337, 0x0341, 0x034C, 0x0356, 0x0360, 0x036A, 0x0374, 0x037E, 0x0388, 0x0392, 0x039C, 0x03A7, 0x03B1, 0x03BB, 0x03C5, 0x03CF, 0x03D9, 0x03E3, 0x03ED, 0x03F7, 0x0401, 0x040C, 0x0416, 0x0420, 0x042A, 0x0434, 0x043E, 0x0448, 0x0452, 0x045C, 0x0466, 0x0470, 0x047A, 0x0484, 0x048E, 0x0499, 0x04A3, 0x04AD, 0x04B7, 0x04C1, 0x04CB, 0x04D5, 0x04DF, 0x04E9, 0x04F3, 0x04FD, 0x0507, 0x0511, 0x051B, 0x0525, 0x052F, 0x0539, 0x0543, 0x054D, 0x0557, 0x0561, 0x056B, 0x0575, 0x057F, 0x0589, 0x0593, 0x059D, 0x05A7, 0x05B1, 0x05BB, 0x05C5, 0x05CF, 0x05D9, 0x05E3, 0x05ED, 0x05F7, 0x0601, 0x060B, 0x0615, 0x061F, 0x0629, 0x0633, 0x063D, 0x0647, 0x0651, 0x065B, 0x0665, 0x066E, 0x0678, 0x0682, 0x068C, 0x0696, 0x06A0, 0x06AA, 0x06B4, 0x06BE, 0x06C8, 0x06D2, 0x06DC, 0x06E5, 0x06EF, 0x06F9, 0x0703, 0x070D, 0x0717, 0x0721, 0x072B, 0x0735, 0x073E, 0x0748, 0x0752, 0x075C, 0x0766, 0x0770, 0x077A, 0x0783, 0x078D, 0x0797, 0x07A1, 0x07AB, 0x07B5, 0x07BE, 0x07C8, 0x07D2, 0x07DC, 0x07E6, 0x07EF, 0x07F9, 0x0803, 0x080D, 0x0817, 0x0820, 0x082A, 0x0834, 0x083E, 0x0848, 0x0851, 0x085B, 0x0865, 0x086F, 0x0878, 0x0882, 0x088C, 0x0896, 0x089F, 0x08A9, 0x08B3, 0x08BD, 0x08C6, 0x08D0, 0x08DA, 0x08E3, 0x08ED, 0x08F7, 0x0901, 0x090A, 0x0914, 0x091E, 0x0927, 0x0931, 0x093B, 0x0944, 0x094E, 0x0958, 0x0961, 0x096B, 0x0975, 0x097E, 0x0988, 0x0992, 0x099B, 0x09A5, 0x09AE, 0x09B8, 0x09C2, 0x09CB, 0x09D5, 0x09DE, 0x09E8, 0x09F2, 0x09FB, 0x0A05, 0x0A0E, 0x0A18, 0x0A22, 0x0A2B, 0x0A35, 0x0A3E, 0x0A48, 0x0A51, 0x0A5B, 0x0A64, 0x0A6E, 0x0A77, 0x0A81, 0x0A8B, 0x0A94, 0x0A9E, 0x0AA7, 0x0AB1, 0x0ABA, 0x0AC4, 0x0ACD, 0x0AD7, 0x0AE0, 0x0AE9, 0x0AF3, 0x0AFC, 0x0B06, 0x0B0F, 0x0B19, 0x0B22, 0x0B2C, 0x0B35, 0x0B3F, 0x0B48, 0x0B51, 0x0B5B, 0x0B64, 0x0B6E, 0x0B77, 0x0B80, 0x0B8A, 0x0B93, 0x0B9D, 0x0BA6, 0x0BAF, 0x0BB9, 0x0BC2, 0x0BCB, 0x0BD5, 0x0BDE, 0x0BE7, 0x0BF1, 0x0BFA, 0x0C03, 0x0C0D, 0x0C16, 0x0C1F, 0x0C29, 0x0C32, 0x0C3B, 0x0C45, 0x0C4E, 0x0C57, 0x0C60, 0x0C6A, 0x0C73, 0x0C7C, 0x0C86, 0x0C8F, 0x0C98, 0x0CA1, 0x0CAB, 0x0CB4, 0x0CBD, 0x0CC6, 0x0CCF, 0x0CD9, 0x0CE2, 0x0CEB, 0x0CF4, 0x0CFD, 0x0D07, 0x0D10, 0x0D19, 0x0D22, 0x0D2B, 0x0D34, 0x0D3E, 0x0D47, 0x0D50, 0x0D59, 0x0D62, 0x0D6B, 0x0D74, 0x0D7D, 0x0D87, 0x0D90, 0x0D99, 0x0DA2, 0x0DAB, 0x0DB4, 0x0DBD, 0x0DC6, 0x0DCF, 0x0DD8, 0x0DE1, 0x0DEA, 0x0DF3, 0x0DFC, 0x0E05, 0x0E0F, 0x0E18, 0x0E21, 0x0E2A, 0x0E33, 0x0E3C, 0x0E45, 0x0E4E, 0x0E56, 0x0E5F, 0x0E68, 0x0E71, 0x0E7A, 0x0E83, 0x0E8C, 0x0E95, 0x0E9E, 0x0EA7, 0x0EB0, 0x0EB9, 0x0EC2, 0x0ECB, 0x0ED4, 0x0EDC, 0x0EE5, 0x0EEE, 0x0EF7, 0x0F00, 0x0F09, 0x0F12, 0x0F1B, 0x0F23, 0x0F2C, 0x0F35, 0x0F3E, 0x0F47, 0x0F50, 0x0F58, 0x0F61, 0x0F6A, 0x0F73, 0x0F7C, 0x0F84, 0x0F8D, 0x0F96, 0x0F9F, 0x0FA7, 0x0FB0, 0x0FB9, 0x0FC2, 0x0FCA, 0x0FD3, 0x0FDC, 0x0FE5, 0x0FED, 0x0FF6, 0x0FFF, 0x1007, 0x1010, 0x1019, 0x1021, 0x102A, 0x1033, 0x103B, 0x1044, 0x104D, 0x1055, 0x105E, 0x1067, 0x106F, 0x1078, 0x1080, 0x1089, 0x1092, 0x109A, 0x10A3, 0x10AB, 0x10B4, 0x10BC, 0x10C5, 0x10CE, 0x10D6, 0x10DF, 0x10E7, 0x10F0, 0x10F8, 0x1101, 0x1109, 0x1112, 0x111A, 0x1123, 0x112B, 0x1134, 0x113C, 0x1145, 0x114D, 0x1156, 0x115E, 0x1166, 0x116F, 0x1177, 0x1180, 0x1188, 0x1191, 0x1199, 0x11A1, 0x11AA, 0x11B2, 0x11BB, 0x11C3, 0x11CB, 0x11D4, 0x11DC, 0x11E4, 0x11ED, 0x11F5, 0x11FD, 0x1206, 0x120E, 0x1216, 0x121F, 0x1227, 0x122F, 0x1237, 0x1240, 0x1248, 0x1250, 0x1259, 0x1261, 0x1269, 0x1271, 0x127A, 0x1282, 0x128A, 0x1292, 0x129A, 0x12A3, 0x12AB, 0x12B3, 0x12BB, 0x12C3, 0x12CC, 0x12D4, 0x12DC, 0x12E4, 0x12EC, 0x12F4, 0x12FC, 0x1305, 0x130D, 0x1315, 0x131D, 0x1325, 0x132D, 0x1335, 0x133D, 0x1345, 0x134D, 0x1355, 0x135E, 0x1366, 0x136E, 0x1376, 0x137E, 0x1386, 0x138E, 0x1396, 0x139E, 0x13A6, 0x13AE, 0x13B6, 0x13BE, 0x13C6, 0x13CE, 0x13D6, 0x13DE, 0x13E6, 0x13ED, 0x13F5, 0x13FD, 0x1405, 0x140D, 0x1415, 0x141D, 0x1425, 0x142D, 0x1435, 0x143D, 0x1444, 0x144C, 0x1454, 0x145C, 0x1464, 0x146C, 0x1473, 0x147B, 0x1483, 0x148B, 0x1493, 0x149B, 0x14A2, 0x14AA, 0x14B2, 0x14BA, 0x14C1, 0x14C9, 0x14D1, 0x14D9, 0x14E0, 0x14E8, 0x14F0, 0x14F8, 0x14FF, 0x1507, 0x150F, 0x1516, 0x151E, 0x1526, 0x152D, 0x1535, 0x153D, 0x1544, 0x154C, 0x1554, 0x155B, 0x1563, 0x156B, 0x1572, 0x157A, 0x1581, 0x1589, 0x1591, 0x1598, 0x15A0, 0x15A7, 0x15AF, 0x15B7, 0x15BE, 0x15C6, 0x15CD, 0x15D5, 0x15DC, 0x15E4, 0x15EB, 0x15F3, 0x15FA, 0x1602, 0x1609, 0x1611, 0x1618, 0x1620, 0x1627, 0x162F, 0x1636, 0x163E, 0x1645, 0x164C, 0x1654, 0x165B, 0x1663, 0x166A, 0x1671, 0x1679, 0x1680, 0x1688, 0x168F, 0x1696, 0x169E, 0x16A5, 0x16AC, 0x16B4, 0x16BB, 0x16C2, 0x16CA, 0x16D1, 0x16D8, 0x16E0, 0x16E7, 0x16EE, 0x16F6, 0x16FD, 0x1704, 0x170B, 0x1713, 0x171A, 0x1721, 0x1728, 0x1730, 0x1737, 0x173E, 0x1745, 0x174C, 0x1754, 0x175B, 0x1762, 0x1769, 0x1770, 0x1778, 0x177F, 0x1786, 0x178D, 0x1794, 0x179B, 0x17A2, 0x17AA, 0x17B1, 0x17B8, 0x17BF, 0x17C6, 0x17CD, 0x17D4, 0x17DB, 0x17E2, 0x17E9, 0x17F0, 0x17F7, 0x17FE, 0x1806, 0x180D, 0x1814, 0x181B, 0x1822, 0x1829, 0x1830, 0x1837, 0x183E, 0x1845, 0x184C, 0x1853, 0x185A, 0x1860, 0x1867, 0x186E, 0x1875, 0x187C, 0x1883, 0x188A, 0x1891, 0x1898, 0x189F, 0x18A6, 0x18AD, 0x18B3, 0x18BA, 0x18C1, 0x18C8, 0x18CF, 0x18D6, 0x18DD, 0x18E3, 0x18EA, 0x18F1, 0x18F8, 0x18FF, 0x1906, 0x190C, 0x1913, 0x191A, 0x1921, 0x1928, 0x192E, 0x1935, 0x193C, 0x1943, 0x1949, 0x1950, 0x1957, 0x195D, 0x1964, 0x196B, 0x1972, 0x1978, 0x197F, 0x1986, 0x198C, 0x1993, 0x199A, 0x19A0, 0x19A7, 0x19AE, 0x19B4, 0x19BB, 0x19C2, 0x19C8, 0x19CF, 0x19D5, 0x19DC, 0x19E3, 0x19E9, 0x19F0, 0x19F6, 0x19FD, 0x1A04, 0x1A0A, 0x1A11, 0x1A17, 0x1A1E, 0x1A24, 0x1A2B, 0x1A31, 0x1A38, 0x1A3E, 0x1A45, 0x1A4B, 0x1A52, 0x1A58, 0x1A5F, 0x1A65, 0x1A6C, 0x1A72, 0x1A79, 0x1A7F, 0x1A86, 0x1A8C, 0x1A93, 0x1A99, 0x1A9F, 0x1AA6, 0x1AAC, 0x1AB3, 0x1AB9, 0x1AC0, 0x1AC6, 0x1ACC, 0x1AD3, 0x1AD9, 0x1ADF, 0x1AE6, 0x1AEC, 0x1AF2, 0x1AF9, 0x1AFF, 0x1B05, 0x1B0C, 0x1B12, 0x1B18, 0x1B1F, 0x1B25, 0x1B2B, 0x1B32, 0x1B38, 0x1B3E, 0x1B44, 0x1B4B, 0x1B51, 0x1B57, 0x1B5D, 0x1B64, 0x1B6A, 0x1B70, 0x1B76, 0x1B7D, 0x1B83, 0x1B89, 0x1B8F, 0x1B95, 0x1B9C, 0x1BA2, 0x1BA8, 0x1BAE, 0x1BB4, 0x1BBA, 0x1BC1, 0x1BC7, 0x1BCD, 0x1BD3, 0x1BD9, 0x1BDF, 0x1BE5, 0x1BEB, 0x1BF2, 0x1BF8, 0x1BFE, 0x1C04, 0x1C0A, 0x1C10, 0x1C16, 0x1C1C, 0x1C22, 0x1C28, 0x1C2E, 0x1C34, 0x1C3A, 0x1C40, 0x1C46, 0x1C4C, 0x1C52, 0x1C58, 0x1C5E, 0x1C64, 0x1C6A, 0x1C70, 0x1C76, 0x1C7C, 0x1C82, 0x1C88, 0x1C8E, 0x1C94, 0x1C9A, 0x1CA0, 0x1CA6, 0x1CAC, 0x1CB2, 0x1CB8, 0x1CBE, 0x1CC3, 0x1CC9, 0x1CCF, 0x1CD5, 0x1CDB, 0x1CE1, 0x1CE7, 0x1CED, 0x1CF3, 0x1CF8, 0x1CFE, 0x1D04, 0x1D0A, 0x1D10, 0x1D16, 0x1D1B, 0x1D21, 0x1D27, 0x1D2D, 0x1D33, 0x1D38, 0x1D3E, 0x1D44, 0x1D4A, 0x1D4F, 0x1D55, 0x1D5B, 0x1D61, 0x1D66, 0x1D6C, 0x1D72, 0x1D78, 0x1D7D, 0x1D83, 0x1D89, 0x1D8E, 0x1D94, 0x1D9A, 0x1DA0, 0x1DA5, 0x1DAB, 0x1DB1, 0x1DB6, 0x1DBC, 0x1DC2, 0x1DC7, 0x1DCD, 0x1DD3, 0x1DD8, 0x1DDE, 0x1DE3, 0x1DE9, 0x1DEF, 0x1DF4, 0x1DFA, 0x1DFF, 0x1E05, 0x1E0B, 0x1E10, 0x1E16, 0x1E1B, 0x1E21, 0x1E26, 0x1E2C, 0x1E32, 0x1E37, 0x1E3D, 0x1E42, 0x1E48, 0x1E4D, 0x1E53, 0x1E58, 0x1E5E, 0x1E63, 0x1E69, 0x1E6E, 0x1E74, 0x1E79, 0x1E7F, 0x1E84, 0x1E8A, 0x1E8F, 0x1E94, 0x1E9A, 0x1E9F, 0x1EA5, 0x1EAA, 0x1EB0, 0x1EB5, 0x1EBA, 0x1EC0, 0x1EC5, 0x1ECB, 0x1ED0, 0x1ED5, 0x1EDB, 0x1EE0, 0x1EE6, 0x1EEB, 0x1EF0, 0x1EF6, 0x1EFB, 0x1F00, 0x1F06, 0x1F0B, 0x1F10, 0x1F16, 0x1F1B, 0x1F20, 0x1F26, 0x1F2B, 0x1F30, 0x1F36, 0x1F3B, 0x1F40, 0x1F45, 0x1F4B, 0x1F50, 0x1F55, 0x1F5A, 0x1F60, 0x1F65, 0x1F6A, 0x1F6F, 0x1F75, 0x1F7A, 0x1F7F, 0x1F84, 0x1F8A, 0x1F8F, 0x1F94, 0x1F99, 0x1F9E, 0x1FA4, 0x1FA9, 0x1FAE, 0x1FB3, 0x1FB8, 0x1FBD, 0x1FC3, 0x1FC8, 0x1FCD, 0x1FD2, 0x1FD7, 0x1FDC, 0x1FE1, 0x1FE6, 0x1FEC, 0x1FF1, 0x1FF6, 0x1FFB, 0x2000 diff --git a/asm/unknown_070110/func_8007066C.s b/asm/unknown_070110/func_8007066C.s index 6f0589bf..97e6f992 100644 --- a/asm/unknown_070110/func_8007066C.s +++ b/asm/unknown_070110/func_8007066C.s @@ -33,8 +33,8 @@ glabel func_8007066C /* 0712D0 800706D0 000442F8 */ dsll $t0, $a0, 0xb /* 0712D4 800706D4 000542F8 */ dsll $t0, $a1, 0xb /* 0712D8 800706D8 0104001F */ ddivu $zero, $t0, $a0 -/* 0712DC 800706DC 3C09800E */ lui $t1, %hi(D_800DDC3E) # $t1, 0x800e -/* 0712E0 800706E0 2529DC3E */ addiu $t1, %lo(D_800DDC3E) # addiu $t1, $t1, -0x23c2 +/* 0712DC 800706DC 3C09800E */ lui $t1, %hi(gArcTanTable) # $t1, 0x800e +/* 0712E0 800706E0 2529DC3E */ addiu $t1, %lo(gArcTanTable) # addiu $t1, $t1, -0x23c2 /* 0712E4 800706E4 24424000 */ addiu $v0, $v0, 0x4000 /* 0712E8 800706E8 14800002 */ bnez $a0, .L800706F4 /* 0712EC 800706EC 00000000 */ nop @@ -51,8 +51,8 @@ glabel func_8007066C /* 071314 80070714 000442F8 */ dsll $t0, $a0, 0xb .L80070718: /* 071318 80070718 0105001F */ ddivu $zero, $t0, $a1 -/* 07131C 8007071C 3C09800E */ lui $t1, %hi(D_800DDC3E) # $t1, 0x800e -/* 071320 80070720 2529DC3E */ addiu $t1, %lo(D_800DDC3E) # addiu $t1, $t1, -0x23c2 +/* 07131C 8007071C 3C09800E */ lui $t1, %hi(gArcTanTable) # $t1, 0x800e +/* 071320 80070720 2529DC3E */ addiu $t1, %lo(gArcTanTable) # addiu $t1, $t1, -0x23c2 /* 071324 80070724 14A00002 */ bnez $a1, .L80070730 /* 071328 80070728 00000000 */ nop /* 07132C 8007072C 0007000D */ break 7 diff --git a/asm/unknown_070110/func_8007082C.s b/asm/unknown_070110/func_8007082C.s index 36e86b3b..0f8a0e6c 100644 --- a/asm/unknown_070110/func_8007082C.s +++ b/asm/unknown_070110/func_8007082C.s @@ -7,9 +7,9 @@ glabel func_80070830 /* 07143C 8007083C 38847FFF */ xori $a0, $a0, 0x7fff /* 071440 80070840 000450C2 */ srl $t2, $a0, 3 .L80070844: -/* 071444 80070844 3C02800E */ lui $v0, %hi(D_800DD43C) # $v0, 0x800e +/* 071444 80070844 3C02800E */ lui $v0, %hi(gSineTable) # $v0, 0x800e /* 071448 80070848 314A07FE */ andi $t2, $t2, 0x7fe -/* 07144C 8007084C 2442D43C */ addiu $v0, %lo(D_800DD43C) # addiu $v0, $v0, -0x2bc4 +/* 07144C 8007084C 2442D43C */ addiu $v0, %lo(gSineTable) # addiu $v0, $v0, -0x2bc4 /* 071450 80070850 004A1021 */ addu $v0, $v0, $t2 /* 071454 80070854 944A0002 */ lhu $t2, 2($v0) /* 071458 80070858 94420000 */ lhu $v0, ($v0) diff --git a/asm/unknown_070110/func_80070890.s b/asm/unknown_070110/func_80070890.s index 2b682f41..9f389377 100644 --- a/asm/unknown_070110/func_80070890.s +++ b/asm/unknown_070110/func_80070890.s @@ -6,9 +6,9 @@ glabel func_80070890 /* 07149C 8007089C 38847FFF */ xori $a0, $a0, 0x7fff /* 0714A0 800708A0 000450C2 */ srl $t2, $a0, 3 .L800708A4: -/* 0714A4 800708A4 3C02800E */ lui $v0, %hi(D_800DD43C) # $v0, 0x800e +/* 0714A4 800708A4 3C02800E */ lui $v0, %hi(gSineTable) # $v0, 0x800e /* 0714A8 800708A8 314A07FE */ andi $t2, $t2, 0x7fe -/* 0714AC 800708AC 2442D43C */ addiu $v0, %lo(D_800DD43C) # addiu $v0, $v0, -0x2bc4 +/* 0714AC 800708AC 2442D43C */ addiu $v0, %lo(gSineTable) # addiu $v0, $v0, -0x2bc4 /* 0714B0 800708B0 004A1021 */ addu $v0, $v0, $t2 /* 0714B4 800708B4 94420000 */ lhu $v0, ($v0) /* 0714B8 800708B8 00042400 */ sll $a0, $a0, 0x10 From a551e62b86b068229268a1f8e300fdbab3618454 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:37:55 +0100 Subject: [PATCH 04/25] racer.c prelim labelling --- asm/non_matchings/racer/func_80042D20.s | 32 ++--- asm/non_matchings/racer/func_80043ECC.s | 4 +- asm/non_matchings/racer/func_8004447C.s | 28 ++--- asm/non_matchings/racer/func_800452A0.s | 4 +- asm/non_matchings/racer/func_80045C48.s | 4 +- asm/non_matchings/racer/func_80046524.s | 60 ++++----- asm/non_matchings/racer/func_80049794.s | 80 ++++++------ asm/non_matchings/racer/func_8004C2B0.s | 4 +- asm/non_matchings/racer/func_8004CC20.s | 14 +-- asm/non_matchings/racer/func_8004DE38.s | 44 +++---- asm/non_matchings/racer/func_8004F7F4.s | 18 +-- asm/non_matchings/racer/func_80050A28.s | 66 +++++----- asm/non_matchings/racer/func_8005250C.s | 12 +- asm/non_matchings/racer/func_80052B64.s | 4 +- asm/non_matchings/racer/func_80052D7C.s | 14 +-- asm/non_matchings/racer/func_80054110.s | 10 +- asm/non_matchings/racer/func_8005492C.s | 14 +-- asm/non_matchings/racer/func_80055EC0.s | 4 +- asm/non_matchings/racer/func_80057220.s | 4 +- asm/non_matchings/racer/func_800581E8.s | 4 +- asm/non_matchings/racer/func_8005A424.s | 4 +- asm/non_matchings/racer/func_8005A6F0.s | 60 ++++----- src/object_models.c | 2 +- src/racer.c | 160 +++++++++++++++--------- src/racer.h | 14 +-- 25 files changed, 351 insertions(+), 313 deletions(-) diff --git a/asm/non_matchings/racer/func_80042D20.s b/asm/non_matchings/racer/func_80042D20.s index f2003926..5f11da27 100644 --- a/asm/non_matchings/racer/func_80042D20.s +++ b/asm/non_matchings/racer/func_80042D20.s @@ -67,8 +67,8 @@ glabel func_80042D20 /* 0439A0 80042DA0 AFAA0060 */ sw $t2, 0x60($sp) /* 0439A4 80042DA4 8FAA0060 */ lw $t2, 0x60($sp) /* 0439A8 80042DA8 10400007 */ beqz $v0, .L80042DC8 -/* 0439AC 80042DAC 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 -/* 0439B0 80042DB0 2442D528 */ addiu $v0, %lo(D_8011D528) # addiu $v0, $v0, -0x2ad8 +/* 0439AC 80042DAC 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 +/* 0439B0 80042DB0 2442D528 */ addiu $v0, %lo(gCurrentCarInput) # addiu $v0, $v0, -0x2ad8 /* 0439B4 80042DB4 8C590000 */ lw $t9, ($v0) /* 0439B8 80042DB8 00000000 */ nop /* 0439BC 80042DBC 372E8000 */ ori $t6, $t9, 0x8000 @@ -431,11 +431,11 @@ glabel func_80042D20 /* 043EFC 800432FC 4608803E */ c.le.s $f16, $f8 /* 043F00 80043300 00000000 */ nop /* 043F04 80043304 45000005 */ bc1f .L8004331C -/* 043F08 80043308 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 -/* 043F0C 8004330C 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) -/* 043F10 80043310 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 043F08 80043308 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 +/* 043F0C 8004330C 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) +/* 043F10 80043310 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 043F14 80043314 35EE8000 */ ori $t6, $t7, 0x8000 -/* 043F18 80043318 AC2ED528 */ sw $t6, %lo(D_8011D528)($at) +/* 043F18 80043318 AC2ED528 */ sw $t6, %lo(gCurrentCarInput)($at) .L8004331C: /* 043F1C 8004331C AFA9005C */ sw $t1, 0x5c($sp) /* 043F20 80043320 A7AC0034 */ sh $t4, 0x34($sp) @@ -772,14 +772,14 @@ glabel func_80042D20 /* 044400 80043800 30F80004 */ andi $t8, $a3, 4 .L80043804: /* 044404 80043804 13000014 */ beqz $t8, .L80043858 -/* 044408 80043808 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 -/* 04440C 8004380C 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) +/* 044408 80043808 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 +/* 04440C 8004380C 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) /* 044410 80043810 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff /* 044414 80043814 34217FFF */ ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff /* 044418 80043818 01C17824 */ and $t7, $t6, $at -/* 04441C 8004381C 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 04441C 8004381C 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 044420 80043820 1000000D */ b .L80043858 -/* 044424 80043824 AC2FD528 */ sw $t7, %lo(D_8011D528)($at) +/* 044424 80043824 AC2FD528 */ sw $t7, %lo(gCurrentCarInput)($at) .L80043828: /* 044428 80043828 2401FFFD */ li $at, -3 /* 04442C 8004382C 00E1C824 */ and $t9, $a3, $at @@ -798,13 +798,13 @@ glabel func_80042D20 /* 04445C 8004385C 00000000 */ nop /* 044460 80043860 31F90004 */ andi $t9, $t7, 4 /* 044464 80043864 13200007 */ beqz $t9, .L80043884 -/* 044468 80043868 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 -/* 04446C 8004386C 8F18D528 */ lw $t8, %lo(D_8011D528)($t8) +/* 044468 80043868 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 +/* 04446C 8004386C 8F18D528 */ lw $t8, %lo(gCurrentCarInput)($t8) /* 044470 80043870 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff /* 044474 80043874 34217FFF */ ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff /* 044478 80043878 03017024 */ and $t6, $t8, $at -/* 04447C 8004387C 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 044480 80043880 AC2ED528 */ sw $t6, %lo(D_8011D528)($at) +/* 04447C 8004387C 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 044480 80043880 AC2ED528 */ sw $t6, %lo(gCurrentCarInput)($at) .L80043884: /* 044484 80043884 860F01C6 */ lh $t7, 0x1c6($s0) /* 044488 80043888 00000000 */ nop @@ -1176,9 +1176,9 @@ glabel func_80042D20 /* 0449E4 80043DE4 E60E0124 */ swc1 $f14, 0x124($s0) .L80043DE8: /* 0449E8 80043DE8 820E01D8 */ lb $t6, 0x1d8($s0) -/* 0449EC 80043DEC 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 0449EC 80043DEC 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 0449F0 80043DF0 11C00015 */ beqz $t6, .L80043E48 -/* 0449F4 80043DF4 2442D528 */ addiu $v0, %lo(D_8011D528) # addiu $v0, $v0, -0x2ad8 +/* 0449F4 80043DF4 2442D528 */ addiu $v0, %lo(gCurrentCarInput) # addiu $v0, $v0, -0x2ad8 /* 0449F8 80043DF8 A20001D3 */ sb $zero, 0x1d3($s0) /* 0449FC 80043DFC A2000213 */ sb $zero, 0x213($s0) /* 044A00 80043E00 8C4F0000 */ lw $t7, ($v0) diff --git a/asm/non_matchings/racer/func_80043ECC.s b/asm/non_matchings/racer/func_80043ECC.s index 77123338..d6517e64 100644 --- a/asm/non_matchings/racer/func_80043ECC.s +++ b/asm/non_matchings/racer/func_80043ECC.s @@ -23,7 +23,7 @@ glabel func_80043ECC /* 044B1C 80043F1C 81EFD5BB */ lb $t7, %lo(D_8011D5BB)($t7) /* 044B20 80043F20 240C0001 */ li $t4, 1 /* 044B24 80043F24 15E0000B */ bnez $t7, .L80043F54 -/* 044B28 80043F28 3C0D8012 */ lui $t5, %hi(D_8011D528) # $t5, 0x8012 +/* 044B28 80043F28 3C0D8012 */ lui $t5, %hi(gCurrentCarInput) # $t5, 0x8012 /* 044B2C 80043F2C 80580014 */ lb $t8, 0x14($v0) /* 044B30 80043F30 80590016 */ lb $t9, 0x16($v0) /* 044B34 80043F34 80490015 */ lb $t1, 0x15($v0) @@ -35,7 +35,7 @@ glabel func_80043ECC /* 044B4C 80043F4C 3C018012 */ lui $at, %hi(D_8011D5BB) # $at, 0x8012 /* 044B50 80043F50 A02CD5BB */ sb $t4, %lo(D_8011D5BB)($at) .L80043F54: -/* 044B54 80043F54 8DADD528 */ lw $t5, %lo(D_8011D528)($t5) +/* 044B54 80043F54 8DADD528 */ lw $t5, %lo(gCurrentCarInput)($t5) /* 044B58 80043F58 8FB80028 */ lw $t8, 0x28($sp) /* 044B5C 80043F5C 31AE8000 */ andi $t6, $t5, 0x8000 /* 044B60 80043F60 15C00016 */ bnez $t6, .L80043FBC diff --git a/asm/non_matchings/racer/func_8004447C.s b/asm/non_matchings/racer/func_8004447C.s index 37c7f625..9f95f17e 100644 --- a/asm/non_matchings/racer/func_8004447C.s +++ b/asm/non_matchings/racer/func_8004447C.s @@ -13,9 +13,9 @@ glabel func_8004447C /* 045080 80044480 AC20D52C */ sw $zero, %lo(gActivePlayerButtonPress)($at) /* 045084 80044484 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 /* 045088 80044488 AC20D530 */ sw $zero, %lo(D_8011D530)($at) -/* 04508C 8004448C 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 04508C 8004448C 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 045090 80044490 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 045094 80044494 AC20D528 */ sw $zero, %lo(D_8011D528)($at) +/* 045094 80044494 AC20D528 */ sw $zero, %lo(gCurrentCarInput)($at) /* 045098 80044498 3C018012 */ lui $at, %hi(D_8011D534) # $at, 0x8012 /* 04509C 8004449C AC20D534 */ sw $zero, %lo(D_8011D534)($at) /* 0450A0 800444A0 AFBF001C */ sw $ra, 0x1c($sp) @@ -514,11 +514,11 @@ glabel L80044ADC /* 0457AC 80044BAC 44804000 */ mtc1 $zero, $f8 /* 0457B0 80044BB0 46005421 */ cvt.d.s $f16, $f10 /* 0457B4 80044BB4 4630403C */ c.lt.d $f8, $f16 -/* 0457B8 80044BB8 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 0457B8 80044BB8 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 0457BC 80044BBC 4500001B */ bc1f .L80044C2C /* 0457C0 80044BC0 34198000 */ li $t9, 32768 /* 0457C4 80044BC4 10000019 */ b .L80044C2C -/* 0457C8 80044BC8 AC39D528 */ sw $t9, %lo(D_8011D528)($at) +/* 0457C8 80044BC8 AC39D528 */ sw $t9, %lo(gCurrentCarInput)($at) .L80044BCC: /* 0457CC 80044BCC C604002C */ lwc1 $f4, 0x2c($s0) /* 0457D0 80044BD0 3C01C010 */ li $at, 0xC0100000 # -2.250000 @@ -530,22 +530,22 @@ glabel L80044ADC /* 0457E8 80044BE8 45000005 */ bc1f .L80044C00 /* 0457EC 80044BEC 240C4000 */ li $t4, 16384 /* 0457F0 80044BF0 3418C000 */ li $t8, 49152 -/* 0457F4 80044BF4 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 0457F4 80044BF4 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 0457F8 80044BF8 10000003 */ b .L80044C08 -/* 0457FC 80044BFC AC38D528 */ sw $t8, %lo(D_8011D528)($at) +/* 0457FC 80044BFC AC38D528 */ sw $t8, %lo(gCurrentCarInput)($at) .L80044C00: -/* 045800 80044C00 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 045804 80044C04 AC2CD528 */ sw $t4, %lo(D_8011D528)($at) +/* 045800 80044C00 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 045804 80044C04 AC2CD528 */ sw $t4, %lo(gCurrentCarInput)($at) .L80044C08: /* 045808 80044C08 C608002C */ lwc1 $f8, 0x2c($s0) /* 04580C 80044C0C 3C01BFF0 */ li $at, 0xBFF00000 # -1.875000 /* 045810 80044C10 44815800 */ mtc1 $at, $f11 /* 045814 80044C14 46004421 */ cvt.d.s $f16, $f8 /* 045818 80044C18 4630503C */ c.lt.d $f10, $f16 -/* 04581C 80044C1C 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 04581C 80044C1C 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 045820 80044C20 45000002 */ bc1f .L80044C2C /* 045824 80044C24 340D8000 */ li $t5, 32768 -/* 045828 80044C28 AC2DD528 */ sw $t5, %lo(D_8011D528)($at) +/* 045828 80044C28 AC2DD528 */ sw $t5, %lo(gCurrentCarInput)($at) .L80044C2C: /* 04582C 80044C2C 8E080158 */ lw $t0, 0x158($s0) /* 045830 80044C30 00000000 */ nop @@ -604,15 +604,15 @@ glabel L80044ADC /* 0458F8 80044CF8 44803000 */ mtc1 $zero, $f6 /* 0458FC 80044CFC 460042A1 */ cvt.d.s $f10, $f8 /* 045900 80044D00 462A303C */ c.lt.d $f6, $f10 -/* 045904 80044D04 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 045904 80044D04 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 045908 80044D08 45000005 */ bc1f .L80044D20 /* 04590C 80044D0C 240D4000 */ li $t5, 16384 /* 045910 80044D10 340CC000 */ li $t4, 49152 -/* 045914 80044D14 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 045914 80044D14 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 045918 80044D18 10000002 */ b .L80044D24 -/* 04591C 80044D1C AC2CD528 */ sw $t4, %lo(D_8011D528)($at) +/* 04591C 80044D1C AC2CD528 */ sw $t4, %lo(gCurrentCarInput)($at) .L80044D20: -/* 045920 80044D20 AC2DD528 */ sw $t5, %lo(D_8011D528)($at) +/* 045920 80044D20 AC2DD528 */ sw $t5, %lo(gCurrentCarInput)($at) .L80044D24: /* 045924 80044D24 3C01800E */ lui $at, %hi(D_800E6350 + 4) # $at, 0x800e /* 045928 80044D28 C7B0005C */ lwc1 $f16, 0x5c($sp) diff --git a/asm/non_matchings/racer/func_800452A0.s b/asm/non_matchings/racer/func_800452A0.s index 126ba4e4..312aa2a8 100644 --- a/asm/non_matchings/racer/func_800452A0.s +++ b/asm/non_matchings/racer/func_800452A0.s @@ -16,9 +16,9 @@ glabel func_800452A0 /* 045EA8 800452A8 AC20D52C */ sw $zero, %lo(gActivePlayerButtonPress)($at) /* 045EAC 800452AC 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 /* 045EB0 800452B0 AC20D530 */ sw $zero, %lo(D_8011D530)($at) -/* 045EB4 800452B4 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 045EB4 800452B4 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 045EB8 800452B8 340E8000 */ li $t6, 32768 -/* 045EBC 800452BC AC2ED528 */ sw $t6, %lo(D_8011D528)($at) +/* 045EBC 800452BC AC2ED528 */ sw $t6, %lo(gCurrentCarInput)($at) /* 045EC0 800452C0 3C018012 */ lui $at, %hi(D_8011D534) # $at, 0x8012 /* 045EC4 800452C4 AFB60048 */ sw $s6, 0x48($sp) /* 045EC8 800452C8 AC20D534 */ sw $zero, %lo(D_8011D534)($at) diff --git a/asm/non_matchings/racer/func_80045C48.s b/asm/non_matchings/racer/func_80045C48.s index 41bd7989..48c696f6 100644 --- a/asm/non_matchings/racer/func_80045C48.s +++ b/asm/non_matchings/racer/func_80045C48.s @@ -1,7 +1,7 @@ glabel func_80045C48 -/* 046848 80045C48 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 046848 80045C48 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 04684C 80045C4C 27BDFF18 */ addiu $sp, $sp, -0xe8 -/* 046850 80045C50 AC20D528 */ sw $zero, %lo(D_8011D528)($at) +/* 046850 80045C50 AC20D528 */ sw $zero, %lo(gCurrentCarInput)($at) /* 046854 80045C54 3C018012 */ lui $at, %hi(gActivePlayerButtonPress) # $at, 0x8012 /* 046858 80045C58 AC20D52C */ sw $zero, %lo(gActivePlayerButtonPress)($at) /* 04685C 80045C5C 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 diff --git a/asm/non_matchings/racer/func_80046524.s b/asm/non_matchings/racer/func_80046524.s index 08670cc8..7ecbc151 100644 --- a/asm/non_matchings/racer/func_80046524.s +++ b/asm/non_matchings/racer/func_80046524.s @@ -96,8 +96,8 @@ glabel func_80046524 /* 0471B0 800465B0 44816000 */ mtc1 $at, $f12 /* 0471B4 800465B4 3C018012 */ lui $at, %hi(D_8011D550) # $at, 0x8012 /* 0471B8 800465B8 A420D550 */ sh $zero, %lo(D_8011D550)($at) -/* 0471BC 800465BC 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 0471C0 800465C0 AC20D554 */ sw $zero, %lo(D_8011D554)($at) +/* 0471BC 800465BC 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 0471C0 800465C0 AC20D554 */ sw $zero, %lo(gCurrentCarSteerVel)($at) /* 0471C4 800465C4 3C018012 */ lui $at, %hi(D_8011D558) # $at, 0x8012 /* 0471C8 800465C8 AC20D558 */ sw $zero, %lo(D_8011D558)($at) /* 0471CC 800465CC C626000C */ lwc1 $f6, 0xc($s1) @@ -203,9 +203,9 @@ glabel func_80046524 /* 047344 80046744 0C0148D3 */ jal func_8005234C /* 047348 80046748 02002025 */ move $a0, $s0 .L8004674C: -/* 04734C 8004674C 3C198012 */ lui $t9, %hi(D_8011D528) # $t9, 0x8012 -/* 047350 80046750 8F39D528 */ lw $t9, %lo(D_8011D528)($t9) -/* 047354 80046754 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 +/* 04734C 8004674C 3C198012 */ lui $t9, %hi(gCurrentCarInput) # $t9, 0x8012 +/* 047350 80046750 8F39D528 */ lw $t9, %lo(gCurrentCarInput)($t9) +/* 047354 80046754 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 /* 047358 80046758 332A8000 */ andi $t2, $t9, 0x8000 /* 04735C 8004675C 1140001E */ beqz $t2, .L800467D8 /* 047360 80046760 00000000 */ nop @@ -273,8 +273,8 @@ glabel func_80046524 /* 04744C 8004684C 460E303C */ c.lt.s $f6, $f14 /* 047450 80046850 46001006 */ mov.s $f0, $f2 /* 047454 80046854 45000008 */ bc1f .L80046878 -/* 047458 80046858 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 -/* 04745C 8004685C 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 047458 80046858 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 +/* 04745C 8004685C 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 047460 80046860 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 047464 80046864 316C8000 */ andi $t4, $t3, 0x8000 /* 047468 80046868 11800003 */ beqz $t4, .L80046878 @@ -302,7 +302,7 @@ glabel func_80046524 .L800468BC: /* 0474BC 800468BC 46007221 */ cvt.d.s $f8, $f14 /* 0474C0 800468C0 4628203C */ c.lt.d $f4, $f8 -/* 0474C4 800468C4 8C84D528 */ lw $a0, %lo(D_8011D528)($a0) +/* 0474C4 800468C4 8C84D528 */ lw $a0, %lo(gCurrentCarInput)($a0) /* 0474C8 800468C8 45000008 */ bc1f .L800468EC /* 0474CC 800468CC 308E4000 */ andi $t6, $a0, 0x4000 /* 0474D0 800468D0 3C01800E */ lui $at, %hi(D_800E63C0 + 4) # $at, 0x800e @@ -705,7 +705,7 @@ glabel func_80046524 /* 047A94 80046E94 A20A01DB */ sb $t2, 0x1db($s0) .L80046E98: /* 047A98 80046E98 04610019 */ bgez $v1, .L80046F00 -/* 047A9C 80046E9C 3C0A8012 */ lui $t2, %hi(D_8011D528) # $t2, 0x8012 +/* 047A9C 80046E9C 3C0A8012 */ lui $t2, %hi(gCurrentCarInput) # $t2, 0x8012 /* 047AA0 80046EA0 00036080 */ sll $t4, $v1, 2 /* 047AA4 80046EA4 01836023 */ subu $t4, $t4, $v1 /* 047AA8 80046EA8 000C6080 */ sll $t4, $t4, 2 @@ -731,12 +731,12 @@ glabel func_80046524 /* 047AF8 80046EF8 27190001 */ addiu $t9, $t8, 1 /* 047AFC 80046EFC A21901DB */ sb $t9, 0x1db($s0) .L80046F00: -/* 047B00 80046F00 8D4AD528 */ lw $t2, %lo(D_8011D528)($t2) +/* 047B00 80046F00 8D4AD528 */ lw $t2, %lo(gCurrentCarInput)($t2) /* 047B04 80046F04 3C01FFFF */ lui $at, (0xFFFF3FFF >> 16) # lui $at, 0xffff /* 047B08 80046F08 34213FFF */ ori $at, (0xFFFF3FFF & 0xFFFF) # ori $at, $at, 0x3fff /* 047B0C 80046F0C 01416024 */ and $t4, $t2, $at -/* 047B10 80046F10 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 047B14 80046F14 AC2CD528 */ sw $t4, %lo(D_8011D528)($at) +/* 047B10 80046F10 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 047B14 80046F14 AC2CD528 */ sw $t4, %lo(gCurrentCarInput)($at) /* 047B18 80046F18 3C018012 */ lui $at, %hi(D_8011D534) # $at, 0x8012 /* 047B1C 80046F1C AC20D534 */ sw $zero, %lo(D_8011D534)($at) /* 047B20 80046F20 A20001E1 */ sb $zero, 0x1e1($s0) @@ -933,12 +933,12 @@ glabel func_80046524 /* 047DF0 800471F0 46240182 */ mul.d $f6, $f0, $f4 /* 047DF4 800471F4 C7AB0050 */ lwc1 $f11, 0x50($sp) /* 047DF8 800471F8 C7AA0054 */ lwc1 $f10, 0x54($sp) -/* 047DFC 800471FC 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 +/* 047DFC 800471FC 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 /* 047E00 80047200 462A3202 */ mul.d $f8, $f6, $f10 /* 047E04 80047204 46280101 */ sub.d $f4, $f0, $f8 /* 047E08 80047208 462021A0 */ cvt.s.d $f6, $f4 /* 047E0C 8004720C E6260020 */ swc1 $f6, 0x20($s1) -/* 047E10 80047210 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 047E10 80047210 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 047E14 80047214 00000000 */ nop /* 047E18 80047218 31F84000 */ andi $t8, $t7, 0x4000 /* 047E1C 8004721C 13000013 */ beqz $t8, .L8004726C @@ -1408,9 +1408,9 @@ glabel func_80046524 .L800478EC: /* 0484EC 800478EC 46206283 */ div.d $f10, $f12, $f0 /* 0484F0 800478F0 44832000 */ mtc1 $v1, $f4 -/* 0484F4 800478F4 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 +/* 0484F4 800478F4 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 /* 0484F8 800478F8 468021A0 */ cvt.s.w $f6, $f4 -/* 0484FC 800478FC 8C84D528 */ lw $a0, %lo(D_8011D528)($a0) +/* 0484FC 800478FC 8C84D528 */ lw $a0, %lo(gCurrentCarInput)($a0) /* 048500 80047900 00000000 */ nop /* 048504 80047904 308E8000 */ andi $t6, $a0, 0x8000 /* 048508 80047908 308F0010 */ andi $t7, $a0, 0x10 @@ -1488,7 +1488,7 @@ glabel func_80046524 /* 048614 80047A14 8D8CD55C */ lw $t4, %lo(D_8011D55C)($t4) /* 048618 80047A18 2401FFFF */ li $at, -1 /* 04861C 80047A1C 15810038 */ bne $t4, $at, .L80047B00 -/* 048620 80047A20 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 +/* 048620 80047A20 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 /* 048624 80047A24 820B01D8 */ lb $t3, 0x1d8($s0) /* 048628 80047A28 3C013FD0 */ li $at, 0x3FD00000 # 1.625000 /* 04862C 80047A2C 15600034 */ bnez $t3, .L80047B00 @@ -1503,7 +1503,7 @@ glabel func_80046524 /* 048650 80047A50 C428641C */ lwc1 $f8, %lo(D_800E6418 + 4)($at) /* 048654 80047A54 3C01800E */ lui $at, %hi(D_800E6420 + 4) # $at, 0x800e /* 048658 80047A58 46203420 */ cvt.s.d $f16, $f6 -/* 04865C 80047A5C 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 +/* 04865C 80047A5C 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 /* 048660 80047A60 46008121 */ cvt.d.s $f4, $f16 /* 048664 80047A64 46282282 */ mul.d $f10, $f4, $f8 /* 048668 80047A68 44802000 */ mtc1 $zero, $f4 @@ -1523,10 +1523,10 @@ glabel func_80046524 /* 04869C 80047A9C 00000000 */ nop /* 0486A0 80047AA0 45000005 */ bc1f .L80047AB8 /* 0486A4 80047AA4 00000000 */ nop -/* 0486A8 80047AA8 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) -/* 0486AC 80047AAC 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 0486A8 80047AA8 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) +/* 0486AC 80047AAC 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 0486B0 80047AB0 35CF0010 */ ori $t7, $t6, 0x10 -/* 0486B4 80047AB4 AC2FD528 */ sw $t7, %lo(D_8011D528)($at) +/* 0486B4 80047AB4 AC2FD528 */ sw $t7, %lo(gCurrentCarInput)($at) .L80047AB8: /* 0486B8 80047AB8 C6040038 */ lwc1 $f4, 0x38($s0) /* 0486BC 80047ABC C626001C */ lwc1 $f6, 0x1c($s1) @@ -1553,7 +1553,7 @@ glabel func_80046524 /* 04870C 80047B0C C426642C */ lwc1 $f6, %lo(D_800E6428 + 4)($at) /* 048710 80047B10 46002021 */ cvt.d.s $f0, $f4 /* 048714 80047B14 46260202 */ mul.d $f8, $f0, $f6 -/* 048718 80047B18 8C84D528 */ lw $a0, %lo(D_8011D528)($a0) +/* 048718 80047B18 8C84D528 */ lw $a0, %lo(gCurrentCarInput)($a0) /* 04871C 80047B1C 3C014000 */ li $at, 0x40000000 # 2.000000 /* 048720 80047B20 30980010 */ andi $t8, $a0, 0x10 /* 048724 80047B24 1300002E */ beqz $t8, .L80047BE0 @@ -1614,7 +1614,7 @@ glabel func_80046524 /* 0487F0 80047BF0 3C014000 */ li $at, 0x40000000 # 2.000000 /* 0487F4 80047BF4 3C0A8012 */ lui $t2, %hi(D_8011D584) # $t2, 0x8012 /* 0487F8 80047BF8 460A3101 */ sub.s $f4, $f6, $f10 -/* 0487FC 80047BFC 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 +/* 0487FC 80047BFC 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 /* 048800 80047C00 E624001C */ swc1 $f4, 0x1c($s1) /* 048804 80047C04 C6060054 */ lwc1 $f6, 0x54($s0) /* 048808 80047C08 00000000 */ nop @@ -1738,7 +1738,7 @@ glabel func_80046524 /* 0489D8 80047DD8 C7A400FC */ lwc1 $f4, 0xfc($sp) /* 0489DC 80047DDC 4500000D */ bc1f .L80047E14 /* 0489E0 80047DE0 00000000 */ nop -/* 0489E4 80047DE4 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 0489E4 80047DE4 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 0489E8 80047DE8 C7A800FC */ lwc1 $f8, 0xfc($sp) /* 0489EC 80047DEC 316E8000 */ andi $t6, $t3, 0x8000 /* 0489F0 80047DF0 15C00008 */ bnez $t6, .L80047E14 @@ -1784,8 +1784,8 @@ glabel func_80046524 /* 048A88 80047E88 E6280024 */ swc1 $f8, 0x24($s1) .L80047E8C: /* 048A8C 80047E8C AE00010C */ sw $zero, 0x10c($s0) -/* 048A90 80047E90 3C188012 */ lui $t8, %hi(D_8011D554) # $t8, 0x8012 -/* 048A94 80047E94 8F18D554 */ lw $t8, %lo(D_8011D554)($t8) +/* 048A90 80047E90 3C188012 */ lui $t8, %hi(gCurrentCarSteerVel) # $t8, 0x8012 +/* 048A94 80047E94 8F18D554 */ lw $t8, %lo(gCurrentCarSteerVel)($t8) /* 048A98 80047E98 860201A2 */ lh $v0, 0x1a2($s0) /* 048A9C 80047E9C 860C01A0 */ lh $t4, 0x1a0($s0) /* 048AA0 80047EA0 03026823 */ subu $t5, $t8, $v0 @@ -2089,8 +2089,8 @@ glabel func_80046524 /* 048EEC 800482EC 4622403C */ c.lt.d $f8, $f2 /* 048EF0 800482F0 00000000 */ nop /* 048EF4 800482F4 45000017 */ bc1f .L80048354 -/* 048EF8 800482F8 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 -/* 048EFC 800482FC 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) +/* 048EF8 800482F8 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 +/* 048EFC 800482FC 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) /* 048F00 80048300 00004025 */ move $t0, $zero /* 048F04 80048304 31CF0010 */ andi $t7, $t6, 0x10 /* 048F08 80048308 11E00006 */ beqz $t7, .L80048324 @@ -2252,13 +2252,13 @@ glabel func_80046524 /* 049158 80048558 10200026 */ beqz $at, .L800485F4 /* 04915C 8004855C 00000000 */ nop /* 049160 80048560 8E2E0040 */ lw $t6, 0x40($s1) -/* 049164 80048564 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 +/* 049164 80048564 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 /* 049168 80048568 81CF0057 */ lb $t7, 0x57($t6) /* 04916C 8004856C 00000000 */ nop /* 049170 80048570 29E10009 */ slti $at, $t7, 9 /* 049174 80048574 1420001F */ bnez $at, .L800485F4 /* 049178 80048578 00000000 */ nop -/* 04917C 8004857C 8F18D528 */ lw $t8, %lo(D_8011D528)($t8) +/* 04917C 8004857C 8F18D528 */ lw $t8, %lo(gCurrentCarInput)($t8) /* 049180 80048580 34018010 */ li $at, 32784 /* 049184 80048584 330D8010 */ andi $t5, $t8, 0x8010 /* 049188 80048588 15A10011 */ bne $t5, $at, .L800485D0 diff --git a/asm/non_matchings/racer/func_80049794.s b/asm/non_matchings/racer/func_80049794.s index d744b69d..5f7a38b4 100644 --- a/asm/non_matchings/racer/func_80049794.s +++ b/asm/non_matchings/racer/func_80049794.s @@ -282,8 +282,8 @@ glabel func_80049794 /* 04A6E0 80049AE0 44818000 */ mtc1 $at, $f16 /* 04A6E4 80049AE4 3C018012 */ lui $at, %hi(D_8011D550) # $at, 0x8012 /* 04A6E8 80049AE8 A420D550 */ sh $zero, %lo(D_8011D550)($at) -/* 04A6EC 80049AEC 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 04A6F0 80049AF0 AC20D554 */ sw $zero, %lo(D_8011D554)($at) +/* 04A6EC 80049AEC 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 04A6F0 80049AF0 AC20D554 */ sw $zero, %lo(gCurrentCarSteerVel)($at) /* 04A6F4 80049AF4 3C018012 */ lui $at, %hi(D_8011D558) # $at, 0x8012 /* 04A6F8 80049AF8 AC20D558 */ sw $zero, %lo(D_8011D558)($at) /* 04A6FC 80049AFC C624000C */ lwc1 $f4, 0xc($s1) @@ -401,9 +401,9 @@ glabel func_80049794 /* 04A898 80049C98 0C0148D3 */ jal func_8005234C /* 04A89C 80049C9C 02002025 */ move $a0, $s0 .L80049CA0: -/* 04A8A0 80049CA0 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 -/* 04A8A4 80049CA4 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) -/* 04A8A8 80049CA8 3C198012 */ lui $t9, %hi(D_8011D528) # $t9, 0x8012 +/* 04A8A0 80049CA0 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 +/* 04A8A4 80049CA4 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) +/* 04A8A8 80049CA8 3C198012 */ lui $t9, %hi(gCurrentCarInput) # $t9, 0x8012 /* 04A8AC 80049CAC 31CF8000 */ andi $t7, $t6, 0x8000 /* 04A8B0 80049CB0 11E00019 */ beqz $t7, .L80049D18 /* 04A8B4 80049CB4 3C01800E */ lui $at, %hi(D_800E64B8 + 4) # $at, 0x800e @@ -463,7 +463,7 @@ glabel func_80049794 /* 04A984 80049D84 00000000 */ nop /* 04A988 80049D88 E60A00B4 */ swc1 $f10, 0xb4($s0) .L80049D8C: -/* 04A98C 80049D8C 8F39D528 */ lw $t9, %lo(D_8011D528)($t9) +/* 04A98C 80049D8C 8F39D528 */ lw $t9, %lo(gCurrentCarInput)($t9) /* 04A990 80049D90 C61200B4 */ lwc1 $f18, 0xb4($s0) /* 04A994 80049D94 332B4000 */ andi $t3, $t9, 0x4000 /* 04A998 80049D98 11600038 */ beqz $t3, .L80049E7C @@ -819,7 +819,7 @@ glabel func_80049794 /* 04AEC0 8004A2C0 1506FFF8 */ bne $t0, $a2, .L8004A2A4 /* 04AEC4 8004A2C4 24630001 */ addiu $v1, $v1, 1 /* 04AEC8 8004A2C8 14A60002 */ bne $a1, $a2, .L8004A2D4 -/* 04AECC 8004A2CC 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 +/* 04AECC 8004A2CC 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 /* 04AED0 8004A2D0 A2000175 */ sb $zero, 0x175($s0) .L8004A2D4: /* 04AED4 8004A2D4 860E0000 */ lh $t6, ($s0) @@ -835,7 +835,7 @@ glabel func_80049794 /* 04AEFC 8004A2FC 3C018012 */ lui $at, %hi(D_8011D582) # $at, 0x8012 /* 04AF00 8004A300 A039D582 */ sb $t9, %lo(D_8011D582)($at) .L8004A304: -/* 04AF04 8004A304 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 04AF04 8004A304 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 04AF08 8004A308 00000000 */ nop /* 04AF0C 8004A30C 316C4000 */ andi $t4, $t3, 0x4000 /* 04AF10 8004A310 11800013 */ beqz $t4, .L8004A360 @@ -903,7 +903,7 @@ glabel func_80049794 /* 04B000 8004A400 2529D538 */ addiu $t1, %lo(D_8011D538) # addiu $t1, $t1, -0x2ac8 .L8004A404: /* 04B004 8004A404 820C01D6 */ lb $t4, 0x1d6($s0) -/* 04B008 8004A408 3C0D8012 */ lui $t5, %hi(D_8011D528) # $t5, 0x8012 +/* 04B008 8004A408 3C0D8012 */ lui $t5, %hi(gCurrentCarInput) # $t5, 0x8012 /* 04B00C 8004A40C 29810005 */ slti $at, $t4, 5 /* 04B010 8004A410 14200018 */ bnez $at, .L8004A474 /* 04B014 8004A414 3C0F800E */ lui $t7, %hi(D_800DCB98) # $t7, 0x800e @@ -932,7 +932,7 @@ glabel func_80049794 /* 04B070 8004A470 E7A600C4 */ swc1 $f6, 0xc4($sp) .L8004A474: /* 04B074 8004A474 A20001E0 */ sb $zero, 0x1e0($s0) -/* 04B078 8004A478 8DADD528 */ lw $t5, %lo(D_8011D528)($t5) +/* 04B078 8004A478 8DADD528 */ lw $t5, %lo(gCurrentCarInput)($t5) /* 04B07C 8004A47C 00000000 */ nop /* 04B080 8004A480 31AE4000 */ andi $t6, $t5, 0x4000 /* 04B084 8004A484 11C00007 */ beqz $t6, .L8004A4A4 @@ -1305,13 +1305,13 @@ glabel func_80049794 /* 04B5C0 8004A9C0 00000000 */ nop /* 04B5C4 8004A9C4 E5C60030 */ swc1 $f6, 0x30($t6) .L8004A9C8: -/* 04B5C8 8004A9C8 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 -/* 04B5CC 8004A9CC 8F18D528 */ lw $t8, %lo(D_8011D528)($t8) +/* 04B5C8 8004A9C8 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 +/* 04B5CC 8004A9CC 8F18D528 */ lw $t8, %lo(gCurrentCarInput)($t8) /* 04B5D0 8004A9D0 3C01FFFF */ lui $at, (0xFFFF5FFF >> 16) # lui $at, 0xffff /* 04B5D4 8004A9D4 34215FFF */ ori $at, (0xFFFF5FFF & 0xFFFF) # ori $at, $at, 0x5fff /* 04B5D8 8004A9D8 0301C824 */ and $t9, $t8, $at -/* 04B5DC 8004A9DC 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 04B5E0 8004A9E0 AC39D528 */ sw $t9, %lo(D_8011D528)($at) +/* 04B5DC 8004A9DC 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 04B5E0 8004A9E0 AC39D528 */ sw $t9, %lo(gCurrentCarInput)($at) /* 04B5E4 8004A9E4 8FA400F8 */ lw $a0, 0xf8($sp) /* 04B5E8 8004A9E8 820B01DB */ lb $t3, 0x1db($s0) /* 04B5EC 8004A9EC 3C013F80 */ li $at, 0x3F800000 # 1.000000 @@ -1414,7 +1414,7 @@ glabel func_80049794 .L8004AB4C: /* 04B74C 8004AB4C 86230002 */ lh $v1, 2($s1) /* 04B750 8004AB50 820F01D5 */ lb $t7, 0x1d5($s0) -/* 04B754 8004AB54 3C0D8012 */ lui $t5, %hi(D_8011D528) # $t5, 0x8012 +/* 04B754 8004AB54 3C0D8012 */ lui $t5, %hi(gCurrentCarInput) # $t5, 0x8012 /* 04B758 8004AB58 15E00009 */ bnez $t7, .L8004AB80 /* 04B75C 8004AB5C 00604025 */ move $t0, $v1 /* 04B760 8004AB60 0002C080 */ sll $t8, $v0, 2 @@ -1426,7 +1426,7 @@ glabel func_80049794 /* 04B778 8004AB78 006B6021 */ addu $t4, $v1, $t3 /* 04B77C 8004AB7C A62C0002 */ sh $t4, 2($s1) .L8004AB80: -/* 04B780 8004AB80 8DADD528 */ lw $t5, %lo(D_8011D528)($t5) +/* 04B780 8004AB80 8DADD528 */ lw $t5, %lo(gCurrentCarInput)($t5) /* 04B784 8004AB84 00000000 */ nop /* 04B788 8004AB88 31AE0010 */ andi $t6, $t5, 0x10 /* 04B78C 8004AB8C 15C00002 */ bnez $t6, .L8004AB98 @@ -1503,11 +1503,11 @@ glabel func_80049794 /* 04B890 8004AC90 142001A6 */ bnez $at, .L8004B32C /* 04B894 8004AC94 00000000 */ nop /* 04B898 8004AC98 862E0002 */ lh $t6, 2($s1) -/* 04B89C 8004AC9C 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 +/* 04B89C 8004AC9C 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 /* 04B8A0 8004ACA0 29C1C000 */ slti $at, $t6, -0x4000 /* 04B8A4 8004ACA4 102001A1 */ beqz $at, .L8004B32C /* 04B8A8 8004ACA8 00000000 */ nop -/* 04B8AC 8004ACAC 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 04B8AC 8004ACAC 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 04B8B0 8004ACB0 2419003C */ li $t9, 60 /* 04B8B4 8004ACB4 31F80010 */ andi $t8, $t7, 0x10 /* 04B8B8 8004ACB8 1300019C */ beqz $t8, .L8004B32C @@ -1550,11 +1550,11 @@ glabel func_80049794 /* 04B93C 8004AD3C 1020017B */ beqz $at, .L8004B32C /* 04B940 8004AD40 00000000 */ nop /* 04B944 8004AD44 86390002 */ lh $t9, 2($s1) -/* 04B948 8004AD48 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 +/* 04B948 8004AD48 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 /* 04B94C 8004AD4C 2B214001 */ slti $at, $t9, 0x4001 /* 04B950 8004AD50 14200176 */ bnez $at, .L8004B32C /* 04B954 8004AD54 00000000 */ nop -/* 04B958 8004AD58 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 04B958 8004AD58 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 04B95C 8004AD5C 240D003C */ li $t5, 60 /* 04B960 8004AD60 316C0010 */ andi $t4, $t3, 0x10 /* 04B964 8004AD64 11800171 */ beqz $t4, .L8004B32C @@ -1565,18 +1565,18 @@ glabel func_80049794 /* 04B974 8004AD74 820401E1 */ lb $a0, 0x1e1($s0) /* 04B978 8004AD78 A3A000A1 */ sb $zero, 0xa1($sp) /* 04B97C 8004AD7C 820301E2 */ lb $v1, 0x1e2($s0) -/* 04B980 8004AD80 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 04B980 8004AD80 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 04B984 8004AD84 1060000B */ beqz $v1, .L8004ADB4 /* 04B988 8004AD88 2401FFEF */ li $at, -17 -/* 04B98C 8004AD8C 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 04B98C 8004AD8C 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 04B990 8004AD90 240F0001 */ li $t7, 1 /* 04B994 8004AD94 304E0010 */ andi $t6, $v0, 0x10 /* 04B998 8004AD98 11C00002 */ beqz $t6, .L8004ADA4 /* 04B99C 8004AD9C 0041C024 */ and $t8, $v0, $at /* 04B9A0 8004ADA0 A3AF00A1 */ sb $t7, 0xa1($sp) .L8004ADA4: -/* 04B9A4 8004ADA4 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 04B9A8 8004ADA8 AC38D528 */ sw $t8, %lo(D_8011D528)($at) +/* 04B9A4 8004ADA4 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 04B9A8 8004ADA8 AC38D528 */ sw $t8, %lo(gCurrentCarInput)($at) /* 04B9AC 8004ADAC 820301E2 */ lb $v1, 0x1e2($s0) /* 04B9B0 8004ADB0 00000000 */ nop .L8004ADB4: @@ -1613,8 +1613,8 @@ glabel func_80049794 /* 04BA24 8004AE24 46085183 */ div.s $f6, $f10, $f8 /* 04BA28 8004AE28 44812800 */ mtc1 $at, $f5 /* 04BA2C 8004AE2C 44802000 */ mtc1 $zero, $f4 -/* 04BA30 8004AE30 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 -/* 04BA34 8004AE34 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 04BA30 8004AE30 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 +/* 04BA34 8004AE34 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 04BA38 8004AE38 00000000 */ nop /* 04BA3C 8004AE3C 316C0010 */ andi $t4, $t3, 0x10 /* 04BA40 8004AE40 460034A1 */ cvt.d.s $f18, $f6 @@ -1671,11 +1671,11 @@ glabel func_80049794 /* 04BB08 8004AF08 11810025 */ beq $t4, $at, .L8004AFA0 /* 04BB0C 8004AF0C 3C088012 */ lui $t0, %hi(D_8011D534) # $t0, 0x8012 /* 04BB10 8004AF10 820B01D8 */ lb $t3, 0x1d8($s0) -/* 04BB14 8004AF14 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 04BB14 8004AF14 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 04BB18 8004AF18 15600021 */ bnez $t3, .L8004AFA0 /* 04BB1C 8004AF1C 00000000 */ nop /* 04BB20 8004AF20 860801A4 */ lh $t0, 0x1a4($s0) -/* 04BB24 8004AF24 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 04BB24 8004AF24 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 04BB28 8004AF28 00084023 */ negu $t0, $t0 /* 04BB2C 8004AF2C 00086983 */ sra $t5, $t0, 6 /* 04BB30 8004AF30 304F0010 */ andi $t7, $v0, 0x10 @@ -1737,12 +1737,12 @@ glabel func_80049794 /* 04BC00 8004B000 00411021 */ addu $v0, $v0, $at .L8004B004: /* 04BC04 8004B004 00580019 */ multu $v0, $t8 -/* 04BC08 8004B008 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 +/* 04BC08 8004B008 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 /* 04BC0C 8004B00C 0000C812 */ mflo $t9 /* 04BC10 8004B010 00195903 */ sra $t3, $t9, 4 /* 04BC14 8004B014 006B6821 */ addu $t5, $v1, $t3 /* 04BC18 8004B018 A60D01A4 */ sh $t5, 0x1a4($s0) -/* 04BC1C 8004B01C 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) +/* 04BC1C 8004B01C 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) /* 04BC20 8004B020 8FB800F8 */ lw $t8, 0xf8($sp) /* 04BC24 8004B024 31CC0010 */ andi $t4, $t6, 0x10 /* 04BC28 8004B028 11800005 */ beqz $t4, .L8004B040 @@ -1758,8 +1758,8 @@ glabel func_80049794 /* 04BC4C 8004B04C 01EB6823 */ subu $t5, $t7, $t3 /* 04BC50 8004B050 A60D01A0 */ sh $t5, 0x1a0($s0) .L8004B054: -/* 04BC54 8004B054 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 -/* 04BC58 8004B058 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 04BC54 8004B054 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 +/* 04BC58 8004B058 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 04BC5C 8004B05C 3C0F8012 */ lui $t7, %hi(D_8011D55C) # $t7, 0x8012 /* 04BC60 8004B060 304E0010 */ andi $t6, $v0, 0x10 /* 04BC64 8004B064 11C00009 */ beqz $t6, .L8004B08C @@ -1781,7 +1781,7 @@ glabel func_80049794 /* 04BCA0 8004B0A0 46083482 */ mul.s $f18, $f6, $f8 /* 04BCA4 8004B0A4 C4246514 */ lwc1 $f4, %lo(D_800E6510 + 4)($at) /* 04BCA8 8004B0A8 C628001C */ lwc1 $f8, 0x1c($s1) -/* 04BCAC 8004B0AC 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 04BCAC 8004B0AC 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 04BCB0 8004B0B0 460092A1 */ cvt.d.s $f10, $f18 /* 04BCB4 8004B0B4 46245182 */ mul.d $f6, $f10, $f4 /* 04BCB8 8004B0B8 C6120050 */ lwc1 $f18, 0x50($s0) @@ -1800,7 +1800,7 @@ glabel func_80049794 /* 04BCEC 8004B0EC 46149182 */ mul.s $f6, $f18, $f20 /* 04BCF0 8004B0F0 46062201 */ sub.s $f8, $f4, $f6 /* 04BCF4 8004B0F4 E6280024 */ swc1 $f8, 0x24($s1) -/* 04BCF8 8004B0F8 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 04BCF8 8004B0F8 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 04BCFC 8004B0FC 00000000 */ nop /* 04BD00 8004B100 30590010 */ andi $t9, $v0, 0x10 /* 04BD04 8004B104 03201025 */ move $v0, $t9 @@ -2038,7 +2038,7 @@ glabel func_80049794 /* 04C064 8004B464 460E0002 */ mul.s $f0, $f0, $f14 /* 04C068 8004B468 C62A001C */ lwc1 $f10, 0x1c($s1) /* 04C06C 8004B46C C6280020 */ lwc1 $f8, 0x20($s1) -/* 04C070 8004B470 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 +/* 04C070 8004B470 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 /* 04C074 8004B474 46009102 */ mul.s $f4, $f18, $f0 /* 04C078 8004B478 46045181 */ sub.s $f6, $f10, $f4 /* 04C07C 8004B47C E626001C */ swc1 $f6, 0x1c($s1) @@ -2116,7 +2116,7 @@ glabel func_80049794 /* 04C18C 8004B58C C7A600D8 */ lwc1 $f6, 0xd8($sp) /* 04C190 8004B590 4500000D */ bc1f .L8004B5C8 /* 04C194 8004B594 00000000 */ nop -/* 04C198 8004B598 8F18D528 */ lw $t8, %lo(D_8011D528)($t8) +/* 04C198 8004B598 8F18D528 */ lw $t8, %lo(gCurrentCarInput)($t8) /* 04C19C 8004B59C C7A800D8 */ lwc1 $f8, 0xd8($sp) /* 04C1A0 8004B5A0 330C8000 */ andi $t4, $t8, 0x8000 /* 04C1A4 8004B5A4 15800008 */ bnez $t4, .L8004B5C8 @@ -2321,8 +2321,8 @@ glabel func_80049794 .L8004B8A0: /* 04C4A0 8004B8A0 C7AC00EC */ lwc1 $f12, 0xec($sp) /* 04C4A4 8004B8A4 AE00010C */ sw $zero, 0x10c($s0) -/* 04C4A8 8004B8A8 3C0D8012 */ lui $t5, %hi(D_8011D554) # $t5, 0x8012 -/* 04C4AC 8004B8AC 8DADD554 */ lw $t5, %lo(D_8011D554)($t5) +/* 04C4A8 8004B8A8 3C0D8012 */ lui $t5, %hi(gCurrentCarSteerVel) # $t5, 0x8012 +/* 04C4AC 8004B8AC 8DADD554 */ lw $t5, %lo(gCurrentCarSteerVel)($t5) /* 04C4B0 8004B8B0 860201A2 */ lh $v0, 0x1a2($s0) /* 04C4B4 8004B8B4 860C01A0 */ lh $t4, 0x1a0($s0) /* 04C4B8 8004B8B8 01A25823 */ subu $t3, $t5, $v0 @@ -2848,8 +2848,8 @@ glabel func_80049794 /* 04CC3C 8004C03C 02202025 */ move $a0, $s1 /* 04CC40 8004C040 11800007 */ beqz $t4, .L8004C060 /* 04CC44 8004C044 02002825 */ move $a1, $s0 -/* 04CC48 8004C048 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 -/* 04CC4C 8004C04C 2442D528 */ addiu $v0, %lo(D_8011D528) # addiu $v0, $v0, -0x2ad8 +/* 04CC48 8004C048 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 +/* 04CC4C 8004C04C 2442D528 */ addiu $v0, %lo(gCurrentCarInput) # addiu $v0, $v0, -0x2ad8 /* 04CC50 8004C050 8C4E0000 */ lw $t6, ($v0) /* 04CC54 8004C054 00000000 */ nop /* 04CC58 8004C058 35D90010 */ ori $t9, $t6, 0x10 diff --git a/asm/non_matchings/racer/func_8004C2B0.s b/asm/non_matchings/racer/func_8004C2B0.s index c353dfeb..3f80e3f0 100644 --- a/asm/non_matchings/racer/func_8004C2B0.s +++ b/asm/non_matchings/racer/func_8004C2B0.s @@ -53,7 +53,7 @@ glabel func_8004C2B0 /* 04CF3C 8004C33C C7B20030 */ lwc1 $f18, 0x30($sp) /* 04CF40 8004C340 24010001 */ li $at, 1 /* 04CF44 8004C344 14410007 */ bne $v0, $at, .L8004C364 -/* 04CF48 8004C348 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 +/* 04CF48 8004C348 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 /* 04CF4C 8004C34C 3C014334 */ li $at, 0x43340000 # 180.000000 /* 04CF50 8004C350 44817000 */ mtc1 $at, $f14 /* 04CF54 8004C354 3C014248 */ li $at, 0x42480000 # 50.000000 @@ -69,7 +69,7 @@ glabel func_8004C2B0 /* 04CF78 8004C378 44819000 */ mtc1 $at, $f18 /* 04CF7C 8004C37C 00000000 */ nop .L8004C380: -/* 04CF80 8004C380 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 04CF80 8004C380 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 04CF84 8004C384 00000000 */ nop /* 04CF88 8004C388 31F80010 */ andi $t8, $t7, 0x10 /* 04CF8C 8004C38C 13000006 */ beqz $t8, .L8004C3A8 diff --git a/asm/non_matchings/racer/func_8004CC20.s b/asm/non_matchings/racer/func_8004CC20.s index 7878f7e6..0ec9b238 100644 --- a/asm/non_matchings/racer/func_8004CC20.s +++ b/asm/non_matchings/racer/func_8004CC20.s @@ -48,8 +48,8 @@ glabel func_8004CC20 /* 04D8A0 8004CCA0 A2000203 */ sb $zero, 0x203($s0) /* 04D8A4 8004CCA4 3C018012 */ lui $at, %hi(D_8011D550) # $at, 0x8012 /* 04D8A8 8004CCA8 A420D550 */ sh $zero, %lo(D_8011D550)($at) -/* 04D8AC 8004CCAC 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 04D8B0 8004CCB0 AC20D554 */ sw $zero, %lo(D_8011D554)($at) +/* 04D8AC 8004CCAC 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 04D8B0 8004CCB0 AC20D554 */ sw $zero, %lo(gCurrentCarSteerVel)($at) /* 04D8B4 8004CCB4 3C018012 */ lui $at, %hi(D_8011D558) # $at, 0x8012 /* 04D8B8 8004CCB8 AC20D558 */ sw $zero, %lo(D_8011D558)($at) /* 04D8BC 8004CCBC C624000C */ lwc1 $f4, 0xc($s1) @@ -139,12 +139,12 @@ glabel func_8004CC20 /* 04D9F4 8004CDF4 0C01BD93 */ jal guMtxXFMF /* 04D9F8 8004CDF8 3C063F80 */ lui $a2, 0x3f80 /* 04D9FC 8004CDFC 340E8000 */ li $t6, 32768 -/* 04DA00 8004CE00 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 04DA04 8004CE04 AC2ED528 */ sw $t6, %lo(D_8011D528)($at) +/* 04DA00 8004CE00 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 04DA04 8004CE04 AC2ED528 */ sw $t6, %lo(gCurrentCarInput)($at) /* 04DA08 8004CE08 02202025 */ move $a0, $s1 /* 04DA0C 8004CE0C 0C014D71 */ jal func_800535C4 /* 04DA10 8004CE10 02002825 */ move $a1, $s0 -/* 04DA14 8004CE14 0C014D99 */ jal func_80053664 +/* 04DA14 8004CE14 0C014D99 */ jal handle_car_velocity_control /* 04DA18 8004CE18 02002025 */ move $a0, $s0 /* 04DA1C 8004CE1C 8FA600DC */ lw $a2, 0xdc($sp) /* 04DA20 8004CE20 02202025 */ move $a0, $s1 @@ -486,7 +486,7 @@ glabel func_8004CC20 /* 04DF10 8004D310 C624001C */ lwc1 $f4, 0x1c($s1) /* 04DF14 8004D314 46009402 */ mul.s $f16, $f18, $f0 /* 04DF18 8004D318 C62A0020 */ lwc1 $f10, 0x20($s1) -/* 04DF1C 8004D31C 3C0B8012 */ lui $t3, %hi(D_8011D554) # $t3, 0x8012 +/* 04DF1C 8004D31C 3C0B8012 */ lui $t3, %hi(gCurrentCarSteerVel) # $t3, 0x8012 /* 04DF20 8004D320 02202025 */ move $a0, $s1 /* 04DF24 8004D324 46102181 */ sub.s $f6, $f4, $f16 /* 04DF28 8004D328 C6300024 */ lwc1 $f16, 0x24($s1) @@ -502,7 +502,7 @@ glabel func_8004CC20 /* 04DF50 8004D350 46088281 */ sub.s $f10, $f16, $f8 /* 04DF54 8004D354 E62A0024 */ swc1 $f10, 0x24($s1) /* 04DF58 8004D358 AE00010C */ sw $zero, 0x10c($s0) -/* 04DF5C 8004D35C 8D6BD554 */ lw $t3, %lo(D_8011D554)($t3) +/* 04DF5C 8004D35C 8D6BD554 */ lw $t3, %lo(gCurrentCarSteerVel)($t3) /* 04DF60 8004D360 860201A2 */ lh $v0, 0x1a2($s0) /* 04DF64 8004D364 860F01A0 */ lh $t7, 0x1a0($s0) /* 04DF68 8004D368 01626023 */ subu $t4, $t3, $v0 diff --git a/asm/non_matchings/racer/func_8004DE38.s b/asm/non_matchings/racer/func_8004DE38.s index f2d98476..bbbcf797 100644 --- a/asm/non_matchings/racer/func_8004DE38.s +++ b/asm/non_matchings/racer/func_8004DE38.s @@ -610,9 +610,9 @@ glabel func_8004DE38 /* 04F2AC 8004E6AC 0C01A94A */ jal get_buttons_held_from_player /* 04F2B0 8004E6B0 AC22D538 */ sw $v0, %lo(D_8011D538)($at) /* 04F2B4 8004E6B4 8FA400AC */ lw $a0, 0xac($sp) -/* 04F2B8 8004E6B8 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 +/* 04F2B8 8004E6B8 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 /* 04F2BC 8004E6BC 0C01A955 */ jal get_buttons_pressed_from_player -/* 04F2C0 8004E6C0 AC22D528 */ sw $v0, %lo(D_8011D528)($at) +/* 04F2C0 8004E6C0 AC22D528 */ sw $v0, %lo(gCurrentCarInput)($at) /* 04F2C4 8004E6C4 8FA400AC */ lw $a0, 0xac($sp) /* 04F2C8 8004E6C8 3C018012 */ lui $at, %hi(gActivePlayerButtonPress) # $at, 0x8012 /* 04F2CC 8004E6CC 0C01A95E */ jal get_buttons_released_from_player @@ -631,8 +631,8 @@ glabel func_8004DE38 /* 04F2F8 8004E6F8 0C01105C */ jal func_80044170 /* 04F2FC 8004E6FC 02002825 */ move $a1, $s0 .L8004E700: -/* 04F300 8004E700 3C098012 */ lui $t1, %hi(D_8011D528) # $t1, 0x8012 -/* 04F304 8004E704 8D29D528 */ lw $t1, %lo(D_8011D528)($t1) +/* 04F300 8004E700 3C098012 */ lui $t1, %hi(gCurrentCarInput) # $t1, 0x8012 +/* 04F304 8004E704 8D29D528 */ lw $t1, %lo(gCurrentCarInput)($t1) /* 04F308 8004E708 00000000 */ nop /* 04F30C 8004E70C 312A8000 */ andi $t2, $t1, 0x8000 /* 04F310 8004E710 15400002 */ bnez $t2, .L8004E71C @@ -667,8 +667,8 @@ glabel func_8004DE38 /* 04F37C 8004E77C AC20D534 */ sw $zero, %lo(D_8011D534)($at) /* 04F380 8004E780 3C018012 */ lui $at, %hi(D_8011D538) # $at, 0x8012 /* 04F384 8004E784 AC20D538 */ sw $zero, %lo(D_8011D538)($at) -/* 04F388 8004E788 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 04F38C 8004E78C AC20D528 */ sw $zero, %lo(D_8011D528)($at) +/* 04F388 8004E788 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 04F38C 8004E78C AC20D528 */ sw $zero, %lo(gCurrentCarInput)($at) /* 04F390 8004E790 3C018012 */ lui $at, %hi(gActivePlayerButtonPress) # $at, 0x8012 /* 04F394 8004E794 AC20D52C */ sw $zero, %lo(gActivePlayerButtonPress)($at) /* 04F398 8004E798 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 @@ -770,8 +770,8 @@ glabel func_8004DE38 /* 04F4F4 8004E8F4 AC20D534 */ sw $zero, %lo(D_8011D534)($at) /* 04F4F8 8004E8F8 3C018012 */ lui $at, %hi(D_8011D538) # $at, 0x8012 /* 04F4FC 8004E8FC AC20D538 */ sw $zero, %lo(D_8011D538)($at) -/* 04F500 8004E900 3C018012 */ lui $at, %hi(D_8011D528) # $at, 0x8012 -/* 04F504 8004E904 AC20D528 */ sw $zero, %lo(D_8011D528)($at) +/* 04F500 8004E900 3C018012 */ lui $at, %hi(gCurrentCarInput) # $at, 0x8012 +/* 04F504 8004E904 AC20D528 */ sw $zero, %lo(gCurrentCarInput)($at) .L8004E908: /* 04F508 8004E908 1460001C */ bnez $v1, .L8004E97C /* 04F50C 8004E90C 00000000 */ nop @@ -985,12 +985,12 @@ glabel L8004EBF4 /* 04F808 8004EC08 10000060 */ b .L8004ED8C /* 04F80C 8004EC0C 820A0175 */ lb $t2, 0x175($s0) glabel L8004EC10 -/* 04F810 8004EC10 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 +/* 04F810 8004EC10 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 /* 04F814 8004EC14 3C0D8012 */ lui $t5, %hi(gActivePlayerButtonPress) # $t5, 0x8012 /* 04F818 8004EC18 3C0C8012 */ lui $t4, %hi(D_8011D540) # $t4, 0x8012 /* 04F81C 8004EC1C 258CD540 */ addiu $t4, %lo(D_8011D540) # addiu $t4, $t4, -0x2ac0 /* 04F820 8004EC20 25ADD52C */ addiu $t5, %lo(gActivePlayerButtonPress) # addiu $t5, $t5, -0x2ad4 -/* 04F824 8004EC24 256BD528 */ addiu $t3, %lo(D_8011D528) # addiu $t3, $t3, -0x2ad8 +/* 04F824 8004EC24 256BD528 */ addiu $t3, %lo(gCurrentCarInput) # addiu $t3, $t3, -0x2ad8 /* 04F828 8004EC28 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F82C 8004EC2C 8FA5009C */ lw $a1, 0x9c($sp) /* 04F830 8004EC30 AFAB0010 */ sw $t3, 0x10($sp) @@ -1002,12 +1002,12 @@ glabel L8004EC10 /* 04F848 8004EC48 10000050 */ b .L8004ED8C /* 04F84C 8004EC4C 820A0175 */ lb $t2, 0x175($s0) glabel L8004EC50 -/* 04F850 8004EC50 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 +/* 04F850 8004EC50 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 /* 04F854 8004EC54 3C0F8012 */ lui $t7, %hi(gActivePlayerButtonPress) # $t7, 0x8012 /* 04F858 8004EC58 3C088012 */ lui $t0, %hi(D_8011D540) # $t0, 0x8012 /* 04F85C 8004EC5C 2508D540 */ addiu $t0, %lo(D_8011D540) # addiu $t0, $t0, -0x2ac0 /* 04F860 8004EC60 25EFD52C */ addiu $t7, %lo(gActivePlayerButtonPress) # addiu $t7, $t7, -0x2ad4 -/* 04F864 8004EC64 25CED528 */ addiu $t6, %lo(D_8011D528) # addiu $t6, $t6, -0x2ad8 +/* 04F864 8004EC64 25CED528 */ addiu $t6, %lo(gCurrentCarInput) # addiu $t6, $t6, -0x2ad8 /* 04F868 8004EC68 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F86C 8004EC6C 8FA5009C */ lw $a1, 0x9c($sp) /* 04F870 8004EC70 AFAE0010 */ sw $t6, 0x10($sp) @@ -1019,12 +1019,12 @@ glabel L8004EC50 /* 04F888 8004EC88 10000040 */ b .L8004ED8C /* 04F88C 8004EC8C 820A0175 */ lb $t2, 0x175($s0) glabel L8004EC90 -/* 04F890 8004EC90 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 +/* 04F890 8004EC90 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 /* 04F894 8004EC94 3C198012 */ lui $t9, %hi(D_8011D534) # $t9, 0x8012 /* 04F898 8004EC98 3C0A8012 */ lui $t2, %hi(D_8011D540) # $t2, 0x8012 /* 04F89C 8004EC9C 254AD540 */ addiu $t2, %lo(D_8011D540) # addiu $t2, $t2, -0x2ac0 /* 04F8A0 8004ECA0 2739D534 */ addiu $t9, %lo(D_8011D534) # addiu $t9, $t9, -0x2acc -/* 04F8A4 8004ECA4 2718D528 */ addiu $t8, %lo(D_8011D528) # addiu $t8, $t8, -0x2ad8 +/* 04F8A4 8004ECA4 2718D528 */ addiu $t8, %lo(gCurrentCarInput) # addiu $t8, $t8, -0x2ad8 /* 04F8A8 8004ECA8 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F8AC 8004ECAC 8FA5009C */ lw $a1, 0x9c($sp) /* 04F8B0 8004ECB0 AFB80010 */ sw $t8, 0x10($sp) @@ -1036,12 +1036,12 @@ glabel L8004EC90 /* 04F8C8 8004ECC8 10000030 */ b .L8004ED8C /* 04F8CC 8004ECCC 820A0175 */ lb $t2, 0x175($s0) glabel L8004ECD0 -/* 04F8D0 8004ECD0 3C098012 */ lui $t1, %hi(D_8011D528) # $t1, 0x8012 +/* 04F8D0 8004ECD0 3C098012 */ lui $t1, %hi(gCurrentCarInput) # $t1, 0x8012 /* 04F8D4 8004ECD4 3C0B8012 */ lui $t3, %hi(gActivePlayerButtonPress) # $t3, 0x8012 /* 04F8D8 8004ECD8 3C0D8012 */ lui $t5, %hi(D_8011D540) # $t5, 0x8012 /* 04F8DC 8004ECDC 25ADD540 */ addiu $t5, %lo(D_8011D540) # addiu $t5, $t5, -0x2ac0 /* 04F8E0 8004ECE0 256BD52C */ addiu $t3, %lo(gActivePlayerButtonPress) # addiu $t3, $t3, -0x2ad4 -/* 04F8E4 8004ECE4 2529D528 */ addiu $t1, %lo(D_8011D528) # addiu $t1, $t1, -0x2ad8 +/* 04F8E4 8004ECE4 2529D528 */ addiu $t1, %lo(gCurrentCarInput) # addiu $t1, $t1, -0x2ad8 /* 04F8E8 8004ECE8 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F8EC 8004ECEC 8FA5009C */ lw $a1, 0x9c($sp) /* 04F8F0 8004ECF0 AFA90010 */ sw $t1, 0x10($sp) @@ -1053,12 +1053,12 @@ glabel L8004ECD0 /* 04F908 8004ED08 10000020 */ b .L8004ED8C /* 04F90C 8004ED0C 820A0175 */ lb $t2, 0x175($s0) glabel L8004ED10 -/* 04F910 8004ED10 3C0C8012 */ lui $t4, %hi(D_8011D528) # $t4, 0x8012 +/* 04F910 8004ED10 3C0C8012 */ lui $t4, %hi(gCurrentCarInput) # $t4, 0x8012 /* 04F914 8004ED14 3C0E8012 */ lui $t6, %hi(gActivePlayerButtonPress) # $t6, 0x8012 /* 04F918 8004ED18 3C0F8012 */ lui $t7, %hi(D_8011D540) # $t7, 0x8012 /* 04F91C 8004ED1C 25EFD540 */ addiu $t7, %lo(D_8011D540) # addiu $t7, $t7, -0x2ac0 /* 04F920 8004ED20 25CED52C */ addiu $t6, %lo(gActivePlayerButtonPress) # addiu $t6, $t6, -0x2ad4 -/* 04F924 8004ED24 258CD528 */ addiu $t4, %lo(D_8011D528) # addiu $t4, $t4, -0x2ad8 +/* 04F924 8004ED24 258CD528 */ addiu $t4, %lo(gCurrentCarInput) # addiu $t4, $t4, -0x2ad8 /* 04F928 8004ED28 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F92C 8004ED2C 8FA5009C */ lw $a1, 0x9c($sp) /* 04F930 8004ED30 AFAC0010 */ sw $t4, 0x10($sp) @@ -1070,12 +1070,12 @@ glabel L8004ED10 /* 04F948 8004ED48 10000010 */ b .L8004ED8C /* 04F94C 8004ED4C 820A0175 */ lb $t2, 0x175($s0) glabel L8004ED50 -/* 04F950 8004ED50 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 04F950 8004ED50 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 04F954 8004ED54 3C188012 */ lui $t8, %hi(gActivePlayerButtonPress) # $t8, 0x8012 /* 04F958 8004ED58 3C198012 */ lui $t9, %hi(D_8011D540) # $t9, 0x8012 /* 04F95C 8004ED5C 2739D540 */ addiu $t9, %lo(D_8011D540) # addiu $t9, $t9, -0x2ac0 /* 04F960 8004ED60 2718D52C */ addiu $t8, %lo(gActivePlayerButtonPress) # addiu $t8, $t8, -0x2ad4 -/* 04F964 8004ED64 2508D528 */ addiu $t0, %lo(D_8011D528) # addiu $t0, $t0, -0x2ad8 +/* 04F964 8004ED64 2508D528 */ addiu $t0, %lo(gCurrentCarInput) # addiu $t0, $t0, -0x2ad8 /* 04F968 8004ED68 8FA400B4 */ lw $a0, 0xb4($sp) /* 04F96C 8004ED6C 8FA5009C */ lw $a1, 0x9c($sp) /* 04F970 8004ED70 AFA80010 */ sw $t0, 0x10($sp) @@ -1131,8 +1131,8 @@ glabel L8004ED88 /* 04FA20 8004EE20 10400007 */ beqz $v0, .L8004EE40 .L8004EE24: /* 04FA24 8004EE24 3C058012 */ lui $a1, %hi(gActivePlayerButtonPress) # $a1, 0x8012 -/* 04FA28 8004EE28 3C068012 */ lui $a2, %hi(D_8011D528) # $a2, 0x8012 -/* 04FA2C 8004EE2C 8CC6D528 */ lw $a2, %lo(D_8011D528)($a2) +/* 04FA28 8004EE28 3C068012 */ lui $a2, %hi(gCurrentCarInput) # $a2, 0x8012 +/* 04FA2C 8004EE2C 8CC6D528 */ lw $a2, %lo(gCurrentCarInput)($a2) /* 04FA30 8004EE30 8CA5D52C */ lw $a1, %lo(gActivePlayerButtonPress)($a1) /* 04FA34 8004EE34 8FA700B4 */ lw $a3, 0xb4($sp) /* 04FA38 8004EE38 0C001434 */ jal func_800050D0 diff --git a/asm/non_matchings/racer/func_8004F7F4.s b/asm/non_matchings/racer/func_8004F7F4.s index 56b8d0d4..3481f936 100644 --- a/asm/non_matchings/racer/func_8004F7F4.s +++ b/asm/non_matchings/racer/func_8004F7F4.s @@ -27,8 +27,8 @@ glabel func_8004F7F4 /* 050414 8004F814 00E08025 */ move $s0, $a3 /* 050418 8004F818 11C00008 */ beqz $t6, .L8004F83C /* 05041C 8004F81C 00C08825 */ move $s1, $a2 -/* 050420 8004F820 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 -/* 050424 8004F824 2484D528 */ addiu $a0, %lo(D_8011D528) # addiu $a0, $a0, -0x2ad8 +/* 050420 8004F820 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 +/* 050424 8004F824 2484D528 */ addiu $a0, %lo(gCurrentCarInput) # addiu $a0, $a0, -0x2ad8 /* 050428 8004F828 8C8F0000 */ lw $t7, ($a0) /* 05042C 8004F82C 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff /* 050430 8004F830 34217FFF */ ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff @@ -37,10 +37,10 @@ glabel func_8004F7F4 .L8004F83C: /* 05043C 8004F83C 3C198012 */ lui $t9, %hi(D_8011D55C) # $t9, 0x8012 /* 050440 8004F840 8F39D55C */ lw $t9, %lo(D_8011D55C)($t9) -/* 050444 8004F844 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 +/* 050444 8004F844 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 /* 050448 8004F848 2401FFFF */ li $at, -1 /* 05044C 8004F84C 13210005 */ beq $t9, $at, .L8004F864 -/* 050450 8004F850 2484D528 */ addiu $a0, %lo(D_8011D528) # addiu $a0, $a0, -0x2ad8 +/* 050450 8004F850 2484D528 */ addiu $a0, %lo(gCurrentCarInput) # addiu $a0, $a0, -0x2ad8 /* 050454 8004F854 820801D8 */ lb $t0, 0x1d8($s0) /* 050458 8004F858 00003025 */ move $a2, $zero /* 05045C 8004F85C 11000008 */ beqz $t0, .L8004F880 @@ -112,8 +112,8 @@ glabel func_8004F7F4 /* 05054C 8004F94C 02002825 */ move $a1, $s0 /* 050550 8004F950 3C018012 */ lui $at, %hi(D_8011D550) # $at, 0x8012 /* 050554 8004F954 A420D550 */ sh $zero, %lo(D_8011D550)($at) -/* 050558 8004F958 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 05055C 8004F95C AC20D554 */ sw $zero, %lo(D_8011D554)($at) +/* 050558 8004F958 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 05055C 8004F95C AC20D554 */ sw $zero, %lo(gCurrentCarSteerVel)($at) /* 050560 8004F960 3C018012 */ lui $at, %hi(D_8011D558) # $at, 0x8012 /* 050564 8004F964 AC20D558 */ sw $zero, %lo(D_8011D558)($at) /* 050568 8004F968 C624000C */ lwc1 $f4, 0xc($s1) @@ -257,7 +257,7 @@ glabel func_8004F7F4 /* 050758 8004FB58 02202025 */ move $a0, $s1 /* 05075C 8004FB5C 0C014D71 */ jal func_800535C4 /* 050760 8004FB60 02002825 */ move $a1, $s0 -/* 050764 8004FB64 0C014D99 */ jal func_80053664 +/* 050764 8004FB64 0C014D99 */ jal handle_car_velocity_control /* 050768 8004FB68 02002025 */ move $a0, $s0 /* 05076C 8004FB6C 8FA600C0 */ lw $a2, 0xc0($sp) /* 050770 8004FB70 02202025 */ move $a0, $s1 @@ -456,8 +456,8 @@ glabel func_8004F7F4 /* 050A38 8004FE38 02002825 */ move $a1, $s0 .L8004FE3C: /* 050A3C 8004FE3C 860501A2 */ lh $a1, 0x1a2($s0) -/* 050A40 8004FE40 3C188012 */ lui $t8, %hi(D_8011D554) # $t8, 0x8012 -/* 050A44 8004FE44 8F18D554 */ lw $t8, %lo(D_8011D554)($t8) +/* 050A40 8004FE40 3C188012 */ lui $t8, %hi(gCurrentCarSteerVel) # $t8, 0x8012 +/* 050A44 8004FE44 8F18D554 */ lw $t8, %lo(gCurrentCarSteerVel)($t8) /* 050A48 8004FE48 30B9FFFF */ andi $t9, $a1, 0xffff /* 050A4C 8004FE4C 34018001 */ li $at, 32769 /* 050A50 8004FE50 03191823 */ subu $v1, $t8, $t9 diff --git a/asm/non_matchings/racer/func_80050A28.s b/asm/non_matchings/racer/func_80050A28.s index 6857fb56..8bfed153 100644 --- a/asm/non_matchings/racer/func_80050A28.s +++ b/asm/non_matchings/racer/func_80050A28.s @@ -66,9 +66,9 @@ glabel func_80050A28 /* 051678 80050A78 E60E0088 */ swc1 $f14, 0x88($s0) /* 05167C 80050A7C 3C0E8012 */ lui $t6, %hi(D_8011D586) # $t6, 0x8012 /* 051680 80050A80 85CED586 */ lh $t6, %lo(D_8011D586)($t6) -/* 051684 80050A84 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 051684 80050A84 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 051688 80050A88 15C00041 */ bnez $t6, .L80050B90 -/* 05168C 80050A8C 2508D528 */ addiu $t0, %lo(D_8011D528) # addiu $t0, $t0, -0x2ad8 +/* 05168C 80050A8C 2508D528 */ addiu $t0, %lo(gCurrentCarInput) # addiu $t0, $t0, -0x2ad8 /* 051690 80050A90 820F01E7 */ lb $t7, 0x1e7($s0) /* 051694 80050A94 3C19800E */ lui $t9, %hi(D_800DCDB0) # $t9, 0x800e /* 051698 80050A98 31F8001F */ andi $t8, $t7, 0x1f @@ -160,8 +160,8 @@ glabel func_80050A28 /* 0517DC 80050BDC 10000008 */ b .L80050C00 /* 0517E0 80050BE0 A20001FB */ sb $zero, 0x1fb($s0) .L80050BE4: -/* 0517E4 80050BE4 3C188012 */ lui $t8, %hi(D_8011D528) # $t8, 0x8012 -/* 0517E8 80050BE8 8F18D528 */ lw $t8, %lo(D_8011D528)($t8) +/* 0517E4 80050BE4 3C188012 */ lui $t8, %hi(gCurrentCarInput) # $t8, 0x8012 +/* 0517E8 80050BE8 8F18D528 */ lw $t8, %lo(gCurrentCarInput)($t8) /* 0517EC 80050BEC 00000000 */ nop /* 0517F0 80050BF0 33198000 */ andi $t9, $t8, 0x8000 /* 0517F4 80050BF4 17200002 */ bnez $t9, .L80050C00 @@ -169,9 +169,9 @@ glabel func_80050A28 /* 0517FC 80050BFC A20001FB */ sb $zero, 0x1fb($s0) .L80050C00: /* 051800 80050C00 820201FB */ lb $v0, 0x1fb($s0) -/* 051804 80050C04 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 051804 80050C04 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 051808 80050C08 18400006 */ blez $v0, .L80050C24 -/* 05180C 80050C0C 2508D528 */ addiu $t0, %lo(D_8011D528) # addiu $t0, $t0, -0x2ad8 +/* 05180C 80050C0C 2508D528 */ addiu $t0, %lo(gCurrentCarInput) # addiu $t0, $t0, -0x2ad8 /* 051810 80050C10 8FAA0080 */ lw $t2, 0x80($sp) /* 051814 80050C14 00000000 */ nop /* 051818 80050C18 004A5823 */ subu $t3, $v0, $t2 @@ -206,9 +206,9 @@ glabel func_80050A28 /* 051884 80050C84 86040000 */ lh $a0, ($s0) /* 051888 80050C88 0C01C8D2 */ jal func_80072348 /* 05188C 80050C8C AFA70078 */ sw $a3, 0x78($sp) -/* 051890 80050C90 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 051890 80050C90 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 051894 80050C94 8FA70078 */ lw $a3, 0x78($sp) -/* 051898 80050C98 2508D528 */ addiu $t0, %lo(D_8011D528) # addiu $t0, $t0, -0x2ad8 +/* 051898 80050C98 2508D528 */ addiu $t0, %lo(gCurrentCarInput) # addiu $t0, $t0, -0x2ad8 .L80050C9C: /* 05189C 80050C9C 3C0E8012 */ lui $t6, %hi(D_8011D55C) # $t6, 0x8012 /* 0518A0 80050CA0 8DCED55C */ lw $t6, %lo(D_8011D55C)($t6) @@ -256,9 +256,9 @@ glabel func_80050A28 /* 051938 80050D38 0C01BE53 */ jal get_random_number_from_range /* 05193C 80050D3C AFA70078 */ sw $a3, 0x78($sp) /* 051940 80050D40 A20201D1 */ sb $v0, 0x1d1($s0) -/* 051944 80050D44 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 051944 80050D44 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 051948 80050D48 8FA70078 */ lw $a3, 0x78($sp) -/* 05194C 80050D4C 2508D528 */ addiu $t0, %lo(D_8011D528) # addiu $t0, $t0, -0x2ad8 +/* 05194C 80050D4C 2508D528 */ addiu $t0, %lo(gCurrentCarInput) # addiu $t0, $t0, -0x2ad8 .L80050D50: /* 051950 80050D50 3C098012 */ lui $t1, %hi(D_8011D534) # $t1, 0x8012 /* 051954 80050D54 2529D534 */ addiu $t1, %lo(D_8011D534) # addiu $t1, $t1, -0x2acc @@ -456,8 +456,8 @@ glabel func_80050A28 .L80051014: /* 051C14 80051014 0C015C88 */ jal func_80057220 /* 051C18 80051018 AFA70078 */ sw $a3, 0x78($sp) -/* 051C1C 8005101C 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 -/* 051C20 80051020 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 051C1C 8005101C 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 +/* 051C20 80051020 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 051C24 80051024 E7A00034 */ swc1 $f0, 0x34($sp) /* 051C28 80051028 31F80010 */ andi $t8, $t7, 0x10 /* 051C2C 8005102C 13000019 */ beqz $t8, .L80051094 @@ -617,8 +617,8 @@ glabel func_80050A28 /* 051E54 80051254 0C001223 */ jal func_8000488C /* 051E58 80051258 00402025 */ move $a0, $v0 .L8005125C: -/* 051E5C 8005125C 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 -/* 051E60 80051260 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 051E5C 8005125C 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 +/* 051E60 80051260 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 051E64 80051264 820301E1 */ lb $v1, 0x1e1($s0) /* 051E68 80051268 30584000 */ andi $t8, $v0, 0x4000 /* 051E6C 8005126C 24060006 */ li $a2, 6 @@ -680,7 +680,7 @@ glabel func_80050A28 /* 051F3C 8005133C 440F4000 */ mfc1 $t7, $f8 /* 051F40 80051340 44CDF800 */ ctc1 $t5, $31 /* 051F44 80051344 01CFC023 */ subu $t8, $t6, $t7 -/* 051F48 80051348 0C014D1E */ jal func_80053478 +/* 051F48 80051348 0C014D1E */ jal handle_car_steering /* 051F4C 8005134C A61801A0 */ sh $t8, 0x1a0($s0) /* 051F50 80051350 C606002C */ lwc1 $f6, 0x2c($s0) /* 051F54 80051354 3C01C010 */ li $at, 0xC0100000 # -2.250000 @@ -691,8 +691,8 @@ glabel func_80050A28 /* 051F68 80051368 44807000 */ mtc1 $zero, $f14 /* 051F6C 8005136C 45000032 */ bc1f .L80051438 /* 051F70 80051370 00004825 */ move $t1, $zero -/* 051F74 80051374 3C028012 */ lui $v0, %hi(D_8011D554) # $v0, 0x8012 -/* 051F78 80051378 8C42D554 */ lw $v0, %lo(D_8011D554)($v0) +/* 051F74 80051374 3C028012 */ lui $v0, %hi(gCurrentCarSteerVel) # $v0, 0x8012 +/* 051F78 80051378 8C42D554 */ lw $v0, %lo(gCurrentCarSteerVel)($v0) /* 051F7C 8005137C 00000000 */ nop /* 051F80 80051380 28411401 */ slti $at, $v0, 0x1401 /* 051F84 80051384 10200007 */ beqz $at, .L800513A4 @@ -718,9 +718,9 @@ glabel func_80050A28 /* 051FCC 800513CC 0326C821 */ addu $t9, $t9, $a2 /* 051FD0 800513D0 0019C900 */ sll $t9, $t9, 4 /* 051FD4 800513D4 00596021 */ addu $t4, $v0, $t9 -/* 051FD8 800513D8 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 +/* 051FD8 800513D8 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 /* 051FDC 800513DC 10000016 */ b .L80051438 -/* 051FE0 800513E0 AC2CD554 */ sw $t4, %lo(D_8011D554)($at) +/* 051FE0 800513E0 AC2CD554 */ sw $t4, %lo(gCurrentCarSteerVel)($at) .L800513E4: /* 051FE4 800513E4 14200005 */ bnez $at, .L800513FC /* 051FE8 800513E8 00000000 */ nop @@ -743,8 +743,8 @@ glabel func_80050A28 /* 052024 80051424 01E67821 */ addu $t7, $t7, $a2 /* 052028 80051428 000F7900 */ sll $t7, $t7, 4 /* 05202C 8005142C 004FC023 */ subu $t8, $v0, $t7 -/* 052030 80051430 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 052034 80051434 AC38D554 */ sw $t8, %lo(D_8011D554)($at) +/* 052030 80051430 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 052034 80051434 AC38D554 */ sw $t8, %lo(gCurrentCarSteerVel)($at) .L80051438: /* 052038 80051438 44808000 */ mtc1 $zero, $f16 /* 05203C 8005143C 44801000 */ mtc1 $zero, $f2 @@ -767,7 +767,7 @@ glabel func_80050A28 /* 05207C 8005147C E7B00040 */ swc1 $f16, 0x40($sp) /* 052080 80051480 8FA50028 */ lw $a1, 0x28($sp) /* 052084 80051484 8FA60070 */ lw $a2, 0x70($sp) -/* 052088 80051488 3C07800E */ lui $a3, %hi(D_800DCB9C) # $a3, 0x800e +/* 052088 80051488 3C07800E */ lui $a3, %hi(gSurfaceSpeedScrubTable) # $a3, 0x800e /* 05208C 8005148C 83A80057 */ lb $t0, 0x57($sp) /* 052090 80051490 8FA90064 */ lw $t1, 0x64($sp) /* 052094 80051494 C7A20048 */ lwc1 $f2, 0x48($sp) @@ -775,7 +775,7 @@ glabel func_80050A28 /* 05209C 8005149C C7B00040 */ lwc1 $f16, 0x40($sp) /* 0520A0 800514A0 00025A00 */ sll $t3, $v0, 8 /* 0520A4 800514A4 05610006 */ bgez $t3, .L800514C0 -/* 0520A8 800514A8 24E7CB9C */ addiu $a3, %lo(D_800DCB9C) # addiu $a3, $a3, -0x3464 +/* 0520A8 800514A8 24E7CB9C */ addiu $a3, %lo(gSurfaceSpeedScrubTable) # addiu $a3, $a3, -0x3464 /* 0520AC 800514AC C4E40000 */ lwc1 $f4, ($a3) /* 0520B0 800514B0 90A201DC */ lbu $v0, 0x1dc($a1) /* 0520B4 800514B4 46047380 */ add.s $f14, $f14, $f4 @@ -959,7 +959,7 @@ glabel func_80050A28 /* 052354 80051754 44804000 */ mtc1 $zero, $f8 /* 052358 80051758 46203287 */ neg.d $f10, $f6 /* 05235C 8005175C 46205020 */ cvt.s.d $f0, $f10 -/* 052360 80051760 3C0F8012 */ lui $t7, %hi(D_8011D554) # $t7, 0x8012 +/* 052360 80051760 3C0F8012 */ lui $t7, %hi(gCurrentCarSteerVel) # $t7, 0x8012 /* 052364 80051764 46000321 */ cvt.d.s $f12, $f0 /* 052368 80051768 4628603C */ c.lt.d $f12, $f8 /* 05236C 8005176C 00000000 */ nop @@ -969,7 +969,7 @@ glabel func_80050A28 /* 05237C 8005177C 00000000 */ nop /* 052380 80051780 46000321 */ cvt.d.s $f12, $f0 .L80051784: -/* 052384 80051784 8DEFD554 */ lw $t7, %lo(D_8011D554)($t7) +/* 052384 80051784 8DEFD554 */ lw $t7, %lo(gCurrentCarSteerVel)($t7) /* 052388 80051788 44804000 */ mtc1 $zero, $f8 /* 05238C 8005178C 448F2000 */ mtc1 $t7, $f4 /* 052390 80051790 00000000 */ nop @@ -980,11 +980,11 @@ glabel func_80050A28 /* 0523A4 800517A4 37010003 */ ori $at, $t8, 3 /* 0523A8 800517A8 38210002 */ xori $at, $at, 2 /* 0523AC 800517AC 44C1F800 */ ctc1 $at, $31 -/* 0523B0 800517B0 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 +/* 0523B0 800517B0 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 /* 0523B4 800517B4 460032A4 */ cvt.w.s $f10, $f6 /* 0523B8 800517B8 440A5000 */ mfc1 $t2, $f10 /* 0523BC 800517BC 44D8F800 */ ctc1 $t8, $31 -/* 0523C0 800517C0 AC2AD554 */ sw $t2, %lo(D_8011D554)($at) +/* 0523C0 800517C0 AC2AD554 */ sw $t2, %lo(gCurrentCarSteerVel)($at) /* 0523C4 800517C4 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 /* 0523C8 800517C8 44814800 */ mtc1 $at, $f9 /* 0523CC 800517CC 3C01800E */ lui $at, %hi(D_800E6670 + 4) # $at, 0x800e @@ -1095,8 +1095,8 @@ glabel func_80050A28 /* 05255C 8005195C 4612203C */ c.lt.s $f4, $f18 /* 052560 80051960 00000000 */ nop /* 052564 80051964 4500000F */ bc1f .L800519A4 -/* 052568 80051968 3C0A8012 */ lui $t2, %hi(D_8011D528) # $t2, 0x8012 -/* 05256C 8005196C 8D4AD528 */ lw $t2, %lo(D_8011D528)($t2) +/* 052568 80051968 3C0A8012 */ lui $t2, %hi(gCurrentCarInput) # $t2, 0x8012 +/* 05256C 8005196C 8D4AD528 */ lw $t2, %lo(gCurrentCarInput)($t2) /* 052570 80051970 00000000 */ nop /* 052574 80051974 314B8000 */ andi $t3, $t2, 0x8000 /* 052578 80051978 1560000A */ bnez $t3, .L800519A4 @@ -1410,7 +1410,7 @@ glabel func_80050A28 /* 0529F0 80051DF0 46228181 */ sub.d $f6, $f16, $f2 /* 0529F4 80051DF4 24010004 */ li $at, 4 /* 0529F8 80051DF8 46283282 */ mul.d $f10, $f6, $f8 -/* 0529FC 80051DFC 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 0529FC 80051DFC 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 052A00 80051E00 15210007 */ bne $t1, $at, .L80051E20 /* 052A04 80051E04 46205020 */ cvt.s.d $f0, $f10 /* 052A08 80051E08 3C013FD0 */ li $at, 0x3FD00000 # 1.625000 @@ -1425,7 +1425,7 @@ glabel func_80050A28 /* 052A28 80051E28 2941FFE7 */ slti $at, $t2, -0x19 /* 052A2C 80051E2C 10200017 */ beqz $at, .L80051E8C /* 052A30 80051E30 00000000 */ nop -/* 052A34 80051E34 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 052A34 80051E34 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 052A38 80051E38 00000000 */ nop /* 052A3C 80051E3C 304B8000 */ andi $t3, $v0, 0x8000 /* 052A40 80051E40 15600012 */ bnez $t3, .L80051E8C @@ -1618,13 +1618,13 @@ glabel func_80050A28 /* 052D00 80052100 44803000 */ mtc1 $zero, $f6 /* 052D04 80052104 820E01E1 */ lb $t6, 0x1e1($s0) /* 052D08 80052108 46262202 */ mul.d $f8, $f4, $f6 -/* 052D0C 8005210C 3C0A8012 */ lui $t2, %hi(D_8011D554) # $t2, 0x8012 +/* 052D0C 8005210C 3C0A8012 */ lui $t2, %hi(gCurrentCarSteerVel) # $t2, 0x8012 /* 052D10 80052110 A20E01E8 */ sb $t6, 0x1e8($s0) /* 052D14 80052114 820B01E0 */ lb $t3, 0x1e0($s0) /* 052D18 80052118 46280281 */ sub.d $f10, $f0, $f8 /* 052D1C 8005211C 462054A0 */ cvt.s.d $f18, $f10 /* 052D20 80052120 E6120008 */ swc1 $f18, 8($s0) -/* 052D24 80052124 8D4AD554 */ lw $t2, %lo(D_8011D554)($t2) +/* 052D24 80052124 8D4AD554 */ lw $t2, %lo(gCurrentCarSteerVel)($t2) /* 052D28 80052128 11600013 */ beqz $t3, .L80052178 /* 052D2C 8005212C AE0A0110 */ sw $t2, 0x110($s0) /* 052D30 80052130 3C188012 */ lui $t8, %hi(D_8011D55C) # $t8, 0x8012 diff --git a/asm/non_matchings/racer/func_8005250C.s b/asm/non_matchings/racer/func_8005250C.s index 2cf28bcd..79510798 100644 --- a/asm/non_matchings/racer/func_8005250C.s +++ b/asm/non_matchings/racer/func_8005250C.s @@ -130,7 +130,7 @@ glabel L80052678 /* 0532D4 800526D4 44CFF800 */ ctc1 $t7, $31 /* 0532D8 800526D8 03231823 */ subu $v1, $t9, $v1 /* 0532DC 800526DC 04610002 */ bgez $v1, .L800526E8 -/* 0532E0 800526E0 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 +/* 0532E0 800526E0 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 /* 0532E4 800526E4 00001825 */ move $v1, $zero .L800526E8: /* 0532E8 800526E8 2861004A */ slti $at, $v1, 0x4a @@ -179,7 +179,7 @@ glabel L80052678 /* 053384 80052784 00000000 */ nop /* 053388 80052788 4500007C */ bc1f .L8005297C /* 05338C 8005278C 8FBF0024 */ lw $ra, 0x24($sp) -/* 053390 80052790 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 053390 80052790 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 053394 80052794 240E0006 */ li $t6, 6 /* 053398 80052798 31F94000 */ andi $t9, $t7, 0x4000 /* 05339C 8005279C 13200077 */ beqz $t9, .L8005297C @@ -233,8 +233,8 @@ glabel L8005280C /* 053450 80052850 10000049 */ b .L80052978 /* 053454 80052854 A0A801F3 */ sb $t0, 0x1f3($a1) glabel L80052858 -/* 053458 80052858 3C098012 */ lui $t1, %hi(D_8011D528) # $t1, 0x8012 -/* 05345C 8005285C 8D29D528 */ lw $t1, %lo(D_8011D528)($t1) +/* 053458 80052858 3C098012 */ lui $t1, %hi(gCurrentCarInput) # $t1, 0x8012 +/* 05345C 8005285C 8D29D528 */ lw $t1, %lo(gCurrentCarInput)($t1) /* 053460 80052860 8FA40028 */ lw $a0, 0x28($sp) /* 053464 80052864 312A2000 */ andi $t2, $t1, 0x2000 /* 053468 80052868 11400002 */ beqz $t2, .L80052874 @@ -262,8 +262,8 @@ glabel L800528A4 /* 0534B8 800528B8 8FA40028 */ lw $a0, 0x28($sp) /* 0534BC 800528BC 45000008 */ bc1f .L800528E0 /* 0534C0 800528C0 24020003 */ li $v0, 3 -/* 0534C4 800528C4 3C0F8012 */ lui $t7, %hi(D_8011D528) # $t7, 0x8012 -/* 0534C8 800528C8 8DEFD528 */ lw $t7, %lo(D_8011D528)($t7) +/* 0534C4 800528C4 3C0F8012 */ lui $t7, %hi(gCurrentCarInput) # $t7, 0x8012 +/* 0534C8 800528C8 8DEFD528 */ lw $t7, %lo(gCurrentCarInput)($t7) /* 0534CC 800528CC 00000000 */ nop /* 0534D0 800528D0 31F94000 */ andi $t9, $t7, 0x4000 /* 0534D4 800528D4 13200003 */ beqz $t9, .L800528E4 diff --git a/asm/non_matchings/racer/func_80052B64.s b/asm/non_matchings/racer/func_80052B64.s index 6b3cf658..e1f821b6 100644 --- a/asm/non_matchings/racer/func_80052B64.s +++ b/asm/non_matchings/racer/func_80052B64.s @@ -128,8 +128,8 @@ glabel func_80052B64 /* 053934 80052D34 A0E001DB */ sb $zero, 0x1db($a3) .L80052D38: /* 053938 80052D38 84EF01A2 */ lh $t7, 0x1a2($a3) -/* 05393C 80052D3C 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 -/* 053940 80052D40 AC2FD554 */ sw $t7, %lo(D_8011D554)($at) +/* 05393C 80052D3C 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 +/* 053940 80052D40 AC2FD554 */ sw $t7, %lo(gCurrentCarSteerVel)($at) /* 053944 80052D44 3C018012 */ lui $at, %hi(D_8011D56C) # $at, 0x8012 /* 053948 80052D48 C424D56C */ lwc1 $f4, %lo(D_8011D56C)($at) /* 05394C 80052D4C C7A6002C */ lwc1 $f6, 0x2c($sp) diff --git a/asm/non_matchings/racer/func_80052D7C.s b/asm/non_matchings/racer/func_80052D7C.s index 647a5877..f14782ac 100644 --- a/asm/non_matchings/racer/func_80052D7C.s +++ b/asm/non_matchings/racer/func_80052D7C.s @@ -160,9 +160,9 @@ glabel func_80052D7C /* 053B5C 80052F5C E5440020 */ swc1 $f4, 0x20($t2) .L80052F60: /* 053B60 80052F60 80AB01E1 */ lb $t3, 0x1e1($a1) -/* 053B64 80052F64 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 053B64 80052F64 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 053B68 80052F68 A0AB01E8 */ sb $t3, 0x1e8($a1) -/* 053B6C 80052F6C 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 053B6C 80052F6C 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 053B70 80052F70 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 /* 053B74 80052F74 304C8000 */ andi $t4, $v0, 0x8000 /* 053B78 80052F78 1180000C */ beqz $t4, .L80052FAC @@ -172,10 +172,10 @@ glabel func_80052D7C /* 053B88 80052F88 44808000 */ mtc1 $zero, $f16 /* 053B8C 80052F8C 460042A1 */ cvt.d.s $f10, $f8 /* 053B90 80052F90 46305481 */ sub.d $f18, $f10, $f16 -/* 053B94 80052F94 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 053B94 80052F94 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 053B98 80052F98 462091A0 */ cvt.s.d $f6, $f18 /* 053B9C 80052F9C E4A6002C */ swc1 $f6, 0x2c($a1) -/* 053BA0 80052FA0 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 053BA0 80052FA0 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 053BA4 80052FA4 00000000 */ nop /* 053BA8 80052FA8 304E4000 */ andi $t6, $v0, 0x4000 .L80052FAC: @@ -238,7 +238,7 @@ glabel func_80052D7C /* 053C84 80053084 84A90000 */ lh $t1, ($a1) /* 053C88 80053088 2401FFFF */ li $at, -1 /* 053C8C 8005308C 15210004 */ bne $t1, $at, .L800530A0 -/* 053C90 80053090 3C068012 */ lui $a2, %hi(D_8011D554) # $a2, 0x8012 +/* 053C90 80053090 3C068012 */ lui $a2, %hi(gCurrentCarSteerVel) # $a2, 0x8012 /* 053C94 80053094 80AA01E1 */ lb $t2, 0x1e1($a1) /* 053C98 80053098 00000000 */ nop /* 053C9C 8005309C A0AA01E8 */ sb $t2, 0x1e8($a1) @@ -246,7 +246,7 @@ glabel func_80052D7C /* 053CA0 800530A0 80A201D3 */ lb $v0, 0x1d3($a1) /* 053CA4 800530A4 3C01800E */ lui $at, %hi(D_800E6708 + 4) # $at, 0x800e /* 053CA8 800530A8 18400006 */ blez $v0, .L800530C4 -/* 053CAC 800530AC 24C6D554 */ addiu $a2, %lo(D_8011D554) # addiu $a2, $a2, -0x2aac +/* 053CAC 800530AC 24C6D554 */ addiu $a2, %lo(gCurrentCarSteerVel) # addiu $a2, $a2, -0x2aac /* 053CB0 800530B0 8FAB0048 */ lw $t3, 0x48($sp) /* 053CB4 800530B4 00000000 */ nop /* 053CB8 800530B8 004B6023 */ subu $t4, $v0, $t3 @@ -403,7 +403,7 @@ glabel func_80052D7C /* 053EEC 800532EC ACC00000 */ sw $zero, ($a2) /* 053EF0 800532F0 E7A2002C */ swc1 $f2, 0x2c($sp) /* 053EF4 800532F4 AFA50044 */ sw $a1, 0x44($sp) -/* 053EF8 800532F8 0C014D1E */ jal func_80053478 +/* 053EF8 800532F8 0C014D1E */ jal handle_car_steering /* 053EFC 800532FC AFA30038 */ sw $v1, 0x38($sp) /* 053F00 80053300 8FA30038 */ lw $v1, 0x38($sp) /* 053F04 80053304 8FA50044 */ lw $a1, 0x44($sp) diff --git a/asm/non_matchings/racer/func_80054110.s b/asm/non_matchings/racer/func_80054110.s index e02c0a57..de5fae5d 100644 --- a/asm/non_matchings/racer/func_80054110.s +++ b/asm/non_matchings/racer/func_80054110.s @@ -17,13 +17,13 @@ glabel func_80054110 /* 054D20 80054120 AFA600B8 */ sw $a2, 0xb8($sp) /* 054D24 80054124 AFA700BC */ sw $a3, 0xbc($sp) /* 054D28 80054128 C484000C */ lwc1 $f4, 0xc($a0) -/* 054D2C 8005412C 3C018012 */ lui $at, %hi(D_8011D554) # $at, 0x8012 +/* 054D2C 8005412C 3C018012 */ lui $at, %hi(gCurrentCarSteerVel) # $at, 0x8012 /* 054D30 80054130 E7A40098 */ swc1 $f4, 0x98($sp) /* 054D34 80054134 C4860010 */ lwc1 $f6, 0x10($a0) /* 054D38 80054138 00808825 */ move $s1, $a0 /* 054D3C 8005413C E7A60094 */ swc1 $f6, 0x94($sp) /* 054D40 80054140 C4880014 */ lwc1 $f8, 0x14($a0) -/* 054D44 80054144 AC20D554 */ sw $zero, %lo(D_8011D554)($at) +/* 054D44 80054144 AC20D554 */ sw $zero, %lo(gCurrentCarSteerVel)($at) /* 054D48 80054148 00A08025 */ move $s0, $a1 /* 054D4C 8005414C 3C018012 */ lui $at, %hi(D_8011D558) # $at, 0x8012 /* 054D50 80054150 00A02025 */ move $a0, $a1 @@ -32,7 +32,7 @@ glabel func_80054110 /* 054D5C 8005415C 00E03025 */ move $a2, $a3 /* 054D60 80054160 0C015E6C */ jal func_800579B0 /* 054D64 80054164 E7A80090 */ swc1 $f8, 0x90($sp) -/* 054D68 80054168 0C014D99 */ jal func_80053664 +/* 054D68 80054168 0C014D99 */ jal handle_car_velocity_control /* 054D6C 8005416C 02002025 */ move $a0, $s0 /* 054D70 80054170 02202025 */ move $a0, $s1 /* 054D74 80054174 0C015D7B */ jal func_800575EC @@ -224,8 +224,8 @@ glabel func_80054110 /* 055020 80054420 0C0148D3 */ jal func_8005234C /* 055024 80054424 A6220018 */ sh $v0, 0x18($s1) /* 055028 80054428 860401A2 */ lh $a0, 0x1a2($s0) -/* 05502C 8005442C 3C088012 */ lui $t0, %hi(D_8011D554) # $t0, 0x8012 -/* 055030 80054430 8D08D554 */ lw $t0, %lo(D_8011D554)($t0) +/* 05502C 8005442C 3C088012 */ lui $t0, %hi(gCurrentCarSteerVel) # $t0, 0x8012 +/* 055030 80054430 8D08D554 */ lw $t0, %lo(gCurrentCarSteerVel)($t0) /* 055034 80054434 3089FFFF */ andi $t1, $a0, 0xffff /* 055038 80054438 34018001 */ li $at, 32769 /* 05503C 8005443C 01091023 */ subu $v0, $t0, $t1 diff --git a/asm/non_matchings/racer/func_8005492C.s b/asm/non_matchings/racer/func_8005492C.s index 6124668d..f14da711 100644 --- a/asm/non_matchings/racer/func_8005492C.s +++ b/asm/non_matchings/racer/func_8005492C.s @@ -58,8 +58,8 @@ glabel func_8005492C /* 0555A4 800549A4 240E0001 */ li $t6, 1 /* 0555A8 800549A8 AFAE0038 */ sw $t6, 0x38($sp) .L800549AC: -/* 0555AC 800549AC 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 -/* 0555B0 800549B0 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 0555AC 800549AC 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 +/* 0555B0 800549B0 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 0555B4 800549B4 8C84D534 */ lw $a0, %lo(D_8011D534)($a0) /* 0555B8 800549B8 304F4000 */ andi $t7, $v0, 0x4000 /* 0555BC 800549BC 24030006 */ li $v1, 6 @@ -124,7 +124,7 @@ glabel func_8005492C /* 055698 80054A98 A4AD01A0 */ sh $t5, 0x1a0($a1) /* 05569C 80054A9C E7A20030 */ swc1 $f2, 0x30($sp) /* 0556A0 80054AA0 AFA70048 */ sw $a3, 0x48($sp) -/* 0556A4 80054AA4 0C014D1E */ jal func_80053478 +/* 0556A4 80054AA4 0C014D1E */ jal handle_car_steering /* 0556A8 80054AA8 AFA5004C */ sw $a1, 0x4c($sp) /* 0556AC 80054AAC 8FA5004C */ lw $a1, 0x4c($sp) /* 0556B0 80054AB0 3C01800E */ lui $at, %hi(D_800E67F8 + 4) # $at, 0x800e @@ -144,9 +144,9 @@ glabel func_8005492C /* 0556E8 80054AE8 10810008 */ beq $a0, $at, .L80054B0C /* 0556EC 80054AEC 46009006 */ mov.s $f0, $f18 /* 0556F0 80054AF0 00047080 */ sll $t6, $a0, 2 -/* 0556F4 80054AF4 3C01800E */ lui $at, %hi(D_800DCB9C) # $at, 0x800e +/* 0556F4 80054AF4 3C01800E */ lui $at, %hi(gSurfaceSpeedScrubTable) # $at, 0x800e /* 0556F8 80054AF8 002E0821 */ addu $at, $at, $t6 -/* 0556FC 80054AFC C426CB9C */ lwc1 $f6, %lo(D_800DCB9C)($at) +/* 0556FC 80054AFC C426CB9C */ lwc1 $f6, %lo(gSurfaceSpeedScrubTable)($at) /* 055700 80054B00 18800002 */ blez $a0, .L80054B0C /* 055704 80054B04 46069000 */ add.s $f0, $f18, $f6 /* 055708 80054B08 00801825 */ move $v1, $a0 @@ -353,11 +353,11 @@ glabel func_8005492C /* 0559F4 80054DF4 3C088012 */ lui $t0, %hi(D_8011D538) # $t0, 0x8012 /* 0559F8 80054DF8 46244182 */ mul.d $f6, $f8, $f4 /* 0559FC 80054DFC 8D08D538 */ lw $t0, %lo(D_8011D538)($t0) -/* 055A00 80054E00 3C028012 */ lui $v0, %hi(D_8011D528) # $v0, 0x8012 +/* 055A00 80054E00 3C028012 */ lui $v0, %hi(gCurrentCarInput) # $v0, 0x8012 /* 055A04 80054E04 2901FFE7 */ slti $at, $t0, -0x19 /* 055A08 80054E08 1020000D */ beqz $at, .L80054E40 /* 055A0C 80054E0C 462033A0 */ cvt.s.d $f14, $f6 -/* 055A10 80054E10 8C42D528 */ lw $v0, %lo(D_8011D528)($v0) +/* 055A10 80054E10 8C42D528 */ lw $v0, %lo(gCurrentCarInput)($v0) /* 055A14 80054E14 00000000 */ nop /* 055A18 80054E18 30498000 */ andi $t1, $v0, 0x8000 /* 055A1C 80054E1C 15200008 */ bnez $t1, .L80054E40 diff --git a/asm/non_matchings/racer/func_80055EC0.s b/asm/non_matchings/racer/func_80055EC0.s index 35c2b677..727bcdeb 100644 --- a/asm/non_matchings/racer/func_80055EC0.s +++ b/asm/non_matchings/racer/func_80055EC0.s @@ -213,7 +213,7 @@ glabel func_80055EC0 /* 056DBC 800561BC 00000000 */ nop .L800561C0: /* 056DC0 800561C0 820C0195 */ lb $t4, 0x195($s0) -/* 056DC4 800561C4 3C0B8012 */ lui $t3, %hi(D_8011D528) # $t3, 0x8012 +/* 056DC4 800561C4 3C0B8012 */ lui $t3, %hi(gCurrentCarInput) # $t3, 0x8012 /* 056DC8 800561C8 11800006 */ beqz $t4, .L800561E4 /* 056DCC 800561CC 00000000 */ nop /* 056DD0 800561D0 82190175 */ lb $t9, 0x175($s0) @@ -222,7 +222,7 @@ glabel func_80055EC0 /* 056DDC 800561DC 8FBF0024 */ lw $ra, 0x24($sp) /* 056DE0 800561E0 A2000195 */ sb $zero, 0x195($s0) .L800561E4: -/* 056DE4 800561E4 8D6BD528 */ lw $t3, %lo(D_8011D528)($t3) +/* 056DE4 800561E4 8D6BD528 */ lw $t3, %lo(gCurrentCarInput)($t3) /* 056DE8 800561E8 3C038012 */ lui $v1, %hi(D_8011D530) # $v1, 0x8012 /* 056DEC 800561EC 316D2000 */ andi $t5, $t3, 0x2000 /* 056DF0 800561F0 15A00006 */ bnez $t5, .L8005620C diff --git a/asm/non_matchings/racer/func_80057220.s b/asm/non_matchings/racer/func_80057220.s index b245e096..959369bc 100644 --- a/asm/non_matchings/racer/func_80057220.s +++ b/asm/non_matchings/racer/func_80057220.s @@ -34,7 +34,7 @@ glabel func_80057220 /* 057E88 80057288 2483FFF2 */ addiu $v1, $a0, -0xe /* 057E8C 8005728C 33198000 */ andi $t9, $t8, 0x8000 /* 057E90 80057290 1320003C */ beqz $t9, .L80057384 -/* 057E94 80057294 3C088012 */ lui $t0, %hi(D_8011D528) # $t0, 0x8012 +/* 057E94 80057294 3C088012 */ lui $t0, %hi(gCurrentCarInput) # $t0, 0x8012 /* 057E98 80057298 04610004 */ bgez $v1, .L800572AC /* 057E9C 8005729C 240A0018 */ li $t2, 24 /* 057EA0 800572A0 04400002 */ bltz $v0, .L800572AC @@ -45,7 +45,7 @@ glabel func_80057220 /* 057EB0 800572B0 00000000 */ nop /* 057EB4 800572B4 00031823 */ negu $v1, $v1 .L800572B8: -/* 057EB8 800572B8 8D08D528 */ lw $t0, %lo(D_8011D528)($t0) +/* 057EB8 800572B8 8D08D528 */ lw $t0, %lo(gCurrentCarInput)($t0) /* 057EBC 800572BC 28610002 */ slti $at, $v1, 2 /* 057EC0 800572C0 31092000 */ andi $t1, $t0, 0x2000 /* 057EC4 800572C4 11200005 */ beqz $t1, .L800572DC diff --git a/asm/non_matchings/racer/func_800581E8.s b/asm/non_matchings/racer/func_800581E8.s index f6d7d3d9..a3478f9b 100644 --- a/asm/non_matchings/racer/func_800581E8.s +++ b/asm/non_matchings/racer/func_800581E8.s @@ -367,9 +367,9 @@ glabel func_800581E8 /* 05930C 8005870C 0C01C1FE */ jal func_800707F8 /* 059310 80058710 000B2403 */ sra $a0, $t3, 0x10 /* 059314 80058714 C7AC0040 */ lwc1 $f12, 0x40($sp) -/* 059318 80058718 3C0D8012 */ lui $t5, %hi(D_8011D528) # $t5, 0x8012 +/* 059318 80058718 3C0D8012 */ lui $t5, %hi(gCurrentCarInput) # $t5, 0x8012 /* 05931C 8005871C 460C0202 */ mul.s $f8, $f0, $f12 -/* 059320 80058720 8DADD528 */ lw $t5, %lo(D_8011D528)($t5) +/* 059320 80058720 8DADD528 */ lw $t5, %lo(gCurrentCarInput)($t5) /* 059324 80058724 44807000 */ mtc1 $zero, $f14 /* 059328 80058728 8FA70070 */ lw $a3, 0x70($sp) /* 05932C 8005872C 31AF8000 */ andi $t7, $t5, 0x8000 diff --git a/asm/non_matchings/racer/func_8005A424.s b/asm/non_matchings/racer/func_8005A424.s index 4330b1d0..fa2345e5 100644 --- a/asm/non_matchings/racer/func_8005A424.s +++ b/asm/non_matchings/racer/func_8005A424.s @@ -27,7 +27,7 @@ glabel func_8005A424 .L8005A488: /* 05B088 8005A488 28618000 */ slti $at, $v1, -0x8000 /* 05B08C 8005A48C 10200003 */ beqz $at, .L8005A49C -/* 05B090 8005A490 3C048012 */ lui $a0, %hi(D_8011D528) # $a0, 0x8012 +/* 05B090 8005A490 3C048012 */ lui $a0, %hi(gCurrentCarInput) # $a0, 0x8012 /* 05B094 8005A494 3401FFFF */ li $at, 65535 /* 05B098 8005A498 00611821 */ addu $v1, $v1, $at .L8005A49C: @@ -40,7 +40,7 @@ glabel func_8005A424 /* 05B0B4 8005A4B4 AC20D52C */ sw $zero, %lo(gActivePlayerButtonPress)($at) /* 05B0B8 8005A4B8 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 /* 05B0BC 8005A4BC AC20D530 */ sw $zero, %lo(D_8011D530)($at) -/* 05B0C0 8005A4C0 2484D528 */ addiu $a0, %lo(D_8011D528) # addiu $a0, $a0, -0x2ad8 +/* 05B0C0 8005A4C0 2484D528 */ addiu $a0, %lo(gCurrentCarInput) # addiu $a0, $a0, -0x2ad8 /* 05B0C4 8005A4C4 AC800000 */ sw $zero, ($a0) /* 05B0C8 8005A4C8 3C018012 */ lui $at, %hi(D_8011D538) # $at, 0x8012 /* 05B0CC 8005A4CC AC20D538 */ sw $zero, %lo(D_8011D538)($at) diff --git a/asm/non_matchings/racer/func_8005A6F0.s b/asm/non_matchings/racer/func_8005A6F0.s index 79bc0ac7..fd0db90b 100644 --- a/asm/non_matchings/racer/func_8005A6F0.s +++ b/asm/non_matchings/racer/func_8005A6F0.s @@ -367,8 +367,8 @@ glabel func_8005A6F0 /* 05B7BC 8005ABBC 8FA700AC */ lw $a3, 0xac($sp) /* 05B7C0 8005ABC0 0C01105C */ jal func_80044170 /* 05B7C4 8005ABC4 02002825 */ move $a1, $s0 -/* 05B7C8 8005ABC8 3C0E8012 */ lui $t6, %hi(D_8011D528) # $t6, 0x8012 -/* 05B7CC 8005ABCC 8DCED528 */ lw $t6, %lo(D_8011D528)($t6) +/* 05B7C8 8005ABC8 3C0E8012 */ lui $t6, %hi(gCurrentCarInput) # $t6, 0x8012 +/* 05B7CC 8005ABCC 8DCED528 */ lw $t6, %lo(gCurrentCarInput)($t6) /* 05B7D0 8005ABD0 3C0C8012 */ lui $t4, %hi(D_8011D56C) # $t4, 0x8012 /* 05B7D4 8005ABD4 31D88000 */ andi $t8, $t6, 0x8000 /* 05B7D8 8005ABD8 258CD56C */ addiu $t4, %lo(D_8011D56C) # addiu $t4, $t4, -0x2a94 @@ -594,9 +594,9 @@ glabel func_8005A6F0 /* 05BB10 8005AF10 3C018012 */ lui $at, %hi(D_8011D534) # $at, 0x8012 /* 05BB14 8005AF14 AC20D534 */ sw $zero, %lo(D_8011D534)($at) /* 05BB18 8005AF18 3C018012 */ lui $at, %hi(D_8011D538) # $at, 0x8012 -/* 05BB1C 8005AF1C 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BB1C 8005AF1C 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BB20 8005AF20 AC20D538 */ sw $zero, %lo(D_8011D538)($at) -/* 05BB24 8005AF24 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BB24 8005AF24 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BB28 8005AF28 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BB2C 8005AF2C AC600000 */ sw $zero, ($v1) /* 05BB30 8005AF30 3C018012 */ lui $at, %hi(D_8011D530) # $at, 0x8012 @@ -608,9 +608,9 @@ glabel func_8005A6F0 .L8005AF48: /* 05BB48 8005AF48 921901D6 */ lbu $t9, 0x1d6($s0) /* 05BB4C 8005AF4C 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 -/* 05BB50 8005AF50 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BB50 8005AF50 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BB54 8005AF54 2F21000E */ sltiu $at, $t9, 0xe -/* 05BB58 8005AF58 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BB58 8005AF58 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BB5C 8005AF5C 10200094 */ beqz $at, .L8005B1B0 /* 05BB60 8005AF60 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 /* 05BB64 8005AF64 0019C880 */ sll $t9, $t9, 2 @@ -626,10 +626,10 @@ glabel L8005AF80 /* 05BB88 8005AF88 8FA600A0 */ lw $a2, 0xa0($sp) /* 05BB8C 8005AF8C 0C013DFD */ jal func_8004F7F4 /* 05BB90 8005AF90 02003825 */ move $a3, $s0 -/* 05BB94 8005AF94 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BB94 8005AF94 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BB98 8005AF98 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BB9C 8005AF9C 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BBA0 8005AFA0 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BBA0 8005AFA0 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BBA4 8005AFA4 10000082 */ b .L8005B1B0 /* 05BBA8 8005AFA8 240B0001 */ li $t3, 1 glabel L8005AFAC @@ -638,10 +638,10 @@ glabel L8005AFAC /* 05BBB4 8005AFB4 8FA600A0 */ lw $a2, 0xa0($sp) /* 05BBB8 8005AFB8 0C013308 */ jal func_8004CC20 /* 05BBBC 8005AFBC 02003825 */ move $a3, $s0 -/* 05BBC0 8005AFC0 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BBC0 8005AFC0 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BBC4 8005AFC4 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BBC8 8005AFC8 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BBCC 8005AFCC 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BBCC 8005AFCC 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BBD0 8005AFD0 10000077 */ b .L8005B1B0 /* 05BBD4 8005AFD4 240B0001 */ li $t3, 1 glabel L8005AFD8 @@ -650,10 +650,10 @@ glabel L8005AFD8 /* 05BBE0 8005AFE0 8FA600A0 */ lw $a2, 0xa0($sp) /* 05BBE4 8005AFE4 0C011949 */ jal func_80046524 /* 05BBE8 8005AFE8 02003825 */ move $a3, $s0 -/* 05BBEC 8005AFEC 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BBEC 8005AFEC 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BBF0 8005AFF0 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BBF4 8005AFF4 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BBF8 8005AFF8 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BBF8 8005AFF8 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BBFC 8005AFFC 1000006C */ b .L8005B1B0 /* 05BC00 8005B000 240B0001 */ li $t3, 1 glabel L8005B004 @@ -662,10 +662,10 @@ glabel L8005B004 /* 05BC0C 8005B00C 8FA600A0 */ lw $a2, 0xa0($sp) /* 05BC10 8005B010 0C0125E5 */ jal func_80049794 /* 05BC14 8005B014 02003825 */ move $a3, $s0 -/* 05BC18 8005B018 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BC18 8005B018 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BC1C 8005B01C 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BC20 8005B020 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BC24 8005B024 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BC24 8005B024 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BC28 8005B028 10000061 */ b .L8005B1B0 /* 05BC2C 8005B02C 240B0001 */ li $t3, 1 glabel L8005B030 @@ -674,10 +674,10 @@ glabel L8005B030 /* 05BC38 8005B038 8FA600A0 */ lw $a2, 0xa0($sp) /* 05BC3C 8005B03C 0C013657 */ jal func_8004D95C /* 05BC40 8005B040 02003825 */ move $a3, $s0 -/* 05BC44 8005B044 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BC44 8005B044 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BC48 8005B048 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BC4C 8005B04C 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BC50 8005B050 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BC50 8005B050 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BC54 8005B054 10000056 */ b .L8005B1B0 /* 05BC58 8005B058 240B0001 */ li $t3, 1 glabel L8005B05C @@ -689,10 +689,10 @@ glabel L8005B05C /* 05BC70 8005B070 AFA20014 */ sw $v0, 0x14($sp) /* 05BC74 8005B074 0C0170D9 */ jal func_8005C364 /* 05BC78 8005B078 AFA80018 */ sw $t0, 0x18($sp) -/* 05BC7C 8005B07C 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BC7C 8005B07C 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BC80 8005B080 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BC84 8005B084 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BC88 8005B088 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BC88 8005B088 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BC8C 8005B08C 10000048 */ b .L8005B1B0 /* 05BC90 8005B090 240B0001 */ li $t3, 1 glabel L8005B094 @@ -704,10 +704,10 @@ glabel L8005B094 /* 05BCA8 8005B0A8 AFA20014 */ sw $v0, 0x14($sp) /* 05BCAC 8005B0AC 0C017434 */ jal func_8005D0D0 /* 05BCB0 8005B0B0 AFA80018 */ sw $t0, 0x18($sp) -/* 05BCB4 8005B0B4 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BCB4 8005B0B4 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BCB8 8005B0B8 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BCBC 8005B0BC 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BCC0 8005B0C0 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BCC0 8005B0C0 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BCC4 8005B0C4 1000003A */ b .L8005B1B0 /* 05BCC8 8005B0C8 240B0001 */ li $t3, 1 glabel L8005B0CC @@ -721,10 +721,10 @@ glabel L8005B0CC /* 05BCE8 8005B0E8 AFA30010 */ sw $v1, 0x10($sp) /* 05BCEC 8005B0EC 0C017608 */ jal func_8005D820 /* 05BCF0 8005B0F0 AFA80018 */ sw $t0, 0x18($sp) -/* 05BCF4 8005B0F4 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BCF4 8005B0F4 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BCF8 8005B0F8 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BCFC 8005B0FC 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BD00 8005B100 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BD00 8005B100 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BD04 8005B104 1000002A */ b .L8005B1B0 /* 05BD08 8005B108 240B0001 */ li $t3, 1 glabel L8005B10C @@ -736,10 +736,10 @@ glabel L8005B10C /* 05BD20 8005B120 AFA20014 */ sw $v0, 0x14($sp) /* 05BD24 8005B124 0C017930 */ jal func_8005E4C0 /* 05BD28 8005B128 AFA80018 */ sw $t0, 0x18($sp) -/* 05BD2C 8005B12C 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BD2C 8005B12C 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BD30 8005B130 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BD34 8005B134 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BD38 8005B138 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BD38 8005B138 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BD3C 8005B13C 1000001C */ b .L8005B1B0 /* 05BD40 8005B140 240B0001 */ li $t3, 1 glabel L8005B144 @@ -751,10 +751,10 @@ glabel L8005B144 /* 05BD58 8005B158 AFA20014 */ sw $v0, 0x14($sp) /* 05BD5C 8005B15C 0C017AA4 */ jal func_8005EA90 /* 05BD60 8005B160 AFA80018 */ sw $t0, 0x18($sp) -/* 05BD64 8005B164 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BD64 8005B164 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BD68 8005B168 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BD6C 8005B16C 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BD70 8005B170 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BD70 8005B170 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BD74 8005B174 1000000E */ b .L8005B1B0 /* 05BD78 8005B178 240B0001 */ li $t3, 1 glabel L8005B17C @@ -766,10 +766,10 @@ glabel L8005B17C /* 05BD90 8005B190 AFA20014 */ sw $v0, 0x14($sp) /* 05BD94 8005B194 0C017CC4 */ jal func_8005F310 /* 05BD98 8005B198 AFA80018 */ sw $t0, 0x18($sp) -/* 05BD9C 8005B19C 3C038012 */ lui $v1, %hi(D_8011D528) # $v1, 0x8012 +/* 05BD9C 8005B19C 3C038012 */ lui $v1, %hi(gCurrentCarInput) # $v1, 0x8012 /* 05BDA0 8005B1A0 3C028012 */ lui $v0, %hi(gActivePlayerButtonPress) # $v0, 0x8012 /* 05BDA4 8005B1A4 2442D52C */ addiu $v0, %lo(gActivePlayerButtonPress) # addiu $v0, $v0, -0x2ad4 -/* 05BDA8 8005B1A8 2463D528 */ addiu $v1, %lo(D_8011D528) # addiu $v1, $v1, -0x2ad8 +/* 05BDA8 8005B1A8 2463D528 */ addiu $v1, %lo(gCurrentCarInput) # addiu $v1, $v1, -0x2ad8 /* 05BDAC 8005B1AC 240B0001 */ li $t3, 1 .L8005B1B0: glabel L8005B1B0 @@ -947,8 +947,8 @@ glabel L8005B1B0 /* 05C028 8005B428 240B0001 */ li $t3, 1 /* 05C02C 8005B42C 130B0008 */ beq $t8, $t3, .L8005B450 /* 05C030 8005B430 3C058012 */ lui $a1, %hi(gActivePlayerButtonPress) # $a1, 0x8012 -/* 05C034 8005B434 3C068012 */ lui $a2, %hi(D_8011D528) # $a2, 0x8012 -/* 05C038 8005B438 8CC6D528 */ lw $a2, %lo(D_8011D528)($a2) +/* 05C034 8005B434 3C068012 */ lui $a2, %hi(gCurrentCarInput) # $a2, 0x8012 +/* 05C038 8005B438 8CC6D528 */ lw $a2, %lo(gCurrentCarInput)($a2) /* 05C03C 8005B43C 8FA400A0 */ lw $a0, 0xa0($sp) /* 05C040 8005B440 8CA5D52C */ lw $a1, %lo(gActivePlayerButtonPress)($a1) /* 05C044 8005B444 8FA700A8 */ lw $a3, 0xa8($sp) diff --git a/src/object_models.c b/src/object_models.c index 3ca18fb1..4dfac82c 100644 --- a/src/object_models.c +++ b/src/object_models.c @@ -67,7 +67,7 @@ void func_8005F850(void) { checksum += *(u8 *)(((s32)&func_80024D54) + i); } if (checksum != gFunc80024D54Checksum) { - func_8005C25C(); + antipiracy_modify_surface_speed_table(); } } diff --git a/src/racer.c b/src/racer.c index 8ca91474..3c31a698 100644 --- a/src/racer.c +++ b/src/racer.c @@ -16,6 +16,7 @@ #include "audio.h" #include "object_functions.h" #include "game.h" +#include "printf.h" #define MAX_NUMBER_OF_GHOST_NODES 360 @@ -35,7 +36,9 @@ f32 D_800DCB60[14] = { }; s32 D_800DCB98 = 0; // Currently unknown, might be a different type. -f32 D_800DCB9C[19] = { +// Table used for quantifying speed reduction while the car drives over it. +// An antipiracy trigger can set the first index to 0.5f, which makes that surface type impossible to drive on. +f32 gSurfaceSpeedScrubTable[19] = { 0.004f, 0.007f, 0.01f, 0.004f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.004f, 0.004f, @@ -136,7 +139,7 @@ s32 D_8011D504; ObjectCamera *gCameraObject; s32 D_8011D50C; ObjectTransform D_8011D510; -s32 D_8011D528; +s32 gCurrentCarInput; // Related to input of the car. s32 gActivePlayerButtonPress; s32 D_8011D530; s32 D_8011D534; @@ -149,7 +152,7 @@ s32 D_8011D54C; s16 D_8011D550; s8 D_8011D552; s8 D_8011D553; -s32 D_8011D554; +s32 gCurrentCarSteerVel; // Related to rotational velocity of the car. s32 D_8011D558; s32 D_8011D55C; s32 D_8011D560; @@ -214,6 +217,7 @@ typedef struct Object_64_80044170 { s8 unk215; } Object_64_80044170; +// Might be the main loop for the AI racers. void func_80044170(Object *arg0, Object_64_80044170 *arg1, s32 arg2) { s32 raceType; @@ -267,9 +271,9 @@ void func_80044170(Object *arg0, Object_64_80044170 *arg1, s32 arg2) { if (arg1->unk214 != 0) { D_8011D534 *= -1; - D_8011D528 &= ~0x8000; + gCurrentCarInput &= ~A_BUTTON; D_8011D538 = -50; - D_8011D528 |= 0x4000; + gCurrentCarInput |= B_BUTTON; } if (D_8011D534 > 75) { @@ -427,13 +431,13 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8004DE38.s") void func_8004F77C(unk8004F77C *arg0) { s32 temp; - arg0->unk20A &= ~0x80; - if ((D_8011D528 & 0x4000) != 0) { - arg0->unk20A |= 0x80; + arg0->flags &= ~0x80; + if ((gCurrentCarInput & B_BUTTON) != 0) { + arg0->flags |= 0x80; } - temp = arg0->unk20A & 0xF; - if ((arg0->unk20A & 0xC0) != 0) { + temp = arg0->flags & 0xF; + if ((arg0->flags & 0xC0) != 0) { temp++; if (temp >= 3) { temp = 2; @@ -445,7 +449,7 @@ void func_8004F77C(unk8004F77C *arg0) { } } - arg0->unk20A = (arg0->unk20A & 0xFFF0) | temp; + arg0->flags = (arg0->flags & 0xFFF0) | temp; } GLOBAL_ASM("asm/non_matchings/racer/func_8004F7F4.s") @@ -497,20 +501,23 @@ GLOBAL_ASM("asm/non_matchings/racer/func_80050754.s") GLOBAL_ASM("asm/non_matchings/racer/func_80050850.s") GLOBAL_ASM("asm/non_matchings/racer/func_80050A28.s") +// Loops for as long as Taj exists. After swapping vehicle once, will remain true until you enter a door. s32 func_80052188(void) { if (D_8011D582 == 2) { D_8011D582 = 1; - return 1; + return TRUE; } - return 0; + return FALSE; } +// Called when Taj swaps the active vehicle, is set to 1, each time. void func_800521B8(s32 arg0) { D_8011D582 = arg0; } GLOBAL_ASM("asm/non_matchings/racer/func_800521C4.s") +// Ran by the AI. Seems to be direction related of some sorts. void func_8005234C(unk8005234C *arg0) { arg0->unk16C -= arg0->unk16C >> 3; if (arg0->unk16C >= -9 && arg0->unk16C < 10) { // Deadzone? @@ -521,91 +528,115 @@ 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) { +// action seems to be 1 when you're reversing, if you hit the horn, it's 4, and if you introduce yourself to a brick wall, it's 3 then 6. +// unk18 seems to be a counter that's used as a baseline for animations +// unk3B mostly mirrors what arg2 is, but it gets set to 0 +// I've yet to find a scenario where D_8011D55C is not 0. +// I've also yet to find a scenario where the action is < 3 +// arg6 is set to 6 when honking, but 7 when reversing and not honking and 0 when crashing. +// arg7 seems to be based on direction???? +void func_80052988(Object *arg0, Object_64 *arg1, s32 action, s32 arg3, s32 duration, s32 arg5, s32 arg6, s32 arg7) { arg5 *= arg7; - if ((D_8011D55C == -1) && (arg2 >= 3)) { + if ((D_8011D55C == -1) && (action >= 3)) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; + //render_printf("set0\n"); } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { - if (arg0->segment.unk18 >= 0x29) { + if (arg0->segment.unk18 >= 41) { arg0->segment.unk18 -= arg7 * 4; - if (arg0->segment.unk18 < 0x29) { - arg0->segment.unk3B = arg2; + if (arg0->segment.unk18 < 41) { + arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; } + //render_printf("set1\n"); } else { arg0->segment.unk18 += arg7 * 4; - if (arg0->segment.unk18 >= 0x28) { - arg0->segment.unk3B = arg2; + if (arg0->segment.unk18 >= 40) { + arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; } + //render_printf("set2\n"); } - } else { - arg0->segment.unk3B = arg2; + } else { // Set active flag, whether it's from just crashing, or beginning to honk. + arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; arg1->unk1F3 &= ~0x80; } - } else if (arg0->segment.unk3B == arg2) { + } else if (arg0->segment.unk3B == action) { if (arg6 & 2) { - if (arg1->unk1F3 & 0x80) { + if (arg1->unk1F3 & 0x80) { // Stop honking or reversing. arg0->segment.unk18 -= arg5; if (arg0->segment.unk18 <= 0) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18 = 0x28; + arg0->segment.unk18 = 40; arg1->unk1F3 = 0; } - } else { + } else { // Actively reversing or honking or boosting, possibly a velocity modifier, have found it's also set when recovering from getting hit by a rocket or spike trap arg0->segment.unk18 += arg5; - if (arg0->segment.unk18 >= arg4) { - arg0->segment.unk18 = arg4 - 1; + // Keeps the timer below the duration value, while actively held. + if (arg0->segment.unk18 >= duration) { + arg0->segment.unk18 = duration - 1; if ((arg6 & 4) == 0) { arg1->unk1F3 |= 0x80; } } } - } else { + } else { // Crash recoil arg0->segment.unk18 += arg5; - if (arg0->segment.unk18 >= arg4) { + if (arg0->segment.unk18 >= duration) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18 = 0x28; + arg0->segment.unk18 = 40; arg1->unk1F3 = 0; } } - } else { + } else { // Haven't seen this trigger yet. arg0->segment.unk18 = arg3; - arg0->segment.unk3B = arg2; + arg0->segment.unk3B = action; } + /*render_printf("D_8011D55C %d\n", D_8011D55C); + render_printf("action %d\n", action); + render_printf("unk18 %d\n", arg0->segment.unk18); + render_printf("unk3B %d\n", arg0->segment.unk3B); + render_printf("arg6 %d\n", arg6); + render_printf("arg7 %d\n", arg7);*/ } 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) { - s32 phi_v0; - f32 phi_f0 = obj->unk2C; +/** + * Handle the steering input of all cars. + * It takes the speed of the car, creating a curve for the rotational velocity to scale with. + */ +void handle_car_steering(Object_64_80053478 *car) { + s32 velScale; + f32 vel = car->unk2C; - if (phi_f0 < 0.0) { - phi_f0 = -phi_f0; + // Stay positive :) + if (vel < 0.0) { + vel = -vel; } - if (phi_f0 > 1.8) { - phi_f0 = 1.8f; + if (vel > 1.8) { + vel = 1.8f; } - phi_f0 -= 0.2; - if (phi_f0 < 0.0) { - phi_f0 = 0.0f; + vel -= 0.2; + if (vel < 0.0) { + vel = 0.0f; } - if (obj->unk1E6 != 0) { - phi_v0 = phi_f0 * 68.0f; + if (car->unk1E6 != 0) { + velScale = vel * 68.0f; } else { - phi_v0 = phi_f0 * 58.0f; + velScale = vel * 58.0f; } - D_8011D554 -= (obj->unk1E1 * phi_v0); - if (obj->unk2C > 0.0f) { - D_8011D554 = -D_8011D554; + // Set the steering velocity based on the car's steering value, scaled with the temp forward velocity value. + gCurrentCarSteerVel -= (car->unk1E1 * velScale); + // If the car is reversing, then flip the steering. + if (car->unk2C > 0.0f) { + gCurrentCarSteerVel = -gCurrentCarSteerVel; } } @@ -624,23 +655,26 @@ 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->throttle > 0.0) { - arg0->throttle -= 0.1; +/** + * Adjusts the throttle and brake application for all cars, based off the input. + */ +void handle_car_velocity_control(Object_64 *car) { + if (car->throttle > 0.0) { + car->throttle -= 0.1; } - if (D_8011D528 & 0x8000) { - arg0->throttle = 1.0f; + if (gCurrentCarInput & A_BUTTON) { + car->throttle = 1.0f; } - if (D_8011D528 & 0x4000) { - if (arg0->brake < 1.0) { - arg0->brake += 0.2; + if (gCurrentCarInput & B_BUTTON) { + if (car->brake < 1.0) { + car->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 (car->brake > 0.05) { + car->brake -= 0.1; } } } @@ -932,8 +966,12 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8005A6F0.s") GLOBAL_ASM("asm/non_matchings/racer/func_8005B818.s") // This gets called if an anti-piracy checksum fails in func_8005F850. -void func_8005C25C(void) { - D_800DCB9C[0] = 0.05f; +/** + * Triggered upon failure of an anti-tamper test. Sets the first index of the surface speed + * table to an unreasonable value, wrecking drivability while on it. + */ +void antipiracy_modify_surface_speed_table(void) { + gSurfaceSpeedScrubTable[0] = 0.05f; } void func_8005C270(unk8005C270 *arg0) { diff --git a/src/racer.h b/src/racer.h index 02a9d625..8fd26363 100644 --- a/src/racer.h +++ b/src/racer.h @@ -63,7 +63,7 @@ typedef struct Object_64_8004D95C { typedef struct unk8004F77C { u8 unk0[0x20A]; - u8 unk20A; + u8 flags; } unk8004F77C; /* Unknown Size */ @@ -74,9 +74,9 @@ typedef struct unk8005234C { typedef struct Object_64_80053478 { u8 unk0[0x2C]; - f32 unk2C; + f32 unk2C; // Forward Velocity? u8 unk30[0x1B1]; - s8 unk1E1; + s8 unk1E1; // Steering Value? u8 unk1E2[4]; s8 unk1E6; } Object_64_80053478; @@ -156,7 +156,7 @@ extern s32 D_800DCB5C; extern f32 D_800DCB60[14]; extern s32 D_800DCB98; -extern f32 D_800DCB9C[19]; +extern f32 gSurfaceSpeedScrubTable[19]; extern f32 D_800DCBE8[19]; @@ -206,9 +206,9 @@ 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 handle_car_steering(Object_64_80053478 *car); void func_800535C4(unk800535C4 *arg0, unk800535C4_2 *arg1); -void func_80053664(Object_64 *arg0); +void handle_car_velocity_control(Object_64 *car); 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); @@ -228,7 +228,7 @@ s16 func_80059E20(void); void func_8005A3B0(void); void func_8005A3C0(void); void func_8005A3D0(void); -void func_8005C25C(void); +void antipiracy_modify_surface_speed_table(void); //Non Matching void set_ghost_position_and_rotation(Object *obj); From 067679e94b6c8805a81fbeea7819789a6d40adf6 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:59:11 +0100 Subject: [PATCH 05/25] better terminology --- asm/non_matchings/racer/func_80050A28.s | 4 ++-- asm/non_matchings/racer/func_8005492C.s | 4 ++-- src/object_models.c | 2 +- src/racer.c | 10 +++++----- src/racer.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/asm/non_matchings/racer/func_80050A28.s b/asm/non_matchings/racer/func_80050A28.s index 8bfed153..90dfc3a0 100644 --- a/asm/non_matchings/racer/func_80050A28.s +++ b/asm/non_matchings/racer/func_80050A28.s @@ -767,7 +767,7 @@ glabel func_80050A28 /* 05207C 8005147C E7B00040 */ swc1 $f16, 0x40($sp) /* 052080 80051480 8FA50028 */ lw $a1, 0x28($sp) /* 052084 80051484 8FA60070 */ lw $a2, 0x70($sp) -/* 052088 80051488 3C07800E */ lui $a3, %hi(gSurfaceSpeedScrubTable) # $a3, 0x800e +/* 052088 80051488 3C07800E */ lui $a3, %hi(gSurfaceTractionTable) # $a3, 0x800e /* 05208C 8005148C 83A80057 */ lb $t0, 0x57($sp) /* 052090 80051490 8FA90064 */ lw $t1, 0x64($sp) /* 052094 80051494 C7A20048 */ lwc1 $f2, 0x48($sp) @@ -775,7 +775,7 @@ glabel func_80050A28 /* 05209C 8005149C C7B00040 */ lwc1 $f16, 0x40($sp) /* 0520A0 800514A0 00025A00 */ sll $t3, $v0, 8 /* 0520A4 800514A4 05610006 */ bgez $t3, .L800514C0 -/* 0520A8 800514A8 24E7CB9C */ addiu $a3, %lo(gSurfaceSpeedScrubTable) # addiu $a3, $a3, -0x3464 +/* 0520A8 800514A8 24E7CB9C */ addiu $a3, %lo(gSurfaceTractionTable) # addiu $a3, $a3, -0x3464 /* 0520AC 800514AC C4E40000 */ lwc1 $f4, ($a3) /* 0520B0 800514B0 90A201DC */ lbu $v0, 0x1dc($a1) /* 0520B4 800514B4 46047380 */ add.s $f14, $f14, $f4 diff --git a/asm/non_matchings/racer/func_8005492C.s b/asm/non_matchings/racer/func_8005492C.s index f14da711..51feb79f 100644 --- a/asm/non_matchings/racer/func_8005492C.s +++ b/asm/non_matchings/racer/func_8005492C.s @@ -144,9 +144,9 @@ glabel func_8005492C /* 0556E8 80054AE8 10810008 */ beq $a0, $at, .L80054B0C /* 0556EC 80054AEC 46009006 */ mov.s $f0, $f18 /* 0556F0 80054AF0 00047080 */ sll $t6, $a0, 2 -/* 0556F4 80054AF4 3C01800E */ lui $at, %hi(gSurfaceSpeedScrubTable) # $at, 0x800e +/* 0556F4 80054AF4 3C01800E */ lui $at, %hi(gSurfaceTractionTable) # $at, 0x800e /* 0556F8 80054AF8 002E0821 */ addu $at, $at, $t6 -/* 0556FC 80054AFC C426CB9C */ lwc1 $f6, %lo(gSurfaceSpeedScrubTable)($at) +/* 0556FC 80054AFC C426CB9C */ lwc1 $f6, %lo(gSurfaceTractionTable)($at) /* 055700 80054B00 18800002 */ blez $a0, .L80054B0C /* 055704 80054B04 46069000 */ add.s $f0, $f18, $f6 /* 055708 80054B08 00801825 */ move $v1, $a0 diff --git a/src/object_models.c b/src/object_models.c index 4dfac82c..dc4b34a2 100644 --- a/src/object_models.c +++ b/src/object_models.c @@ -67,7 +67,7 @@ void func_8005F850(void) { checksum += *(u8 *)(((s32)&func_80024D54) + i); } if (checksum != gFunc80024D54Checksum) { - antipiracy_modify_surface_speed_table(); + antipiracy_modify_surface_traction_table(); } } diff --git a/src/racer.c b/src/racer.c index 3c31a698..5f6ca530 100644 --- a/src/racer.c +++ b/src/racer.c @@ -36,16 +36,16 @@ f32 D_800DCB60[14] = { }; s32 D_800DCB98 = 0; // Currently unknown, might be a different type. -// Table used for quantifying speed reduction while the car drives over it. +// Table used for quantifying speed reduction while the car drives over it, like how grass will slow you down more than the road. // An antipiracy trigger can set the first index to 0.5f, which makes that surface type impossible to drive on. -f32 gSurfaceSpeedScrubTable[19] = { +f32 gSurfaceTractionTable[19] = { 0.004f, 0.007f, 0.01f, 0.004f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.004f, 0.004f, 0.004f, 0.004f, 0.004f, 0.004f, 0.004f, 0.004f, 0.004f, }; - +// Can only assume this is surface related too. Not incline thresholds though. f32 D_800DCBE8[19] = { 0.8f, 0.85f, 0.85f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, @@ -970,8 +970,8 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8005B818.s") * Triggered upon failure of an anti-tamper test. Sets the first index of the surface speed * table to an unreasonable value, wrecking drivability while on it. */ -void antipiracy_modify_surface_speed_table(void) { - gSurfaceSpeedScrubTable[0] = 0.05f; +void antipiracy_modify_surface_traction_table(void) { + gSurfaceTractionTable[0] = 0.05f; } void func_8005C270(unk8005C270 *arg0) { diff --git a/src/racer.h b/src/racer.h index 8fd26363..e8c4ae09 100644 --- a/src/racer.h +++ b/src/racer.h @@ -156,7 +156,7 @@ extern s32 D_800DCB5C; extern f32 D_800DCB60[14]; extern s32 D_800DCB98; -extern f32 gSurfaceSpeedScrubTable[19]; +extern f32 gSurfaceTractionTable[19]; extern f32 D_800DCBE8[19]; @@ -228,7 +228,7 @@ s16 func_80059E20(void); void func_8005A3B0(void); void func_8005A3C0(void); void func_8005A3D0(void); -void antipiracy_modify_surface_speed_table(void); +void antipiracy_modify_surface_traction_table(void); //Non Matching void set_ghost_position_and_rotation(Object *obj); From bff0c086945ba95044fcb67fc1dd79e365d8bfca Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Fri, 22 Apr 2022 22:25:10 +0100 Subject: [PATCH 06/25] matched thread4_audio --- .../unknown_003260/audioNewThread.s | 4 +- .../unknown_003260/func_80002A98.s | 97 ------------------- src/unknown_003260.c | 35 ++++++- src/unknown_003260.h | 2 +- 4 files changed, 36 insertions(+), 102 deletions(-) delete mode 100644 asm/non_matchings/unknown_003260/func_80002A98.s diff --git a/asm/non_matchings/unknown_003260/audioNewThread.s b/asm/non_matchings/unknown_003260/audioNewThread.s index d11e48ce..bafcfe8c 100644 --- a/asm/non_matchings/unknown_003260/audioNewThread.s +++ b/asm/non_matchings/unknown_003260/audioNewThread.s @@ -246,8 +246,8 @@ glabel audioNewThread /* 003604 80002A04 3C188012 */ lui $t8, %hi(dmaState) # $t8, 0x8012 /* 003608 80002A08 27189230 */ addiu $t8, %lo(dmaState) # addiu $t8, $t8, -0x6dd0 /* 00360C 80002A0C 3C048011 */ lui $a0, %hi(audioThread) # $a0, 0x8011 -/* 003610 80002A10 3C068000 */ lui $a2, %hi(func_80002A98) # $a2, 0x8000 -/* 003614 80002A14 24C62A98 */ addiu $a2, %lo(func_80002A98) # addiu $a2, $a2, 0x2a98 +/* 003610 80002A10 3C068000 */ lui $a2, %hi(thread4_audio) # $a2, 0x8000 +/* 003614 80002A14 24C62A98 */ addiu $a2, %lo(thread4_audio) # addiu $a2, $a2, 0x2a98 /* 003618 80002A18 24845FB0 */ addiu $a0, %lo(audioThread) # addiu $a0, $a0, 0x5fb0 /* 00361C 80002A1C AFB80010 */ sw $t8, 0x10($sp) /* 003620 80002A20 24050004 */ li $a1, 4 diff --git a/asm/non_matchings/unknown_003260/func_80002A98.s b/asm/non_matchings/unknown_003260/func_80002A98.s deleted file mode 100644 index 8f19cae9..00000000 --- a/asm/non_matchings/unknown_003260/func_80002A98.s +++ /dev/null @@ -1,97 +0,0 @@ -glabel func_80002A98 -/* 003698 80002A98 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 00369C 80002A9C AFA40050 */ sw $a0, 0x50($sp) -/* 0036A0 80002AA0 3C048011 */ lui $a0, %hi(D_80115F90) # $a0, 0x8011 -/* 0036A4 80002AA4 AFBF003C */ sw $ra, 0x3c($sp) -/* 0036A8 80002AA8 AFB00018 */ sw $s0, 0x18($sp) -/* 0036AC 80002AAC 8C845F90 */ lw $a0, %lo(D_80115F90)($a0) -/* 0036B0 80002AB0 3C058011 */ lui $a1, %hi(audioStack) # $a1, 0x8011 -/* 0036B4 80002AB4 3C068011 */ lui $a2, %hi(OSMesgQueue_80116160) # $a2, 0x8011 -/* 0036B8 80002AB8 AFBE0038 */ sw $fp, 0x38($sp) -/* 0036BC 80002ABC AFB70034 */ sw $s7, 0x34($sp) -/* 0036C0 80002AC0 AFB60030 */ sw $s6, 0x30($sp) -/* 0036C4 80002AC4 AFB5002C */ sw $s5, 0x2c($sp) -/* 0036C8 80002AC8 AFB40028 */ sw $s4, 0x28($sp) -/* 0036CC 80002ACC AFB30024 */ sw $s3, 0x24($sp) -/* 0036D0 80002AD0 AFB20020 */ sw $s2, 0x20($sp) -/* 0036D4 80002AD4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0036D8 80002AD8 00008025 */ move $s0, $zero -/* 0036DC 80002ADC AFA00048 */ sw $zero, 0x48($sp) -/* 0036E0 80002AE0 AFA00044 */ sw $zero, 0x44($sp) -/* 0036E4 80002AE4 24C66160 */ addiu $a2, %lo(OSMesgQueue_80116160) # addiu $a2, $a2, 0x6160 -/* 0036E8 80002AE8 24A56220 */ addiu $a1, %lo(audioStack) # addiu $a1, $a1, 0x6220 -/* 0036EC 80002AEC 0C01E520 */ jal osScAddClient -/* 0036F0 80002AF0 24070001 */ li $a3, 1 -/* 0036F4 80002AF4 3C1E8011 */ lui $fp, %hi(D_80116198) # $fp, 0x8011 -/* 0036F8 80002AF8 3C16800E */ lui $s6, %hi(audFrameCt) # $s6, 0x800e -/* 0036FC 80002AFC 3C158011 */ lui $s5, %hi(D_80115F98) # $s5, 0x8011 -/* 003700 80002B00 26B55F98 */ addiu $s5, %lo(D_80115F98) # addiu $s5, $s5, 0x5f98 -/* 003704 80002B04 26D6C680 */ addiu $s6, %lo(audFrameCt) # addiu $s6, $s6, -0x3980 -/* 003708 80002B08 27DE6198 */ addiu $fp, %lo(D_80116198) # addiu $fp, $fp, 0x6198 -/* 00370C 80002B0C 24170003 */ li $s7, 3 -/* 003710 80002B10 2414000A */ li $s4, 10 -/* 003714 80002B14 24130004 */ li $s3, 4 -/* 003718 80002B18 24120001 */ li $s2, 1 -/* 00371C 80002B1C 27B10048 */ addiu $s1, $sp, 0x48 -.L80002B20: -/* 003720 80002B20 3C048011 */ lui $a0, %hi(OSMesgQueue_80116160) # $a0, 0x8011 -/* 003724 80002B24 24846160 */ addiu $a0, %lo(OSMesgQueue_80116160) # addiu $a0, $a0, 0x6160 -/* 003728 80002B28 02202825 */ move $a1, $s1 -/* 00372C 80002B2C 0C0322EC */ jal osRecvMesg -/* 003730 80002B30 02403025 */ move $a2, $s2 -/* 003734 80002B34 8FAE0048 */ lw $t6, 0x48($sp) -/* 003738 80002B38 00000000 */ nop -/* 00373C 80002B3C 85C20000 */ lh $v0, ($t6) -/* 003740 80002B40 00000000 */ nop -/* 003744 80002B44 10520007 */ beq $v0, $s2, .L80002B64 -/* 003748 80002B48 00000000 */ nop -/* 00374C 80002B4C 1053001B */ beq $v0, $s3, .L80002BBC -/* 003750 80002B50 00000000 */ nop -/* 003754 80002B54 10540018 */ beq $v0, $s4, .L80002BB8 -/* 003758 80002B58 00000000 */ nop -/* 00375C 80002B5C 10000017 */ b .L80002BBC -/* 003760 80002B60 00000000 */ nop -.L80002B64: -/* 003764 80002B64 8ECF0000 */ lw $t7, ($s6) -/* 003768 80002B68 8FA50044 */ lw $a1, 0x44($sp) -/* 00376C 80002B6C 01F7001B */ divu $zero, $t7, $s7 -/* 003770 80002B70 16E00002 */ bnez $s7, .L80002B7C -/* 003774 80002B74 00000000 */ nop -/* 003778 80002B78 0007000D */ break 7 -.L80002B7C: -/* 00377C 80002B7C 0000C010 */ mfhi $t8 -/* 003780 80002B80 0018C880 */ sll $t9, $t8, 2 -/* 003784 80002B84 02B94021 */ addu $t0, $s5, $t9 -/* 003788 80002B88 8D040008 */ lw $a0, 8($t0) -/* 00378C 80002B8C 0C000B00 */ jal func_80002C00 -/* 003790 80002B90 00000000 */ nop -/* 003794 80002B94 03C02025 */ move $a0, $fp -/* 003798 80002B98 27A50044 */ addiu $a1, $sp, 0x44 -/* 00379C 80002B9C 0C0322EC */ jal osRecvMesg -/* 0037A0 80002BA0 02403025 */ move $a2, $s2 -/* 0037A4 80002BA4 8FA40044 */ lw $a0, 0x44($sp) -/* 0037A8 80002BA8 0C000B7E */ jal func_80002DF8 -/* 0037AC 80002BAC 00000000 */ nop -/* 0037B0 80002BB0 10000002 */ b .L80002BBC -/* 0037B4 80002BB4 00000000 */ nop -.L80002BB8: -/* 0037B8 80002BB8 02408025 */ move $s0, $s2 -.L80002BBC: -/* 0037BC 80002BBC 1200FFD8 */ beqz $s0, .L80002B20 -/* 0037C0 80002BC0 00000000 */ nop -/* 0037C4 80002BC4 3C048011 */ lui $a0, %hi(ALGlobals_801161D0) # $a0, 0x8011 -/* 0037C8 80002BC8 0C0321ED */ jal alClose -/* 0037CC 80002BCC 248461D0 */ addiu $a0, %lo(ALGlobals_801161D0) # addiu $a0, $a0, 0x61d0 -/* 0037D0 80002BD0 8FBF003C */ lw $ra, 0x3c($sp) -/* 0037D4 80002BD4 8FB00018 */ lw $s0, 0x18($sp) -/* 0037D8 80002BD8 8FB1001C */ lw $s1, 0x1c($sp) -/* 0037DC 80002BDC 8FB20020 */ lw $s2, 0x20($sp) -/* 0037E0 80002BE0 8FB30024 */ lw $s3, 0x24($sp) -/* 0037E4 80002BE4 8FB40028 */ lw $s4, 0x28($sp) -/* 0037E8 80002BE8 8FB5002C */ lw $s5, 0x2c($sp) -/* 0037EC 80002BEC 8FB60030 */ lw $s6, 0x30($sp) -/* 0037F0 80002BF0 8FB70034 */ lw $s7, 0x34($sp) -/* 0037F4 80002BF4 8FBE0038 */ lw $fp, 0x38($sp) -/* 0037F8 80002BF8 03E00008 */ jr $ra -/* 0037FC 80002BFC 27BD0050 */ addiu $sp, $sp, 0x50 - diff --git a/src/unknown_003260.c b/src/unknown_003260.c index 7fb33fb9..94acacd0 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -123,7 +123,7 @@ void audioNewThread(ALSynConfig *c, OSPri p, OSSched *arg2) { osCreateMesgQueue(&OSMesgQueue_80116160, &D_80116178, 8); osCreateMesgQueue(&audDMAMessageQ, &audDMAMessageBuf, 50); - osCreateThread(&audioThread, 4, &func_80002A98, NULL, &dmaState, p); + osCreateThread(&audioThread, 4, &thread4_audio, NULL, &dmaState, p); } #else GLOBAL_ASM("asm/non_matchings/unknown_003260/audioNewThread.s") @@ -137,7 +137,38 @@ void audioStopThread(void) { osStopThread(&audioThread); } -GLOBAL_ASM("asm/non_matchings/unknown_003260/func_80002A98.s") +/** + * Main function for handling ingame audio. Loops continuously as long as the scheduler feeds it updates. + */ +void thread4_audio(UNUSED void *arg) { + s32 audioThreadMarkExit; + s16* audioThreadRetraceMesg; + s16* audioThreadUpdateMesg; + + audioThreadMarkExit = FALSE; + audioThreadRetraceMesg = NULL; + audioThreadUpdateMesg = NULL; + + osScAddClient(D_80115F90, &audioStack, &OSMesgQueue_80116160, 1); + while (!audioThreadMarkExit) { + osRecvMesg(&OSMesgQueue_80116160, &audioThreadRetraceMesg, 1); + switch (*audioThreadRetraceMesg) { + case 1: + func_80002C00(D_80115F98[(((u32) audFrameCt % 3))+2], audioThreadUpdateMesg); + osRecvMesg(&D_80116198, &audioThreadUpdateMesg, 1); + func_80002DF8(audioThreadUpdateMesg); + break; + case 4: + // Mysterious void. + break; + case 10: + audioThreadMarkExit = TRUE; + break; + } + } + alClose(&ALGlobals_801161D0); +} + GLOBAL_ASM("asm/non_matchings/unknown_003260/func_80002C00.s") GLOBAL_ASM("asm/non_matchings/unknown_003260/func_80002DF8.s") diff --git a/src/unknown_003260.h b/src/unknown_003260.h index 446bc1a8..06095961 100644 --- a/src/unknown_003260.h +++ b/src/unknown_003260.h @@ -102,7 +102,7 @@ extern unk800DC6BC* gAlSndPlayer; extern s32 sfxVolumeSlider; extern s32 D_800DC6C4; -extern void func_80002A98(void*); +extern void thread4_audio(void*); void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size); //lib/src/al void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items, s32 itemCount); //lib/src/unknown_0C9C90.c ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt); //lib/src/unknown_0C9C90.c From 7962ad78615ce1178dd3be16460a22e1898a96e1 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Sat, 23 Apr 2022 18:39:20 +0100 Subject: [PATCH 07/25] identify some ostask values --- .../unknown_078050/setupOSTasks.s | 28 +++++++++---------- src/unknown_078050.c | 4 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/asm/non_matchings/unknown_078050/setupOSTasks.s b/asm/non_matchings/unknown_078050/setupOSTasks.s index 7a39ce56..d8cd1ff0 100644 --- a/asm/non_matchings/unknown_078050/setupOSTasks.s +++ b/asm/non_matchings/unknown_078050/setupOSTasks.s @@ -37,21 +37,21 @@ glabel setupOSTasks /* 0780D8 800774D8 ACEA0050 */ sw $t2, 0x50($a3) /* 0780DC 800774DC ACEE0014 */ sw $t6, 0x14($a3) /* 0780E0 800774E0 01E3C023 */ subu $t8, $t7, $v1 -/* 0780E4 800774E4 3C0C8012 */ lui $t4, %hi(D_801246A0) # $t4, 0x8012 +/* 0780E4 800774E4 3C0C8012 */ lui $t4, %hi(gGfxSPTaskYieldBuffer) # $t4, 0x8012 /* 0780E8 800774E8 3C0D8012 */ lui $t5, %hi(D_80125EA0) # $t5, 0x8012 /* 0780EC 800774EC 344200FF */ ori $v0, (0xFF0000FF & 0xFFFF) # ori $v0, $v0, 0xff /* 0780F0 800774F0 ACE90008 */ sw $t1, 8($a3) /* 0780F4 800774F4 3C19800E */ lui $t9, %hi(rspF3DDKRXbusStart) # $t9, 0x800e /* 0780F8 800774F8 3C08800F */ lui $t0, %hi(rspF3DDKRDataXbusStart) # $t0, 0x800f -/* 0780FC 800774FC 3C0A8012 */ lui $t2, %hi(D_801242A0) # $t2, 0x8012 -/* 078100 80077500 258C46A0 */ addiu $t4, %lo(D_801246A0) # addiu $t4, $t4, 0x46a0 +/* 0780FC 800774FC 3C0A8012 */ lui $t2, %hi(gDramStack) # $t2, 0x8012 +/* 078100 80077500 258C46A0 */ addiu $t4, %lo(gGfxSPTaskYieldBuffer) # addiu $t4, $t4, 0x46a0 /* 078104 80077504 25AD5EA0 */ addiu $t5, %lo(D_80125EA0) # addiu $t5, $t5, 0x5ea0 /* 078108 80077508 3C0E8012 */ lui $t6, %hi(D_801271B0) # $t6, 0x8012 /* 07810C 8007750C ACF8001C */ sw $t8, 0x1c($a3) /* 078110 80077510 2739A970 */ addiu $t9, %lo(rspF3DDKRXbusStart) # addiu $t9, $t9, -0x5690 /* 078114 80077514 2508ABA0 */ addiu $t0, %lo(rspF3DDKRDataXbusStart) # addiu $t0, $t0, -0x5460 /* 078118 80077518 24090800 */ li $t1, 2048 -/* 07811C 8007751C 254A42A0 */ addiu $t2, %lo(D_801242A0) # addiu $t2, $t2, 0x42a0 +/* 07811C 8007751C 254A42A0 */ addiu $t2, %lo(gDramStack) # addiu $t2, $t2, 0x42a0 /* 078120 80077520 240B0400 */ li $t3, 1024 /* 078124 80077524 ACEC0038 */ sw $t4, 0x38($a3) /* 078128 80077528 ACED003C */ sw $t5, 0x3c($a3) @@ -125,14 +125,14 @@ glabel setupOSTasks /* 078230 80077630 ACEC0014 */ sw $t4, 0x14($a3) /* 078234 80077634 25EFA970 */ addiu $t7, %lo(rspF3DDKRXbusStart) # addiu $t7, $t7, -0x5690 /* 078238 80077638 3C18800F */ lui $t8, %hi(rspF3DDKRDataXbusStart) # $t8, 0x800f -/* 07823C 8007763C 3C088012 */ lui $t0, %hi(D_801242A0) # $t0, 0x8012 +/* 07823C 8007763C 3C088012 */ lui $t0, %hi(gDramStack) # $t0, 0x8012 /* 078240 80077640 3C0A8012 */ lui $t2, %hi(D_801271B0) # $t2, 0x8012 /* 078244 80077644 3C0D8012 */ lui $t5, %hi(D_80125ED8) # $t5, 0x8012 /* 078248 80077648 3C0E800E */ lui $t6, %hi(D_800DE490) # $t6, 0x800e /* 07824C 8007764C ACEF0020 */ sw $t7, 0x20($a3) /* 078250 80077650 2718ABA0 */ addiu $t8, %lo(rspF3DDKRDataXbusStart) # addiu $t8, $t8, -0x5460 /* 078254 80077654 24190800 */ li $t9, 2048 -/* 078258 80077658 250842A0 */ addiu $t0, %lo(D_801242A0) # addiu $t0, $t0, 0x42a0 +/* 078258 80077658 250842A0 */ addiu $t0, %lo(gDramStack) # addiu $t0, $t0, 0x42a0 /* 07825C 8007765C 24090400 */ li $t1, 1024 /* 078260 80077660 254A71B0 */ addiu $t2, %lo(D_801271B0) # addiu $t2, $t2, 0x71b0 /* 078264 80077664 240B0A00 */ li $t3, 2560 @@ -230,16 +230,16 @@ glabel setupOSTasks /* 0783C4 800777C4 ACF80028 */ sw $t8, 0x28($a3) /* 0783C8 800777C8 ACEE001C */ sw $t6, 0x1c($a3) /* 0783CC 800777CC 24190800 */ li $t9, 2048 -/* 0783D0 800777D0 3C088012 */ lui $t0, %hi(D_801242A0) # $t0, 0x8012 -/* 0783D4 800777D4 3C0A8012 */ lui $t2, %hi(D_801246A0) # $t2, 0x8012 +/* 0783D0 800777D0 3C088012 */ lui $t0, %hi(gDramStack) # $t0, 0x8012 +/* 0783D4 800777D4 3C0A8012 */ lui $t2, %hi(gGfxSPTaskYieldBuffer) # $t2, 0x8012 /* 0783D8 800777D8 3C0B8012 */ lui $t3, %hi(D_80125EA0) # $t3, 0x8012 /* 0783DC 800777DC 3C0C8012 */ lui $t4, %hi(D_801271B0) # $t4, 0x8012 /* 0783E0 800777E0 3C0F8012 */ lui $t7, %hi(D_80125ED8) # $t7, 0x8012 /* 0783E4 800777E4 3C18800E */ lui $t8, %hi(D_800DE490) # $t8, 0x800e /* 0783E8 800777E8 ACF9002C */ sw $t9, 0x2c($a3) -/* 0783EC 800777EC 250842A0 */ addiu $t0, %lo(D_801242A0) # addiu $t0, $t0, 0x42a0 +/* 0783EC 800777EC 250842A0 */ addiu $t0, %lo(gDramStack) # addiu $t0, $t0, 0x42a0 /* 0783F0 800777F0 24090400 */ li $t1, 1024 -/* 0783F4 800777F4 254A46A0 */ addiu $t2, %lo(D_801246A0) # addiu $t2, $t2, 0x46a0 +/* 0783F4 800777F4 254A46A0 */ addiu $t2, %lo(gGfxSPTaskYieldBuffer) # addiu $t2, $t2, 0x46a0 /* 0783F8 800777F8 256B5EA0 */ addiu $t3, %lo(D_80125EA0) # addiu $t3, $t3, 0x5ea0 /* 0783FC 800777FC 258C71B0 */ addiu $t4, %lo(D_801271B0) # addiu $t4, $t4, 0x71b0 /* 078400 80077800 240D0A00 */ li $t5, 2560 @@ -335,17 +335,17 @@ glabel setupOSTasks /* 078558 80077958 ACF80028 */ sw $t8, 0x28($a3) /* 07855C 8007795C ACEE001C */ sw $t6, 0x1c($a3) /* 078560 80077960 24190800 */ li $t9, 2048 -/* 078564 80077964 3C088012 */ lui $t0, %hi(D_801242A0) # $t0, 0x8012 -/* 078568 80077968 3C0A8012 */ lui $t2, %hi(D_801246A0) # $t2, 0x8012 +/* 078564 80077964 3C088012 */ lui $t0, %hi(gDramStack) # $t0, 0x8012 +/* 078568 80077968 3C0A8012 */ lui $t2, %hi(gGfxSPTaskYieldBuffer) # $t2, 0x8012 /* 07856C 8007796C 3C0B8012 */ lui $t3, %hi(D_80125EA0) # $t3, 0x8012 /* 078570 80077970 3C0C8012 */ lui $t4, %hi(D_801271B0) # $t4, 0x8012 /* 078574 80077974 3C0F8012 */ lui $t7, %hi(D_80125ED8) # $t7, 0x8012 /* 078578 80077978 3C18800E */ lui $t8, %hi(D_800DE490) # $t8, 0x800e /* 07857C 8007797C ACE20018 */ sw $v0, 0x18($a3) /* 078580 80077980 ACF9002C */ sw $t9, 0x2c($a3) -/* 078584 80077984 250842A0 */ addiu $t0, %lo(D_801242A0) # addiu $t0, $t0, 0x42a0 +/* 078584 80077984 250842A0 */ addiu $t0, %lo(gDramStack) # addiu $t0, $t0, 0x42a0 /* 078588 80077988 24090400 */ li $t1, 1024 -/* 07858C 8007798C 254A46A0 */ addiu $t2, %lo(D_801246A0) # addiu $t2, $t2, 0x46a0 +/* 07858C 8007798C 254A46A0 */ addiu $t2, %lo(gGfxSPTaskYieldBuffer) # addiu $t2, $t2, 0x46a0 /* 078590 80077990 256B5EA0 */ addiu $t3, %lo(D_80125EA0) # addiu $t3, $t3, 0x5ea0 /* 078594 80077994 258C71B0 */ addiu $t4, %lo(D_801271B0) # addiu $t4, $t4, 0x71b0 /* 078598 80077998 240D0A00 */ li $t5, 2560 diff --git a/src/unknown_078050.c b/src/unknown_078050.c index 022e22d4..55b549f8 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -146,8 +146,8 @@ Gfx D_800DE6E8[][2] = { /************ .bss ************/ -s32 D_801242A0[256]; -s32 D_801246A0[1536]; +u8 gDramStack[SP_DRAM_STACK_SIZE8]; +u8 gGfxSPTaskYieldBuffer[0x1800]; OSMesgQueue D_80125EA0; OSMesg D_80125EB8; OSMesgQueue D_80125EC0; From 3cf1dc4e301e534898f323a34301dc2ebd059b11 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Sun, 24 Apr 2022 20:00:03 +0100 Subject: [PATCH 08/25] match func_80043ECC --- src/racer.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 4 deletions(-) diff --git a/src/racer.c b/src/racer.c index 5f6ca530..e581beff 100644 --- a/src/racer.c +++ b/src/racer.c @@ -191,14 +191,96 @@ s16 D_8011D5AE; s32 D_8011D5B0; s32 D_8011D5B4; s16 D_8011D5B8; -s8 D_8011D5BA; -s8 D_8011D5BB; -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_Unknown5 { + u8 pad0[0x88]; + u8 unk89; + u8 pad90[0xE9]; + s8 unk172; + s8 unk173; + s8 unk174; + u8 pad175[0x5E]; + s8 unk1D3; +} Object_64_Unknown5; + +typedef struct TempStruct5 { + s8 pad0[8]; + s8 unk8[4][4]; +} TempStruct5; + +void func_80043ECC(s32 arg0, Object_64_Unknown5 *arg1, s32 arg2) { + TempStruct5 *temp_v0; + s8* test; + s8 phi_a0; + s32 i; + static s8 D_8011D5BA; + static s8 D_8011D5BB; + static s8 D_8011D5BC; + + if (!arg0) { + D_8011D5BA = 0; + D_8011D5BB = 0; + D_8011D5BC = 0; + return; + } + temp_v0 = (TempStruct5 *)func_8006C18C(); + if (arg1->unk1D3) { + if (!D_8011D5BB) { + temp_v0->unk8[3][0] += temp_v0->unk8[3][2]; + temp_v0->unk8[3][1] += temp_v0->unk8[3][3]; + D_8011D5BB = 1; + } + if (!(gCurrentCarInput & A_BUTTON)) { + D_8011D5BA += arg2; + } + } else { + D_8011D5BB = 0; + if (D_8011D5BA > 20) { + temp_v0->unk8[0][0] += temp_v0->unk8[0][2]; + temp_v0->unk8[0][1] += temp_v0->unk8[0][3]; + } + D_8011D5BA = 0; + } + if (arg1->unk173) { + if (D_8011D5BC < arg1->unk174) { + temp_v0->unk8[1][0] += temp_v0->unk8[1][2]; + temp_v0->unk8[1][1] += temp_v0->unk8[1][3]; + } + D_8011D5BC = arg1->unk174; + } else { + D_8011D5BC = 0; + } + test = get_misc_asset(12); + if ((D_8011D530 & 0x2000) && arg1->unk173) { + if (arg1->unk174 < 3) { + phi_a0 = test[arg1->unk172 * 3 + arg1->unk174]; + } else { + phi_a0 = arg1->unk172; + } + if (D_800DCD90[phi_a0] == 1) { + temp_v0->unk8[2][0] += temp_v0->unk8[2][2]; + temp_v0->unk8[2][1] += temp_v0->unk8[2][3]; + } + } + for (i = 0; i < 2; i++) { + if (temp_v0->unk8[1][i] > 100 || temp_v0->unk8[1][i] < 0) { + temp_v0->unk8[1][i] = 100; + } + if (temp_v0->unk8[0][i] > 100 || temp_v0->unk8[0][i] < 0) { + temp_v0->unk8[0][i] = 100; + } + if (temp_v0->unk8[3][i] > 100 || temp_v0->unk8[3][i] < 0) { + temp_v0->unk8[3][i] = 100; + } + if (temp_v0->unk8[2][i] > 100 || temp_v0->unk8[2][i] < 0) { + temp_v0->unk8[2][i] = 100; + } + } +} typedef struct Object_64_80044170 { char unk0[0x2C]; From 297d0e2d031e55065d7b61fbf1109ea1a0d001f8 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Mon, 25 Apr 2022 23:05:39 +0100 Subject: [PATCH 09/25] match func_8007B46C --- src/textures_sprites.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/textures_sprites.c b/src/textures_sprites.c index 21ec9fc5..1400210c 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -1094,7 +1094,24 @@ void func_8007B454(void) { D_80126382 = 1; } -GLOBAL_ASM("asm/non_matchings/textures_sprites/func_8007B46C.s") +typedef struct Struct_Unk_8007B46C { + u8 pad0[0x12]; + u16 unk12; + u8 pad14[2]; + s16 unk16; + u8 pad17[3]; +} Struct_Unk_8007B46C; + +Struct_Unk_8007B46C *func_8007B46C(Struct_Unk_8007B46C *arg0, s32 arg1) { + if (arg1 > 0) { + if (arg1 < arg0->unk12 << 8) { + arg0 = ((u8*)arg0) + ((arg1 >> 16) * arg0->unk16); + } else { + arg0 = ((u8*)arg0) + ((arg0->unk12 >> 8) - 1) * arg0->unk16; + } + } + return arg0; +} void func_8007B4C8(Gfx **dlist, TextureHeader *arg1, u32 flags) { func_8007B4E8(dlist, arg1, flags, 0); From bb0eee12eefadc8b1433458e61bb3610c0b92144 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Mon, 25 Apr 2022 23:30:02 +0100 Subject: [PATCH 10/25] remember to delete unused asm files --- asm/non_matchings/racer/func_80043ECC.s | 193 ------------------ .../textures_sprites/func_8007B46C.s | 28 --- 2 files changed, 221 deletions(-) delete mode 100644 asm/non_matchings/racer/func_80043ECC.s delete mode 100644 asm/non_matchings/textures_sprites/func_8007B46C.s diff --git a/asm/non_matchings/racer/func_80043ECC.s b/asm/non_matchings/racer/func_80043ECC.s deleted file mode 100644 index d6517e64..00000000 --- a/asm/non_matchings/racer/func_80043ECC.s +++ /dev/null @@ -1,193 +0,0 @@ -glabel func_80043ECC -/* 044ACC 80043ECC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 044AD0 80043ED0 AFBF0014 */ sw $ra, 0x14($sp) -/* 044AD4 80043ED4 14800008 */ bnez $a0, .L80043EF8 -/* 044AD8 80043ED8 AFA60028 */ sw $a2, 0x28($sp) -/* 044ADC 80043EDC 3C018012 */ lui $at, %hi(D_8011D5BA) # $at, 0x8012 -/* 044AE0 80043EE0 A020D5BA */ sb $zero, %lo(D_8011D5BA)($at) -/* 044AE4 80043EE4 3C018012 */ lui $at, %hi(D_8011D5BB) # $at, 0x8012 -/* 044AE8 80043EE8 A020D5BB */ sb $zero, %lo(D_8011D5BB)($at) -/* 044AEC 80043EEC 3C018012 */ lui $at, %hi(D_8011D5BC) # $at, 0x8012 -/* 044AF0 80043EF0 1000009B */ b .L80044160 -/* 044AF4 80043EF4 A020D5BC */ sb $zero, %lo(D_8011D5BC)($at) -.L80043EF8: -/* 044AF8 80043EF8 0C01B063 */ jal func_8006C18C -/* 044AFC 80043EFC AFA50024 */ sw $a1, 0x24($sp) -/* 044B00 80043F00 8FA50024 */ lw $a1, 0x24($sp) -/* 044B04 80043F04 00403025 */ move $a2, $v0 -/* 044B08 80043F08 80AE01D3 */ lb $t6, 0x1d3($a1) -/* 044B0C 80043F0C 3C018012 */ lui $at, %hi(D_8011D5BB) # $at, 0x8012 -/* 044B10 80043F10 11C0001A */ beqz $t6, .L80043F7C -/* 044B14 80043F14 2404000C */ li $a0, 12 -/* 044B18 80043F18 3C0F8012 */ lui $t7, %hi(D_8011D5BB) # $t7, 0x8012 -/* 044B1C 80043F1C 81EFD5BB */ lb $t7, %lo(D_8011D5BB)($t7) -/* 044B20 80043F20 240C0001 */ li $t4, 1 -/* 044B24 80043F24 15E0000B */ bnez $t7, .L80043F54 -/* 044B28 80043F28 3C0D8012 */ lui $t5, %hi(gCurrentCarInput) # $t5, 0x8012 -/* 044B2C 80043F2C 80580014 */ lb $t8, 0x14($v0) -/* 044B30 80043F30 80590016 */ lb $t9, 0x16($v0) -/* 044B34 80043F34 80490015 */ lb $t1, 0x15($v0) -/* 044B38 80043F38 804A0017 */ lb $t2, 0x17($v0) -/* 044B3C 80043F3C 03194021 */ addu $t0, $t8, $t9 -/* 044B40 80043F40 012A5821 */ addu $t3, $t1, $t2 -/* 044B44 80043F44 A0480014 */ sb $t0, 0x14($v0) -/* 044B48 80043F48 A04B0015 */ sb $t3, 0x15($v0) -/* 044B4C 80043F4C 3C018012 */ lui $at, %hi(D_8011D5BB) # $at, 0x8012 -/* 044B50 80043F50 A02CD5BB */ sb $t4, %lo(D_8011D5BB)($at) -.L80043F54: -/* 044B54 80043F54 8DADD528 */ lw $t5, %lo(gCurrentCarInput)($t5) -/* 044B58 80043F58 8FB80028 */ lw $t8, 0x28($sp) -/* 044B5C 80043F5C 31AE8000 */ andi $t6, $t5, 0x8000 -/* 044B60 80043F60 15C00016 */ bnez $t6, .L80043FBC -/* 044B64 80043F64 3C0F8012 */ lui $t7, %hi(D_8011D5BA) # $t7, 0x8012 -/* 044B68 80043F68 81EFD5BA */ lb $t7, %lo(D_8011D5BA)($t7) -/* 044B6C 80043F6C 3C018012 */ lui $at, %hi(D_8011D5BA) # $at, 0x8012 -/* 044B70 80043F70 01F8C821 */ addu $t9, $t7, $t8 -/* 044B74 80043F74 10000011 */ b .L80043FBC -/* 044B78 80043F78 A039D5BA */ sb $t9, %lo(D_8011D5BA)($at) -.L80043F7C: -/* 044B7C 80043F7C 3C088012 */ lui $t0, %hi(D_8011D5BA) # $t0, 0x8012 -/* 044B80 80043F80 8108D5BA */ lb $t0, %lo(D_8011D5BA)($t0) -/* 044B84 80043F84 A020D5BB */ sb $zero, %lo(D_8011D5BB)($at) -/* 044B88 80043F88 29010015 */ slti $at, $t0, 0x15 -/* 044B8C 80043F8C 14200009 */ bnez $at, .L80043FB4 -/* 044B90 80043F90 00000000 */ nop -/* 044B94 80043F94 80490008 */ lb $t1, 8($v0) -/* 044B98 80043F98 804A000A */ lb $t2, 0xa($v0) -/* 044B9C 80043F9C 804C0009 */ lb $t4, 9($v0) -/* 044BA0 80043FA0 804D000B */ lb $t5, 0xb($v0) -/* 044BA4 80043FA4 012A5821 */ addu $t3, $t1, $t2 -/* 044BA8 80043FA8 018D7021 */ addu $t6, $t4, $t5 -/* 044BAC 80043FAC A04B0008 */ sb $t3, 8($v0) -/* 044BB0 80043FB0 A04E0009 */ sb $t6, 9($v0) -.L80043FB4: -/* 044BB4 80043FB4 3C018012 */ lui $at, %hi(D_8011D5BA) # $at, 0x8012 -/* 044BB8 80043FB8 A020D5BA */ sb $zero, %lo(D_8011D5BA)($at) -.L80043FBC: -/* 044BBC 80043FBC 80AF0173 */ lb $t7, 0x173($a1) -/* 044BC0 80043FC0 3C188012 */ lui $t8, %hi(D_8011D5BC) # $t8, 0x8012 -/* 044BC4 80043FC4 11E00014 */ beqz $t7, .L80044018 -/* 044BC8 80043FC8 3C018012 */ lui $at, %hi(D_8011D5BC) # $at, 0x8012 -/* 044BCC 80043FCC 80A30174 */ lb $v1, 0x174($a1) -/* 044BD0 80043FD0 8318D5BC */ lb $t8, %lo(D_8011D5BC)($t8) -/* 044BD4 80043FD4 00000000 */ nop -/* 044BD8 80043FD8 0303082A */ slt $at, $t8, $v1 -/* 044BDC 80043FDC 1020000B */ beqz $at, .L8004400C -/* 044BE0 80043FE0 00000000 */ nop -/* 044BE4 80043FE4 8059000C */ lb $t9, 0xc($v0) -/* 044BE8 80043FE8 8048000E */ lb $t0, 0xe($v0) -/* 044BEC 80043FEC 804A000D */ lb $t2, 0xd($v0) -/* 044BF0 80043FF0 804B000F */ lb $t3, 0xf($v0) -/* 044BF4 80043FF4 03284821 */ addu $t1, $t9, $t0 -/* 044BF8 80043FF8 014B6021 */ addu $t4, $t2, $t3 -/* 044BFC 80043FFC A049000C */ sb $t1, 0xc($v0) -/* 044C00 80044000 A04C000D */ sb $t4, 0xd($v0) -/* 044C04 80044004 80A30174 */ lb $v1, 0x174($a1) -/* 044C08 80044008 00000000 */ nop -.L8004400C: -/* 044C0C 8004400C 3C018012 */ lui $at, %hi(D_8011D5BC) # $at, 0x8012 -/* 044C10 80044010 10000002 */ b .L8004401C -/* 044C14 80044014 A023D5BC */ sb $v1, %lo(D_8011D5BC)($at) -.L80044018: -/* 044C18 80044018 A020D5BC */ sb $zero, %lo(D_8011D5BC)($at) -.L8004401C: -/* 044C1C 8004401C AFA50024 */ sw $a1, 0x24($sp) -/* 044C20 80044020 0C0078A7 */ jal get_misc_asset -/* 044C24 80044024 AFA6001C */ sw $a2, 0x1c($sp) -/* 044C28 80044028 3C0D8012 */ lui $t5, %hi(D_8011D530) # $t5, 0x8012 -/* 044C2C 8004402C 8DADD530 */ lw $t5, %lo(D_8011D530)($t5) -/* 044C30 80044030 8FA50024 */ lw $a1, 0x24($sp) -/* 044C34 80044034 8FA6001C */ lw $a2, 0x1c($sp) -/* 044C38 80044038 31AE2000 */ andi $t6, $t5, 0x2000 -/* 044C3C 8004403C 11C00022 */ beqz $t6, .L800440C8 -/* 044C40 80044040 00000000 */ nop -/* 044C44 80044044 80AF0173 */ lb $t7, 0x173($a1) -/* 044C48 80044048 3C0A800E */ lui $t2, %hi(D_800DCD90) # $t2, 0x800e -/* 044C4C 8004404C 11E0001E */ beqz $t7, .L800440C8 -/* 044C50 80044050 00000000 */ nop -/* 044C54 80044054 80A30174 */ lb $v1, 0x174($a1) -/* 044C58 80044058 00000000 */ nop -/* 044C5C 8004405C 28610003 */ slti $at, $v1, 3 -/* 044C60 80044060 1020000A */ beqz $at, .L8004408C -/* 044C64 80044064 00000000 */ nop -/* 044C68 80044068 80B80172 */ lb $t8, 0x172($a1) -/* 044C6C 8004406C 00000000 */ nop -/* 044C70 80044070 0018C880 */ sll $t9, $t8, 2 -/* 044C74 80044074 0338C823 */ subu $t9, $t9, $t8 -/* 044C78 80044078 03234021 */ addu $t0, $t9, $v1 -/* 044C7C 8004407C 01024821 */ addu $t1, $t0, $v0 -/* 044C80 80044080 81240000 */ lb $a0, ($t1) -/* 044C84 80044084 10000004 */ b .L80044098 -/* 044C88 80044088 01445021 */ addu $t2, $t2, $a0 -.L8004408C: -/* 044C8C 8004408C 80A40172 */ lb $a0, 0x172($a1) -/* 044C90 80044090 00000000 */ nop -/* 044C94 80044094 01445021 */ addu $t2, $t2, $a0 -.L80044098: -/* 044C98 80044098 814ACD90 */ lb $t2, %lo(D_800DCD90)($t2) -/* 044C9C 8004409C 24010001 */ li $at, 1 -/* 044CA0 800440A0 1541000A */ bne $t2, $at, .L800440CC -/* 044CA4 800440A4 00C01025 */ move $v0, $a2 -/* 044CA8 800440A8 80CB0010 */ lb $t3, 0x10($a2) -/* 044CAC 800440AC 80CC0012 */ lb $t4, 0x12($a2) -/* 044CB0 800440B0 80CE0011 */ lb $t6, 0x11($a2) -/* 044CB4 800440B4 80CF0013 */ lb $t7, 0x13($a2) -/* 044CB8 800440B8 016C6821 */ addu $t5, $t3, $t4 -/* 044CBC 800440BC 01CFC021 */ addu $t8, $t6, $t7 -/* 044CC0 800440C0 A0CD0010 */ sb $t5, 0x10($a2) -/* 044CC4 800440C4 A0D80011 */ sb $t8, 0x11($a2) -.L800440C8: -/* 044CC8 800440C8 00C01025 */ move $v0, $a2 -.L800440CC: -/* 044CCC 800440CC 24060002 */ li $a2, 2 -/* 044CD0 800440D0 00002825 */ move $a1, $zero -/* 044CD4 800440D4 24040064 */ li $a0, 100 -.L800440D8: -/* 044CD8 800440D8 8043000C */ lb $v1, 0xc($v0) -/* 044CDC 800440DC 24A50001 */ addiu $a1, $a1, 1 -/* 044CE0 800440E0 28610065 */ slti $at, $v1, 0x65 -/* 044CE4 800440E4 10200003 */ beqz $at, .L800440F4 -/* 044CE8 800440E8 00000000 */ nop -/* 044CEC 800440EC 04610002 */ bgez $v1, .L800440F8 -/* 044CF0 800440F0 00000000 */ nop -.L800440F4: -/* 044CF4 800440F4 A044000C */ sb $a0, 0xc($v0) -.L800440F8: -/* 044CF8 800440F8 80430008 */ lb $v1, 8($v0) -/* 044CFC 800440FC 00000000 */ nop -/* 044D00 80044100 28610065 */ slti $at, $v1, 0x65 -/* 044D04 80044104 10200003 */ beqz $at, .L80044114 -/* 044D08 80044108 00000000 */ nop -/* 044D0C 8004410C 04610002 */ bgez $v1, .L80044118 -/* 044D10 80044110 00000000 */ nop -.L80044114: -/* 044D14 80044114 A0440008 */ sb $a0, 8($v0) -.L80044118: -/* 044D18 80044118 80430014 */ lb $v1, 0x14($v0) -/* 044D1C 8004411C 00000000 */ nop -/* 044D20 80044120 28610065 */ slti $at, $v1, 0x65 -/* 044D24 80044124 10200003 */ beqz $at, .L80044134 -/* 044D28 80044128 00000000 */ nop -/* 044D2C 8004412C 04610002 */ bgez $v1, .L80044138 -/* 044D30 80044130 00000000 */ nop -.L80044134: -/* 044D34 80044134 A0440014 */ sb $a0, 0x14($v0) -.L80044138: -/* 044D38 80044138 80430010 */ lb $v1, 0x10($v0) -/* 044D3C 8004413C 00000000 */ nop -/* 044D40 80044140 28610065 */ slti $at, $v1, 0x65 -/* 044D44 80044144 10200003 */ beqz $at, .L80044154 -/* 044D48 80044148 00000000 */ nop -/* 044D4C 8004414C 04610002 */ bgez $v1, .L80044158 -/* 044D50 80044150 00000000 */ nop -.L80044154: -/* 044D54 80044154 A0440010 */ sb $a0, 0x10($v0) -.L80044158: -/* 044D58 80044158 14A6FFDF */ bne $a1, $a2, .L800440D8 -/* 044D5C 8004415C 24420001 */ addiu $v0, $v0, 1 -.L80044160: -/* 044D60 80044160 8FBF0014 */ lw $ra, 0x14($sp) -/* 044D64 80044164 27BD0020 */ addiu $sp, $sp, 0x20 -/* 044D68 80044168 03E00008 */ jr $ra -/* 044D6C 8004416C 00000000 */ nop - diff --git a/asm/non_matchings/textures_sprites/func_8007B46C.s b/asm/non_matchings/textures_sprites/func_8007B46C.s deleted file mode 100644 index 82a7028d..00000000 --- a/asm/non_matchings/textures_sprites/func_8007B46C.s +++ /dev/null @@ -1,28 +0,0 @@ -glabel func_8007B46C -/* 07C06C 8007B46C 18A00014 */ blez $a1, .L8007B4C0 -/* 07C070 8007B470 00000000 */ nop -/* 07C074 8007B474 94820012 */ lhu $v0, 0x12($a0) -/* 07C078 8007B478 00000000 */ nop -/* 07C07C 8007B47C 00027200 */ sll $t6, $v0, 8 -/* 07C080 8007B480 00AE082A */ slt $at, $a1, $t6 -/* 07C084 8007B484 10200008 */ beqz $at, .L8007B4A8 -/* 07C088 8007B488 00024203 */ sra $t0, $v0, 8 -/* 07C08C 8007B48C 84980016 */ lh $t8, 0x16($a0) -/* 07C090 8007B490 00057C03 */ sra $t7, $a1, 0x10 -/* 07C094 8007B494 01F80019 */ multu $t7, $t8 -/* 07C098 8007B498 0000C812 */ mflo $t9 -/* 07C09C 8007B49C 00991021 */ addu $v0, $a0, $t9 -/* 07C0A0 8007B4A0 03E00008 */ jr $ra -/* 07C0A4 8007B4A4 00000000 */ nop - -.L8007B4A8: -/* 07C0A8 8007B4A8 848A0016 */ lh $t2, 0x16($a0) -/* 07C0AC 8007B4AC 2509FFFF */ addiu $t1, $t0, -1 -/* 07C0B0 8007B4B0 012A0019 */ multu $t1, $t2 -/* 07C0B4 8007B4B4 00005812 */ mflo $t3 -/* 07C0B8 8007B4B8 008B2021 */ addu $a0, $a0, $t3 -/* 07C0BC 8007B4BC 00000000 */ nop -.L8007B4C0: -/* 07C0C0 8007B4C0 03E00008 */ jr $ra -/* 07C0C4 8007B4C4 00801025 */ move $v0, $a0 - From 5008a6f921b958afaca96ee065614f622a8f215b Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Tue, 26 Apr 2022 22:56:35 +0100 Subject: [PATCH 11/25] match func_80059080 --- asm/non_matchings/racer/func_80059080.s | 105 ------------------------ src/objects.h | 7 +- src/racer.c | 60 +++++++++++++- 3 files changed, 65 insertions(+), 107 deletions(-) delete mode 100644 asm/non_matchings/racer/func_80059080.s diff --git a/asm/non_matchings/racer/func_80059080.s b/asm/non_matchings/racer/func_80059080.s deleted file mode 100644 index c3ba7948..00000000 --- a/asm/non_matchings/racer/func_80059080.s +++ /dev/null @@ -1,105 +0,0 @@ -glabel func_80059080 -/* 059C80 80059080 27BDFF58 */ addiu $sp, $sp, -0xa8 -/* 059C84 80059084 AFBF003C */ sw $ra, 0x3c($sp) -/* 059C88 80059088 AFB50034 */ sw $s5, 0x34($sp) -/* 059C8C 8005908C 00A0A825 */ move $s5, $a1 -/* 059C90 80059090 AFB60038 */ sw $s6, 0x38($sp) -/* 059C94 80059094 AFB40030 */ sw $s4, 0x30($sp) -/* 059C98 80059098 AFB3002C */ sw $s3, 0x2c($sp) -/* 059C9C 8005909C AFB20028 */ sw $s2, 0x28($sp) -/* 059CA0 800590A0 AFB10024 */ sw $s1, 0x24($sp) -/* 059CA4 800590A4 AFB00020 */ sw $s0, 0x20($sp) -/* 059CA8 800590A8 E7B50018 */ swc1 $f21, 0x18($sp) -/* 059CAC 800590AC E7B4001C */ swc1 $f20, 0x1c($sp) -/* 059CB0 800590B0 AFA400A8 */ sw $a0, 0xa8($sp) -/* 059CB4 800590B4 AFA600B0 */ sw $a2, 0xb0($sp) -/* 059CB8 800590B8 0C006E99 */ jal func_8001BA64 -/* 059CBC 800590BC AFA700B4 */ sw $a3, 0xb4($sp) -/* 059CC0 800590C0 10400045 */ beqz $v0, .L800591D8 -/* 059CC4 800590C4 0040B025 */ move $s6, $v0 -/* 059CC8 800590C8 C6A600A8 */ lwc1 $f6, 0xa8($s5) -/* 059CCC 800590CC 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 059CD0 800590D0 44812800 */ mtc1 $at, $f5 -/* 059CD4 800590D4 44802000 */ mtc1 $zero, $f4 -/* 059CD8 800590D8 46003221 */ cvt.d.s $f8, $f6 -/* 059CDC 800590DC 46282281 */ sub.d $f10, $f4, $f8 -/* 059CE0 800590E0 44800000 */ mtc1 $zero, $f0 -/* 059CE4 800590E4 46205520 */ cvt.s.d $f20, $f10 -/* 059CE8 800590E8 27B20084 */ addiu $s2, $sp, 0x84 -/* 059CEC 800590EC 4600A03C */ c.lt.s $f20, $f0 -/* 059CF0 800590F0 27B30070 */ addiu $s3, $sp, 0x70 -/* 059CF4 800590F4 45000002 */ bc1f .L80059100 -/* 059CF8 800590F8 27B0005C */ addiu $s0, $sp, 0x5c -/* 059CFC 800590FC 46000506 */ mov.s $f20, $f0 -.L80059100: -/* 059D00 80059100 82A30192 */ lb $v1, 0x192($s5) -/* 059D04 80059104 27B40070 */ addiu $s4, $sp, 0x70 -/* 059D08 80059108 2471FFFE */ addiu $s1, $v1, -2 -/* 059D0C 8005910C 06210002 */ bgez $s1, .L80059118 -/* 059D10 80059110 00000000 */ nop -/* 059D14 80059114 02228821 */ addu $s1, $s1, $v0 -.L80059118: -/* 059D18 80059118 92A501C8 */ lbu $a1, 0x1c8($s5) -/* 059D1C 8005911C 0C006E87 */ jal func_8001BA1C -/* 059D20 80059120 02202025 */ move $a0, $s1 -/* 059D24 80059124 C4500010 */ lwc1 $f16, 0x10($v0) -/* 059D28 80059128 26310001 */ addiu $s1, $s1, 1 -/* 059D2C 8005912C E6500000 */ swc1 $f16, ($s2) -/* 059D30 80059130 C4520014 */ lwc1 $f18, 0x14($v0) -/* 059D34 80059134 26520004 */ addiu $s2, $s2, 4 -/* 059D38 80059138 E6720000 */ swc1 $f18, ($s3) -/* 059D3C 8005913C C4460018 */ lwc1 $f6, 0x18($v0) -/* 059D40 80059140 16360002 */ bne $s1, $s6, .L8005914C -/* 059D44 80059144 E6060000 */ swc1 $f6, ($s0) -/* 059D48 80059148 00008825 */ move $s1, $zero -.L8005914C: -/* 059D4C 8005914C 26100004 */ addiu $s0, $s0, 4 -/* 059D50 80059150 1614FFF1 */ bne $s0, $s4, .L80059118 -/* 059D54 80059154 26730004 */ addiu $s3, $s3, 4 -/* 059D58 80059158 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 059D5C 8005915C 44812800 */ mtc1 $at, $f5 -/* 059D60 80059160 44802000 */ mtc1 $zero, $f4 -/* 059D64 80059164 4600A021 */ cvt.d.s $f0, $f20 -/* 059D68 80059168 4620203E */ c.le.d $f4, $f0 -/* 059D6C 8005916C 00008025 */ move $s0, $zero -/* 059D70 80059170 45000007 */ bc1f .L80059190 -/* 059D74 80059174 27A40084 */ addiu $a0, $sp, 0x84 -/* 059D78 80059178 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 059D7C 8005917C 44814800 */ mtc1 $at, $f9 -/* 059D80 80059180 44804000 */ mtc1 $zero, $f8 -/* 059D84 80059184 24100001 */ li $s0, 1 -/* 059D88 80059188 46280281 */ sub.d $f10, $f0, $f8 -/* 059D8C 8005918C 46205520 */ cvt.s.d $f20, $f10 -.L80059190: -/* 059D90 80059190 4406A000 */ mfc1 $a2, $f20 -/* 059D94 80059194 0C008950 */ jal catmull_rom_interpolation -/* 059D98 80059198 02002825 */ move $a1, $s0 -/* 059D9C 8005919C 8FAE00B0 */ lw $t6, 0xb0($sp) -/* 059DA0 800591A0 4406A000 */ mfc1 $a2, $f20 -/* 059DA4 800591A4 27A40070 */ addiu $a0, $sp, 0x70 -/* 059DA8 800591A8 02002825 */ move $a1, $s0 -/* 059DAC 800591AC 0C008950 */ jal catmull_rom_interpolation -/* 059DB0 800591B0 E5C00000 */ swc1 $f0, ($t6) -/* 059DB4 800591B4 8FAF00B4 */ lw $t7, 0xb4($sp) -/* 059DB8 800591B8 4406A000 */ mfc1 $a2, $f20 -/* 059DBC 800591BC 27A4005C */ addiu $a0, $sp, 0x5c -/* 059DC0 800591C0 02002825 */ move $a1, $s0 -/* 059DC4 800591C4 0C008950 */ jal catmull_rom_interpolation -/* 059DC8 800591C8 E5E00000 */ swc1 $f0, ($t7) -/* 059DCC 800591CC 8FB800B8 */ lw $t8, 0xb8($sp) -/* 059DD0 800591D0 00000000 */ nop -/* 059DD4 800591D4 E7000000 */ swc1 $f0, ($t8) -.L800591D8: -/* 059DD8 800591D8 8FBF003C */ lw $ra, 0x3c($sp) -/* 059DDC 800591DC C7B50018 */ lwc1 $f21, 0x18($sp) -/* 059DE0 800591E0 C7B4001C */ lwc1 $f20, 0x1c($sp) -/* 059DE4 800591E4 8FB00020 */ lw $s0, 0x20($sp) -/* 059DE8 800591E8 8FB10024 */ lw $s1, 0x24($sp) -/* 059DEC 800591EC 8FB20028 */ lw $s2, 0x28($sp) -/* 059DF0 800591F0 8FB3002C */ lw $s3, 0x2c($sp) -/* 059DF4 800591F4 8FB40030 */ lw $s4, 0x30($sp) -/* 059DF8 800591F8 8FB50034 */ lw $s5, 0x34($sp) -/* 059DFC 800591FC 8FB60038 */ lw $s6, 0x38($sp) -/* 059E00 80059200 03E00008 */ jr $ra -/* 059E04 80059204 27BD00A8 */ addiu $sp, $sp, 0xa8 - diff --git a/src/objects.h b/src/objects.h index c0983d35..e5b8adf5 100644 --- a/src/objects.h +++ b/src/objects.h @@ -19,7 +19,11 @@ typedef struct unknown800DC6F0 { /* Size: 0x3C bytes */ typedef struct unknown8011AECC { - u8 unk00[0x3A]; + u8 unk00[0x10]; + f32 unk10; + f32 unk14; + f32 unk18; + u8 pad1C[0x1E]; s8 unk3A; s8 unk3B; } unknown8011AECC; @@ -217,6 +221,7 @@ void func_8002458C(s32 arg0); s16 *func_80024594(s32 *arg0, s32 *arg1); void func_800245B4(s16 arg0); void func_80012E28(Object *this); +f32 catmull_rom_interpolation(f32*, s32, f32); //Non Matching void calc_dynamic_lighting_for_object_1(Object *, ObjectModel *, s16, Object *, f32, f32); diff --git a/src/racer.c b/src/racer.c index e581beff..3f73cb2f 100644 --- a/src/racer.c +++ b/src/racer.c @@ -917,7 +917,65 @@ void func_80058F44(f32 arg0, Object *arg1, Object *arg2) { GLOBAL_ASM("asm/non_matchings/racer/func_80058F44.s") #endif -GLOBAL_ASM("asm/non_matchings/racer/func_80059080.s") +typedef struct Object_64_80059080 { + u8 pad0[0x10]; + f32 unk10; + f32 unk14; + f32 unk18; + u8 pad1C[0x8C]; + f32 unkA8; + u8 padAC[0xE6]; + s8 unk192; + u8 pad196[0x35]; + u8 unk1C8; + u8 pad1C9[3]; +} Object_64_80059080; + +void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32* arg2, f32* arg3, f32* arg4) { + s32 splinePos; + UNUSED u32 pad0, pad1; + unknown8011AECC* temp_v0_2; + s32 destReached; + f32 something0[4]; + s32 i; + f32 something1[4]; + f32 magnitude; + f32 something2[4]; + s32 splineEnd; + + splineEnd = func_8001BA64(); + + if (splineEnd) { + magnitude = 1.0 - arg1->unkA8; + if (magnitude < 0.0f) { + magnitude = 0.0f; + } + splinePos = arg1->unk192 - 2; + if(arg1->unk192){} + if (splinePos < 0) { + splinePos += splineEnd; + } + for (i = 0; i < 5; i++) { + temp_v0_2 = func_8001BA1C(splinePos, arg1->unk1C8); + something0[i] = temp_v0_2->unk10; + something1[i] = temp_v0_2->unk14; + something2[i] = temp_v0_2->unk18; + splinePos++; + if (splinePos == splineEnd) { + splinePos = 0; + } + } + destReached = 0; + if (magnitude >= 1.0) { + destReached = 1; + magnitude -= 1.0; + } + *arg2 = catmull_rom_interpolation(something0, destReached, magnitude); + *arg3 = catmull_rom_interpolation(something1, destReached, magnitude); + *arg4 = catmull_rom_interpolation(something2, destReached, magnitude); + } +} + GLOBAL_ASM("asm/non_matchings/racer/func_80059208.s") void get_timestamp_from_frames(s32 frameCount, s32 *minutes, s32 *seconds, s32 *hundredths) { From f617bce3d2ec9f130de3d9b155a201b5bf4048f2 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:51:30 +0100 Subject: [PATCH 12/25] Update racer.c --- src/racer.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/racer.c b/src/racer.c index a390d7c7..bda42913 100644 --- a/src/racer.c +++ b/src/racer.c @@ -283,7 +283,7 @@ void func_80043ECC(s32 arg0, Object_64_Unknown5 *arg1, s32 arg2) { } // Might be the main loop for the AI racers. -void func_80044170(Object *arg0, Object_64_80044170 *arg1, s32 arg2) { +void func_80044170(Object *arg0, Object_Racer *arg1, s32 arg2) { s32 raceType; raceType = get_current_level_race_type(); @@ -586,7 +586,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8005250C.s") // I've also yet to find a scenario where the action is < 3 // arg6 is set to 6 when honking, but 7 when reversing and not honking and 0 when crashing. // arg7 seems to be based on direction???? -void func_80052988(Object *arg0, Object_Racer *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { +void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 duration, s32 arg5, s32 arg6, s32 arg7) { arg5 *= arg7; if ((D_8011D55C == -1) && (action >= 3)) { @@ -684,7 +684,7 @@ void handle_car_steering(Object_Racer *obj) { velScale = vel * 58.0f; } // Set the steering velocity based on the car's steering value, scaled with the temp forward velocity value. - gCurrentCarSteerVel -= (car->unk1E1 * velScale); + gCurrentCarSteerVel -= (obj->unk1E1 * velScale); // If the car is reversing, then flip the steering. if (obj->velocity > 0.0f) { gCurrentCarSteerVel = -gCurrentCarSteerVel; @@ -890,16 +890,15 @@ typedef struct Object_64_80059080 { } Object_64_80059080; void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32* arg2, f32* arg3, f32* arg4) { - s32 splinePos; - UNUSED u32 pad0, pad1; unknown8011AECC* temp_v0_2; + s32 splinePos; s32 destReached; - f32 something0[4]; - s32 i; - f32 something1[4]; - f32 magnitude; - f32 something2[4]; s32 splineEnd; + f32 splineX[5]; + f32 splineY[5]; + f32 splineZ[5]; + f32 magnitude; + s32 i; splineEnd = func_8001BA64(); @@ -908,16 +907,16 @@ void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32* arg2, f32* ar if (magnitude < 0.0f) { magnitude = 0.0f; } + if (arg1->unk192) {} splinePos = arg1->unk192 - 2; - if(arg1->unk192){} if (splinePos < 0) { splinePos += splineEnd; } for (i = 0; i < 5; i++) { temp_v0_2 = func_8001BA1C(splinePos, arg1->unk1C8); - something0[i] = temp_v0_2->unk10; - something1[i] = temp_v0_2->unk14; - something2[i] = temp_v0_2->unk18; + splineX[i] = temp_v0_2->unk10; + splineY[i] = temp_v0_2->unk14; + splineZ[i] = temp_v0_2->unk18; splinePos++; if (splinePos == splineEnd) { splinePos = 0; @@ -928,9 +927,9 @@ void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32* arg2, f32* ar destReached = 1; magnitude -= 1.0; } - *arg2 = catmull_rom_interpolation(something0, destReached, magnitude); - *arg3 = catmull_rom_interpolation(something1, destReached, magnitude); - *arg4 = catmull_rom_interpolation(something2, destReached, magnitude); + *arg2 = catmull_rom_interpolation(splineX, destReached, magnitude); + *arg3 = catmull_rom_interpolation(splineY, destReached, magnitude); + *arg4 = catmull_rom_interpolation(splineZ, destReached, magnitude); } } From 7c4d2eb64f2e23fc09b03674ac850d2ceb37fa81 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 12:33:05 +0100 Subject: [PATCH 13/25] match func_80070750 --- asm/non_matchings/racer/func_80052388.s | 110 ------------------------ include/structs.h | 11 ++- src/racer.c | 53 +++++++++++- 3 files changed, 59 insertions(+), 115 deletions(-) delete mode 100644 asm/non_matchings/racer/func_80052388.s diff --git a/asm/non_matchings/racer/func_80052388.s b/asm/non_matchings/racer/func_80052388.s deleted file mode 100644 index a52fc1d4..00000000 --- a/asm/non_matchings/racer/func_80052388.s +++ /dev/null @@ -1,110 +0,0 @@ -glabel func_80052388 -/* 052F88 80052388 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 052F8C 8005238C AFBF0014 */ sw $ra, 0x14($sp) -/* 052F90 80052390 AFA70034 */ sw $a3, 0x34($sp) -/* 052F94 80052394 C486000C */ lwc1 $f6, 0xc($a0) -/* 052F98 80052398 C4C4000C */ lwc1 $f4, 0xc($a2) -/* 052F9C 8005239C C48A0014 */ lwc1 $f10, 0x14($a0) -/* 052FA0 800523A0 46062301 */ sub.s $f12, $f4, $f6 -/* 052FA4 800523A4 C4C80014 */ lwc1 $f8, 0x14($a2) -/* 052FA8 800523A8 460C6402 */ mul.s $f16, $f12, $f12 -/* 052FAC 800523AC 460A4381 */ sub.s $f14, $f8, $f10 -/* 052FB0 800523B0 C7A60034 */ lwc1 $f6, 0x34($sp) -/* 052FB4 800523B4 00001825 */ move $v1, $zero -/* 052FB8 800523B8 460E7482 */ mul.s $f18, $f14, $f14 -/* 052FBC 800523BC 46128100 */ add.s $f4, $f16, $f18 -/* 052FC0 800523C0 4606203C */ c.lt.s $f4, $f6 -/* 052FC4 800523C4 00000000 */ nop -/* 052FC8 800523C8 4500004D */ bc1f .L80052500 -/* 052FCC 800523CC 8FBF0014 */ lw $ra, 0x14($sp) -/* 052FD0 800523D0 AFA40028 */ sw $a0, 0x28($sp) -/* 052FD4 800523D4 AFA5002C */ sw $a1, 0x2c($sp) -/* 052FD8 800523D8 AFA60030 */ sw $a2, 0x30($sp) -/* 052FDC 800523DC E7AC0020 */ swc1 $f12, 0x20($sp) -/* 052FE0 800523E0 0C01C1D4 */ jal func_80070750 -/* 052FE4 800523E4 E7AE001C */ swc1 $f14, 0x1c($sp) -/* 052FE8 800523E8 8FA40028 */ lw $a0, 0x28($sp) -/* 052FEC 800523EC 34018000 */ li $at, 32768 -/* 052FF0 800523F0 848E0000 */ lh $t6, ($a0) -/* 052FF4 800523F4 8FA5002C */ lw $a1, 0x2c($sp) -/* 052FF8 800523F8 31CFFFFF */ andi $t7, $t6, 0xffff -/* 052FFC 800523FC 004F1823 */ subu $v1, $v0, $t7 -/* 053000 80052400 00611821 */ addu $v1, $v1, $at -/* 053004 80052404 34018001 */ li $at, 32769 -/* 053008 80052408 8FA60030 */ lw $a2, 0x30($sp) -/* 05300C 8005240C C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 053010 80052410 C7AE001C */ lwc1 $f14, 0x1c($sp) -/* 053014 80052414 0061082A */ slt $at, $v1, $at -/* 053018 80052418 14200003 */ bnez $at, .L80052428 -/* 05301C 8005241C 3C01FFFF */ lui $at, (0xFFFF0001 >> 16) # lui $at, 0xffff -/* 053020 80052420 34210001 */ ori $at, (0xFFFF0001 & 0xFFFF) # ori $at, $at, 1 -/* 053024 80052424 00611821 */ addu $v1, $v1, $at -.L80052428: -/* 053028 80052428 28618000 */ slti $at, $v1, -0x8000 -/* 05302C 8005242C 10200002 */ beqz $at, .L80052438 -/* 053030 80052430 3401FFFF */ li $at, 65535 -/* 053034 80052434 00611821 */ addu $v1, $v1, $at -.L80052438: -/* 053038 80052438 28613001 */ slti $at, $v1, 0x3001 -/* 05303C 8005243C 14200003 */ bnez $at, .L8005244C -/* 053040 80052440 2861D000 */ slti $at, $v1, -0x3000 -/* 053044 80052444 24033000 */ li $v1, 12288 -/* 053048 80052448 2861D000 */ slti $at, $v1, -0x3000 -.L8005244C: -/* 05304C 8005244C 10200002 */ beqz $at, .L80052458 -/* 053050 80052450 00000000 */ nop -/* 053054 80052454 2403D000 */ li $v1, -12288 -.L80052458: -/* 053058 80052458 80B801E7 */ lb $t8, 0x1e7($a1) -/* 05305C 8005245C A4A3016C */ sh $v1, 0x16c($a1) -/* 053060 80052460 3319003F */ andi $t9, $t8, 0x3f -/* 053064 80052464 2B21001F */ slti $at, $t9, 0x1f -/* 053068 80052468 10200002 */ beqz $at, .L80052474 -/* 05306C 8005246C 00000000 */ nop -/* 053070 80052470 A4A0016C */ sh $zero, 0x16c($a1) -.L80052474: -/* 053074 80052474 8CC50064 */ lw $a1, 0x64($a2) -/* 053078 80052478 AFA40028 */ sw $a0, 0x28($sp) -/* 05307C 8005247C 0C01C1D4 */ jal func_80070750 -/* 053080 80052480 AFA5002C */ sw $a1, 0x2c($sp) -/* 053084 80052484 8FA40028 */ lw $a0, 0x28($sp) -/* 053088 80052488 34018001 */ li $at, 32769 -/* 05308C 8005248C 84880000 */ lh $t0, ($a0) -/* 053090 80052490 8FA5002C */ lw $a1, 0x2c($sp) -/* 053094 80052494 3109FFFF */ andi $t1, $t0, 0xffff -/* 053098 80052498 00491823 */ subu $v1, $v0, $t1 -/* 05309C 8005249C 0061082A */ slt $at, $v1, $at -/* 0530A0 800524A0 14200003 */ bnez $at, .L800524B0 -/* 0530A4 800524A4 3C01FFFF */ lui $at, (0xFFFF0001 >> 16) # lui $at, 0xffff -/* 0530A8 800524A8 34210001 */ ori $at, (0xFFFF0001 & 0xFFFF) # ori $at, $at, 1 -/* 0530AC 800524AC 00611821 */ addu $v1, $v1, $at -.L800524B0: -/* 0530B0 800524B0 28618000 */ slti $at, $v1, -0x8000 -/* 0530B4 800524B4 10200002 */ beqz $at, .L800524C0 -/* 0530B8 800524B8 3401FFFF */ li $at, 65535 -/* 0530BC 800524BC 00611821 */ addu $v1, $v1, $at -.L800524C0: -/* 0530C0 800524C0 28613001 */ slti $at, $v1, 0x3001 -/* 0530C4 800524C4 14200003 */ bnez $at, .L800524D4 -/* 0530C8 800524C8 2861D000 */ slti $at, $v1, -0x3000 -/* 0530CC 800524CC 24033000 */ li $v1, 12288 -/* 0530D0 800524D0 2861D000 */ slti $at, $v1, -0x3000 -.L800524D4: -/* 0530D4 800524D4 10200002 */ beqz $at, .L800524E0 -/* 0530D8 800524D8 00000000 */ nop -/* 0530DC 800524DC 2403D000 */ li $v1, -12288 -.L800524E0: -/* 0530E0 800524E0 80AA01E7 */ lb $t2, 0x1e7($a1) -/* 0530E4 800524E4 A4A3016C */ sh $v1, 0x16c($a1) -/* 0530E8 800524E8 314B001F */ andi $t3, $t2, 0x1f -/* 0530EC 800524EC 2961000A */ slti $at, $t3, 0xa -/* 0530F0 800524F0 10200002 */ beqz $at, .L800524FC -/* 0530F4 800524F4 24030001 */ li $v1, 1 -/* 0530F8 800524F8 A4A0016C */ sh $zero, 0x16c($a1) -.L800524FC: -/* 0530FC 800524FC 8FBF0014 */ lw $ra, 0x14($sp) -.L80052500: -/* 053100 80052500 27BD0028 */ addiu $sp, $sp, 0x28 -/* 053104 80052504 03E00008 */ jr $ra -/* 053108 80052508 00601025 */ move $v0, $v1 - diff --git a/include/structs.h b/include/structs.h index 67834438..0c9d6018 100644 --- a/include/structs.h +++ b/include/structs.h @@ -413,7 +413,7 @@ typedef struct LevelModelSegment { /* 0x1E */ s16 numberOfTriangles; /* 0x20 */ s16 numberOfBatches; u8 pad22[0x09]; -/* 0x2B */ s8 unk2B; +/* 0x2B */ s8 unk2B; u8 pad2C[4]; /* 0x30 */ s16 unk30; /* 0x32 */ s16 unk32; @@ -454,7 +454,7 @@ typedef struct LevelModel { u8 pad1C[4]; /* 0x20 */ s32 unk20; //spriteIndex? u8 pad24[0x14]; -/* 0x38 */ u32 minimapColor; +/* 0x38 */ u32 minimapColor; u8 pad3C[0xC]; /* 0x48 */ s32 modelSize; } LevelModel; @@ -836,7 +836,9 @@ typedef struct Object_Racer { /* 0x162 */ s16 unk162; /* 0x164 */ s16 unk164; /* 0x166 */ s16 unk166; - /* 0x168 */ u8 pad168[0xA]; + /* 0x168 */ u8 pad168[0x4]; + /* 0x166 */ s16 unk16C; + /* 0x168 */ u8 pad16E[0x4]; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; /* 0x174 */ u8 balloon_level; @@ -877,7 +879,8 @@ typedef struct Object_Racer { /* 0x1E2 */ s8 unk1E2; /* 0x1E3 */ u8 pad1E3[0x3]; /* 0x1E6 */ s8 drift_direction; - /* 0x1E7 */ u8 pad1E7[0x6]; + /* 0x1E7 */ s8 unk1E7; + /* 0x1E8 */ u8 pad1E8[0x5]; /* 0x1ED */ s8 squish_timer; /* 0x1EE */ u8 pad1EE[0x1]; /* 0x1EF */ u8 boost_sound; diff --git a/src/racer.c b/src/racer.c index bda42913..6acca83f 100644 --- a/src/racer.c +++ b/src/racer.c @@ -576,7 +576,58 @@ void func_8005234C(unk8005234C *arg0) { } } -GLOBAL_ASM("asm/non_matchings/racer/func_80052388.s") +extern s16 func_80070750(f32 y, f32 x); + +s32 func_80052388(Object* obj1, Object_Racer* arg1, Object* obj2, f32 distance) { + s32 rotation; + f32 diffX; + f32 diffZ; + s32 ret = FALSE; + + diffX = obj2->segment.trans.x_position - obj1->segment.trans.x_position; + diffZ = obj2->segment.trans.z_position - obj1->segment.trans.z_position; + if ((diffX * diffX) + (diffZ * diffZ) < distance) { + rotation = (func_80070750(diffX, diffZ) - (obj1->segment.trans.y_rotation & 0xFFFF)) + 0x8000; + if (rotation > 0x8000) { + rotation += 0xFFFF0001; + } + if (rotation < -0x8000) { + rotation += 0xFFFF; + } + if (rotation > 0x3000) { + rotation = 0x3000; + } + if (rotation < -0x3000) { + rotation = -0x3000; + } + arg1->unk16C = rotation; + if ((arg1->unk1E7 & 0x3F) < 0x1F) { + arg1->unk16C = 0; + } + arg1 = (struct Object_Racer *) obj2->unk64; + rotation = func_80070750(diffX, diffZ) - (obj1->segment.trans.y_rotation & 0xFFFF); + if (rotation > 0x8000) { + rotation += 0xFFFF0001; + } + if (rotation < -0x8000) { + rotation += 0xFFFF; + } + if (rotation > 0x3000) { + rotation = 0x3000; + } + if (rotation < -0x3000) { + rotation = -0x3000; + } + arg1->unk16C = rotation; + if (ret) {} + ret = TRUE; + if ((arg1->unk1E7 & 0x1F) < 0xA) { + arg1->unk16C = 0; + } + } + return ret; +} + GLOBAL_ASM("asm/non_matchings/racer/func_8005250C.s") // action seems to be 1 when you're reversing, if you hit the horn, it's 4, and if you introduce yourself to a brick wall, it's 3 then 6. From 44ec3cff15b92ccb57edebe0cace6a21c55482bf Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:02:32 +0100 Subject: [PATCH 14/25] remove some stray commas from enums because apparently decomp.me doesn't like it --- asm/non_matchings/racer/func_80050850.s | 139 ------------------------ include/enums.h | 46 ++++---- include/structs.h | 5 +- src/camera.h | 2 +- src/fade_transition.h | 2 +- src/menu.h | 2 +- src/save_data.h | 2 +- src/video.h | 2 +- 8 files changed, 31 insertions(+), 169 deletions(-) delete mode 100644 asm/non_matchings/racer/func_80050850.s diff --git a/asm/non_matchings/racer/func_80050850.s b/asm/non_matchings/racer/func_80050850.s deleted file mode 100644 index 9c2d37b6..00000000 --- a/asm/non_matchings/racer/func_80050850.s +++ /dev/null @@ -1,139 +0,0 @@ -glabel func_80050850 -/* 051450 80050850 AFA60008 */ sw $a2, 8($sp) -/* 051454 80050854 AFA7000C */ sw $a3, 0xc($sp) -/* 051458 80050858 908C01F1 */ lbu $t4, 0x1f1($a0) -/* 05145C 8005085C 0007C400 */ sll $t8, $a3, 0x10 -/* 051460 80050860 0018CC03 */ sra $t9, $t8, 0x10 -/* 051464 80050864 00067400 */ sll $t6, $a2, 0x10 -/* 051468 80050868 000E7C03 */ sra $t7, $t6, 0x10 -/* 05146C 8005086C 1580006C */ bnez $t4, .L80050A20 -/* 051470 80050870 03203825 */ move $a3, $t9 -/* 051474 80050874 84830160 */ lh $v1, 0x160($a0) -/* 051478 80050878 34088001 */ li $t0, 32769 -/* 05147C 8005087C 306DFFFF */ andi $t5, $v1, 0xffff -/* 051480 80050880 01ED1023 */ subu $v0, $t7, $t5 -/* 051484 80050884 0048082A */ slt $at, $v0, $t0 -/* 051488 80050888 14200004 */ bnez $at, .L8005089C -/* 05148C 8005088C A4990166 */ sh $t9, 0x166($a0) -/* 051490 80050890 3C09FFFF */ lui $t1, (0xFFFF0001 >> 16) # lui $t1, 0xffff -/* 051494 80050894 35290001 */ ori $t1, (0xFFFF0001 & 0xFFFF) # ori $t1, $t1, 1 -/* 051498 80050898 00491021 */ addu $v0, $v0, $t1 -.L8005089C: -/* 05149C 8005089C 3C09FFFF */ lui $t1, (0xFFFF0001 >> 16) # lui $t1, 0xffff -/* 0514A0 800508A0 28418000 */ slti $at, $v0, -0x8000 -/* 0514A4 800508A4 10200003 */ beqz $at, .L800508B4 -/* 0514A8 800508A8 35290001 */ ori $t1, (0xFFFF0001 & 0xFFFF) # ori $t1, $t1, 1 -/* 0514AC 800508AC 340AFFFF */ li $t2, 65535 -/* 0514B0 800508B0 004A1021 */ addu $v0, $v0, $t2 -.L800508B4: -/* 0514B4 800508B4 1840000B */ blez $v0, .L800508E4 -/* 0514B8 800508B8 340AFFFF */ li $t2, 65535 -/* 0514BC 800508BC 240B0600 */ li $t3, 1536 -/* 0514C0 800508C0 00AB0019 */ multu $a1, $t3 -/* 0514C4 800508C4 00003012 */ mflo $a2 -/* 0514C8 800508C8 00C2082A */ slt $at, $a2, $v0 -/* 0514CC 800508CC 10200003 */ beqz $at, .L800508DC -/* 0514D0 800508D0 00627021 */ addu $t6, $v1, $v0 -/* 0514D4 800508D4 00C01025 */ move $v0, $a2 -/* 0514D8 800508D8 00627021 */ addu $t6, $v1, $v0 -.L800508DC: -/* 0514DC 800508DC 1000000C */ b .L80050910 -/* 0514E0 800508E0 A48E0160 */ sh $t6, 0x160($a0) -.L800508E4: -/* 0514E4 800508E4 0441000A */ bgez $v0, .L80050910 -/* 0514E8 800508E8 240B0600 */ li $t3, 1536 -/* 0514EC 800508EC 00AB0019 */ multu $a1, $t3 -/* 0514F0 800508F0 00003012 */ mflo $a2 -/* 0514F4 800508F4 00063023 */ negu $a2, $a2 -/* 0514F8 800508F8 0046082A */ slt $at, $v0, $a2 -/* 0514FC 800508FC 10200003 */ beqz $at, .L8005090C -/* 051500 80050900 00627821 */ addu $t7, $v1, $v0 -/* 051504 80050904 00C01025 */ move $v0, $a2 -/* 051508 80050908 00627821 */ addu $t7, $v1, $v0 -.L8005090C: -/* 05150C 8005090C A48F0160 */ sh $t7, 0x160($a0) -.L80050910: -/* 051510 80050910 84830162 */ lh $v1, 0x162($a0) -/* 051514 80050914 240B0600 */ li $t3, 1536 -/* 051518 80050918 3078FFFF */ andi $t8, $v1, 0xffff -/* 05151C 8005091C 00F81023 */ subu $v0, $a3, $t8 -/* 051520 80050920 0048082A */ slt $at, $v0, $t0 -/* 051524 80050924 14200003 */ bnez $at, .L80050934 -/* 051528 80050928 28418000 */ slti $at, $v0, -0x8000 -/* 05152C 8005092C 00491021 */ addu $v0, $v0, $t1 -/* 051530 80050930 28418000 */ slti $at, $v0, -0x8000 -.L80050934: -/* 051534 80050934 10200002 */ beqz $at, .L80050940 -/* 051538 80050938 00000000 */ nop -/* 05153C 8005093C 004A1021 */ addu $v0, $v0, $t2 -.L80050940: -/* 051540 80050940 1840000A */ blez $v0, .L8005096C -/* 051544 80050944 00000000 */ nop -/* 051548 80050948 00AB0019 */ multu $a1, $t3 -/* 05154C 8005094C 00003012 */ mflo $a2 -/* 051550 80050950 00C2082A */ slt $at, $a2, $v0 -/* 051554 80050954 10200003 */ beqz $at, .L80050964 -/* 051558 80050958 0062C821 */ addu $t9, $v1, $v0 -/* 05155C 8005095C 00C01025 */ move $v0, $a2 -/* 051560 80050960 0062C821 */ addu $t9, $v1, $v0 -.L80050964: -/* 051564 80050964 1000000C */ b .L80050998 -/* 051568 80050968 A4990162 */ sh $t9, 0x162($a0) -.L8005096C: -/* 05156C 8005096C 0441000A */ bgez $v0, .L80050998 -/* 051570 80050970 00000000 */ nop -/* 051574 80050974 00AB0019 */ multu $a1, $t3 -/* 051578 80050978 00003012 */ mflo $a2 -/* 05157C 8005097C 00063023 */ negu $a2, $a2 -/* 051580 80050980 0046082A */ slt $at, $v0, $a2 -/* 051584 80050984 10200003 */ beqz $at, .L80050994 -/* 051588 80050988 00626021 */ addu $t4, $v1, $v0 -/* 05158C 8005098C 00C01025 */ move $v0, $a2 -/* 051590 80050990 00626021 */ addu $t4, $v1, $v0 -.L80050994: -/* 051594 80050994 A48C0162 */ sh $t4, 0x162($a0) -.L80050998: -/* 051598 80050998 84830164 */ lh $v1, 0x164($a0) -/* 05159C 8005099C 87AD0012 */ lh $t5, 0x12($sp) -/* 0515A0 800509A0 306EFFFF */ andi $t6, $v1, 0xffff -/* 0515A4 800509A4 01AE1023 */ subu $v0, $t5, $t6 -/* 0515A8 800509A8 0048082A */ slt $at, $v0, $t0 -/* 0515AC 800509AC 14200003 */ bnez $at, .L800509BC -/* 0515B0 800509B0 28418000 */ slti $at, $v0, -0x8000 -/* 0515B4 800509B4 00491021 */ addu $v0, $v0, $t1 -/* 0515B8 800509B8 28418000 */ slti $at, $v0, -0x8000 -.L800509BC: -/* 0515BC 800509BC 10200002 */ beqz $at, .L800509C8 -/* 0515C0 800509C0 00000000 */ nop -/* 0515C4 800509C4 004A1021 */ addu $v0, $v0, $t2 -.L800509C8: -/* 0515C8 800509C8 1840000A */ blez $v0, .L800509F4 -/* 0515CC 800509CC 00000000 */ nop -/* 0515D0 800509D0 00AB0019 */ multu $a1, $t3 -/* 0515D4 800509D4 00003012 */ mflo $a2 -/* 0515D8 800509D8 00C2082A */ slt $at, $a2, $v0 -/* 0515DC 800509DC 10200003 */ beqz $at, .L800509EC -/* 0515E0 800509E0 00627821 */ addu $t7, $v1, $v0 -/* 0515E4 800509E4 00C01025 */ move $v0, $a2 -/* 0515E8 800509E8 00627821 */ addu $t7, $v1, $v0 -.L800509EC: -/* 0515EC 800509EC 03E00008 */ jr $ra -/* 0515F0 800509F0 A48F0164 */ sh $t7, 0x164($a0) - -.L800509F4: -/* 0515F4 800509F4 0441000A */ bgez $v0, .L80050A20 -/* 0515F8 800509F8 00000000 */ nop -/* 0515FC 800509FC 00AB0019 */ multu $a1, $t3 -/* 051600 80050A00 00003012 */ mflo $a2 -/* 051604 80050A04 00063023 */ negu $a2, $a2 -/* 051608 80050A08 0046082A */ slt $at, $v0, $a2 -/* 05160C 80050A0C 10200003 */ beqz $at, .L80050A1C -/* 051610 80050A10 0062C021 */ addu $t8, $v1, $v0 -/* 051614 80050A14 00C01025 */ move $v0, $a2 -/* 051618 80050A18 0062C021 */ addu $t8, $v1, $v0 -.L80050A1C: -/* 05161C 80050A1C A4980164 */ sh $t8, 0x164($a0) -.L80050A20: -/* 051620 80050A20 03E00008 */ jr $ra -/* 051624 80050A24 00000000 */ nop - diff --git a/include/enums.h b/include/enums.h index 0eba44f8..34482934 100644 --- a/include/enums.h +++ b/include/enums.h @@ -4,50 +4,50 @@ /* All the enums defined here can be used in asset files */ typedef enum Vehicle { - VEHICLE_CAR, - VEHICLE_HOVERCRAFT, - VEHICLE_PLANE, + VEHICLE_CAR, + VEHICLE_HOVERCRAFT, + VEHICLE_PLANE } Vehicle; typedef enum Language { - LANGUAGE_ENGLISH, - LANGUAGE_GERMAN, - LANGUAGE_FRENCH, - LANGUAGE_JAPANESE, + LANGUAGE_ENGLISH, + LANGUAGE_GERMAN, + LANGUAGE_FRENCH, + LANGUAGE_JAPANESE } Language; typedef enum World { WORLD_NONE = -1, // This enum starts at -1 instead of 0. - WORLD_CENTRAL_AREA, - WORLD_DINO_DOMAIN, - WORLD_SHERBET_ISLAND, - WORLD_SNOWFLAKE_MOUNTAIN, - WORLD_DRAGON_FOREST, - WORLD_FUTURE_FUN_LAND, + WORLD_CENTRAL_AREA, + WORLD_DINO_DOMAIN, + WORLD_SHERBET_ISLAND, + WORLD_SNOWFLAKE_MOUNTAIN, + WORLD_DRAGON_FOREST, + WORLD_FUTURE_FUN_LAND } World; typedef enum RaceType { RACETYPE_DEFAULT = 0, - RACETYPE_HORSESHOE_GULCH = 3, - RACETYPE_HUBWORLD = 5, + RACETYPE_HORSESHOE_GULCH = 3, + RACETYPE_HUBWORLD = 5, RACETYPE_CUTSCENE_1 = 6, // Not sure what the difference between these two are. - RACETYPE_CUTSCENE_2 = 7, - RACETYPE_BOSS = 8, - RACETYPE_CHALLENGE_BATTLE = 64, - RACETYPE_CHALLENGE_BANANAS = 65, - RACETYPE_CHALLENGE_EGGS = 66, + RACETYPE_CUTSCENE_2 = 7, + RACETYPE_BOSS = 8, + RACETYPE_CHALLENGE_BATTLE = 64, + RACETYPE_CHALLENGE_BANANAS = 65, + RACETYPE_CHALLENGE_EGGS = 66 } RaceType; typedef enum HorizontalAlignmentFlags { HORZ_ALIGN_LEFT = 0, HORZ_ALIGN_RIGHT = 1, - HORZ_ALIGN_CENTER = 4, + HORZ_ALIGN_CENTER = 4 } HorizontalAlignmentFlags; typedef enum VerticalAlignmentFlags { VERT_ALIGN_TOP = 0, VERT_ALIGN_BOTTOM = 2, - VERT_ALIGN_MIDDLE = 8, + VERT_ALIGN_MIDDLE = 8 } VerticalAlignmentFlags; typedef enum AlignmentFlags { @@ -59,7 +59,7 @@ typedef enum AlignmentFlags { ALIGN_MIDDLE_RIGHT = VERT_ALIGN_MIDDLE | HORZ_ALIGN_RIGHT, ALIGN_BOTTOM_LEFT = VERT_ALIGN_BOTTOM | HORZ_ALIGN_LEFT, ALIGN_BOTTOM_CENTER = VERT_ALIGN_BOTTOM | HORZ_ALIGN_CENTER, - ALIGN_BOTTOM_RIGHT = VERT_ALIGN_BOTTOM | HORZ_ALIGN_RIGHT, + ALIGN_BOTTOM_RIGHT = VERT_ALIGN_BOTTOM | HORZ_ALIGN_RIGHT } AlignmentFlags; #endif diff --git a/include/structs.h b/include/structs.h index 0c9d6018..3df8e273 100644 --- a/include/structs.h +++ b/include/structs.h @@ -474,7 +474,7 @@ typedef enum { OBJECT_MODEL_TYPE_SPRITE_BILLBOARD, OBJECT_MODEL_TYPE_VEHICLE_PART, OBJECT_MODEL_TYPE_UNKNOWN3, - OBJECT_MODEL_TYPE_UNKNOWN4, + OBJECT_MODEL_TYPE_UNKNOWN4 } ObjectModelType; typedef struct ObjectHeader { @@ -884,7 +884,8 @@ typedef struct Object_Racer { /* 0x1ED */ s8 squish_timer; /* 0x1EE */ u8 pad1EE[0x1]; /* 0x1EF */ u8 boost_sound; - /* 0x1F0 */ u8 pad1F0[0x2]; + /* 0x1F0 */ u8 pad1F0[0x1]; + /* 0x1F1 */ u8 unk1F1; /* 0x1F2 */ u8 unk1F2; /* 0x1F3 */ u8 unk1F3; /* 0x1F4 */ u8 pad1F4[0x1]; diff --git a/src/camera.h b/src/camera.h index c2b9a14b..0e9024eb 100644 --- a/src/camera.h +++ b/src/camera.h @@ -47,7 +47,7 @@ enum ViewPortFlags { VIEWPORT_X_CUSTOM = 0x0008, VIEWPORT_Y_CUSTOM = 0x0010, VIEWPORT_WIDTH_CUSTOM = 0x0020, - VIEWPORT_HEIGHT_CUSTOM = 0x0040, + VIEWPORT_HEIGHT_CUSTOM = 0x0040 }; extern s8 D_800DD060; diff --git a/src/fade_transition.h b/src/fade_transition.h index 47fa1fe2..b500a2e8 100644 --- a/src/fade_transition.h +++ b/src/fade_transition.h @@ -21,7 +21,7 @@ enum TransitionStatus { TRANSITION_LEVELSWAP = -1, TRANSITION_NONE, - TRANSITION_ACTIVE, + TRANSITION_ACTIVE }; /* Size: 8 bytes */ diff --git a/src/menu.h b/src/menu.h index 84217f8e..b362bf2b 100644 --- a/src/menu.h +++ b/src/menu.h @@ -25,7 +25,7 @@ enum DialogueMenuCases { DIALOG_TT, DIALOG_CHALLENGE, DIALOG_TROPHY, - DIALOG_RACERESULT, + DIALOG_RACERESULT }; #define CHEAT(index) 1 << index diff --git a/src/save_data.h b/src/save_data.h index fcc4d721..d9a24dab 100644 --- a/src/save_data.h +++ b/src/save_data.h @@ -31,7 +31,7 @@ typedef enum { CONTROLLER_PAK_UNK6, //Could be another way to mark as full according to tt_menu_loop RUMBLE_PAK, CONTROLLER_PAK_UNK8, // func_80074B34 Sets this, possibly set in func_800860A8 - CONTROLLER_PAK_BAD_DATA, + CONTROLLER_PAK_BAD_DATA } SIDeviceStatus; extern s8 *D_800DE440; diff --git a/src/video.h b/src/video.h index db4aedd9..0dbde27c 100644 --- a/src/video.h +++ b/src/video.h @@ -53,7 +53,7 @@ enum LogicUpdateRates { LOGIC_15FPS, LOGIC_12FPS, LOGIC_10FPS, - LOGIC_5FPS = 12, + LOGIC_5FPS = 12 }; extern s32 gVideoRefreshRate; From d1e571dfd3190d84079b99fc09fd1a72589f553c Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:20:15 +0100 Subject: [PATCH 15/25] match func_80050850 --- asm/non_matchings/racer/func_80046524.s | 4 +- asm/non_matchings/racer/func_80049794.s | 2 +- asm/non_matchings/racer/func_8004F7F4.s | 2 +- asm/non_matchings/racer/func_80054110.s | 2 +- src/racer.c | 76 ++++++++++++++++++++++++- 5 files changed, 80 insertions(+), 6 deletions(-) diff --git a/asm/non_matchings/racer/func_80046524.s b/asm/non_matchings/racer/func_80046524.s index 7ecbc151..a0476955 100644 --- a/asm/non_matchings/racer/func_80046524.s +++ b/asm/non_matchings/racer/func_80046524.s @@ -547,7 +547,7 @@ glabel func_80046524 /* 047840 80046C40 86060160 */ lh $a2, 0x160($s0) /* 047844 80046C44 AFA00010 */ sw $zero, 0x10($sp) /* 047848 80046C48 02002025 */ move $a0, $s0 -/* 04784C 80046C4C 0C014214 */ jal func_80050850 +/* 04784C 80046C4C 0C014214 */ jal apply_vehicle_rotation_offset /* 047850 80046C50 00003825 */ move $a3, $zero /* 047854 80046C54 10000015 */ b .L80046CAC /* 047858 80046C58 820B01D5 */ lb $t3, 0x1d5($s0) @@ -569,7 +569,7 @@ glabel func_80046524 /* 047894 80046C94 44074000 */ mfc1 $a3, $f8 /* 047898 80046C98 44D8F800 */ ctc1 $t8, $31 /* 04789C 80046C9C 0007CC00 */ sll $t9, $a3, 0x10 -/* 0478A0 80046CA0 0C014214 */ jal func_80050850 +/* 0478A0 80046CA0 0C014214 */ jal apply_vehicle_rotation_offset /* 0478A4 80046CA4 00193C03 */ sra $a3, $t9, 0x10 /* 0478A8 80046CA8 820B01D5 */ lb $t3, 0x1d5($s0) .L80046CAC: diff --git a/asm/non_matchings/racer/func_80049794.s b/asm/non_matchings/racer/func_80049794.s index 5f7a38b4..2241f49f 100644 --- a/asm/non_matchings/racer/func_80049794.s +++ b/asm/non_matchings/racer/func_80049794.s @@ -1004,7 +1004,7 @@ glabel func_80049794 /* 04B174 8004A574 8FA500F8 */ lw $a1, 0xf8($sp) /* 04B178 8004A578 01E03825 */ move $a3, $t7 /* 04B17C 8004A57C AFA00010 */ sw $zero, 0x10($sp) -/* 04B180 8004A580 0C014214 */ jal func_80050850 +/* 04B180 8004A580 0C014214 */ jal apply_vehicle_rotation_offset /* 04B184 8004A584 E7AE00DC */ swc1 $f14, 0xdc($sp) /* 04B188 8004A588 920201FE */ lbu $v0, 0x1fe($s0) /* 04B18C 8004A58C C7AE00DC */ lwc1 $f14, 0xdc($sp) diff --git a/asm/non_matchings/racer/func_8004F7F4.s b/asm/non_matchings/racer/func_8004F7F4.s index 3481f936..fe13d6f4 100644 --- a/asm/non_matchings/racer/func_8004F7F4.s +++ b/asm/non_matchings/racer/func_8004F7F4.s @@ -100,7 +100,7 @@ glabel func_8004F7F4 /* 050520 8004F920 AE280074 */ sw $t0, 0x74($s1) /* 050524 8004F924 8FA500C0 */ lw $a1, 0xc0($sp) .L8004F928: -/* 050528 8004F928 0C014214 */ jal func_80050850 +/* 050528 8004F928 0C014214 */ jal apply_vehicle_rotation_offset /* 05052C 8004F92C AFA30010 */ sw $v1, 0x10($sp) /* 050530 8004F930 8FA600C4 */ lw $a2, 0xc4($sp) /* 050534 8004F934 02202025 */ move $a0, $s1 diff --git a/asm/non_matchings/racer/func_80054110.s b/asm/non_matchings/racer/func_80054110.s index de5fae5d..78125c11 100644 --- a/asm/non_matchings/racer/func_80054110.s +++ b/asm/non_matchings/racer/func_80054110.s @@ -77,7 +77,7 @@ glabel func_80054110 /* 054E04 80054204 02002025 */ move $a0, $s0 /* 054E08 80054208 00003025 */ move $a2, $zero /* 054E0C 8005420C 00003825 */ move $a3, $zero -/* 054E10 80054210 0C014214 */ jal func_80050850 +/* 054E10 80054210 0C014214 */ jal apply_vehicle_rotation_offset /* 054E14 80054214 AFA00010 */ sw $zero, 0x10($sp) /* 054E18 80054218 0C01AF6C */ jal get_current_level_header /* 054E1C 8005421C 00000000 */ nop diff --git a/src/racer.c b/src/racer.c index 6acca83f..9e926ae0 100644 --- a/src/racer.c +++ b/src/racer.c @@ -549,7 +549,81 @@ void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) { GLOBAL_ASM("asm/non_matchings/racer/func_80050754.s") #endif -GLOBAL_ASM("asm/non_matchings/racer/func_80050850.s") +/** + * Applies visual rotational offets to vehicles. + * Examples include planes when on the ground, or when crashing, or hovercraft when braking. + */ +void apply_vehicle_rotation_offset(Object_Racer* obj, s32 max, s16 roll, s16 pitch, s16 yaw) { + s32 diff; + s32 tempAngle; + + if (!obj->unk1F1) { + tempAngle = roll - (obj->unk160 & 0xFFFF); + obj->unk166 = pitch; + if (tempAngle > 0x8000) { + tempAngle += 0xFFFF0001; + } + if (tempAngle < -0x8000) { + tempAngle += 0xFFFF; + } + if (tempAngle > 0) { + diff = max * 0x600; + if (diff < tempAngle) { + tempAngle = diff; + } + obj->unk160 += tempAngle; + } else if (tempAngle < 0) { + diff = -(max * 0x600); + if (tempAngle < diff) { + tempAngle = diff; + } + obj->unk160 += tempAngle; + } + tempAngle = pitch - (obj->unk162 & 0xFFFF); + if (tempAngle > 0x8000) { + tempAngle = tempAngle + 0xFFFF0001; + } + if (tempAngle < -0x8000) { + tempAngle = tempAngle + 0xFFFF; + } + if (tempAngle > 0) { + diff = max * 0x600; + if (diff < tempAngle) { + tempAngle = diff; + } + obj->unk162 += tempAngle; + } else if (tempAngle < 0) { + diff = -(max * 0x600); + if (tempAngle < diff) { + tempAngle = diff; + } + obj->unk162 += tempAngle; + } + tempAngle = yaw - (obj->unk164 & 0xFFFF); + if (tempAngle > 0x8000) { + tempAngle = tempAngle + 0xFFFF0001; + } + if (tempAngle < -0x8000) { + tempAngle = tempAngle + 0xFFFF; + } + if (tempAngle > 0) { + diff = max * 0x600; + if (diff < tempAngle) { + tempAngle = diff; + } + obj->unk164 += tempAngle; + return; + } + if (tempAngle < 0) { + diff = -(max * 0x600); + if (tempAngle < diff) { + tempAngle = diff; + } + obj->unk164 += tempAngle; + } + } +} + GLOBAL_ASM("asm/non_matchings/racer/func_80050A28.s") // Loops for as long as Taj exists. After swapping vehicle once, will remain true until you enter a door. From 4cb6f8cc2a676fbb73caa9587a8d454f023ed58e Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 18:55:36 +0100 Subject: [PATCH 16/25] object_racers rework --- include/structs.h | 169 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 131 insertions(+), 38 deletions(-) diff --git a/include/structs.h b/include/structs.h index 3df8e273..0285994a 100644 --- a/include/structs.h +++ b/include/structs.h @@ -783,13 +783,20 @@ typedef struct Object_Racer { /* 0x000 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled /* 0x002 */ u8 unk2; /* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc. - /* 0x004 */ u8 pad4[0x20]; + /* 0x004 */ s32 unk4; + /* 0x008 */ s32 unk8; + /* 0x00C */ s32 unkC; + /* 0x010 */ s32 unk10; + /* 0x014 */ s32 unk14; + /* 0x018 */ s32 unk18; + /* 0x01C */ s32 unk1C; + /* 0x020 */ s32 unk20; /* 0x024 */ s32 unk24; /* 0x028 */ u16 unk28; /* 0x02A */ u16 unk2A; /* 0x02C */ f32 velocity; /* 0x030 */ f32 lateral_velocity; - /* 0x034 */ u8 pad[0x4]; + /* 0x034 */ s32 unk34; /* 0x038 */ f32 ox1; /* 0x03C */ f32 oy1; /* 0x040 */ f32 oz1; @@ -802,114 +809,200 @@ typedef struct Object_Racer { /* 0x05C */ f32 prev_x_position; /* 0x060 */ f32 prev_y_position; /* 0x064 */ f32 prev_z_position; - /* 0x068 */ u8 pad68[0x10]; + /* 0x068 */ s32 unk68; + /* 0x06C */ s32 unk6C; + /* 0x070 */ s32 unk70; + /* 0x074 */ s32 unk74; /* 0x078 */ f32 unk78; /* 0x07C */ f32 unk7C; /* 0x080 */ f32 unk80; - /* 0x084 */ u8 pad84[0x8]; + /* 0x084 */ f32 unk84; + /* 0x088 */ f32 unk88; /* 0x08C */ f32 stretch_height; /* 0x090 */ f32 stretch_height_cap; /* 0x094 */ f32 camera_zoom; - /* 0x098 */ u8 pad98[0x4]; + /* 0x098 */ f32 unk98; /* 0x09C */ f32 pitch; - /* 0x0A0 */ u8 padA0[0x8]; + /* 0x0A0 */ f32 unkA0; + /* 0x0A4 */ s32 unkA4; /* 0x0A8 */ f32 checkpoint_distance; - /* 0x0AC */ u8 padAC[0x8]; + /* 0x0AC */ f32 unkAC; + /* 0x0B0 */ f32 unkB0; /* 0x0B4 */ f32 throttle; /* 0x0B8 */ f32 brake; - /* 0x0BC */ u8 padBC[0x14]; + /* 0x0BC */ f32 unkBC; + /* 0x0C0 */ f32 unkC0; + /* 0x0C4 */ f32 unkC4; + /* 0x0C8 */ f32 unkC8; + /* 0x0CC */ f32 unkCC; /* 0x0D0 */ f32 unkD0; - /* 0x0D4 */ u8 padD4[0x34]; + /* 0x0D4 */ s32 unkD4; + /* 0x0D8 */ f32 unkD8; + /* 0x0DC */ f32 unkDC; + /* 0x0E0 */ f32 unkE0; + /* 0x0E4 */ f32 unkE4; + /* 0x0E8 */ f32 unkE8; + /* 0x0EC */ f32 unkEC; + /* 0x0F0 */ f32 unkF0; + /* 0x0F4 */ f32 unkF4; + /* 0x0F8 */ f32 unkF8; + /* 0x0FC */ f32 unkFC; + /* 0x100 */ f32 unk100; + /* 0x104 */ f32 unk104; /* 0x108 */ s32 unk108; - /* 0x10C */ u8 pad10C[0xC]; + /* 0x10C */ s32 unk10C; + /* 0x110 */ s32 unk110; + /* 0x114 */ s32 unk114; /* 0x118 */ s32 unk118; - /* 0x11C */ u8 pad11C[0xC]; + /* 0x11C */ s32 unk11C; + /* 0x120 */ s32 unk120; + /* 0x124 */ s32 unk124; /* 0x128 */ u32 lap_times[3]; - /* 0x134 */ u8 pad134[0x10]; + /* 0x134 */ s32 unk134; + /* 0x138 */ s32 unk138; + /* 0x13C */ s32 unk13C; + /* 0x140 */ s32 unk140; /* 0x144 */ struct Object *held_obj; /* 0x148 */ struct Object *unk148; /* 0x14C */ struct Object *unk14C; - /* 0x150 */ u8 pad150[0x4]; + /* 0x150 */ struct Object *unk150; /* 0x154 */ struct Object *unk154; - /* 0x158 */ u8 pad158[0x8]; + /* 0x158 */ s32 unk158; + /* 0x15C */ s32 unk15C; /* 0x160 */ s16 unk160; /* 0x162 */ s16 unk162; /* 0x164 */ s16 unk164; /* 0x166 */ s16 unk166; - /* 0x168 */ u8 pad168[0x4]; + /* 0x168 */ s16 unk168; + /* 0x16A */ s16 unk16A; /* 0x166 */ s16 unk16C; - /* 0x168 */ u8 pad16E[0x4]; + /* 0x16E */ s16 unk16E; + /* 0x170 */ s16 unk170; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; /* 0x174 */ u8 balloon_level; - /* 0x175 */ u8 pad175[0xE]; + /* 0x175 */ u8 unk175; + /* 0x176 */ s16 unk176; + /* 0x178 */ s32 unk178; + /* 0x17C */ s32 unk17C; + /* 0x180 */ s8 unk180; + /* 0x181 */ s8 unk181; + /* 0x182 */ s8 unk182; /* 0x183 */ s8 unk183; /* 0x184 */ s8 pad184; /* 0x185 */ s8 bananas; /* 0x186 */ u8 unk186; /* 0x187 */ s8 unk187; - /* 0x188 */ u8 pad188[0x4]; + /* 0x188 */ s32 unk188; /* 0x18C */ s16 unk18C; /* 0x18E */ s16 unk18E; /* 0x190 */ u16 unk190; /* 0x192 */ u8 unk192; /* 0x193 */ u8 unk193; - /* 0x194 */ u8 pad194[0xC]; + /* 0x194 */ s16 unk194; + /* 0x196 */ s16 unk196; + /* 0x198 */ s32 unk198; + /* 0x19C */ s32 unk19C; /* 0x1A0 */ s16 unk1A0; /* 0x1A2 */ s16 unk1A2; /* 0x1A4 */ s16 unk1A4; - /* 0x1A6 */ u8 pad1A6[0x14]; + /* 0x1A6 */ s16 unk1A6; + /* 0x1A8 */ s16 unk1A8; + /* 0x1AA */ u8 unk1AA; + /* 0x1AB */ u8 unk1AB; + /* 0x1AC */ u8 unk1AC; + /* 0x1AD */ u8 unk1AD; + /* 0x1AE */ u8 unk1AE; + /* 0x1AF */ u8 unk1AF; + /* 0x1B0 */ s32 unk1B0; + /* 0x1B4 */ s32 unk1B4; + /* 0x1B8 */ s16 unk1B8; /* 0x1BA */ u16 unk1BA; - /* 0x1BC */ u8 pad1BC[0xD]; + /* 0x1BC */ s32 unk1BC; + /* 0x1C0 */ s32 unk1C0; + /* 0x1C4 */ s16 unk1C4; + /* 0x1C6 */ s16 unk1C6; + /* 0x1C8 */ u8 unk1C8; /* 0x1C9 */ u8 unk1C9; /* 0x1CA */ s8 unk1CA; - /* 0x1CB */ u8 pad1CB[0x3]; + /* 0x1CB */ u8 unk1CB; + /* 0x1CC */ u8 unk1CC; + /* 0x1CD */ u8 unk1CD; /* 0x1CE */ u8 unk1CE; - /* 0x1CF */ u8 pad1CF[0x4]; + /* 0x1CF */ u8 unk1CF; + /* 0x1D0 */ u8 unk1D0; + /* 0x1D1 */ u8 unk1D1; + /* 0x1D2 */ u8 unk1D2; /* 0x1D3 */ s8 unk1D3; - /* 0x1D4 */ u8 pad1D4[0x2]; + /* 0x1D4 */ u8 unk1D4; + /* 0x1D5 */ u8 unk1D5; /* 0x1D6 */ s8 unk1D6; /* 0x1D7 */ s8 unk1D7; /* 0x1D8 */ s8 unk1D8; - /* 0x1D9 */ u8 pad1D9[0x2]; + /* 0x1D9 */ u8 unk1D9; + /* 0x1DA */ u8 unk1DA; /* 0x1DB */ s8 spinout_timer; /* 0x1DC */ u8 wheel_surfaces[4]; - /* 0x1E0 */ u8 pad1E0[0x1]; + /* 0x1E0 */ u8 unk1E0; /* 0x1E1 */ s8 unk1E1; /* 0x1E2 */ s8 unk1E2; - /* 0x1E3 */ u8 pad1E3[0x3]; + /* 0x1E3 */ s8 unk1E3; + /* 0x1E4 */ s8 unk1E4; + /* 0x1E5 */ s8 unk1E5; /* 0x1E6 */ s8 drift_direction; /* 0x1E7 */ s8 unk1E7; - /* 0x1E8 */ u8 pad1E8[0x5]; + /* 0x1E8 */ s8 unk1E8; + /* 0x1E9 */ s8 unk1E9; + /* 0x1EA */ s8 unk1EA; + /* 0x1EB */ s8 unk1EB; + /* 0x1EC */ s8 unk1EC; /* 0x1ED */ s8 squish_timer; - /* 0x1EE */ u8 pad1EE[0x1]; + /* 0x1EE */ s8 unk1EE; /* 0x1EF */ u8 boost_sound; - /* 0x1F0 */ u8 pad1F0[0x1]; + /* 0x1F0 */ u8 unk1F0; /* 0x1F1 */ u8 unk1F1; /* 0x1F2 */ u8 unk1F2; /* 0x1F3 */ u8 unk1F3; - /* 0x1F4 */ u8 pad1F4[0x1]; + /* 0x1F4 */ u8 unk1F4; /* 0x1F5 */ u8 unk1F5; - /* 0x1F6 */ u8 pad1F6[0x1]; + /* 0x1F6 */ u8 unk1F6; /* 0x1F7 */ u8 transparency; /* 0x290 */ u8 indicator_type; /* 0x291 */ s8 indicator_timer; - /* 0x1FA */ u8 pad1FA[0x6]; + /* 0x1FA */ s8 unk1FA; + /* 0x1FB */ s8 unk1FB; + /* 0x1FC */ s8 unk1FC; + /* 0x1FD */ s8 unk1FD; + /* 0x1FE */ s8 unk1FE; + /* 0x1FF */ s8 unk1FF; /* 0x200 */ s8 unk200; - /* 0x201 */ u8 pad201[0x2]; + /* 0x201 */ s8 unk201; + /* 0x202 */ s8 unk202; /* 0x203 */ s8 unk203; /* 0x204 */ s16 unk204; - /* 0x206 */ u8 pad206[0x6]; + /* 0x206 */ s16 unk206; + /* 0x208 */ s16 unk208; + /* 0x20A */ s16 unk20A; /* 0x20C */ u8 unk20C; - /* 0x20D */ u8 pad20D[0x1]; + /* 0x20D */ u8 unk20D; /* 0x20E */ s16 unk20E; /* 0x210 */ s8 unk210; - /* 0x211 */ u8 pad211[0x2]; + /* 0x211 */ u8 unk211; + /* 0x212 */ u8 unk212; /* 0x213 */ s8 unk213; /* 0x214 */ s8 unk214; /* 0x215 */ s8 unk215; - /* 0x216 */ u8 pad216[0x6]; + /* 0x216 */ u8 unk216; + /* 0x217 */ u8 unk217; + /* 0x218 */ u8 unk218; + /* 0x219 */ u8 unk219; + /* 0x21A */ u8 unk21A; + /* 0x21B */ u8 unk21B; /* 0x21C */ u8 unk21C; + /* 0x21D */ u8 unk21D; + /* 0x21E */ u8 unk21E; + /* 0x21F */ u8 unk21F; + /* 0x220 */ s32 unk220; } Object_Racer; typedef struct Object_Bonus { From 52c28968e93f41bf4802052c9ffd917b7ffada56 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 21:23:46 +0100 Subject: [PATCH 17/25] necessary struct reworks actually in pain rn --- include/structs.h | 90 +++++++++++++++++++++--------------------- src/object_functions.c | 44 ++++++++++----------- src/particles.c | 2 +- src/racer.c | 48 +++++++++++----------- 4 files changed, 91 insertions(+), 93 deletions(-) diff --git a/include/structs.h b/include/structs.h index 0285994a..c4231f5f 100644 --- a/include/structs.h +++ b/include/structs.h @@ -885,10 +885,7 @@ typedef struct Object_Racer { /* 0x176 */ s16 unk176; /* 0x178 */ s32 unk178; /* 0x17C */ s32 unk17C; - /* 0x180 */ s8 unk180; - /* 0x181 */ s8 unk181; - /* 0x182 */ s8 unk182; - /* 0x183 */ s8 unk183; + /* 0x180 */ s32 unk180; /* 0x184 */ s8 pad184; /* 0x185 */ s8 bananas; /* 0x186 */ u8 unk186; @@ -899,7 +896,8 @@ typedef struct Object_Racer { /* 0x190 */ u16 unk190; /* 0x192 */ u8 unk192; /* 0x193 */ u8 unk193; - /* 0x194 */ s16 unk194; + /* 0x194 */ s8 unk194; + /* 0x195 */ s8 unk195; /* 0x196 */ s16 unk196; /* 0x198 */ s32 unk198; /* 0x19C */ s32 unk19C; @@ -908,12 +906,10 @@ typedef struct Object_Racer { /* 0x1A4 */ s16 unk1A4; /* 0x1A6 */ s16 unk1A6; /* 0x1A8 */ s16 unk1A8; - /* 0x1AA */ u8 unk1AA; - /* 0x1AB */ u8 unk1AB; + /* 0x1AA */ u16 unk1AA; /* 0x1AC */ u8 unk1AC; /* 0x1AD */ u8 unk1AD; - /* 0x1AE */ u8 unk1AE; - /* 0x1AF */ u8 unk1AF; + /* 0x1AE */ s16 unk1AE; /* 0x1B0 */ s32 unk1B0; /* 0x1B4 */ s32 unk1B4; /* 0x1B8 */ s16 unk1B8; @@ -972,7 +968,7 @@ typedef struct Object_Racer { /* 0x1FA */ s8 unk1FA; /* 0x1FB */ s8 unk1FB; /* 0x1FC */ s8 unk1FC; - /* 0x1FD */ s8 unk1FD; + /* 0x1FD */ u8 unk1FD; /* 0x1FE */ s8 unk1FE; /* 0x1FF */ s8 unk1FF; /* 0x200 */ s8 unk200; @@ -994,14 +990,8 @@ typedef struct Object_Racer { /* 0x215 */ s8 unk215; /* 0x216 */ u8 unk216; /* 0x217 */ u8 unk217; - /* 0x218 */ u8 unk218; - /* 0x219 */ u8 unk219; - /* 0x21A */ u8 unk21A; - /* 0x21B */ u8 unk21B; - /* 0x21C */ u8 unk21C; - /* 0x21D */ u8 unk21D; - /* 0x21E */ u8 unk21E; - /* 0x21F */ u8 unk21F; + /* 0x218 */ s32 unk218; + /* 0x21C */ s32 unk21C; /* 0x220 */ s32 unk220; } Object_Racer; @@ -1220,46 +1210,54 @@ typedef struct ObjectTransform { /* Size: 0x44 bytes */ typedef struct ObjectSegment { - /* 0x0000 */ ObjectTransform trans; - /* 0x0018 */ s16 unk18; - /* 0x001A */ s16 unk1A; - /* 0x001C */ f32 x_velocity; - /* 0x0020 */ f32 y_velocity; - /* 0x0024 */ f32 z_velocity; - /* 0x0028 */ f32 unk28; - + ObjectTransform trans; union { struct { - /* 0x002C */ s16 upper; - /* 0x002E */ s16 lower; + s16 upper; + s16 lower; } half; - /* 0x002C */ f32 word; + f32 word; + } unk18; + f32 x_velocity; + f32 y_velocity; + f32 z_velocity; + f32 unk28; + union { + struct { + s16 upper; + s16 lower; + } half; + f32 word; } unk2C; - - /* 0x0030 */ f32 unk30; - + f32 unk30; union { - /* 0x0034 */ f32 unk34; - /* 0x0034 */ s16 levelSegmentIndex; + f32 unk34; + s16 levelSegmentIndex; + struct h { + s16 h0; + s16 h1; + } h; } unk34_a; - union { struct { - /* 0x0038 */ u8 upper; - /* 0x0039 */ u8 lower; + u8 upper; + u8 lower; } half; - /* 0x0038 */ s16 word; + s16 word; } unk38; - - /* 0x003A */ s8 unk3A; - /* 0x003B */ s8 unk3B; - + s8 unk3A; + s8 unk3B; union { - /* 0x003C */ Object_3C* unk3C; - /* 0x003C */ f32 unk3C_f; + Object_3C* unk3C; + f32 unk3C_f; + struct { + u8 b0; + u8 b1; + u8 b2; + u8 b3; + } byte; } unk3C_a; - - /* 0x0040 */ ObjectHeader *header; + ObjectHeader *header; } ObjectSegment; /* Size: 0x0630 bytes */ diff --git a/src/object_functions.c b/src/object_functions.c index fbb3635f..4b45354d 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -276,7 +276,7 @@ void obj_loop_fireball_octoweapon(Object *obj, s32 speed) { obj->segment.trans.y_position = sp4C[0]; } } - obj->segment.unk18 += speed * 10; + obj->segment.unk18.half.upper += speed * 10; obj64 = obj->unk64; obj4C = obj->unk4C; obj4C_obj = (Object*)obj4C->unk0; // This should be a0, not v1! @@ -445,7 +445,7 @@ void obj_init_torch_mist(Object *obj, LevelObjectEntry_Torch_Mist *entry) { } void obj_loop_torch_mist(Object *obj, s32 speed) { - obj->segment.unk18 += obj->unk78 * speed; + obj->segment.unk18.half.upper += obj->unk78 * speed; } void obj_init_effectbox(UNUSED Object *obj, UNUSED LevelObjectEntry_EffectBox *entry) { @@ -897,7 +897,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) { Object_60 *obj60; obj->segment.unk3B = 0; - obj->segment.unk18 = 0x28; + obj->segment.unk18.half.upper = 0x28; if (func_8001139C() == 0) { obj->unk78 += speed; } @@ -1002,9 +1002,9 @@ void obj_loop_lavaspurt(Object *obj, s32 speed) { obj->segment.trans.unk6 |= 0x4000; } else { obj->segment.trans.unk6 &= ~0x4000; - obj->segment.unk18 += speed * 4; - if (obj->segment.unk18 >= 256) { - obj->segment.unk18 = 0; + obj->segment.unk18.half.upper += speed * 4; + if (obj->segment.unk18.half.upper >= 256) { + obj->segment.unk18.half.upper = 0; obj->unk78 = get_random_number_from_range(0, 30) + obj->unk7C.word; } } @@ -1029,7 +1029,7 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { obj->segment.trans.unk6 &= ~0x4000; someObj64->unk150 = obj; } - obj->segment.unk18 = obj->unk78 * 127; + obj->segment.unk18.half.upper = obj->unk78 * 127; } } @@ -1399,12 +1399,12 @@ void obj_loop_smoke(Object *obj, s32 speed) { temp_f2 *= 1.2; } obj->segment.trans.x_position += obj->segment.x_velocity * temp_f2; - obj->segment.unk18 += speed * 16; + obj->segment.unk18.half.upper += speed * 16; obj->segment.trans.y_position += obj->segment.y_velocity * temp_f2; obj->segment.trans.z_position += obj->segment.z_velocity * temp_f2; - if (obj->segment.unk18 >= 256) { + if (obj->segment.unk18.half.upper >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18 = 255; + obj->segment.unk18.half.upper = 255; } } @@ -1412,10 +1412,10 @@ void obj_init_unknown25(UNUSED Object *obj, UNUSED LevelObjectEntry_Unknown25 *e } void obj_loop_unknown25(Object *obj, s32 speed) { - obj->segment.unk18 += speed * 8; - if (obj->segment.unk18 >= 256) { + obj->segment.unk18.half.upper += speed * 8; + if (obj->segment.unk18.half.upper >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18 = 255; + obj->segment.unk18.half.upper = 255; } } @@ -1429,17 +1429,17 @@ void obj_loop_wardensmoke(Object *obj, s32 speed) { if (osTvType == TV_TYPE_PAL) { temp_f2 *= 1.2; } - obj->segment.unk18 += speed * 4; + obj->segment.unk18.half.upper += speed * 4; obj->segment.trans.y_position += temp_f2 * 0.25; - if (obj->segment.unk18 >= 256) { + if (obj->segment.unk18.half.upper >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18 = 255; + obj->segment.unk18.half.upper = 255; } } void obj_init_bombexplosion(Object *obj, LevelObjectEntry_BombExplosion *entry) { LevelObjectEntry_BombExplosion *entry2; - obj->segment.unk18 = 0; + obj->segment.unk18.half.upper = 0; obj->segment.trans.scale = 0.5f; obj->segment.unk3A = get_random_number_from_range(0, obj->segment.header->numberOfModelIds - 1); entry2 = entry; // Needed for a match. @@ -1581,7 +1581,7 @@ void obj_loop_dino_whale(Object *obj, s32 speed) { } else { obj->unk78 = 0; } - sp2C = obj->segment.unk18; + sp2C = obj->segment.unk18.half.upper; func_8001F460(obj, speed, obj); func_800113CC(obj, 0, sp2C, 0xAC, 0xAD); if (obj->unk4C->unk13 < 0xFF) { @@ -2041,7 +2041,7 @@ void obj_loop_ainode(UNUSED Object *obj, UNUSED s32 speed) { } void obj_init_treasuresucker(Object *obj, LevelObjectEntry_TreasureSucker *entry) { - obj->segment.unk18 = 0x78; + obj->segment.unk18.half.upper = 0x78; obj->unk78 = (entry->unk8 - 1) & 3; } @@ -2053,7 +2053,7 @@ void obj_init_flycoin(UNUSED Object *obj, UNUSED LevelObjectEntry_FlyCoin *entry GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_flycoin.s") void obj_init_bananacreator(Object *obj, UNUSED LevelObjectEntry_BananaCreator *entry) { - obj->segment.unk18 = 100; + obj->segment.unk18.half.upper = 100; } void obj_loop_bananacreator(Object *obj, s32 speed) { @@ -2410,7 +2410,7 @@ void obj_loop_buoy_pirateship(Object *obj, s32 speed) { if (obj->unk64 != NULL) { obj->segment.trans.y_position = func_800BEEB4(obj->unk64); } - obj->segment.unk18 += speed * 8; + obj->segment.unk18.half.upper += speed * 8; } void obj_init_log(Object *obj, LevelObjectEntry_Log *entry, UNUSED s32 arg2) { @@ -2738,6 +2738,6 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_levelname.s") void obj_loop_wizghosts(Object *obj, s32 speed) { func_8001F460(obj, speed, obj); - obj->segment.unk18 = (obj->segment.unk18 + (speed * 8)) & 0xFF; + obj->segment.unk18.half.upper = (obj->segment.unk18.half.upper + (speed * 8)) & 0xFF; } diff --git a/src/particles.c b/src/particles.c index a41b10a4..1d4b0b86 100644 --- a/src/particles.c +++ b/src/particles.c @@ -545,7 +545,7 @@ void func_800AF6E4(Object *obj, s32 arg1) { obj6C = &obj->unk6C[arg1]; obj6C->unk4 &= 0x7FFF; - obj->segment.unk1A--; + obj->segment.unk18.half.lower--; } GLOBAL_ASM("asm/non_matchings/particles/func_800AF714.s") diff --git a/src/racer.c b/src/racer.c index 9e926ae0..1a0e516d 100644 --- a/src/racer.c +++ b/src/racer.c @@ -390,7 +390,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) { if (phi_v0 >= 0x4A) { phi_v0 = 0x49; } - temp_v1 = phi_v0 - planeObj->segment.unk18; + temp_v1 = phi_v0 - planeObj->segment.unk18.half.upper; phi_v0 = 0; if (temp_v1 > 0) { phi_v0 = arg0 * 3; @@ -404,7 +404,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) { phi_v0 = temp_v1; } } - planeObj->segment.unk18 += phi_v0; + planeObj->segment.unk18.half.upper += phi_v0; } } @@ -469,7 +469,7 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { if ((func_8002341C() != 0) && (obj64->unk1D6 == 0xA)) { obj->unk4C->unk14 = 0; } - sp26 = obj->segment.unk18; + sp26 = obj->segment.unk18.half.upper; obj64->unk1D6 = 0xA; func_80049794(arg0, arg1, obj, obj64); obj64->unk1D6 = obj64->unk1D7; @@ -484,7 +484,7 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { 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; + obj->segment.unk18.half.upper = sp26 + arg0; func_80061C0C(obj); } } @@ -527,7 +527,7 @@ void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) { Object *someObj; obj->segment.unk3B = 0; - obj->segment.unk18 = 0x28; + obj->segment.unk18.half.upper = 0x28; 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; @@ -720,62 +720,62 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d //render_printf("set0\n"); } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { - if (arg0->segment.unk18 >= 41) { - arg0->segment.unk18 -= arg7 * 4; - if (arg0->segment.unk18 < 41) { + if (arg0->segment.unk18.half.upper >= 41) { + arg0->segment.unk18.half.upper -= arg7 * 4; + if (arg0->segment.unk18.half.upper < 41) { arg0->segment.unk3B = action; - arg0->segment.unk18 = arg3; + arg0->segment.unk18.half.upper = arg3; } //render_printf("set1\n"); } else { - arg0->segment.unk18 += arg7 * 4; - if (arg0->segment.unk18 >= 40) { + arg0->segment.unk18.half.upper += arg7 * 4; + if (arg0->segment.unk18.half.upper >= 40) { arg0->segment.unk3B = action; - arg0->segment.unk18 = arg3; + arg0->segment.unk18.half.upper = arg3; } //render_printf("set2\n"); } } else { // Set active flag, whether it's from just crashing, or beginning to honk. arg0->segment.unk3B = action; - arg0->segment.unk18 = arg3; + arg0->segment.unk18.half.upper = arg3; arg1->unk1F3 &= ~0x80; } } else if (arg0->segment.unk3B == action) { if (arg6 & 2) { if (arg1->unk1F3 & 0x80) { // Stop honking or reversing. - arg0->segment.unk18 -= arg5; - if (arg0->segment.unk18 <= 0) { + arg0->segment.unk18.half.upper -= arg5; + if (arg0->segment.unk18.half.upper <= 0) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18 = 40; + arg0->segment.unk18.half.upper = 40; arg1->unk1F3 = 0; } } else { // Actively reversing or honking or boosting, possibly a velocity modifier, have found it's also set when recovering from getting hit by a rocket or spike trap - arg0->segment.unk18 += arg5; + arg0->segment.unk18.half.upper += arg5; // Keeps the timer below the duration value, while actively held. - if (arg0->segment.unk18 >= duration) { - arg0->segment.unk18 = duration - 1; + if (arg0->segment.unk18.half.upper >= duration) { + arg0->segment.unk18.half.upper = duration - 1; if ((arg6 & 4) == 0) { arg1->unk1F3 |= 0x80; } } } } else { // Crash recoil - arg0->segment.unk18 += arg5; - if (arg0->segment.unk18 >= duration) { + arg0->segment.unk18.half.upper += arg5; + if (arg0->segment.unk18.half.upper >= duration) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18 = 40; + arg0->segment.unk18.half.upper = 40; arg1->unk1F3 = 0; } } } else { // Haven't seen this trigger yet. - arg0->segment.unk18 = arg3; + arg0->segment.unk18.half.upper = arg3; arg0->segment.unk3B = action; } /*render_printf("D_8011D55C %d\n", D_8011D55C); render_printf("action %d\n", action); - render_printf("unk18 %d\n", arg0->segment.unk18); + render_printf("unk18 %d\n", arg0->segment.unk18.half.upper); render_printf("unk3B %d\n", arg0->segment.unk3B); render_printf("arg6 %d\n", arg6); render_printf("arg7 %d\n", arg7);*/ From 0bc89603f2acfec7b45ee0e1bf42ba6f4ddeb093 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 27 Apr 2022 22:27:50 +0100 Subject: [PATCH 18/25] Update structs.h --- include/structs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/structs.h b/include/structs.h index c4231f5f..3ad799a0 100644 --- a/include/structs.h +++ b/include/structs.h @@ -978,7 +978,8 @@ typedef struct Object_Racer { /* 0x204 */ s16 unk204; /* 0x206 */ s16 unk206; /* 0x208 */ s16 unk208; - /* 0x20A */ s16 unk20A; + /* 0x20A */ s8 unk20A; + /* 0x20B */ s8 unk20B; /* 0x20C */ u8 unk20C; /* 0x20D */ u8 unk20D; /* 0x20E */ s16 unk20E; From f499f0d0ba78bcc66d8047554ab93e7d0dc46e9a Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 13:54:27 +0100 Subject: [PATCH 19/25] match obj_init_racer --- asm/non_matchings/racer/obj_init_racer.s | 234 ----------------------- include/structs.h | 86 +++++---- src/racer.c | 130 +++++++++++-- src/racer.h | 32 ++-- 4 files changed, 175 insertions(+), 307 deletions(-) delete mode 100644 asm/non_matchings/racer/obj_init_racer.s diff --git a/asm/non_matchings/racer/obj_init_racer.s b/asm/non_matchings/racer/obj_init_racer.s deleted file mode 100644 index b46ba17c..00000000 --- a/asm/non_matchings/racer/obj_init_racer.s +++ /dev/null @@ -1,234 +0,0 @@ -glabel obj_init_racer -/* 04E6B0 8004DAB0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 04E6B4 8004DAB4 44811000 */ mtc1 $at, $f2 -/* 04E6B8 8004DAB8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 04E6BC 8004DABC 3C018012 */ lui $at, %hi(D_8011D53C) # $at, 0x8012 -/* 04E6C0 8004DAC0 AFBF001C */ sw $ra, 0x1c($sp) -/* 04E6C4 8004DAC4 AFB00018 */ sw $s0, 0x18($sp) -/* 04E6C8 8004DAC8 AC20D53C */ sw $zero, %lo(D_8011D53C)($at) -/* 04E6CC 8004DACC 84AE000C */ lh $t6, 0xc($a1) -/* 04E6D0 8004DAD0 8C900064 */ lw $s0, 0x64($a0) -/* 04E6D4 8004DAD4 A48E0000 */ sh $t6, ($a0) -/* 04E6D8 8004DAD8 84AF000A */ lh $t7, 0xa($a1) -/* 04E6DC 8004DADC 00803825 */ move $a3, $a0 -/* 04E6E0 8004DAE0 A48F0002 */ sh $t7, 2($a0) -/* 04E6E4 8004DAE4 84B80008 */ lh $t8, 8($a1) -/* 04E6E8 8004DAE8 2409FFFF */ li $t1, -1 -/* 04E6EC 8004DAEC A4980004 */ sh $t8, 4($a0) -/* 04E6F0 8004DAF0 84A6000E */ lh $a2, 0xe($a1) -/* 04E6F4 8004DAF4 A2000194 */ sb $zero, 0x194($s0) -/* 04E6F8 8004DAF8 E602008C */ swc1 $f2, 0x8c($s0) -/* 04E6FC 8004DAFC 04C00010 */ bltz $a2, .L8004DB40 -/* 04E700 8004DB00 E6020090 */ swc1 $f2, 0x90($s0) -/* 04E704 8004DB04 28C10004 */ slti $at, $a2, 4 -/* 04E708 8004DB08 1020000D */ beqz $at, .L8004DB40 -/* 04E70C 8004DB0C 00000000 */ nop -/* 04E710 8004DB10 AFA60028 */ sw $a2, 0x28($sp) -/* 04E714 8004DB14 0C003856 */ jal func_8000E158 -/* 04E718 8004DB18 AFA40030 */ sw $a0, 0x30($sp) -/* 04E71C 8004DB1C 8FA60028 */ lw $a2, 0x28($sp) -/* 04E720 8004DB20 8FA70030 */ lw $a3, 0x30($sp) -/* 04E724 8004DB24 10400003 */ beqz $v0, .L8004DB34 -/* 04E728 8004DB28 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 04E72C 8004DB2C 24190001 */ li $t9, 1 -/* 04E730 8004DB30 03263023 */ subu $a2, $t9, $a2 -.L8004DB34: -/* 04E734 8004DB34 44811000 */ mtc1 $at, $f2 -/* 04E738 8004DB38 10000002 */ b .L8004DB44 -/* 04E73C 8004DB3C A6060000 */ sh $a2, ($s0) -.L8004DB40: -/* 04E740 8004DB40 A6090000 */ sh $t1, ($s0) -.L8004DB44: -/* 04E744 8004DB44 84EA0000 */ lh $t2, ($a3) -/* 04E748 8004DB48 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 04E74C 8004DB4C A60A01A0 */ sh $t2, 0x1a0($s0) -/* 04E750 8004DB50 84EB0004 */ lh $t3, 4($a3) -/* 04E754 8004DB54 44812000 */ mtc1 $at, $f4 -/* 04E758 8004DB58 860C01A0 */ lh $t4, 0x1a0($s0) -/* 04E75C 8004DB5C A60B01A4 */ sh $t3, 0x1a4($s0) -/* 04E760 8004DB60 E60400C4 */ swc1 $f4, 0xc4($s0) -/* 04E764 8004DB64 A60C0196 */ sh $t4, 0x196($s0) -/* 04E768 8004DB68 C4E6000C */ lwc1 $f6, 0xc($a3) -/* 04E76C 8004DB6C 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 04E770 8004DB70 E60600D8 */ swc1 $f6, 0xd8($s0) -/* 04E774 8004DB74 44810000 */ mtc1 $at, $f0 -/* 04E778 8004DB78 C4E80010 */ lwc1 $f8, 0x10($a3) -/* 04E77C 8004DB7C 24180003 */ li $t8, 3 -/* 04E780 8004DB80 46004280 */ add.s $f10, $f8, $f0 -/* 04E784 8004DB84 24190001 */ li $t9, 1 -/* 04E788 8004DB88 E60A00DC */ swc1 $f10, 0xdc($s0) -/* 04E78C 8004DB8C C4F00014 */ lwc1 $f16, 0x14($a3) -/* 04E790 8004DB90 24090001 */ li $t1, 1 -/* 04E794 8004DB94 E61000E0 */ swc1 $f16, 0xe0($s0) -/* 04E798 8004DB98 C4F2000C */ lwc1 $f18, 0xc($a3) -/* 04E79C 8004DB9C 2401FFFF */ li $at, -1 -/* 04E7A0 8004DBA0 E61200E4 */ swc1 $f18, 0xe4($s0) -/* 04E7A4 8004DBA4 C4E40010 */ lwc1 $f4, 0x10($a3) -/* 04E7A8 8004DBA8 00000000 */ nop -/* 04E7AC 8004DBAC 46002180 */ add.s $f6, $f4, $f0 -/* 04E7B0 8004DBB0 E60600E8 */ swc1 $f6, 0xe8($s0) -/* 04E7B4 8004DBB4 C4E80014 */ lwc1 $f8, 0x14($a3) -/* 04E7B8 8004DBB8 00000000 */ nop -/* 04E7BC 8004DBBC E60800EC */ swc1 $f8, 0xec($s0) -/* 04E7C0 8004DBC0 C4EA000C */ lwc1 $f10, 0xc($a3) -/* 04E7C4 8004DBC4 00000000 */ nop -/* 04E7C8 8004DBC8 E60A00F0 */ swc1 $f10, 0xf0($s0) -/* 04E7CC 8004DBCC C4F00010 */ lwc1 $f16, 0x10($a3) -/* 04E7D0 8004DBD0 00000000 */ nop -/* 04E7D4 8004DBD4 46008480 */ add.s $f18, $f16, $f0 -/* 04E7D8 8004DBD8 E61200F4 */ swc1 $f18, 0xf4($s0) -/* 04E7DC 8004DBDC C4E40014 */ lwc1 $f4, 0x14($a3) -/* 04E7E0 8004DBE0 00000000 */ nop -/* 04E7E4 8004DBE4 E60400F8 */ swc1 $f4, 0xf8($s0) -/* 04E7E8 8004DBE8 C4E6000C */ lwc1 $f6, 0xc($a3) -/* 04E7EC 8004DBEC 00000000 */ nop -/* 04E7F0 8004DBF0 E60600FC */ swc1 $f6, 0xfc($s0) -/* 04E7F4 8004DBF4 C4E80010 */ lwc1 $f8, 0x10($a3) -/* 04E7F8 8004DBF8 00000000 */ nop -/* 04E7FC 8004DBFC 46004280 */ add.s $f10, $f8, $f0 -/* 04E800 8004DC00 E60A0100 */ swc1 $f10, 0x100($s0) -/* 04E804 8004DC04 C4F00014 */ lwc1 $f16, 0x14($a3) -/* 04E808 8004DC08 00000000 */ nop -/* 04E80C 8004DC0C E6100104 */ swc1 $f16, 0x104($s0) -/* 04E810 8004DC10 C4F2000C */ lwc1 $f18, 0xc($a3) -/* 04E814 8004DC14 00000000 */ nop -/* 04E818 8004DC18 E612005C */ swc1 $f18, 0x5c($s0) -/* 04E81C 8004DC1C C4E40010 */ lwc1 $f4, 0x10($a3) -/* 04E820 8004DC20 00000000 */ nop -/* 04E824 8004DC24 E6040060 */ swc1 $f4, 0x60($s0) -/* 04E828 8004DC28 C4E60014 */ lwc1 $f6, 0x14($a3) -/* 04E82C 8004DC2C 00000000 */ nop -/* 04E830 8004DC30 E6060064 */ swc1 $f6, 0x64($s0) -/* 04E834 8004DC34 8CED004C */ lw $t5, 0x4c($a3) -/* 04E838 8004DC38 C4E8000C */ lwc1 $f8, 0xc($a3) -/* 04E83C 8004DC3C 00000000 */ nop -/* 04E840 8004DC40 E5A80004 */ swc1 $f8, 4($t5) -/* 04E844 8004DC44 8CEE004C */ lw $t6, 0x4c($a3) -/* 04E848 8004DC48 C4EA0010 */ lwc1 $f10, 0x10($a3) -/* 04E84C 8004DC4C 00000000 */ nop -/* 04E850 8004DC50 E5CA0008 */ swc1 $f10, 8($t6) -/* 04E854 8004DC54 8CEF004C */ lw $t7, 0x4c($a3) -/* 04E858 8004DC58 C4F00014 */ lwc1 $f16, 0x14($a3) -/* 04E85C 8004DC5C 00000000 */ nop -/* 04E860 8004DC60 E5F0000C */ swc1 $f16, 0xc($t7) -/* 04E864 8004DC64 86020000 */ lh $v0, ($s0) -/* 04E868 8004DC68 A21801E2 */ sb $t8, 0x1e2($s0) -/* 04E86C 8004DC6C 00025080 */ sll $t2, $v0, 2 -/* 04E870 8004DC70 01425021 */ addu $t2, $t2, $v0 -/* 04E874 8004DC74 A61901AA */ sh $t9, 0x1aa($s0) -/* 04E878 8004DC78 A60901AE */ sh $t1, 0x1ae($s0) -/* 04E87C 8004DC7C A20A01E7 */ sb $t2, 0x1e7($s0) -/* 04E880 8004DC80 E60200A8 */ swc1 $f2, 0xa8($s0) -/* 04E884 8004DC84 A20001FD */ sb $zero, 0x1fd($s0) -/* 04E888 8004DC88 AE000178 */ sw $zero, 0x178($s0) -/* 04E88C 8004DC8C AE00017C */ sw $zero, 0x17c($s0) -/* 04E890 8004DC90 AE000180 */ sw $zero, 0x180($s0) -/* 04E894 8004DC94 AE000218 */ sw $zero, 0x218($s0) -/* 04E898 8004DC98 AE000220 */ sw $zero, 0x220($s0) -/* 04E89C 8004DC9C 1041002B */ beq $v0, $at, .L8004DD4C -/* 04E8A0 8004DCA0 AE00021C */ sw $zero, 0x21c($s0) -/* 04E8A4 8004DCA4 3C028012 */ lui $v0, %hi(D_8011D582) # $v0, 0x8012 -/* 04E8A8 8004DCA8 2442D582 */ addiu $v0, %lo(D_8011D582) # addiu $v0, $v0, -0x2a7e -/* 04E8AC 8004DCAC 804B0000 */ lb $t3, ($v0) -/* 04E8B0 8004DCB0 00C02025 */ move $a0, $a2 -/* 04E8B4 8004DCB4 15600025 */ bnez $t3, .L8004DD4C -/* 04E8B8 8004DCB8 00000000 */ nop -/* 04E8BC 8004DCBC 0C01997A */ jal func_800665E8 -/* 04E8C0 8004DCC0 AFA70030 */ sw $a3, 0x30($sp) -/* 04E8C4 8004DCC4 0C01A73F */ jal func_80069CFC -/* 04E8C8 8004DCC8 00000000 */ nop -/* 04E8CC 8004DCCC 3C038012 */ lui $v1, %hi(gCameraObject) # $v1, 0x8012 -/* 04E8D0 8004DCD0 2463D508 */ addiu $v1, %lo(gCameraObject) # addiu $v1, $v1, -0x2af8 -/* 04E8D4 8004DCD4 AC620000 */ sw $v0, ($v1) -/* 04E8D8 8004DCD8 8FA40030 */ lw $a0, 0x30($sp) -/* 04E8DC 8004DCDC A4400004 */ sh $zero, 4($v0) -/* 04E8E0 8004DCE0 8C6E0000 */ lw $t6, ($v1) -/* 04E8E4 8004DCE4 240D0400 */ li $t5, 1024 -/* 04E8E8 8004DCE8 A5CD0002 */ sh $t5, 2($t6) -/* 04E8EC 8004DCEC 8C780000 */ lw $t8, ($v1) -/* 04E8F0 8004DCF0 860F0196 */ lh $t7, 0x196($s0) -/* 04E8F4 8004DCF4 240800FF */ li $t0, 255 -/* 04E8F8 8004DCF8 A70F0000 */ sh $t7, ($t8) -/* 04E8FC 8004DCFC 8C790000 */ lw $t9, ($v1) -/* 04E900 8004DD00 44809000 */ mtc1 $zero, $f18 -/* 04E904 8004DD04 A7200036 */ sh $zero, 0x36($t9) -/* 04E908 8004DD08 8C690000 */ lw $t1, ($v1) -/* 04E90C 8004DD0C 02002825 */ move $a1, $s0 -/* 04E910 8004DD10 A128003C */ sb $t0, 0x3c($t1) -/* 04E914 8004DD14 8C6A0000 */ lw $t2, ($v1) -/* 04E918 8004DD18 3C063F80 */ lui $a2, 0x3f80 -/* 04E91C 8004DD1C A148003D */ sb $t0, 0x3d($t2) -/* 04E920 8004DD20 8C6B0000 */ lw $t3, ($v1) -/* 04E924 8004DD24 00000000 */ nop -/* 04E928 8004DD28 A168003E */ sb $t0, 0x3e($t3) -/* 04E92C 8004DD2C 8C6C0000 */ lw $t4, ($v1) -/* 04E930 8004DD30 00000000 */ nop -/* 04E934 8004DD34 A188003F */ sb $t0, 0x3f($t4) -/* 04E938 8004DD38 8C6D0000 */ lw $t5, ($v1) -/* 04E93C 8004DD3C 0C015E90 */ jal func_80057A40 -/* 04E940 8004DD40 E5B20018 */ swc1 $f18, 0x18($t5) -/* 04E944 8004DD44 8FA70030 */ lw $a3, 0x30($sp) -/* 04E948 8004DD48 00000000 */ nop -.L8004DD4C: -/* 04E94C 8004DD4C 3C028012 */ lui $v0, %hi(D_8011D582) # $v0, 0x8012 -/* 04E950 8004DD50 2442D582 */ addiu $v0, %lo(D_8011D582) # addiu $v0, $v0, -0x2a7e -/* 04E954 8004DD54 804E0000 */ lb $t6, ($v0) -/* 04E958 8004DD58 240800FF */ li $t0, 255 -/* 04E95C 8004DD5C 15C00007 */ bnez $t6, .L8004DD7C -/* 04E960 8004DD60 00002025 */ move $a0, $zero -/* 04E964 8004DD64 3C018012 */ lui $at, %hi(D_8011D583) # $at, 0x8012 -/* 04E968 8004DD68 A020D583 */ sb $zero, %lo(D_8011D583)($at) -/* 04E96C 8004DD6C 3C018012 */ lui $at, %hi(D_8011D586) # $at, 0x8012 -/* 04E970 8004DD70 A420D586 */ sh $zero, %lo(D_8011D586)($at) -/* 04E974 8004DD74 3C018012 */ lui $at, %hi(D_8011D584) # $at, 0x8012 -/* 04E978 8004DD78 A020D584 */ sb $zero, %lo(D_8011D584)($at) -.L8004DD7C: -/* 04E97C 8004DD7C 8CF8004C */ lw $t8, 0x4c($a3) -/* 04E980 8004DD80 240F0005 */ li $t7, 5 -/* 04E984 8004DD84 A70F0014 */ sh $t7, 0x14($t8) -/* 04E988 8004DD88 8CF9004C */ lw $t9, 0x4c($a3) -/* 04E98C 8004DD8C 2409000F */ li $t1, 15 -/* 04E990 8004DD90 A3200011 */ sb $zero, 0x11($t9) -/* 04E994 8004DD94 8CEA004C */ lw $t2, 0x4c($a3) -/* 04E998 8004DD98 240B0014 */ li $t3, 20 -/* 04E99C 8004DD9C A1490010 */ sb $t1, 0x10($t2) -/* 04E9A0 8004DDA0 8CEC004C */ lw $t4, 0x4c($a3) -/* 04E9A4 8004DDA4 3C018012 */ lui $at, %hi(D_8011D560) # $at, 0x8012 -/* 04E9A8 8004DDA8 A18B0012 */ sb $t3, 0x12($t4) -/* 04E9AC 8004DDAC A20001EE */ sb $zero, 0x1ee($s0) -/* 04E9B0 8004DDB0 804D0000 */ lb $t5, ($v0) -/* 04E9B4 8004DDB4 240E0006 */ li $t6, 6 -/* 04E9B8 8004DDB8 15A00002 */ bnez $t5, .L8004DDC4 -/* 04E9BC 8004DDBC 240F0064 */ li $t7, 100 -/* 04E9C0 8004DDC0 A20801F7 */ sb $t0, 0x1f7($s0) -.L8004DDC4: -/* 04E9C4 8004DDC4 A420D560 */ sh $zero, %lo(D_8011D560)($at) -/* 04E9C8 8004DDC8 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 04E9CC 8004DDCC 44812000 */ mtc1 $at, $f4 -/* 04E9D0 8004DDD0 3C018012 */ lui $at, %hi(D_8011D544) # $at, 0x8012 -/* 04E9D4 8004DDD4 E424D544 */ swc1 $f4, %lo(D_8011D544)($at) -/* 04E9D8 8004DDD8 A20E01C9 */ sb $t6, 0x1c9($s0) -/* 04E9DC 8004DDDC A60F01C6 */ sh $t7, 0x1c6($s0) -/* 04E9E0 8004DDE0 3C018012 */ lui $at, %hi(D_8011D580) # $at, 0x8012 -/* 04E9E4 8004DDE4 A020D580 */ sb $zero, %lo(D_8011D580)($at) -/* 04E9E8 8004DDE8 3C018012 */ lui $at, %hi(D_8011D58F) # $at, 0x8012 -/* 04E9EC 8004DDEC 24020004 */ li $v0, 4 -/* 04E9F0 8004DDF0 A020D58C */ sb $zero, %lo(D_8011D58C)($at) -/* 04E9F4 8004DDF4 A020D58D */ sb $zero, %lo(D_8011D58D)($at) -/* 04E9F8 8004DDF8 A020D58E */ sb $zero, %lo(D_8011D58E)($at) -/* 04E9FC 8004DDFC A020D58F */ sb $zero, %lo(D_8011D58F)($at) -/* 04EA00 8004DE00 AFA20024 */ sw $v0, 0x24($sp) -/* 04EA04 8004DE04 00002825 */ move $a1, $zero -/* 04EA08 8004DE08 0C010FB3 */ jal func_80043ECC -/* 04EA0C 8004DE0C 00003025 */ move $a2, $zero -/* 04EA10 8004DE10 8FA20024 */ lw $v0, 0x24($sp) -/* 04EA14 8004DE14 3C018012 */ lui $at, %hi(D_8011D583) # $at, 0x8012 -/* 04EA18 8004DE18 A022D583 */ sb $v0, %lo(D_8011D583)($at) -/* 04EA1C 8004DE1C 3C018012 */ lui $at, %hi(D_8011D585) # $at, 0x8012 -/* 04EA20 8004DE20 A020D585 */ sb $zero, %lo(D_8011D585)($at) -/* 04EA24 8004DE24 A200020A */ sb $zero, 0x20a($s0) -/* 04EA28 8004DE28 8FBF001C */ lw $ra, 0x1c($sp) -/* 04EA2C 8004DE2C 8FB00018 */ lw $s0, 0x18($sp) -/* 04EA30 8004DE30 03E00008 */ jr $ra -/* 04EA34 8004DE34 27BD0030 */ addiu $sp, $sp, 0x30 - diff --git a/include/structs.h b/include/structs.h index 3ad799a0..c036a2ad 100644 --- a/include/structs.h +++ b/include/structs.h @@ -530,7 +530,9 @@ typedef struct Object_44 { typedef struct Object_4C { void *unk0; - u8 pad4[0xC]; + f32 x_position; + f32 y_position; + f32 z_position; u8 unk10; u8 unk11; u8 unk12; @@ -1211,54 +1213,54 @@ typedef struct ObjectTransform { /* Size: 0x44 bytes */ typedef struct ObjectSegment { - ObjectTransform trans; - union { - struct { - s16 upper; - s16 lower; - } half; - f32 word; - } unk18; - f32 x_velocity; - f32 y_velocity; - f32 z_velocity; - f32 unk28; - union { - struct { - s16 upper; - s16 lower; - } half; - f32 word; - } unk2C; - f32 unk30; - union { - f32 unk34; - s16 levelSegmentIndex; - struct h { - s16 h0; - s16 h1; + ObjectTransform trans; + union { + struct { + s16 upper; + s16 lower; + } half; + f32 word; + } unk18; + f32 x_velocity; + f32 y_velocity; + f32 z_velocity; + f32 unk28; + union { + struct { + s16 upper; + s16 lower; + } half; + f32 word; + } unk2C; + f32 unk30; + union { + f32 unk34; + s16 levelSegmentIndex; + struct h { + s16 h0; + s16 h1; } h; - } unk34_a; - union { - struct { - u8 upper; - u8 lower; - } half; - s16 word; - } unk38; - s8 unk3A; - s8 unk3B; - union { - Object_3C* unk3C; - f32 unk3C_f; + } unk34_a; + union { + struct { + u8 upper; + u8 lower; + } half; + s16 word; + } unk38; + s8 unk3A; + s8 unk3B; + union { + Object_3C* unk3C; + f32 unk3C_f; struct { u8 b0; u8 b1; u8 b2; u8 b3; } byte; - } unk3C_a; - ObjectHeader *header; + } unk3C_a; + ObjectHeader *header; } ObjectSegment; /* Size: 0x0630 bytes */ diff --git a/src/racer.c b/src/racer.c index 1a0e516d..aeef9b56 100644 --- a/src/racer.c +++ b/src/racer.c @@ -155,7 +155,8 @@ s8 D_8011D553; s32 gCurrentCarSteerVel; // Related to rotational velocity of the car. s32 D_8011D558; s32 D_8011D55C; -s32 D_8011D560; +s16 D_8011D560; +s16 D_8011D562; s32 D_8011D564; s32 D_8011D568; s32 D_8011D56C; @@ -169,16 +170,13 @@ s8 D_8011D582; s8 D_8011D583; s8 D_8011D584; s8 D_8011D585; -s8 D_8011D586; -s8 D_8011D587; +s16 D_8011D586; s8 D_8011D588; s8 D_8011D589; s8 D_8011D58A; s8 D_8011D58B; -s8 D_8011D58C; -s8 D_8011D58D; -s8 D_8011D58E; -s8 D_8011D58F; +s8 D_8011D58B; +s8 D_8011D58C[4]; GhostHeader *gGhostData[3]; s8 D_8011D59C; s8 D_8011D59D; @@ -490,7 +488,107 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { } } -GLOBAL_ASM("asm/non_matchings/racer/obj_init_racer.s") +void obj_init_racer(Object* obj, LevelObjectEntry_CharacterFlag* arg1) { + Object_Racer* tempObj; + s32 player; + s32 i; + + D_8011D53C = 0; + tempObj = (struct Object_Racer *) obj->unk64; + obj->segment.trans.y_rotation = arg1->unkC; + obj->segment.trans.x_rotation = arg1->unkA; + obj->segment.trans.z_rotation = arg1->unk8; + player = arg1->unkE; + tempObj->unk194 = 0; + tempObj->stretch_height = 1.0f; + tempObj->stretch_height_cap = 1.0f; + if (player >= 0 && player < 4) { + if (func_8000E158()) { + player = 1 - player; + } + tempObj->playerIndex = player; + } else { + tempObj->playerIndex = -1; + } + tempObj->unk1A0 = obj->segment.trans.y_rotation; + tempObj->unk1A4 = obj->segment.trans.z_rotation; + tempObj->unkC4 = 0.5f; + if (1); + tempObj->unk196 = tempObj->unk1A0; + tempObj->unkD8 = obj->segment.trans.x_position; + tempObj->unkDC = obj->segment.trans.y_position + 30.0f; + tempObj->unkE0 = obj->segment.trans.z_position; + tempObj->unkE4 = obj->segment.trans.x_position; + tempObj->unkE8 = obj->segment.trans.y_position + 30.0f; + tempObj->unkEC = obj->segment.trans.z_position; + tempObj->unkF0 = obj->segment.trans.x_position; + tempObj->unkF4 = obj->segment.trans.y_position + 30.0f; + tempObj->unkF8 = obj->segment.trans.z_position; + tempObj->unkFC = obj->segment.trans.x_position; + tempObj->unk100 = obj->segment.trans.y_position + 30.0f; + tempObj->unk104 = obj->segment.trans.z_position; + tempObj->prev_x_position = obj->segment.trans.x_position; + tempObj->prev_y_position = obj->segment.trans.y_position; + tempObj->prev_z_position = obj->segment.trans.z_position; + obj->unk4C->x_position = obj->segment.trans.x_position; + obj->unk4C->y_position = obj->segment.trans.y_position; + obj->unk4C->z_position = obj->segment.trans.z_position; + tempObj->unk1E2 = 3; + tempObj->unk1AA = 1; + tempObj->unk1AE = 1; + tempObj->unk1E7 = tempObj->playerIndex * 5; + tempObj->checkpoint_distance = 1.0f; + tempObj->unk1FD = 0; + tempObj->unk178 = 0; + tempObj->unk17C = 0; + tempObj->unk180 = 0; + tempObj->unk218 = 0; + tempObj->unk220 = 0; + tempObj->unk21C = 0; + if (tempObj->playerIndex != -1 && !D_8011D582) { + func_800665E8(player); + gCameraObject = func_80069CFC(); + gCameraObject->trans.z_rotation = 0; + gCameraObject->trans.x_rotation = 0x400; + gCameraObject->trans.y_rotation = tempObj->unk196; + gCameraObject->unk36 = 0; + gCameraObject->unk3C = 0xFF; + gCameraObject->unk3D = 0xFF; + gCameraObject->unk3E = 0xFF; + gCameraObject->unk3F = 0xFF; + gCameraObject->unk18 = 0.0f; + func_80057A40(obj, tempObj, 1.0f); + } + if (!D_8011D582) { + D_8011D583 = 0; + D_8011D586 = 0; + D_8011D584 = 0; + } + obj->unk4C->unk14 = 5; + obj->unk4C->unk11 = 0; + obj->unk4C->unk10 = 0xF; + obj->unk4C->unk12 = 0x14; + tempObj->unk1EE = 0; + if (!D_8011D582) { + tempObj->transparency = 0xFF; + } + D_8011D560 = 0; + D_8011D544 = 300.0f; + tempObj->unk1C9 = 6; + tempObj->unk1C6 = 100; + D_8011D580 = 0; + + for (i = 0; i < 4; i++) { D_8011D58C[i] = 0; } + if (tempObj); + if (tempObj); + if (tempObj); + if (tempObj); + func_80043ECC(0, 0, 0); + D_8011D583 = i; + D_8011D585 = 0; + tempObj->unk20A = 0; +} + GLOBAL_ASM("asm/non_matchings/racer/func_8004DE38.s") void func_8004F77C(unk8004F77C *arg0) { @@ -969,15 +1067,15 @@ void func_800580B4(Object *obj, Object_Racer *obj64, s32 arg2, f32 arg3) { if ((D_8011D55C != -1) && (obj64->unk1D8 != 1)) { if (arg2 != gCameraObject->unk36) { func_80057A40(obj, obj64, arg3); - xPos = gCameraObject->x_position; - yPos = gCameraObject->y_position; - zPos = gCameraObject->z_position; + xPos = gCameraObject->trans.x_position; + yPos = gCameraObject->trans.y_position; + zPos = gCameraObject->trans.z_position; gCameraObject->unk36 = arg2; func_80057A40(obj, obj64, arg3); if (D_8011D540 == 0 && D_8011D582 == 0) { - gCameraObject->unk24 = xPos - gCameraObject->x_position; - gCameraObject->unk28 = yPos - (gCameraObject->y_position + gCameraObject->unk30); - gCameraObject->unk2C = zPos - gCameraObject->z_position; + gCameraObject->x_velocity = xPos - gCameraObject->trans.x_position; + gCameraObject->y_velocity = yPos - (gCameraObject->trans.y_position + gCameraObject->unk30); + gCameraObject->z_velocity = zPos - gCameraObject->trans.z_position; } } } @@ -991,10 +1089,10 @@ GLOBAL_ASM("asm/non_matchings/racer/func_80058D5C.s") void func_80058F44(f32 arg0, Object *arg1, Object *arg2) { s32 temp0, temp1; temp0 = (s32)arg0; - temp1 = func_8007066C(gCameraObject->x_position - arg1->segment.trans.x_position, gCameraObject->z_position - arg1->segment.trans.z_position); + temp1 = func_8007066C(gCameraObject->trans.x_position - arg1->segment.trans.x_position, gCameraObject->trans.z_position - arg1->segment.trans.z_position); gCameraObject->y_rotation += (((-temp1 - gCameraObject->y_rotation) + 0x8000) * temp0) >> 4; gCameraObject->z_rotation -= (gCameraObject->z_rotation * temp0) >> 4; - gCameraObject->unk34 = get_level_segment_index_from_position(gCameraObject->x_position, arg2->segment.unk3C_a.unk3C_f, gCameraObject->z_position); + gCameraObject->unk34 = get_level_segment_index_from_position(gCameraObject->trans.x_position, arg2->segment.unk3C_a.unk3C_f, gCameraObject->trans.z_position); } #else GLOBAL_ASM("asm/non_matchings/racer/func_80058F44.s") diff --git a/src/racer.h b/src/racer.h index 7495425b..29863606 100644 --- a/src/racer.h +++ b/src/racer.h @@ -5,21 +5,23 @@ #include "structs.h" typedef struct ObjectCamera { -/* 0x0000 */ s16 y_rotation; -/* 0x0002 */ s16 x_rotation; -/* 0x0004 */ s16 z_rotation; -/* 0x0006 */ s16 unk6; -/* 0x0008 */ f32 scale; -/* 0x000C */ f32 x_position; -/* 0x0010 */ f32 y_position; -/* 0x0014 */ f32 z_position; -/* 0x0018 */ u8 pad18[0xC]; -/* 0x0024 */ f32 unk24; -/* 0x0028 */ f32 unk28; -/* 0x002C */ f32 unk2C; -/* 0x0030 */ f32 unk30; -/* 0x0034 */ s16 unk34; -/* 0x0036 */ s16 unk36; + ObjectTransform trans; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 x_velocity; + f32 y_velocity; + f32 z_velocity; + f32 unk30; + s16 unk34; + s16 unk36; + s16 unk38; + u8 unk3A; + u8 unk3B; + u8 unk3C; + u8 unk3D; + u8 unk3E; + u8 unk3F; } ObjectCamera; typedef struct unk8004F77C { From 0f000cc71b5a0b4aab063569f1d74346cdf6d4fd Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 14:10:43 +0100 Subject: [PATCH 20/25] Readd struct offset labels --- include/structs.h | 56 +++++++++++++++++++++++------------------------ src/racer.h | 34 ++++++++++++++-------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/include/structs.h b/include/structs.h index c036a2ad..c5e688ea 100644 --- a/include/structs.h +++ b/include/structs.h @@ -1213,54 +1213,54 @@ typedef struct ObjectTransform { /* Size: 0x44 bytes */ typedef struct ObjectSegment { - ObjectTransform trans; + /* 0x0000 */ ObjectTransform trans; union { struct { - s16 upper; - s16 lower; + /* 0x0018 */ s16 upper; + /* 0x0020 */ s16 lower; } half; - f32 word; + /* 0x0018 */ f32 word; } unk18; - f32 x_velocity; - f32 y_velocity; - f32 z_velocity; - f32 unk28; + /* 0x001C */ f32 x_velocity; + /* 0x0020 */ f32 y_velocity; + /* 0x0024 */ f32 z_velocity; + /* 0x0028 */ f32 unk28; union { struct { - s16 upper; - s16 lower; + /* 0x002C */ s16 upper; + /* 0x002E */ s16 lower; } half; - f32 word; + /* 0x002C */ f32 word; } unk2C; - f32 unk30; + /* 0x0030 */ f32 unk30; union { - f32 unk34; - s16 levelSegmentIndex; + /* 0x0034 */ f32 unk34; + /* 0x0034 */ s16 levelSegmentIndex; struct h { - s16 h0; - s16 h1; + /* 0x0034 */ s16 h0; + /* 0x0036 */ s16 h1; } h; } unk34_a; union { struct { - u8 upper; - u8 lower; + /* 0x0038 */ u8 upper; + /* 0x0039 */ u8 lower; } half; - s16 word; + /* 0x0038 */ s16 word; } unk38; - s8 unk3A; - s8 unk3B; + /* 0x003A */ s8 unk3A; + /* 0x003B */ s8 unk3B; union { - Object_3C* unk3C; - f32 unk3C_f; + /* 0x003C */ Object_3C* unk3C; + /* 0x003C */ f32 unk3C_f; struct { - u8 b0; - u8 b1; - u8 b2; - u8 b3; + /* 0x003C */ u8 b0; + /* 0x003D */ u8 b1; + /* 0x003E */ u8 b2; + /* 0x003F */ u8 b3; } byte; } unk3C_a; - ObjectHeader *header; + /* 0x0040 */ ObjectHeader *header; } ObjectSegment; /* Size: 0x0630 bytes */ diff --git a/src/racer.h b/src/racer.h index 29863606..707aae1a 100644 --- a/src/racer.h +++ b/src/racer.h @@ -5,23 +5,23 @@ #include "structs.h" typedef struct ObjectCamera { - ObjectTransform trans; - f32 unk18; - f32 unk1C; - f32 unk20; - f32 x_velocity; - f32 y_velocity; - f32 z_velocity; - f32 unk30; - s16 unk34; - s16 unk36; - s16 unk38; - u8 unk3A; - u8 unk3B; - u8 unk3C; - u8 unk3D; - u8 unk3E; - u8 unk3F; + /* 0x0014 */ ObjectTransform trans; + /* 0x0018 */ f32 unk18; + /* 0x001C */ f32 unk1C; + /* 0x0020 */ f32 unk20; + /* 0x0024 */ f32 x_velocity; + /* 0x0028 */ f32 y_velocity; + /* 0x002C */ f32 z_velocity; + /* 0x0030 */ f32 unk30; + /* 0x0034 */ s16 unk34; + /* 0x0036 */ s16 unk36; + /* 0x0038 */ s16 unk38; + /* 0x003A */ u8 unk3A; + /* 0x003B */ u8 unk3B; + /* 0x003C */ u8 unk3C; + /* 0x003D */ u8 unk3D; + /* 0x003E */ u8 unk3E; + /* 0x003F */ u8 unk3F; } ObjectCamera; typedef struct unk8004F77C { From 08c9e784f8c88df239c6d2bf5af63069ae768719 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 15:51:08 +0100 Subject: [PATCH 21/25] revert some redundant struct changes --- include/structs.h | 88 +++++++++++++++++++----------------------- src/object_functions.c | 44 ++++++++++----------- src/particles.c | 2 +- src/racer.c | 53 +++++++++++++------------ 4 files changed, 92 insertions(+), 95 deletions(-) diff --git a/include/structs.h b/include/structs.h index c5e688ea..332c0c29 100644 --- a/include/structs.h +++ b/include/structs.h @@ -1213,54 +1213,46 @@ typedef struct ObjectTransform { /* Size: 0x44 bytes */ typedef struct ObjectSegment { - /* 0x0000 */ ObjectTransform trans; - union { - struct { - /* 0x0018 */ s16 upper; - /* 0x0020 */ s16 lower; - } half; - /* 0x0018 */ f32 word; - } unk18; - /* 0x001C */ f32 x_velocity; - /* 0x0020 */ f32 y_velocity; - /* 0x0024 */ f32 z_velocity; - /* 0x0028 */ f32 unk28; - union { - struct { - /* 0x002C */ s16 upper; - /* 0x002E */ s16 lower; - } half; - /* 0x002C */ f32 word; - } unk2C; - /* 0x0030 */ f32 unk30; - union { - /* 0x0034 */ f32 unk34; - /* 0x0034 */ s16 levelSegmentIndex; - struct h { - /* 0x0034 */ s16 h0; - /* 0x0036 */ s16 h1; - } h; - } unk34_a; - union { - struct { - /* 0x0038 */ u8 upper; - /* 0x0039 */ u8 lower; - } half; - /* 0x0038 */ s16 word; - } unk38; - /* 0x003A */ s8 unk3A; - /* 0x003B */ s8 unk3B; - union { - /* 0x003C */ Object_3C* unk3C; - /* 0x003C */ f32 unk3C_f; - struct { - /* 0x003C */ u8 b0; - /* 0x003D */ u8 b1; - /* 0x003E */ u8 b2; - /* 0x003F */ u8 b3; - } byte; - } unk3C_a; - /* 0x0040 */ ObjectHeader *header; + /* 0x0000 */ ObjectTransform trans; + /* 0x0018 */ s16 unk18; + /* 0x001A */ s16 unk1A; + /* 0x001C */ f32 x_velocity; + /* 0x0020 */ f32 y_velocity; + /* 0x0024 */ f32 z_velocity; + /* 0x0028 */ f32 unk28; + + union { + struct { + /* 0x002C */ s16 upper; + /* 0x002E */ s16 lower; + } half; + /* 0x002C */ f32 word; + } unk2C; + + /* 0x0030 */ f32 unk30; + + union { + /* 0x0034 */ f32 unk34; + /* 0x0034 */ s16 levelSegmentIndex; + } unk34_a; + + union { + struct { + /* 0x0038 */ u8 upper; + /* 0x0039 */ u8 lower; + } half; + /* 0x0038 */ s16 word; + } unk38; + + /* 0x003A */ s8 unk3A; + /* 0x003B */ s8 unk3B; + + union { + /* 0x003C */ Object_3C* unk3C; + /* 0x003C */ f32 unk3C_f; + } unk3C_a; + + /* 0x0040 */ ObjectHeader *header; } ObjectSegment; /* Size: 0x0630 bytes */ diff --git a/src/object_functions.c b/src/object_functions.c index 4b45354d..fbb3635f 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -276,7 +276,7 @@ void obj_loop_fireball_octoweapon(Object *obj, s32 speed) { obj->segment.trans.y_position = sp4C[0]; } } - obj->segment.unk18.half.upper += speed * 10; + obj->segment.unk18 += speed * 10; obj64 = obj->unk64; obj4C = obj->unk4C; obj4C_obj = (Object*)obj4C->unk0; // This should be a0, not v1! @@ -445,7 +445,7 @@ void obj_init_torch_mist(Object *obj, LevelObjectEntry_Torch_Mist *entry) { } void obj_loop_torch_mist(Object *obj, s32 speed) { - obj->segment.unk18.half.upper += obj->unk78 * speed; + obj->segment.unk18 += obj->unk78 * speed; } void obj_init_effectbox(UNUSED Object *obj, UNUSED LevelObjectEntry_EffectBox *entry) { @@ -897,7 +897,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) { Object_60 *obj60; obj->segment.unk3B = 0; - obj->segment.unk18.half.upper = 0x28; + obj->segment.unk18 = 0x28; if (func_8001139C() == 0) { obj->unk78 += speed; } @@ -1002,9 +1002,9 @@ void obj_loop_lavaspurt(Object *obj, s32 speed) { obj->segment.trans.unk6 |= 0x4000; } else { obj->segment.trans.unk6 &= ~0x4000; - obj->segment.unk18.half.upper += speed * 4; - if (obj->segment.unk18.half.upper >= 256) { - obj->segment.unk18.half.upper = 0; + obj->segment.unk18 += speed * 4; + if (obj->segment.unk18 >= 256) { + obj->segment.unk18 = 0; obj->unk78 = get_random_number_from_range(0, 30) + obj->unk7C.word; } } @@ -1029,7 +1029,7 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { obj->segment.trans.unk6 &= ~0x4000; someObj64->unk150 = obj; } - obj->segment.unk18.half.upper = obj->unk78 * 127; + obj->segment.unk18 = obj->unk78 * 127; } } @@ -1399,12 +1399,12 @@ void obj_loop_smoke(Object *obj, s32 speed) { temp_f2 *= 1.2; } obj->segment.trans.x_position += obj->segment.x_velocity * temp_f2; - obj->segment.unk18.half.upper += speed * 16; + obj->segment.unk18 += speed * 16; obj->segment.trans.y_position += obj->segment.y_velocity * temp_f2; obj->segment.trans.z_position += obj->segment.z_velocity * temp_f2; - if (obj->segment.unk18.half.upper >= 256) { + if (obj->segment.unk18 >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18.half.upper = 255; + obj->segment.unk18 = 255; } } @@ -1412,10 +1412,10 @@ void obj_init_unknown25(UNUSED Object *obj, UNUSED LevelObjectEntry_Unknown25 *e } void obj_loop_unknown25(Object *obj, s32 speed) { - obj->segment.unk18.half.upper += speed * 8; - if (obj->segment.unk18.half.upper >= 256) { + obj->segment.unk18 += speed * 8; + if (obj->segment.unk18 >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18.half.upper = 255; + obj->segment.unk18 = 255; } } @@ -1429,17 +1429,17 @@ void obj_loop_wardensmoke(Object *obj, s32 speed) { if (osTvType == TV_TYPE_PAL) { temp_f2 *= 1.2; } - obj->segment.unk18.half.upper += speed * 4; + obj->segment.unk18 += speed * 4; obj->segment.trans.y_position += temp_f2 * 0.25; - if (obj->segment.unk18.half.upper >= 256) { + if (obj->segment.unk18 >= 256) { gParticlePtrList_addObject(obj); - obj->segment.unk18.half.upper = 255; + obj->segment.unk18 = 255; } } void obj_init_bombexplosion(Object *obj, LevelObjectEntry_BombExplosion *entry) { LevelObjectEntry_BombExplosion *entry2; - obj->segment.unk18.half.upper = 0; + obj->segment.unk18 = 0; obj->segment.trans.scale = 0.5f; obj->segment.unk3A = get_random_number_from_range(0, obj->segment.header->numberOfModelIds - 1); entry2 = entry; // Needed for a match. @@ -1581,7 +1581,7 @@ void obj_loop_dino_whale(Object *obj, s32 speed) { } else { obj->unk78 = 0; } - sp2C = obj->segment.unk18.half.upper; + sp2C = obj->segment.unk18; func_8001F460(obj, speed, obj); func_800113CC(obj, 0, sp2C, 0xAC, 0xAD); if (obj->unk4C->unk13 < 0xFF) { @@ -2041,7 +2041,7 @@ void obj_loop_ainode(UNUSED Object *obj, UNUSED s32 speed) { } void obj_init_treasuresucker(Object *obj, LevelObjectEntry_TreasureSucker *entry) { - obj->segment.unk18.half.upper = 0x78; + obj->segment.unk18 = 0x78; obj->unk78 = (entry->unk8 - 1) & 3; } @@ -2053,7 +2053,7 @@ void obj_init_flycoin(UNUSED Object *obj, UNUSED LevelObjectEntry_FlyCoin *entry GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_flycoin.s") void obj_init_bananacreator(Object *obj, UNUSED LevelObjectEntry_BananaCreator *entry) { - obj->segment.unk18.half.upper = 100; + obj->segment.unk18 = 100; } void obj_loop_bananacreator(Object *obj, s32 speed) { @@ -2410,7 +2410,7 @@ void obj_loop_buoy_pirateship(Object *obj, s32 speed) { if (obj->unk64 != NULL) { obj->segment.trans.y_position = func_800BEEB4(obj->unk64); } - obj->segment.unk18.half.upper += speed * 8; + obj->segment.unk18 += speed * 8; } void obj_init_log(Object *obj, LevelObjectEntry_Log *entry, UNUSED s32 arg2) { @@ -2738,6 +2738,6 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_levelname.s") void obj_loop_wizghosts(Object *obj, s32 speed) { func_8001F460(obj, speed, obj); - obj->segment.unk18.half.upper = (obj->segment.unk18.half.upper + (speed * 8)) & 0xFF; + obj->segment.unk18 = (obj->segment.unk18 + (speed * 8)) & 0xFF; } diff --git a/src/particles.c b/src/particles.c index 1d4b0b86..a41b10a4 100644 --- a/src/particles.c +++ b/src/particles.c @@ -545,7 +545,7 @@ void func_800AF6E4(Object *obj, s32 arg1) { obj6C = &obj->unk6C[arg1]; obj6C->unk4 &= 0x7FFF; - obj->segment.unk18.half.lower--; + obj->segment.unk1A--; } GLOBAL_ASM("asm/non_matchings/particles/func_800AF714.s") diff --git a/src/racer.c b/src/racer.c index aeef9b56..4ce505c9 100644 --- a/src/racer.c +++ b/src/racer.c @@ -388,7 +388,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) { if (phi_v0 >= 0x4A) { phi_v0 = 0x49; } - temp_v1 = phi_v0 - planeObj->segment.unk18.half.upper; + temp_v1 = phi_v0 - planeObj->segment.unk18; phi_v0 = 0; if (temp_v1 > 0) { phi_v0 = arg0 * 3; @@ -402,7 +402,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) { phi_v0 = temp_v1; } } - planeObj->segment.unk18.half.upper += phi_v0; + planeObj->segment.unk18 += phi_v0; } } @@ -467,7 +467,7 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { if ((func_8002341C() != 0) && (obj64->unk1D6 == 0xA)) { obj->unk4C->unk14 = 0; } - sp26 = obj->segment.unk18.half.upper; + sp26 = obj->segment.unk18; obj64->unk1D6 = 0xA; func_80049794(arg0, arg1, obj, obj64); obj64->unk1D6 = obj64->unk1D7; @@ -482,12 +482,16 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { 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.half.upper = sp26 + arg0; + obj->segment.unk18 = sp26 + arg0; func_80061C0C(obj); } } } +/** + * Initialise the basic properties of each racer object. If it's tied to a human player, + * will also initialise a camera object. + */ void obj_init_racer(Object* obj, LevelObjectEntry_CharacterFlag* arg1) { Object_Racer* tempObj; s32 player; @@ -578,6 +582,7 @@ void obj_init_racer(Object* obj, LevelObjectEntry_CharacterFlag* arg1) { tempObj->unk1C6 = 100; D_8011D580 = 0; + // This needs to be on one line to match. for (i = 0; i < 4; i++) { D_8011D58C[i] = 0; } if (tempObj); if (tempObj); @@ -625,7 +630,7 @@ void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) { Object *someObj; obj->segment.unk3B = 0; - obj->segment.unk18.half.upper = 0x28; + obj->segment.unk18 = 0x28; 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; @@ -818,62 +823,62 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d //render_printf("set0\n"); } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { - if (arg0->segment.unk18.half.upper >= 41) { - arg0->segment.unk18.half.upper -= arg7 * 4; - if (arg0->segment.unk18.half.upper < 41) { + if (arg0->segment.unk18 >= 41) { + arg0->segment.unk18 -= arg7 * 4; + if (arg0->segment.unk18 < 41) { arg0->segment.unk3B = action; - arg0->segment.unk18.half.upper = arg3; + arg0->segment.unk18 = arg3; } //render_printf("set1\n"); } else { - arg0->segment.unk18.half.upper += arg7 * 4; - if (arg0->segment.unk18.half.upper >= 40) { + arg0->segment.unk18 += arg7 * 4; + if (arg0->segment.unk18 >= 40) { arg0->segment.unk3B = action; - arg0->segment.unk18.half.upper = arg3; + arg0->segment.unk18 = arg3; } //render_printf("set2\n"); } } else { // Set active flag, whether it's from just crashing, or beginning to honk. arg0->segment.unk3B = action; - arg0->segment.unk18.half.upper = arg3; + arg0->segment.unk18 = arg3; arg1->unk1F3 &= ~0x80; } } else if (arg0->segment.unk3B == action) { if (arg6 & 2) { if (arg1->unk1F3 & 0x80) { // Stop honking or reversing. - arg0->segment.unk18.half.upper -= arg5; - if (arg0->segment.unk18.half.upper <= 0) { + arg0->segment.unk18 -= arg5; + if (arg0->segment.unk18 <= 0) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18.half.upper = 40; + arg0->segment.unk18 = 40; arg1->unk1F3 = 0; } } else { // Actively reversing or honking or boosting, possibly a velocity modifier, have found it's also set when recovering from getting hit by a rocket or spike trap - arg0->segment.unk18.half.upper += arg5; + arg0->segment.unk18 += arg5; // Keeps the timer below the duration value, while actively held. - if (arg0->segment.unk18.half.upper >= duration) { - arg0->segment.unk18.half.upper = duration - 1; + if (arg0->segment.unk18 >= duration) { + arg0->segment.unk18 = duration - 1; if ((arg6 & 4) == 0) { arg1->unk1F3 |= 0x80; } } } } else { // Crash recoil - arg0->segment.unk18.half.upper += arg5; - if (arg0->segment.unk18.half.upper >= duration) { + arg0->segment.unk18 += arg5; + if (arg0->segment.unk18 >= duration) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - arg0->segment.unk18.half.upper = 40; + arg0->segment.unk18 = 40; arg1->unk1F3 = 0; } } } else { // Haven't seen this trigger yet. - arg0->segment.unk18.half.upper = arg3; + arg0->segment.unk18 = arg3; arg0->segment.unk3B = action; } /*render_printf("D_8011D55C %d\n", D_8011D55C); render_printf("action %d\n", action); - render_printf("unk18 %d\n", arg0->segment.unk18.half.upper); + render_printf("unk18 %d\n", arg0->segment.unk18); render_printf("unk3B %d\n", arg0->segment.unk3B); render_printf("arg6 %d\n", arg6); render_printf("arg7 %d\n", arg7);*/ From 8b85e14c6283f556e0d101eddc2c348de72a7618 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:05:04 +0100 Subject: [PATCH 22/25] removing insane scrawlings of a person in search of answers --- src/racer.c | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/racer.c b/src/racer.c index 4ce505c9..8400cefb 100644 --- a/src/racer.c +++ b/src/racer.c @@ -212,7 +212,7 @@ typedef struct TempStruct5 { void func_80043ECC(s32 arg0, Object_64_Unknown5 *arg1, s32 arg2) { TempStruct5 *temp_v0; - s8* test; + s8 *test; s8 phi_a0; s32 i; static s8 D_8011D5BA; @@ -656,7 +656,7 @@ GLOBAL_ASM("asm/non_matchings/racer/func_80050754.s") * Applies visual rotational offets to vehicles. * Examples include planes when on the ground, or when crashing, or hovercraft when braking. */ -void apply_vehicle_rotation_offset(Object_Racer* obj, s32 max, s16 roll, s16 pitch, s16 yaw) { +void apply_vehicle_rotation_offset(Object_Racer *obj, s32 max, s16 roll, s16 pitch, s16 yaw) { s32 diff; s32 tempAngle; @@ -755,7 +755,7 @@ void func_8005234C(unk8005234C *arg0) { extern s16 func_80070750(f32 y, f32 x); -s32 func_80052388(Object* obj1, Object_Racer* arg1, Object* obj2, f32 distance) { +s32 func_80052388(Object *obj1, Object_Racer *arg1, Object *obj2, f32 distance) { s32 rotation; f32 diffX; f32 diffZ; @@ -807,20 +807,12 @@ s32 func_80052388(Object* obj1, Object_Racer* arg1, Object* obj2, f32 distance) GLOBAL_ASM("asm/non_matchings/racer/func_8005250C.s") -// action seems to be 1 when you're reversing, if you hit the horn, it's 4, and if you introduce yourself to a brick wall, it's 3 then 6. -// unk18 seems to be a counter that's used as a baseline for animations -// unk3B mostly mirrors what arg2 is, but it gets set to 0 -// I've yet to find a scenario where D_8011D55C is not 0. -// I've also yet to find a scenario where the action is < 3 -// arg6 is set to 6 when honking, but 7 when reversing and not honking and 0 when crashing. -// arg7 seems to be based on direction???? void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 duration, s32 arg5, s32 arg6, s32 arg7) { arg5 *= arg7; if ((D_8011D55C == -1) && (action >= 3)) { arg0->segment.unk3B = 0; arg1->unk1F2 = 0; - //render_printf("set0\n"); } else if (arg0->segment.unk3B == 0) { if (arg6 & 1) { if (arg0->segment.unk18 >= 41) { @@ -829,23 +821,21 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; } - //render_printf("set1\n"); } else { arg0->segment.unk18 += arg7 * 4; if (arg0->segment.unk18 >= 40) { arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; } - //render_printf("set2\n"); } - } else { // Set active flag, whether it's from just crashing, or beginning to honk. + } else { arg0->segment.unk3B = action; arg0->segment.unk18 = arg3; arg1->unk1F3 &= ~0x80; } } else if (arg0->segment.unk3B == action) { if (arg6 & 2) { - if (arg1->unk1F3 & 0x80) { // Stop honking or reversing. + if (arg1->unk1F3 & 0x80) { arg0->segment.unk18 -= arg5; if (arg0->segment.unk18 <= 0) { arg0->segment.unk3B = 0; @@ -853,9 +843,8 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d arg0->segment.unk18 = 40; arg1->unk1F3 = 0; } - } else { // Actively reversing or honking or boosting, possibly a velocity modifier, have found it's also set when recovering from getting hit by a rocket or spike trap + } else { arg0->segment.unk18 += arg5; - // Keeps the timer below the duration value, while actively held. if (arg0->segment.unk18 >= duration) { arg0->segment.unk18 = duration - 1; if ((arg6 & 4) == 0) { @@ -863,7 +852,7 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d } } } - } else { // Crash recoil + } else { arg0->segment.unk18 += arg5; if (arg0->segment.unk18 >= duration) { arg0->segment.unk3B = 0; @@ -872,16 +861,10 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d arg1->unk1F3 = 0; } } - } else { // Haven't seen this trigger yet. + } else { arg0->segment.unk18 = arg3; arg0->segment.unk3B = action; } - /*render_printf("D_8011D55C %d\n", D_8011D55C); - render_printf("action %d\n", action); - render_printf("unk18 %d\n", arg0->segment.unk18); - render_printf("unk3B %d\n", arg0->segment.unk3B); - render_printf("arg6 %d\n", arg6); - render_printf("arg7 %d\n", arg7);*/ } GLOBAL_ASM("asm/non_matchings/racer/func_80052B64.s") @@ -1117,8 +1100,8 @@ typedef struct Object_64_80059080 { u8 pad1C9[3]; } Object_64_80059080; -void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32* arg2, f32* arg3, f32* arg4) { - unknown8011AECC* temp_v0_2; +void func_80059080(s32 arg0, struct Object_64_80059080 *arg1, f32 *arg2, f32 *arg3, f32 *arg4) { + unknown8011AECC *temp_v0_2; s32 splinePos; s32 destReached; s32 splineEnd; From ca4c15ca0a1a0156832ebb8ab74148a5756dc8c8 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:16:52 +0100 Subject: [PATCH 23/25] Update unknown_003260.c --- src/unknown_003260.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unknown_003260.c b/src/unknown_003260.c index 94acacd0..3a44e997 100644 --- a/src/unknown_003260.c +++ b/src/unknown_003260.c @@ -142,8 +142,8 @@ void audioStopThread(void) { */ void thread4_audio(UNUSED void *arg) { s32 audioThreadMarkExit; - s16* audioThreadRetraceMesg; - s16* audioThreadUpdateMesg; + s16 *audioThreadRetraceMesg; + s16 *audioThreadUpdateMesg; audioThreadMarkExit = FALSE; audioThreadRetraceMesg = NULL; From c7d0863ee2e5c8a0152d711c0d0ffddeed3e1dea Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:52:44 +0100 Subject: [PATCH 24/25] Update racer.c --- src/racer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/racer.c b/src/racer.c index 8400cefb..bcc407a1 100644 --- a/src/racer.c +++ b/src/racer.c @@ -492,8 +492,8 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) { * Initialise the basic properties of each racer object. If it's tied to a human player, * will also initialise a camera object. */ -void obj_init_racer(Object* obj, LevelObjectEntry_CharacterFlag* arg1) { - Object_Racer* tempObj; +void obj_init_racer(Object *obj, LevelObjectEntry_CharacterFlag *arg1) { + Object_Racer *tempObj; s32 player; s32 i; From 2a035eb98a256874a1e64a264764c4d0f857660f Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 28 Apr 2022 19:31:38 +0100 Subject: [PATCH 25/25] rename traction checksum --- src/object_models.c | 4 ++-- src/object_models.h | 2 +- tools/python/calc_func_checksums.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/object_models.c b/src/object_models.c index dc4b34a2..5ddd7e38 100644 --- a/src/object_models.c +++ b/src/object_models.c @@ -10,7 +10,7 @@ /************ .data ************/ -s32 gFunc80024D54Checksum = 116315; +s32 gTractionTableChecksum = 116315; s32 gFunc80024D54Length = 1980; /*******************************/ @@ -66,7 +66,7 @@ void func_8005F850(void) { for (i = 0; i < gFunc80024D54Length; i++) { checksum += *(u8 *)(((s32)&func_80024D54) + i); } - if (checksum != gFunc80024D54Checksum) { + if (checksum != gTractionTableChecksum) { antipiracy_modify_surface_traction_table(); } } diff --git a/src/object_models.h b/src/object_models.h index b47d2f15..ae9ede97 100644 --- a/src/object_models.h +++ b/src/object_models.h @@ -11,7 +11,7 @@ typedef struct unk8011D624 { ObjectModel *model; } unk8011D624; -extern s32 gFunc80024D54Checksum; +extern s32 gTractionTableChecksum; extern s32 gFunc80024D54Length; void func_8005F850(void); diff --git a/tools/python/calc_func_checksums.py b/tools/python/calc_func_checksums.py index ac121757..3948173b 100644 --- a/tools/python/calc_func_checksums.py +++ b/tools/python/calc_func_checksums.py @@ -13,7 +13,7 @@ ROM_FILEPATH = BUILD_DIR + '/dkr.z64' FUNCTIONS_TO_CALC = [ # function checksum variable func size variable ('func_80019808', 'gFunc80019808Checksum', 'gFunc80019808Length'), - ('func_80024D54', 'gFunc80024D54Checksum', 'gFunc80024D54Length'), + ('func_80024D54', 'gTractionTableChecksum', 'gFunc80024D54Length'), ('obj_loop_goldenballoon', 'gObjLoopGoldenBalloonChecksum', 'gObjLoopGoldenBalloonLength'), ('func_80068158', 'gFunc80068158Checksum', 'gFunc80068158Length') ]