From 04bee9fc2d421db23dd0d76d6c0991368bf607e4 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Tue, 15 Nov 2022 17:45:22 +0000 Subject: [PATCH] Get within a flea's something or other of 37% (#285) * match func_800A4154 * match func_800A497C * nonmatching func_800A8474 * match func_800A3884 * Update game_ui.h * quick fixes * match func_800A4F50 and func_800A45F0 * Update game_ui.h * prelim * match func_8009CD7C and func_800AAFD0 * nonmatching func_800AC5A4 * warning * smilng emote * match func_800AC5A4 * Update weather.h * Update weather.c * fix a buncha warnings * Update game_ui.c * match func_80092E94 * I know what menu_5 is now :) * Update game_ui.c * Update menu.c * match func_80068514 * match func_800B695C and func_800B69FC * match func_8000FC6C * quick fixes --- asm/non_matchings/camera/func_80068514.s | 454 ---------------- asm/non_matchings/game_ui/func_800A7A60.s | 2 +- asm/non_matchings/game_ui/func_800AAFD0.s | 121 ----- asm/non_matchings/game_ui/func_800AC5A4.s | 191 ------- asm/non_matchings/game_ui/func_800ACA20.s | 2 +- .../game_ui/render_rain_splashes.s | 2 +- asm/non_matchings/menu/func_80092E94.s | 490 ------------------ asm/non_matchings/menu/func_8009CA60.s | 2 +- asm/non_matchings/menu/func_8009CD7C.s | 131 ----- asm/non_matchings/objects/func_8000FC6C.s | 49 -- asm/non_matchings/objects/func_800135B8.s | 2 +- asm/non_matchings/objects/func_800138A8.s | 2 +- .../objects/render_3d_billboard.s | 2 +- asm/non_matchings/objects/render_3d_model.s | 4 +- asm/non_matchings/printf/func_800B3740.s | 2 +- asm/non_matchings/printf/func_800B695C.s | 44 -- asm/non_matchings/printf/func_800B69FC.s | 288 ---------- include/f3ddkr.h | 10 + include/structs.h | 66 ++- src/camera.c | 131 ++++- src/camera.h | 26 +- src/fade_transition.c | 16 +- src/fade_transition.h | 16 +- src/font.c | 4 +- src/font.h | 4 +- src/game.c | 24 +- src/game_ui.c | 307 ++++++----- src/game_ui.h | 2 +- src/menu.c | 189 ++++++- src/menu.h | 17 +- src/objects.c | 36 +- src/objects.h | 39 +- src/particles.c | 4 +- src/particles.h | 4 + src/printf.c | 55 +- src/printf.h | 6 +- src/unknown_0255E0.c | 4 +- src/unknown_0255E0.h | 5 +- src/unknown_078050.c | 2 +- src/unknown_078050.h | 4 +- src/weather.c | 56 +- src/weather.h | 8 +- 42 files changed, 777 insertions(+), 2046 deletions(-) delete mode 100644 asm/non_matchings/camera/func_80068514.s delete mode 100644 asm/non_matchings/game_ui/func_800AAFD0.s delete mode 100644 asm/non_matchings/game_ui/func_800AC5A4.s delete mode 100644 asm/non_matchings/menu/func_80092E94.s delete mode 100644 asm/non_matchings/menu/func_8009CD7C.s delete mode 100644 asm/non_matchings/objects/func_8000FC6C.s delete mode 100644 asm/non_matchings/printf/func_800B695C.s delete mode 100644 asm/non_matchings/printf/func_800B69FC.s diff --git a/asm/non_matchings/camera/func_80068514.s b/asm/non_matchings/camera/func_80068514.s deleted file mode 100644 index e2dc18ac..00000000 --- a/asm/non_matchings/camera/func_80068514.s +++ /dev/null @@ -1,454 +0,0 @@ -glabel func_80068514 -/* 069114 80068514 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 069118 80068518 8FAF0074 */ lw $t7, 0x74($sp) -/* 06911C 8006851C AFB10024 */ sw $s1, 0x24($sp) -/* 069120 80068520 AFB00020 */ sw $s0, 0x20($sp) -/* 069124 80068524 240E0001 */ li $t6, 1 -/* 069128 80068528 31F80001 */ andi $t8, $t7, 1 -/* 06912C 8006852C 00E08025 */ move $s0, $a3 -/* 069130 80068530 00808825 */ move $s1, $a0 -/* 069134 80068534 AFBF002C */ sw $ra, 0x2c($sp) -/* 069138 80068538 AFB20028 */ sw $s2, 0x28($sp) -/* 06913C 8006853C E7B50018 */ swc1 $f21, 0x18($sp) -/* 069140 80068540 E7B4001C */ swc1 $f20, 0x1c($sp) -/* 069144 80068544 AFA50064 */ sw $a1, 0x64($sp) -/* 069148 80068548 130000D4 */ beqz $t8, .L8006889C -/* 06914C 8006854C AFAE0030 */ sw $t6, 0x30($sp) -/* 069150 80068550 3C028012 */ lui $v0, %hi(D_80120D20) # $v0, 0x8012 -/* 069154 80068554 8C420D20 */ lw $v0, %lo(D_80120D20)($v0) -/* 069158 80068558 3C018012 */ lui $at, %hi(D_80120D28) # $at, 0x8012 -/* 06915C 8006855C 0002C880 */ sll $t9, $v0, 2 -/* 069160 80068560 00390821 */ addu $at, $at, $t9 -/* 069164 80068564 C4240D28 */ lwc1 $f4, %lo(D_80120D28)($at) -/* 069168 80068568 C4E6000C */ lwc1 $f6, 0xc($a3) -/* 06916C 8006856C 3C018012 */ lui $at, %hi(D_80120D40) # $at, 0x8012 -/* 069170 80068570 46062201 */ sub.s $f8, $f4, $f6 -/* 069174 80068574 00390821 */ addu $at, $at, $t9 -/* 069178 80068578 E7A8005C */ swc1 $f8, 0x5c($sp) -/* 06917C 8006857C C4F20010 */ lwc1 $f18, 0x10($a3) -/* 069180 80068580 C42A0D40 */ lwc1 $f10, %lo(D_80120D40)($at) -/* 069184 80068584 3C018012 */ lui $at, %hi(D_80120D58) # $at, 0x8012 -/* 069188 80068588 46125101 */ sub.s $f4, $f10, $f18 -/* 06918C 8006858C 00390821 */ addu $at, $at, $t9 -/* 069190 80068590 E7A40058 */ swc1 $f4, 0x58($sp) -/* 069194 80068594 C4E80014 */ lwc1 $f8, 0x14($a3) -/* 069198 80068598 C4260D58 */ lwc1 $f6, %lo(D_80120D58)($at) -/* 06919C 8006859C 84E40000 */ lh $a0, ($a3) -/* 0691A0 800685A0 0C01C1F1 */ jal cosine_s -/* 0691A4 800685A4 46083501 */ sub.s $f20, $f6, $f8 -/* 0691A8 800685A8 86040000 */ lh $a0, ($s0) -/* 0691AC 800685AC 0C01C1FE */ jal sine_s -/* 0691B0 800685B0 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 0691B4 800685B4 C7AE005C */ lwc1 $f14, 0x5c($sp) -/* 0691B8 800685B8 C7A2004C */ lwc1 $f2, 0x4c($sp) -/* 0691BC 800685BC 46007282 */ mul.s $f10, $f14, $f0 -/* 0691C0 800685C0 C7B00058 */ lwc1 $f16, 0x58($sp) -/* 0691C4 800685C4 4602A482 */ mul.s $f18, $f20, $f2 -/* 0691C8 800685C8 00000000 */ nop -/* 0691CC 800685CC 4600A182 */ mul.s $f6, $f20, $f0 -/* 0691D0 800685D0 46125100 */ add.s $f4, $f10, $f18 -/* 0691D4 800685D4 E7A40044 */ swc1 $f4, 0x44($sp) -/* 0691D8 800685D8 46027202 */ mul.s $f8, $f14, $f2 -/* 0691DC 800685DC 46083501 */ sub.s $f20, $f6, $f8 -/* 0691E0 800685E0 46108282 */ mul.s $f10, $f16, $f16 -/* 0691E4 800685E4 00000000 */ nop -/* 0691E8 800685E8 4614A482 */ mul.s $f18, $f20, $f20 -/* 0691EC 800685EC 0C0326B4 */ jal sqrtf -/* 0691F0 800685F0 46125300 */ add.s $f12, $f10, $f18 -/* 0691F4 800685F4 C7AC0044 */ lwc1 $f12, 0x44($sp) -/* 0691F8 800685F8 0C01C1D4 */ jal arctan2_f -/* 0691FC 800685FC 46000386 */ mov.s $f14, $f0 -/* 069200 80068600 C7AC0044 */ lwc1 $f12, 0x44($sp) -/* 069204 80068604 AFA20038 */ sw $v0, 0x38($sp) -/* 069208 80068608 0C01C1D4 */ jal arctan2_f -/* 06920C 8006860C 4600A386 */ mov.s $f14, $f20 -/* 069210 80068610 00022400 */ sll $a0, $v0, 0x10 -/* 069214 80068614 00045403 */ sra $t2, $a0, 0x10 -/* 069218 80068618 0C01C20C */ jal func_80070830 -/* 06921C 8006861C 01402025 */ move $a0, $t2 -/* 069220 80068620 44802000 */ mtc1 $zero, $f4 -/* 069224 80068624 00021823 */ negu $v1, $v0 -/* 069228 80068628 4604A03C */ c.lt.s $f20, $f4 -/* 06922C 8006862C 00035A03 */ sra $t3, $v1, 8 -/* 069230 80068630 45000007 */ bc1f .L80068650 -/* 069234 80068634 01602025 */ move $a0, $t3 -/* 069238 80068638 8FAD0038 */ lw $t5, 0x38($sp) -/* 06923C 8006863C 240C0001 */ li $t4, 1 -/* 069240 80068640 000D7023 */ negu $t6, $t5 -/* 069244 80068644 4600A507 */ neg.s $f20, $f20 -/* 069248 80068648 018B2023 */ subu $a0, $t4, $t3 -/* 06924C 8006864C AFAE0038 */ sw $t6, 0x38($sp) -.L80068650: -/* 069250 80068650 C7AC0058 */ lwc1 $f12, 0x58($sp) -/* 069254 80068654 4600A386 */ mov.s $f14, $f20 -/* 069258 80068658 0C01C1D4 */ jal arctan2_f -/* 06925C 8006865C AFA4003C */ sw $a0, 0x3c($sp) -/* 069260 80068660 34018001 */ li $at, 32769 -/* 069264 80068664 8FA4003C */ lw $a0, 0x3c($sp) -/* 069268 80068668 0041082A */ slt $at, $v0, $at -/* 06926C 8006866C 14200003 */ bnez $at, .L8006867C -/* 069270 80068670 00401825 */ move $v1, $v0 -/* 069274 80068674 3C01FFFF */ lui $at, 0xffff -/* 069278 80068678 00411821 */ addu $v1, $v0, $at -.L8006867C: -/* 06927C 8006867C 00640019 */ multu $v1, $a0 -/* 069280 80068680 8FA20038 */ lw $v0, 0x38($sp) -/* 069284 80068684 240A00FF */ li $t2, 255 -/* 069288 80068688 0002C1C3 */ sra $t8, $v0, 7 -/* 06928C 8006868C 331900FF */ andi $t9, $t8, 0xff -/* 069290 80068690 2B210080 */ slti $at, $t9, 0x80 -/* 069294 80068694 03209025 */ move $s2, $t9 -/* 069298 80068698 3C028012 */ lui $v0, %hi(D_80120D20) # $v0, 0x8012 -/* 06929C 8006869C 00001812 */ mflo $v1 -/* 0692A0 800686A0 00037A03 */ sra $t7, $v1, 8 -/* 0692A4 800686A4 14200005 */ bnez $at, .L800686BC -/* 0692A8 800686A8 01E01825 */ move $v1, $t7 -/* 0692AC 800686AC 34018000 */ li $at, 32768 -/* 0692B0 800686B0 01599023 */ subu $s2, $t2, $t9 -/* 0692B4 800686B4 01E11821 */ addu $v1, $t7, $at -/* 0692B8 800686B8 AFA00030 */ sw $zero, 0x30($sp) -.L800686BC: -/* 0692BC 800686BC 8C420D20 */ lw $v0, %lo(D_80120D20)($v0) -/* 0692C0 800686C0 3C018012 */ lui $at, %hi(D_80120D28) # $at, 0x8012 -/* 0692C4 800686C4 00026080 */ sll $t4, $v0, 2 -/* 0692C8 800686C8 002C0821 */ addu $at, $at, $t4 -/* 0692CC 800686CC C4260D28 */ lwc1 $f6, %lo(D_80120D28)($at) -/* 0692D0 800686D0 3C018012 */ lui $at, %hi(D_80120D40) # $at, 0x8012 -/* 0692D4 800686D4 002C0821 */ addu $at, $at, $t4 -/* 0692D8 800686D8 C608000C */ lwc1 $f8, 0xc($s0) -/* 0692DC 800686DC C42A0D40 */ lwc1 $f10, %lo(D_80120D40)($at) -/* 0692E0 800686E0 C6120010 */ lwc1 $f18, 0x10($s0) -/* 0692E4 800686E4 46083001 */ sub.s $f0, $f6, $f8 -/* 0692E8 800686E8 3C018012 */ lui $at, %hi(D_80120D58) # $at, 0x8012 -/* 0692EC 800686EC 46125101 */ sub.s $f4, $f10, $f18 -/* 0692F0 800686F0 002C0821 */ addu $at, $at, $t4 -/* 0692F4 800686F4 E7A40058 */ swc1 $f4, 0x58($sp) -/* 0692F8 800686F8 C6080014 */ lwc1 $f8, 0x14($s0) -/* 0692FC 800686FC C4260D58 */ lwc1 $f6, %lo(D_80120D58)($at) -/* 069300 80068700 46000282 */ mul.s $f10, $f0, $f0 -/* 069304 80068704 46083501 */ sub.s $f20, $f6, $f8 -/* 069308 80068708 00125840 */ sll $t3, $s2, 1 -/* 06930C 8006870C 01609025 */ move $s2, $t3 -/* 069310 80068710 4614A482 */ mul.s $f18, $f20, $f20 -/* 069314 80068714 E7A0005C */ swc1 $f0, 0x5c($sp) -/* 069318 80068718 AFA30034 */ sw $v1, 0x34($sp) -/* 06931C 8006871C 0C0326B4 */ jal sqrtf -/* 069320 80068720 46125300 */ add.s $f12, $f10, $f18 -/* 069324 80068724 C7AC005C */ lwc1 $f12, 0x5c($sp) -/* 069328 80068728 E7A00050 */ swc1 $f0, 0x50($sp) -/* 06932C 8006872C 0C01C1D4 */ jal arctan2_f -/* 069330 80068730 4600A386 */ mov.s $f14, $f20 -/* 069334 80068734 3C058012 */ lui $a1, %hi(D_80120CF0) # $a1, 0x8012 -/* 069338 80068738 24A50CF0 */ addiu $a1, %lo(D_80120CF0) # addiu $a1, $a1, 0xcf0 -/* 06933C 8006873C C7AC0058 */ lwc1 $f12, 0x58($sp) -/* 069340 80068740 C7AE0050 */ lwc1 $f14, 0x50($sp) -/* 069344 80068744 0C01C1D4 */ jal arctan2_f -/* 069348 80068748 A4A20000 */ sh $v0, ($a1) -/* 06934C 8006874C 3C058012 */ lui $a1, %hi(D_80120CF0) # $a1, 0x8012 -/* 069350 80068750 8FAE0034 */ lw $t6, 0x34($sp) -/* 069354 80068754 24A50CF0 */ addiu $a1, %lo(D_80120CF0) # addiu $a1, $a1, 0xcf0 -/* 069358 80068758 00026823 */ negu $t5, $v0 -/* 06935C 8006875C A4AD0002 */ sh $t5, 2($a1) -/* 069360 80068760 A4AE0004 */ sh $t6, 4($a1) -/* 069364 80068764 C6040008 */ lwc1 $f4, 8($s0) -/* 069368 80068768 3C048012 */ lui $a0, %hi(D_80121060) # $a0, 0x8012 -/* 06936C 8006876C E4A40008 */ swc1 $f4, 8($a1) -/* 069370 80068770 C606000C */ lwc1 $f6, 0xc($s0) -/* 069374 80068774 24841060 */ addiu $a0, %lo(D_80121060) # addiu $a0, $a0, 0x1060 -/* 069378 80068778 E4A6000C */ swc1 $f6, 0xc($a1) -/* 06937C 8006877C C6080010 */ lwc1 $f8, 0x10($s0) -/* 069380 80068780 00000000 */ nop -/* 069384 80068784 E4A80010 */ swc1 $f8, 0x10($a1) -/* 069388 80068788 C60A0014 */ lwc1 $f10, 0x14($s0) -/* 06938C 8006878C 0C01BF0C */ jal func_8006FC30 -/* 069390 80068790 E4AA0014 */ swc1 $f10, 0x14($a1) -/* 069394 80068794 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 069398 80068798 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 06939C 8006879C 8D0F0000 */ lw $t7, ($t0) -/* 0693A0 800687A0 3C0B8012 */ lui $t3, %hi(D_80120D70) # $t3, 0x8012 -/* 0693A4 800687A4 25F80001 */ addiu $t8, $t7, 1 -/* 0693A8 800687A8 00185080 */ sll $t2, $t8, 2 -/* 0693AC 800687AC 256B0D70 */ addiu $t3, %lo(D_80120D70) # addiu $t3, $t3, 0xd70 -/* 0693B0 800687B0 014B1021 */ addu $v0, $t2, $t3 -/* 0693B4 800687B4 3C108012 */ lui $s0, %hi(D_80121060) # $s0, 0x8012 -/* 0693B8 800687B8 26101060 */ addiu $s0, %lo(D_80121060) # addiu $s0, $s0, 0x1060 -/* 0693BC 800687BC 8C45FFFC */ lw $a1, -4($v0) -/* 0693C0 800687C0 8C460000 */ lw $a2, ($v0) -/* 0693C4 800687C4 AD180000 */ sw $t8, ($t0) -/* 0693C8 800687C8 0C01BDDA */ jal func_8006F768 -/* 0693CC 800687CC 02002025 */ move $a0, $s0 -/* 0693D0 800687D0 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 0693D4 800687D4 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 0693D8 800687D8 8D0C0000 */ lw $t4, ($t0) -/* 0693DC 800687DC 3C048012 */ lui $a0, %hi(D_80120D70) # $a0, 0x8012 -/* 0693E0 800687E0 000C6880 */ sll $t5, $t4, 2 -/* 0693E4 800687E4 008D2021 */ addu $a0, $a0, $t5 -/* 0693E8 800687E8 8C840D70 */ lw $a0, %lo(D_80120D70)($a0) -/* 0693EC 800687EC 3C058012 */ lui $a1, %hi(D_80120F20) # $a1, 0x8012 -/* 0693F0 800687F0 24A50F20 */ addiu $a1, %lo(D_80120F20) # addiu $a1, $a1, 0xf20 -/* 0693F4 800687F4 0C01BDDA */ jal func_8006F768 -/* 0693F8 800687F8 02003025 */ move $a2, $s0 -/* 0693FC 800687FC 8FAE0064 */ lw $t6, 0x64($sp) -/* 069400 80068800 02002025 */ move $a0, $s0 -/* 069404 80068804 8DC50000 */ lw $a1, ($t6) -/* 069408 80068808 0C01BE1C */ jal func_8006F870 -/* 06940C 8006880C 00000000 */ nop -/* 069410 80068810 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 069414 80068814 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 069418 80068818 8FA60064 */ lw $a2, 0x64($sp) -/* 06941C 8006881C 8D180000 */ lw $t8, ($t0) -/* 069420 80068820 8CCF0000 */ lw $t7, ($a2) -/* 069424 80068824 3C018012 */ lui $at, %hi(D_80120D88) # $at, 0x8012 -/* 069428 80068828 0018C880 */ sll $t9, $t8, 2 -/* 06942C 8006882C 00390821 */ addu $at, $at, $t9 -/* 069430 80068830 AC2F0D88 */ sw $t7, %lo(D_80120D88)($at) -/* 069434 80068834 8E230000 */ lw $v1, ($s1) -/* 069438 80068838 3C0B0180 */ lui $t3, (0x01800040 >> 16) # lui $t3, 0x180 -/* 06943C 8006883C 246A0008 */ addiu $t2, $v1, 8 -/* 069440 80068840 AE2A0000 */ sw $t2, ($s1) -/* 069444 80068844 356B0040 */ ori $t3, (0x01800040 & 0xFFFF) # ori $t3, $t3, 0x40 -/* 069448 80068848 AC6B0000 */ sw $t3, ($v1) -/* 06944C 8006884C 8CCC0000 */ lw $t4, ($a2) -/* 069450 80068850 3C018000 */ lui $at, 0x8000 -/* 069454 80068854 01816821 */ addu $t5, $t4, $at -/* 069458 80068858 AC6D0004 */ sw $t5, 4($v1) -/* 06945C 8006885C 8CCE0000 */ lw $t6, ($a2) -/* 069460 80068860 3C05000E */ lui $a1, 0xe -/* 069464 80068864 25D80040 */ addiu $t8, $t6, 0x40 -/* 069468 80068868 ACD80000 */ sw $t8, ($a2) -/* 06946C 8006886C 8E230000 */ lw $v1, ($s1) -/* 069470 80068870 24B9D138 */ addiu $t9, $a1, -0x2ec8 -/* 069474 80068874 332A0006 */ andi $t2, $t9, 6 -/* 069478 80068878 000A5C00 */ sll $t3, $t2, 0x10 -/* 06947C 8006887C 3C010400 */ lui $at, 0x400 -/* 069480 80068880 01616025 */ or $t4, $t3, $at -/* 069484 80068884 246F0008 */ addiu $t7, $v1, 8 -/* 069488 80068888 AE2F0000 */ sw $t7, ($s1) -/* 06948C 8006888C 358D001A */ ori $t5, $t4, 0x1a -/* 069490 80068890 AC6D0000 */ sw $t5, ($v1) -/* 069494 80068894 1000008A */ b .L80068AC0 -/* 069498 80068898 AC790004 */ sw $t9, 4($v1) -.L8006889C: -/* 06949C 8006889C 444EF800 */ cfc1 $t6, $31 -/* 0694A0 800688A0 C612000C */ lwc1 $f18, 0xc($s0) -/* 0694A4 800688A4 35C10003 */ ori $at, $t6, 3 -/* 0694A8 800688A8 38210002 */ xori $at, $at, 2 -/* 0694AC 800688AC 44C1F800 */ ctc1 $at, $31 -/* 0694B0 800688B0 8CC20000 */ lw $v0, ($a2) -/* 0694B4 800688B4 46009124 */ cvt.w.s $f4, $f18 -/* 0694B8 800688B8 240500FF */ li $a1, 255 -/* 0694BC 800688BC 44CEF800 */ ctc1 $t6, $31 -/* 0694C0 800688C0 44182000 */ mfc1 $t8, $f4 -/* 0694C4 800688C4 3C098000 */ lui $t1, 0x8000 -/* 0694C8 800688C8 444FF800 */ cfc1 $t7, $31 -/* 0694CC 800688CC A4580000 */ sh $t8, ($v0) -/* 0694D0 800688D0 35E10003 */ ori $at, $t7, 3 -/* 0694D4 800688D4 38210002 */ xori $at, $at, 2 -/* 0694D8 800688D8 44C1F800 */ ctc1 $at, $31 -/* 0694DC 800688DC C6060010 */ lwc1 $f6, 0x10($s0) -/* 0694E0 800688E0 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 0694E4 800688E4 46003224 */ cvt.w.s $f8, $f6 -/* 0694E8 800688E8 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 0694EC 800688EC 44CFF800 */ ctc1 $t7, $31 -/* 0694F0 800688F0 44194000 */ mfc1 $t9, $f8 -/* 0694F4 800688F4 3C048012 */ lui $a0, %hi(D_80120D70) # $a0, 0x8012 -/* 0694F8 800688F8 444AF800 */ cfc1 $t2, $31 -/* 0694FC 800688FC A4590002 */ sh $t9, 2($v0) -/* 069500 80068900 35410003 */ ori $at, $t2, 3 -/* 069504 80068904 38210002 */ xori $at, $at, 2 -/* 069508 80068908 44C1F800 */ ctc1 $at, $31 -/* 06950C 8006890C C60A0014 */ lwc1 $f10, 0x14($s0) -/* 069510 80068910 A0450006 */ sb $a1, 6($v0) -/* 069514 80068914 460054A4 */ cvt.w.s $f18, $f10 -/* 069518 80068918 A0450007 */ sb $a1, 7($v0) -/* 06951C 8006891C 440B9000 */ mfc1 $t3, $f18 -/* 069520 80068920 A0450008 */ sb $a1, 8($v0) -/* 069524 80068924 A0450009 */ sb $a1, 9($v0) -/* 069528 80068928 A44B0004 */ sh $t3, 4($v0) -/* 06952C 8006892C 8E230000 */ lw $v1, ($s1) -/* 069530 80068930 3C010400 */ lui $at, 0x400 -/* 069534 80068934 246C0008 */ addiu $t4, $v1, 8 -/* 069538 80068938 AE2C0000 */ sw $t4, ($s1) -/* 06953C 8006893C 8CCD0000 */ lw $t5, ($a2) -/* 069540 80068940 44CAF800 */ ctc1 $t2, $31 -/* 069544 80068944 01A9C021 */ addu $t8, $t5, $t1 -/* 069548 80068948 330F0006 */ andi $t7, $t8, 6 -/* 06954C 8006894C 000FCC00 */ sll $t9, $t7, 0x10 -/* 069550 80068950 03215025 */ or $t2, $t9, $at -/* 069554 80068954 354B001A */ ori $t3, $t2, 0x1a -/* 069558 80068958 AC6B0000 */ sw $t3, ($v1) -/* 06955C 8006895C 8CCC0000 */ lw $t4, ($a2) -/* 069560 80068960 3C0F8012 */ lui $t7, %hi(gCutsceneCameraActive) # $t7, 0x8012 -/* 069564 80068964 01896821 */ addu $t5, $t4, $t1 -/* 069568 80068968 AC6D0004 */ sw $t5, 4($v1) -/* 06956C 8006896C 8CCE0000 */ lw $t6, ($a2) -/* 069570 80068970 3C078012 */ lui $a3, %hi(gVideoAspectRatio) # $a3, 0x8012 -/* 069574 80068974 25D8000A */ addiu $t8, $t6, 0xa -/* 069578 80068978 ACD80000 */ sw $t8, ($a2) -/* 06957C 8006897C 81EF0D14 */ lb $t7, %lo(gCutsceneCameraActive)($t7) -/* 069580 80068980 00000000 */ nop -/* 069584 80068984 15E0000D */ bnez $t7, .L800689BC -/* 069588 80068988 3C198012 */ lui $t9, %hi(gObjectRenderStackPos) # $t9, 0x8012 -/* 06958C 8006898C 8F390CE4 */ lw $t9, %lo(gObjectRenderStackPos)($t9) -/* 069590 80068990 3C0B8012 */ lui $t3, %hi(gObjectRenderStack+4) # $t3, 0x8012 -/* 069594 80068994 00195100 */ sll $t2, $t9, 4 -/* 069598 80068998 01595021 */ addu $t2, $t2, $t9 -/* 06959C 8006899C 000A5080 */ sll $t2, $t2, 2 -/* 0695A0 800689A0 016A5821 */ addu $t3, $t3, $t2 -/* 0695A4 800689A4 856B0AC4 */ lh $t3, %lo(gObjectRenderStack+4)($t3) -/* 0695A8 800689A8 860C0004 */ lh $t4, 4($s0) -/* 0695AC 800689AC 00000000 */ nop -/* 0695B0 800689B0 016C6821 */ addu $t5, $t3, $t4 -/* 0695B4 800689B4 1000000D */ b .L800689EC -/* 0695B8 800689B8 AFAD0034 */ sw $t5, 0x34($sp) -.L800689BC: -/* 0695BC 800689BC 3C0E8012 */ lui $t6, %hi(gObjectRenderStackPos) # $t6, 0x8012 -/* 0695C0 800689C0 8DCE0CE4 */ lw $t6, %lo(gObjectRenderStackPos)($t6) -/* 0695C4 800689C4 3C0F8012 */ lui $t7, %hi(gObjectRenderStack+276) # $t7, 0x8012 -/* 0695C8 800689C8 000EC100 */ sll $t8, $t6, 4 -/* 0695CC 800689CC 030EC021 */ addu $t8, $t8, $t6 -/* 0695D0 800689D0 0018C080 */ sll $t8, $t8, 2 -/* 0695D4 800689D4 01F87821 */ addu $t7, $t7, $t8 -/* 0695D8 800689D8 85EF0BD4 */ lh $t7, %lo(gObjectRenderStack+276)($t7) -/* 0695DC 800689DC 86190004 */ lh $t9, 4($s0) -/* 0695E0 800689E0 00000000 */ nop -/* 0695E4 800689E4 01F95021 */ addu $t2, $t7, $t9 -/* 0695E8 800689E8 AFAA0034 */ sw $t2, 0x34($sp) -.L800689EC: -/* 0695EC 800689EC 8D0B0000 */ lw $t3, ($t0) -/* 0695F0 800689F0 86120018 */ lh $s2, 0x18($s0) -/* 0695F4 800689F4 256C0001 */ addiu $t4, $t3, 1 -/* 0695F8 800689F8 AD0C0000 */ sw $t4, ($t0) -/* 0695FC 800689FC 000C7080 */ sll $t6, $t4, 2 -/* 069600 80068A00 008E2021 */ addu $a0, $a0, $t6 -/* 069604 80068A04 8C840D70 */ lw $a0, %lo(D_80120D70)($a0) -/* 069608 80068A08 8CE76174 */ lw $a3, %lo(gVideoAspectRatio)($a3) -/* 06960C 80068A0C 8E060008 */ lw $a2, 8($s0) -/* 069610 80068A10 8FA50034 */ lw $a1, 0x34($sp) -/* 069614 80068A14 0C01C04C */ jal func_80070130 -/* 069618 80068A18 00000000 */ nop -/* 06961C 80068A1C 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 069620 80068A20 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 069624 80068A24 8D180000 */ lw $t8, ($t0) -/* 069628 80068A28 8FB90064 */ lw $t9, 0x64($sp) -/* 06962C 80068A2C 3C048012 */ lui $a0, %hi(D_80120D70) # $a0, 0x8012 -/* 069630 80068A30 00187880 */ sll $t7, $t8, 2 -/* 069634 80068A34 008F2021 */ addu $a0, $a0, $t7 -/* 069638 80068A38 8C840D70 */ lw $a0, %lo(D_80120D70)($a0) -/* 06963C 80068A3C 8F250000 */ lw $a1, ($t9) -/* 069640 80068A40 0C01BE1C */ jal func_8006F870 -/* 069644 80068A44 00000000 */ nop -/* 069648 80068A48 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 06964C 80068A4C 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 069650 80068A50 8FA50064 */ lw $a1, 0x64($sp) -/* 069654 80068A54 8D0B0000 */ lw $t3, ($t0) -/* 069658 80068A58 8CAA0000 */ lw $t2, ($a1) -/* 06965C 80068A5C 3C018012 */ lui $at, %hi(D_80120D88) # $at, 0x8012 -/* 069660 80068A60 000B6080 */ sll $t4, $t3, 2 -/* 069664 80068A64 002C0821 */ addu $at, $at, $t4 -/* 069668 80068A68 AC2A0D88 */ sw $t2, %lo(D_80120D88)($at) -/* 06966C 80068A6C 8E230000 */ lw $v1, ($s1) -/* 069670 80068A70 3C0E0180 */ lui $t6, (0x01800040 >> 16) # lui $t6, 0x180 -/* 069674 80068A74 246D0008 */ addiu $t5, $v1, 8 -/* 069678 80068A78 AE2D0000 */ sw $t5, ($s1) -/* 06967C 80068A7C 35CE0040 */ ori $t6, (0x01800040 & 0xFFFF) # ori $t6, $t6, 0x40 -/* 069680 80068A80 AC6E0000 */ sw $t6, ($v1) -/* 069684 80068A84 8CB80000 */ lw $t8, ($a1) -/* 069688 80068A88 3C018000 */ lui $at, 0x8000 -/* 06968C 80068A8C 03017821 */ addu $t7, $t8, $at -/* 069690 80068A90 AC6F0004 */ sw $t7, 4($v1) -/* 069694 80068A94 8CB90000 */ lw $t9, ($a1) -/* 069698 80068A98 3C0CBC00 */ lui $t4, (0xBC000002 >> 16) # lui $t4, 0xbc00 -/* 06969C 80068A9C 272B0040 */ addiu $t3, $t9, 0x40 -/* 0696A0 80068AA0 ACAB0000 */ sw $t3, ($a1) -/* 0696A4 80068AA4 8E230000 */ lw $v1, ($s1) -/* 0696A8 80068AA8 358C0002 */ ori $t4, (0xBC000002 & 0xFFFF) # ori $t4, $t4, 2 -/* 0696AC 80068AAC 246A0008 */ addiu $t2, $v1, 8 -/* 0696B0 80068AB0 AE2A0000 */ sw $t2, ($s1) -/* 0696B4 80068AB4 240D0001 */ li $t5, 1 -/* 0696B8 80068AB8 AC6D0004 */ sw $t5, 4($v1) -/* 0696BC 80068ABC AC6C0000 */ sw $t4, ($v1) -.L80068AC0: -/* 0696C0 80068AC0 3C0E8012 */ lui $t6, %hi(D_80120D0C) # $t6, 0x8012 -/* 0696C4 80068AC4 8DCE0D0C */ lw $t6, %lo(D_80120D0C)($t6) -/* 0696C8 80068AC8 8FA20074 */ lw $v0, 0x74($sp) -/* 0696CC 80068ACC 15C00009 */ bnez $t6, .L80068AF4 -/* 0696D0 80068AD0 2401FFFE */ li $at, -2 -/* 0696D4 80068AD4 8FB00070 */ lw $s0, 0x70($sp) -/* 0696D8 80068AD8 325800FF */ andi $t8, $s2, 0xff -/* 0696DC 80068ADC 860F0000 */ lh $t7, ($s0) -/* 0696E0 80068AE0 00000000 */ nop -/* 0696E4 80068AE4 030F0019 */ multu $t8, $t7 -/* 0696E8 80068AE8 00009012 */ mflo $s2 -/* 0696EC 80068AEC 0012CA03 */ sra $t9, $s2, 8 -/* 0696F0 80068AF0 03209025 */ move $s2, $t9 -.L80068AF4: -/* 0696F4 80068AF4 00415824 */ and $t3, $v0, $at -/* 0696F8 80068AF8 8FB00070 */ lw $s0, 0x70($sp) -/* 0696FC 80068AFC 316A0004 */ andi $t2, $t3, 4 -/* 069700 80068B00 11400002 */ beqz $t2, .L80068B0C -/* 069704 80068B04 01601025 */ move $v0, $t3 -/* 069708 80068B08 35620001 */ ori $v0, $t3, 1 -.L80068B0C: -/* 06970C 80068B0C 860D0006 */ lh $t5, 6($s0) -/* 069710 80068B10 304E000F */ andi $t6, $v0, 0xf -/* 069714 80068B14 AFA20074 */ sw $v0, 0x74($sp) -/* 069718 80068B18 02202025 */ move $a0, $s1 -/* 06971C 80068B1C 0C01EFCD */ jal func_8007BF34 -/* 069720 80068B20 01AE2825 */ or $a1, $t5, $t6 -/* 069724 80068B24 8FB80074 */ lw $t8, 0x74($sp) -/* 069728 80068B28 3C088012 */ lui $t0, %hi(D_80120D1C) # $t0, 0x8012 -/* 06972C 80068B2C 330F0100 */ andi $t7, $t8, 0x100 -/* 069730 80068B30 15E00008 */ bnez $t7, .L80068B54 -/* 069734 80068B34 25080D1C */ addiu $t0, %lo(D_80120D1C) # addiu $t0, $t0, 0xd1c -/* 069738 80068B38 8E230000 */ lw $v1, ($s1) -/* 06973C 80068B3C 3C0BFA00 */ lui $t3, 0xfa00 -/* 069740 80068B40 24790008 */ addiu $t9, $v1, 8 -/* 069744 80068B44 AE390000 */ sw $t9, ($s1) -/* 069748 80068B48 240AFFFF */ li $t2, -1 -/* 06974C 80068B4C AC6A0004 */ sw $t2, 4($v1) -/* 069750 80068B50 AC6B0000 */ sw $t3, ($v1) -.L80068B54: -/* 069754 80068B54 8E230000 */ lw $v1, ($s1) -/* 069758 80068B58 3C0D0600 */ lui $t5, 0x600 -/* 06975C 80068B5C 246C0008 */ addiu $t4, $v1, 8 -/* 069760 80068B60 AE2C0000 */ sw $t4, ($s1) -/* 069764 80068B64 00127080 */ sll $t6, $s2, 2 -/* 069768 80068B68 020EC021 */ addu $t8, $s0, $t6 -/* 06976C 80068B6C AC6D0000 */ sw $t5, ($v1) -/* 069770 80068B70 8F0F000C */ lw $t7, 0xc($t8) -/* 069774 80068B74 3C0DBC00 */ lui $t5, (0xBC00000A >> 16) # lui $t5, 0xbc00 -/* 069778 80068B78 AC6F0004 */ sw $t7, 4($v1) -/* 06977C 80068B7C 8D190000 */ lw $t9, ($t0) -/* 069780 80068B80 35AD000A */ ori $t5, (0xBC00000A & 0xFFFF) # ori $t5, $t5, 0xa -/* 069784 80068B84 272BFFFF */ addiu $t3, $t9, -1 -/* 069788 80068B88 15600003 */ bnez $t3, .L80068B98 -/* 06978C 80068B8C AD0B0000 */ sw $t3, ($t0) -/* 069790 80068B90 10000002 */ b .L80068B9C -/* 069794 80068B94 00009025 */ move $s2, $zero -.L80068B98: -/* 069798 80068B98 24120001 */ li $s2, 1 -.L80068B9C: -/* 06979C 80068B9C 8E230000 */ lw $v1, ($s1) -/* 0697A0 80068BA0 00127180 */ sll $t6, $s2, 6 -/* 0697A4 80068BA4 246C0008 */ addiu $t4, $v1, 8 -/* 0697A8 80068BA8 AE2C0000 */ sw $t4, ($s1) -/* 0697AC 80068BAC AC6E0004 */ sw $t6, 4($v1) -/* 0697B0 80068BB0 AC6D0000 */ sw $t5, ($v1) -/* 0697B4 80068BB4 8E230000 */ lw $v1, ($s1) -/* 0697B8 80068BB8 3C0FBC00 */ lui $t7, (0xBC000002 >> 16) # lui $t7, 0xbc00 -/* 0697BC 80068BBC 24780008 */ addiu $t8, $v1, 8 -/* 0697C0 80068BC0 AE380000 */ sw $t8, ($s1) -/* 0697C4 80068BC4 35EF0002 */ ori $t7, (0xBC000002 & 0xFFFF) # ori $t7, $t7, 2 -/* 0697C8 80068BC8 AC6F0000 */ sw $t7, ($v1) -/* 0697CC 80068BCC AC600004 */ sw $zero, 4($v1) -/* 0697D0 80068BD0 8FBF002C */ lw $ra, 0x2c($sp) -/* 0697D4 80068BD4 8FB20028 */ lw $s2, 0x28($sp) -/* 0697D8 80068BD8 8FB10024 */ lw $s1, 0x24($sp) -/* 0697DC 80068BDC 8FB00020 */ lw $s0, 0x20($sp) -/* 0697E0 80068BE0 C7B4001C */ lwc1 $f20, 0x1c($sp) -/* 0697E4 80068BE4 C7B50018 */ lwc1 $f21, 0x18($sp) -/* 0697E8 80068BE8 8FA20030 */ lw $v0, 0x30($sp) -/* 0697EC 80068BEC 03E00008 */ jr $ra -/* 0697F0 80068BF0 27BD0060 */ addiu $sp, $sp, 0x60 - diff --git a/asm/non_matchings/game_ui/func_800A7A60.s b/asm/non_matchings/game_ui/func_800A7A60.s index 88e9e73f..331ee232 100644 --- a/asm/non_matchings/game_ui/func_800A7A60.s +++ b/asm/non_matchings/game_ui/func_800A7A60.s @@ -59,7 +59,7 @@ glabel func_800A7A60 /* 0A8744 800A7B44 24C66D04 */ addiu $a2, %lo(gHUDCurrTriList) # addiu $a2, $a2, 0x6d04 /* 0A8748 800A7B48 24A56D00 */ addiu $a1, %lo(gHUDCurrMatrix) # addiu $a1, $a1, 0x6d00 /* 0A874C 800A7B4C 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc -/* 0A8750 800A7B50 0C01A145 */ jal func_80068514 +/* 0A8750 800A7B50 0C01A145 */ jal render_sprite_billboard /* 0A8754 800A7B54 AFA20010 */ sw $v0, 0x10($sp) .L800A7B58: /* 0A8758 800A7B58 8FBF001C */ lw $ra, 0x1c($sp) diff --git a/asm/non_matchings/game_ui/func_800AAFD0.s b/asm/non_matchings/game_ui/func_800AAFD0.s deleted file mode 100644 index ed78c4b7..00000000 --- a/asm/non_matchings/game_ui/func_800AAFD0.s +++ /dev/null @@ -1,121 +0,0 @@ -glabel func_800AAFD0 -/* 0ABBD0 800AAFD0 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0ABBD4 800AAFD4 AFBF003C */ sw $ra, 0x3c($sp) -/* 0ABBD8 800AAFD8 AFBE0038 */ sw $fp, 0x38($sp) -/* 0ABBDC 800AAFDC AFB70034 */ sw $s7, 0x34($sp) -/* 0ABBE0 800AAFE0 AFB60030 */ sw $s6, 0x30($sp) -/* 0ABBE4 800AAFE4 AFB5002C */ sw $s5, 0x2c($sp) -/* 0ABBE8 800AAFE8 AFB40028 */ sw $s4, 0x28($sp) -/* 0ABBEC 800AAFEC AFB30024 */ sw $s3, 0x24($sp) -/* 0ABBF0 800AAFF0 AFB20020 */ sw $s2, 0x20($sp) -/* 0ABBF4 800AAFF4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0ABBF8 800AAFF8 AFB00018 */ sw $s0, 0x18($sp) -/* 0ABBFC 800AAFFC 84850028 */ lh $a1, 0x28($a0) -/* 0ABC00 800AB000 00809825 */ move $s3, $a0 -/* 0ABC04 800AB004 18A00057 */ blez $a1, .L800AB164 -/* 0ABC08 800AB008 0000B825 */ move $s7, $zero -/* 0ABC0C 800AB00C 3C128012 */ lui $s2, %hi(gHUDCurrDisplayList) # $s2, 0x8012 -/* 0ABC10 800AB010 26526CFC */ addiu $s2, %lo(gHUDCurrDisplayList) # addiu $s2, $s2, 0x6cfc -/* 0ABC14 800AB014 0000F025 */ move $fp, $zero -.L800AB018: -/* 0ABC18 800AB018 8E6E0038 */ lw $t6, 0x38($s3) -/* 0ABC1C 800AB01C 24160001 */ li $s6, 1 -/* 0ABC20 800AB020 01DE1021 */ addu $v0, $t6, $fp -/* 0ABC24 800AB024 8C470008 */ lw $a3, 8($v0) -/* 0ABC28 800AB028 240100FF */ li $at, 255 -/* 0ABC2C 800AB02C 30EF0100 */ andi $t7, $a3, 0x100 -/* 0ABC30 800AB030 15E00048 */ bnez $t7, .L800AB154 -/* 0ABC34 800AB034 00000000 */ nop -/* 0ABC38 800AB038 84430002 */ lh $v1, 2($v0) -/* 0ABC3C 800AB03C 84440004 */ lh $a0, 4($v0) -/* 0ABC40 800AB040 00035880 */ sll $t3, $v1, 2 -/* 0ABC44 800AB044 8458000E */ lh $t8, 0xe($v0) -/* 0ABC48 800AB048 84590010 */ lh $t9, 0x10($v0) -/* 0ABC4C 800AB04C 8E6A0004 */ lw $t2, 4($s3) -/* 0ABC50 800AB050 8E6C0008 */ lw $t4, 8($s3) -/* 0ABC54 800AB054 90450000 */ lbu $a1, ($v0) -/* 0ABC58 800AB058 01635821 */ addu $t3, $t3, $v1 -/* 0ABC5C 800AB05C 000B5840 */ sll $t3, $t3, 1 -/* 0ABC60 800AB060 00046900 */ sll $t5, $a0, 4 -/* 0ABC64 800AB064 03038023 */ subu $s0, $t8, $v1 -/* 0ABC68 800AB068 0324A023 */ subu $s4, $t9, $a0 -/* 0ABC6C 800AB06C 014BA821 */ addu $s5, $t2, $t3 -/* 0ABC70 800AB070 14A10003 */ bne $a1, $at, .L800AB080 -/* 0ABC74 800AB074 018D4021 */ addu $t0, $t4, $t5 -/* 0ABC78 800AB078 10000006 */ b .L800AB094 -/* 0ABC7C 800AB07C 00008825 */ move $s1, $zero -.L800AB080: -/* 0ABC80 800AB080 8E6E0000 */ lw $t6, ($s3) -/* 0ABC84 800AB084 000578C0 */ sll $t7, $a1, 3 -/* 0ABC88 800AB088 01CFC021 */ addu $t8, $t6, $t7 -/* 0ABC8C 800AB08C 8F110000 */ lw $s1, ($t8) -/* 0ABC90 800AB090 00000000 */ nop -.L800AB094: -/* 0ABC94 800AB094 2401FFFD */ li $at, -3 -/* 0ABC98 800AB098 00E13024 */ and $a2, $a3, $at -/* 0ABC9C 800AB09C 02402025 */ move $a0, $s2 -/* 0ABCA0 800AB0A0 02202825 */ move $a1, $s1 -/* 0ABCA4 800AB0A4 0C01ED32 */ jal func_8007B4C8 -/* 0ABCA8 800AB0A8 AFA80044 */ sw $t0, 0x44($sp) -/* 0ABCAC 800AB0AC 8E430000 */ lw $v1, ($s2) -/* 0ABCB0 800AB0B0 3C098000 */ lui $t1, 0x8000 -/* 0ABCB4 800AB0B4 02A92021 */ addu $a0, $s5, $t1 -/* 0ABCB8 800AB0B8 260AFFFF */ addiu $t2, $s0, -1 -/* 0ABCBC 800AB0BC 24790008 */ addiu $t9, $v1, 8 -/* 0ABCC0 800AB0C0 AE590000 */ sw $t9, ($s2) -/* 0ABCC4 800AB0C4 000A58C0 */ sll $t3, $t2, 3 -/* 0ABCC8 800AB0C8 308C0006 */ andi $t4, $a0, 6 -/* 0ABCCC 800AB0CC 016C6825 */ or $t5, $t3, $t4 -/* 0ABCD0 800AB0D0 0010C8C0 */ sll $t9, $s0, 3 -/* 0ABCD4 800AB0D4 03305021 */ addu $t2, $t9, $s0 -/* 0ABCD8 800AB0D8 000A5840 */ sll $t3, $t2, 1 -/* 0ABCDC 800AB0DC 31AE00FF */ andi $t6, $t5, 0xff -/* 0ABCE0 800AB0E0 000E7C00 */ sll $t7, $t6, 0x10 -/* 0ABCE4 800AB0E4 256C0008 */ addiu $t4, $t3, 8 -/* 0ABCE8 800AB0E8 3C010400 */ lui $at, 0x400 -/* 0ABCEC 800AB0EC 8FA80044 */ lw $t0, 0x44($sp) -/* 0ABCF0 800AB0F0 01E1C025 */ or $t8, $t7, $at -/* 0ABCF4 800AB0F4 318DFFFF */ andi $t5, $t4, 0xffff -/* 0ABCF8 800AB0F8 030D7025 */ or $t6, $t8, $t5 -/* 0ABCFC 800AB0FC AC6E0000 */ sw $t6, ($v1) -/* 0ABD00 800AB100 16200002 */ bnez $s1, .L800AB10C -/* 0ABD04 800AB104 AC640004 */ sw $a0, 4($v1) -/* 0ABD08 800AB108 0000B025 */ move $s6, $zero -.L800AB10C: -/* 0ABD0C 800AB10C 2699FFFF */ addiu $t9, $s4, -1 -/* 0ABD10 800AB110 8E430000 */ lw $v1, ($s2) -/* 0ABD14 800AB114 00195100 */ sll $t2, $t9, 4 -/* 0ABD18 800AB118 01565825 */ or $t3, $t2, $s6 -/* 0ABD1C 800AB11C 316C00FF */ andi $t4, $t3, 0xff -/* 0ABD20 800AB120 246F0008 */ addiu $t7, $v1, 8 -/* 0ABD24 800AB124 AE4F0000 */ sw $t7, ($s2) -/* 0ABD28 800AB128 000CC400 */ sll $t8, $t4, 0x10 -/* 0ABD2C 800AB12C 3C010500 */ lui $at, 0x500 -/* 0ABD30 800AB130 00147100 */ sll $t6, $s4, 4 -/* 0ABD34 800AB134 31CFFFFF */ andi $t7, $t6, 0xffff -/* 0ABD38 800AB138 03016825 */ or $t5, $t8, $at -/* 0ABD3C 800AB13C 01AFC825 */ or $t9, $t5, $t7 -/* 0ABD40 800AB140 01095021 */ addu $t2, $t0, $t1 -/* 0ABD44 800AB144 AC6A0004 */ sw $t2, 4($v1) -/* 0ABD48 800AB148 AC790000 */ sw $t9, ($v1) -/* 0ABD4C 800AB14C 86650028 */ lh $a1, 0x28($s3) -/* 0ABD50 800AB150 00000000 */ nop -.L800AB154: -/* 0ABD54 800AB154 26F70001 */ addiu $s7, $s7, 1 -/* 0ABD58 800AB158 02E5082A */ slt $at, $s7, $a1 -/* 0ABD5C 800AB15C 1420FFAE */ bnez $at, .L800AB018 -/* 0ABD60 800AB160 27DE000C */ addiu $fp, $fp, 0xc -.L800AB164: -/* 0ABD64 800AB164 8FBF003C */ lw $ra, 0x3c($sp) -/* 0ABD68 800AB168 8FB00018 */ lw $s0, 0x18($sp) -/* 0ABD6C 800AB16C 8FB1001C */ lw $s1, 0x1c($sp) -/* 0ABD70 800AB170 8FB20020 */ lw $s2, 0x20($sp) -/* 0ABD74 800AB174 8FB30024 */ lw $s3, 0x24($sp) -/* 0ABD78 800AB178 8FB40028 */ lw $s4, 0x28($sp) -/* 0ABD7C 800AB17C 8FB5002C */ lw $s5, 0x2c($sp) -/* 0ABD80 800AB180 8FB60030 */ lw $s6, 0x30($sp) -/* 0ABD84 800AB184 8FB70034 */ lw $s7, 0x34($sp) -/* 0ABD88 800AB188 8FBE0038 */ lw $fp, 0x38($sp) -/* 0ABD8C 800AB18C 03E00008 */ jr $ra -/* 0ABD90 800AB190 27BD0068 */ addiu $sp, $sp, 0x68 - diff --git a/asm/non_matchings/game_ui/func_800AC5A4.s b/asm/non_matchings/game_ui/func_800AC5A4.s deleted file mode 100644 index ca6cc55c..00000000 --- a/asm/non_matchings/game_ui/func_800AC5A4.s +++ /dev/null @@ -1,191 +0,0 @@ -glabel func_800AC5A4 -/* 0AD1A4 800AC5A4 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0AD1A8 800AC5A8 AFB10018 */ sw $s1, 0x18($sp) -/* 0AD1AC 800AC5AC 3C11800E */ lui $s1, %hi(D_800E28D8) # $s1, 0x800e -/* 0AD1B0 800AC5B0 263128D8 */ addiu $s1, %lo(D_800E28D8) # addiu $s1, $s1, 0x28d8 -/* 0AD1B4 800AC5B4 8E2E0008 */ lw $t6, 8($s1) -/* 0AD1B8 800AC5B8 AFBF002C */ sw $ra, 0x2c($sp) -/* 0AD1BC 800AC5BC AFB50028 */ sw $s5, 0x28($sp) -/* 0AD1C0 800AC5C0 AFB40024 */ sw $s4, 0x24($sp) -/* 0AD1C4 800AC5C4 AFB30020 */ sw $s3, 0x20($sp) -/* 0AD1C8 800AC5C8 AFB2001C */ sw $s2, 0x1c($sp) -/* 0AD1CC 800AC5CC 11C00097 */ beqz $t6, .L800AC82C -/* 0AD1D0 800AC5D0 AFB00014 */ sw $s0, 0x14($sp) -/* 0AD1D4 800AC5D4 3C13800E */ lui $s3, %hi(D_800E2908) # $s3, 0x800e -/* 0AD1D8 800AC5D8 26732908 */ addiu $s3, %lo(D_800E2908) # addiu $s3, $s3, 0x2908 -/* 0AD1DC 800AC5DC 8E790000 */ lw $t9, ($s3) -/* 0AD1E0 800AC5E0 3C148012 */ lui $s4, %hi(D_80127C00) # $s4, 0x8012 -/* 0AD1E4 800AC5E4 3C158012 */ lui $s5, %hi(D_80127C04) # $s5, 0x8012 -/* 0AD1E8 800AC5E8 26B57C04 */ addiu $s5, %lo(D_80127C04) # addiu $s5, $s5, 0x7c04 -/* 0AD1EC 800AC5EC 26947C00 */ addiu $s4, %lo(D_80127C00) # addiu $s4, $s4, 0x7c00 -/* 0AD1F0 800AC5F0 240F0004 */ li $t7, 4 -/* 0AD1F4 800AC5F4 24180002 */ li $t8, 2 -/* 0AD1F8 800AC5F8 2B210004 */ slti $at, $t9, 4 -/* 0AD1FC 800AC5FC AE8F0000 */ sw $t7, ($s4) -/* 0AD200 800AC600 1420008A */ bnez $at, .L800AC82C -/* 0AD204 800AC604 AEB80000 */ sw $t8, ($s5) -/* 0AD208 800AC608 0C01A76C */ jal func_80069DB0 -/* 0AD20C 800AC60C AFA00034 */ sw $zero, 0x34($sp) -/* 0AD210 800AC610 3C108012 */ lui $s0, %hi(gWeatherDisplayListHead) # $s0, 0x8012 -/* 0AD214 800AC614 26107C0C */ addiu $s0, %lo(gWeatherDisplayListHead) # addiu $s0, $s0, 0x7c0c -/* 0AD218 800AC618 8E030000 */ lw $v1, ($s0) -/* 0AD21C 800AC61C 3C0B8000 */ lui $t3, 0x8000 -/* 0AD220 800AC620 246E0008 */ addiu $t6, $v1, 8 -/* 0AD224 800AC624 AE0E0000 */ sw $t6, ($s0) -/* 0AD228 800AC628 3C0F0100 */ lui $t7, (0x01000040 >> 16) # lui $t7, 0x100 -/* 0AD22C 800AC62C 35EF0040 */ ori $t7, (0x01000040 & 0xFFFF) # ori $t7, $t7, 0x40 -/* 0AD230 800AC630 004BC021 */ addu $t8, $v0, $t3 -/* 0AD234 800AC634 AC780004 */ sw $t8, 4($v1) -/* 0AD238 800AC638 AC6F0000 */ sw $t7, ($v1) -/* 0AD23C 800AC63C 8E030000 */ lw $v1, ($s0) -/* 0AD240 800AC640 3C0EBC00 */ lui $t6, (0xBC00000A >> 16) # lui $t6, 0xbc00 -/* 0AD244 800AC644 24790008 */ addiu $t9, $v1, 8 -/* 0AD248 800AC648 AE190000 */ sw $t9, ($s0) -/* 0AD24C 800AC64C 35CE000A */ ori $t6, (0xBC00000A & 0xFFFF) # ori $t6, $t6, 0xa -/* 0AD250 800AC650 AC6E0000 */ sw $t6, ($v1) -/* 0AD254 800AC654 AC600004 */ sw $zero, 4($v1) -/* 0AD258 800AC658 8E250008 */ lw $a1, 8($s1) -/* 0AD25C 800AC65C 02002025 */ move $a0, $s0 -/* 0AD260 800AC660 0C01ED32 */ jal func_8007B4C8 -/* 0AD264 800AC664 24060002 */ li $a2, 2 -/* 0AD268 800AC668 8E820000 */ lw $v0, ($s4) -/* 0AD26C 800AC66C 8E690000 */ lw $t1, ($s3) -/* 0AD270 800AC670 8FA80034 */ lw $t0, 0x34($sp) -/* 0AD274 800AC674 0049082A */ slt $at, $v0, $t1 -/* 0AD278 800AC678 10200038 */ beqz $at, .L800AC75C -/* 0AD27C 800AC67C 3C0B8000 */ lui $t3, 0x8000 -/* 0AD280 800AC680 3C12800E */ lui $s2, %hi(D_800E290C) # $s2, 0x800e -/* 0AD284 800AC684 3C0D800E */ lui $t5, %hi(D_800E2904) # $t5, 0x800e -/* 0AD288 800AC688 25AD2904 */ addiu $t5, %lo(D_800E2904) # addiu $t5, $t5, 0x2904 -/* 0AD28C 800AC68C 2652290C */ addiu $s2, %lo(D_800E290C) # addiu $s2, $s2, 0x290c -/* 0AD290 800AC690 3C110500 */ lui $s1, 0x500 -/* 0AD294 800AC694 3C1F0400 */ lui $ra, 0x400 -/* 0AD298 800AC698 240C000A */ li $t4, 10 -.L800AC69C: -/* 0AD29C 800AC69C 010C0019 */ multu $t0, $t4 -/* 0AD2A0 800AC6A0 8DB80000 */ lw $t8, ($t5) -/* 0AD2A4 800AC6A4 8E030000 */ lw $v1, ($s0) -/* 0AD2A8 800AC6A8 244EFFFF */ addiu $t6, $v0, -1 -/* 0AD2AC 800AC6AC 24790008 */ addiu $t9, $v1, 8 -/* 0AD2B0 800AC6B0 AE190000 */ sw $t9, ($s0) -/* 0AD2B4 800AC6B4 00007812 */ mflo $t7 -/* 0AD2B8 800AC6B8 01F85021 */ addu $t2, $t7, $t8 -/* 0AD2BC 800AC6BC 014B3821 */ addu $a3, $t2, $t3 -/* 0AD2C0 800AC6C0 30F80006 */ andi $t8, $a3, 6 -/* 0AD2C4 800AC6C4 000E78C0 */ sll $t7, $t6, 3 -/* 0AD2C8 800AC6C8 01F8C825 */ or $t9, $t7, $t8 -/* 0AD2CC 800AC6CC 332E00FF */ andi $t6, $t9, 0xff -/* 0AD2D0 800AC6D0 000E7C00 */ sll $t7, $t6, 0x10 -/* 0AD2D4 800AC6D4 0002C8C0 */ sll $t9, $v0, 3 -/* 0AD2D8 800AC6D8 03227021 */ addu $t6, $t9, $v0 -/* 0AD2DC 800AC6DC 01FFC025 */ or $t8, $t7, $ra -/* 0AD2E0 800AC6E0 000E7840 */ sll $t7, $t6, 1 -/* 0AD2E4 800AC6E4 25F90008 */ addiu $t9, $t7, 8 -/* 0AD2E8 800AC6E8 332EFFFF */ andi $t6, $t9, 0xffff -/* 0AD2EC 800AC6EC 030E7825 */ or $t7, $t8, $t6 -/* 0AD2F0 800AC6F0 AC6F0000 */ sw $t7, ($v1) -/* 0AD2F4 800AC6F4 AC670004 */ sw $a3, 4($v1) -/* 0AD2F8 800AC6F8 8EA60000 */ lw $a2, ($s5) -/* 0AD2FC 800AC6FC 8E030000 */ lw $v1, ($s0) -/* 0AD300 800AC700 24D8FFFF */ addiu $t8, $a2, -1 -/* 0AD304 800AC704 00187100 */ sll $t6, $t8, 4 -/* 0AD308 800AC708 24790008 */ addiu $t9, $v1, 8 -/* 0AD30C 800AC70C AE190000 */ sw $t9, ($s0) -/* 0AD310 800AC710 35CF0001 */ ori $t7, $t6, 1 -/* 0AD314 800AC714 31F900FF */ andi $t9, $t7, 0xff -/* 0AD318 800AC718 0019C400 */ sll $t8, $t9, 0x10 -/* 0AD31C 800AC71C 00067900 */ sll $t7, $a2, 4 -/* 0AD320 800AC720 31F9FFFF */ andi $t9, $t7, 0xffff -/* 0AD324 800AC724 03117025 */ or $t6, $t8, $s1 -/* 0AD328 800AC728 01D9C025 */ or $t8, $t6, $t9 -/* 0AD32C 800AC72C AC780000 */ sw $t8, ($v1) -/* 0AD330 800AC730 8E4F0000 */ lw $t7, ($s2) -/* 0AD334 800AC734 00000000 */ nop -/* 0AD338 800AC738 01EB7021 */ addu $t6, $t7, $t3 -/* 0AD33C 800AC73C AC6E0004 */ sw $t6, 4($v1) -/* 0AD340 800AC740 8E820000 */ lw $v0, ($s4) -/* 0AD344 800AC744 8E690000 */ lw $t1, ($s3) -/* 0AD348 800AC748 01024021 */ addu $t0, $t0, $v0 -/* 0AD34C 800AC74C 0102C821 */ addu $t9, $t0, $v0 -/* 0AD350 800AC750 0329082A */ slt $at, $t9, $t1 -/* 0AD354 800AC754 1420FFD1 */ bnez $at, .L800AC69C -/* 0AD358 800AC758 00000000 */ nop -.L800AC75C: -/* 0AD35C 800AC75C 240C000A */ li $t4, 10 -/* 0AD360 800AC760 010C0019 */ multu $t0, $t4 -/* 0AD364 800AC764 3C0D800E */ lui $t5, %hi(D_800E2904) # $t5, 0x800e -/* 0AD368 800AC768 25AD2904 */ addiu $t5, %lo(D_800E2904) # addiu $t5, $t5, 0x2904 -/* 0AD36C 800AC76C 8DAF0000 */ lw $t7, ($t5) -/* 0AD370 800AC770 8E030000 */ lw $v1, ($s0) -/* 0AD374 800AC774 01281023 */ subu $v0, $t1, $t0 -/* 0AD378 800AC778 2459FFFF */ addiu $t9, $v0, -1 -/* 0AD37C 800AC77C 246E0008 */ addiu $t6, $v1, 8 -/* 0AD380 800AC780 AE0E0000 */ sw $t6, ($s0) -/* 0AD384 800AC784 3C1F0400 */ lui $ra, 0x400 -/* 0AD388 800AC788 3C110500 */ lui $s1, 0x500 -/* 0AD38C 800AC78C 3C12800E */ lui $s2, %hi(D_800E290C) # $s2, 0x800e -/* 0AD390 800AC790 0000C012 */ mflo $t8 -/* 0AD394 800AC794 030F5021 */ addu $t2, $t8, $t7 -/* 0AD398 800AC798 014B3821 */ addu $a3, $t2, $t3 -/* 0AD39C 800AC79C 30EF0006 */ andi $t7, $a3, 6 -/* 0AD3A0 800AC7A0 0019C0C0 */ sll $t8, $t9, 3 -/* 0AD3A4 800AC7A4 030F7025 */ or $t6, $t8, $t7 -/* 0AD3A8 800AC7A8 31D900FF */ andi $t9, $t6, 0xff -/* 0AD3AC 800AC7AC 0019C400 */ sll $t8, $t9, 0x10 -/* 0AD3B0 800AC7B0 000270C0 */ sll $t6, $v0, 3 -/* 0AD3B4 800AC7B4 01C2C821 */ addu $t9, $t6, $v0 -/* 0AD3B8 800AC7B8 031F7825 */ or $t7, $t8, $ra -/* 0AD3BC 800AC7BC 0019C040 */ sll $t8, $t9, 1 -/* 0AD3C0 800AC7C0 270E0008 */ addiu $t6, $t8, 8 -/* 0AD3C4 800AC7C4 31D9FFFF */ andi $t9, $t6, 0xffff -/* 0AD3C8 800AC7C8 01F9C025 */ or $t8, $t7, $t9 -/* 0AD3CC 800AC7CC AC780000 */ sw $t8, ($v1) -/* 0AD3D0 800AC7D0 AC670004 */ sw $a3, 4($v1) -/* 0AD3D4 800AC7D4 8E6F0000 */ lw $t7, ($s3) -/* 0AD3D8 800AC7D8 8E030000 */ lw $v1, ($s0) -/* 0AD3DC 800AC7DC 01E83023 */ subu $a2, $t7, $t0 -/* 0AD3E0 800AC7E0 0006C843 */ sra $t9, $a2, 1 -/* 0AD3E4 800AC7E4 246E0008 */ addiu $t6, $v1, 8 -/* 0AD3E8 800AC7E8 AE0E0000 */ sw $t6, ($s0) -/* 0AD3EC 800AC7EC 2738FFFF */ addiu $t8, $t9, -1 -/* 0AD3F0 800AC7F0 00187100 */ sll $t6, $t8, 4 -/* 0AD3F4 800AC7F4 35CF0001 */ ori $t7, $t6, 1 -/* 0AD3F8 800AC7F8 03203025 */ move $a2, $t9 -/* 0AD3FC 800AC7FC 31F900FF */ andi $t9, $t7, 0xff -/* 0AD400 800AC800 0019C400 */ sll $t8, $t9, 0x10 -/* 0AD404 800AC804 00067900 */ sll $t7, $a2, 4 -/* 0AD408 800AC808 31F9FFFF */ andi $t9, $t7, 0xffff -/* 0AD40C 800AC80C 03117025 */ or $t6, $t8, $s1 -/* 0AD410 800AC810 01D9C025 */ or $t8, $t6, $t9 -/* 0AD414 800AC814 2652290C */ addiu $s2, %lo(D_800E290C) # addiu $s2, $s2, 0x290c -/* 0AD418 800AC818 AC780000 */ sw $t8, ($v1) -/* 0AD41C 800AC81C 8E4F0000 */ lw $t7, ($s2) -/* 0AD420 800AC820 00000000 */ nop -/* 0AD424 800AC824 01EB7021 */ addu $t6, $t7, $t3 -/* 0AD428 800AC828 AC6E0004 */ sw $t6, 4($v1) -.L800AC82C: -/* 0AD42C 800AC82C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0AD430 800AC830 8FB00014 */ lw $s0, 0x14($sp) -/* 0AD434 800AC834 8FB10018 */ lw $s1, 0x18($sp) -/* 0AD438 800AC838 8FB2001C */ lw $s2, 0x1c($sp) -/* 0AD43C 800AC83C 8FB30020 */ lw $s3, 0x20($sp) -/* 0AD440 800AC840 8FB40024 */ lw $s4, 0x24($sp) -/* 0AD444 800AC844 8FB50028 */ lw $s5, 0x28($sp) -/* 0AD448 800AC848 03E00008 */ jr $ra -/* 0AD44C 800AC84C 27BD0038 */ addiu $sp, $sp, 0x38 - -/* 0AD450 800AC850 240E0001 */ li $t6, 1 -/* 0AD454 800AC854 3C01800E */ lui $at, %hi(D_800E2A84) # $at, 0x800e -/* 0AD458 800AC858 03E00008 */ jr $ra -/* 0AD45C 800AC85C AC2E2A84 */ sw $t6, %lo(D_800E2A84)($at) - -/* 0AD460 800AC860 3C0E800E */ lui $t6, %hi(D_800E2A80) # $t6, 0x800e -/* 0AD464 800AC864 8DCE2A80 */ lw $t6, %lo(D_800E2A80)($t6) -/* 0AD468 800AC868 3C01800E */ lui $at, %hi(D_800E2A84) # $at, 0x800e -/* 0AD46C 800AC86C 11C00002 */ beqz $t6, .L800AC878 -/* 0AD470 800AC870 00000000 */ nop -/* 0AD474 800AC874 AC202A84 */ sw $zero, %lo(D_800E2A84)($at) -.L800AC878: -/* 0AD478 800AC878 03E00008 */ jr $ra -/* 0AD47C 800AC87C 00000000 */ nop - diff --git a/asm/non_matchings/game_ui/func_800ACA20.s b/asm/non_matchings/game_ui/func_800ACA20.s index 7d1719bc..ad4b27a3 100644 --- a/asm/non_matchings/game_ui/func_800ACA20.s +++ b/asm/non_matchings/game_ui/func_800ACA20.s @@ -218,7 +218,7 @@ glabel func_800ACA20 /* 0AD964 800ACD64 8D6F0000 */ lw $t7, ($t3) /* 0AD968 800ACD68 24180104 */ li $t8, 260 /* 0AD96C 800ACD6C AFB80014 */ sw $t8, 0x14($sp) -/* 0AD970 800ACD70 0C01A145 */ jal func_80068514 +/* 0AD970 800ACD70 0C01A145 */ jal render_sprite_billboard /* 0AD974 800ACD74 AFAF0010 */ sw $t7, 0x10($sp) /* 0AD978 800ACD78 8E0E0010 */ lw $t6, 0x10($s0) /* 0AD97C 800ACD7C 26100010 */ addiu $s0, $s0, 0x10 diff --git a/asm/non_matchings/game_ui/render_rain_splashes.s b/asm/non_matchings/game_ui/render_rain_splashes.s index 906aeee9..0f77f939 100644 --- a/asm/non_matchings/game_ui/render_rain_splashes.s +++ b/asm/non_matchings/game_ui/render_rain_splashes.s @@ -272,7 +272,7 @@ glabel render_rain_splashes /* 0AE65C 800ADA5C 24C67C14 */ addiu $a2, %lo(D_80127C14) # addiu $a2, $a2, 0x7c14 /* 0AE660 800ADA60 24A57C10 */ addiu $a1, %lo(D_80127C10) # addiu $a1, $a1, 0x7c10 /* 0AE664 800ADA64 02003825 */ move $a3, $s0 -/* 0AE668 800ADA68 0C01A145 */ jal func_80068514 +/* 0AE668 800ADA68 0C01A145 */ jal render_sprite_billboard /* 0AE66C 800ADA6C AFAC0010 */ sw $t4, 0x10($sp) .L800ADA70: /* 0AE670 800ADA70 3C0E800E */ lui $t6, %hi(gRainGfx) # $t6, 0x800e diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s deleted file mode 100644 index 7cb229c1..00000000 --- a/asm/non_matchings/menu/func_80092E94.s +++ /dev/null @@ -1,490 +0,0 @@ -glabel func_80092E94 -/* 093A94 80092E94 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 093A98 80092E98 AFBF0034 */ sw $ra, 0x34($sp) -/* 093A9C 80092E9C AFB1002C */ sw $s1, 0x2c($sp) -/* 093AA0 80092EA0 00C08825 */ move $s1, $a2 -/* 093AA4 80092EA4 AFB20030 */ sw $s2, 0x30($sp) -/* 093AA8 80092EA8 AFB00028 */ sw $s0, 0x28($sp) -/* 093AAC 80092EAC AFA40078 */ sw $a0, 0x78($sp) -/* 093AB0 80092EB0 AFA5007C */ sw $a1, 0x7c($sp) -/* 093AB4 80092EB4 0C01BAA4 */ jal get_settings -/* 093AB8 80092EB8 AFA00054 */ sw $zero, 0x54($sp) -/* 093ABC 80092EBC 3C0E8000 */ lui $t6, %hi(osTvType) # $t6, 0x8000 -/* 093AC0 80092EC0 8DCE0300 */ lw $t6, %lo(osTvType)($t6) -/* 093AC4 80092EC4 00402025 */ move $a0, $v0 -/* 093AC8 80092EC8 15C00002 */ bnez $t6, .L80092ED4 -/* 093ACC 80092ECC 00002825 */ move $a1, $zero -/* 093AD0 80092ED0 2405000C */ li $a1, 12 -.L80092ED4: -/* 093AD4 80092ED4 3C18800E */ lui $t8, %hi(gTrackIdForPreview) # $t8, 0x800e -/* 093AD8 80092ED8 8F18F4C4 */ lw $t8, %lo(gTrackIdForPreview)($t8) -/* 093ADC 80092EDC 8C8F004C */ lw $t7, 0x4c($a0) -/* 093AE0 80092EE0 3C128012 */ lui $s2, %hi(sMenuCurrDisplayList) # $s2, 0x8012 -/* 093AE4 80092EE4 265263A0 */ addiu $s2, %lo(sMenuCurrDisplayList) # addiu $s2, $s2, 0x63a0 -/* 093AE8 80092EE8 01F8C821 */ addu $t9, $t7, $t8 -/* 093AEC 80092EEC 83280002 */ lb $t0, 2($t9) -/* 093AF0 80092EF0 8E430000 */ lw $v1, ($s2) -/* 093AF4 80092EF4 AFA80058 */ sw $t0, 0x58($sp) -/* 093AF8 80092EF8 24690008 */ addiu $t1, $v1, 8 -/* 093AFC 80092EFC AE490000 */ sw $t1, ($s2) -/* 093B00 80092F00 3C0AB600 */ lui $t2, 0xb600 -/* 093B04 80092F04 240B1000 */ li $t3, 4096 -/* 093B08 80092F08 AC6B0004 */ sw $t3, 4($v1) -/* 093B0C 80092F0C AC6A0000 */ sw $t2, ($v1) -/* 093B10 80092F10 AFA50060 */ sw $a1, 0x60($sp) -/* 093B14 80092F14 0C026F57 */ jal func_8009BD5C -/* 093B18 80092F18 AFA40050 */ sw $a0, 0x50($sp) -/* 093B1C 80092F1C 3C058012 */ lui $a1, %hi(sMenuCurrHudMat) # $a1, 0x8012 -/* 093B20 80092F20 24A563A8 */ addiu $a1, %lo(sMenuCurrHudMat) # addiu $a1, $a1, 0x63a8 -/* 093B24 80092F24 0C019FCB */ jal func_80067F2C -/* 093B28 80092F28 02402025 */ move $a0, $s2 -/* 093B2C 80092F2C 3C02800E */ lui $v0, %hi(gMenuDelay) # $v0, 0x800e -/* 093B30 80092F30 8C42F47C */ lw $v0, %lo(gMenuDelay)($v0) -/* 093B34 80092F34 00000000 */ nop -/* 093B38 80092F38 2841FFEC */ slti $at, $v0, -0x14 -/* 093B3C 80092F3C 142001AA */ bnez $at, .L800935E8 -/* 093B40 80092F40 28410015 */ slti $at, $v0, 0x15 -/* 093B44 80092F44 102001A9 */ beqz $at, .L800935EC -/* 093B48 80092F48 8FBF0034 */ lw $ra, 0x34($sp) -/* 093B4C 80092F4C 8FA40058 */ lw $a0, 0x58($sp) -/* 093B50 80092F50 0C01AC3E */ jal get_map_available_vehicles -/* 093B54 80092F54 00000000 */ nop -/* 093B58 80092F58 8FA40058 */ lw $a0, 0x58($sp) -/* 093B5C 80092F5C 0C01AF77 */ jal get_level_name -/* 093B60 80092F60 AFA2005C */ sw $v0, 0x5c($sp) -/* 093B64 80092F64 00408025 */ move $s0, $v0 -/* 093B68 80092F68 0C0310BB */ jal set_text_font -/* 093B6C 80092F6C 24040002 */ li $a0, 2 -/* 093B70 80092F70 00002025 */ move $a0, $zero -/* 093B74 80092F74 00002825 */ move $a1, $zero -/* 093B78 80092F78 00003025 */ move $a2, $zero -/* 093B7C 80092F7C 0C0310F3 */ jal set_text_background_colour -/* 093B80 80092F80 00003825 */ move $a3, $zero -/* 093B84 80092F84 240C0080 */ li $t4, 128 -/* 093B88 80092F88 AFAC0010 */ sw $t4, 0x10($sp) -/* 093B8C 80092F8C 00002025 */ move $a0, $zero -/* 093B90 80092F90 00002825 */ move $a1, $zero -/* 093B94 80092F94 00003025 */ move $a2, $zero -/* 093B98 80092F98 0C0310E1 */ jal set_text_colour -/* 093B9C 80092F9C 240700FF */ li $a3, 255 -/* 093BA0 80092FA0 240D000C */ li $t5, 12 -/* 093BA4 80092FA4 AFAD0010 */ sw $t5, 0x10($sp) -/* 093BA8 80092FA8 02402025 */ move $a0, $s2 -/* 093BAC 80092FAC 240500A1 */ li $a1, 161 -/* 093BB0 80092FB0 2406002E */ li $a2, 46 -/* 093BB4 80092FB4 0C031110 */ jal draw_text -/* 093BB8 80092FB8 02003825 */ move $a3, $s0 -/* 093BBC 80092FBC 240E00FF */ li $t6, 255 -/* 093BC0 80092FC0 AFAE0010 */ sw $t6, 0x10($sp) -/* 093BC4 80092FC4 240400FF */ li $a0, 255 -/* 093BC8 80092FC8 240500FF */ li $a1, 255 -/* 093BCC 80092FCC 240600FF */ li $a2, 255 -/* 093BD0 80092FD0 0C0310E1 */ jal set_text_colour -/* 093BD4 80092FD4 00003825 */ move $a3, $zero -/* 093BD8 80092FD8 240F000C */ li $t7, 12 -/* 093BDC 80092FDC AFAF0010 */ sw $t7, 0x10($sp) -/* 093BE0 80092FE0 02402025 */ move $a0, $s2 -/* 093BE4 80092FE4 240500A0 */ li $a1, 160 -/* 093BE8 80092FE8 2406002B */ li $a2, 43 -/* 093BEC 80092FEC 0C031110 */ jal draw_text -/* 093BF0 80092FF0 02003825 */ move $a3, $s0 -/* 093BF4 80092FF4 8FA40058 */ lw $a0, 0x58($sp) -/* 093BF8 80092FF8 0C01AC53 */ jal func_8006B14C -/* 093BFC 80092FFC 00000000 */ nop -/* 093C00 80093000 30580040 */ andi $t8, $v0, 0x40 -/* 093C04 80093004 17000179 */ bnez $t8, .L800935EC -/* 093C08 80093008 8FBF0034 */ lw $ra, 0x34($sp) -/* 093C0C 8009300C 16200141 */ bnez $s1, .L80093514 -/* 093C10 80093010 00000000 */ nop -/* 093C14 80093014 0C003932 */ jal is_time_trial_enabled -/* 093C18 80093018 00000000 */ nop -/* 093C1C 8009301C 10400091 */ beqz $v0, .L80093264 -/* 093C20 80093020 00000000 */ nop -/* 093C24 80093024 8FA40058 */ lw $a0, 0x58($sp) -/* 093C28 80093028 0C024AF8 */ jal func_80092BE0 -/* 093C2C 8009302C 00000000 */ nop -/* 093C30 80093030 04400010 */ bltz $v0, .L80093074 -/* 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(gRaceSelectionTTTexture) # $a1, 0x800e -/* 093C44 80093044 241900FF */ li $t9, 255 -/* 093C48 80093048 240800FF */ li $t0, 255 -/* 093C4C 8009304C 240900FF */ li $t1, 255 -/* 093C50 80093050 AFA90018 */ sw $t1, 0x18($sp) -/* 093C54 80093054 AFA80014 */ sw $t0, 0x14($sp) -/* 093C58 80093058 AFB90010 */ sw $t9, 0x10($sp) -/* 093C5C 8009305C 24A50614 */ addiu $a1, %lo(gRaceSelectionTTTexture) # addiu $a1, $a1, 0x614 -/* 093C60 80093060 02402025 */ move $a0, $s2 -/* 093C64 80093064 240600CC */ li $a2, 204 -/* 093C68 80093068 AFAA001C */ sw $t2, 0x1c($sp) -/* 093C6C 8009306C 0C01E2AE */ jal render_textured_rectangle -/* 093C70 80093070 24E7007A */ addiu $a3, $a3, 0x7a -.L80093074: -/* 093C74 80093074 0C0310BB */ jal set_text_font -/* 093C78 80093078 00002025 */ move $a0, $zero -/* 093C7C 8009307C 240B00FF */ li $t3, 255 -/* 093C80 80093080 AFAB0010 */ sw $t3, 0x10($sp) -/* 093C84 80093084 240400FF */ li $a0, 255 -/* 093C88 80093088 24050040 */ li $a1, 64 -/* 093C8C 8009308C 24060040 */ li $a2, 64 -/* 093C90 80093090 0C0310E1 */ jal set_text_colour -/* 093C94 80093094 24070060 */ li $a3, 96 -/* 093C98 80093098 3C0C800E */ lui $t4, %hi(gMenuText) # $t4, 0x800e -/* 093C9C 8009309C 8D8CF4A0 */ lw $t4, %lo(gMenuText)($t4) -/* 093CA0 800930A0 8FB00060 */ lw $s0, 0x60($sp) -/* 093CA4 800930A4 240D000C */ li $t5, 12 -/* 093CA8 800930A8 8D870024 */ lw $a3, 0x24($t4) -/* 093CAC 800930AC 26100048 */ addiu $s0, $s0, 0x48 -/* 093CB0 800930B0 02003025 */ move $a2, $s0 -/* 093CB4 800930B4 AFAD0010 */ sw $t5, 0x10($sp) -/* 093CB8 800930B8 02402025 */ move $a0, $s2 -/* 093CBC 800930BC 0C031110 */ jal draw_text -/* 093CC0 800930C0 24050058 */ li $a1, 88 -/* 093CC4 800930C4 3C0E800E */ lui $t6, %hi(gMenuText) # $t6, 0x800e -/* 093CC8 800930C8 8DCEF4A0 */ lw $t6, %lo(gMenuText)($t6) -/* 093CCC 800930CC 8FA60060 */ lw $a2, 0x60($sp) -/* 093CD0 800930D0 8DC70028 */ lw $a3, 0x28($t6) -/* 093CD4 800930D4 240F000C */ li $t7, 12 -/* 093CD8 800930D8 24C6005C */ addiu $a2, $a2, 0x5c -/* 093CDC 800930DC AFA60040 */ sw $a2, 0x40($sp) -/* 093CE0 800930E0 AFAF0010 */ sw $t7, 0x10($sp) -/* 093CE4 800930E4 02402025 */ move $a0, $s2 -/* 093CE8 800930E8 0C031110 */ jal draw_text -/* 093CEC 800930EC 24050058 */ li $a1, 88 -/* 093CF0 800930F0 241800FF */ li $t8, 255 -/* 093CF4 800930F4 AFB80010 */ sw $t8, 0x10($sp) -/* 093CF8 800930F8 240400FF */ li $a0, 255 -/* 093CFC 800930FC 24050080 */ li $a1, 128 -/* 093D00 80093100 240600FF */ li $a2, 255 -/* 093D04 80093104 0C0310E1 */ jal set_text_colour -/* 093D08 80093108 24070060 */ li $a3, 96 -/* 093D0C 8009310C 3C098012 */ lui $t1, %hi(gPlayerSelectVehicle) # $t1, 0x8012 -/* 093D10 80093110 812969C0 */ lb $t1, %lo(gPlayerSelectVehicle)($t1) -/* 093D14 80093114 8FA80050 */ lw $t0, 0x50($sp) -/* 093D18 80093118 00095080 */ sll $t2, $t1, 2 -/* 093D1C 8009311C 8FB10058 */ lw $s1, 0x58($sp) -/* 093D20 80093120 010A5821 */ addu $t3, $t0, $t2 -/* 093D24 80093124 8D6C0030 */ lw $t4, 0x30($t3) -/* 093D28 80093128 0011C840 */ sll $t9, $s1, 1 -/* 093D2C 8009312C 01996821 */ addu $t5, $t4, $t9 -/* 093D30 80093130 95A40000 */ lhu $a0, ($t5) -/* 093D34 80093134 03208825 */ move $s1, $t9 -/* 093D38 80093138 27A50054 */ addiu $a1, $sp, 0x54 -/* 093D3C 8009313C 0C025DBE */ jal decompress_filename_string -/* 093D40 80093140 24060003 */ li $a2, 3 -/* 093D44 80093144 240E000C */ li $t6, 12 -/* 093D48 80093148 AFAE0010 */ sw $t6, 0x10($sp) -/* 093D4C 8009314C 02402025 */ move $a0, $s2 -/* 093D50 80093150 24050102 */ li $a1, 258 -/* 093D54 80093154 02003025 */ move $a2, $s0 -/* 093D58 80093158 0C031110 */ jal draw_text -/* 093D5C 8009315C 27A70054 */ addiu $a3, $sp, 0x54 -/* 093D60 80093160 3C188012 */ lui $t8, %hi(gPlayerSelectVehicle) # $t8, 0x8012 -/* 093D64 80093164 831869C0 */ lb $t8, %lo(gPlayerSelectVehicle)($t8) -/* 093D68 80093168 8FAF0050 */ lw $t7, 0x50($sp) -/* 093D6C 8009316C 0018C880 */ sll $t9, $t8, 2 -/* 093D70 80093170 01F94821 */ addu $t1, $t7, $t9 -/* 093D74 80093174 8D280018 */ lw $t0, 0x18($t1) -/* 093D78 80093178 27B00054 */ addiu $s0, $sp, 0x54 -/* 093D7C 8009317C 01115021 */ addu $t2, $t0, $s1 -/* 093D80 80093180 95440000 */ lhu $a0, ($t2) -/* 093D84 80093184 02002825 */ move $a1, $s0 -/* 093D88 80093188 0C025DBE */ jal decompress_filename_string -/* 093D8C 8009318C 24060003 */ li $a2, 3 -/* 093D90 80093190 8FA60040 */ lw $a2, 0x40($sp) -/* 093D94 80093194 240B000C */ li $t3, 12 -/* 093D98 80093198 AFAB0010 */ sw $t3, 0x10($sp) -/* 093D9C 8009319C 02402025 */ move $a0, $s2 -/* 093DA0 800931A0 24050102 */ li $a1, 258 -/* 093DA4 800931A4 0C031110 */ jal draw_text -/* 093DA8 800931A8 02003825 */ move $a3, $s0 -/* 093DAC 800931AC 8FA20050 */ lw $v0, 0x50($sp) -/* 093DB0 800931B0 3C0D800E */ lui $t5, %hi(gTrackIdForPreview) # $t5, 0x800e -/* 093DB4 800931B4 3C198012 */ lui $t9, %hi(gPlayerSelectVehicle) # $t9, 0x8012 -/* 093DB8 800931B8 833969C0 */ lb $t9, %lo(gPlayerSelectVehicle)($t9) -/* 093DBC 800931BC 8DADF4C4 */ lw $t5, %lo(gTrackIdForPreview)($t5) -/* 093DC0 800931C0 8C4C004C */ lw $t4, 0x4c($v0) -/* 093DC4 800931C4 00194880 */ sll $t1, $t9, 2 -/* 093DC8 800931C8 018D7021 */ addu $t6, $t4, $t5 -/* 093DCC 800931CC 81D80002 */ lb $t8, 2($t6) -/* 093DD0 800931D0 00494021 */ addu $t0, $v0, $t1 -/* 093DD4 800931D4 8D0A003C */ lw $t2, 0x3c($t0) -/* 093DD8 800931D8 00187840 */ sll $t7, $t8, 1 -/* 093DDC 800931DC 014F5821 */ addu $t3, $t2, $t7 -/* 093DE0 800931E0 95640000 */ lhu $a0, ($t3) -/* 093DE4 800931E4 240D00FF */ li $t5, 255 -/* 093DE8 800931E8 240C00FF */ li $t4, 255 -/* 093DEC 800931EC AFAC0010 */ sw $t4, 0x10($sp) -/* 093DF0 800931F0 AFAD0014 */ sw $t5, 0x14($sp) -/* 093DF4 800931F4 AFA00018 */ sw $zero, 0x18($sp) -/* 093DF8 800931F8 2405001A */ li $a1, 26 -/* 093DFC 800931FC 24060035 */ li $a2, 53 -/* 093E00 80093200 0C020600 */ jal show_timestamp -/* 093E04 80093204 24070080 */ li $a3, 128 -/* 093E08 80093208 8FAE0050 */ lw $t6, 0x50($sp) -/* 093E0C 8009320C 3C188012 */ lui $t8, %hi(gPlayerSelectVehicle) # $t8, 0x8012 -/* 093E10 80093210 3C0F800E */ lui $t7, %hi(gTrackIdForPreview) # $t7, 0x800e -/* 093E14 80093214 8DEFF4C4 */ lw $t7, %lo(gTrackIdForPreview)($t7) -/* 093E18 80093218 831869C0 */ lb $t8, %lo(gPlayerSelectVehicle)($t8) -/* 093E1C 8009321C 8DCA004C */ lw $t2, 0x4c($t6) -/* 093E20 80093220 0018C880 */ sll $t9, $t8, 2 -/* 093E24 80093224 014F5821 */ addu $t3, $t2, $t7 -/* 093E28 80093228 816C0002 */ lb $t4, 2($t3) -/* 093E2C 8009322C 01D94821 */ addu $t1, $t6, $t9 -/* 093E30 80093230 8D280024 */ lw $t0, 0x24($t1) -/* 093E34 80093234 000C6840 */ sll $t5, $t4, 1 -/* 093E38 80093238 010DC021 */ addu $t8, $t0, $t5 -/* 093E3C 8009323C 97040000 */ lhu $a0, ($t8) -/* 093E40 80093240 240900FF */ li $t1, 255 -/* 093E44 80093244 241900C0 */ li $t9, 192 -/* 093E48 80093248 AFB90010 */ sw $t9, 0x10($sp) -/* 093E4C 8009324C AFA90014 */ sw $t1, 0x14($sp) -/* 093E50 80093250 AFA00018 */ sw $zero, 0x18($sp) -/* 093E54 80093254 2405001A */ li $a1, 26 -/* 093E58 80093258 24060021 */ li $a2, 33 -/* 093E5C 8009325C 0C020600 */ jal show_timestamp -/* 093E60 80093260 240700FF */ li $a3, 255 -.L80093264: -/* 093E64 80093264 3C068012 */ lui $a2, %hi(gOptionBlinkTimer) # $a2, 0x8012 -/* 093E68 80093268 8CC663BC */ lw $a2, %lo(gOptionBlinkTimer)($a2) -/* 093E6C 8009326C 24040007 */ li $a0, 7 -/* 093E70 80093270 000670C0 */ sll $t6, $a2, 3 -/* 093E74 80093274 29C10100 */ slti $at, $t6, 0x100 -/* 093E78 80093278 14200003 */ bnez $at, .L80093288 -/* 093E7C 8009327C 01C03025 */ move $a2, $t6 -/* 093E80 80093280 240A01FF */ li $t2, 511 -/* 093E84 80093284 014E3023 */ subu $a2, $t2, $t6 -.L80093288: -/* 093E88 80093288 240F00FF */ li $t7, 255 -/* 093E8C 8009328C AFAF0010 */ sw $t7, 0x10($sp) -/* 093E90 80093290 240500FF */ li $a1, 255 -/* 093E94 80093294 0C0313EF */ jal set_current_dialogue_background_colour -/* 093E98 80093298 00003825 */ move $a3, $zero -/* 093E9C 8009329C 8FA20060 */ lw $v0, 0x60($sp) -/* 093EA0 800932A0 24040007 */ li $a0, 7 -/* 093EA4 800932A4 244B0089 */ addiu $t3, $v0, 0x89 -/* 093EA8 800932A8 AFAB0010 */ sw $t3, 0x10($sp) -/* 093EAC 800932AC 24050086 */ li $a1, 134 -/* 093EB0 800932B0 240700BA */ li $a3, 186 -/* 093EB4 800932B4 0C0313B7 */ jal set_current_dialogue_box_coords -/* 093EB8 800932B8 24460070 */ addiu $a2, $v0, 0x70 -/* 093EBC 800932BC 02402025 */ move $a0, $s2 -/* 093EC0 800932C0 00002825 */ move $a1, $zero -/* 093EC4 800932C4 00003025 */ move $a2, $zero -/* 093EC8 800932C8 0C0316D6 */ jal render_dialogue_box -/* 093ECC 800932CC 24070007 */ li $a3, 7 -/* 093ED0 800932D0 8FA70060 */ lw $a3, 0x60($sp) -/* 093ED4 800932D4 3C05800E */ lui $a1, %hi(gRaceSelectionVehicleTitleTexture) # $a1, 0x800e -/* 093ED8 800932D8 240C00FF */ li $t4, 255 -/* 093EDC 800932DC 240800FF */ li $t0, 255 -/* 093EE0 800932E0 240D00FF */ li $t5, 255 -/* 093EE4 800932E4 241800FF */ li $t8, 255 -/* 093EE8 800932E8 AFB8001C */ sw $t8, 0x1c($sp) -/* 093EEC 800932EC AFAD0018 */ sw $t5, 0x18($sp) -/* 093EF0 800932F0 AFA80014 */ sw $t0, 0x14($sp) -/* 093EF4 800932F4 AFAC0010 */ sw $t4, 0x10($sp) -/* 093EF8 800932F8 24A505B4 */ addiu $a1, %lo(gRaceSelectionVehicleTitleTexture) # addiu $a1, $a1, 0x5b4 -/* 093EFC 800932FC 02402025 */ move $a0, $s2 -/* 093F00 80093300 24060088 */ li $a2, 136 -/* 093F04 80093304 0C01E2AE */ jal render_textured_rectangle -/* 093F08 80093308 24E70072 */ addiu $a3, $a3, 0x72 -/* 093F0C 8009330C 8FB90060 */ lw $t9, 0x60($sp) -/* 093F10 80093310 00008025 */ move $s0, $zero -/* 093F14 80093314 2731008B */ addiu $s1, $t9, 0x8b -/* 093F18 80093318 AFB10040 */ sw $s1, 0x40($sp) -/* 093F1C 8009331C 8FAE007C */ lw $t6, 0x7c($sp) -.L80093320: -/* 093F20 80093320 8FA40058 */ lw $a0, 0x58($sp) -/* 093F24 80093324 29C10002 */ slti $at, $t6, 2 -/* 093F28 80093328 10200008 */ beqz $at, .L8009334C -/* 093F2C 8009332C 240200FF */ li $v0, 255 -/* 093F30 80093330 0C01AC2B */ jal get_map_default_vehicle -/* 093F34 80093334 00000000 */ nop -/* 093F38 80093338 10500004 */ beq $v0, $s0, .L8009334C -/* 093F3C 8009333C 240200FF */ li $v0, 255 -/* 093F40 80093340 10000002 */ b .L8009334C -/* 093F44 80093344 24020080 */ li $v0, 128 -/* 093F48 80093348 240200FF */ li $v0, 255 -.L8009334C: -/* 093F4C 8009334C 8FAB005C */ lw $t3, 0x5c($sp) -/* 093F50 80093350 240A0001 */ li $t2, 1 -/* 093F54 80093354 020A7804 */ sllv $t7, $t2, $s0 -/* 093F58 80093358 01EB6024 */ and $t4, $t7, $t3 -/* 093F5C 8009335C 11800025 */ beqz $t4, .L800933F4 -/* 093F60 80093360 00104080 */ sll $t0, $s0, 2 -/* 093F64 80093364 3C198012 */ lui $t9, %hi(gPlayerSelectVehicle) # $t9, 0x8012 -/* 093F68 80093368 833969C0 */ lb $t9, %lo(gPlayerSelectVehicle)($t9) -/* 093F6C 8009336C 01104023 */ subu $t0, $t0, $s0 -/* 093F70 80093370 3C18800E */ lui $t8, %hi(gRaceSelectionImages) # $t8, 0x800e -/* 093F74 80093374 27180624 */ addiu $t8, %lo(gRaceSelectionImages) # addiu $t8, $t8, 0x624 -/* 093F78 80093378 00086880 */ sll $t5, $t0, 2 -/* 093F7C 8009337C 16190010 */ bne $s0, $t9, .L800933C0 -/* 093F80 80093380 01B81821 */ addu $v1, $t5, $t8 -/* 093F84 80093384 8C650004 */ lw $a1, 4($v1) -/* 093F88 80093388 240900FF */ li $t1, 255 -/* 093F8C 8009338C 240E00FF */ li $t6, 255 -/* 093F90 80093390 240A00FF */ li $t2, 255 -/* 093F94 80093394 240F00FF */ li $t7, 255 -/* 093F98 80093398 AFAF001C */ sw $t7, 0x1c($sp) -/* 093F9C 8009339C AFAA0018 */ sw $t2, 0x18($sp) -/* 093FA0 800933A0 AFAE0014 */ sw $t6, 0x14($sp) -/* 093FA4 800933A4 AFA90010 */ sw $t1, 0x10($sp) -/* 093FA8 800933A8 02402025 */ move $a0, $s2 -/* 093FAC 800933AC 24060068 */ li $a2, 104 -/* 093FB0 800933B0 0C01E2AE */ jal render_textured_rectangle -/* 093FB4 800933B4 02203825 */ move $a3, $s1 -/* 093FB8 800933B8 1000000E */ b .L800933F4 -/* 093FBC 800933BC 26310018 */ addiu $s1, $s1, 0x18 -.L800933C0: -/* 093FC0 800933C0 8C650008 */ lw $a1, 8($v1) -/* 093FC4 800933C4 240B00FF */ li $t3, 255 -/* 093FC8 800933C8 240C00FF */ li $t4, 255 -/* 093FCC 800933CC 240800FF */ li $t0, 255 -/* 093FD0 800933D0 AFA80018 */ sw $t0, 0x18($sp) -/* 093FD4 800933D4 AFAC0014 */ sw $t4, 0x14($sp) -/* 093FD8 800933D8 AFAB0010 */ sw $t3, 0x10($sp) -/* 093FDC 800933DC 02402025 */ move $a0, $s2 -/* 093FE0 800933E0 24060068 */ li $a2, 104 -/* 093FE4 800933E4 02203825 */ move $a3, $s1 -/* 093FE8 800933E8 0C01E2AE */ jal render_textured_rectangle -/* 093FEC 800933EC AFA2001C */ sw $v0, 0x1c($sp) -/* 093FF0 800933F0 26310018 */ addiu $s1, $s1, 0x18 -.L800933F4: -/* 093FF4 800933F4 26100001 */ addiu $s0, $s0, 1 -/* 093FF8 800933F8 24010003 */ li $at, 3 -/* 093FFC 800933FC 1601FFC8 */ bne $s0, $at, .L80093320 -/* 094000 80093400 8FAE007C */ lw $t6, 0x7c($sp) -/* 094004 80093404 3C028012 */ lui $v0, %hi(gPlayerSelectVehicle) # $v0, 0x8012 -/* 094008 80093408 804269C0 */ lb $v0, %lo(gPlayerSelectVehicle)($v0) -/* 09400C 8009340C 8FB10040 */ lw $s1, 0x40($sp) -/* 094010 80093410 24010002 */ li $at, 2 -/* 094014 80093414 14410002 */ bne $v0, $at, .L80093420 -/* 094018 80093418 02402025 */ move $a0, $s2 -/* 09401C 8009341C 26310002 */ addiu $s1, $s1, 2 -.L80093420: -/* 094020 80093420 00026880 */ sll $t5, $v0, 2 -/* 094024 80093424 01A26823 */ subu $t5, $t5, $v0 -/* 094028 80093428 000DC080 */ sll $t8, $t5, 2 -/* 09402C 8009342C 3C05800E */ lui $a1, %hi(gRaceSelectionImages) # $a1, 0x800e -/* 094030 80093430 00B82821 */ addu $a1, $a1, $t8 -/* 094034 80093434 8CA50624 */ lw $a1, %lo(gRaceSelectionImages)($a1) -/* 094038 80093438 241900FF */ li $t9, 255 -/* 09403C 8009343C 240900FF */ li $t1, 255 -/* 094040 80093440 240E00FF */ li $t6, 255 -/* 094044 80093444 240A00FF */ li $t2, 255 -/* 094048 80093448 AFAA001C */ sw $t2, 0x1c($sp) -/* 09404C 8009344C AFAE0018 */ sw $t6, 0x18($sp) -/* 094050 80093450 AFA90014 */ sw $t1, 0x14($sp) -/* 094054 80093454 AFB90010 */ sw $t9, 0x10($sp) -/* 094058 80093458 24060095 */ li $a2, 149 -/* 09405C 8009345C 0C01E2AE */ jal render_textured_rectangle -/* 094060 80093460 02203825 */ move $a3, $s1 -/* 094064 80093464 0C01ECF4 */ jal func_8007B3D0 -/* 094068 80093468 02402025 */ move $a0, $s2 -/* 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) -/* 094080 80093480 3C01C250 */ li $at, 0xC2500000 # -52.000000 -/* 094084 80093484 E5E400EC */ swc1 $f4, 0xec($t7) -/* 094088 80093488 8C4B0000 */ lw $t3, ($v0) -/* 09408C 8009348C 44813000 */ mtc1 $at, $f6 -/* 094090 80093490 24040007 */ li $a0, 7 -/* 094094 80093494 0C027298 */ jal func_8009CA60 -/* 094098 80093498 E56600F0 */ swc1 $f6, 0xf0($t3) -/* 09409C 8009349C 3C0C8012 */ lui $t4, %hi(D_801263E0) # $t4, 0x8012 -/* 0940A0 800934A0 8D8C63E0 */ lw $t4, %lo(D_801263E0)($t4) -/* 0940A4 800934A4 00000000 */ nop -/* 0940A8 800934A8 11800050 */ beqz $t4, .L800935EC -/* 0940AC 800934AC 8FBF0034 */ lw $ra, 0x34($sp) -/* 0940B0 800934B0 0C0310BB */ jal set_text_font -/* 0940B4 800934B4 24040002 */ li $a0, 2 -/* 0940B8 800934B8 00002025 */ move $a0, $zero -/* 0940BC 800934BC 00002825 */ move $a1, $zero -/* 0940C0 800934C0 00003025 */ move $a2, $zero -/* 0940C4 800934C4 0C0310F3 */ jal set_text_background_colour -/* 0940C8 800934C8 00003825 */ move $a3, $zero -/* 0940CC 800934CC 240800FF */ li $t0, 255 -/* 0940D0 800934D0 AFA80010 */ sw $t0, 0x10($sp) -/* 0940D4 800934D4 240400FF */ li $a0, 255 -/* 0940D8 800934D8 240500FF */ li $a1, 255 -/* 0940DC 800934DC 240600FF */ li $a2, 255 -/* 0940E0 800934E0 0C0310E1 */ jal set_text_colour -/* 0940E4 800934E4 00003825 */ move $a3, $zero -/* 0940E8 800934E8 8FA60060 */ lw $a2, 0x60($sp) -/* 0940EC 800934EC 3C07800F */ lui $a3, %hi(D_800E8240) # $a3, 0x800f -/* 0940F0 800934F0 240D000C */ li $t5, 12 -/* 0940F4 800934F4 AFAD0010 */ sw $t5, 0x10($sp) -/* 0940F8 800934F8 24E78240 */ addiu $a3, %lo(D_800E8240) # addiu $a3, $a3, -0x7dc0 -/* 0940FC 800934FC 02402025 */ move $a0, $s2 -/* 094100 80093500 240500A0 */ li $a1, 160 -/* 094104 80093504 0C031110 */ jal draw_text -/* 094108 80093508 24C600AC */ addiu $a2, $a2, 0xac -/* 09410C 8009350C 10000037 */ b .L800935EC -/* 094110 80093510 8FBF0034 */ lw $ra, 0x34($sp) -.L80093514: -/* 094114 80093514 0C0310BB */ jal set_text_font -/* 094118 80093518 24040002 */ li $a0, 2 -/* 09411C 8009351C 00002025 */ move $a0, $zero -/* 094120 80093520 00002825 */ move $a1, $zero -/* 094124 80093524 00003025 */ move $a2, $zero -/* 094128 80093528 0C0310F3 */ jal set_text_background_colour -/* 09412C 8009352C 00003825 */ move $a3, $zero -/* 094130 80093530 241800FF */ li $t8, 255 -/* 094134 80093534 AFB80010 */ sw $t8, 0x10($sp) -/* 094138 80093538 240400FF */ li $a0, 255 -/* 09413C 8009353C 240500FF */ li $a1, 255 -/* 094140 80093540 240600FF */ li $a2, 255 -/* 094144 80093544 0C0310E1 */ jal set_text_colour -/* 094148 80093548 00003825 */ move $a3, $zero -/* 09414C 8009354C 8FB00060 */ lw $s0, 0x60($sp) -/* 094150 80093550 00000000 */ nop -/* 094154 80093554 261000B0 */ addiu $s0, $s0, 0xb0 -/* 094158 80093558 0C027AC8 */ jal get_language -/* 09415C 8009355C 02008825 */ move $s1, $s0 -/* 094160 80093560 24010002 */ li $at, 2 -/* 094164 80093564 1441000A */ bne $v0, $at, .L80093590 -/* 094168 80093568 02402025 */ move $a0, $s2 -/* 09416C 8009356C 3C19800E */ lui $t9, %hi(gMenuText) # $t9, 0x800e -/* 094170 80093570 8F39F4A0 */ lw $t9, %lo(gMenuText)($t9) -/* 094174 80093574 2409000C */ li $t1, 12 -/* 094178 80093578 8F270034 */ lw $a3, 0x34($t9) -/* 09417C 8009357C AFA90010 */ sw $t1, 0x10($sp) -/* 094180 80093580 240500A0 */ li $a1, 160 -/* 094184 80093584 0C031110 */ jal draw_text -/* 094188 80093588 02003025 */ move $a2, $s0 -/* 09418C 8009358C 26110020 */ addiu $s1, $s0, 0x20 -.L80093590: -/* 094190 80093590 3C0E800E */ lui $t6, %hi(gMenuText) # $t6, 0x800e -/* 094194 80093594 8DCEF4A0 */ lw $t6, %lo(gMenuText)($t6) -/* 094198 80093598 240A000C */ li $t2, 12 -/* 09419C 8009359C 8DC7002C */ lw $a3, 0x2c($t6) -/* 0941A0 800935A0 AFAA0010 */ sw $t2, 0x10($sp) -/* 0941A4 800935A4 02402025 */ move $a0, $s2 -/* 0941A8 800935A8 240500A0 */ li $a1, 160 -/* 0941AC 800935AC 0C031110 */ jal draw_text -/* 0941B0 800935B0 02203025 */ move $a2, $s1 -/* 0941B4 800935B4 0C027AC8 */ jal get_language -/* 0941B8 800935B8 26310020 */ addiu $s1, $s1, 0x20 -/* 0941BC 800935BC 24010002 */ li $at, 2 -/* 0941C0 800935C0 10410009 */ beq $v0, $at, .L800935E8 -/* 0941C4 800935C4 02402025 */ move $a0, $s2 -/* 0941C8 800935C8 3C0F800E */ lui $t7, %hi(gMenuText) # $t7, 0x800e -/* 0941CC 800935CC 8DEFF4A0 */ lw $t7, %lo(gMenuText)($t7) -/* 0941D0 800935D0 240B000C */ li $t3, 12 -/* 0941D4 800935D4 8DE70034 */ lw $a3, 0x34($t7) -/* 0941D8 800935D8 AFAB0010 */ sw $t3, 0x10($sp) -/* 0941DC 800935DC 240500A0 */ li $a1, 160 -/* 0941E0 800935E0 0C031110 */ jal draw_text -/* 0941E4 800935E4 02203025 */ move $a2, $s1 -.L800935E8: -/* 0941E8 800935E8 8FBF0034 */ lw $ra, 0x34($sp) -.L800935EC: -/* 0941EC 800935EC 8FB00028 */ lw $s0, 0x28($sp) -/* 0941F0 800935F0 8FB1002C */ lw $s1, 0x2c($sp) -/* 0941F4 800935F4 8FB20030 */ lw $s2, 0x30($sp) -/* 0941F8 800935F8 03E00008 */ jr $ra -/* 0941FC 800935FC 27BD0078 */ addiu $sp, $sp, 0x78 - diff --git a/asm/non_matchings/menu/func_8009CA60.s b/asm/non_matchings/menu/func_8009CA60.s index 66be05e4..233a4f1b 100644 --- a/asm/non_matchings/menu/func_8009CA60.s +++ b/asm/non_matchings/menu/func_8009CA60.s @@ -182,7 +182,7 @@ glabel func_8009CA60 /* 09D91C 8009CD1C 8C426550 */ lw $v0, %lo(D_80126550)($v0) /* 09D920 8009CD20 00000000 */ nop /* 09D924 8009CD24 8C440000 */ lw $a0, ($v0) -/* 09D928 8009CD28 0C02735F */ jal func_8009CD7C +/* 09D928 8009CD28 0C02735F */ jal render_track_selection_viewport_border /* 09D92C 8009CD2C 00000000 */ nop /* 09D930 8009CD30 0C01A690 */ jal func_80069A40 /* 09D934 8009CD34 02002025 */ move $a0, $s0 diff --git a/asm/non_matchings/menu/func_8009CD7C.s b/asm/non_matchings/menu/func_8009CD7C.s deleted file mode 100644 index 6c80dbac..00000000 --- a/asm/non_matchings/menu/func_8009CD7C.s +++ /dev/null @@ -1,131 +0,0 @@ -glabel func_8009CD7C -/* 09D97C 8009CD7C 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 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 -/* 09D994 8009CD94 0080A825 */ move $s5, $a0 -/* 09D998 8009CD98 AFBF003C */ sw $ra, 0x3c($sp) -/* 09D99C 8009CD9C AFBE0038 */ sw $fp, 0x38($sp) -/* 09D9A0 8009CDA0 AFB70034 */ sw $s7, 0x34($sp) -/* 09D9A4 8009CDA4 AFB60030 */ sw $s6, 0x30($sp) -/* 09D9A8 8009CDA8 AFB40028 */ sw $s4, 0x28($sp) -/* 09D9AC 8009CDAC AFB30024 */ sw $s3, 0x24($sp) -/* 09D9B0 8009CDB0 AFB20020 */ sw $s2, 0x20($sp) -/* 09D9B4 8009CDB4 AFB1001C */ sw $s1, 0x1c($sp) -/* 09D9B8 8009CDB8 AFB00018 */ sw $s0, 0x18($sp) -/* 09D9BC 8009CDBC 11E10003 */ beq $t7, $at, .L8009CDCC -/* 09D9C0 8009CDC0 AFAE005C */ sw $t6, 0x5c($sp) -/* 09D9C4 8009CDC4 2418000D */ li $t8, 13 -/* 09D9C8 8009CDC8 AFB8005C */ sw $t8, 0x5c($sp) -.L8009CDCC: -/* 09D9CC 8009CDCC 86A60028 */ lh $a2, 0x28($s5) -/* 09D9D0 8009CDD0 0000B025 */ move $s6, $zero -/* 09D9D4 8009CDD4 18C00058 */ blez $a2, .L8009CF38 -/* 09D9D8 8009CDD8 0000B825 */ move $s7, $zero -/* 09D9DC 8009CDDC 3C118012 */ lui $s1, %hi(sMenuCurrDisplayList) # $s1, 0x8012 -/* 09D9E0 8009CDE0 263163A0 */ addiu $s1, %lo(sMenuCurrDisplayList) # addiu $s1, $s1, 0x63a0 -.L8009CDE4: -/* 09D9E4 8009CDE4 8EB90038 */ lw $t9, 0x38($s5) -/* 09D9E8 8009CDE8 2401FFFF */ li $at, -1 -/* 09D9EC 8009CDEC 03371021 */ addu $v0, $t9, $s7 -/* 09D9F0 8009CDF0 8C4A0008 */ lw $t2, 8($v0) -/* 09D9F4 8009CDF4 00000000 */ nop -/* 09D9F8 8009CDF8 314B0100 */ andi $t3, $t2, 0x100 -/* 09D9FC 8009CDFC 1560004A */ bnez $t3, .L8009CF28 -/* 09DA00 8009CE00 00000000 */ nop -/* 09DA04 8009CE04 84430002 */ lh $v1, 2($v0) -/* 09DA08 8009CE08 84440004 */ lh $a0, 4($v0) -/* 09DA0C 8009CE0C 00037880 */ sll $t7, $v1, 2 -/* 09DA10 8009CE10 844C000E */ lh $t4, 0xe($v0) -/* 09DA14 8009CE14 844D0010 */ lh $t5, 0x10($v0) -/* 09DA18 8009CE18 8EAE0004 */ lw $t6, 4($s5) -/* 09DA1C 8009CE1C 8EB80008 */ lw $t8, 8($s5) -/* 09DA20 8009CE20 90450000 */ lbu $a1, ($v0) -/* 09DA24 8009CE24 01E37821 */ addu $t7, $t7, $v1 -/* 09DA28 8009CE28 000F7840 */ sll $t7, $t7, 1 -/* 09DA2C 8009CE2C 0004C900 */ sll $t9, $a0, 4 -/* 09DA30 8009CE30 01838023 */ subu $s0, $t4, $v1 -/* 09DA34 8009CE34 01A49023 */ subu $s2, $t5, $a0 -/* 09DA38 8009CE38 01CFF021 */ addu $fp, $t6, $t7 -/* 09DA3C 8009CE3C 14A10005 */ bne $a1, $at, .L8009CE54 -/* 09DA40 8009CE40 03194021 */ addu $t0, $t8, $t9 -/* 09DA44 8009CE44 00009825 */ move $s3, $zero -/* 09DA48 8009CE48 0000A025 */ move $s4, $zero -/* 09DA4C 8009CE4C 10000009 */ b .L8009CE74 -/* 09DA50 8009CE50 00003825 */ move $a3, $zero -.L8009CE54: -/* 09DA54 8009CE54 8EAA0000 */ lw $t2, ($s5) -/* 09DA58 8009CE58 90470007 */ lbu $a3, 7($v0) -/* 09DA5C 8009CE5C 000558C0 */ sll $t3, $a1, 3 -/* 09DA60 8009CE60 014B6021 */ addu $t4, $t2, $t3 -/* 09DA64 8009CE64 00076B80 */ sll $t5, $a3, 0xe -/* 09DA68 8009CE68 8D930000 */ lw $s3, ($t4) -/* 09DA6C 8009CE6C 24140001 */ li $s4, 1 -/* 09DA70 8009CE70 01A03825 */ move $a3, $t5 -.L8009CE74: -/* 09DA74 8009CE74 8FA6005C */ lw $a2, 0x5c($sp) -/* 09DA78 8009CE78 02202025 */ move $a0, $s1 -/* 09DA7C 8009CE7C 02602825 */ move $a1, $s3 -/* 09DA80 8009CE80 0C01ED3A */ jal func_8007B4E8 -/* 09DA84 8009CE84 AFA80044 */ sw $t0, 0x44($sp) -/* 09DA88 8009CE88 8E220000 */ lw $v0, ($s1) -/* 09DA8C 8009CE8C 3C098000 */ lui $t1, 0x8000 -/* 09DA90 8009CE90 03C92021 */ addu $a0, $fp, $t1 -/* 09DA94 8009CE94 260FFFFF */ addiu $t7, $s0, -1 -/* 09DA98 8009CE98 244E0008 */ addiu $t6, $v0, 8 -/* 09DA9C 8009CE9C AE2E0000 */ sw $t6, ($s1) -/* 09DAA0 8009CEA0 000FC0C0 */ sll $t8, $t7, 3 -/* 09DAA4 8009CEA4 30990006 */ andi $t9, $a0, 6 -/* 09DAA8 8009CEA8 03195025 */ or $t2, $t8, $t9 -/* 09DAAC 8009CEAC 001070C0 */ sll $t6, $s0, 3 -/* 09DAB0 8009CEB0 01D07821 */ addu $t7, $t6, $s0 -/* 09DAB4 8009CEB4 000FC040 */ sll $t8, $t7, 1 -/* 09DAB8 8009CEB8 314B00FF */ andi $t3, $t2, 0xff -/* 09DABC 8009CEBC 000B6400 */ sll $t4, $t3, 0x10 -/* 09DAC0 8009CEC0 27190008 */ addiu $t9, $t8, 8 -/* 09DAC4 8009CEC4 3C010400 */ lui $at, 0x400 -/* 09DAC8 8009CEC8 8FA80044 */ lw $t0, 0x44($sp) -/* 09DACC 8009CECC 01816825 */ or $t5, $t4, $at -/* 09DAD0 8009CED0 332AFFFF */ andi $t2, $t9, 0xffff -/* 09DAD4 8009CED4 01AA5825 */ or $t3, $t5, $t2 -/* 09DAD8 8009CED8 264EFFFF */ addiu $t6, $s2, -1 -/* 09DADC 8009CEDC AC4B0000 */ sw $t3, ($v0) -/* 09DAE0 8009CEE0 AC440004 */ sw $a0, 4($v0) -/* 09DAE4 8009CEE4 8E220000 */ lw $v0, ($s1) -/* 09DAE8 8009CEE8 000E7900 */ sll $t7, $t6, 4 -/* 09DAEC 8009CEEC 01F4C025 */ or $t8, $t7, $s4 -/* 09DAF0 8009CEF0 331900FF */ andi $t9, $t8, 0xff -/* 09DAF4 8009CEF4 244C0008 */ addiu $t4, $v0, 8 -/* 09DAF8 8009CEF8 AE2C0000 */ sw $t4, ($s1) -/* 09DAFC 8009CEFC 00196C00 */ sll $t5, $t9, 0x10 -/* 09DB00 8009CF00 00125900 */ sll $t3, $s2, 4 -/* 09DB04 8009CF04 3C010500 */ lui $at, 0x500 -/* 09DB08 8009CF08 01A15025 */ or $t2, $t5, $at -/* 09DB0C 8009CF0C 316CFFFF */ andi $t4, $t3, 0xffff -/* 09DB10 8009CF10 014C7025 */ or $t6, $t2, $t4 -/* 09DB14 8009CF14 01097821 */ addu $t7, $t0, $t1 -/* 09DB18 8009CF18 AC4F0004 */ sw $t7, 4($v0) -/* 09DB1C 8009CF1C AC4E0000 */ sw $t6, ($v0) -/* 09DB20 8009CF20 86A60028 */ lh $a2, 0x28($s5) -/* 09DB24 8009CF24 00000000 */ nop -.L8009CF28: -/* 09DB28 8009CF28 26D60001 */ addiu $s6, $s6, 1 -/* 09DB2C 8009CF2C 02C6082A */ slt $at, $s6, $a2 -/* 09DB30 8009CF30 1420FFAC */ bnez $at, .L8009CDE4 -/* 09DB34 8009CF34 26F7000C */ addiu $s7, $s7, 0xc -.L8009CF38: -/* 09DB38 8009CF38 8FBF003C */ lw $ra, 0x3c($sp) -/* 09DB3C 8009CF3C 8FB00018 */ lw $s0, 0x18($sp) -/* 09DB40 8009CF40 8FB1001C */ lw $s1, 0x1c($sp) -/* 09DB44 8009CF44 8FB20020 */ lw $s2, 0x20($sp) -/* 09DB48 8009CF48 8FB30024 */ lw $s3, 0x24($sp) -/* 09DB4C 8009CF4C 8FB40028 */ lw $s4, 0x28($sp) -/* 09DB50 8009CF50 8FB5002C */ lw $s5, 0x2c($sp) -/* 09DB54 8009CF54 8FB60030 */ lw $s6, 0x30($sp) -/* 09DB58 8009CF58 8FB70034 */ lw $s7, 0x34($sp) -/* 09DB5C 8009CF5C 8FBE0038 */ lw $fp, 0x38($sp) -/* 09DB60 8009CF60 03E00008 */ jr $ra -/* 09DB64 8009CF64 27BD0070 */ addiu $sp, $sp, 0x70 - diff --git a/asm/non_matchings/objects/func_8000FC6C.s b/asm/non_matchings/objects/func_8000FC6C.s deleted file mode 100644 index 24335e16..00000000 --- a/asm/non_matchings/objects/func_8000FC6C.s +++ /dev/null @@ -1,49 +0,0 @@ -glabel func_8000FC6C -/* 01086C 8000FC6C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 010870 8000FC70 AFBF0014 */ sw $ra, 0x14($sp) -/* 010874 8000FC74 8C8E0040 */ lw $t6, 0x40($a0) -/* 010878 8000FC78 AC850058 */ sw $a1, 0x58($a0) -/* 01087C 8000FC7C C5C40008 */ lwc1 $f4, 8($t6) -/* 010880 8000FC80 A4A0000C */ sh $zero, 0xc($a1) -/* 010884 8000FC84 E4A40000 */ swc1 $f4, ($a1) -/* 010888 8000FC88 8C8F0040 */ lw $t7, 0x40($a0) -/* 01088C 8000FC8C 00803025 */ move $a2, $a0 -/* 010890 8000FC90 8DF80000 */ lw $t8, ($t7) -/* 010894 8000FC94 ACA00004 */ sw $zero, 4($a1) -/* 010898 8000FC98 0018CA03 */ sra $t9, $t8, 8 -/* 01089C 8000FC9C A4B9000E */ sh $t9, 0xe($a1) -/* 0108A0 8000FCA0 8C820040 */ lw $v0, 0x40($a0) -/* 0108A4 8000FCA4 00000000 */ nop -/* 0108A8 8000FCA8 84480036 */ lh $t0, 0x36($v0) -/* 0108AC 8000FCAC 00000000 */ nop -/* 0108B0 8000FCB0 11000008 */ beqz $t0, .L8000FCD4 -/* 0108B4 8000FCB4 00000000 */ nop -/* 0108B8 8000FCB8 84440038 */ lh $a0, 0x38($v0) -/* 0108BC 8000FCBC AFA60018 */ sw $a2, 0x18($sp) -/* 0108C0 8000FCC0 0C01EB9D */ jal load_texture -/* 0108C4 8000FCC4 AFA5001C */ sw $a1, 0x1c($sp) -/* 0108C8 8000FCC8 8FA5001C */ lw $a1, 0x1c($sp) -/* 0108CC 8000FCCC 8FA60018 */ lw $a2, 0x18($sp) -/* 0108D0 8000FCD0 ACA20004 */ sw $v0, 4($a1) -.L8000FCD4: -/* 0108D4 8000FCD4 8CAA0004 */ lw $t2, 4($a1) -/* 0108D8 8000FCD8 2409FFFF */ li $t1, -1 -/* 0108DC 8000FCDC A4A90008 */ sh $t1, 8($a1) -/* 0108E0 8000FCE0 3C018012 */ lui $at, %hi(D_8011AE54) # $at, 0x8012 -/* 0108E4 8000FCE4 AC2AAE54 */ sw $t2, %lo(D_8011AE54)($at) -/* 0108E8 8000FCE8 8CCB0040 */ lw $t3, 0x40($a2) -/* 0108EC 8000FCEC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0108F0 8000FCF0 856C0036 */ lh $t4, 0x36($t3) -/* 0108F4 8000FCF4 24020014 */ li $v0, 20 -/* 0108F8 8000FCF8 11800007 */ beqz $t4, .L8000FD18 -/* 0108FC 8000FCFC 00000000 */ nop -/* 010900 8000FD00 8CAD0004 */ lw $t5, 4($a1) -/* 010904 8000FD04 00000000 */ nop -/* 010908 8000FD08 15A00003 */ bnez $t5, .L8000FD18 -/* 01090C 8000FD0C 00000000 */ nop -/* 010910 8000FD10 10000001 */ b .L8000FD18 -/* 010914 8000FD14 00001025 */ move $v0, $zero -.L8000FD18: -/* 010918 8000FD18 03E00008 */ jr $ra -/* 01091C 8000FD1C 27BD0018 */ addiu $sp, $sp, 0x18 - diff --git a/asm/non_matchings/objects/func_800135B8.s b/asm/non_matchings/objects/func_800135B8.s index c1f1f196..f393cbb7 100644 --- a/asm/non_matchings/objects/func_800135B8.s +++ b/asm/non_matchings/objects/func_800135B8.s @@ -125,7 +125,7 @@ glabel func_800135B8 /* 014380 80013780 240D010A */ li $t5, 266 /* 014384 80013784 8F2C0078 */ lw $t4, 0x78($t9) /* 014388 80013788 AFAD0014 */ sw $t5, 0x14($sp) -/* 01438C 8001378C 0C01A145 */ jal func_80068514 +/* 01438C 8001378C 0C01A145 */ jal render_sprite_billboard /* 014390 80013790 AFAC0010 */ sw $t4, 0x10($sp) /* 014394 80013794 922E0070 */ lbu $t6, 0x70($s1) /* 014398 80013798 24010002 */ li $at, 2 diff --git a/asm/non_matchings/objects/func_800138A8.s b/asm/non_matchings/objects/func_800138A8.s index 32b2f65c..8158bede 100644 --- a/asm/non_matchings/objects/func_800138A8.s +++ b/asm/non_matchings/objects/func_800138A8.s @@ -83,7 +83,7 @@ glabel func_800138A8 /* 0145E8 800139E8 2484AE8C */ addiu $a0, %lo(gObjectCurrDisplayList) # addiu $a0, $a0, -0x5174 /* 0145EC 800139EC 02003825 */ move $a3, $s0 /* 0145F0 800139F0 AFB80014 */ sw $t8, 0x14($sp) -/* 0145F4 800139F4 0C01A145 */ jal func_80068514 +/* 0145F4 800139F4 0C01A145 */ jal render_sprite_billboard /* 0145F8 800139F8 AFAF0010 */ sw $t7, 0x10($sp) /* 0145FC 800139FC 8FBF0024 */ lw $ra, 0x24($sp) /* 014600 80013A00 8FB00020 */ lw $s0, 0x20($sp) diff --git a/asm/non_matchings/objects/render_3d_billboard.s b/asm/non_matchings/objects/render_3d_billboard.s index 75ef1c26..89b13ec6 100644 --- a/asm/non_matchings/objects/render_3d_billboard.s +++ b/asm/non_matchings/objects/render_3d_billboard.s @@ -261,7 +261,7 @@ glabel render_3d_billboard /* 012C50 80012050 AFAA0014 */ sw $t2, 0x14($sp) /* 012C54 80012054 AFA80080 */ sw $t0, 0x80($sp) /* 012C58 80012058 AFA9007C */ sw $t1, 0x7c($sp) -/* 012C5C 8001205C 0C01A145 */ jal func_80068514 +/* 012C5C 8001205C 0C01A145 */ jal render_sprite_billboard /* 012C60 80012060 AFB90010 */ sw $t9, 0x10($sp) /* 012C64 80012064 8FA80080 */ lw $t0, 0x80($sp) /* 012C68 80012068 8FA9007C */ lw $t1, 0x7c($sp) diff --git a/asm/non_matchings/objects/render_3d_model.s b/asm/non_matchings/objects/render_3d_model.s index df29a922..3997a0ab 100644 --- a/asm/non_matchings/objects/render_3d_model.s +++ b/asm/non_matchings/objects/render_3d_model.s @@ -559,7 +559,7 @@ glabel render_3d_model /* 0134DC 800128DC AFAB0030 */ sw $t3, 0x30($sp) /* 0134E0 800128E0 E7A00094 */ swc1 $f0, 0x94($sp) /* 0134E4 800128E4 E7A20090 */ swc1 $f2, 0x90($sp) -/* 0134E8 800128E8 0C01A145 */ jal func_80068514 +/* 0134E8 800128E8 0C01A145 */ jal render_sprite_billboard /* 0134EC 800128EC E7AC008C */ swc1 $f12, 0x8c($sp) /* 0134F0 800128F0 83A8008A */ lb $t0, 0x8a($sp) /* 0134F4 800128F4 8FAA00BC */ lw $t2, 0xbc($sp) @@ -692,7 +692,7 @@ glabel render_3d_model /* 0136E0 80012AE0 17010005 */ bne $t8, $at, .L80012AF8 /* 0136E4 80012AE4 8FAF009C */ lw $t7, 0x9c($sp) /* 0136E8 80012AE8 AFAC0010 */ sw $t4, 0x10($sp) -/* 0136EC 80012AEC 0C01A145 */ jal func_80068514 +/* 0136EC 80012AEC 0C01A145 */ jal render_sprite_billboard /* 0136F0 80012AF0 AFAE0014 */ sw $t6, 0x14($sp) /* 0136F4 80012AF4 8FAF009C */ lw $t7, 0x9c($sp) .L80012AF8: diff --git a/asm/non_matchings/printf/func_800B3740.s b/asm/non_matchings/printf/func_800B3740.s index 853efd31..d7195f94 100644 --- a/asm/non_matchings/printf/func_800B3740.s +++ b/asm/non_matchings/printf/func_800B3740.s @@ -110,7 +110,7 @@ glabel func_800B3740 /* 0B44DC 800B38DC AFAA0038 */ sw $t2, 0x38($sp) /* 0B44E0 800B38E0 AFA20034 */ sw $v0, 0x34($sp) /* 0B44E4 800B38E4 AFAB0014 */ sw $t3, 0x14($sp) -/* 0B44E8 800B38E8 0C01A145 */ jal func_80068514 +/* 0B44E8 800B38E8 0C01A145 */ jal render_sprite_billboard /* 0B44EC 800B38EC AFA80010 */ sw $t0, 0x10($sp) /* 0B44F0 800B38F0 8FA20034 */ lw $v0, 0x34($sp) /* 0B44F4 800B38F4 8FAA0038 */ lw $t2, 0x38($sp) diff --git a/asm/non_matchings/printf/func_800B695C.s b/asm/non_matchings/printf/func_800B695C.s deleted file mode 100644 index f9acd21e..00000000 --- a/asm/non_matchings/printf/func_800B695C.s +++ /dev/null @@ -1,44 +0,0 @@ -glabel func_800B695C -/* 0B755C 800B695C 8FAF0010 */ lw $t7, 0x10($sp) -/* 0B7560 800B6960 00A77026 */ xor $t6, $a1, $a3 -/* 0B7564 800B6964 00CFC026 */ xor $t8, $a2, $t7 -/* 0B7568 800B6968 2F180001 */ sltiu $t8, $t8, 1 -/* 0B756C 800B696C 2DCE0001 */ sltiu $t6, $t6, 1 -/* 0B7570 800B6970 01D8C825 */ or $t9, $t6, $t8 -/* 0B7574 800B6974 1720001F */ bnez $t9, .L800B69F4 -/* 0B7578 800B6978 2CA10002 */ sltiu $at, $a1, 2 -/* 0B757C 800B697C 14200002 */ bnez $at, .L800B6988 -/* 0B7580 800B6980 24E70002 */ addiu $a3, $a3, 2 -/* 0B7584 800B6984 24A5FFFE */ addiu $a1, $a1, -2 -.L800B6988: -/* 0B7588 800B6988 8C830000 */ lw $v1, ($a0) -/* 0B758C 800B698C 3C0AFCFF */ lui $t2, (0xFCFFFFFF >> 16) # lui $t2, 0xfcff -/* 0B7590 800B6990 24690008 */ addiu $t1, $v1, 8 -/* 0B7594 800B6994 AC890000 */ sw $t1, ($a0) -/* 0B7598 800B6998 3C0BFFFD */ lui $t3, (0xFFFDF6FB >> 16) # lui $t3, 0xfffd -/* 0B759C 800B699C 356BF6FB */ ori $t3, (0xFFFDF6FB & 0xFFFF) # ori $t3, $t3, 0xf6fb -/* 0B75A0 800B69A0 354AFFFF */ ori $t2, (0xFCFFFFFF & 0xFFFF) # ori $t2, $t2, 0xffff -/* 0B75A4 800B69A4 AC6A0000 */ sw $t2, ($v1) -/* 0B75A8 800B69A8 AC6B0004 */ sw $t3, 4($v1) -/* 0B75AC 800B69AC 8C830000 */ lw $v1, ($a0) -/* 0B75B0 800B69B0 30ED03FF */ andi $t5, $a3, 0x3ff -/* 0B75B4 800B69B4 246C0008 */ addiu $t4, $v1, 8 -/* 0B75B8 800B69B8 AC8C0000 */ sw $t4, ($a0) -/* 0B75BC 800B69BC 8FB80010 */ lw $t8, 0x10($sp) -/* 0B75C0 800B69C0 000D7B80 */ sll $t7, $t5, 0xe -/* 0B75C4 800B69C4 3C01F600 */ lui $at, 0xf600 -/* 0B75C8 800B69C8 01E17025 */ or $t6, $t7, $at -/* 0B75CC 800B69CC 30CD03FF */ andi $t5, $a2, 0x3ff -/* 0B75D0 800B69D0 30AB03FF */ andi $t3, $a1, 0x3ff -/* 0B75D4 800B69D4 331903FF */ andi $t9, $t8, 0x3ff -/* 0B75D8 800B69D8 00194880 */ sll $t1, $t9, 2 -/* 0B75DC 800B69DC 000B6380 */ sll $t4, $t3, 0xe -/* 0B75E0 800B69E0 000D7880 */ sll $t7, $t5, 2 -/* 0B75E4 800B69E4 018FC025 */ or $t8, $t4, $t7 -/* 0B75E8 800B69E8 01C95025 */ or $t2, $t6, $t1 -/* 0B75EC 800B69EC AC6A0000 */ sw $t2, ($v1) -/* 0B75F0 800B69F0 AC780004 */ sw $t8, 4($v1) -.L800B69F4: -/* 0B75F4 800B69F4 03E00008 */ jr $ra -/* 0B75F8 800B69F8 00000000 */ nop - diff --git a/asm/non_matchings/printf/func_800B69FC.s b/asm/non_matchings/printf/func_800B69FC.s deleted file mode 100644 index 2b419fb9..00000000 --- a/asm/non_matchings/printf/func_800B69FC.s +++ /dev/null @@ -1,288 +0,0 @@ -glabel func_800B69FC -/* 0B75FC 800B69FC 28A10040 */ slti $at, $a1, 0x40 -/* 0B7600 800B6A00 10200043 */ beqz $at, .L800B6B10 -/* 0B7604 800B6A04 3C038012 */ lui $v1, %hi(D_80127CCC) # $v1, 0x8012 -/* 0B7608 800B6A08 24637CCC */ addiu $v1, %lo(D_80127CCC) # addiu $v1, $v1, 0x7ccc -/* 0B760C 800B6A0C 8C6E0000 */ lw $t6, ($v1) -/* 0B7610 800B6A10 3C0F8012 */ lui $t7, %hi(D_80127CB8) # $t7, 0x8012 -/* 0B7614 800B6A14 11C0003C */ beqz $t6, .L800B6B08 -/* 0B7618 800B6A18 00000000 */ nop -/* 0B761C 800B6A1C 8DEF7CB8 */ lw $t7, %lo(D_80127CB8)($t7) -/* 0B7620 800B6A20 3C19FD70 */ lui $t9, 0xfd70 -/* 0B7624 800B6A24 11E00037 */ beqz $t7, .L800B6B04 -/* 0B7628 800B6A28 3C0C8012 */ lui $t4, %hi(gTexture0) # $t4, 0x8012 -/* 0B762C 800B6A2C 8C820000 */ lw $v0, ($a0) -/* 0B7630 800B6A30 3C018000 */ lui $at, (0x80000020 >> 16) # lui $at, 0x8000 -/* 0B7634 800B6A34 24580008 */ addiu $t8, $v0, 8 -/* 0B7638 800B6A38 AC980000 */ sw $t8, ($a0) -/* 0B763C 800B6A3C AC590000 */ sw $t9, ($v0) -/* 0B7640 800B6A40 8D8C7CA0 */ lw $t4, %lo(gTexture0)($t4) -/* 0B7644 800B6A44 34210020 */ ori $at, (0x80000020 & 0xFFFF) # ori $at, $at, 0x20 -/* 0B7648 800B6A48 01816821 */ addu $t5, $t4, $at -/* 0B764C 800B6A4C AC4D0004 */ sw $t5, 4($v0) -/* 0B7650 800B6A50 8C820000 */ lw $v0, ($a0) -/* 0B7654 800B6A54 3C180708 */ lui $t8, (0x07080200 >> 16) # lui $t8, 0x708 -/* 0B7658 800B6A58 244E0008 */ addiu $t6, $v0, 8 -/* 0B765C 800B6A5C AC8E0000 */ sw $t6, ($a0) -/* 0B7660 800B6A60 37180200 */ ori $t8, (0x07080200 & 0xFFFF) # ori $t8, $t8, 0x200 -/* 0B7664 800B6A64 3C0FF570 */ lui $t7, 0xf570 -/* 0B7668 800B6A68 AC4F0000 */ sw $t7, ($v0) -/* 0B766C 800B6A6C AC580004 */ sw $t8, 4($v0) -/* 0B7670 800B6A70 8C820000 */ lw $v0, ($a0) -/* 0B7674 800B6A74 3C0CE600 */ lui $t4, 0xe600 -/* 0B7678 800B6A78 24590008 */ addiu $t9, $v0, 8 -/* 0B767C 800B6A7C AC990000 */ sw $t9, ($a0) -/* 0B7680 800B6A80 AC400004 */ sw $zero, 4($v0) -/* 0B7684 800B6A84 AC4C0000 */ sw $t4, ($v0) -/* 0B7688 800B6A88 8C820000 */ lw $v0, ($a0) -/* 0B768C 800B6A8C 3C0F0741 */ lui $t7, (0x0741F056 >> 16) # lui $t7, 0x741 -/* 0B7690 800B6A90 244D0008 */ addiu $t5, $v0, 8 -/* 0B7694 800B6A94 AC8D0000 */ sw $t5, ($a0) -/* 0B7698 800B6A98 35EFF056 */ ori $t7, (0x0741F056 & 0xFFFF) # ori $t7, $t7, 0xf056 -/* 0B769C 800B6A9C 3C0EF300 */ lui $t6, 0xf300 -/* 0B76A0 800B6AA0 AC4E0000 */ sw $t6, ($v0) -/* 0B76A4 800B6AA4 AC4F0004 */ sw $t7, 4($v0) -/* 0B76A8 800B6AA8 8C820000 */ lw $v0, ($a0) -/* 0B76AC 800B6AAC 3C19E700 */ lui $t9, 0xe700 -/* 0B76B0 800B6AB0 24580008 */ addiu $t8, $v0, 8 -/* 0B76B4 800B6AB4 AC980000 */ sw $t8, ($a0) -/* 0B76B8 800B6AB8 AC400004 */ sw $zero, 4($v0) -/* 0B76BC 800B6ABC AC590000 */ sw $t9, ($v0) -/* 0B76C0 800B6AC0 8C820000 */ lw $v0, ($a0) -/* 0B76C4 800B6AC4 3C0E0008 */ lui $t6, (0x00080200 >> 16) # lui $t6, 8 -/* 0B76C8 800B6AC8 244C0008 */ addiu $t4, $v0, 8 -/* 0B76CC 800B6ACC AC8C0000 */ sw $t4, ($a0) -/* 0B76D0 800B6AD0 3C0DF568 */ lui $t5, (0xF5683000 >> 16) # lui $t5, 0xf568 -/* 0B76D4 800B6AD4 35AD3000 */ ori $t5, (0xF5683000 & 0xFFFF) # ori $t5, $t5, 0x3000 -/* 0B76D8 800B6AD8 35CE0200 */ ori $t6, (0x00080200 & 0xFFFF) # ori $t6, $t6, 0x200 -/* 0B76DC 800B6ADC AC4E0004 */ sw $t6, 4($v0) -/* 0B76E0 800B6AE0 AC4D0000 */ sw $t5, ($v0) -/* 0B76E4 800B6AE4 8C820000 */ lw $v0, ($a0) -/* 0B76E8 800B6AE8 3C19002F */ lui $t9, (0x002FC028 >> 16) # lui $t9, 0x2f -/* 0B76EC 800B6AEC 244F0008 */ addiu $t7, $v0, 8 -/* 0B76F0 800B6AF0 AC8F0000 */ sw $t7, ($a0) -/* 0B76F4 800B6AF4 3739C028 */ ori $t9, (0x002FC028 & 0xFFFF) # ori $t9, $t9, 0xc028 -/* 0B76F8 800B6AF8 3C18F200 */ lui $t8, 0xf200 -/* 0B76FC 800B6AFC AC580000 */ sw $t8, ($v0) -/* 0B7700 800B6B00 AC590004 */ sw $t9, 4($v0) -.L800B6B04: -/* 0B7704 800B6B04 AC600000 */ sw $zero, ($v1) -.L800B6B08: -/* 0B7708 800B6B08 1000008A */ b .L800B6D34 -/* 0B770C 800B6B0C 24A5FFDF */ addiu $a1, $a1, -0x21 -.L800B6B10: -/* 0B7710 800B6B10 28A10060 */ slti $at, $a1, 0x60 -/* 0B7714 800B6B14 10200043 */ beqz $at, .L800B6C24 -/* 0B7718 800B6B18 3C038012 */ lui $v1, %hi(D_80127CCC) # $v1, 0x8012 -/* 0B771C 800B6B1C 24637CCC */ addiu $v1, %lo(D_80127CCC) # addiu $v1, $v1, 0x7ccc -/* 0B7720 800B6B20 8C6C0000 */ lw $t4, ($v1) -/* 0B7724 800B6B24 24060001 */ li $a2, 1 -/* 0B7728 800B6B28 10CC003C */ beq $a2, $t4, .L800B6C1C -/* 0B772C 800B6B2C 3C0D8012 */ lui $t5, %hi(D_80127CB8) # $t5, 0x8012 -/* 0B7730 800B6B30 8DAD7CB8 */ lw $t5, %lo(D_80127CB8)($t5) -/* 0B7734 800B6B34 3C0FFD70 */ lui $t7, 0xfd70 -/* 0B7738 800B6B38 11A00037 */ beqz $t5, .L800B6C18 -/* 0B773C 800B6B3C 3C188012 */ lui $t8, %hi(gTexture1) # $t8, 0x8012 -/* 0B7740 800B6B40 8C820000 */ lw $v0, ($a0) -/* 0B7744 800B6B44 3C018000 */ lui $at, (0x80000020 >> 16) # lui $at, 0x8000 -/* 0B7748 800B6B48 244E0008 */ addiu $t6, $v0, 8 -/* 0B774C 800B6B4C AC8E0000 */ sw $t6, ($a0) -/* 0B7750 800B6B50 AC4F0000 */ sw $t7, ($v0) -/* 0B7754 800B6B54 8F187CA4 */ lw $t8, %lo(gTexture1)($t8) -/* 0B7758 800B6B58 34210020 */ ori $at, (0x80000020 & 0xFFFF) # ori $at, $at, 0x20 -/* 0B775C 800B6B5C 0301C821 */ addu $t9, $t8, $at -/* 0B7760 800B6B60 AC590004 */ sw $t9, 4($v0) -/* 0B7764 800B6B64 8C820000 */ lw $v0, ($a0) -/* 0B7768 800B6B68 3C0E0708 */ lui $t6, (0x07080200 >> 16) # lui $t6, 0x708 -/* 0B776C 800B6B6C 244C0008 */ addiu $t4, $v0, 8 -/* 0B7770 800B6B70 AC8C0000 */ sw $t4, ($a0) -/* 0B7774 800B6B74 35CE0200 */ ori $t6, (0x07080200 & 0xFFFF) # ori $t6, $t6, 0x200 -/* 0B7778 800B6B78 3C0DF570 */ lui $t5, 0xf570 -/* 0B777C 800B6B7C AC4D0000 */ sw $t5, ($v0) -/* 0B7780 800B6B80 AC4E0004 */ sw $t6, 4($v0) -/* 0B7784 800B6B84 8C820000 */ lw $v0, ($a0) -/* 0B7788 800B6B88 3C18E600 */ lui $t8, 0xe600 -/* 0B778C 800B6B8C 244F0008 */ addiu $t7, $v0, 8 -/* 0B7790 800B6B90 AC8F0000 */ sw $t7, ($a0) -/* 0B7794 800B6B94 AC400004 */ sw $zero, 4($v0) -/* 0B7798 800B6B98 AC580000 */ sw $t8, ($v0) -/* 0B779C 800B6B9C 8C820000 */ lw $v0, ($a0) -/* 0B77A0 800B6BA0 3C0D0755 */ lui $t5, (0x07553043 >> 16) # lui $t5, 0x755 -/* 0B77A4 800B6BA4 24590008 */ addiu $t9, $v0, 8 -/* 0B77A8 800B6BA8 AC990000 */ sw $t9, ($a0) -/* 0B77AC 800B6BAC 35AD3043 */ ori $t5, (0x07553043 & 0xFFFF) # ori $t5, $t5, 0x3043 -/* 0B77B0 800B6BB0 3C0CF300 */ lui $t4, 0xf300 -/* 0B77B4 800B6BB4 AC4C0000 */ sw $t4, ($v0) -/* 0B77B8 800B6BB8 AC4D0004 */ sw $t5, 4($v0) -/* 0B77BC 800B6BBC 8C820000 */ lw $v0, ($a0) -/* 0B77C0 800B6BC0 3C0FE700 */ lui $t7, 0xe700 -/* 0B77C4 800B6BC4 244E0008 */ addiu $t6, $v0, 8 -/* 0B77C8 800B6BC8 AC8E0000 */ sw $t6, ($a0) -/* 0B77CC 800B6BCC AC400004 */ sw $zero, 4($v0) -/* 0B77D0 800B6BD0 AC4F0000 */ sw $t7, ($v0) -/* 0B77D4 800B6BD4 8C820000 */ lw $v0, ($a0) -/* 0B77D8 800B6BD8 3C0C0008 */ lui $t4, (0x00080200 >> 16) # lui $t4, 8 -/* 0B77DC 800B6BDC 24580008 */ addiu $t8, $v0, 8 -/* 0B77E0 800B6BE0 AC980000 */ sw $t8, ($a0) -/* 0B77E4 800B6BE4 3C19F568 */ lui $t9, (0xF5683E00 >> 16) # lui $t9, 0xf568 -/* 0B77E8 800B6BE8 37393E00 */ ori $t9, (0xF5683E00 & 0xFFFF) # ori $t9, $t9, 0x3e00 -/* 0B77EC 800B6BEC 358C0200 */ ori $t4, (0x00080200 & 0xFFFF) # ori $t4, $t4, 0x200 -/* 0B77F0 800B6BF0 AC4C0004 */ sw $t4, 4($v0) -/* 0B77F4 800B6BF4 AC590000 */ sw $t9, ($v0) -/* 0B77F8 800B6BF8 8C820000 */ lw $v0, ($a0) -/* 0B77FC 800B6BFC 3C0F003D */ lui $t7, (0x003DC028 >> 16) # lui $t7, 0x3d -/* 0B7800 800B6C00 244D0008 */ addiu $t5, $v0, 8 -/* 0B7804 800B6C04 AC8D0000 */ sw $t5, ($a0) -/* 0B7808 800B6C08 35EFC028 */ ori $t7, (0x003DC028 & 0xFFFF) # ori $t7, $t7, 0xc028 -/* 0B780C 800B6C0C 3C0EF200 */ lui $t6, 0xf200 -/* 0B7810 800B6C10 AC4E0000 */ sw $t6, ($v0) -/* 0B7814 800B6C14 AC4F0004 */ sw $t7, 4($v0) -.L800B6C18: -/* 0B7818 800B6C18 AC660000 */ sw $a2, ($v1) -.L800B6C1C: -/* 0B781C 800B6C1C 10000045 */ b .L800B6D34 -/* 0B7820 800B6C20 24A5FFC0 */ addiu $a1, $a1, -0x40 -.L800B6C24: -/* 0B7824 800B6C24 28A10080 */ slti $at, $a1, 0x80 -/* 0B7828 800B6C28 10200042 */ beqz $at, .L800B6D34 -/* 0B782C 800B6C2C 3C038012 */ lui $v1, %hi(D_80127CCC) # $v1, 0x8012 -/* 0B7830 800B6C30 24637CCC */ addiu $v1, %lo(D_80127CCC) # addiu $v1, $v1, 0x7ccc -/* 0B7834 800B6C34 8C780000 */ lw $t8, ($v1) -/* 0B7838 800B6C38 24060002 */ li $a2, 2 -/* 0B783C 800B6C3C 10D8003D */ beq $a2, $t8, .L800B6D34 -/* 0B7840 800B6C40 24A5FFA0 */ addiu $a1, $a1, -0x60 -/* 0B7844 800B6C44 3C198012 */ lui $t9, %hi(D_80127CB8) # $t9, 0x8012 -/* 0B7848 800B6C48 8F397CB8 */ lw $t9, %lo(D_80127CB8)($t9) -/* 0B784C 800B6C4C 3C0DFD70 */ lui $t5, 0xfd70 -/* 0B7850 800B6C50 13200037 */ beqz $t9, .L800B6D30 -/* 0B7854 800B6C54 3C0E8012 */ lui $t6, %hi(gTexture2) # $t6, 0x8012 -/* 0B7858 800B6C58 8C820000 */ lw $v0, ($a0) -/* 0B785C 800B6C5C 3C018000 */ lui $at, (0x80000020 >> 16) # lui $at, 0x8000 -/* 0B7860 800B6C60 244C0008 */ addiu $t4, $v0, 8 -/* 0B7864 800B6C64 AC8C0000 */ sw $t4, ($a0) -/* 0B7868 800B6C68 AC4D0000 */ sw $t5, ($v0) -/* 0B786C 800B6C6C 8DCE7CA8 */ lw $t6, %lo(gTexture2)($t6) -/* 0B7870 800B6C70 34210020 */ ori $at, (0x80000020 & 0xFFFF) # ori $at, $at, 0x20 -/* 0B7874 800B6C74 01C17821 */ addu $t7, $t6, $at -/* 0B7878 800B6C78 AC4F0004 */ sw $t7, 4($v0) -/* 0B787C 800B6C7C 8C820000 */ lw $v0, ($a0) -/* 0B7880 800B6C80 3C0C0708 */ lui $t4, (0x07080200 >> 16) # lui $t4, 0x708 -/* 0B7884 800B6C84 24580008 */ addiu $t8, $v0, 8 -/* 0B7888 800B6C88 AC980000 */ sw $t8, ($a0) -/* 0B788C 800B6C8C 358C0200 */ ori $t4, (0x07080200 & 0xFFFF) # ori $t4, $t4, 0x200 -/* 0B7890 800B6C90 3C19F570 */ lui $t9, 0xf570 -/* 0B7894 800B6C94 AC590000 */ sw $t9, ($v0) -/* 0B7898 800B6C98 AC4C0004 */ sw $t4, 4($v0) -/* 0B789C 800B6C9C 8C820000 */ lw $v0, ($a0) -/* 0B78A0 800B6CA0 3C0EE600 */ lui $t6, 0xe600 -/* 0B78A4 800B6CA4 244D0008 */ addiu $t5, $v0, 8 -/* 0B78A8 800B6CA8 AC8D0000 */ sw $t5, ($a0) -/* 0B78AC 800B6CAC AC400004 */ sw $zero, 4($v0) -/* 0B78B0 800B6CB0 AC4E0000 */ sw $t6, ($v0) -/* 0B78B4 800B6CB4 8C820000 */ lw $v0, ($a0) -/* 0B78B8 800B6CB8 3C190741 */ lui $t9, (0x0741F056 >> 16) # lui $t9, 0x741 -/* 0B78BC 800B6CBC 244F0008 */ addiu $t7, $v0, 8 -/* 0B78C0 800B6CC0 AC8F0000 */ sw $t7, ($a0) -/* 0B78C4 800B6CC4 3739F056 */ ori $t9, (0x0741F056 & 0xFFFF) # ori $t9, $t9, 0xf056 -/* 0B78C8 800B6CC8 3C18F300 */ lui $t8, 0xf300 -/* 0B78CC 800B6CCC AC580000 */ sw $t8, ($v0) -/* 0B78D0 800B6CD0 AC590004 */ sw $t9, 4($v0) -/* 0B78D4 800B6CD4 8C820000 */ lw $v0, ($a0) -/* 0B78D8 800B6CD8 3C0DE700 */ lui $t5, 0xe700 -/* 0B78DC 800B6CDC 244C0008 */ addiu $t4, $v0, 8 -/* 0B78E0 800B6CE0 AC8C0000 */ sw $t4, ($a0) -/* 0B78E4 800B6CE4 AC400004 */ sw $zero, 4($v0) -/* 0B78E8 800B6CE8 AC4D0000 */ sw $t5, ($v0) -/* 0B78EC 800B6CEC 8C820000 */ lw $v0, ($a0) -/* 0B78F0 800B6CF0 3C180008 */ lui $t8, (0x00080200 >> 16) # lui $t8, 8 -/* 0B78F4 800B6CF4 244E0008 */ addiu $t6, $v0, 8 -/* 0B78F8 800B6CF8 AC8E0000 */ sw $t6, ($a0) -/* 0B78FC 800B6CFC 3C0FF568 */ lui $t7, (0xF5683000 >> 16) # lui $t7, 0xf568 -/* 0B7900 800B6D00 35EF3000 */ ori $t7, (0xF5683000 & 0xFFFF) # ori $t7, $t7, 0x3000 -/* 0B7904 800B6D04 37180200 */ ori $t8, (0x00080200 & 0xFFFF) # ori $t8, $t8, 0x200 -/* 0B7908 800B6D08 AC580004 */ sw $t8, 4($v0) -/* 0B790C 800B6D0C AC4F0000 */ sw $t7, ($v0) -/* 0B7910 800B6D10 8C820000 */ lw $v0, ($a0) -/* 0B7914 800B6D14 3C0D002F */ lui $t5, (0x002FC028 >> 16) # lui $t5, 0x2f -/* 0B7918 800B6D18 24590008 */ addiu $t9, $v0, 8 -/* 0B791C 800B6D1C AC990000 */ sw $t9, ($a0) -/* 0B7920 800B6D20 35ADC028 */ ori $t5, (0x002FC028 & 0xFFFF) # ori $t5, $t5, 0xc028 -/* 0B7924 800B6D24 3C0CF200 */ lui $t4, 0xf200 -/* 0B7928 800B6D28 AC4C0000 */ sw $t4, ($v0) -/* 0B792C 800B6D2C AC4D0004 */ sw $t5, 4($v0) -.L800B6D30: -/* 0B7930 800B6D30 AC660000 */ sw $a2, ($v1) -.L800B6D34: -/* 0B7934 800B6D34 3C038012 */ lui $v1, %hi(D_80127CCC) # $v1, 0x8012 -/* 0B7938 800B6D38 24637CCC */ addiu $v1, %lo(D_80127CCC) # addiu $v1, $v1, 0x7ccc -/* 0B793C 800B6D3C 8C6E0000 */ lw $t6, ($v1) -/* 0B7940 800B6D40 0005C040 */ sll $t8, $a1, 1 -/* 0B7944 800B6D44 3C0C800E */ lui $t4, %hi(D_800E2EF4) # $t4, 0x800e -/* 0B7948 800B6D48 000E7980 */ sll $t7, $t6, 6 -/* 0B794C 800B6D4C 01F8C821 */ addu $t9, $t7, $t8 -/* 0B7950 800B6D50 258C2EF4 */ addiu $t4, %lo(D_800E2EF4) # addiu $t4, $t4, 0x2ef4 -/* 0B7954 800B6D54 032C1021 */ addu $v0, $t9, $t4 -/* 0B7958 800B6D58 90460000 */ lbu $a2, ($v0) -/* 0B795C 800B6D5C 904D0001 */ lbu $t5, 1($v0) -/* 0B7960 800B6D60 3C0E8012 */ lui $t6, %hi(D_80127CB8) # $t6, 0x8012 -/* 0B7964 800B6D64 8DCE7CB8 */ lw $t6, %lo(D_80127CB8)($t6) -/* 0B7968 800B6D68 01A63823 */ subu $a3, $t5, $a2 -/* 0B796C 800B6D6C 11C00036 */ beqz $t6, .L800B6E48 -/* 0B7970 800B6D70 24E70001 */ addiu $a3, $a3, 1 -/* 0B7974 800B6D74 8C820000 */ lw $v0, ($a0) -/* 0B7978 800B6D78 3C18FCFF */ lui $t8, (0xFCFFFFFF >> 16) # lui $t8, 0xfcff -/* 0B797C 800B6D7C 244F0008 */ addiu $t7, $v0, 8 -/* 0B7980 800B6D80 AC8F0000 */ sw $t7, ($a0) -/* 0B7984 800B6D84 3C19FFFE */ lui $t9, (0xFFFEF379 >> 16) # lui $t9, 0xfffe -/* 0B7988 800B6D88 3739F379 */ ori $t9, (0xFFFEF379 & 0xFFFF) # ori $t9, $t9, 0xf379 -/* 0B798C 800B6D8C 3718FFFF */ ori $t8, (0xFCFFFFFF & 0xFFFF) # ori $t8, $t8, 0xffff -/* 0B7990 800B6D90 AC580000 */ sw $t8, ($v0) -/* 0B7994 800B6D94 AC590004 */ sw $t9, 4($v0) -/* 0B7998 800B6D98 8C820000 */ lw $v0, ($a0) -/* 0B799C 800B6D9C 3C0A8012 */ lui $t2, %hi(D_80127CAC) # $t2, 0x8012 -/* 0B79A0 800B6DA0 244C0008 */ addiu $t4, $v0, 8 -/* 0B79A4 800B6DA4 254A7CAC */ addiu $t2, %lo(D_80127CAC) # addiu $t2, $t2, 0x7cac -/* 0B79A8 800B6DA8 AC8C0000 */ sw $t4, ($a0) -/* 0B79AC 800B6DAC 954D0000 */ lhu $t5, ($t2) -/* 0B79B0 800B6DB0 3C0B8012 */ lui $t3, %hi(D_80127CAE) # $t3, 0x8012 -/* 0B79B4 800B6DB4 01A77021 */ addu $t6, $t5, $a3 -/* 0B79B8 800B6DB8 256B7CAE */ addiu $t3, %lo(D_80127CAE) # addiu $t3, $t3, 0x7cae -/* 0B79BC 800B6DBC 956D0000 */ lhu $t5, ($t3) -/* 0B79C0 800B6DC0 000E7880 */ sll $t7, $t6, 2 -/* 0B79C4 800B6DC4 31F80FFF */ andi $t8, $t7, 0xfff -/* 0B79C8 800B6DC8 0018CB00 */ sll $t9, $t8, 0xc -/* 0B79CC 800B6DCC 25AE000A */ addiu $t6, $t5, 0xa -/* 0B79D0 800B6DD0 000E7880 */ sll $t7, $t6, 2 -/* 0B79D4 800B6DD4 3C01E400 */ lui $at, 0xe400 -/* 0B79D8 800B6DD8 03216025 */ or $t4, $t9, $at -/* 0B79DC 800B6DDC 31F80FFF */ andi $t8, $t7, 0xfff -/* 0B79E0 800B6DE0 0198C825 */ or $t9, $t4, $t8 -/* 0B79E4 800B6DE4 AC590000 */ sw $t9, ($v0) -/* 0B79E8 800B6DE8 954D0000 */ lhu $t5, ($t2) -/* 0B79EC 800B6DEC 95780000 */ lhu $t8, ($t3) -/* 0B79F0 800B6DF0 000D7080 */ sll $t6, $t5, 2 -/* 0B79F4 800B6DF4 31CF0FFF */ andi $t7, $t6, 0xfff -/* 0B79F8 800B6DF8 0018C880 */ sll $t9, $t8, 2 -/* 0B79FC 800B6DFC 332D0FFF */ andi $t5, $t9, 0xfff -/* 0B7A00 800B6E00 000F6300 */ sll $t4, $t7, 0xc -/* 0B7A04 800B6E04 018D7025 */ or $t6, $t4, $t5 -/* 0B7A08 800B6E08 AC4E0004 */ sw $t6, 4($v0) -/* 0B7A0C 800B6E0C 8C820000 */ lw $v0, ($a0) -/* 0B7A10 800B6E10 00066D40 */ sll $t5, $a2, 0x15 -/* 0B7A14 800B6E14 244F0008 */ addiu $t7, $v0, 8 -/* 0B7A18 800B6E18 AC8F0000 */ sw $t7, ($a0) -/* 0B7A1C 800B6E1C 3C18B300 */ lui $t8, 0xb300 -/* 0B7A20 800B6E20 AC580000 */ sw $t8, ($v0) -/* 0B7A24 800B6E24 AC4D0004 */ sw $t5, 4($v0) -/* 0B7A28 800B6E28 8C820000 */ lw $v0, ($a0) -/* 0B7A2C 800B6E2C 3C180400 */ lui $t8, (0x04000400 >> 16) # lui $t8, 0x400 -/* 0B7A30 800B6E30 244E0008 */ addiu $t6, $v0, 8 -/* 0B7A34 800B6E34 AC8E0000 */ sw $t6, ($a0) -/* 0B7A38 800B6E38 37180400 */ ori $t8, (0x04000400 & 0xFFFF) # ori $t8, $t8, 0x400 -/* 0B7A3C 800B6E3C 3C0FB200 */ lui $t7, 0xb200 -/* 0B7A40 800B6E40 AC4F0000 */ sw $t7, ($v0) -/* 0B7A44 800B6E44 AC580004 */ sw $t8, 4($v0) -.L800B6E48: -/* 0B7A48 800B6E48 03E00008 */ jr $ra -/* 0B7A4C 800B6E4C 00E01025 */ move $v0, $a3 - diff --git a/include/f3ddkr.h b/include/f3ddkr.h index 5d955c2f..3bc0cc41 100644 --- a/include/f3ddkr.h +++ b/include/f3ddkr.h @@ -19,6 +19,7 @@ #define DKR_CC_UNK9 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0 #define DKR_CC_UNK10 TEXEL0, 0, SCALE, 0, 0, 0, 0, TEXEL0 #define DKR_CC_UNK11 ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL0, 0, PRIMITIVE, 0 +#define DKR_CC_UNK12 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0 #define DKR_CC_ENVIRONMENT 0, 0, 0, ENVIRONMENT, 0, 0, 0, ENVIRONMENT #define DKR_CC_DECALFADEPRIM 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0 @@ -95,6 +96,9 @@ _g->words.w1 = (unsigned int)(address); \ } +#define gSPVertexDKR(pkt, v, n, v0) \ + gDma1p(pkt, G_VTX, v, (((n) * 8 + (n)) << 1) + 8,((n)-1)<<3|(((u32)(v) & 6))|(v0)) + #define TRIN_DISABLE_TEXTURE 0 #define TRIN_ENABLE_TEXTURE 1 @@ -107,6 +111,12 @@ _g->words.w1 = (unsigned int)(address); \ } +#define gSPPolygon(dl, ptr, numTris, texEnabled) { \ + Gfx *_g = (Gfx *)(dl); \ + _g->words.w0 = _SHIFTL(((numTris - 1) << 4) | (texEnabled), 16, 8) | _SHIFTL(G_TRIN, 24, 8) | _SHIFTL((numTris*16), 0, 16); \ + _g->words.w1 = (unsigned int)(ptr); \ +} + #define numberOfGfxCommands(gfxCmds) (sizeof(gfxCmds) / sizeof(Gwords)) #define gDkrDmaDisplayList(pkt, address, numberOfCommands) \ diff --git a/include/structs.h b/include/structs.h index 0d3715e5..7c62ee63 100644 --- a/include/structs.h +++ b/include/structs.h @@ -463,30 +463,36 @@ typedef struct ObjectModel_44 { } ObjectModel_44; typedef struct ObjectModel { -/* 0x00 */ TextureInfo *textures; -/* 0x04 */ Vertex *vertices; -/* 0x08 */ Triangle *triangles; -/* 0x0C */ s32 *unkC; -/* 0x10 */ s32 *unk10; - u8 pad0[0x0B]; -/* 0x1F */ s8 unk1F; - u8 pad20[2]; -/* 0x22 */ s16 numberOfTextures; -/* 0x24 */ s16 numberOfVertices; -/* 0x26 */ s16 numberOfTriangles; -/* 0x28 */ s16 numberOfBatches; - u8 pad2A[4]; -/* 0x2E */ u8 unk2E; -/* 0x30 */ s16 unk30; - u8 pad32[6]; -/* 0x38 */ TriangleBatchInfo *batches; -/* 0x3C */ u8 pad3C[4]; -/* 0x40 */ s32 *unk40; -/* 0x44 */ ObjectModel_44 *animations; -/* 0x48 */ s16 numberOfAnimations; -/* 0x4A */ u8 pad4A[6]; -/* 0x50 */ s16 unk50; -} ObjectModel; + /* 0x00 */ TextureInfo* textures; + /* 0x04 */ Vertex* vertices; + /* 0x08 */ Triangle* triangles; + /* 0x0C */ s32* unkC; + /* 0x10 */ s32* unk10; + /* 0x14 */ u8 unk14[0x4]; + /* 0x18 */ s32 unk18; + /* 0x1A */ s8 unk1A; + /* 0x1C */ s8 unk1C; + /* 0x1E */ s8 unk1E; + /* 0x1F */ s8 unk1F; + /* 0x20 */ u8 pad20[2]; + /* 0x22 */ s16 numberOfTextures; + /* 0x24 */ s16 numberOfVertices; + /* 0x26 */ s16 numberOfTriangles; + /* 0x28 */ s16 numberOfBatches; + /* 0x2A */ u8 pad2A[4]; + /* 0x2E */ u8 unk2E; + /* 0x2F */ char pad2F[1]; + /* 0x30 */ s16 unk30; + /* 0x32 */ u8 pad32[6]; + /* 0x38 */ TriangleBatchInfo* batches; + /* 0x3C */ u8 pad3C[4]; + /* 0x40 */ s32* unk40; + /* 0x44 */ ObjectModel_44* animations; + /* 0x48 */ s16 numberOfAnimations; + /* 0x4A */ u8 pad4A[6]; + /* 0x50 */ s16 unk50; + /* 0x52 */ s16 unk52; +} ObjectModel; /* Size: 0x44 bytes */ typedef struct LevelModelSegment { @@ -657,7 +663,7 @@ typedef struct Object_50 { } Object_50; typedef struct Object_54 { - s32 unk0; + f32 unk0; u8 unk4; u8 unk5; u8 unk6; @@ -672,6 +678,9 @@ typedef struct Object_54 { s16 unk12; s16 unk14; s16 unk16; + u8 unk18; + u8 unk19; + u8 unk1A; } Object_54; typedef struct Object_5C { @@ -682,6 +691,8 @@ typedef struct Object_5C { typedef struct Object_60 { s32 unk0; void *unk4; // Object* pointer + u8 unk8[0x24]; + s32 *unk2C; } Object_60; struct Object; @@ -1316,7 +1327,8 @@ typedef struct Object_68 { }; /* 0x04 */ s32 *unk4[3]; /* 0x10 */ s16 unk10; - /* 0x14 */ u8 pad14[13]; + /* 0x14 */ u8 pad14[12]; + /* 0x1E */ s8 unk1E; /* 0x1F */ s8 unk1F; /* 0x20 */ s8 unk20; /* 0x21 */ s8 unk21; @@ -1388,7 +1400,7 @@ typedef struct ObjectSegment { /* Size: 0x0630 bytes */ typedef struct Object { /* 0x0000 */ ObjectSegment segment; - /* 0x0044 */ void *unk44; + /* 0x0044 */ s32 *unk44; /* 0x0048 */ s16 behaviorId; /* 0x004A */ s16 unk4A; /* 0x004C */ Object_4C *unk4C; //player + 0x318 diff --git a/src/camera.c b/src/camera.c index b1064306..77ccba71 100644 --- a/src/camera.c +++ b/src/camera.c @@ -9,6 +9,7 @@ #include "video.h" #include "lib/src/libc/rmonPrintf.h" #include "math_util.h" +#include "weather.h" extern u32 osTvType; @@ -49,9 +50,8 @@ ScreenViewport gScreenViewports[4] = { s32 D_800DD134 = 0; -// Not sure about the typing here -UNUSED s16 D_800DD138[8] = { - 0, 0, 0, -1, -1, 0, 0, 0 +Vertex D_800DD138 = { + 0, 0, 0, 255, 255, 255, 255 }; // RSP Viewports @@ -244,7 +244,7 @@ s32 get_object_render_stack_pos(void) { return gObjectRenderStackPos; } -void func_80066230(Gfx **dlist, Mtx **mats) { +void func_80066230(Gfx **dlist, Matrix **mats) { ObjectSegment *someStruct; s16 sp2A; s16 sp28; @@ -608,7 +608,7 @@ UNUSED void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2) #define SCISSOR_INTERLACE G_SC_NON_INTERLACE -void func_80066CDC(Gfx **dlist, Mtx **mats) { +void func_80066CDC(Gfx **dlist, Matrix **mats) { u32 sp58; u32 sp54; u32 sp4C; @@ -834,7 +834,7 @@ void func_80067A3C(Gfx **dlist) { gDPSetScissor((*dlist)++, 0, 0, 0, width, height); } -void func_80067D3C(Gfx **dlist, UNUSED Mtx **mats) { +void func_80067D3C(Gfx **dlist, UNUSED Matrix **mats) { s32 temp; gSPPerspNormalize((*dlist)++, perspNorm); @@ -879,12 +879,11 @@ void func_80067D3C(Gfx **dlist, UNUSED Mtx **mats) { * Sets the Y value of the Y axis in the matrix to the passed value. * This is used to vertically scale ortho geometry to look identical across NTSC and PAL systems. */ - void set_ortho_matrix_height(f32 value) { gOrthoMatrix[1][1] = value; } -void func_80067F2C(Gfx **dlist, Mtx **mats) { +void func_80067F2C(Gfx **dlist, Matrix **mats) { u32 widthAndHeight; s32 width, height; s32 i, j; @@ -911,7 +910,7 @@ void func_80067F2C(Gfx **dlist, Mtx **mats) { } } -void func_8006807C(Gfx **dlist, Mtx **mats) { +void func_8006807C(Gfx **dlist, Matrix **mats) { func_8006FE74(&D_80121060, &D_800DD288); func_8006F768(&D_80121060, &D_80120EE0, &D_80120F20); func_8006FE74(D_80120D70[0], &D_800DD2A0); @@ -956,7 +955,7 @@ void func_800682AC(Gfx **dlist) { gObjectRenderStackPos = 0; } -void func_80068408(Gfx **dlist, Mtx **mats) { +void func_80068408(Gfx **dlist, Matrix **mats) { func_800705F8(D_80120D70[D_80120D1C], 0.0f, 0.0f, 0.0f); func_8006F768(D_80120D70[D_80120D1C], &D_80120F20, &D_80121060); func_8006F870(&D_80121060, (Matrix *)*mats); @@ -968,7 +967,117 @@ void func_80068508(s32 arg0) { D_80120D0C = arg0; } -GLOBAL_ASM("asm/non_matchings/camera/func_80068514.s") +/** + * Calculates angle from object to camera, then renders the sprite as a billboard, facing the camera. + */ +s32 render_sprite_billboard(Gfx **dlist, Matrix **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags) { + f32 sp5C; + f32 sp58; + Vertex *v; + f32 sp50; + f32 sp4C; + f32 temp_f0; + f32 sp44; + f32 var_f20; + s32 sp3C; + s32 sp38; + s32 sp34; + s32 result; + s32 var_s2; + + result = TRUE; + if (flags & 1) { + sp5C = D_80120D28[D_80120D20] - obj->segment.trans.x_position; + sp58 = D_80120D40[D_80120D20] - obj->segment.trans.y_position; + var_f20 = D_80120D58[D_80120D20] - obj->segment.trans.z_position; + sp4C = cosine_s(obj->segment.trans.y_rotation); + temp_f0 = sine_s(obj->segment.trans.y_rotation); + sp44 = (sp5C * temp_f0) + (var_f20 * sp4C); + var_f20 = (var_f20 * temp_f0) - (sp5C * sp4C); + sp38 = arctan2_f(sp44, sqrtf((sp58 * sp58) + (var_f20 * var_f20))); + sp3C = -func_80070830(arctan2_f(sp44, var_f20)) >> 8; + if (var_f20 < 0.0f) { + var_f20 = -var_f20; + sp3C = 1 - sp3C; + sp38 = -sp38; + } + sp34 = arctan2_f(sp58, var_f20); + if (sp34 > 0x8000) { + sp34 -= 0x10000; + } + sp34 = (sp34 * sp3C) >> 8; + var_s2 = (sp38 >> 7) & 0xFF; + if (var_s2 > 127) { + var_s2 = 255 - var_s2; + sp34 += 0x8000; + result = FALSE; + } + var_s2 *= 2; + sp5C = D_80120D28[D_80120D20] - obj->segment.trans.x_position; + sp58 = D_80120D40[D_80120D20] - obj->segment.trans.y_position; + var_f20 = D_80120D58[D_80120D20] - obj->segment.trans.z_position; + sp50 = sqrtf((sp5C * sp5C) + (var_f20 * var_f20)); + D_80120CF0.y_rotation = arctan2_f(sp5C, var_f20); + D_80120CF0.x_rotation = -arctan2_f(sp58, sp50); + D_80120CF0.z_rotation = sp34; + D_80120CF0.scale = obj->segment.trans.scale; + D_80120CF0.x_position = obj->segment.trans.x_position; + D_80120CF0.y_position = obj->segment.trans.y_position; + D_80120CF0.z_position = obj->segment.trans.z_position; + func_8006FC30(D_80121060, &D_80120CF0); + D_80120D1C++; + func_8006F768((Matrix*) D_80121060, (Matrix*)&D_80120D70[D_80120D1C-1][0][0], (Matrix*)&D_80120D70[D_80120D1C][0][0]); + func_8006F768(D_80120D70[D_80120D1C], (Matrix*) D_80120F20, (Matrix*) D_80121060); + func_8006F870((Matrix*) D_80121060, *mtx); + D_80120D88[D_80120D1C] = *mtx; + gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), 0x80); + gSPVertexDKR((*dlist)++, OS_K0_TO_PHYSICAL(&D_800DD138), 1, 0); + } else { + v = *vertexList; + v->x = obj->segment.trans.x_position; + v->y = obj->segment.trans.y_position; + v->z = obj->segment.trans.z_position; + v->r = 255; + v->g = 255; + v->b = 255; + v->a = 255; + gSPVertexDKR((*dlist)++, OS_PHYSICAL_TO_K0(*vertexList), 1, 0); + (*vertexList)++; + if (gCutsceneCameraActive == 0) { + sp34 = gObjectRenderStack[gObjectRenderStackPos].trans.z_rotation + obj->segment.trans.z_rotation; + } else { + sp34 = gObjectRenderStack[gObjectRenderStackPos + 4].trans.z_rotation + obj->segment.trans.z_rotation; + } + var_s2 = obj->segment.unk18; + D_80120D1C++; + func_80070130((f32 (*)[4]) D_80120D70[D_80120D1C], sp34, obj->segment.trans.scale, gVideoAspectRatio); + func_8006F870(D_80120D70[D_80120D1C], *mtx); + D_80120D88[D_80120D1C] = *mtx; + gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), 0x80); + gDkrEnableBillboard((*dlist)++); + } + if (D_80120D0C == 0) { + var_s2 = ((var_s2 & 0xFF) * arg4->unk0) >> 8; + } + flags &= ~1; + if (flags & 4) { + flags |= 1; + } + func_8007BF34(dlist, arg4->unk6 | (flags & 0xF)); + if (!(flags & 0x100)) { + gDPSetPrimColor((*dlist)++, 0, 0, 255, 255, 255, 255); + } + gSPDisplayList((*dlist)++, arg4->unk8[var_s2 + 1]); + D_80120D1C--; + if (D_80120D1C == 0) { + var_s2 = 0; + } else { + var_s2 = 1; + } + gDkrInsertMatrix((*dlist)++, 0, var_s2 << 6); + gDkrDisableBillboard((*dlist)++); + return result; +} void func_80068BF4(Gfx **arg0, Matrix **arg1, Vertex **arg2, ObjectSegment *arg3, unk80068BF4 *arg4, s32 arg5) { UNUSED s32 pad; diff --git a/src/camera.h b/src/camera.h index a4a626ce..d77efd90 100644 --- a/src/camera.h +++ b/src/camera.h @@ -92,9 +92,6 @@ typedef struct unk80068BF4 { extern ScreenViewport gScreenViewports[4]; -// Not sure about the typing here -extern s16 D_800DD138[8]; - // RSP Viewports extern Vp D_800DD148[20]; @@ -112,6 +109,14 @@ extern f32 D_80120D58[5]; extern f32 D_80120D40[6]; extern f32 D_80120D28[6]; +typedef struct unk80068514_arg4 { + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; + Gfx *unk8[1]; +} unk80068514_arg4; + //TODO: Figure out where these functions live: unknown_070110? void func_8006F870(Matrix *, Matrix *); //unknown_070110 void func_800705F8(Matrix *, f32, f32, f32); //From unknown_070110 @@ -128,7 +133,7 @@ UNUSED void calculate_camera_perspective(void); Matrix *func_80066204(void); s32 get_viewport_count(void); s32 get_object_render_stack_pos(void); -void func_80066230(Gfx **dlist, Mtx **arg1); +void func_80066230(Gfx **dlist, Matrix **arg1); f32 func_80066348(f32 xPos, f32 yPos, f32 zPos); void func_800663DC(s32 xPos, s32 yPos, s32 zPos, s32 arg3, s32 arg4, s32 arg5); void write_to_object_render_stack(s32 arg0, f32 xPos, f32 yPos, f32 zPos, s16 arg4, s16 arg5, s16 arg6); @@ -145,11 +150,11 @@ s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, 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 set_ortho_matrix_height(f32 value); -void func_80067F2C(Gfx **dlist, Mtx **mats); -void func_8006807C(Gfx **dlist, Mtx **mats); +void func_80067F2C(Gfx **dlist, Matrix **mats); +void func_8006807C(Gfx **dlist, Matrix **mats); void func_80068158(Gfx **dlist, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_800682AC(Gfx **dlist); -void func_80068408(Gfx **dlist, Mtx **mats); +void func_80068408(Gfx **dlist, Matrix **mats); void func_80068508(s32 arg0); ObjectSegment *func_80069CFC(void); ObjectSegment *func_80069D20(void); @@ -174,13 +179,14 @@ s8 clamp_joystick_y_axis(s32 player); s8 clamp_joystick(s8 stickMag); void disable_button_mask(void); s32 init_controllers(void); -void func_80067D3C(Gfx **dlist, UNUSED Mtx **mats); -void func_80067A3C(Gfx **dlist); +void func_80067D3C(Gfx **dlist, UNUSED Matrix **mats); +void func_80068BF4(Gfx **arg0, Matrix **arg1, Vertex **arg2, ObjectSegment *arg3, unk80068BF4 *arg4, s32 arg5); +s32 render_sprite_billboard(Gfx **dlist, Matrix **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags); // Non Matching void func_80066610(void); void func_80065EA0(void); s32 func_8006A1C4(s32 arg0, s32 logicUpdateRate); -void func_80066CDC(Gfx **dlist, Mtx **mats); +void func_80066CDC(Gfx **dlist, Matrix **mats); #endif diff --git a/src/fade_transition.c b/src/fade_transition.c index 3cd75bcf..372bedbb 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -338,7 +338,7 @@ s32 handle_transitions(s32 updateRate) { * The rendering portion of transitions. * First establishes an orthogonal matrix, then renders a transition effect onscreen. */ -void render_fade_transition(Gfx **dlist, Mtx **mats, VertexList **verts) { +void render_fade_transition(Gfx **dlist, Matrix **mats, VertexList **verts) { if (sTransitionStatus != TRANSITION_NONE) { if (osTvType == TV_TYPE_PAL) { set_ortho_matrix_height(1.4f); @@ -404,7 +404,7 @@ void func_800C0780(FadeTransition *transition) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0834.s") -void render_fade_fullscreen(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList **verts) { +void render_fade_fullscreen(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { s32 screenSize = get_video_width_and_height_as_s32(); gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, gCurFadeRed, gCurFadeGreen, gCurFadeBlue, gCurFadeAlpha); @@ -416,7 +416,7 @@ void render_fade_fullscreen(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList ** GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C0B00.s") GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1130.s") -void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { func_8007B3D0(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -426,7 +426,7 @@ void render_fade_barndoor_horizontal(Gfx **dlist, UNUSED Mtx **mats, UNUSED Vert } // This is exactly the same as render_fade_barndoor_horizontal; I wonder what gets changed then? -void render_fade_barndoor_vertical(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_vertical(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { func_8007B3D0(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -439,7 +439,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C15D4.s") GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C1EE8.s") #ifdef NON_EQUIVALENT -void render_fade_circle(Gfx **dlist, Mtx **mats, VertexList **verts) { +void render_fade_circle(Gfx **dlist, Matrix **mats, VertexList **verts) { u8 *addr, *addr2; func_8007B3D0(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); @@ -467,7 +467,7 @@ GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_circle.s") #ifdef NON_EQUIVALENT // This doesn't work properly. -void render_fade_waves(Gfx **dlist, Mtx **mats, VertexList **verts) { +void render_fade_waves(Gfx **dlist, Matrix **mats, VertexList **verts) { s32 i; func_8007B3D0(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); @@ -487,7 +487,7 @@ void render_fade_waves(Gfx **dlist, Mtx **mats, VertexList **verts) { GLOBAL_ASM("asm/non_matchings/fade_transition/render_fade_waves.s") #endif -void render_fade_barndoor_diagonal(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList **verts) { +void render_fade_barndoor_diagonal(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { func_8007B3D0(dlist); gSPDisplayList((*dlist)++, dTransitionShapeSettings); // TODO: Need to clean this up. @@ -528,7 +528,7 @@ void func_800C27A0(s32 updateRate) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C27A0.s") #endif -void render_fade_disabled(Gfx **dlist, UNUSED Mtx **mats, UNUSED VertexList **verts) { +void render_fade_disabled(Gfx **dlist, UNUSED Matrix **mats, UNUSED VertexList **verts) { s32 screenSize = get_video_width_and_height_as_s32(); gSPDisplayList((*dlist)++, dTransitionFadeSettings); gDPSetPrimColor((*dlist)++, 0, 0, (gLastFadeRed >> 16), (gLastFadeGreen >> 16), (gLastFadeBlue >> 16), 255); diff --git a/src/fade_transition.h b/src/fade_transition.h index 40b5523a..4723a8e6 100644 --- a/src/fade_transition.h +++ b/src/fade_transition.h @@ -41,16 +41,16 @@ void func_800C0180(void); u32 func_800C018C(void); void transition_end(void); s32 handle_transitions(s32 updateRate); -void render_fade_transition(Gfx **dlist, Mtx **mats, VertexList **verts); -void render_fade_fullscreen(Gfx **dlist, Mtx **mats, VertexList **verts); -void render_fade_barndoor_horizontal(Gfx **dlist, Mtx **mats, VertexList **verts); -void render_fade_barndoor_vertical(Gfx **dlist, Mtx **mats, VertexList **verts); -void render_fade_barndoor_diagonal(Gfx **dlist, Mtx **mats, VertexList **verts); -void render_fade_disabled(Gfx **dlist, Mtx **mats, VertexList **verts); +void render_fade_transition(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_fullscreen(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_barndoor_horizontal(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_barndoor_vertical(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_barndoor_diagonal(Gfx **dlist, Matrix **mats, VertexList **verts); +void render_fade_disabled(Gfx **dlist, Matrix **mats, VertexList **verts); void func_800C0780(FadeTransition *transition); -void render_fade_circle(Gfx **dlist, Mtx **mats, VertexList **verts); //Non Matching -void render_fade_waves(Gfx **dlist, Mtx **mats, VertexList **verts); //Non Matching +void render_fade_circle(Gfx **dlist, Matrix **mats, VertexList **verts); //Non Matching +void render_fade_waves(Gfx **dlist, Matrix **mats, VertexList **verts); //Non Matching void func_800C0834(s32); //Non Matching void func_800C1130(s32); //Non Matching void func_800C1EE8(s32); //Non Matching diff --git a/src/font.c b/src/font.c index 40033329..e31677b3 100644 --- a/src/font.c +++ b/src/font.c @@ -755,7 +755,7 @@ void func_800C56D0(s32 dialogueBoxID) { * Contains a timer that counts down two frames before closing a dialogue box * when the player exits out of one. */ -void render_dialogue_boxes(Gfx **dlist, Mtx **mat, VertexList **verts) { +void render_dialogue_boxes(Gfx **dlist, Matrix **mat, VertexList **verts) { s32 i; if (sDialogueBoxIsOpen) { @@ -840,7 +840,7 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) { /** * Render the selected dialogue box. Background first, then text. */ -void render_dialogue_box(Gfx **dlist, Mtx **mat, VertexList **verts, s32 dialogueBoxID) { +void render_dialogue_box(Gfx **dlist, Matrix **mat, VertexList **verts, s32 dialogueBoxID) { DialogueBoxBackground *dialogueBox; DialogueBox *dialogueTextBox; s32 i; diff --git a/src/font.h b/src/font.h index 2a9f0b22..a057f45e 100644 --- a/src/font.h +++ b/src/font.h @@ -187,9 +187,9 @@ UNUSED void func_800C564C(s32 dialogueBoxID); UNUSED void func_800C5678(s32 dialogueBoxID); UNUSED void func_800C56A4(s32 dialogueBoxID); void func_800C56D0(s32 dialogueBoxID); -void render_dialogue_boxes(Gfx **dlist, Mtx **mat, VertexList **verts); +void render_dialogue_boxes(Gfx **dlist, Matrix **mat, VertexList **verts); void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry); -void render_dialogue_box(Gfx **dlist, Mtx **mat, VertexList **verts, s32 dialogueBoxID); +void render_dialogue_box(Gfx **dlist, Matrix **mat, VertexList **verts, s32 dialogueBoxID); void parse_string_with_number(char *input, char *output, s32 number); void s32_to_string(char **outString, s32 number); diff --git a/src/game.c b/src/game.c index 66fe83ff..3b1959a7 100644 --- a/src/game.c +++ b/src/game.c @@ -139,8 +139,8 @@ s16 D_801211C8[20]; Gfx *gDisplayLists[2]; Gfx *gCurrDisplayList; UNUSED s32 D_801211FC; -Mtx *gHudMatrices[2]; -Mtx *gGameCurrMatrix; +Matrix *gHudMatrices[2]; +Matrix *gGameCurrMatrix; VertexList *gHudVertices[2]; VertexList *gGameCurrVertexList; TriangleList *gHudTriangles[2]; @@ -189,10 +189,10 @@ void func_8006A6B0(void) { s32 count; s32 checksumCount; u8 *sp44; - s32 temp2; + UNUSED s32 temp2; sp44 = allocate_from_main_pool_safe(sizeof(LevelHeader), COLOUR_TAG_YELLOW); - gTempAssetTable = load_asset_section_from_rom(ASSET_LEVEL_HEADERS_TABLE); + gTempAssetTable = (s32 *) load_asset_section_from_rom(ASSET_LEVEL_HEADERS_TABLE); i = 0; while (i < 16) { D_80121180[i++] = 0; @@ -203,10 +203,10 @@ void func_8006A6B0(void) { } gNumberOfLevelHeaders--; D_8012117C = allocate_from_main_pool_safe(gNumberOfLevelHeaders * sizeof(unk8012117C), COLOUR_TAG_YELLOW); - gCurrentLevelHeader = sp44; + gCurrentLevelHeader = (LevelHeader *) sp44; gNumberOfWorlds = -1; for (i = 0; i < gNumberOfLevelHeaders; i++) { - load_asset_to_address(ASSET_LEVEL_HEADERS, gCurrentLevelHeader, gTempAssetTable[i], sizeof(LevelHeader)); + load_asset_to_address(ASSET_LEVEL_HEADERS, (s32) gCurrentLevelHeader, gTempAssetTable[i], sizeof(LevelHeader)); if (gNumberOfWorlds < gCurrentLevelHeader->world) { gNumberOfWorlds = gCurrentLevelHeader->world; } @@ -234,7 +234,7 @@ void func_8006A6B0(void) { free_from_memory_pool(gTempAssetTable); free_from_memory_pool(sp44); - gTempAssetTable = load_asset_section_from_rom(ASSET_LEVEL_NAMES_TABLE); + gTempAssetTable = (s32 *) load_asset_section_from_rom(ASSET_LEVEL_NAMES_TABLE); for (i = 0; gTempAssetTable[i] != (-1); i++){} i--; @@ -244,9 +244,9 @@ void func_8006A6B0(void) { gLevelNames = allocate_from_main_pool_safe(i * sizeof(s32), COLOUR_TAG_YELLOW); D_800DD310 = allocate_from_main_pool_safe(temp, COLOUR_TAG_YELLOW); - load_asset_to_address(ASSET_LEVEL_NAMES, D_800DD310, 0, temp); + load_asset_to_address(ASSET_LEVEL_NAMES, (u32) D_800DD310, 0, temp); for (count = 0; count < i; count++) { - gLevelNames[count] = &D_800DD310[gTempAssetTable[count]]; + gLevelNames[count] = (u8 *) &D_800DD310[gTempAssetTable[count]]; } free_from_memory_pool(gTempAssetTable); @@ -934,7 +934,7 @@ void main_game_loop(void) { set_rsp_segment(&gCurrDisplayList, 4, gVideoLastFramebuffer - 0x500); init_rsp(&gCurrDisplayList); init_rdp_and_framebuffer(&gCurrDisplayList); - render_background(&gCurrDisplayList, (Mtx *) &gGameCurrMatrix, TRUE); + render_background(&gCurrDisplayList, (Matrix *) &gGameCurrMatrix, TRUE); D_800DD37C = func_8006A1C4(D_800DD37C, sLogicUpdateRate); if (get_lockup_status()) { render_epc_lock_up_display(); @@ -1372,7 +1372,7 @@ void ingame_logic_loop(s32 updateRate) { load_menu_with_level_background(MENU_UNUSED_8, -1, 0); } else { gIsLoading = TRUE; - load_menu_with_level_background(MENU_UNKNOWN_5, -1, -1); + load_menu_with_level_background(MENU_TRACK_SELECT_ADVENTURE, -1, -1); } } else if (!(buttonHeldInputs & R_TRIG)) { if (!(buttonHeldInputs & Z_TRIG)) { @@ -1915,7 +1915,7 @@ void func_8006EFDC(void) { D_8012350C = 3; size1 = (gNumF3dCmdsPerPlayer[3] * sizeof(Gwords)); - size2 = (gNumHudMatPerPlayer[3] * sizeof(Mtx)); + size2 = (gNumHudMatPerPlayer[3] * sizeof(Matrix)); size3 = (gNumHudVertsPerPlayer[3] * sizeof(Vertex)); size4 = (gNumHudTrisPerPlayer[3] * sizeof(Triangle)); totalSize = size1 + size2 + size3 + size4; diff --git a/src/game_ui.c b/src/game_ui.c index 8e39f480..61b6d1fd 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -14,6 +14,8 @@ #include "math_util.h" #include "objects.h" #include "game_text.h" +#include "object_models.h" +#include "unknown_0255E0.h" extern u32 osTvType; @@ -338,7 +340,7 @@ void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s3 } D_80126CDC = D_80126CE0[D_80126D08]; if (func_8001E440() != 10) { - if (gHUDNumPlayers == 0) { + if (gHUDNumPlayers == ONE_PLAYER) { if (get_buttons_pressed_from_player(D_80126D10) & D_CBUTTONS && racer->racer.raceFinished == FALSE && ((D_80126D60->race_type == RACETYPE_DEFAULT) || D_80126D60->race_type == RACETYPE_HORSESHOE_GULCH) && D_80126D34) { D_800E2790 = 1 - D_800E2790; play_sound_global((SOUND_TING_HIGHER + D_800E2790), NULL); @@ -358,7 +360,7 @@ void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s3 } if (get_buttons_pressed_from_player(D_80126D10) & R_CBUTTONS && racer->racer.raceFinished == FALSE && D_80126D34 && D_80126CD0 == 0) { D_800E27A4[gHUDNumPlayers] = 1 - D_800E27A4[gHUDNumPlayers]; - if (D_800E27A4[gHUDNumPlayers] == 0) { + if (D_800E27A4[gHUDNumPlayers] == FALSE) { play_sound_global(SOUND_TING_LOW, NULL); } else { play_sound_global(SOUND_TING_HIGH, NULL); @@ -414,7 +416,7 @@ void render_hud(Gfx **dList, Matrix **mtx, TriangleList **tris, Object *arg3, s3 } gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 255); func_800A7A60(arg3, &gHUDCurrDisplayList); - func_80067F2C(&gHUDCurrDisplayList, (Mtx** ) &gHUDCurrMatrix); + func_80067F2C(&gHUDCurrDisplayList, (Matrix **) &gHUDCurrMatrix); gDPSetEnvColor(gHUDCurrDisplayList++, 255, 255, 255, 0); sp2C = func_8001139C(&gHUDCurrDisplayList) >> 1; if (func_8000E4D8()) { @@ -582,7 +584,7 @@ void render_course_indicator_arrows(Object_64 *racer, s32 updateRate) { if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS && racer->racer.indicator_type < ASSET_TEX2D_30) { indicator->unk0 = (s16) (0x8000 - indicator->unk0); } - if (gHUDNumPlayers == 0 && racer->racer.raceFinished == FALSE && racer->racer.indicator_type && D_800E27B8 == 0) { + if (gHUDNumPlayers == ONE_PLAYER && racer->racer.raceFinished == FALSE && racer->racer.indicator_type && D_800E27B8 == 0) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 255, 255, 160); func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, indicator); indicator->unkC = -indicator->unkC; @@ -757,7 +759,7 @@ void render_speedometer(Object *obj, UNUSED s32 updateRate) { D_80126CDC->unk4C4 += ((vel - D_80126CDC->unk4C4) / 8); } } - if (D_800E27A4[gHUDNumPlayers] == 0) { + if (D_800E27A4[gHUDNumPlayers] == FALSE) { if (D_80126CD3 & 2) { opacity = 255.0f - ((D_80126CD0 * 255.0f) / D_8012718B); } else { @@ -793,7 +795,7 @@ void render_race_start(s32 arg0, s32 updateRate) { D_800E2770[0].unk3 = -1; D_800E2770[1].unk3 = -1; } - if (gHUDNumPlayers == 1) { + if (gHUDNumPlayers == TWO_PLAYERS) { func_8007BF1C(TRUE); } if (arg0 > 0) { @@ -831,7 +833,7 @@ void render_race_start(s32 arg0, s32 updateRate) { if (D_80126CDC->unk19A[D_80126D08] >= 60) { if (gRaceStartShowHudStep == 4) { // Mute background music in 3/4 player. - if (get_viewport_count() > 1) { + if (get_viewport_count() > TWO_PLAYERS) { play_music(SEQUENCE_NONE); } else { func_8006BD10(1.0f); @@ -864,7 +866,7 @@ void render_racer_bananas(Object_64 *obj, s32 updateRate) { s16 temp_v1; s32 temp_lo; u8 var_v1; - if(obj->racer.playerIndex == PLAYER_COMPUTER || ((gHUDNumPlayers < 1 || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == 2 || D_80126D60->race_type == 0x41 || D_80126D60->race_type == 0x40) && obj->racer.raceFinished == FALSE) && (gHUDNumPlayers < 1 || (obj->racer.lap < 1) || obj->racer.lap_times[obj->racer.lap] >= 180 || D_80126D60->race_type & 0x40)) { + if(obj->racer.playerIndex == PLAYER_COMPUTER || ((gHUDNumPlayers < TWO_PLAYERS || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == PLAYER_THREE || D_80126D60->race_type == RACETYPE_CHALLENGE_BANANAS || D_80126D60->race_type == RACETYPE_CHALLENGE_BATTLE) && obj->racer.raceFinished == FALSE) && (gHUDNumPlayers < TWO_PLAYERS || (obj->racer.lap < 1) || obj->racer.lap_times[obj->racer.lap] >= 180 || D_80126D60->race_type & RACETYPE_CHALLENGE)) { func_800AA600(&gHUDCurrDisplayList, (Matrix *) &gHUDCurrMatrix, (TriangleList *) &gHUDCurrTriList, (unk80126CDC *) &D_80126CDC->unk240); bananas = obj->racer.bananas; var_v1 = D_80126CDC->unkF8; @@ -1038,9 +1040,9 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A4C44.s") * In multiplayer, shows a cut down display, if the display setting is set to show laps. */ void render_lap_count(Object_64 *obj, s32 updateRate) { - if (obj->racer.raceFinished == FALSE && (gHUDNumPlayers <= 0 || obj->racer.lap <= 0 || obj->racer.lap_times[obj->racer.lap] >= 180) - && (gHUDNumPlayers <= 0 || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == 3)) { - if (D_80126D60->laps == (0, obj->racer.unk194 + 1) && gHUDNumPlayers < 2) { + if (obj->racer.raceFinished == FALSE && (gHUDNumPlayers <= ONE_PLAYER || obj->racer.lap <= 0 || obj->racer.lap_times[obj->racer.lap] >= 180) + && (gHUDNumPlayers <= ONE_PLAYER || D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] == 3)) { + if (D_80126D60->laps == (0, obj->racer.unk194 + 1) && gHUDNumPlayers < THREE_PLAYERS) { D_80126CDC->unk21A += updateRate; if (D_80126CDC->unk21A > 6) { D_80126CDC->unk218++; @@ -1062,7 +1064,7 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk68[0x38]); func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk68[0x58]); } - if (gHUDNumPlayers == 1) { + if (gHUDNumPlayers == TWO_PLAYERS) { func_8007BF1C(TRUE); } if (is_game_paused() == FALSE) { @@ -1073,13 +1075,13 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { D_80126CDC->unk3DD = 0; play_sound_global(SOUND_WHOOSH1, NULL); switch (gHUDNumPlayers) { - case 0: + case ONE_PLAYER: D_80126CDC->unk3DC = -21; D_80126CDC->unk3FC = 32; D_80126CDC->unk3CC = -200.0f; D_80126CDC->unk3EC = 211.0f; break; - case 1: + case TWO_PLAYERS: D_80126CDC->unk3DC = -16; D_80126CDC->unk3FC = 27; D_80126CDC->unk3CC = -200.0f; @@ -1105,13 +1107,13 @@ void render_lap_count(Object_64 *obj, s32 updateRate) { D_80126CDC->unk3DD = 0; play_sound_global(SOUND_WHOOSH1, NULL); switch (gHUDNumPlayers) { - case 0: + case ONE_PLAYER: D_80126CDC->unk3DC = 51; D_80126CDC->unk3BC = -41; D_80126CDC->unk3CC = 210.0f; D_80126CDC->unk3AC = -200.0f; break; - case 1: + case TWO_PLAYERS: D_80126CDC->unk3DC = 41; D_80126CDC->unk3BC = -31; D_80126CDC->unk3CC = 210.0f; @@ -1215,7 +1217,7 @@ void render_wrong_way_text(Object_64* obj, s32 updateRate) { f32 textMoveSpeed; f32 textPosTarget; - if (gHUDNumPlayers == 1) { + if (gHUDNumPlayers == TWO_PLAYERS) { func_8007BF1C(TRUE); } if (obj->racer.unk1FC > 120 && (gHUDNumPlayers || D_80126CDC->unk46C == D_80126CDC->unk47A[2]) && !is_game_paused()) { @@ -1274,10 +1276,10 @@ void render_wrong_way_text(Object_64* obj, s32 updateRate) { D_80126CDC->unk47A[2] = -31; D_80126CDC->unk49C = 52; D_80126CDC->unk47A[3] = 0; - if (gHUDNumPlayers == 1) { + if (gHUDNumPlayers == TWO_PLAYERS) { D_80126CDC->unk47A[2] = -21; D_80126CDC->unk49C = 42; - } else if (gHUDNumPlayers > 1) { + } else if (gHUDNumPlayers > TWO_PLAYERS) { if (obj->racer.playerIndex == PLAYER_ONE || obj->racer.playerIndex == PLAYER_THREE) { D_80126CDC->unk47A[2] = -100; D_80126CDC->unk49C = -55; @@ -1376,11 +1378,11 @@ void render_weapon_hud(Object *obj, s32 updateRate) { D_80126CDC->unk5C += updateRate; if (D_80126CDC->unk5C > 120) { D_80126CDC->unk5C = 120; - } else if (gHUDNumPlayers == 0) { + } else if (gHUDNumPlayers == ONE_PLAYER) { D_80126CDC->unk48 += 0.18 * cosine_s(((f32) D_80126CDC->unk5C * 682.6583 * 4.0)); } } - if (gHUDNumPlayers > 0) { + if (gHUDNumPlayers > ONE_PLAYER) { D_80126CDC->unk48 *= 0.75; } if (D_80126CDC->unk48 != 1.0) { @@ -1409,7 +1411,7 @@ void render_weapon_hud(Object *obj, s32 updateRate) { if (D_80126CDC->unk5B < 0) { D_80126CDC->unk5B = 0; } - if (gHUDNumPlayers) { + if (gHUDNumPlayers != ONE_PLAYER) { D_80126CDC->unk48 /= 2; } func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk40); @@ -1435,7 +1437,7 @@ void render_race_time(Object_64* obj, s32 updateRate) { s32 countingDown; s32 timerHideCounter; - if (!(gHUDNumPlayers && D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] != 1) || (gHUDNumPlayers > 0 && obj->racer.lap > 0 && obj->racer.lap_times[obj->racer.lap] < 180)) { + if (!(gHUDNumPlayers != ONE_PLAYER && D_800E2794[gHUDNumPlayers][obj->racer.playerIndex] != 1) || (gHUDNumPlayers > ONE_PLAYER && obj->racer.lap > 0 && obj->racer.lap_times[obj->racer.lap] < 180)) { if (obj->racer.raceFinished == FALSE) { timerHideCounter = D_80126CDC->unk15A + 127; if (obj->racer.lap > 0 && obj->racer.lap_times[obj->racer.lap] < 180 && obj->racer.lap < D_80126D60->laps) { @@ -1453,7 +1455,7 @@ void render_race_time(Object_64* obj, s32 updateRate) { D_80126CDC->unk15A = -127; timerHideCounter = 0; } - if (gHUDNumPlayers == 0) { + if (gHUDNumPlayers == ONE_PLAYER) { func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk140); } if (normalise_time(36000) < stopwatchTimer) { @@ -1472,7 +1474,7 @@ void render_race_time(Object_64* obj, s32 updateRate) { return; } else { if (gHideRaceTimer) { - if (gHUDNumPlayers == 0) { + if (gHUDNumPlayers == ONE_PLAYER) { play_sound_global(SOUND_HUD_LAP_TICK, NULL); } gHideRaceTimer = FALSE; @@ -1513,37 +1515,46 @@ s8 func_800A8458(void) { } #ifdef NON_MATCHING -s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateRate) { +void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRate) { + s32 pad2; LevelModel *lvlMdl; // sp158 s32 sp154; - Object **sp150; + Object **objectGroup; + s32 pad4; Object_Racer *someRacer; - s32 sp144; - s32 sp140; + s32 i; + s32 objectCount; + s32 pad6; ObjectTransform_800A8474 objTrans; // sp120 f32 sp11C; f32 sp118; f32 sp114; - s32 sp113; + u8 sp113; s32 mapOpacity; s32 opacity; - s32 spF4; - s32 spF0; + Object_Racer *pad11; + s32 pad10; + s32 pad12; + s32 pad5; + s32 sp144; + s32 pad1; + s32 pad8; + Object_Racer *curRacerObj; s32 spE4; s32 spE0; - s32 i; + s32 pad3; + s32 pad9; + s32 spF4; + s32 spF0; s32 racerCount; - s32 spBC; Object **racerGroup; ObjectSegment *someObjSeg; - Object_Racer *curRacerObj; - f32 temp_f14; - f32 var_f12; - f32 var_f16; - f32 var_f18; + s32 spBC; s32 temp_f16; s32 temp_f6; s32 temp_s0; + u16 new_var; + u8 new_var2; s32 temp_s0_2; s32 temp_s0_3; s32 temp_s1; @@ -1552,11 +1563,7 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR s32 temp_s3; Object *temp_v0_8; s32 var_a0_5; - s32 var_a1; - Object *someRacerObj; - ByteColour *charColour; s32 temp; - s32 temp2; func_800A0BD4(updateRate); @@ -1588,24 +1595,25 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR } } } + D_80126D60 = get_current_level_header(); - sp150 = get_racer_objects_by_port(&sp140); + objectGroup = get_racer_objects_by_port(&objectCount); gHUDCurrDisplayList = *dList; gHUDCurrMatrix = *mtx; gHUDCurrTriList = *triList; if (D_80126D60->race_type == RACETYPE_CHALLENGE_EGGS) { - if (D_80126D37 == 2 && D_800E27A4[gHUDNumPlayers] == 0) { + if (D_80126D37 == 2 && D_800E27A4[gHUDNumPlayers] == FALSE) { func_800A14F0(NULL, updateRate); func_8007B3D0(&gHUDCurrDisplayList); } else { if (D_80126D37 == 3) { - curRacerObj = NULL; - for(i = 0; i < sp140; i++) { - if (sp150[i]->unk64->racer.playerIndex == PLAYER_COMPUTER) { - curRacerObj = &sp150[i]->unk64->racer; + pad11 = NULL; + for(pad12 = 0; pad12 < objectCount; pad12++) { + if (objectGroup[pad12]->unk64->racer.playerIndex == PLAYER_COMPUTER) { + pad11 = &objectGroup[pad12]->unk64->racer; } } - if (curRacerObj != NULL) { + if (pad11 != NULL) { temp_s0 = D_80126CDC->unk64C; temp_s1 = D_80126CDC->unk650; spF4 = D_80126CDC->unk66C; @@ -1620,7 +1628,7 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126CDC->unk650 *= 1.1; D_80126CDC->unk670 *= 1.1; } - func_800A19A4(curRacerObj, updateRate); + func_800A19A4(pad11, updateRate); D_800E2834 = -2; D_80126CDC->unk64C = temp_s0; D_80126CDC->unk650 = temp_s1; @@ -1630,29 +1638,29 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR } } } else if (D_80126D60->race_type == RACETYPE_CHALLENGE_BATTLE) { - if (D_80126D37 == 2 && D_800E27A4[gHUDNumPlayers] == 0) { - func_80068508(1); + if (D_80126D37 == 2 && D_800E27A4[gHUDNumPlayers] == FALSE) { + func_80068508(TRUE); func_8007BF1C(FALSE); func_80067F2C(&gHUDCurrDisplayList, &gHUDCurrMatrix); func_800A1E48(0, updateRate); - func_80068508(0); + func_80068508(FALSE); func_8007B3D0(&gHUDCurrDisplayList); func_8007BF1C(TRUE); } else { if (D_80126D37 == 3) { curRacerObj = NULL; - for(var_a1 = 0; var_a1 < sp140; var_a1++) { - if (sp150[var_a1]->unk64->racer.playerIndex == PLAYER_COMPUTER) { - curRacerObj = &sp150[var_a1]->unk64->racer; + for(pad12 = 0; pad12 < objectCount; pad12++) { + if (objectGroup[pad12]->unk64->racer.playerIndex == PLAYER_COMPUTER) { + curRacerObj = &objectGroup[pad12]->unk64->racer; } } if (curRacerObj != NULL) { - D_80126CDC = (unk80126CDC* ) D_80126CEC; - spE4 = D_80126CEC->unk64C; - spE0 = D_80126CEC->unk650; + D_80126CDC = D_80126CEC; + spE4 = D_80126CDC->unk64C; + spE0 = D_80126CDC->unk650; func_8007BF1C(FALSE); func_80067F2C(&gHUDCurrDisplayList, &gHUDCurrMatrix); - func_80068508(1); + func_80068508(TRUE); D_80126CDC->unk64C = 225.0f; if (osTvType == TV_TYPE_PAL) { D_80126CDC->unk650 = 181.5f; @@ -1661,64 +1669,68 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR } if (osTvType == TV_TYPE_PAL) { var_a0_5 = (66.0f - D_80126CDC->unk36C) - 4.0f; - sp144 = -114.0f - D_80126CDC->unk370; + pad12 = -114.0f - D_80126CDC->unk370; } else { var_a0_5 = 66.0f - D_80126CDC->unk36C; - sp144 = -100.0f - D_80126CDC->unk370; + pad12 = -100.0f - D_80126CDC->unk370; } D_80126CDC->unk36C += var_a0_5; - D_80126CDC->unk370 += sp144; + D_80126CDC->unk370 += pad12; D_80126CDC->unkEC += var_a0_5; - D_80126CDC->unkF0 += sp144; + D_80126CDC->unkF0 += pad12; D_80126CDC->unk38C += var_a0_5; - D_80126CDC->unk390 += sp144; + D_80126CDC->unk390 += pad12; D_80126CDC->unk10C += var_a0_5; - D_80126CDC->unk110 -= sp144 + 1; + D_80126CDC->unk110 -= pad12 + 1; D_80126CDC->unk12C += var_a0_5; - D_80126CDC->unk130 -= sp144 + 1; + D_80126CDC->unk130 -= pad12 + 1; D_80126CDC->unk24C += var_a0_5; - D_80126CDC->unk250 -= sp144; - D_80126CDC->unk646 = curRacerObj->characterId + 56; + D_80126CDC->unk250 -= pad12; + new_var = curRacerObj->characterId; + D_80126CDC->unk646 = new_var + 56; if (osTvType == TV_TYPE_PAL) { - D_80126CDC->unk64C = D_80126CDC->unk64C - 4.0f; - D_80126CDC->unk66C = D_80126CDC->unk66C - 4.0f; + D_80126CDC->unk64C -= 4.0f; + D_80126CDC->unk66C -= 4.0f; } D_80126CD5 = TRUE; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk640); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk640); D_80126CD5 = FALSE; if (D_80126CDC->unkFB == 0 && curRacerObj->bananas == 10) { D_80126CDC->unkFB = curRacerObj->bananas; } render_racer_bananas((Object_64 *)curRacerObj, updateRate); + + + D_80126CDC->unk36C -= var_a0_5; - D_80126CDC->unk370 -= sp144; + D_80126CDC->unk370 -= pad12; D_80126CDC->unkEC -= var_a0_5; - D_80126CDC->unkF0 -= sp144; + D_80126CDC->unkF0 -= pad12; D_80126CDC->unk38C -= var_a0_5; - D_80126CDC->unk390 -= sp144; + D_80126CDC->unk390 -= pad12; D_80126CDC->unk10C -= var_a0_5; - D_80126CDC->unk110 += sp144 + 1; + D_80126CDC->unk110 += pad12 + 1; D_80126CDC->unk12C -= var_a0_5; - D_80126CDC->unk130 += sp144 + 1; + D_80126CDC->unk130 += pad12 + 1; D_80126CDC->unk24C -= var_a0_5; - D_80126CDC->unk250 += sp144; + D_80126CDC->unk250 += pad12; D_80126CDC->unk64C = spE4; D_80126CDC->unk650 = spE0; func_8007BF1C(TRUE); func_8007B3D0(&gHUDCurrDisplayList); - func_80068508(0); + func_80068508(FALSE); } } } } else if (D_80126D60->race_type == RACETYPE_CHALLENGE_BANANAS) { - if ((D_80126D37 == 2) && (D_800E27A4[gHUDNumPlayers] == 0)) { + if ((D_80126D37 == 2) && (D_800E27A4[gHUDNumPlayers] == FALSE)) { temp_s0_2 = D_80126CDC->unk64C; temp_s1_2 = D_80126CDC->unk650; temp_s3 = D_80126CDC->unk40C; spBC = D_80126CDC->unk410; racerGroup = get_racer_objects(&racerCount); - for (i = 0; i < racerCount; i++) { - func_800A45F0(&racerGroup[i]->unk64->racer); + for (sp144 = 0; sp144 < racerCount; sp144++) { + func_800A45F0(&racerGroup[sp144]->unk64->racer); if (osTvType == TV_TYPE_PAL) { D_80126CDC->unk650 += 66.0; D_80126CDC->unk410 += 66.0; @@ -1732,13 +1744,13 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126CDC->unk40C = temp_s3; D_80126CDC->unk410 = spBC; } else if (D_80126D37 == 3) { - curRacerObj = NULL; - for(var_a1 = 0; var_a1 < sp140; var_a1++) { - if (sp150[var_a1]->unk64->racer.playerIndex == PLAYER_COMPUTER) { - curRacerObj = &sp150[var_a1]->unk64->racer; + pad11 = NULL; + for(pad12 = 0; pad12 < objectCount; pad12++) { + if (objectGroup[pad12]->unk64->racer.playerIndex == PLAYER_COMPUTER) { + pad11 = &objectGroup[pad12]->unk64->racer; } } - if (curRacerObj != NULL) { + if (pad11 != NULL) { temp_s0_3 = D_80126CDC->unk64C; temp_s1_3 = D_80126CDC->unk650; temp_f16 = D_80126CDC->unk40C; @@ -1748,14 +1760,14 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126CDC->unk40C = 209.0f; D_80126CDC->unk410 = 193.0f; if (osTvType == TV_TYPE_PAL) { - D_80126CDC->unk64C = D_80126CDC->unk64C - 4.0f; - D_80126CDC->unk40C = D_80126CDC->unk40C - 4.0f; - D_80126CDC->unk650 = D_80126CDC->unk650 * 1.1; - D_80126CDC->unk410 = D_80126CDC->unk410 * 1.1; + D_80126CDC->unk64C -= 4.0f; + D_80126CDC->unk40C -= 4.0f; + D_80126CDC->unk650 *= 1.1; + D_80126CDC->unk410 *= 1.1; D_80126CDC->unk650 = (s32) D_80126CDC->unk650; D_80126CDC->unk410 = (s32) D_80126CDC->unk410; } - func_800A45F0(curRacerObj); + func_800A45F0(pad11); D_80126CDC->unk64C = temp_s0_3; D_80126CDC->unk650 = temp_s1_3; D_80126CDC->unk40C = temp_f16; @@ -1770,36 +1782,33 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR *dList = gHUDCurrDisplayList; *mtx = gHUDCurrMatrix; *triList = gHUDCurrTriList; + if (!(D_80126D60->unkBC & 1)) { sp113 = TRUE; - for(var_a1 = 0; var_a1 < sp140; var_a1++) { - if (&sp150[var_a1]->unk64->racer != NULL && - sp150[var_a1]->unk64->racer.playerIndex != PLAYER_COMPUTER && - sp150[var_a1]->unk64->racer.raceFinished == FALSE) { + for(i = 0; i < objectCount; i++) { + if (&objectGroup[i]->unk64->racer != NULL && + objectGroup[i]->unk64->racer.playerIndex != PLAYER_COMPUTER && + objectGroup[i]->unk64->racer.raceFinished == FALSE) { sp113 = FALSE; } } - if ((gHUDNumPlayers != 2 || func_8006EAB0() == 0) && (!check_if_showing_cutscene_camera() && !sp113)) { - if (D_800E27A4[gHUDNumPlayers] != 1) { - return sp113; + if ((gHUDNumPlayers != THREE_PLAYERS || func_8006EAB0() == 0) && (!check_if_showing_cutscene_camera() && !sp113)) { + if (D_800E27A4[gHUDNumPlayers] != TRUE && !sp113) { + return; } else { func_8007B3D0(&gHUDCurrDisplayList); func_80067F2C(&gHUDCurrDisplayList, &gHUDCurrMatrix); lvlMdl = get_current_level_model(); if (lvlMdl != NULL) { someObjSeg = func_80069D20(); - func_80068508(1); + func_80068508(TRUE); sp154 = lvlMdl->unk20; switch (gHUDNumPlayers) { - default: - D_80126D58 = 135; - D_80126D5C = -98; - break; - case 1: + case TWO_PLAYERS: D_80126D58 = 135; D_80126D5C = -D_80126D20 / 2; break; - case 2: + case THREE_PLAYERS: if (get_current_level_race_type() == RACETYPE_CHALLENGE_EGGS || get_current_level_race_type() == RACETYPE_CHALLENGE_BATTLE || get_current_level_race_type() == RACETYPE_CHALLENGE_BANANAS) { @@ -1810,10 +1819,14 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126D5C = -60 - (D_80126D20 / 2); } break; - case 3: + case FOUR_PLAYERS: D_80126D58 = (D_80126D1C / 2) - 8; D_80126D5C = -D_80126D20 / 2; break; + default: + D_80126D58 = 135; + D_80126D5C = -98; + break; } if (osTvType == TV_TYPE_PAL) { D_80126D5C *= 1.2; @@ -1833,9 +1846,9 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR objTrans.trans.y_rotation = 0; } objTrans.unk18 = 0; + objTrans.trans.z_position = 0.0f; objTrans.trans.scale = 1.0f; opacity = mapOpacity; - objTrans.trans.z_position = 0.0f; if (mapOpacity > 160) { mapOpacity = 160; } @@ -1855,20 +1868,20 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126CDC->unk1E6 = 14; D_80126CDC->unk1E4 = 0; D_80126CDC->unk1E8 = 1.0f; - temp = (opacity * (f32) temp_v0_8->segment.unk38.half.upper) * 0.0078125; + temp = (opacity * (f32) temp_v0_8->segment.unk38.half.lower) * 0.0078125; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 60, 60, 60, temp); - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); } } temp_v0_8 = func_8001B640(); if (temp_v0_8 != NULL) { func_800AA3EC(temp_v0_8->segment.trans.x_position, temp_v0_8->segment.trans.z_position, sp114, sp118, sp11C); D_80126CDC->unk1E4 = 0; - temp = (opacity * (f32) temp_v0_8->segment.unk38.half.upper) * 0.0078125; + temp = (opacity * (f32) temp_v0_8->segment.unk38.half.lower) * 0.0078125; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, D_800E27BC[8].red, D_800E27BC[8].green, D_800E27BC[8].blue, temp); D_80126CDC->unk1E8 = 1.0f; D_80126CDC->unk1E6 = 14; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); } if (D_80126D60->race_type == RACETYPE_HUBWORLD) { temp_v0_8 = func_80018C6C(); @@ -1878,19 +1891,21 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR D_80126CDC->unk1E4 = 0; gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 0, 255, opacity); D_80126CDC->unk1E8 = 1.0f; - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); } } - for(i = sp140 - 1; i >= 0; i--) { - someRacerObj = sp150[i]; - someRacer = &someRacerObj->unk64->racer; + for(i = objectCount - 1; i >= 0; i--) { + someRacer = &objectGroup[i]->unk64->racer; if (someRacer != NULL) { - func_800AA3EC(someRacerObj->segment.trans.x_position, someRacerObj->segment.trans.z_position, sp114, sp118, sp11C); + func_800AA3EC(objectGroup[i]->segment.trans.x_position, objectGroup[i]->segment.trans.z_position, sp114, sp118, sp11C); if (someRacer->playerIndex != PLAYER_COMPUTER) { D_80126CDC->unk1F0 -= 1.0f; D_80126CDC->unk1E6 = 27; - D_80126CDC->unk1E4 = someRacerObj->segment.trans.y_rotation - ((lvlMdl->unk24 * 0xFFFF) / 360); - if (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) { + D_80126CDC->unk1E4 = objectGroup[i]->segment.trans.y_rotation - ((lvlMdl->unk24 * 0xFFFF) / 360); + //D_80126CDC->unk1E4 = objectGroup[i]->segment.trans.y_rotation - (((lvlMdl->unk24 * 0xFFFF) / 360) & 0xFFFF); // fakematch + + new_var2 = get_filtered_cheats(); + if (new_var2 & CHEAT_MIRRORED_TRACKS) { D_80126CDC->unk1E4 = 0xFFFF - D_80126CDC->unk1E4; } func_8007BF1C(TRUE); @@ -1901,8 +1916,7 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR if (func_8002341C() && someRacer->unk1D6 == 10) { gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, 255, 0, 255, opacity); } else { - charColour = &D_800E27BC[someRacer->characterId]; - gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, charColour->red, charColour->green, charColour->blue, opacity); + gDPSetPrimColor(gHUDCurrDisplayList++, 0, 0, D_800E27BC[someRacer->characterId].red, D_800E27BC[someRacer->characterId].green, D_800E27BC[someRacer->characterId].blue, opacity); } if (!(get_current_level_race_type() & RACETYPE_CHALLENGE) || (!someRacer->raceFinished)) { if (osTvType == TV_TYPE_PAL) { @@ -1924,13 +1938,13 @@ s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateR } else { D_80126CDC->unk1E8 = 1.0f; } - func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, (unk80126CDC* ) &D_80126CDC->unk1E0); + func_800AA600(&gHUDCurrDisplayList, &gHUDCurrMatrix, &gHUDCurrTriList, &D_80126CDC->unk1E0); } func_8007BF1C(FALSE); } } gDPPipeSync(gHUDCurrDisplayList++); - func_80068508(0); + func_80068508(FALSE); func_8007BF1C(TRUE); *dList = gHUDCurrDisplayList; *mtx = gHUDCurrMatrix; @@ -1945,7 +1959,50 @@ GLOBAL_ASM("asm/non_matchings/game_ui/func_800A8474.s") #endif GLOBAL_ASM("asm/non_matchings/game_ui/func_800AA3EC.s") GLOBAL_ASM("asm/non_matchings/game_ui/func_800AA600.s") -GLOBAL_ASM("asm/non_matchings/game_ui/func_800AAFD0.s") + +void func_800AAFD0(ObjectModel *objModel) { + UNUSED s32 pad; + TextureHeader *texPtr; + s32 triOffset; + s32 vertOffset; + s32 numBatches; + s32 numVerts; + s32 numTris; + Vertex *verts; + Triangle *tris; + s32 textureEnabled; + s32 i; + s32 texIndex; + s32 flags; + + numBatches = objModel->numberOfBatches; + + for (i = 0; i < numBatches; i++) { + flags = objModel->batches[i].flags; + if (!(flags & 0x100)) { + vertOffset = objModel->batches[i].verticesOffset; + triOffset = objModel->batches[i].facesOffset; + numVerts = objModel->batches[i + 1].verticesOffset - vertOffset; + numTris = objModel->batches[i + 1].facesOffset - triOffset; + verts = &objModel->vertices[vertOffset]; + tris = &objModel->triangles[triOffset]; + texIndex = objModel->batches[i].textureIndex; // 0xFF = No Texture + textureEnabled = TRIN_ENABLE_TEXTURE; + if (texIndex == 0xFF) { + texPtr = NULL; + } else { + texPtr = objModel->textures[texIndex].texture; + } + func_8007B4C8(&gHUDCurrDisplayList, texPtr, flags & ~2); + gSPVertexDKR(gHUDCurrDisplayList++, OS_PHYSICAL_TO_K0(verts), numVerts, 0); + if (texPtr == NULL) { + textureEnabled = TRIN_DISABLE_TEXTURE; + } + gSPPolygon(gHUDCurrDisplayList++, OS_PHYSICAL_TO_K0(tris), numTris, textureEnabled); + numBatches = objModel->numberOfBatches; + } + } +} void func_800AB194(s32 arg0) { D_80126CD1 = 1; diff --git a/src/game_ui.h b/src/game_ui.h index 79543118..64bb108e 100644 --- a/src/game_ui.h +++ b/src/game_ui.h @@ -300,7 +300,7 @@ void func_800A718C(Object_64 *obj); void func_800AA600(Gfx **dList, Matrix **mtx, TriangleList **triList, unk80126CDC *arg3); void func_8009ECF0(s32 viewPortCount); void func_800A003C(void); -s32 func_800A8474(Gfx **dList, Matrix **mtx, TriangleList **triList, s32 updateRate); +void func_800A8474(Gfx **dList, Matrix **mtx, VertexList **triList, s32 updateRate); void func_800A7FBC(s32, s32, s32 minutes, s32 seconds, s32 hundredths, s32); void func_800A1248(s32, Object*, s32); void func_800A1C04(s32, Object*, s32); diff --git a/src/menu.c b/src/menu.c index 8212228d..eab1c40c 100644 --- a/src/menu.c +++ b/src/menu.c @@ -44,7 +44,7 @@ s32 gSaveGhostDelayCounter; s32 gPreviousMenuID; Gfx *sMenuCurrDisplayList; char **gTTSaveGhostPakErrorText; -Mtx *sMenuCurrHudMat; +Matrix *sMenuCurrHudMat; VertexList *sMenuCurrHudVerts; TriangleList *sMenuCurrHudTris; unk801263C0 D_801263B4; @@ -1819,8 +1819,8 @@ void menu_init(u32 menuId) { case MENU_TRACK_SELECT: menu_track_select_init(); break; - case MENU_UNKNOWN_5: - menu_5_init(); + case MENU_TRACK_SELECT_ADVENTURE: + menu_adventure_track_init(); break; case MENU_RESULTS: menu_11_init(); @@ -1853,7 +1853,7 @@ void menu_init(u32 menuId) { /** * Runs every frame. Calls the loop function of the current menu id */ -s32 menu_loop(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { +s32 menu_loop(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { s32 ret; sMenuCurrDisplayList = *currDisplayList; @@ -1896,8 +1896,8 @@ s32 menu_loop(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currHudVerts case MENU_TRACK_SELECT: ret = menu_track_select_loop(updateRate); break; - case MENU_UNKNOWN_5: - ret = menu_5_loop(updateRate); + case MENU_TRACK_SELECT_ADVENTURE: + ret = menu_adventure_track_loop(updateRate); break; case MENU_RESULTS: ret = menu_results_loop(updateRate); @@ -6414,7 +6414,10 @@ s32 func_80092BE0(MapId mapId) { return temp; } -void menu_5_init(void) { +/** + * Load and initialise the track setup gui for use when entering a track in adventure mode. +*/ +void menu_adventure_track_init(void) { Settings *settings; s32 result; MapId mapId; @@ -6467,9 +6470,124 @@ void menu_5_init(void) { } } -GLOBAL_ASM("asm/non_matchings/menu/func_80092E94.s") +/** + * Render the setup gui when in a track preview in adventure mode. + * This includes the vehicle selection and if time trial is enabled, the best times. + */ +void render_adventure_track_setup(s32 arg0, s32 arg1, s32 arg2) { + s32 alpha; + s32 y; + s32 greenAmount; + s32 i; + s32 savedY; + s32 yOffset; + s32 mask; + s32 sp58; + char *filename; + Settings* settings; + char* levelName; -s32 menu_5_loop(s32 updateRate) { + filename = NULL; + settings = get_settings(); + yOffset = 0; + if (osTvType == TV_TYPE_PAL) { + yOffset = 12; + } + sp58 = ((Settings4C *)((u8 *) settings->unk4C + gTrackIdForPreview))->unk2; + gSPClearGeometryMode(sMenuCurrDisplayList++, G_CULL_FRONT); + func_8009BD5C(); + func_80067F2C(&sMenuCurrDisplayList, &sMenuCurrHudMat); + if (gMenuDelay >= -20) { + if (gMenuDelay <= 20) { + mask = get_map_available_vehicles(sp58); + levelName = get_level_name(sp58); + set_text_font(FONT_LARGE); + set_text_background_colour(0, 0, 0, 0); + set_text_colour(0, 0, 0, 255, 128); + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF + 1, 46, levelName, ALIGN_MIDDLE_CENTER); + set_text_colour(255, 255, 255, 0, 255); + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF, 43, levelName, ALIGN_MIDDLE_CENTER); + if (!(func_8006B14C(sp58) & 0x40)) { + if (arg2 == 0) { + if (is_time_trial_enabled()) { + if (func_80092BE0(sp58) >= 0) { + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionTTTexture, SCREEN_HEIGHT - 36, yOffset + 122, 255, 255, 255, sMenuGuiOpacity); + } + set_text_font(0); + set_text_colour(255, 64, 64, 96, 255); + draw_text(&sMenuCurrDisplayList, 88, yOffset + 72, gMenuText[ASSET_MENU_TEXT_BESTTIME], ALIGN_MIDDLE_CENTER); + draw_text(&sMenuCurrDisplayList, 88, yOffset + 92, gMenuText[ASSET_MENU_TEXT_BESTLAP], ALIGN_MIDDLE_CENTER); + set_text_colour(255, 128, 255, 96, 255); + decompress_filename_string(settings->courseInitialsPtr[gPlayerSelectVehicle[0]][sp58], &filename, 3); + draw_text(&sMenuCurrDisplayList, 258, yOffset + 72, (char*) &filename, ALIGN_MIDDLE_CENTER); + decompress_filename_string(settings->flapInitialsPtr[gPlayerSelectVehicle[0]][sp58], &filename, 3); + draw_text(&sMenuCurrDisplayList, 258, yOffset + 92, (char*) &filename, ALIGN_MIDDLE_CENTER); + show_timestamp(settings->courseTimesPtr[gPlayerSelectVehicle[0]][((Settings4C *)((u8 *) settings->unk4C + gTrackIdForPreview))->unk2], 26, 53, 128, 255, 255, 0); + show_timestamp(settings->flapTimesPtr[gPlayerSelectVehicle[0]][((Settings4C *)((u8 *) settings->unk4C + gTrackIdForPreview))->unk2], 26, 33, 255, 192, 255, 0); + } + greenAmount = gOptionBlinkTimer * 8; + if (greenAmount > 255) { + greenAmount = 511 - greenAmount; + } + set_current_dialogue_background_colour(7, 255, greenAmount, 0, 255); + set_current_dialogue_box_coords(7, 134, yOffset + 112, 186, yOffset + 137); + render_dialogue_box(&sMenuCurrDisplayList, NULL, NULL, 7); + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionVehicleTitleTexture, 136, yOffset + 114, 255, 255, 255, 255); + + y = yOffset + 139; + savedY = y; + + for (i = 0; i < 3; i++) { + alpha = (arg1 < 2 && get_map_default_vehicle(sp58) != i) ? 128 : 255; + if ((1 << i) & mask) { + if (i == gPlayerSelectVehicle[0]) { + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[i*3+1], 104, y, 255, 255, 255, 255); + } else { + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[i*3+2], 104, y, 255, 255, 255, alpha); + } + y += 24; + } + } + y = savedY; + if (gPlayerSelectVehicle[0] == 2) { + y += 2; + } + render_textured_rectangle(&sMenuCurrDisplayList, gRaceSelectionImages[gPlayerSelectVehicle[0]*3], 149, y, 255, 255, 255, 255); + func_8007B3D0(&sMenuCurrDisplayList); + gMenuImageStack[7].unkC = 21.0f; + gMenuImageStack[7].unk10 = -52.0f; + func_8009CA60(7); + if (D_801263E0 != 0) { + set_text_font(FONT_LARGE); + set_text_background_colour(0, 0, 0, 0); + set_text_colour(255, 255, 255, 0, 255); + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF, yOffset + 172, (char*) D_800E8240, ALIGN_MIDDLE_CENTER); + } + } else { + set_text_font(FONT_LARGE); + set_text_background_colour(0, 0, 0, 0); + set_text_colour(255, 255, 255, 0, 255); + y = yOffset + 0xB0; + if (get_language() == LANGUAGE_FRENCH) { + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF, y, gMenuText[13], ALIGN_MIDDLE_CENTER); + y += 32; + } + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF, y, gMenuText[11], ALIGN_MIDDLE_CENTER); + y += 32; + if (get_language() != LANGUAGE_FRENCH) { + draw_text(&sMenuCurrDisplayList, SCREEN_WIDTH_HALF, y, gMenuText[13], ALIGN_MIDDLE_CENTER); + } + } + } + } + } +} + +/** + * Process the logic for the track setup selection after entering a door in adventure mode. + * This also includes drawing all the gui. +*/ +s32 menu_adventure_track_loop(s32 updateRate) { s32 vehicle; s32 sp30; s32 vehicle2; @@ -6504,7 +6622,7 @@ s32 menu_5_loop(s32 updateRate) { } } gOptionBlinkTimer = (gOptionBlinkTimer + updateRate) & 0x3F; - func_80092E94(updateRate, sp1C, sp20); + render_adventure_track_setup(updateRate, sp1C, sp20); if (sp1C < 2) { gPlayerSelectVehicle[PLAYER_ONE] = get_map_default_vehicle(mapId); } @@ -8200,7 +8318,54 @@ void func_8009CA58(void) { } GLOBAL_ASM("asm/non_matchings/menu/func_8009CA60.s") -GLOBAL_ASM("asm/non_matchings/menu/func_8009CD7C.s") + +/** + * Render the border around the centre viewport in the track selection menu. + * Comes in wood, iron and gold colours. + */ +void render_track_selection_viewport_border(ObjectModel *objMdl) { + s32 pad1[4]; + s32 sp5C; + s32 pad2[4]; + TextureHeader *tex; + Triangle *tris; + s32 triOffset; + s32 vertOffset; + Vertex *verts; + s32 numVerts; + s32 numTris; + s32 var_a3; + s32 texEnabled; + s32 i; + + sp5C = 9; + if (sMenuGuiOpacity != 255) { + sp5C = 13; + } + for (i = 0; i < objMdl->numberOfBatches; i++) { + if (!(objMdl->batches[i].flags & 0x100)) { + vertOffset = objMdl->batches[i].verticesOffset; + triOffset = objMdl->batches[i].facesOffset; + numVerts = objMdl->batches[i + 1].verticesOffset - vertOffset; + numTris = objMdl->batches[i + 1].facesOffset - triOffset; + verts = &objMdl->vertices[vertOffset]; + tris = &objMdl->triangles[triOffset]; + if (objMdl->batches[i].textureIndex == -1) { + tex = NULL; + texEnabled = FALSE; + var_a3 = 0; + } else { + tex = objMdl->textures[objMdl->batches[i].textureIndex].texture; + texEnabled = TRUE; + var_a3 = objMdl->batches[i].unk7 << 14; + } + func_8007B4E8(&sMenuCurrDisplayList, tex, sp5C, var_a3); + + gSPVertexDKR(sMenuCurrDisplayList++, OS_PHYSICAL_TO_K0(verts), numVerts, 0); + gSPPolygon(sMenuCurrDisplayList++, OS_PHYSICAL_TO_K0(tris), numTris, texEnabled); + } + } +} void func_8009CF68(s32 arg0) { if (D_800DF4E4[arg0] == 0) { @@ -8800,7 +8965,7 @@ void dialogue_close_stub(void) { * Renders a textbox with a displaylist. * Return value goes completely unused. */ -f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, Mtx **mat, VertexList **verts) { +f32 func_8009E9B0(UNUSED DialogueBoxBackground *textbox, Gfx **dlist, Matrix **mat, VertexList **verts) { sMenuCurrDisplayList = *dlist; sMenuCurrHudMat = *mat; sMenuCurrHudVerts = *verts; diff --git a/src/menu.h b/src/menu.h index 4a2d1dce..c72e90a7 100644 --- a/src/menu.h +++ b/src/menu.h @@ -69,7 +69,7 @@ typedef enum MENU_ID { MENU_UNUSED_2, MENU_CHARACTER_SELECT, MENU_UNUSED_4, - MENU_UNKNOWN_5, + MENU_TRACK_SELECT_ADVENTURE, MENU_FILE_SELECT, MENU_UNUSED_7, MENU_UNUSED_8, @@ -680,7 +680,7 @@ extern DrawTexture D_800DFC40[2]; extern DrawTexture D_800DFC50[2]; extern DrawTexture D_800DFC60[2]; extern Gfx *sMenuCurrDisplayList; -extern Mtx *sMenuCurrHudMat; +extern Matrix *sMenuCurrHudMat; extern const char D_800E8208[]; extern s32 gOptionBlinkTimer; extern s32 D_801263E0; @@ -720,7 +720,7 @@ void func_8007FF88(void); void func_80080E6C(void); void func_800813C0(void); void menu_init(u32 menuId); -s32 menu_loop(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); +s32 menu_loop(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); void show_timestamp(s32 frameCount, s32 xPos, s32 yPos, u8 red, u8 green, u8 blue, u8 fontID); void func_80081E54(MenuElement *arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); @@ -767,7 +767,7 @@ void func_8008E4B0(void); void func_8008F534(void); void func_80090ED8(s32 updateRate); s32 func_80092BE0(MapId mapId); -void menu_5_init(void); +void menu_adventure_track_init(void); void func_80093A0C(void); void n_alSynRemovePlayer(void); void n_alSeqpDelete(void); @@ -833,7 +833,7 @@ s32 dialogue_race_defeat(void); s32 trophy_race_cabinet_menu_loop(void); void dialogue_open_stub(void); void dialogue_close_stub(void); -f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **dlist, Mtx **mat, VertexList **vtx); +f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **dlist, Matrix **mat, VertexList **vtx); u64 *get_eeprom_settings_pointer(void); s32 set_eeprom_settings_value(u64 valueToSet); s32 unset_eeprom_settings_value(u64 valueToUnset); @@ -848,7 +848,7 @@ s32 is_drumstick_unlocked(void); s32 menu_character_select_loop(s32 updateRate); s32 menu_caution_loop(s32 updateRate); void func_8008DC7C(UNUSED s32 updateRate); -s32 menu_5_loop(s32 updateRate); +s32 menu_adventure_track_loop(s32 updateRate); void func_80095624(s32 status); s32 menu_boot_loop(s32 arg0); void menu_magic_codes_init(void); @@ -868,6 +868,8 @@ void func_8008C168(s32 updateRate); void func_8008C698(s32 updateRate); void func_80083098(f32); void func_8008F00C(s32); +void render_track_selection_viewport_border(ObjectModel *objMdl); +void render_adventure_track_setup(UNUSED s32 updateRate, s32 arg1, s32 arg2); // Non Matching functions below here void load_menu_text(s32 language); // Non Matching @@ -912,7 +914,6 @@ void func_8008B4C8(void); void func_8008B758(s8 *activePlayers); void func_8006F564(s8 arg0); void func_80099E8C(s32 updateRate); -void func_80092E94(UNUSED s32 updateRate, s32 arg1, s32 arg2); s32 func_800998E0(s32 arg0); void func_80081218(void); void func_80080580(Gfx **arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, void *arg8); @@ -920,6 +921,8 @@ void func_800853D0(unk800861C8 *arg0, s32 arg1, s32 arg2); void render_enter_filename_ui(UNUSED s32 unused); void func_8008D8BC(s32 updateRate); void renderTrackSelect(s32 arg0, s32 arg1, s8 *arg2, s8 *arg3, s32 arg4, s32 arg5, s32 arg6, DrawTexture *arg7, s32 arg8); +//Possible names +//void renderTrackSelect(s32 xPos, s32 yPos, char *levelName, char *arg3, s32 colour, s32 imageId, s32 copyViewPort, DrawTexture *arg7, s32 arg8); s32 func_80095728(Gfx **gfx, Mtx **mtx, VertexList **vtx, s32 updateRate); s32 func_8008F618(Gfx **dlist, Mtx **mat); void func_80093D40(UNUSED s32 updateRate); diff --git a/src/objects.c b/src/objects.c index 34a2e6b2..9e7716e3 100644 --- a/src/objects.c +++ b/src/objects.c @@ -136,7 +136,7 @@ s8 D_8011AD26[2]; f32 D_8011AD28; s32 D_8011AD2C; f32 D_8011AD30; -s32 D_8011AD34; +Object *D_8011AD34; s32 D_8011AD38; //D_8011AD38 is ultimately set by func_80074B34, and is almost definitely SIDeviceStatus s8 D_8011AD3C; s8 D_8011AD3D; @@ -188,7 +188,7 @@ Object *D_8011AE08[16]; s32 (*D_8011AE48)[8]; // Unknown number of entries. u8 (*D_8011AE4C)[8]; // Unknown number of entries. s32 D_8011AE50; -s32 D_8011AE54; +TextureHeader *D_8011AE54; Object **gObjPtrList; // Not sure about the number of elements s32 objCount; s32 D_8011AE60; @@ -206,7 +206,7 @@ s16 D_8011AE82; s32 D_8011AE84; s32 D_8011AE88; Gfx *gObjectCurrDisplayList; -Mtx *gObjectCurrMatrix; +Matrix *gObjectCurrMatrix; VertexList *gObjectCurrVertexList; s32 D_8011AE98[2]; s32 D_8011AEA0; @@ -790,7 +790,23 @@ s32 func_8000FAC4(Object *obj, s32 arg1) { } GLOBAL_ASM("asm/non_matchings/objects/func_8000FBCC.s") -GLOBAL_ASM("asm/non_matchings/objects/func_8000FC6C.s") + +s32 func_8000FC6C(struct_8000FC6C_3 *arg0, struct_8000FC6C *arg1) { + arg0->unk58 = arg1; + arg1->unk0 = arg0->unk40->unk8; + arg1->unkC = 0; + arg1->unkE = arg0->unk40->unk0 >> 8; + arg1->unk4 = NULL; + if (arg0->unk40->unk36) { + arg1->unk4 = load_texture(arg0->unk40->unk38); + } + arg1->unk8 = -1; + D_8011AE54 = arg1->unk4; + if (arg0->unk40->unk36 && arg1->unk4 == NULL) { + return 0; + } + return 20; +} s32 func_8000FD20(unk8000FD20 *arg0, unk8000FD20_2 *arg1) { arg0->unk4C = arg1; @@ -1086,7 +1102,7 @@ void func_80012CE8(Gfx **dlist) { } } -void func_80012D5C(Gfx **dlist, Mtx **mats, VertexList **verts, Object *object) { +void func_80012D5C(Gfx **dlist, Matrix **mats, VertexList **verts, Object *object) { f32 scale; if (object->segment.trans.unk6 & 0x5000) return; @@ -1177,7 +1193,7 @@ GLOBAL_ASM("asm/non_matchings/objects/func_800138A8.s") * Get the racer object data, and fetch set visual shield properties based on that racer. * Afterwards, render the graphics with opacity scaling with the fadetimer. */ -void render_racer_shield(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object *obj) { +void render_racer_shield(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj) { struct Object_Racer* racer; Object_68 *gfxData; ObjectModel *mdl; @@ -1249,7 +1265,7 @@ void render_racer_shield(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object *o * Get the racer object data, and fetch set visual magnet properties based on that racer. * Afterwards, render the graphics with opacity set by the properties. */ -void render_racer_magnet(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object *obj) { +void render_racer_magnet(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj) { Object_Racer *racer; Object_68 *gfxData; ObjectModel *mdl; @@ -1443,7 +1459,7 @@ s32 func_8001B288(void) { } } -s32 func_8001B2E0() { +Object *func_8001B2E0() { return D_8011AD34; } @@ -1456,8 +1472,8 @@ s32 func_8001B3AC(s32 arg0) { GLOBAL_ASM("asm/non_matchings/objects/func_8001B3C4.s") GLOBAL_ASM("asm/non_matchings/objects/func_8001B4FC.s") -s32 func_8001B640() { - return D_800DC718; +Object *func_8001B640() { + return (Object *) D_800DC718; } s32 func_8001B650(void) { diff --git a/src/objects.h b/src/objects.h index 973daa3d..3e523ea1 100644 --- a/src/objects.h +++ b/src/objects.h @@ -223,6 +223,32 @@ typedef struct unk8000FD34 { s32 unk5C; } unk8000FD34; +typedef struct struct_8000FC6C { + f32 unk0; + TextureHeader *unk4; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; +} struct_8000FC6C; + +typedef struct struct_8000FC6C_2 { + s32 unk0; + s32 unk4; + f32 unk8; + s32 unkC; + u8 unk10[0x26]; + s16 unk36; + s16 unk38; +} struct_8000FC6C_2; + +typedef struct struct_8000FC6C_3 { + u8 unk0[0x40]; + struct_8000FC6C_2 *unk40; + u8 unk44[0x14]; + void *unk58; +} struct_8000FC6C_3; + extern unknown800DC6F0 D_800DC6F0; extern unknown800DC6F0 D_800DC6F8; @@ -307,7 +333,7 @@ void func_80012C30(void); void func_80012C3C(Gfx** dlist); void func_80012C98(Gfx **dlist); void func_80012CE8(Gfx **dlist); -void func_80012D5C(Gfx **dlist, Mtx **mats, VertexList **verts, Object *object); +void func_80012D5C(Gfx **dlist, Matrix **mats, VertexList **verts, Object *object); void func_80012F30(Object *arg0); void render_object(Object *this); void func_80013548(Object *arg0); @@ -320,9 +346,9 @@ void func_8001A8D4(s32 arg0); s16 func_8001AE44(); s32 func_8001AE54(); s32 func_8001B288(void); -s32 func_8001B2E0(); +Object *func_8001B2E0(void); s32 func_8001B3AC(s32 arg0); -s32 func_8001B640(); +Object *func_8001B640(void); s32 func_8001B650(void); s32 func_8001B738(s32 controllerIndex); u8 has_ghost_to_save(); @@ -379,9 +405,10 @@ void func_80021400(s32 arg0); s32 func_8001B668(s32 arg0); s32 func_80011570(Object *obj, f32 xPos, f32 yPos, f32 zPos); Object *get_racer_object_by_port(s32 index); -void render_racer_shield(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object *obj); -void render_racer_magnet(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object *obj); +void render_racer_shield(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj); +void render_racer_magnet(Gfx **dList, Matrix **mtx, VertexList **vtxList, Object *obj); void set_and_normalize_D_8011AFE8(f32 arg0, f32 arg1, f32 arg2); +s32 func_8000FC6C(struct_8000FC6C_3 *arg0, struct_8000FC6C *arg1); //Non Matching void calc_dynamic_lighting_for_object_1(Object *, ObjectModel *, s16, Object *, f32, f32); @@ -404,6 +431,6 @@ Object *func_8001B7A8(Object *arg0, s32 arg1, f32 *arg2); void func_80011134(Object *, s32); void func_800113CC(Object *, s32, s32, s32, s32); s32 func_800143A8(ObjectModel*, Object*, s32, s32, s32); /* extern */ -void func_80068FA8(Gfx**, Mtx**, Object*, Object*, f32); /* extern */ +void func_80068FA8(Gfx**, Matrix**, Object*, Object*, f32); /* extern */ #endif diff --git a/src/particles.c b/src/particles.c index a41b10a4..7d44977f 100644 --- a/src/particles.c +++ b/src/particles.c @@ -159,8 +159,8 @@ s32 D_80127C88[6]; TextureHeader *gTexture0; TextureHeader *gTexture1; TextureHeader *gTexture2; -s16 D_80127CAC; -s16 D_80127CAE; +u16 D_80127CAC; +u16 D_80127CAE; s16 D_80127CB0; s16 D_80127CB2; s32 D_80127CB4; diff --git a/src/particles.h b/src/particles.h index 2b8e810d..3e04e565 100644 --- a/src/particles.h +++ b/src/particles.h @@ -115,6 +115,10 @@ typedef struct XYStruct { extern unk800E2CF0 **gParticlesAssetTable; extern s32 gParticlesAssetTableCount; +extern s32 D_80127CB8; +extern s32 D_80127CCC; +extern u16 D_80127CAE; +extern u16 D_80127CAC; extern ParticleBehavior **gParticleBehavioursAssetTable; extern s32 gParticleBehavioursAssetTableCount; diff --git a/src/printf.c b/src/printf.c index 6feaea6c..087662f6 100644 --- a/src/printf.c +++ b/src/printf.c @@ -77,7 +77,7 @@ GLOBAL_ASM("asm/non_matchings/printf/func_800B3358.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B34B0.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B3564.s") -UNUSED void func_800B3678(Gfx **arg0, Mtx **arg1, VertexList **arg2) { +UNUSED void func_800B3678(Gfx **arg0, Matrix **arg1, VertexList **arg2) { UNUSED s32 pad; UNUSED s32 pad2; Object **temp_s0; @@ -201,5 +201,54 @@ GLOBAL_ASM("asm/non_matchings/printf/set_render_printf_position.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B63F4.s") GLOBAL_ASM("asm/non_matchings/printf/func_800B653C.s") -GLOBAL_ASM("asm/non_matchings/printf/func_800B695C.s") -GLOBAL_ASM("asm/non_matchings/printf/func_800B69FC.s") + +void func_800B695C(Gfx **dList, u32 arg1, u32 arg2, u32 arg3, u32 arg4) { + if (!((arg1 == arg3) | (arg2 == arg4))) { + if (arg1 >= 2) { + arg1 -= 2; + } + arg3 += 2; + gDPSetCombineMode((*dList)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPFillRectangle((*dList)++, arg1, arg2, arg3, arg4); + } +} + +s32 func_800B69FC(Gfx **dlist, s32 arg1) { + s32 temp_a3; + s32 temp_a2; + u8* temp_v0_22; + + if (arg1 < 64) { + if (D_80127CCC != 0) { + if (D_80127CB8 != 0) { + gDPLoadTextureBlock((*dlist)++, OS_PHYSICAL_TO_K0(gTexture0 + 1), G_IM_FMT_IA, G_IM_SIZ_8b, 192, 11, 0, 2, 2, 0, 0, 0, 0); + } + D_80127CCC = 0; + } + arg1 -= 33; + } else if (arg1 < 96) { + if (D_80127CCC != 1) { + if (D_80127CB8) { + gDPLoadTextureBlock((*dlist)++, OS_PHYSICAL_TO_K0(gTexture1 + 1), G_IM_FMT_IA, G_IM_SIZ_8b, 248, 11, 0, 2, 2, 0, 0, 0, 0); + } + D_80127CCC = 1; + } + arg1 -= 64; + } else if (arg1 < 128) { + arg1 -= 96; + if (D_80127CCC != 2) { + if (D_80127CB8 != 0) { + gDPLoadTextureBlock((*dlist)++, OS_PHYSICAL_TO_K0(gTexture2 + 1), G_IM_FMT_IA, G_IM_SIZ_8b, 192, 11, 0, 2, 2, 0, 0, 0, 0); + } + D_80127CCC = 2; + } + } + temp_v0_22 = &D_800E2EF4[(D_80127CCC << 6) + (arg1 * 2)]; + temp_a2 = temp_v0_22[0]; + temp_a3 = (temp_v0_22[1] - temp_a2) + 1; + if (D_80127CB8) { + gDPSetCombineMode((*dlist)++, DKR_CC_UNK12, DKR_CC_UNK12); + gSPTextureRectangle((*dlist)++, (D_80127CAC << 2), (D_80127CAE << 2), ((D_80127CAC + temp_a3) << 2), ((D_80127CAE + 10) << 2), 0, (temp_a2 << 5), 0, 1024, 1024); + } + return temp_a3; +} diff --git a/src/printf.h b/src/printf.h index af3e2140..99fc5ecc 100644 --- a/src/printf.h +++ b/src/printf.h @@ -44,10 +44,12 @@ UNUSED ParticleBehavior *func_800B4578(s32 idx); void func_800B5E88(void); void set_render_printf_colour(u8 red, u8 green, u8 blue, u8 alpha); void set_render_printf_background_colour(u8 red, u8 green, u8 blue, u8 alpha); +void func_800B695C(Gfx** dList, u32 arg1, u32 arg2, u32 arg3, u32 arg4); +s32 func_800B69FC(Gfx **dlist, s32 arg1); void set_render_printf_position(u16 xpos, u16 ypos); // Non Matching s32 render_printf(const char *format, ...); // Non Matching -void print_debug_strings(Gfx **arg0); // Non Matching -void func_800B3740(Object *, Gfx **, Mtx **, VertexList **, s32); // Non Matching +void print_debug_strings(Gfx **dList); // Non Matching +void func_800B3740(Object *, Gfx **, Matrix **, VertexList **, s32); // Non Matching #endif diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 65637519..64146530 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -61,7 +61,7 @@ const char D_800E5E10[] = "TrackGetHeight() - Overflow!!!\n"; /************ .bss ************/ Gfx *gSceneCurrDisplayList; -Mtx *gSceneCurrMatrix; +Matrix *gSceneCurrMatrix; VertexList *gSceneCurrVertexList; TriangleList *gSceneCurrTriList; @@ -263,7 +263,7 @@ extern s32 D_A0000200; /** * The root function for rendering the entire scene */ -void render_scene(Gfx** dList, Mtx** mtx, s16** vtx, s8** tris, s32 updateRate) { +void render_scene(Gfx** dList, Matrix** mtx, s16** vtx, s8** tris, s32 updateRate) { s32 i; s32 numViewports; s32 delta; diff --git a/src/unknown_0255E0.h b/src/unknown_0255E0.h index 0126bcab..0e7cff80 100644 --- a/src/unknown_0255E0.h +++ b/src/unknown_0255E0.h @@ -118,7 +118,7 @@ void render_level_geometry_and_objects(void); void render_level_segment(s32 segmentId, s32 nonOpaque); s32 func_8002A5F8(LevelModelSegmentBoundingBox *bb); void func_80030664(s32 arg0, s16 arg1, s16 arg2, u8 arg3, u8 arg4, u8 arg5); -void render_scene(Gfx** dList, Mtx** mtx, s16** vtx, s8** tris, s32 updateRate); +void render_scene(Gfx** dList, Matrix** mtx, s16** vtx, s8** tris, s32 updateRate); void func_8002C7D4(void); void render_floor_decal(Object *, Object_50 *); void func_8002D670(Object *, Object *); @@ -128,7 +128,6 @@ s32 func_80027568(void); void func_8002C954(LevelModelSegment*, LevelModelSegmentBoundingBox*, s32); s32 func_8002CC30(LevelModelSegment*); s8 func_8002B0F4(s16, f32 xPos, f32 zPos, struct TempStruct8**); -void render_racer_magnet(Gfx **dList, Mtx **mtx, VertexList **vtxList, Object* obj); s8 func_8002AD08(f32 yPos, f32* waterHeight, s32*); void func_800278E8(s32); void func_80028050(void); @@ -137,7 +136,7 @@ void func_80028CD0(s32); void func_8002A31C(void); void func_8002D8DC(s32, s32, s32); void func_8007F24C(s8*, s32); -void func_800ACA20(Gfx**, Mtx**, s16**, ObjectSegment*); +void func_800ACA20(Gfx**, Matrix**, s16**, ObjectSegment*); void func_800AD030(ObjectSegment*); void func_800B9C18(s32); diff --git a/src/unknown_078050.c b/src/unknown_078050.c index d8350b05..989b44b7 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -409,7 +409,7 @@ void set_background_fill_colour(s32 red, s32 green, s32 blue) { * over the colour buffer. DrawBG if set to 0 (which never happens) will completely skip * over clearing the colour buffer. */ -void render_background(Gfx **dlist, Mtx *mtx, s32 drawBG) { +void render_background(Gfx **dlist, Matrix *mtx, s32 drawBG) { s32 widthAndHeight; s32 w; s32 h; diff --git a/src/unknown_078050.h b/src/unknown_078050.h index 71a4f4ff..2be1149d 100644 --- a/src/unknown_078050.h +++ b/src/unknown_078050.h @@ -11,7 +11,7 @@ #include "video.h" typedef union { - void (*function)(Gfx*, Mtx *); + void (*function)(Gfx*, Matrix *); void *ptr; } unk800DE4D0; @@ -67,7 +67,7 @@ s32 setup_ostask_xbus(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg); void setup_ostask_fifo(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg); void render_textured_rectangle(Gfx **dlist, DrawTexture *img, s32 xPos, s32 yPos, u8 red, u8 green, u8 blue, u8 alpha); void func_800787FC(Gfx** arg0); -void render_background(Gfx **dlist, Mtx *mtx, s32 drawBG); +void render_background(Gfx **dlist, Matrix *mtx, s32 drawBG); void func_80078AAC(void *arg0); //Non Matching diff --git a/src/weather.c b/src/weather.c index 823bc73f..7d9dcba9 100644 --- a/src/weather.c +++ b/src/weather.c @@ -10,6 +10,8 @@ #include "camera.h" #include "unknown_0255E0.h" #include "unknown_008C40.h" +#include "textures_sprites.h" +#include "math_util.h" /************ .data ************/ @@ -24,11 +26,11 @@ s32 *D_800E28D4 = 0; unk800E2850 D_800E28D8 = { NULL, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Not sure about typing for the following. -s32 D_800E2904 = 0; +Vertex *D_800E2904 = 0; s32 D_800E2908 = 0; s32 *D_800E290C = NULL; s32 *D_800E2910 = NULL; -s32 *D_800E2914[2] = { NULL, NULL }; +Vertex *D_800E2914[2] = { NULL, NULL }; s32 *D_800E291C = NULL; // List of Ids s32 D_800E2920 = 0; @@ -152,7 +154,7 @@ s32 D_80127C00; s32 D_80127C04; s32 D_80127C08; Gfx *gWeatherDisplayListHead; -Mtx *D_80127C10; +Matrix *D_80127C10; VertexList *D_80127C14; TriangleList *D_80127C18; ObjectSegment *D_80127C1C; @@ -288,7 +290,7 @@ void func_800ABC5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { * The root function for handling all weather. * Decide whether to perform rain or snow logic, execute it, then set it to render right after. */ -void process_weather(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { +void process_weather(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate) { UNUSED s32 unused; gWeatherDisplayListHead = *currDisplayList; D_80127C10 = *currHudMat; @@ -321,9 +323,9 @@ void process_weather(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currH func_800AC0C8(updateRate, &D_80127BF8); // This is the snow physics that makes it move if ((D_80127BB4 > 0) && (D_80127BF8.unk4 < D_80127BF8.unk0)) { - D_800E2904 = (s32) D_800E2914[D_80127C08]; + D_800E2904 = D_800E2914[D_80127C08]; func_800AC21C(); // Both of these funcs are needed to render. - func_800AC5A4(); + render_falling_snow(); D_80127C08 = 1 - D_80127C08; } } @@ -335,7 +337,47 @@ void process_weather(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currH GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC0C8.s") GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC21C.s") -GLOBAL_ASM("asm/non_matchings/game_ui/func_800AC5A4.s") + +/** + * Load and execute the draw commands for the falling snowflakes, seen with snowy weather enabled. + */ +void render_falling_snow(void) { + s32 i; + u32 mtx; + + if (D_800E28D8.unk8 != NULL) { + D_80127C00 = 4; + D_80127C04 = 2; + if (D_800E2908 >= 4) { + i = 0; + mtx = (u32) func_80069DB0(); + gSPMatrix(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx ^ 0), G_MTX_DKR_INDEX_0); + gDkrInsertMatrix(gWeatherDisplayListHead++, G_MTX_DKR_INDEX_0, 0); + func_8007B4C8(&gWeatherDisplayListHead, D_800E28D8.unk8, 2U); + while (i + D_80127C00 < D_800E2908) { + mtx = (u32) &D_800E2904[i]; + gSPVertexDKR(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx), D_80127C00, 0); + gSPPolygon(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(D_800E290C), D_80127C04, 1); + i += D_80127C00; + } + mtx = (u32) &D_800E2904[i]; + gSPVertexDKR(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(mtx), (D_800E2908 - i), 0); + gSPPolygon(gWeatherDisplayListHead++, OS_PHYSICAL_TO_K0(D_800E290C), ((s32) (D_800E2908 - i) >> 1), 1); + } + } +} + +// Unused +void func_800AC850(void) { + D_800E2A84 = 1; +} + +// Unused +void func_800AC860(void) { + if (D_800E2A80 != 0) { + D_800E2A84 = 0; + } +} void func_800AC880(s32 arg0) { if (arg0 == D_800E2A80) { diff --git a/src/weather.h b/src/weather.h index e86bf97f..13b19c9d 100644 --- a/src/weather.h +++ b/src/weather.h @@ -94,17 +94,15 @@ void handle_rain_sound(s32 updateRate); void render_rain_splashes(s32 updateRate); void handle_rain_lightning(s32 updateRate); void render_rain_overlay(unk800E2C2C*, s32); -void process_weather(Gfx **currDisplayList, Mtx **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); +void process_weather(Gfx **currDisplayList, Matrix **currHudMat, VertexList **currHudVerts, TriangleList **currHudTris, s32 updateRate); +void render_falling_snow(void); +void free_weather_memory(void); -f32 cosine_s(s16); -f32 sine_s(s16); s32 func_8007082C(s16); s32 func_80070830(s16); -void free_weather_memory(void); void func_800AB1F0(void); s32 func_800AC0C8(s32, unk80127BF8 *); void func_8006F6EC(Matrix *arg0, Matrix *arg1, Matrix *arg2); void func_800AC21C(void); -void func_800AC5A4(void); #endif