From 6af653ad3decee10076179d8c2e869b604087fc5 Mon Sep 17 00:00:00 2001 From: Tyler McGavran Date: Tue, 2 Apr 2024 15:00:35 -0400 Subject: [PATCH] Update some attempts, got a couple matches (#591) * Update some attempts, got a couple matches * More matches and updates Signed-off-by: Taggerung --- .../code_80091750/func_80097E58.s | 163 --- .../code_80091750/func_800987D0.s | 286 ----- .../code_80091750/func_800A8564.s | 109 -- .../render_objects/func_8004D654.s | 96 -- .../update_objects/func_8007B040.s | 144 --- .../update_objects/func_80081FF4.s | 120 -- include/objects.h | 8 +- src/code_80005FD0.c | 4 - src/code_8006E9C0.c | 6 +- src/code_80091750.c | 1071 +++++------------ src/code_80091750.h | 21 +- src/data/some_data.c | 68 +- src/data/some_data.h | 4 +- src/render_objects.c | 139 ++- src/update_objects.c | 127 +- tools/doxygen_syms.md | 3 +- 16 files changed, 481 insertions(+), 1888 deletions(-) delete mode 100644 asm/non_matchings/code_80091750/func_800987D0.s delete mode 100644 asm/non_matchings/code_80091750/func_800A8564.s delete mode 100644 asm/non_matchings/render_objects/func_8004D654.s delete mode 100644 asm/non_matchings/update_objects/func_8007B040.s delete mode 100644 asm/non_matchings/update_objects/func_80081FF4.s diff --git a/asm/non_matchings/code_80091750/func_80097E58.s b/asm/non_matchings/code_80091750/func_80097E58.s index ce725abcb..3cac9a60d 100644 --- a/asm/non_matchings/code_80091750/func_80097E58.s +++ b/asm/non_matchings/code_80091750/func_80097E58.s @@ -465,166 +465,3 @@ glabel func_80097E58 /* 09914C 8009854C 8FBE0028 */ lw $fp, 0x28($sp) /* 099150 80098550 03E00008 */ jr $ra /* 099154 80098554 27BD00F8 */ addiu $sp, $sp, 0xf8 - -/* 099158 80098558 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 09915C 8009855C 8FAE0050 */ lw $t6, 0x50($sp) -/* 099160 80098560 AFB00008 */ sw $s0, 8($sp) -/* 099164 80098564 8FB00054 */ lw $s0, 0x54($sp) -/* 099168 80098568 AFB5001C */ sw $s5, 0x1c($sp) -/* 09916C 8009856C 00CE082B */ sltu $at, $a2, $t6 -/* 099170 80098570 00E0A825 */ move $s5, $a3 -/* 099174 80098574 AFBF002C */ sw $ra, 0x2c($sp) -/* 099178 80098578 AFBE0028 */ sw $fp, 0x28($sp) -/* 09917C 8009857C AFB70024 */ sw $s7, 0x24($sp) -/* 099180 80098580 AFB60020 */ sw $s6, 0x20($sp) -/* 099184 80098584 AFB40018 */ sw $s4, 0x18($sp) -/* 099188 80098588 AFB30014 */ sw $s3, 0x14($sp) -/* 09918C 8009858C AFB20010 */ sw $s2, 0x10($sp) -/* 099190 80098590 AFB1000C */ sw $s1, 0xc($sp) -/* 099194 80098594 AFA50044 */ sw $a1, 0x44($sp) -/* 099198 80098598 00C01025 */ move $v0, $a2 -/* 09919C 8009859C 1020007F */ beqz $at, .L8009879C -/* 0991A0 800985A0 AFB00034 */ sw $s0, 0x34($sp) -/* 0991A4 800985A4 3C1E0701 */ lui $fp, (0x07014050 >> 16) # lui $fp, 0x701 -/* 0991A8 800985A8 3C168019 */ lui $s6, %hi(D_8018D9B0) # $s6, 0x8019 -/* 0991AC 800985AC 26D6D9B0 */ addiu $s6, %lo(D_8018D9B0) # addiu $s6, $s6, -0x2650 -/* 0991B0 800985B0 37DE4050 */ ori $fp, (0x07014050 & 0xFFFF) # ori $fp, $fp, 0x4050 -/* 0991B4 800985B4 3C1FE600 */ lui $ra, 0xe600 -/* 0991B8 800985B8 3C17F510 */ lui $s7, 0xf510 -.L800985BC: -/* 0991BC 800985BC 8FAF0044 */ lw $t7, 0x44($sp) -/* 0991C0 800985C0 01F5082B */ sltu $at, $t7, $s5 -/* 0991C4 800985C4 1020006D */ beqz $at, .L8009877C -/* 0991C8 800985C8 01E03825 */ move $a3, $t7 -/* 0991CC 800985CC 8FB10060 */ lw $s1, 0x60($sp) -/* 0991D0 800985D0 AFA20038 */ sw $v0, 0x38($sp) -/* 0991D4 800985D4 8FA30038 */ lw $v1, 0x38($sp) -/* 0991D8 800985D8 8FA20058 */ lw $v0, 0x58($sp) -/* 0991DC 800985DC 2631FFFF */ addiu $s1, $s1, -1 -/* 0991E0 800985E0 32380FFF */ andi $t8, $s1, 0xfff -/* 0991E4 800985E4 3C01FD10 */ lui $at, 0xfd10 -/* 0991E8 800985E8 03018825 */ or $s1, $t8, $at -/* 0991EC 800985EC 01EF9023 */ subu $s2, $t7, $t7 -/* 0991F0 800985F0 246D0020 */ addiu $t5, $v1, 0x20 -/* 0991F4 800985F4 000DC080 */ sll $t8, $t5, 2 -/* 0991F8 800985F8 00127040 */ sll $t6, $s2, 1 -/* 0991FC 800985FC 25D20049 */ addiu $s2, $t6, 0x49 -/* 099200 80098600 330D0FFF */ andi $t5, $t8, 0xfff -/* 099204 80098604 00036080 */ sll $t4, $v1, 2 -/* 099208 80098608 24530020 */ addiu $s3, $v0, 0x20 -/* 09920C 8009860C 0002A080 */ sll $s4, $v0, 2 -/* 099210 80098610 32980FFF */ andi $t8, $s4, 0xfff -/* 099214 80098614 00137080 */ sll $t6, $s3, 2 -/* 099218 80098618 318F0FFF */ andi $t7, $t4, 0xfff -/* 09921C 8009861C 01E06025 */ move $t4, $t7 -/* 099220 80098620 31D30FFF */ andi $s3, $t6, 0xfff -/* 099224 80098624 0300A025 */ move $s4, $t8 -.L80098628: -/* 099228 80098628 00801025 */ move $v0, $a0 -/* 09922C 8009862C AC510000 */ sw $s1, ($v0) -/* 099230 80098630 8ED90000 */ lw $t9, ($s6) -/* 099234 80098634 24840008 */ addiu $a0, $a0, 8 -/* 099238 80098638 001270C2 */ srl $t6, $s2, 3 -/* 09923C 8009863C AC590004 */ sw $t9, 4($v0) -/* 099240 80098640 31CF01FF */ andi $t7, $t6, 0x1ff -/* 099244 80098644 00801825 */ move $v1, $a0 -/* 099248 80098648 00075080 */ sll $t2, $a3, 2 -/* 09924C 8009864C 31590FFF */ andi $t9, $t2, 0xfff -/* 099250 80098650 24840008 */ addiu $a0, $a0, 8 -/* 099254 80098654 000FC240 */ sll $t8, $t7, 9 -/* 099258 80098658 03174025 */ or $t0, $t8, $s7 -/* 09925C 8009865C 00802825 */ move $a1, $a0 -/* 099260 80098660 00195300 */ sll $t2, $t9, 0xc -/* 099264 80098664 3C01F400 */ lui $at, 0xf400 -/* 099268 80098668 24EB0020 */ addiu $t3, $a3, 0x20 -/* 09926C 8009866C 000B1080 */ sll $v0, $t3, 2 -/* 099270 80098670 01417825 */ or $t7, $t2, $at -/* 099274 80098674 24840008 */ addiu $a0, $a0, 8 -/* 099278 80098678 AC680000 */ sw $t0, ($v1) -/* 09927C 8009867C AC7E0004 */ sw $fp, 4($v1) -/* 099280 80098680 00804825 */ move $t1, $a0 -/* 099284 80098684 01ECC025 */ or $t8, $t7, $t4 -/* 099288 80098688 30590FFF */ andi $t9, $v0, 0xfff -/* 09928C 8009868C 00191300 */ sll $v0, $t9, 0xc -/* 099290 80098690 ACA00004 */ sw $zero, 4($a1) -/* 099294 80098694 ACBF0000 */ sw $ra, ($a1) -/* 099298 80098698 3C010700 */ lui $at, 0x700 -/* 09929C 8009869C 00417825 */ or $t7, $v0, $at -/* 0992A0 800986A0 AD380000 */ sw $t8, ($t1) -/* 0992A4 800986A4 24840008 */ addiu $a0, $a0, 8 -/* 0992A8 800986A8 00801825 */ move $v1, $a0 -/* 0992AC 800986AC 01EDC025 */ or $t8, $t7, $t5 -/* 0992B0 800986B0 AD380004 */ sw $t8, 4($t1) -/* 0992B4 800986B4 3C19E700 */ lui $t9, 0xe700 -/* 0992B8 800986B8 AC790000 */ sw $t9, ($v1) -/* 0992BC 800986BC 24840008 */ addiu $a0, $a0, 8 -/* 0992C0 800986C0 00802825 */ move $a1, $a0 -/* 0992C4 800986C4 AC600004 */ sw $zero, 4($v1) -/* 0992C8 800986C8 3C01F200 */ lui $at, 0xf200 -/* 0992CC 800986CC 3C0E0001 */ lui $t6, (0x00014050 >> 16) # lui $t6, 1 -/* 0992D0 800986D0 35CE4050 */ ori $t6, (0x00014050 & 0xFFFF) # ori $t6, $t6, 0x4050 -/* 0992D4 800986D4 01417825 */ or $t7, $t2, $at -/* 0992D8 800986D8 01ECC025 */ or $t8, $t7, $t4 -/* 0992DC 800986DC ACAE0004 */ sw $t6, 4($a1) -/* 0992E0 800986E0 24840008 */ addiu $a0, $a0, 8 -/* 0992E4 800986E4 26030020 */ addiu $v1, $s0, 0x20 -/* 0992E8 800986E8 00803025 */ move $a2, $a0 -/* 0992EC 800986EC ACA80000 */ sw $t0, ($a1) -/* 0992F0 800986F0 00037080 */ sll $t6, $v1, 2 -/* 0992F4 800986F4 ACD80000 */ sw $t8, ($a2) -/* 0992F8 800986F8 004DC825 */ or $t9, $v0, $t5 -/* 0992FC 800986FC 31CF0FFF */ andi $t7, $t6, 0xfff -/* 099300 80098700 ACD90004 */ sw $t9, 4($a2) -/* 099304 80098704 000FC300 */ sll $t8, $t7, 0xc -/* 099308 80098708 3C01E400 */ lui $at, 0xe400 -/* 09930C 8009870C 24840008 */ addiu $a0, $a0, 8 -/* 099310 80098710 0301C825 */ or $t9, $t8, $at -/* 099314 80098714 03337025 */ or $t6, $t9, $s3 -/* 099318 80098718 00801025 */ move $v0, $a0 -/* 09931C 8009871C 00107880 */ sll $t7, $s0, 2 -/* 099320 80098720 31F80FFF */ andi $t8, $t7, 0xfff -/* 099324 80098724 0018CB00 */ sll $t9, $t8, 0xc -/* 099328 80098728 AC4E0000 */ sw $t6, ($v0) -/* 09932C 8009872C 24840008 */ addiu $a0, $a0, 8 -/* 099330 80098730 00802825 */ move $a1, $a0 -/* 099334 80098734 03347025 */ or $t6, $t9, $s4 -/* 099338 80098738 AC4E0004 */ sw $t6, 4($v0) -/* 09933C 8009873C 24840008 */ addiu $a0, $a0, 8 -/* 099340 80098740 00803025 */ move $a2, $a0 -/* 099344 80098744 3C190400 */ lui $t9, (0x04000400 >> 16) # lui $t9, 0x400 -/* 099348 80098748 3C0FB300 */ lui $t7, 0xb300 -/* 09934C 8009874C 0175082B */ sltu $at, $t3, $s5 -/* 099350 80098750 ACAF0000 */ sw $t7, ($a1) -/* 099354 80098754 37390400 */ ori $t9, (0x04000400 & 0xFFFF) # ori $t9, $t9, 0x400 -/* 099358 80098758 ACA00004 */ sw $zero, 4($a1) -/* 09935C 8009875C 3C18B200 */ lui $t8, 0xb200 -/* 099360 80098760 01603825 */ move $a3, $t3 -/* 099364 80098764 ACD80000 */ sw $t8, ($a2) -/* 099368 80098768 ACD90004 */ sw $t9, 4($a2) -/* 09936C 8009876C 24840008 */ addiu $a0, $a0, 8 -/* 099370 80098770 1420FFAD */ bnez $at, .L80098628 -/* 099374 80098774 00608025 */ move $s0, $v1 -/* 099378 80098778 8FA20038 */ lw $v0, 0x38($sp) -.L8009877C: -/* 09937C 8009877C 8FB80050 */ lw $t8, 0x50($sp) -/* 099380 80098780 8FAE0058 */ lw $t6, 0x58($sp) -/* 099384 80098784 24420020 */ addiu $v0, $v0, 0x20 -/* 099388 80098788 0058082B */ sltu $at, $v0, $t8 -/* 09938C 8009878C 25CF0020 */ addiu $t7, $t6, 0x20 -/* 099390 80098790 8FB00034 */ lw $s0, 0x34($sp) -/* 099394 80098794 1420FF89 */ bnez $at, .L800985BC -/* 099398 80098798 AFAF0058 */ sw $t7, 0x58($sp) -.L8009879C: -/* 09939C 8009879C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0993A0 800987A0 8FB00008 */ lw $s0, 8($sp) -/* 0993A4 800987A4 8FB1000C */ lw $s1, 0xc($sp) -/* 0993A8 800987A8 8FB20010 */ lw $s2, 0x10($sp) -/* 0993AC 800987AC 8FB30014 */ lw $s3, 0x14($sp) -/* 0993B0 800987B0 8FB40018 */ lw $s4, 0x18($sp) -/* 0993B4 800987B4 8FB5001C */ lw $s5, 0x1c($sp) -/* 0993B8 800987B8 8FB60020 */ lw $s6, 0x20($sp) -/* 0993BC 800987BC 8FB70024 */ lw $s7, 0x24($sp) -/* 0993C0 800987C0 8FBE0028 */ lw $fp, 0x28($sp) -/* 0993C4 800987C4 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0993C8 800987C8 03E00008 */ jr $ra -/* 0993CC 800987CC 00801025 */ move $v0, $a0 diff --git a/asm/non_matchings/code_80091750/func_800987D0.s b/asm/non_matchings/code_80091750/func_800987D0.s deleted file mode 100644 index f7618b842..000000000 --- a/asm/non_matchings/code_80091750/func_800987D0.s +++ /dev/null @@ -1,286 +0,0 @@ -glabel func_800987D0 -/* 0993D0 800987D0 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0993D4 800987D4 AFB10034 */ sw $s1, 0x34($sp) -/* 0993D8 800987D8 3C118019 */ lui $s1, %hi(D_8018E7B8) # $s1, 0x8019 -/* 0993DC 800987DC 2631E7B8 */ addiu $s1, %lo(D_8018E7B8) # addiu $s1, $s1, -0x1848 -/* 0993E0 800987E0 8E220000 */ lw $v0, ($s1) -/* 0993E4 800987E4 AFB3003C */ sw $s3, 0x3c($sp) -/* 0993E8 800987E8 AFB00030 */ sw $s0, 0x30($sp) -/* 0993EC 800987EC 00808025 */ move $s0, $a0 -/* 0993F0 800987F0 00C09825 */ move $s3, $a2 -/* 0993F4 800987F4 AFBF0054 */ sw $ra, 0x54($sp) -/* 0993F8 800987F8 AFBE0050 */ sw $fp, 0x50($sp) -/* 0993FC 800987FC AFB7004C */ sw $s7, 0x4c($sp) -/* 099400 80098800 AFB60048 */ sw $s6, 0x48($sp) -/* 099404 80098804 AFB50044 */ sw $s5, 0x44($sp) -/* 099408 80098808 AFB40040 */ sw $s4, 0x40($sp) -/* 09940C 8009880C AFB20038 */ sw $s2, 0x38($sp) -/* 099410 80098810 F7B80028 */ sdc1 $f24, 0x28($sp) -/* 099414 80098814 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 099418 80098818 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 09941C 8009881C AFA5006C */ sw $a1, 0x6c($sp) -/* 099420 80098820 14400004 */ bnez $v0, .L80098834 -/* 099424 80098824 AFA70074 */ sw $a3, 0x74($sp) -/* 099428 80098828 240E0001 */ li $t6, 1 -/* 09942C 8009882C AE2E0000 */ sw $t6, ($s1) -/* 099430 80098830 01C01025 */ move $v0, $t6 -.L80098834: -/* 099434 80098834 3C148019 */ lui $s4, %hi(D_8018E7D0) # $s4, 0x8019 -/* 099438 80098838 2694E7D0 */ addiu $s4, %lo(D_8018E7D0) # addiu $s4, $s4, -0x1830 -/* 09943C 8009883C 8E8F0000 */ lw $t7, ($s4) -/* 099440 80098840 24124E20 */ li $s2, 20000 -/* 099444 80098844 01F20019 */ multu $t7, $s2 -/* 099448 80098848 0000C012 */ mflo $t8 -/* 09944C 8009884C 00000000 */ nop -/* 099450 80098850 00000000 */ nop -/* 099454 80098854 0302001B */ divu $zero, $t8, $v0 -/* 099458 80098858 0000C812 */ mflo $t9 -/* 09945C 8009885C 14400002 */ bnez $v0, .L80098868 -/* 099460 80098860 00000000 */ nop -/* 099464 80098864 0007000D */ break 7 -.L80098868: -/* 099468 80098868 0332001B */ divu $zero, $t9, $s2 -/* 09946C 8009886C 00002010 */ mfhi $a0 -/* 099470 80098870 308EFFFF */ andi $t6, $a0, 0xffff -/* 099474 80098874 16400002 */ bnez $s2, .L80098880 -/* 099478 80098878 00000000 */ nop -/* 09947C 8009887C 0007000D */ break 7 -.L80098880: -/* 099480 80098880 01C02025 */ move $a0, $t6 -/* 099484 80098884 0C0AE006 */ jal sins -/* 099488 80098888 00000000 */ nop -/* 09948C 8009888C 8E8F0000 */ lw $t7, ($s4) -/* 099490 80098890 8E390000 */ lw $t9, ($s1) -/* 099494 80098894 46000606 */ mov.s $f24, $f0 -/* 099498 80098898 01F20019 */ multu $t7, $s2 -/* 09949C 8009889C 0000C012 */ mflo $t8 -/* 0994A0 800988A0 00000000 */ nop -/* 0994A4 800988A4 00000000 */ nop -/* 0994A8 800988A8 0319001B */ divu $zero, $t8, $t9 -/* 0994AC 800988AC 00007012 */ mflo $t6 -/* 0994B0 800988B0 17200002 */ bnez $t9, .L800988BC -/* 0994B4 800988B4 00000000 */ nop -/* 0994B8 800988B8 0007000D */ break 7 -.L800988BC: -/* 0994BC 800988BC 01D2001B */ divu $zero, $t6, $s2 -/* 0994C0 800988C0 00002010 */ mfhi $a0 -/* 0994C4 800988C4 308FFFFF */ andi $t7, $a0, 0xffff -/* 0994C8 800988C8 16400002 */ bnez $s2, .L800988D4 -/* 0994CC 800988CC 00000000 */ nop -/* 0994D0 800988D0 0007000D */ break 7 -.L800988D4: -/* 0994D4 800988D4 01E02025 */ move $a0, $t7 -/* 0994D8 800988D8 0C0AE00E */ jal coss -/* 0994DC 800988DC 00000000 */ nop -/* 0994E0 800988E0 8E980000 */ lw $t8, ($s4) -/* 0994E4 800988E4 8FAD007C */ lw $t5, 0x7c($sp) -/* 0994E8 800988E8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0994EC 800988EC 44982000 */ mtc1 $t8, $f4 -/* 0994F0 800988F0 3C1EE700 */ lui $fp, 0xe700 -/* 0994F4 800988F4 07010004 */ bgez $t8, .L80098908 -/* 0994F8 800988F8 468021A0 */ cvt.s.w $f6, $f4 -/* 0994FC 800988FC 44814000 */ mtc1 $at, $f8 -/* 099500 80098900 00000000 */ nop -/* 099504 80098904 46083180 */ add.s $f6, $f6, $f8 -.L80098908: -/* 099508 80098908 8E390000 */ lw $t9, ($s1) -/* 09950C 8009890C 3C013FE0 */ li $at, 0x3FE00000 # 1.750000 -/* 099510 80098910 44812800 */ mtc1 $at, $f5 -/* 099514 80098914 44802000 */ mtc1 $zero, $f4 -/* 099518 80098918 460032A1 */ cvt.d.s $f10, $f6 -/* 09951C 8009891C 44993000 */ mtc1 $t9, $f6 -/* 099520 80098920 46245202 */ mul.d $f8, $f10, $f4 -/* 099524 80098924 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 099528 80098928 3C170700 */ lui $s7, 0x700 -/* 09952C 8009892C 3C16F400 */ lui $s6, 0xf400 -/* 099530 80098930 3C15E600 */ lui $s5, 0xe600 -/* 099534 80098934 3C140701 */ lui $s4, (0x07014050 >> 16) # lui $s4, 0x701 -/* 099538 80098938 07210005 */ bgez $t9, .L80098950 -/* 09953C 8009893C 468032A1 */ cvt.d.w $f10, $f6 -/* 099540 80098940 44812800 */ mtc1 $at, $f5 -/* 099544 80098944 44802000 */ mtc1 $zero, $f4 -/* 099548 80098948 00000000 */ nop -/* 09954C 8009894C 46245280 */ add.d $f10, $f10, $f4 -.L80098950: -/* 099550 80098950 462A4183 */ div.d $f6, $f8, $f10 -/* 099554 80098954 3C013FF0 */ li $at, 0x3FF00000 # 1.875000 -/* 099558 80098958 44812800 */ mtc1 $at, $f5 -/* 09955C 8009895C 44802000 */ mtc1 $zero, $f4 -/* 099560 80098960 8FAE0078 */ lw $t6, 0x78($sp) -/* 099564 80098964 02601025 */ move $v0, $s3 -/* 099568 80098968 AFAD005C */ sw $t5, 0x5c($sp) -/* 09956C 8009896C 026E082B */ sltu $at, $s3, $t6 -/* 099570 80098970 3C13F510 */ lui $s3, 0xf510 -/* 099574 80098974 36944050 */ ori $s4, (0x07014050 & 0xFFFF) # ori $s4, $s4, 0x4050 -/* 099578 80098978 3C128019 */ lui $s2, %hi(D_8018D9B0) # $s2, 0x8019 -/* 09957C 8009897C 46243200 */ add.d $f8, $f6, $f4 -/* 099580 80098980 10200095 */ beqz $at, .L80098BD8 -/* 099584 80098984 462044A0 */ cvt.s.d $f18, $f8 -/* 099588 80098988 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 09958C 8009898C 4481B000 */ mtc1 $at, $f22 -/* 099590 80098990 3C014320 */ li $at, 0x43200000 # 160.000000 -/* 099594 80098994 4481A000 */ mtc1 $at, $f20 -/* 099598 80098998 2652D9B0 */ addiu $s2, %lo(D_8018D9B0) # addiu $s2, $s2, -0x2650 -.L8009899C: -/* 09959C 8009899C 8FAF006C */ lw $t7, 0x6c($sp) -/* 0995A0 800989A0 8FB80074 */ lw $t8, 0x74($sp) -/* 0995A4 800989A4 00025880 */ sll $t3, $v0, 2 -/* 0995A8 800989A8 01E03025 */ move $a2, $t7 -/* 0995AC 800989AC 01F8082B */ sltu $at, $t7, $t8 -/* 0995B0 800989B0 10200081 */ beqz $at, .L80098BB8 -/* 0995B4 800989B4 01EF8823 */ subu $s1, $t7, $t7 -/* 0995B8 800989B8 AFA20060 */ sw $v0, 0x60($sp) -/* 0995BC 800989BC 244C0020 */ addiu $t4, $v0, 0x20 -/* 0995C0 800989C0 8FA20080 */ lw $v0, 0x80($sp) -/* 0995C4 800989C4 8FBF0088 */ lw $ra, 0x88($sp) -/* 0995C8 800989C8 3C01FD10 */ lui $at, 0xfd10 -/* 0995CC 800989CC 2442FF88 */ addiu $v0, $v0, -0x78 -/* 0995D0 800989D0 44825000 */ mtc1 $v0, $f10 -/* 0995D4 800989D4 44822000 */ mtc1 $v0, $f4 -/* 0995D8 800989D8 27FFFFFF */ addiu $ra, $ra, -1 -/* 0995DC 800989DC 468051A0 */ cvt.s.w $f6, $f10 -/* 0995E0 800989E0 33F90FFF */ andi $t9, $ra, 0xfff -/* 0995E4 800989E4 0321F825 */ or $ra, $t9, $at -/* 0995E8 800989E8 000CC880 */ sll $t9, $t4, 2 -/* 0995EC 800989EC 00117840 */ sll $t7, $s1, 1 -/* 0995F0 800989F0 46802220 */ cvt.s.w $f8, $f4 -/* 0995F4 800989F4 4606C302 */ mul.s $f12, $f24, $f6 -/* 0995F8 800989F8 31780FFF */ andi $t8, $t3, 0xfff -/* 0995FC 800989FC 03005825 */ move $t3, $t8 -/* 099600 80098A00 25F10049 */ addiu $s1, $t7, 0x49 -/* 099604 80098A04 332C0FFF */ andi $t4, $t9, 0xfff -/* 099608 80098A08 46080402 */ mul.s $f16, $f0, $f8 -/* 09960C 80098A0C 4600C387 */ neg.s $f14, $f24 -/* 099610 80098A10 02001025 */ move $v0, $s0 -.L80098A14: -/* 099614 80098A14 AC5F0000 */ sw $ra, ($v0) -/* 099618 80098A18 8E4F0000 */ lw $t7, ($s2) -/* 09961C 80098A1C 26100008 */ addiu $s0, $s0, 8 -/* 099620 80098A20 0011C0C3 */ sra $t8, $s1, 3 -/* 099624 80098A24 AC4F0004 */ sw $t7, 4($v0) -/* 099628 80098A28 331901FF */ andi $t9, $t8, 0x1ff -/* 09962C 80098A2C 02001825 */ move $v1, $s0 -/* 099630 80098A30 00064880 */ sll $t1, $a2, 2 -/* 099634 80098A34 312F0FFF */ andi $t7, $t1, 0xfff -/* 099638 80098A38 26100008 */ addiu $s0, $s0, 8 -/* 09963C 80098A3C 00197240 */ sll $t6, $t9, 9 -/* 099640 80098A40 01D33825 */ or $a3, $t6, $s3 -/* 099644 80098A44 02002025 */ move $a0, $s0 -/* 099648 80098A48 000F4B00 */ sll $t1, $t7, 0xc -/* 09964C 80098A4C 24CA0020 */ addiu $t2, $a2, 0x20 -/* 099650 80098A50 000A1080 */ sll $v0, $t2, 2 -/* 099654 80098A54 0136C825 */ or $t9, $t1, $s6 -/* 099658 80098A58 26100008 */ addiu $s0, $s0, 8 -/* 09965C 80098A5C AC670000 */ sw $a3, ($v1) -/* 099660 80098A60 AC740004 */ sw $s4, 4($v1) -/* 099664 80098A64 02004025 */ move $t0, $s0 -/* 099668 80098A68 032B7025 */ or $t6, $t9, $t3 -/* 09966C 80098A6C 304F0FFF */ andi $t7, $v0, 0xfff -/* 099670 80098A70 000F1300 */ sll $v0, $t7, 0xc -/* 099674 80098A74 AC800004 */ sw $zero, 4($a0) -/* 099678 80098A78 AC950000 */ sw $s5, ($a0) -/* 09967C 80098A7C AD0E0000 */ sw $t6, ($t0) -/* 099680 80098A80 0057C825 */ or $t9, $v0, $s7 -/* 099684 80098A84 26100008 */ addiu $s0, $s0, 8 -/* 099688 80098A88 02001825 */ move $v1, $s0 -/* 09968C 80098A8C 032C7025 */ or $t6, $t9, $t4 -/* 099690 80098A90 AD0E0004 */ sw $t6, 4($t0) -/* 099694 80098A94 26100008 */ addiu $s0, $s0, 8 -/* 099698 80098A98 3C0F0001 */ lui $t7, (0x00014050 >> 16) # lui $t7, 1 -/* 09969C 80098A9C 35EF4050 */ ori $t7, (0x00014050 & 0xFFFF) # ori $t7, $t7, 0x4050 -/* 0996A0 80098AA0 02002025 */ move $a0, $s0 -/* 0996A4 80098AA4 AC600004 */ sw $zero, 4($v1) -/* 0996A8 80098AA8 AC7E0000 */ sw $fp, ($v1) -/* 0996AC 80098AAC AC8F0004 */ sw $t7, 4($a0) -/* 0996B0 80098AB0 25AFFF60 */ addiu $t7, $t5, -0xa0 -/* 0996B4 80098AB4 448F5000 */ mtc1 $t7, $f10 -/* 0996B8 80098AB8 AC870000 */ sw $a3, ($a0) -/* 0996BC 80098ABC 26100008 */ addiu $s0, $s0, 8 -/* 0996C0 80098AC0 468050A0 */ cvt.s.w $f2, $f10 -/* 0996C4 80098AC4 3C01F200 */ lui $at, 0xf200 -/* 0996C8 80098AC8 0121C025 */ or $t8, $t1, $at -/* 0996CC 80098ACC 02002825 */ move $a1, $s0 -/* 0996D0 80098AD0 004C7025 */ or $t6, $v0, $t4 -/* 0996D4 80098AD4 ACAE0004 */ sw $t6, 4($a1) -/* 0996D8 80098AD8 46001182 */ mul.s $f6, $f2, $f0 -/* 0996DC 80098ADC 030BC825 */ or $t9, $t8, $t3 -/* 0996E0 80098AE0 ACB90000 */ sw $t9, ($a1) -/* 0996E4 80098AE4 3C01E400 */ lui $at, 0xe400 -/* 0996E8 80098AE8 26100008 */ addiu $s0, $s0, 8 -/* 0996EC 80098AEC 02001025 */ move $v0, $s0 -/* 0996F0 80098AF0 26100008 */ addiu $s0, $s0, 8 -/* 0996F4 80098AF4 460C3100 */ add.s $f4, $f6, $f12 -/* 0996F8 80098AF8 02001825 */ move $v1, $s0 -/* 0996FC 80098AFC 26100008 */ addiu $s0, $s0, 8 -/* 099700 80098B00 02003825 */ move $a3, $s0 -/* 099704 80098B04 46122202 */ mul.s $f8, $f4, $f18 -/* 099708 80098B08 01403025 */ move $a2, $t2 -/* 09970C 80098B0C 26100008 */ addiu $s0, $s0, 8 -/* 099710 80098B10 46027102 */ mul.s $f4, $f14, $f2 -/* 099714 80098B14 25AD0020 */ addiu $t5, $t5, 0x20 -/* 099718 80098B18 46144280 */ add.s $f10, $f8, $f20 -/* 09971C 80098B1C 46102200 */ add.s $f8, $f4, $f16 -/* 099720 80098B20 4600518D */ trunc.w.s $f6, $f10 -/* 099724 80098B24 46124282 */ mul.s $f10, $f8, $f18 -/* 099728 80098B28 44043000 */ mfc1 $a0, $f6 -/* 09972C 80098B2C 00000000 */ nop -/* 099730 80098B30 248E0020 */ addiu $t6, $a0, 0x20 -/* 099734 80098B34 46165180 */ add.s $f6, $f10, $f22 -/* 099738 80098B38 000E7880 */ sll $t7, $t6, 2 -/* 09973C 80098B3C 31F80FFF */ andi $t8, $t7, 0xfff -/* 099740 80098B40 0018CB00 */ sll $t9, $t8, 0xc -/* 099744 80098B44 4600310D */ trunc.w.s $f4, $f6 -/* 099748 80098B48 03217025 */ or $t6, $t9, $at -/* 09974C 80098B4C 44052000 */ mfc1 $a1, $f4 -/* 099750 80098B50 00000000 */ nop -/* 099754 80098B54 24AF0020 */ addiu $t7, $a1, 0x20 -/* 099758 80098B58 000FC080 */ sll $t8, $t7, 2 -/* 09975C 80098B5C 33190FFF */ andi $t9, $t8, 0xfff -/* 099760 80098B60 01D97825 */ or $t7, $t6, $t9 -/* 099764 80098B64 0004C080 */ sll $t8, $a0, 2 -/* 099768 80098B68 330E0FFF */ andi $t6, $t8, 0xfff -/* 09976C 80098B6C AC4F0000 */ sw $t7, ($v0) -/* 099770 80098B70 00057880 */ sll $t7, $a1, 2 -/* 099774 80098B74 31F80FFF */ andi $t8, $t7, 0xfff -/* 099778 80098B78 000ECB00 */ sll $t9, $t6, 0xc -/* 09977C 80098B7C 03387025 */ or $t6, $t9, $t8 -/* 099780 80098B80 AC4E0004 */ sw $t6, 4($v0) -/* 099784 80098B84 3C0FB300 */ lui $t7, 0xb300 -/* 099788 80098B88 AC6F0000 */ sw $t7, ($v1) -/* 09978C 80098B8C AC600004 */ sw $zero, 4($v1) -/* 099790 80098B90 3C180400 */ lui $t8, (0x04000400 >> 16) # lui $t8, 0x400 -/* 099794 80098B94 37180400 */ ori $t8, (0x04000400 & 0xFFFF) # ori $t8, $t8, 0x400 -/* 099798 80098B98 3C19B200 */ lui $t9, 0xb200 -/* 09979C 80098B9C ACF90000 */ sw $t9, ($a3) -/* 0997A0 80098BA0 ACF80004 */ sw $t8, 4($a3) -/* 0997A4 80098BA4 8FAE0074 */ lw $t6, 0x74($sp) -/* 0997A8 80098BA8 014E082B */ sltu $at, $t2, $t6 -/* 0997AC 80098BAC 5420FF99 */ bnel $at, $zero, .L80098A14 -/* 0997B0 80098BB0 02001025 */ move $v0, $s0 -/* 0997B4 80098BB4 8FA20060 */ lw $v0, 0x60($sp) -.L80098BB8: -/* 0997B8 80098BB8 8FB80078 */ lw $t8, 0x78($sp) -/* 0997BC 80098BBC 8FAF0080 */ lw $t7, 0x80($sp) -/* 0997C0 80098BC0 24420020 */ addiu $v0, $v0, 0x20 -/* 0997C4 80098BC4 0058082B */ sltu $at, $v0, $t8 -/* 0997C8 80098BC8 25F90020 */ addiu $t9, $t7, 0x20 -/* 0997CC 80098BCC 8FAD005C */ lw $t5, 0x5c($sp) -/* 0997D0 80098BD0 1420FF72 */ bnez $at, .L8009899C -/* 0997D4 80098BD4 AFB90080 */ sw $t9, 0x80($sp) -.L80098BD8: -/* 0997D8 80098BD8 8FBF0054 */ lw $ra, 0x54($sp) -/* 0997DC 80098BDC 02001025 */ move $v0, $s0 -/* 0997E0 80098BE0 8FB00030 */ lw $s0, 0x30($sp) -/* 0997E4 80098BE4 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0997E8 80098BE8 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 0997EC 80098BEC D7B80028 */ ldc1 $f24, 0x28($sp) -/* 0997F0 80098BF0 8FB10034 */ lw $s1, 0x34($sp) -/* 0997F4 80098BF4 8FB20038 */ lw $s2, 0x38($sp) -/* 0997F8 80098BF8 8FB3003C */ lw $s3, 0x3c($sp) -/* 0997FC 80098BFC 8FB40040 */ lw $s4, 0x40($sp) -/* 099800 80098C00 8FB50044 */ lw $s5, 0x44($sp) -/* 099804 80098C04 8FB60048 */ lw $s6, 0x48($sp) -/* 099808 80098C08 8FB7004C */ lw $s7, 0x4c($sp) -/* 09980C 80098C0C 8FBE0050 */ lw $fp, 0x50($sp) -/* 099810 80098C10 03E00008 */ jr $ra -/* 099814 80098C14 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/asm/non_matchings/code_80091750/func_800A8564.s b/asm/non_matchings/code_80091750/func_800A8564.s deleted file mode 100644 index 4970d4099..000000000 --- a/asm/non_matchings/code_80091750/func_800A8564.s +++ /dev/null @@ -1,109 +0,0 @@ -glabel func_800A8564 -/* 0A9164 800A8564 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0A9168 800A8568 AFBF002C */ sw $ra, 0x2c($sp) -/* 0A916C 800A856C 8C820000 */ lw $v0, ($a0) -/* 0A9170 800A8570 2401000F */ li $at, 15 -/* 0A9174 800A8574 00803825 */ move $a3, $a0 -/* 0A9178 800A8578 10410008 */ beq $v0, $at, .L800A859C -/* 0A917C 800A857C 00002825 */ move $a1, $zero -/* 0A9180 800A8580 24010033 */ li $at, 51 -/* 0A9184 800A8584 10410010 */ beq $v0, $at, .L800A85C8 -/* 0A9188 800A8588 2401005D */ li $at, 93 -/* 0A918C 800A858C 10410019 */ beq $v0, $at, .L800A85F4 -/* 0A9190 800A8590 3C0E8019 */ lui $t6, %hi(D_8018EDEC) # $t6, 0x8019 -/* 0A9194 800A8594 10000051 */ b .L800A86DC -/* 0A9198 800A8598 8FBF002C */ lw $ra, 0x2c($sp) -.L800A859C: -/* 0A919C 800A859C 3C028019 */ lui $v0, %hi(gMainMenuSelectionDepth) # $v0, 0x8019 -/* 0A91A0 800A85A0 8042EDED */ lb $v0, %lo(gMainMenuSelectionDepth)($v0) -/* 0A91A4 800A85A4 3C040200 */ lui $a0, %hi(D_0200487C) # $a0, 0x200 -/* 0A91A8 800A85A8 24010006 */ li $at, 6 -/* 0A91AC 800A85AC 10410004 */ beq $v0, $at, .L800A85C0 -/* 0A91B0 800A85B0 2484487C */ addiu $a0, %lo(D_0200487C) # addiu $a0, $a0, 0x487c -/* 0A91B4 800A85B4 24010007 */ li $at, 7 -/* 0A91B8 800A85B8 54410015 */ bnel $v0, $at, .L800A8610 -/* 0A91BC 800A85BC 8CE2001C */ lw $v0, 0x1c($a3) -.L800A85C0: -/* 0A91C0 800A85C0 10000012 */ b .L800A860C -/* 0A91C4 800A85C4 24050001 */ li $a1, 1 -.L800A85C8: -/* 0A91C8 800A85C8 3C028019 */ lui $v0, %hi(D_8018EDEE) # $v0, 0x8019 -/* 0A91CC 800A85CC 8042EDEE */ lb $v0, %lo(D_8018EDEE)($v0) -/* 0A91D0 800A85D0 3C040200 */ lui $a0, %hi(D_02004B74) # $a0, 0x200 -/* 0A91D4 800A85D4 24010002 */ li $at, 2 -/* 0A91D8 800A85D8 10410004 */ beq $v0, $at, .L800A85EC -/* 0A91DC 800A85DC 24844B74 */ addiu $a0, %lo(D_02004B74) # addiu $a0, $a0, 0x4b74 -/* 0A91E0 800A85E0 24010003 */ li $at, 3 -/* 0A91E4 800A85E4 5441000A */ bnel $v0, $at, .L800A8610 -/* 0A91E8 800A85E8 8CE2001C */ lw $v0, 0x1c($a3) -.L800A85EC: -/* 0A91EC 800A85EC 10000007 */ b .L800A860C -/* 0A91F0 800A85F0 24050001 */ li $a1, 1 -.L800A85F4: -/* 0A91F4 800A85F4 81CEEDEC */ lb $t6, %lo(D_8018EDEC)($t6) -/* 0A91F8 800A85F8 3C040200 */ lui $a0, %hi(D_02004E80) # $a0, 0x200 -/* 0A91FC 800A85FC 24010003 */ li $at, 3 -/* 0A9200 800A8600 15C10002 */ bne $t6, $at, .L800A860C -/* 0A9204 800A8604 24844E80 */ addiu $a0, %lo(D_02004E80) # addiu $a0, $a0, 0x4e80 -/* 0A9208 800A8608 24050001 */ li $a1, 1 -.L800A860C: -/* 0A920C 800A860C 8CE2001C */ lw $v0, 0x1c($a3) -.L800A8610: -/* 0A9210 800A8610 28410020 */ slti $at, $v0, 0x20 -/* 0A9214 800A8614 10200030 */ beqz $at, .L800A86D8 -/* 0A9218 800A8618 00021940 */ sll $v1, $v0, 5 -/* 0A921C 800A861C 04610003 */ bgez $v1, .L800A862C -/* 0A9220 800A8620 00037983 */ sra $t7, $v1, 6 -/* 0A9224 800A8624 2461003F */ addiu $at, $v1, 0x3f -/* 0A9228 800A8628 00017983 */ sra $t7, $at, 6 -.L800A862C: -/* 0A922C 800A862C AFAF0034 */ sw $t7, 0x34($sp) -/* 0A9230 800A8630 AFA50030 */ sw $a1, 0x30($sp) -/* 0A9234 800A8634 0C026449 */ jal segmented_to_virtual_dupe -/* 0A9238 800A8638 AFA70038 */ sw $a3, 0x38($sp) -/* 0A923C 800A863C 8FA70038 */ lw $a3, 0x38($sp) -/* 0A9240 800A8640 8FA50030 */ lw $a1, 0x30($sp) -/* 0A9244 800A8644 9459000C */ lhu $t9, 0xc($v0) -/* 0A9248 800A8648 944A000E */ lhu $t2, 0xe($v0) -/* 0A924C 800A864C 8CF8000C */ lw $t8, 0xc($a3) -/* 0A9250 800A8650 8CE90010 */ lw $t1, 0x10($a3) -/* 0A9254 800A8654 8FA30034 */ lw $v1, 0x34($sp) -/* 0A9258 800A8658 03194021 */ addu $t0, $t8, $t9 -/* 0A925C 800A865C 10A0000C */ beqz $a1, .L800A8690 -/* 0A9260 800A8660 012A3021 */ addu $a2, $t1, $t2 -/* 0A9264 800A8664 3C048015 */ lui $a0, %hi(gDisplayListHead) # $a0, 0x8015 -/* 0A9268 800A8668 01033823 */ subu $a3, $t0, $v1 -/* 0A926C 800A866C 24CB0012 */ addiu $t3, $a2, 0x12 -/* 0A9270 800A8670 AFAB0010 */ sw $t3, 0x10($sp) -/* 0A9274 800A8674 24E7001E */ addiu $a3, $a3, 0x1e -/* 0A9278 800A8678 8C840298 */ lw $a0, %lo(gDisplayListHead)($a0) -/* 0A927C 800A867C 0C025668 */ jal draw_flash_select_case_slow -/* 0A9280 800A8680 01032821 */ addu $a1, $t0, $v1 -/* 0A9284 800A8684 3C018015 */ lui $at, %hi(gDisplayListHead) # $at, 0x8015 -/* 0A9288 800A8688 10000013 */ b .L800A86D8 -/* 0A928C 800A868C AC220298 */ sw $v0, %lo(gDisplayListHead)($at) -.L800A8690: -/* 0A9290 800A8690 3C048015 */ lui $a0, %hi(gDisplayListHead) # $a0, 0x8015 -/* 0A9294 800A8694 01033823 */ subu $a3, $t0, $v1 -/* 0A9298 800A8698 24CC0012 */ addiu $t4, $a2, 0x12 -/* 0A929C 800A869C 240D0001 */ li $t5, 1 -/* 0A92A0 800A86A0 240E0001 */ li $t6, 1 -/* 0A92A4 800A86A4 240F0001 */ li $t7, 1 -/* 0A92A8 800A86A8 241800FF */ li $t8, 255 -/* 0A92AC 800A86AC AFB80020 */ sw $t8, 0x20($sp) -/* 0A92B0 800A86B0 AFAF001C */ sw $t7, 0x1c($sp) -/* 0A92B4 800A86B4 AFAE0018 */ sw $t6, 0x18($sp) -/* 0A92B8 800A86B8 AFAD0014 */ sw $t5, 0x14($sp) -/* 0A92BC 800A86BC AFAC0010 */ sw $t4, 0x10($sp) -/* 0A92C0 800A86C0 24E7001E */ addiu $a3, $a3, 0x1e -/* 0A92C4 800A86C4 8C840298 */ lw $a0, %lo(gDisplayListHead)($a0) -/* 0A92C8 800A86C8 0C026306 */ jal draw_box_fill -/* 0A92CC 800A86CC 01032821 */ addu $a1, $t0, $v1 -/* 0A92D0 800A86D0 3C018015 */ lui $at, %hi(gDisplayListHead) # $at, 0x8015 -/* 0A92D4 800A86D4 AC220298 */ sw $v0, %lo(gDisplayListHead)($at) -.L800A86D8: -/* 0A92D8 800A86D8 8FBF002C */ lw $ra, 0x2c($sp) -.L800A86DC: -/* 0A92DC 800A86DC 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0A92E0 800A86E0 03E00008 */ jr $ra -/* 0A92E4 800A86E4 00000000 */ nop diff --git a/asm/non_matchings/render_objects/func_8004D654.s b/asm/non_matchings/render_objects/func_8004D654.s deleted file mode 100644 index 4191028a2..000000000 --- a/asm/non_matchings/render_objects/func_8004D654.s +++ /dev/null @@ -1,96 +0,0 @@ - -glabel func_8004D654 -/* 04E254 8004D654 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 04E258 8004D658 3C088015 */ lui $t0, %hi(gDisplayListHead) # $t0, 0x8015 -/* 04E25C 8004D65C 25080298 */ addiu $t0, %lo(gDisplayListHead) # addiu $t0, $t0, 0x298 -/* 04E260 8004D660 AFBE0048 */ sw $fp, 0x48($sp) -/* 04E264 8004D664 8FBE0074 */ lw $fp, 0x74($sp) -/* 04E268 8004D668 8D030000 */ lw $v1, ($t0) -/* 04E26C 8004D66C F7B40020 */ sdc1 $f20, 0x20($sp) -/* 04E270 8004D670 AFBF004C */ sw $ra, 0x4c($sp) -/* 04E274 8004D674 246F0008 */ addiu $t7, $v1, 8 -/* 04E278 8004D678 AFB70044 */ sw $s7, 0x44($sp) -/* 04E27C 8004D67C AFB60040 */ sw $s6, 0x40($sp) -/* 04E280 8004D680 AFB5003C */ sw $s5, 0x3c($sp) -/* 04E284 8004D684 AFB40038 */ sw $s4, 0x38($sp) -/* 04E288 8004D688 AFB30034 */ sw $s3, 0x34($sp) -/* 04E28C 8004D68C AFB20030 */ sw $s2, 0x30($sp) -/* 04E290 8004D690 AFB1002C */ sw $s1, 0x2c($sp) -/* 04E294 8004D694 AFB00028 */ sw $s0, 0x28($sp) -/* 04E298 8004D698 AFA40050 */ sw $a0, 0x50($sp) -/* 04E29C 8004D69C AFA60058 */ sw $a2, 0x58($sp) -/* 04E2A0 8004D6A0 AD0F0000 */ sw $t7, ($t0) -/* 04E2A4 8004D6A4 3C190D01 */ lui $t9, %hi(D_0D008000) # $t9, 0xd01 -/* 04E2A8 8004D6A8 27398000 */ addiu $t9, %lo(D_0D008000) # addiu $t9, $t9, -0x8000 -/* 04E2AC 8004D6AC 3C180600 */ lui $t8, 0x600 -/* 04E2B0 8004D6B0 4487A000 */ mtc1 $a3, $f20 -/* 04E2B4 8004D6B4 AC780000 */ sw $t8, ($v1) -/* 04E2B8 8004D6B8 AC790004 */ sw $t9, 4($v1) -/* 04E2BC 8004D6BC 00C03825 */ move $a3, $a2 -/* 04E2C0 8004D6C0 00A0B825 */ move $s7, $a1 -/* 04E2C4 8004D6C4 07C10003 */ bgez $fp, .L8004D6D4 -/* 04E2C8 8004D6C8 001E7043 */ sra $t6, $fp, 1 -/* 04E2CC 8004D6CC 27C10001 */ addiu $at, $fp, 1 -/* 04E2D0 8004D6D0 00017043 */ sra $t6, $at, 1 -.L8004D6D4: -/* 04E2D4 8004D6D4 02EEA023 */ subu $s4, $s7, $t6 -/* 04E2D8 8004D6D8 00E09025 */ move $s2, $a3 -/* 04E2DC 8004D6DC 8FA50064 */ lw $a1, 0x64($sp) -/* 04E2E0 8004D6E0 8FA60068 */ lw $a2, 0x68($sp) -/* 04E2E4 8004D6E4 0C012D20 */ jal func_8004B480 -/* 04E2E8 8004D6E8 8FA40060 */ lw $a0, 0x60($sp) -/* 04E2EC 8004D6EC 8FB1007C */ lw $s1, 0x7c($sp) -/* 04E2F0 8004D6F0 00008025 */ move $s0, $zero -/* 04E2F4 8004D6F4 8FB30070 */ lw $s3, 0x70($sp) -/* 04E2F8 8004D6F8 03D1001A */ div $zero, $fp, $s1 -/* 04E2FC 8004D6FC 0000A812 */ mflo $s5 -/* 04E300 8004D700 16200002 */ bnez $s1, .L8004D70C -/* 04E304 8004D704 00000000 */ nop -/* 04E308 8004D708 0007000D */ break 7 -.L8004D70C: -/* 04E30C 8004D70C 2401FFFF */ li $at, -1 -/* 04E310 8004D710 16210004 */ bne $s1, $at, .L8004D724 -/* 04E314 8004D714 3C018000 */ lui $at, 0x8000 -/* 04E318 8004D718 17C10002 */ bne $fp, $at, .L8004D724 -/* 04E31C 8004D71C 00000000 */ nop -/* 04E320 8004D720 0006000D */ break 6 -.L8004D724: -/* 04E324 8004D724 5AA00017 */ blezl $s5, .L8004D784 -/* 04E328 8004D728 8FBF004C */ lw $ra, 0x4c($sp) -/* 04E32C 8004D72C 02710019 */ multu $s3, $s1 -/* 04E330 8004D730 0000B012 */ mflo $s6 -/* 04E334 8004D734 06C10003 */ bgez $s6, .L8004D744 -/* 04E338 8004D738 00164843 */ sra $t1, $s6, 1 -/* 04E33C 8004D73C 26C10001 */ addiu $at, $s6, 1 -/* 04E340 8004D740 00014843 */ sra $t1, $at, 1 -.L8004D744: -/* 04E344 8004D744 0120B025 */ move $s6, $t1 -.L8004D748: -/* 04E348 8004D748 02402025 */ move $a0, $s2 -/* 04E34C 8004D74C 02602825 */ move $a1, $s3 -/* 04E350 8004D750 0C0113CD */ jal func_80044F34 -/* 04E354 8004D754 02203025 */ move $a2, $s1 -/* 04E358 8004D758 8FA40050 */ lw $a0, 0x50($sp) -/* 04E35C 8004D75C 02E02825 */ move $a1, $s7 -/* 04E360 8004D760 02603025 */ move $a2, $s3 -/* 04E364 8004D764 03C03825 */ move $a3, $fp -/* 04E368 8004D768 0C012ECF */ jal func_8004BB3C -/* 04E36C 8004D76C E7B40010 */ swc1 $f20, 0x10($sp) -/* 04E370 8004D770 26100001 */ addiu $s0, $s0, 1 -/* 04E374 8004D774 02569021 */ addu $s2, $s2, $s6 -/* 04E378 8004D778 1615FFF3 */ bne $s0, $s5, .L8004D748 -/* 04E37C 8004D77C 0291A021 */ addu $s4, $s4, $s1 -/* 04E380 8004D780 8FBF004C */ lw $ra, 0x4c($sp) -.L8004D784: -/* 04E384 8004D784 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 04E388 8004D788 8FB00028 */ lw $s0, 0x28($sp) -/* 04E38C 8004D78C 8FB1002C */ lw $s1, 0x2c($sp) -/* 04E390 8004D790 8FB20030 */ lw $s2, 0x30($sp) -/* 04E394 8004D794 8FB30034 */ lw $s3, 0x34($sp) -/* 04E398 8004D798 8FB40038 */ lw $s4, 0x38($sp) -/* 04E39C 8004D79C 8FB5003C */ lw $s5, 0x3c($sp) -/* 04E3A0 8004D7A0 8FB60040 */ lw $s6, 0x40($sp) -/* 04E3A4 8004D7A4 8FB70044 */ lw $s7, 0x44($sp) -/* 04E3A8 8004D7A8 8FBE0048 */ lw $fp, 0x48($sp) -/* 04E3AC 8004D7AC 03E00008 */ jr $ra -/* 04E3B0 8004D7B0 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/asm/non_matchings/update_objects/func_8007B040.s b/asm/non_matchings/update_objects/func_8007B040.s deleted file mode 100644 index 87576cc57..000000000 --- a/asm/non_matchings/update_objects/func_8007B040.s +++ /dev/null @@ -1,144 +0,0 @@ -glabel func_8007B040 -/* 07BC40 8007B040 3C0E800E */ lui $t6, %hi(gModeSelection) # $t6, 0x800e -/* 07BC44 8007B044 8DCEC53C */ lw $t6, %lo(gModeSelection)($t6) -/* 07BC48 8007B048 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 07BC4C 8007B04C AFB00018 */ sw $s0, 0x18($sp) -/* 07BC50 8007B050 00A08025 */ move $s0, $a1 -/* 07BC54 8007B054 AFBF001C */ sw $ra, 0x1c($sp) -/* 07BC58 8007B058 AFA40078 */ sw $a0, 0x78($sp) -/* 07BC5C 8007B05C 00003825 */ move $a3, $zero -/* 07BC60 8007B060 15C00020 */ bnez $t6, .L8007B0E4 -/* 07BC64 8007B064 00005825 */ move $t3, $zero -/* 07BC68 8007B068 0C0ADF8D */ jal random_int -/* 07BC6C 8007B06C 24040064 */ li $a0, 100 -/* 07BC70 8007B070 28410051 */ slti $at, $v0, 0x51 -/* 07BC74 8007B074 1020000B */ beqz $at, .L8007B0A4 -/* 07BC78 8007B078 320400FF */ andi $a0, $s0, 0xff -/* 07BC7C 8007B07C 00101080 */ sll $v0, $s0, 2 -/* 07BC80 8007B080 3C048016 */ lui $a0, %hi(gLapCountByPlayerId + 0x2) # 0x8016 -/* 07BC84 8007B084 3C058016 */ lui $a1, %hi(gGPCurrentRaceRankByPlayerId + 0x2) # 0x8016 -/* 07BC88 8007B088 00A22821 */ addu $a1, $a1, $v0 -/* 07BC8C 8007B08C 00822021 */ addu $a0, $a0, $v0 -/* 07BC90 8007B090 84844392 */ lh $a0, %lo(gLapCountByPlayerId + 0x2)($a0) # 0x4392($a0) -/* 07BC94 8007B094 0C01EBD0 */ jal gen_random_item_human -/* 07BC98 8007B098 84A543BA */ lh $a1, %lo(gGPCurrentRaceRankByPlayerId + 0x2)($a1) # 0x43ba($a1) -/* 07BC9C 8007B09C 10000006 */ b .L8007B0B8 -/* 07BCA0 8007B0A0 00401825 */ move $v1, $v0 -.L8007B0A4: -/* 07BCA4 8007B0A4 3C051900 */ lui $a1, (0x1900A058 >> 16) # lui $a1, 0x1900 -/* 07BCA8 8007B0A8 34A5A058 */ ori $a1, (0x1900A058 & 0xFFFF) # ori $a1, $a1, 0xa058 -/* 07BCAC 8007B0AC 0C032418 */ jal func_800C9060 -/* 07BCB0 8007B0B0 AFA00060 */ sw $zero, 0x60($sp) -/* 07BCB4 8007B0B4 8FA30060 */ lw $v1, 0x60($sp) -.L8007B0B8: -/* 07BCB8 8007B0B8 8FAF0078 */ lw $t7, 0x78($sp) -/* 07BCBC 8007B0BC 240D00E0 */ li $t5, 224 -/* 07BCC0 8007B0C0 3C0C8016 */ lui $t4, %hi(gObjectList) # $t4, 0x8016 -/* 07BCC4 8007B0C4 01ED0019 */ multu $t7, $t5 -/* 07BCC8 8007B0C8 258C5C18 */ addiu $t4, %lo(gObjectList) # addiu $t4, $t4, 0x5c18 -/* 07BCCC 8007B0CC 240B0001 */ li $t3, 1 -/* 07BCD0 8007B0D0 0000C012 */ mflo $t8 -/* 07BCD4 8007B0D4 01983821 */ addu $a3, $t4, $t8 -/* 07BCD8 8007B0D8 A4E300A2 */ sh $v1, 0xa2($a3) -/* 07BCDC 8007B0DC 10000058 */ b .L8007B240 -/* 07BCE0 8007B0E0 A0E300D2 */ sb $v1, 0xd2($a3) -.L8007B0E4: -/* 07BCE4 8007B0E4 3C08800E */ lui $t0, %hi(gPlayerCountSelection1) # $t0, 0x800e -/* 07BCE8 8007B0E8 8D08C538 */ lw $t0, %lo(gPlayerCountSelection1)($t0) -/* 07BCEC 8007B0EC 00001825 */ move $v1, $zero -/* 07BCF0 8007B0F0 19000019 */ blez $t0, .L8007B158 -/* 07BCF4 8007B0F4 3C048018 */ lui $a0, %hi(gItemWindowObjectByPlayerId) # $a0, 0x8018 -/* 07BCF8 8007B0F8 3C0C8016 */ lui $t4, %hi(gObjectList) # $t4, 0x8016 -/* 07BCFC 8007B0FC 258C5C18 */ addiu $t4, %lo(gObjectList) # addiu $t4, $t4, 0x5c18 -/* 07BD00 8007B100 24843E88 */ addiu $a0, %lo(gItemWindowObjectByPlayerId) # addiu $a0, $a0, 0x3e88 -/* 07BD04 8007B104 240D00E0 */ li $t5, 224 -/* 07BD08 8007B108 27AA0040 */ addiu $t2, $sp, 0x40 -/* 07BD0C 8007B10C 27A90050 */ addiu $t1, $sp, 0x50 -.L8007B110: -/* 07BD10 8007B110 1070000D */ beq $v1, $s0, .L8007B148 -/* 07BD14 8007B114 8C860000 */ lw $a2, ($a0) -/* 07BD18 8007B118 00CD0019 */ multu $a2, $t5 -/* 07BD1C 8007B11C 00071080 */ sll $v0, $a3, 2 -/* 07BD20 8007B120 0122C821 */ addu $t9, $t1, $v0 -/* 07BD24 8007B124 01427021 */ addu $t6, $t2, $v0 -/* 07BD28 8007B128 00007812 */ mflo $t7 -/* 07BD2C 8007B12C 018FC021 */ addu $t8, $t4, $t7 -/* 07BD30 8007B130 870500A4 */ lh $a1, 0xa4($t8) -/* 07BD34 8007B134 50A00005 */ beql $a1, $zero, .L8007B14C -/* 07BD38 8007B138 24630001 */ addiu $v1, $v1, 1 -/* 07BD3C 8007B13C AF230000 */ sw $v1, ($t9) -/* 07BD40 8007B140 ADC50000 */ sw $a1, ($t6) -/* 07BD44 8007B144 24E70001 */ addiu $a3, $a3, 1 -.L8007B148: -/* 07BD48 8007B148 24630001 */ addiu $v1, $v1, 1 -.L8007B14C: -/* 07BD4C 8007B14C 0068082A */ slt $at, $v1, $t0 -/* 07BD50 8007B150 1420FFEF */ bnez $at, .L8007B110 -/* 07BD54 8007B154 24840004 */ addiu $a0, $a0, 4 -.L8007B158: -/* 07BD58 8007B158 50E0003A */ beql $a3, $zero, .L8007B244 -/* 07BD5C 8007B15C 8FBF001C */ lw $ra, 0x1c($sp) -/* 07BD60 8007B160 0C0ADF8D */ jal random_int -/* 07BD64 8007B164 30E4FFFF */ andi $a0, $a3, 0xffff -/* 07BD68 8007B168 8FB80078 */ lw $t8, 0x78($sp) -/* 07BD6C 8007B16C 240D00E0 */ li $t5, 224 -/* 07BD70 8007B170 27A90050 */ addiu $t1, $sp, 0x50 -/* 07BD74 8007B174 030D0019 */ multu $t8, $t5 -/* 07BD78 8007B178 00025880 */ sll $t3, $v0, 2 -/* 07BD7C 8007B17C 012B7021 */ addu $t6, $t1, $t3 -/* 07BD80 8007B180 8DC30000 */ lw $v1, ($t6) -/* 07BD84 8007B184 27AA0040 */ addiu $t2, $sp, 0x40 -/* 07BD88 8007B188 3C0C8016 */ lui $t4, %hi(gObjectList) # $t4, 0x8016 -/* 07BD8C 8007B18C 258C5C18 */ addiu $t4, %lo(gObjectList) # addiu $t4, $t4, 0x5c18 -/* 07BD90 8007B190 014B7821 */ addu $t7, $t2, $t3 -/* 07BD94 8007B194 85E80002 */ lh $t0, 2($t7) -/* 07BD98 8007B198 0003C0C0 */ sll $t8, $v1, 3 -/* 07BD9C 8007B19C 0000C812 */ mflo $t9 -/* 07BDA0 8007B1A0 01993821 */ addu $a3, $t4, $t9 -/* 07BDA4 8007B1A4 0303C023 */ subu $t8, $t8, $v1 -/* 07BDA8 8007B1A8 0018C100 */ sll $t8, $t8, 4 -/* 07BDAC 8007B1AC 3C19800E */ lui $t9, %hi(gPlayerOne) # $t9, 0x800e -/* 07BDB0 8007B1B0 A0E300D1 */ sb $v1, 0xd1($a3) -/* 07BDB4 8007B1B4 0303C023 */ subu $t8, $t8, $v1 -/* 07BDB8 8007B1B8 A4E800A2 */ sh $t0, 0xa2($a3) -/* 07BDBC 8007B1BC A0E800D2 */ sb $t0, 0xd2($a3) -/* 07BDC0 8007B1C0 8F39C4DC */ lw $t9, %lo(gPlayerOne)($t9) -/* 07BDC4 8007B1C4 3C068018 */ lui $a2, %hi(gItemWindowObjectByPlayerId) # 0x8018 -/* 07BDC8 8007B1C8 0018C080 */ sll $t8, $t8, 2 -/* 07BDCC 8007B1CC 00037880 */ sll $t7, $v1, 2 -/* 07BDD0 8007B1D0 00CF3021 */ addu $a2, $a2, $t7 -/* 07BDD4 8007B1D4 0303C023 */ subu $t8, $t8, $v1 -/* 07BDD8 8007B1D8 8CC43E88 */ lw $a0, %lo(gItemWindowObjectByPlayerId)($a2) # 0x3e88($a2) -/* 07BDDC 8007B1DC 0018C0C0 */ sll $t8, $t8, 3 -/* 07BDE0 8007B1E0 03197021 */ addu $t6, $t8, $t9 -/* 07BDE4 8007B1E4 AFAE0038 */ sw $t6, 0x38($sp) -/* 07BDE8 8007B1E8 24050001 */ li $a1, 1 -/* 07BDEC 8007B1EC 0C01C8A9 */ jal func_800722A4 -/* 07BDF0 8007B1F0 AFA40064 */ sw $a0, 0x64($sp) -/* 07BDF4 8007B1F4 8FA40064 */ lw $a0, 0x64($sp) -/* 07BDF8 8007B1F8 240D00E0 */ li $t5, 224 -/* 07BDFC 8007B1FC 3C0C8016 */ lui $t4, %hi(gObjectList) # $t4, 0x8016 -/* 07BE00 8007B200 008D0019 */ multu $a0, $t5 -/* 07BE04 8007B204 258C5C18 */ addiu $t4, %lo(gObjectList) # addiu $t4, $t4, 0x5c18 -/* 07BE08 8007B208 8FB80038 */ lw $t8, 0x38($sp) -/* 07BE0C 8007B20C 24050002 */ li $a1, 2 -/* 07BE10 8007B210 00007812 */ mflo $t7 -/* 07BE14 8007B214 018F8021 */ addu $s0, $t4, $t7 -/* 07BE18 8007B218 A60000A4 */ sh $zero, 0xa4($s0) -/* 07BE1C 8007B21C 0C01C8C8 */ jal func_80072320 -/* 07BE20 8007B220 A7000010 */ sh $zero, 0x10($t8) -/* 07BE24 8007B224 10400005 */ beqz $v0, .L8007B23C -/* 07BE28 8007B228 8FA60064 */ lw $a2, 0x64($sp) -/* 07BE2C 8007B22C 00C02025 */ move $a0, $a2 -/* 07BE30 8007B230 0C01C8B3 */ jal func_800722CC -/* 07BE34 8007B234 24050002 */ li $a1, 2 -/* 07BE38 8007B238 A6000098 */ sh $zero, 0x98($s0) -.L8007B23C: -/* 07BE3C 8007B23C 240B0001 */ li $t3, 1 -.L8007B240: -/* 07BE40 8007B240 8FBF001C */ lw $ra, 0x1c($sp) -.L8007B244: -/* 07BE44 8007B244 8FB00018 */ lw $s0, 0x18($sp) -/* 07BE48 8007B248 27BD0078 */ addiu $sp, $sp, 0x78 -/* 07BE4C 8007B24C 03E00008 */ jr $ra -/* 07BE50 8007B250 01601025 */ move $v0, $t3 diff --git a/asm/non_matchings/update_objects/func_80081FF4.s b/asm/non_matchings/update_objects/func_80081FF4.s deleted file mode 100644 index 932ca1b9a..000000000 --- a/asm/non_matchings/update_objects/func_80081FF4.s +++ /dev/null @@ -1,120 +0,0 @@ -glabel func_80081FF4 -/* 082BF4 80081FF4 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 082BF8 80081FF8 AFBF0014 */ sw $ra, 0x14($sp) -/* 082BFC 80081FFC AFA5003C */ sw $a1, 0x3c($sp) -/* 082C00 80082000 AFA40038 */ sw $a0, 0x38($sp) -/* 082C04 80082004 0C01C8E9 */ jal init_object -/* 082C08 80082008 00002825 */ move $a1, $zero -/* 082C0C 8008200C 0C0ADF8D */ jal random_int -/* 082C10 80082010 2404001E */ li $a0, 30 -/* 082C14 80082014 8FAE0038 */ lw $t6, 0x38($sp) -/* 082C18 80082018 8FA3003C */ lw $v1, 0x3c($sp) -/* 082C1C 8008201C 3C188016 */ lui $t8, %hi(gObjectList) # $t8, 0x8016 -/* 082C20 80082020 000E78C0 */ sll $t7, $t6, 3 -/* 082C24 80082024 01EE7823 */ subu $t7, $t7, $t6 -/* 082C28 80082028 000F7940 */ sll $t7, $t7, 5 -/* 082C2C 8008202C 27185C18 */ addiu $t8, %lo(gObjectList) # addiu $t8, $t8, 0x5c18 -/* 082C30 80082030 01F83821 */ addu $a3, $t7, $t8 -/* 082C34 80082034 24590005 */ addiu $t9, $v0, 5 -/* 082C38 80082038 24010001 */ li $at, 1 -/* 082C3C 8008203C 10610009 */ beq $v1, $at, .L80082064 -/* 082C40 80082040 ACF9004C */ sw $t9, 0x4c($a3) -/* 082C44 80082044 24010002 */ li $at, 2 -/* 082C48 80082048 1061000D */ beq $v1, $at, .L80082080 -/* 082C4C 8008204C 3C068019 */ lui $a2, %hi(D_8018D1A8) # 0x8019 -/* 082C50 80082050 24010003 */ li $at, 3 -/* 082C54 80082054 10610011 */ beq $v1, $at, .L8008209C -/* 082C58 80082058 3C068019 */ lui $a2, %hi(D_8018D1B8) # 0x8019 -/* 082C5C 8008205C 10000016 */ b .L800820B8 -/* 082C60 80082060 8FA5002C */ lw $a1, 0x2c($sp) -.L80082064: -/* 082C64 80082064 3C068019 */ lui $a2, %hi(D_8018D198) # $a2, 0x8019 -/* 082C68 80082068 24C6D198 */ addiu $a2, %lo(D_8018D198) # addiu $a2, $a2, -0x2e68 -/* 082C6C 8008206C 24050008 */ li $a1, 8 -/* 082C70 80082070 A7A00028 */ sh $zero, 0x28($sp) -/* 082C74 80082074 AFA5002C */ sw $a1, 0x2c($sp) -/* 082C78 80082078 1000000E */ b .L800820B4 -/* 082C7C 8008207C AFA60020 */ sw $a2, 0x20($sp) -.L80082080: -/* 082C80 80082080 24C6D1A8 */ addiu $a2, $a2, %lo(D_8018D1A8) # -0x2e58 -/* 082C84 80082084 2405000B */ li $a1, 11 -/* 082C88 80082088 24080018 */ li $t0, 24 -/* 082C8C 8008208C A7A80028 */ sh $t0, 0x28($sp) -/* 082C90 80082090 AFA5002C */ sw $a1, 0x2c($sp) -/* 082C94 80082094 10000007 */ b .L800820B4 -/* 082C98 80082098 AFA60020 */ sw $a2, 0x20($sp) -.L8008209C: -/* 082C9C 8008209C 24C6D1B8 */ addiu $a2, $a2, %lo(D_8018D1B8) # -0x2e48 -/* 082CA0 800820A0 2405000C */ li $a1, 12 -/* 082CA4 800820A4 24090039 */ li $t1, 57 -/* 082CA8 800820A8 A7A90028 */ sh $t1, 0x28($sp) -/* 082CAC 800820AC AFA5002C */ sw $a1, 0x2c($sp) -/* 082CB0 800820B0 AFA60020 */ sw $a2, 0x20($sp) -.L800820B4: -/* 082CB4 800820B4 8FA5002C */ lw $a1, 0x2c($sp) -.L800820B8: -/* 082CB8 800820B8 AFA70018 */ sw $a3, 0x18($sp) -/* 082CBC 800820BC 0C0ADF8D */ jal random_int -/* 082CC0 800820C0 30A4FFFF */ andi $a0, $a1, 0xffff -/* 082CC4 800820C4 8FA5002C */ lw $a1, 0x2c($sp) -/* 082CC8 800820C8 00021C00 */ sll $v1, $v0, 0x10 -/* 082CCC 800820CC 00035403 */ sra $t2, $v1, 0x10 -/* 082CD0 800820D0 01401825 */ move $v1, $t2 -/* 082CD4 800820D4 8FA60020 */ lw $a2, 0x20($sp) -/* 082CD8 800820D8 8FA70018 */ lw $a3, 0x18($sp) -/* 082CDC 800820DC 18A00013 */ blez $a1, .L8008212C -/* 082CE0 800820E0 00002025 */ move $a0, $zero -/* 082CE4 800820E4 00661021 */ addu $v0, $v1, $a2 -.L800820E8: -/* 082CE8 800820E8 804B0000 */ lb $t3, ($v0) -/* 082CEC 800820EC 24840001 */ addiu $a0, $a0, 1 -/* 082CF0 800820F0 51600009 */ beql $t3, $zero, .L80082118 -/* 082CF4 800820F4 240E0001 */ li $t6, 1 -/* 082CF8 800820F8 24630001 */ addiu $v1, $v1, 1 -/* 082CFC 800820FC 00036400 */ sll $t4, $v1, 0x10 -/* 082D00 80082100 000C1C03 */ sra $v1, $t4, 0x10 -/* 082D04 80082104 14650007 */ bne $v1, $a1, .L80082124 -/* 082D08 80082108 00000000 */ nop -/* 082D0C 8008210C 10000005 */ b .L80082124 -/* 082D10 80082110 00001825 */ move $v1, $zero -/* 082D14 80082114 240E0001 */ li $t6, 1 -.L80082118: -/* 082D18 80082118 A04E0000 */ sb $t6, ($v0) -/* 082D1C 8008211C 10000003 */ b .L8008212C -/* 082D20 80082120 A4E300A4 */ sh $v1, 0xa4($a3) -.L80082124: -/* 082D24 80082124 5485FFF0 */ bnel $a0, $a1, .L800820E8 -/* 082D28 80082128 00661021 */ addu $v0, $v1, $a2 -.L8008212C: -/* 082D2C 8008212C 87AF0028 */ lh $t7, 0x28($sp) -/* 082D30 80082130 0003C880 */ sll $t9, $v1, 2 -/* 082D34 80082134 0323C823 */ subu $t9, $t9, $v1 -/* 082D38 80082138 00194040 */ sll $t0, $t9, 1 -/* 082D3C 8008213C 3C0A800E */ lui $t2, %hi(gMoleSpawns) # $t2, 0x800e -/* 082D40 80082140 000FC040 */ sll $t8, $t7, 1 -/* 082D44 80082144 03084821 */ addu $t1, $t8, $t0 -/* 082D48 80082148 254A6360 */ addiu $t2, %lo(gMoleSpawns) # addiu $t2, $t2, 0x6360 -/* 082D4C 8008214C 012A1021 */ addu $v0, $t1, $t2 -/* 082D50 80082150 844B0000 */ lh $t3, ($v0) -/* 082D54 80082154 3C018019 */ lui $at, %hi(xOrientation) # $at, 0x8019 -/* 082D58 80082158 C428D01C */ lwc1 $f8, %lo(xOrientation)($at) -/* 082D5C 8008215C 448B2000 */ mtc1 $t3, $f4 -/* 082D60 80082160 844C0002 */ lh $t4, 2($v0) -/* 082D64 80082164 844D0004 */ lh $t5, 4($v0) -/* 082D68 80082168 468021A0 */ cvt.s.w $f6, $f4 -/* 082D6C 8008216C 448C8000 */ mtc1 $t4, $f16 -/* 082D70 80082170 3C014022 */ li $at, 0x40220000 # 2.531250 -/* 082D74 80082174 44812800 */ mtc1 $at, $f5 -/* 082D78 80082178 44802000 */ mtc1 $zero, $f4 -/* 082D7C 8008217C 468084A1 */ cvt.d.w $f18, $f16 -/* 082D80 80082180 46083282 */ mul.s $f10, $f6, $f8 -/* 082D84 80082184 8FBF0014 */ lw $ra, 0x14($sp) -/* 082D88 80082188 27BD0038 */ addiu $sp, $sp, 0x38 -/* 082D8C 8008218C 46249181 */ sub.d $f6, $f18, $f4 -/* 082D90 80082190 E4EA0010 */ swc1 $f10, 0x10($a3) -/* 082D94 80082194 448D5000 */ mtc1 $t5, $f10 -/* 082D98 80082198 46203220 */ cvt.s.d $f8, $f6 -/* 082D9C 8008219C 46805420 */ cvt.s.w $f16, $f10 -/* 082DA0 800821A0 E4E80014 */ swc1 $f8, 0x14($a3) -/* 082DA4 800821A4 03E00008 */ jr $ra -/* 082DA8 800821A8 E4F00018 */ swc1 $f16, 0x18($a3) diff --git a/include/objects.h b/include/objects.h index e3c5dd73a..86fc2af02 100644 --- a/include/objects.h +++ b/include/objects.h @@ -311,13 +311,17 @@ extern s32 indexObjectList3[]; extern s32 indexObjectList4[]; #define gObjectParticle1_SIZE 128 -#define NUM_MAX_MOLES 0x1F #define NUM_GROUP1_MOLES 8 #define NUM_GROUP2_MOLES 11 #define NUM_GROUP3_MOLES 12 +#define NUM_TOTAL_MOLES (NUM_GROUP1_MOLES + NUM_GROUP2_MOLES + NUM_GROUP3_MOLES) #define NUM_SNOWFLAKES 0x32 -extern Vec3s gMoleSpawns[]; +typedef union { + Vec3s asVec3sList[NUM_TOTAL_MOLES]; + s16 asFlatList[NUM_TOTAL_MOLES*3]; +} MoleSpawnUnion; +extern MoleSpawnUnion gMoleSpawns; /** * Exact use unknown, something related to the mole groups diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index d1b1cee1f..e574dc8c7 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -930,10 +930,6 @@ s32 func_80007BF8(u16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) { #ifdef NON_MATCHING // Likely func equiv // https://decomp.me/scratch/Te4u1 -extern u16 D_80163344[]; -extern s16 D_80163478; -extern s16 D_801634C0[]; - void func_80007D04(s32 playerId, Player *player) { s16 temp_t1; s16 temp_t2; diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index 3eda50bb9..45b0b7de8 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -942,12 +942,12 @@ void init_course_object(void) { D_8018D1B8[i] = 0; find_unused_obj_index(&indexObjectList1[i]); } - for (i = 0; i < NUM_MAX_MOLES; i++) { + for (i = 0; i < NUM_TOTAL_MOLES; i++) { find_unused_obj_index(&gObjectParticle1[i]); objectId = gObjectParticle1[i]; init_object(objectId, 0); - gObjectList[objectId].pos[0] = gMoleSpawns[i][0] * xOrientation; - gObjectList[objectId].pos[2] = gMoleSpawns[i][2]; + gObjectList[objectId].pos[0] = gMoleSpawns.asVec3sList[i][0] * xOrientation; + gObjectList[objectId].pos[2] = gMoleSpawns.asVec3sList[i][2]; func_800887C0(objectId); gObjectList[objectId].sizeScaling = 0.7f; } diff --git a/src/code_80091750.c b/src/code_80091750.c index 16849d710..2f7956a33 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -64,7 +64,7 @@ struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; s32 gCycleFlashMenu; s8 D_8018E7AC[4]; s8 D_8018E7B0; -s32 D_8018E7B8[4]; +u32 D_8018E7B8[4]; u32 D_8018E7C8; u32 D_8018E7D0[4]; s32 D_8018E7E0; @@ -1172,13 +1172,12 @@ MkTexture *D_800E8294[] = { MkTexture *D_800E82B4[] = { D_02004A5C, D_02004A98, D_02004AD4, D_02004B10, - D_02004B9C, }; -MkTexture *D_800E82C8[] = { - D_02004BC4, D_02004BEC, D_02004C14, D_02004C3C, - D_02004C64, D_02004C8C, D_02004CF0, D_02004D54, - D_02004DB8, D_02004E1C, D_02004E80, +MkTexture *D_800E82C4[] = { + D_02004B9C, D_02004BC4, D_02004BEC, D_02004C14, + D_02004C3C, D_02004C64, D_02004C8C, D_02004CF0, + D_02004D54, D_02004DB8, D_02004E1C, D_02004E80, }; MkTexture *D_800E82F4[] = { @@ -3494,252 +3493,106 @@ block_39: GLOBAL_ASM("asm/non_matchings/code_80091750/func_800963F0.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Sep-01-2023 -extern ? D_0B002A00; +#ifdef NON_MATCHING +// https://decomp.me/scratch/zyWcm +// I think I have the GIB macros right, but everything else is suspect -Gfx *func_80096CD8(Gfx *displayListHead, s32 arg1, s32 arg2, u32 arg3, u32 arg4) { - s32 spD4; - s32 spD0; /* compiler-managed */ +// I don't know what this actually meant to be. Its plausible that its meant to be a reference to `gTextureTitleChocoMountain` +// That would be weird though because this function doesn't draw that picture at all. So its plausible that its instead +// using it as some form semi-random data for the static pattern? +extern u8 D_0B002A00; + +// This function is responsible for drawing a near unnoticeable static pattern +// over the course images when loading the cup selection screen +// Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make it last longer +Gfx *func_80096CD8(Gfx *displayListHead, s32 arg1, s32 arg2, u32 width, u32 arg4) { s32 spCC; - s32 spC8; - s32 spC4; - s32 sp84; - u32 sp80; - u32 sp7C; - u32 sp78; - s32 sp58; - Gfx *temp_s0; - Gfx *temp_s0_2; - Gfx *temp_s0_3; - Gfx *temp_s0_4; - Gfx *temp_s0_5; - Gfx *temp_s0_6; - Gfx *temp_s0_7; - Gfx *temp_s0_8; - Gfx *temp_s0_9; - Gfx *temp_v0_2; - Gfx *var_s0; - s32 temp_a0; - s32 temp_a1; - s32 temp_a2; - s32 temp_at; - s32 temp_at_2; - s32 temp_lo; - s32 temp_t4; - s32 temp_t8; - s32 temp_t8_2; - s32 temp_v0; - s32 temp_v0_3; - s32 temp_v0_4; - s32 temp_v1; + s32 masks; + s32 maskt; s32 temp_v1_2; - s32 temp_v1_3; - s32 temp_v1_4; s32 var_fp; s32 var_s1_2; s32 var_s1_3; - s32 var_s2; - s32 var_s2_2; - s32 var_s3; - s32 var_s3_2; - s32 var_s4; - s32 var_t3; - s32 var_t4; s32 var_t5; s32 var_v0; - u32 temp_a3; u32 temp_t2; u32 temp_t6; - u32 temp_t7; - u32 var_a1; - u32 var_a1_2; - u32 var_ra; - u32 var_ra_2; - u32 var_s1; + s32 var_a1; + s32 var_ra; + s32 var_s1; u32 var_s4_2; - u32 var_s6; - u32 var_s7; + s32 temp_v0; - var_s0 = displayListHead; - var_s2 = arg2; - var_s4 = arg1; var_ra = 1; - spC8 = 0; - spC4 = 0; - if (arg3 >= 2U) { + masks = 0; + maskt = 0; + if (width >= 2U) { do { - temp_t7 = var_ra * 2; - var_ra = temp_t7; - } while (temp_t7 < arg3); + var_ra *= 2; + } while (var_ra < width); } - temp_lo = 0x400 / (s32) var_ra; - var_a1 = arg4; - spCC = temp_lo; - if (var_a1 < (u32) (temp_lo / 2)) { - var_v0 = temp_lo / 2; + spCC = 0x400 / var_ra; + if (arg4 < (spCC / 2)) { do { - temp_v1 = var_v0; - var_v0 = temp_v1 / 2; - } while (var_a1 < (u32) var_v0); - spCC = temp_v1; + spCC /= 2; + } while (arg4 < spCC); } var_s1 = var_ra; - if ((s32) var_ra >= 2) { - do { - temp_t8 = (s32) var_s1 / 2; - temp_at = temp_t8 < 2; - var_s1 = (u32) temp_t8; - spC8 += 1; - } while (temp_at == 0); + while (var_s1 >= 2) { + var_s1 /= 2; + masks += 1; } var_s1_2 = spCC; - if (var_s1_2 >= 2) { - do { - temp_t8_2 = var_s1_2 / 2; - temp_at_2 = temp_t8_2 < 2; - var_s1_2 = temp_t8_2; - spC4 += 1; - } while (temp_at_2 == 0); + while (var_s1_2 >= 2) { + var_s1_2 /= 2; + maskt += 1; } - if (var_s4 < 0) { - arg3 -= var_s4; - var_s4 = 0; - } else if ((u32) (var_s4 + arg3) >= 0x141U) { - arg3 = 0x140 - var_s4; + if (arg1 < 0) { + width -= arg1; + arg1 = 0; + } else if ((arg1 + width) > 0x140) { + width = 0x140 - arg1; } - if (var_s2 < 0) { - var_a1 -= var_s2; - var_s2 = 0; - } else if ((u32) (var_s2 + var_a1) >= 0xF1U) { - var_a1 = 0xF0 - var_s2; + if (arg2 < 0) { + arg4 -= arg2; + arg2 = 0; + } else if ((arg2 + arg4) > 0xF0) { + arg4 = 0xF0 - arg2; } - if (arg3 == 0) { - - } else if (var_a1 == 0) { - - } else { - spD0 = (s32) var_ra; - var_s3 = var_s2 + var_a1; - temp_t4 = var_s4 + arg3; - sp84 = temp_t4; + if (width == 0) return displayListHead; + else if (arg4 == 0) return displayListHead; + else { temp_v0 = random_int(0x0064U); - temp_v0_2 = draw_box(var_s0, var_s4, var_s2, sp84, var_s3, 0, 0, 0, temp_v0); - var_t4 = temp_t4; - var_ra_2 = var_ra; - temp_v1_2 = (temp_v0 + 0x96) & 0xFF; - temp_v0_2->words.w0 = 0xE7000000; - temp_v0_2->unk8 = 0xB900031D; - temp_v0_2->unkC = 0x00504240; - temp_v0_2->unk10 = 0xFA000000; - temp_v0_2->words.w1 = 0; - temp_v0_2->unk14 = (s32) ((temp_v1_2 << 0x18) | (temp_v1_2 << 0x10) | (temp_v1_2 << 8) | temp_v1_2); - temp_v0_2->unk1C = 0xFF2FFFFF; - temp_v0_2->unk18 = 0xFC119623; - var_s0 = temp_v0_2 + 0x20; - var_fp = var_s2; - if ((u32) var_s2 < (u32) var_s3) { -loop_23: + displayListHead = draw_box(displayListHead, arg1, arg2, arg1 + width, arg2 + arg4, 0, 0, 0, temp_v0); + temp_v0 += 0x96; + gDPPipeSync(displayListHead++); + gDPSetRenderMode(displayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetPrimColor(displayListHead++, 0, 0, temp_v0, temp_v0, temp_v0, temp_v0); + gDPSetCombineMode(displayListHead++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + for (var_fp = arg2; var_fp < (arg2 + arg4); var_fp += spCC) { var_t5 = spCC; - var_s1_3 = var_s4; - temp_t6 = spCC + var_fp; - sp7C = temp_t6; - if ((u32) var_s3 < temp_t6) { - var_t5 = var_s3 - var_fp; - if (var_t5 != 0) { - var_s1_3 = var_s4; - goto block_26; - } - } else { -block_26: - if ((u32) var_s4 < (u32) var_t4) { - sp80 = (u32) var_s3; - arg1 = var_s4; -loop_28: - temp_t2 = var_ra_2 + var_s1_3; - if ((u32) var_t4 < temp_t2) { - var_s4_2 = var_t4 - var_s1_3; - if (var_s4_2 == 0) { - var_s4 = arg1; - var_s3 = (s32) sp80; - } else { - var_a1_2 = ((arg3 - 1) & 0xFFF) | 0xFD700000; - temp_v0_3 = (spC4 & 0xF) << 0xE; - temp_v1_3 = (spC8 & 0xF) * 0x10; - var_s6 = temp_v0_3 | 0x07000000 | temp_v1_3; - var_t3 = (var_fp << 5) & 0xFFFF; - var_s2_2 = (var_fp * 4) & 0xFFF; - var_s3_2 = ((var_fp + var_t5) * 4) & 0xFFF; - var_s7 = temp_v0_3 | temp_v1_3; - goto block_33; - } - } else { - var_a1_2 = ((arg3 - 1) & 0xFFF) | 0xFD700000; - temp_v0_4 = (spC4 & 0xF) << 0xE; - temp_v1_4 = (spC8 & 0xF) * 0x10; - var_s6 = temp_v0_4 | 0x07000000 | temp_v1_4; - var_t3 = (var_fp << 5) & 0xFFFF; - var_s2_2 = (var_fp * 4) & 0xFFF; - var_s3_2 = ((var_fp + var_t5) * 4) & 0xFFF; - var_s7 = temp_v0_4 | temp_v1_4; - var_s4_2 = var_ra_2; -block_33: - var_s0->words.w0 = var_a1_2; - spD0 = var_ra_2; - spD4 = var_t5; - sp84 = var_t4; - sp58 = var_t3; - sp78 = temp_t2; - temp_s0 = var_s0 + 8; - temp_a2 = var_s1_3 + var_s4_2; - var_s0->words.w1 = (u32) ((random_int(0x0080U) * 2) + &D_0B002A00); - temp_s0_2 = temp_s0 + 8; - temp_a3 = ((((u32) (((temp_a2 - var_s1_3) * 2) + 9) >> 3) & 0x1FF) << 9) | 0xF5700000; - temp_s0->words.w0 = temp_a3; - temp_s0->words.w1 = var_s6; - temp_s0_2->words.w0 = 0xE6000000; - temp_a1 = ((var_s1_3 * 4) & 0xFFF) << 0xC; - temp_s0_2->words.w1 = 0; - temp_s0_3 = temp_s0_2 + 8; - temp_a0 = ((temp_a2 * 4) & 0xFFF) << 0xC; - temp_s0_3->words.w0 = temp_a1 | 0xF4000000 | var_s2_2; - temp_s0_4 = temp_s0_3 + 8; - temp_s0_3->words.w1 = temp_a0 | 0x07000000 | var_s3_2; - temp_s0_5 = temp_s0_4 + 8; - temp_s0_4->words.w0 = 0xE7000000; - temp_s0_4->words.w1 = 0; - temp_s0_6 = temp_s0_5 + 8; - temp_s0_5->words.w1 = var_s7; - temp_s0_5->words.w0 = temp_a3; - temp_s0_7 = temp_s0_6 + 8; - temp_s0_6->words.w1 = temp_a0 | var_s3_2; - temp_s0_6->words.w0 = temp_a1 | 0xF2000000 | var_s2_2; - temp_s0_8 = temp_s0_7 + 8; - temp_s0_7->words.w1 = temp_a1 | var_s2_2; - temp_s0_7->words.w0 = temp_a0 | 0xE4000000 | var_s3_2; - temp_s0_8->words.w0 = 0xB3000000; - temp_s0_9 = temp_s0_8 + 8; - temp_s0_8->words.w1 = (var_s1_3 << 0x15) | var_t3; - temp_s0_9->words.w0 = 0xB2000000; - temp_s0_9->words.w1 = 0x04000400; - var_s0 = temp_s0_9 + 8; - var_s1_3 = (s32) temp_t2; - if (temp_t2 >= (u32) var_t4) { - var_s4 = arg1; - var_s3 = (s32) sp80; - } else { - goto loop_28; - } - } - } - var_fp = (s32) sp7C; - if ((u32) var_fp < (u32) var_s3) { - goto loop_23; + temp_t6 = var_fp + spCC; + if ((arg2 + arg4) < temp_t6) { + var_t5 = (arg2 + arg4) - var_fp; + if (var_t5 == 0) return displayListHead; + } + for (var_s1_3 = arg1; var_s1_3 < (arg1 + width); var_s1_3 += var_ra) { + var_s4_2 = var_ra; + temp_t2 = var_s1_3 + var_ra; + if ((arg1 + width) < temp_t2) { + var_s4_2 = (arg1 + width) - var_s1_3; + if (var_s4_2 == 0) return displayListHead; } + gDPLoadTextureTile(displayListHead++, (random_int(0x0080U) * 2) + &D_0B002A00, G_IM_FMT_IA, G_IM_SIZ_16b, width, 0, + var_s1_3, var_fp, var_s1_3 + var_s4_2, var_fp + var_t5, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + + gSPTextureRectangle(displayListHead++, var_s1_3 * 4, var_fp * 4, (var_s1_3 + var_s4_2) * 4, (var_fp + var_t5) * 4, 0, var_s1_3 << 5, var_fp << 5, 1024, 1024); + } } } - return var_s0; + return displayListHead; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_80096CD8.s") @@ -4071,476 +3924,132 @@ Gfx *func_80097A14(Gfx *displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, return displayListHead; } -#ifdef MIPS_TO_C -//generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Dec-21-2023 +#ifdef NON_MATCHING +// https://decomp.me/scratch/EAuX4 +// I'm fairly certain I've got the GBI macros correct, don't know what the source of the diff is +// While there may be register allocation issues, I suspect the instruction ordering issues are the actual problems Gfx *func_80097AE4(Gfx *displayListHead, s8 fmt, s32 arg2, s32 arg3, u8 *arg4, s32 arg5) { - s32 sp34; - Gfx *temp_a0; - Gfx *temp_a0_10; - Gfx *temp_a0_11; - Gfx *temp_a0_12; - Gfx *temp_a0_13; - Gfx *temp_a0_14; - Gfx *temp_a0_15; - Gfx *temp_a0_16; - Gfx *temp_a0_17; - Gfx *temp_a0_18; - Gfx *temp_a0_19; - Gfx *temp_a0_2; - Gfx *temp_a0_3; - Gfx *temp_a0_4; - Gfx *temp_a0_5; - Gfx *temp_a0_6; - Gfx *temp_a0_7; - Gfx *temp_a0_8; - Gfx *temp_a0_9; - Gfx *var_a0; - s32 temp_s1; - s32 temp_t1; - s32 temp_t6; - s32 temp_t7_2; - s32 temp_t8; - s32 temp_t8_3; - s32 temp_t9; - s32 temp_v1; s32 var_a2; - s32 var_s0; - s32 var_s2; - u32 temp_s4; - u32 temp_t7; - u32 temp_t8_2; + s32 stackPadding0; + s32 arg2Copy; + s32 dsdx; - var_a0 = displayListHead; - var_s0 = arg2; - var_s2 = arg3; - if (arg5 >= 0x20) { + if (arg5 >= 0x20) return displayListHead; - } else { - temp_t8 = (fmt & 7) << 0x15; - temp_s4 = temp_t8 | 0xFD000000 | 0x100000 | 0x3F; - temp_t8_2 = temp_t8 | 0xF5000000 | 0x100000 | 0x1200; - sp34 = var_s0; - var_a2 = 0; - temp_t7 = (((0x8000 / (s32) (0x20 - arg5)) & 0xFFFF) << 0x10) | 0x400; - do { - temp_a0 = var_a0 + 8; - var_a0->words.w0 = temp_s4; - var_a0->words.w1 = (u32) arg4; - temp_a0_2 = temp_a0 + 8; - temp_t6 = (var_a2 * 4) & 0xFFF; - temp_a0_3 = temp_a0_2 + 8; - temp_a0->words.w1 = 0x07014050; - temp_a0->words.w0 = temp_t8_2; - temp_s1 = var_a2 + 0x20; - temp_t9 = (temp_s1 * 4) & 0xFFF; - temp_a0_2->words.w1 = 0; - temp_a0_2->words.w0 = 0xE6000000; - temp_a0_4 = temp_a0_3 + 8; - temp_a0_3->words.w1 = temp_t9 | 0x07080000; - temp_a0_3->words.w0 = temp_t6 | 0xF4000000; - temp_a0_5 = temp_a0_4 + 8; - temp_a0_4->words.w1 = 0; - temp_a0_4->words.w0 = 0xE7000000; - temp_a0_5->words.w1 = 0x00014050; - temp_a0_5->words.w0 = temp_t8_2; - temp_a0_6 = temp_a0_5 + 8; - temp_v1 = var_s0 + 0x20; - temp_t1 = var_s2 + 0x20; - temp_a0_6->words.w0 = temp_t6 | 0xF2000000; - temp_a0_6->words.w1 = temp_t9 | 0x80000; - temp_t7_2 = (temp_t1 * 4) & 0xFFF; - temp_a0_7 = temp_a0_6 + 8; - temp_t8_3 = (var_s2 * 4) & 0xFFF; - temp_a0_7->words.w0 = (((temp_v1 * 4) & 0xFFF) << 0xC) | 0xE4000000 | temp_t7_2; - temp_a0_8 = temp_a0_7 + 8; - temp_a0_7->words.w1 = ((((var_s0 + arg5) * 4) & 0xFFF) << 0xC) | temp_t8_3; - temp_a0_9 = temp_a0_8 + 8; - temp_a0_8->words.w0 = 0xB3000000; - temp_a0_10 = temp_a0_9 + 8; - temp_a0_8->words.w1 = 0; - temp_a0_9->words.w0 = 0xB2000000; - temp_a0_9->words.w1 = temp_t7; - temp_a0_11 = temp_a0_10 + 8; - temp_a0_10->words.w1 = (u32) arg4; - temp_a0_10->words.w0 = temp_s4; - temp_a0_12 = temp_a0_11 + 8; - temp_a0_11->words.w1 = 0x07014050; - temp_a0_11->words.w0 = temp_t8_2; - temp_a0_13 = temp_a0_12 + 8; - temp_a0_12->words.w1 = 0; - temp_a0_12->words.w0 = 0xE6000000; - temp_a0_14 = temp_a0_13 + 8; - temp_a0_13->words.w1 = temp_t9 | 0x07100000; - temp_a0_13->words.w0 = temp_t6 | 0xF4080000; - temp_a0_15 = temp_a0_14 + 8; - temp_a0_14->words.w1 = 0; - temp_a0_14->words.w0 = 0xE7000000; - temp_a0_15->words.w1 = 0x00014050; - temp_a0_16 = temp_a0_15 + 8; - temp_a0_15->words.w0 = temp_t8_2; - temp_a0_16->words.w0 = temp_t6 | 0xF2080000; - temp_a0_16->words.w1 = temp_t9 | 0x100000; - temp_a0_17 = temp_a0_16 + 8; - temp_a0_17->words.w0 = (((((temp_v1 - arg5) + 0x20) * 4) & 0xFFF) << 0xC) | 0xE4000000 | temp_t7_2; - temp_a0_18 = temp_a0_17 + 8; - temp_a0_17->words.w1 = (((temp_v1 * 4) & 0xFFF) << 0xC) | temp_t8_3; - temp_a0_19 = temp_a0_18 + 8; - temp_a0_18->words.w0 = 0xB3000000; - temp_a0_18->words.w1 = 0; - temp_a0_19->words.w0 = 0xB2000000; - temp_a0_19->words.w1 = temp_t7; - /* - gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 0, 0, var_a2, 32, (var_a2 + 1) * 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, arg2 + arg5, arg3 + 32*var_a2, arg2 + 32, arg3 + 32, G_TX_RENDERTILE, 0, 0, 0x8000 / (32 - arg5), 4); - - gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 0, 32, 0, 64, 0, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(displayListHead++, arg2 + 32, arg3 + 32*var_a2, (arg2 + 32 - arg5) + 32, arg3 + 32, G_TX_RENDERTILE, 0, 0, 0x8000 / (32 - arg5), 4); - */ - var_a2 = temp_s1; - var_a0 = temp_a0_19 + 8; - var_s0 = sp34; - var_s2 = temp_t1; - } while (temp_s1 != 0x40); + arg2Copy = arg2; + dsdx = 0x8000 / (0x20 - arg5); + for (var_a2 = 0; var_a2 < 0x40; var_a2 += 0x20) { + gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 0, 0, var_a2, 32, var_a2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, (arg2 + arg5) << 2, arg3 << 2, (arg2 + 0x20) << 2, (arg3 + 0x20) << 2, 0, 0, 0, dsdx, 1024); + arg2 += 0x20; + gDPLoadTextureTile(displayListHead++, arg4, fmt, G_IM_SIZ_16b, 64, 0, 32, var_a2, 64, var_a2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, arg2 << 2, arg3 << 2, ((arg2 - arg5) + 0x20) << 2, (arg3 + 0x20) << 2, 0, 0, 0, dsdx, 1024); + arg2 = arg2Copy; + arg3 += 0x20; } - return var_a0; + return displayListHead; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_80097AE4.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Sep-01-2023 -Gfx *func_80097E58(Gfx *displayListHead, s8 arg1, s32 arg2, u32 arg3, u32 arg5, s32 arg6, s32 arg7, s32 arg8, u32 arg9, s32 argB, s32 argB, s32 argB) { - s32 spEC; +#ifdef NON_MATCHING +// https://decomp.me/scratch/U4QaQ +// I'm fairly certain I have the GBI macros correct, so the massive diff is probably +// the result of somemath ordering issues. +Gfx *func_80097E58(Gfx *displayListHead, s8 fmt, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, u8 *someTexture, u32 width, s32 argA, u32 argB) { + u32 ult; s32 spDC; s32 sp80; - s32 sp60; - u32 sp5C; - s32 sp40; - u32 sp3C; - s32 sp30; - Gfx *temp_a0; - Gfx *temp_a0_10; - Gfx *temp_a0_11; - Gfx *temp_a0_12; - Gfx *temp_a0_13; - Gfx *temp_a0_14; - Gfx *temp_a0_15; - Gfx *temp_a0_16; - Gfx *temp_a0_17; - Gfx *temp_a0_18; - Gfx *temp_a0_19; - Gfx *temp_a0_2; - Gfx *temp_a0_3; - Gfx *temp_a0_4; - Gfx *temp_a0_5; - Gfx *temp_a0_6; - Gfx *temp_a0_7; - Gfx *temp_a0_8; - Gfx *temp_a0_9; - Gfx *var_a0; - s32 temp_a3; - s32 temp_s0; - s32 temp_t1; - s32 temp_t2; - s32 temp_t6; - s32 temp_t6_2; - s32 temp_t6_3; - s32 temp_t7; - s32 temp_t7_2; - s32 temp_t7_3; - s32 temp_t7_4; - s32 temp_t8; - s32 temp_t9; - s32 temp_t9_2; - s32 temp_v0; s32 temp_v1; - s32 temp_v1_2; - s32 var_s0; s32 var_s1; s32 var_s2; - s32 var_s4; s32 var_s5; - s32 var_s6; - s32 var_s7; - s32 var_t3; - s32 var_v0; - u32 temp_a1; - u32 temp_t0; - u32 var_fp; - u32 var_ra; - u32 var_s3; - u32 var_t2; - u32 var_t4; + u32 lrs; + s32 arg6Copy; - var_a0 = displayListHead; - if (argB >= 0x20) { + if ((s32)width >= 0x20) return displayListHead; - } else { - var_s4 = arg7; - temp_t0 = (u32) argB >> 1; - temp_t7 = argB - temp_t0; - sp80 = temp_t7; - spDC = temp_t7; - var_t4 = arg3; - spEC = var_s4; - if (arg3 < (u32) arg6) { -loop_3: - if ((u32) arg6 < (u32) (var_t4 + 0x20)) { - temp_v0 = arg6 - var_t4; - var_s2 = temp_v0; - if (temp_v0 != 0) { - temp_t9 = (arg1 & 7) << 0x15; - temp_v1 = 0x20 - argB; - sp30 = argB; - var_s3 = temp_t9 | 0xFD000000 | 0x100000 | ((argB - 1) & 0xFFF); - temp_t6 = temp_t9 | 0xF5000000 | 0x100000; - var_s5 = (s32) (spDC * temp_v1) / 32; - sp60 = temp_t0 << 0x15; - temp_t6_2 = ((temp_t0 * 4) & 0xFFF) << 0xC; - sp5C = (((s32) ((sp80 << 5) << 0xA) / (s32) (sp80 * temp_v1)) << 0x10) | 0x400; - var_s6 = temp_t6_2 | 0xF2000000; - temp_t7_2 = ((argB * 4) & 0xFFF) << 0xC; - var_v0 = temp_t6_2; - var_s7 = temp_t7_2 | 0x07000000; - var_t3 = temp_t7_2; - var_fp = temp_t6 | ((((u32) (((argB - temp_t0) * 2) + 9) >> 3) & 0x1FF) << 9); - var_ra = temp_t6 | ((((u32) (((argB - temp_t0) * 2) + 9) >> 3) & 0x1FF) << 9); - sp40 = var_v0 | 0xF4000000; - sp3C = (((s32) ((temp_t0 << 5) << 0xA) / (s32) (temp_t0 * temp_v1)) << 0x10) | 0x400; - var_s1 = (s32) (temp_t0 * argB) / 32; - var_s0 = var_v0 | 0x07000000; - var_t2 = temp_t6 | ((((u32) ((temp_t0 * 2) + 9) >> 3) & 0x1FF) << 9); - goto block_7; - } - } else { - temp_v1_2 = 0x20 - argB; - temp_t8 = (arg1 & 7) << 0x15; - sp30 = argB; - var_s3 = temp_t8 | 0xFD000000 | 0x100000 | ((argB - 1) & 0xFFF); - temp_t7_3 = temp_t8 | 0xF5000000 | 0x100000; - var_s2 = 0x20; - var_s5 = (s32) (spDC * temp_v1_2) / 32; - sp60 = temp_t0 << 0x15; - temp_t7_4 = ((temp_t0 * 4) & 0xFFF) << 0xC; - sp5C = (((s32) ((sp80 << 5) << 0xA) / (s32) (sp80 * temp_v1_2)) << 0x10) | 0x400; - var_s6 = temp_t7_4 | 0xF2000000; - temp_t6_3 = ((argB * 4) & 0xFFF) << 0xC; - var_v0 = temp_t7_4; - var_s7 = temp_t6_3 | 0x07000000; - var_t3 = temp_t6_3; - var_fp = temp_t7_3 | ((((u32) (((argB - temp_t0) * 2) + 9) >> 3) & 0x1FF) << 9); - var_ra = temp_t7_3 | ((((u32) (((argB - temp_t0) * 2) + 9) >> 3) & 0x1FF) << 9); - sp40 = var_v0 | 0xF4000000; - sp3C = (((s32) ((temp_t0 << 5) << 0xA) / (s32) (temp_t0 * temp_v1_2)) << 0x10) | 0x400; - var_s1 = (s32) (temp_t0 * argB) / 32; - var_s0 = var_v0 | 0x07000000; - var_t2 = temp_t7_3 | ((((u32) ((temp_t0 * 2) + 9) >> 3) & 0x1FF) << 9); -block_7: - var_a0->words.w0 = var_s3; - temp_a0 = var_a0 + 8; - var_a0->words.w1 = arg9; - temp_a0->words.w1 = 0x07014050; - temp_a0_2 = temp_a0 + 8; - temp_a0->words.w0 = var_t2; - temp_t9_2 = (var_t4 * 4) & 0xFFF; - temp_a0_3 = temp_a0_2 + 8; - temp_a0_2->words.w0 = 0xE6000000; - temp_a3 = ((var_t4 + var_s2) * 4) & 0xFFF; - temp_a0_2->words.w1 = 0; - temp_a0_3->words.w0 = temp_t9_2 | 0xF4000000; - temp_a0_4 = temp_a0_3 + 8; - temp_a0_3->words.w1 = var_s0 | temp_a3; - temp_a0_5 = temp_a0_4 + 8; - temp_a0_4->words.w0 = 0xE7000000; - temp_a0_4->words.w1 = 0; - temp_a0_6 = temp_a0_5 + 8; - temp_a0_5->words.w1 = 0x00014050; - temp_a0_5->words.w0 = var_t2; - temp_a0_6->words.w1 = var_v0 | temp_a3; - temp_a0_6->words.w0 = temp_t9_2 | 0xF2000000; - temp_s0 = var_s4 + temp_t0; - temp_t1 = ((arg8 + var_s2) * 4) & 0xFFF; - temp_a0_7 = temp_a0_6 + 8; - temp_a0_7->words.w0 = (((temp_s0 * 4) & 0xFFF) << 0xC) | 0xE4000000 | temp_t1; - temp_t2 = (arg8 * 4) & 0xFFF; - temp_a0_7->words.w1 = ((((var_s1 + var_s4) * 4) & 0xFFF) << 0xC) | temp_t2; - temp_a0_8 = temp_a0_7 + 8; - temp_a1 = (var_t4 << 5) & 0xFFFF; - temp_a0_9 = temp_a0_8 + 8; - temp_a0_8->words.w0 = 0xB3000000; - temp_a0_8->words.w1 = temp_a1; - temp_a0_9->words.w0 = 0xB2000000; - temp_a0_10 = temp_a0_9 + 8; - temp_a0_9->words.w1 = sp3C; - temp_a0_10->words.w0 = var_s3; - temp_a0_11 = temp_a0_10 + 8; - temp_a0_10->words.w1 = arg9; - temp_a0_12 = temp_a0_11 + 8; - temp_a0_11->words.w1 = 0x07014050; - temp_a0_11->words.w0 = var_ra; - temp_a0_12->words.w0 = 0xE6000000; - temp_a0_12->words.w1 = 0; - temp_a0_13 = temp_a0_12 + 8; - temp_a0_14 = temp_a0_13 + 8; - temp_a0_13->words.w0 = sp40 | temp_t9_2; - temp_a0_13->words.w1 = var_s7 | temp_a3; - temp_a0_15 = temp_a0_14 + 8; - temp_a0_14->words.w0 = 0xE7000000; - temp_a0_14->words.w1 = 0; - temp_a0_15->words.w1 = 0x00014050; - temp_a0_16 = temp_a0_15 + 8; - temp_a0_15->words.w0 = var_fp; - temp_a0_16->words.w0 = var_s6 | temp_t9_2; - temp_a0_16->words.w1 = var_t3 | temp_a3; - temp_a0_17 = temp_a0_16 + 8; - temp_a0_17->words.w0 = ((((var_s5 + temp_s0) * 4) & 0xFFF) << 0xC) | 0xE4000000 | temp_t1; - temp_a0_17->words.w1 = (((temp_s0 * 4) & 0xFFF) << 0xC) | temp_t2; - temp_a0_18 = temp_a0_17 + 8; - temp_a0_18->words.w0 = 0xB3000000; - temp_a0_19 = temp_a0_18 + 8; - temp_a0_18->words.w1 = sp60 | temp_a1; - temp_a0_19->words.w0 = 0xB2000000; - var_t4 += 0x20; - var_a0 = temp_a0_19 + 8; - temp_a0_19->words.w1 = sp5C; - var_s4 = spEC; - arg8 += 0x20; - if (var_t4 < (u32) arg6) { - goto loop_3; - } - } + lrs = width >> 1; + spDC = sp80 = width - lrs; + arg6Copy = arg6; + for (ult = arg3; ult < arg5; ult += 0x20) { + if (arg5 < (ult + 0x20)) { // Less than 0x20 left to reach target + var_s2 = arg5 - ult; // Leftover amount to reach target + if (var_s2 == 0) break; // Actually at target + } else { + var_s2 = 0x20; // Go the full 0x20 on this step } + temp_v1 = 0x20 - argB; + var_s1 = (lrs * argB) / 32; + var_s5 = (spDC * temp_v1) / 32; + + gDPLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, width, 0, 0, ult, lrs, ult + var_s2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, (arg6 + var_s1) << 2, arg7 << 2, (arg6 + lrs) << 2, (arg7 + var_s2) << 2, 0, 0, ult << 5, (s32)((lrs << 5) << 0xA) / (s32)(lrs * temp_v1), 1024); + + arg6 += lrs; + gDPLoadTextureTile(displayListHead++, someTexture, fmt, G_IM_SIZ_16b, width, 0, lrs, ult, width, ult + var_s2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, arg6 << 2, arg7 << 2, (arg6 + var_s5) << 2, (arg7 + var_s2) << 2, 0, lrs << 5, ult << 5, ((sp80 << 5) << 0xA) / (sp80 * temp_v1), 1024); + arg6 = arg6Copy; + arg7 += 0x20; } - return var_a0; + return displayListHead; } #else GLOBAL_ASM("asm/non_matchings/code_80091750/func_80097E58.s") #endif -#ifdef MIPS_TO_C -//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Sep-01-2023 -extern u32 D_8018E7B8; -extern s32 D_8018E7D0; +Gfx *func_80098558(Gfx *displayListHead, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 arg6, s32 arg7, s32 arg8) { + u32 var_a3; + u32 var_v0; + s32 arg5Copy; -Gfx *func_800987D0(Gfx *displayListHead, u32 arg1, u32 arg2, u32 arg3, u32 arg4, s32 arg5, s32 arg6, s32 arg8, s32 arg8) { - u32 sp60; - s32 sp5C; - Gfx *temp_s0; - Gfx *temp_s0_2; - Gfx *temp_s0_3; - Gfx *temp_s0_4; - Gfx *temp_s0_5; - Gfx *temp_s0_6; - Gfx *temp_s0_7; - Gfx *temp_s0_8; - Gfx *temp_s0_9; - Gfx *var_s0; + arg5Copy = arg5; + for (var_v0 = arg2; var_v0 < arg4; var_v0 += 0x20) { + for (var_a3 = arg1; var_a3 < arg3; var_a3 += 0x20) { + gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0, var_a3 + 0x20, var_v0 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(displayListHead++, arg5 << 2, arg6 << 2, (arg5 + 0x20) << 2, (arg6 + 0x20) << 2, 0, 0, 0, 1024, 1024); + arg5 += 0x20; + } + arg5 = arg5Copy; + arg6 += 0x20; + } + return displayListHead; +} + +Gfx *func_800987D0(Gfx *displayListHead, u32 arg1, u32 arg2, u32 width, u32 height, s32 column, s32 row, s32 arg7, u32 textureWidth, s32 textureHeight) { + s32 var_a2; + s32 var_v0_2; + s32 columnCopy; + s32 temp_f4_2; + s32 stackPadding0; + s32 temp_f6; f32 temp_f0; f32 temp_f18; f32 temp_f24; - f32 temp_f2; - f32 temp_f4; - f32 temp_f8; - f32 var_f6; - f64 var_f10; - s32 temp_f4_2; - s32 temp_f6; - s32 temp_t1; - s32 temp_t4; - s32 temp_t8; - s32 temp_v0; - s32 temp_v0_2; - s32 var_t5; - u32 temp_a3; - u32 temp_t2; - u32 var_a2; - u32 var_v0; - u32 var_v0_2; - var_v0 = D_8018E7B8; - var_s0 = displayListHead; - if (var_v0 == 0) { - D_8018E7B8 = 1; - var_v0 = 1; + if (D_8018E7B8[0] == 0) { + D_8018E7B8[0] = 1; } - temp_f24 = sins(((u32) ((u32) (D_8018E7D0 * 0x4E20U) / var_v0) % 20000U) & 0xFFFF); - temp_f0 = coss(((u32) ((u32) (D_8018E7D0 * 0x4E20U) / (u32) D_8018E7B8) % 20000U) & 0xFFFF); - var_t5 = arg5; - var_f6 = (f32) D_8018E7D0; - if (D_8018E7D0 < 0) { - var_f6 += 4294967296.0f; + temp_f24 = sins(((D_8018E7D0[0] * 0x4E20) / D_8018E7B8[0]) % 20000U); + temp_f0 = coss(((D_8018E7D0[0] * 0x4E20) / D_8018E7B8[0]) % 20000U); + temp_f18 = (((f32)D_8018E7D0[0] * 0.5) / D_8018E7B8[0]) + 1.0; + columnCopy = column; + for (var_v0_2 = arg2; var_v0_2 < height; var_v0_2 += 0x20) { + for (var_a2 = arg1; var_a2 < width; var_a2 += 0x20) { + gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, + var_a2, var_v0_2, var_a2 + 0x20, var_v0_2 + 0x20, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + temp_f6 = (temp_f18 * ((temp_f0 * (column - 0xA0)) + (temp_f24 * (row - 0x78)))) + 160.0f; + temp_f4_2 = (temp_f18 * ((-temp_f24 * (column - 0xA0)) + (temp_f0 * (row - 0x78)))) + 120.0f; + gSPTextureRectangle(displayListHead++, temp_f6 * 4, temp_f4_2 * 4, (temp_f6 + 0x20^0) * 4, (temp_f4_2 + 0x20^0) * 4, 0, 0, 0, 1024, 1024); + column += 0x20; + } + column = columnCopy; + row += 0x20; } - var_f10 = (f64) D_8018E7B8; - if ((s32) D_8018E7B8 < 0) { - var_f10 += 4294967296.0; - } - var_v0_2 = arg2; - sp5C = var_t5; - temp_f18 = (f32) ((((f64) var_f6 * 0.5) / var_f10) + 1.0); - if (arg2 < arg4) { - do { - var_a2 = arg1; - if (arg1 < arg3) { - sp60 = var_v0_2; - temp_v0 = arg6 - 0x78; - temp_t8 = (var_v0_2 * 4) & 0xFFF; - temp_t4 = ((var_v0_2 + 0x20) * 4) & 0xFFF; - do { - var_s0->words.w0 = ((arg8 - 1) & 0xFFF) | 0xFD100000; - temp_s0 = var_s0 + 8; - var_s0->words.w1 = (u32) D_8018D9B0; - temp_s0_2 = temp_s0 + 8; - temp_a3 = ((((s32) ((arg1 * 0 * 2) + 0x49) >> 3) & 0x1FF) << 9) | 0xF5100000; - temp_t1 = ((var_a2 * 4) & 0xFFF) << 0xC; - temp_t2 = var_a2 + 0x20; - temp_s0_3 = temp_s0_2 + 8; - temp_s0->words.w0 = temp_a3; - temp_s0->words.w1 = 0x07014050; - temp_v0_2 = ((temp_t2 * 4) & 0xFFF) << 0xC; - temp_s0_2->words.w1 = 0; - temp_s0_2->words.w0 = 0xE6000000; - temp_s0_3->words.w0 = temp_t1 | 0xF4000000 | temp_t8; - temp_s0_4 = temp_s0_3 + 8; - temp_s0_3->words.w1 = temp_v0_2 | 0x07000000 | temp_t4; - temp_s0_5 = temp_s0_4 + 8; - temp_s0_4->words.w1 = 0; - temp_s0_4->words.w0 = 0xE7000000; - temp_s0_5->words.w1 = 0x00014050; - temp_s0_5->words.w0 = temp_a3; - temp_s0_6 = temp_s0_5 + 8; - temp_f2 = (f32) (var_t5 - 0xA0); - temp_s0_6->words.w1 = temp_v0_2 | temp_t4; - temp_s0_6->words.w0 = temp_t1 | 0xF2000000 | temp_t8; - temp_s0_7 = temp_s0_6 + 8; - temp_s0_8 = temp_s0_7 + 8; - temp_s0_9 = temp_s0_8 + 8; - temp_f8 = ((temp_f2 * temp_f0) + (temp_f24 * (f32) temp_v0)) * temp_f18; - var_a2 = temp_t2; - var_s0 = temp_s0_9 + 8; - temp_f4 = -temp_f24 * temp_f2; - var_t5 += 0x20; - temp_f6 = (s32) (temp_f8 + 160.0f); - temp_f4_2 = (s32) (((temp_f4 + (temp_f0 * (f32) temp_v0)) * temp_f18) + 120.0f); - temp_s0_7->words.w0 = ((((temp_f6 + 0x20) * 4) & 0xFFF) << 0xC) | 0xE4000000 | (((temp_f4_2 + 0x20) * 4) & 0xFFF); - temp_s0_7->words.w1 = (((temp_f6 * 4) & 0xFFF) << 0xC) | ((temp_f4_2 * 4) & 0xFFF); - temp_s0_8->words.w0 = 0xB3000000; - temp_s0_8->words.w1 = 0; - temp_s0_9->words.w0 = 0xB2000000; - temp_s0_9->words.w1 = 0x04000400; - } while (temp_t2 < arg3); - var_v0_2 = sp60; - } - var_v0_2 += 0x20; - var_t5 = sp5C; - arg6 += 0x20; - } while (var_v0_2 < arg4); - } - return var_s0; + return displayListHead; } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800987D0.s") -#endif // draw a box filled with a solid color Gfx *draw_box_fill(Gfx *displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, s32 red, s32 green, s32 blue, s32 alpha) { @@ -6802,7 +6311,7 @@ void add_8018D9E0_entry(s32 type, s32 column, s32 row, s8 priority) { case 0x5A: case 0x5B: case 0x5C: - func_800996BC(segmented_to_virtual_dupe(D_800E82C8[type - 0x53]), 0); + func_800996BC(segmented_to_virtual_dupe(D_800E82C4[type - 0x52]), 0); break; case 0x5F: case 0x60: @@ -7029,34 +6538,30 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/add_8018D9E0_entry.s") #endif #ifdef NON_MATCHING -// Lots of work left to be done. -// There's a pretty huge diff in the `case 0x4` block concerning all the math -// being done. Not sure what's up there yet. -// spAC and spA8 are used in `case 0x8C` without being intitialized. I don't know if that's -// a result of wonky decompilation or if that's real. +// https://decomp.me/scratch/MatRp +// Biggest diff left is in the case 0x12 though 0x19 handling. Not really sure what's going on there +// There's also a diff in the handling of D_800E77A0 in case 0x4. Not sure what's going on there either void func_8009F5E0(struct_8018D9E0_entry *arg0) { - s32 spAC; - s32 spA8; + s32 var_a1; + s32 var_v1; s32 stackPadding0; - MkTexture *sp9C; s32 stackPadding1; + MkTexture *sp9C; s32 stackPadding2; - s32 stackPadding3; - s32 stackPadding4; - char sp80[3]; - f32 var_f0; s32 temp_a0; - s32 stackPadding5; s32 temp_t2; - s32 temp_t4; s32 temp_t5; s32 temp_t9; - s32 temp_v0_4; - s32 temp_v1_3; - s32 var_a1; + s32 temp_v1; + char sp80[3]; s32 var_t0; - s32 var_v1; s32 var_a2; + f32 why = 0.75f; + s32 one = 1; + f32 floatone = 1; + s32 stackPadding3; + s32 stackPadding4; + f32 var_f0; if ((s8) arg0->visible != 0) { gDPPipeSync(gDisplayListHead++); @@ -7114,39 +6619,39 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { } break; case 0x5: /* switch 6 */ - temp_t4 = (s32) ((f32) (get_string_width(D_800E7574[0]) + 5) * 0.9f) / 2; - gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - temp_t4, 0x0000007B, temp_t4 + 0xA0, 0x000000A4, 0, 0, 0, 0x00000096); + var_t0 = (s32) ((f32) (get_string_width(D_800E7574[0]) + 5) * 0.9f) / 2; + gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - var_t0, 0x0000007B, var_t0 + 0xA0, 0x000000A4, 0, 0, 0, 0x00000096); set_text_color(1); draw_text(0x0000009B, 0x0000008C, D_800E7574[0], 0, 0.9f, 0.9f); - temp_v1_3 = func_800B4EB4(0, 7) & 0xFFFFF; - if (temp_v1_3 < 0x1EAA) { + temp_v1 = func_800B4EB4(0, 7) & 0xFFFFF; + if (temp_v1 < 0x1EAA) { set_text_color((s32) gGlobalTimer % 2); - } else if (temp_v1_3 < 0x2329) { + } else if (temp_v1 < 0x2329) { set_text_color((s32) gGlobalTimer % 3); } else { set_text_color(3); } - get_time_record_minutes(temp_v1_3, sp80); + get_time_record_minutes(temp_v1, sp80); func_800939C8(0x00000077, 0x000000A0, sp80, 0, 1.0f, 1.0f); func_80093324(0x0000008B, 0x000000A0, "'", 0, 1.0f, 1.0f); - get_time_record_seconds(temp_v1_3, sp80); + get_time_record_seconds(temp_v1, sp80); func_800939C8(0x00000094, 0x000000A0, sp80, 0, 1.0f, 1.0f); func_80093324(0x000000A7, 0x000000A0, "\"", 0, 1.0f, 1.0f); - get_time_record_centiseconds(temp_v1_3, sp80); + get_time_record_centiseconds(temp_v1, sp80); func_800939C8(0x000000B4, 0x000000A0, sp80, 0, 1.0f, 1.0f); break; case 0x4: /* switch 6 */ var_t0 = get_string_width(D_800E77A0[0]); - temp_v0_4 = get_string_width(D_800E77A0[1]); - if (var_t0 < temp_v0_4) { - var_t0 = temp_v0_4; + temp_v1 = get_string_width(D_800E77A0[1]); + if (var_t0 < temp_v1) { + var_t0 = temp_v1; } - temp_t2 = (s32) (var_t0 * 0.75f) / 2; - temp_t5 = (s32) (((0.75f * 2.0f) + 0.5) * 16.0) / 2; + temp_t2 = (s32) (var_t0 * why) / 2; + temp_t5 = (s32) (((why * 2) + 0.5) * 16.0) / 2; gDisplayListHead = draw_box(gDisplayListHead, 0xA0 - temp_t2, 0xB6 - temp_t5, temp_t2 + 0xA0, temp_t5 + 0xB6, 0, 0, 0, 0x00000096); set_text_color(4); - for (var_v1 = 0; var_v1 < 2; var_v1++) { - draw_text(0xA0 - (1.0f * 0.75f), (s32) (0xB4 + ((f32) (var_v1 * 0x12) * 0.75f)), D_800E77A0[var_v1], 0, 0.75f, 0.75f); + for (temp_t9 = 0; temp_t9 < 2; temp_t9++) { + draw_text(0xA0*one - floatone*why, (s32) (0xB4*one + ((f32) (temp_t9 * 0x12) * why)), D_800E77A0[temp_t9], 0, why, why); } break; case 0x23: /* switch 6 */ @@ -7161,9 +6666,9 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0xC: /* switch 6 */ case 0xD: /* switch 6 */ case 0xE: /* switch 6 */ - temp_a0 = arg0->type - 0xB; - func_800A8270(temp_a0, arg0); - func_800A0FA4(arg0, temp_a0); + var_a1 = arg0->type - 0xB; + func_800A8270(var_a1, arg0); + func_800A0FA4(arg0, var_a1); break; case 0xF: /* switch 6 */ func_800A8564(arg0); @@ -7171,17 +6676,17 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { break; case 0x10: /* switch 6 */ case 0x11: /* switch 6 */ - temp_a0 = arg0->type - 0xF; + var_a1 = arg0->type - 0xF; if (arg0->unk1C < 0x20) { - temp_t9 = (s32) (arg0->unk1C * 0x3A) / 64; - if (temp_a0 == gMainMenuSelectionDepth) { + temp_t9 = (arg0->unk1C * 0x3A) / 64; + if (var_a1 == gMainMenuSelectionDepth) { gDisplayListHead = draw_flash_select_case_fast(gDisplayListHead, arg0->column + temp_t9, arg0->row, (arg0->column - temp_t9) + 0x39, arg0->row + 0x12); } else { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column + temp_t9, arg0->row, (arg0->column - temp_t9) + 0x39, arg0->row + 0x12, 1, 1, 1, 0x000000FF); } } - temp_a0 = arg0->type - 0xA; - gDisplayListHead = func_8009BC9C(gDisplayListHead, D_800E8254[temp_a0], arg0->column, arg0->row, 2, arg0->unk1C); + var_v1 = arg0->type - 0xA; + gDisplayListHead = func_8009BC9C(gDisplayListHead, D_800E8254[var_v1], arg0->column, arg0->row, 2, arg0->unk1C); break; case 0x12: /* switch 6 */ case 0x13: /* switch 6 */ @@ -7191,44 +6696,44 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0x17: /* switch 6 */ case 0x18: /* switch 6 */ case 0x19: /* switch 6 */ - var_a2 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; + var_v1 = D_800E86B0[gPlayerCount - 1][D_800E86AC[gPlayerCount - 1]]; var_a1 = gGameModeFromNumPlayersAndRowSelection[gPlayerCount][D_800E86AC[gPlayerCount - 1]]; switch (arg0->type) { /* switch 5 */ - case 18: /* switch 5 */ - case 19: /* switch 5 */ - case 20: /* switch 5 */ - case 21: /* switch 5 */ + case 0x12: /* switch 5 */ + case 0x13: /* switch 5 */ + case 0x14: /* switch 5 */ + case 0x15: /* switch 5 */ if ((var_a1 != 0) && (var_a1 != 2)) { - var_a2 = -1; + var_v1 = -1; } var_a1 = 18; sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); break; - case 22: /* switch 5 */ - case 23: /* switch 5 */ + case 0x16: /* switch 5 */ + case 0x17: /* switch 5 */ if (var_a1 != 2) { - var_a2 = -1; + var_v1 = -1; } else { var_a1 = 22; sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); } break; - case 24: /* switch 5 */ - case 25: /* switch 5 */ + case 0x18: /* switch 5 */ + case 0x19: /* switch 5 */ if (var_a1 != 1) { - var_a2 = -1; + var_v1 = -1; } else { var_a1 = 24; sp9C = segmented_to_virtual_dupe(D_800E824C[arg0->type]); } break; } - if (var_a2 != -1) { - if ((gMainMenuSelectionDepth >= 5) && (var_a2 == (arg0->type - var_a1))) { + if (var_v1 != -1) { + if ((gMainMenuSelectionDepth >= 5) && (var_v1 == (arg0->type - var_a1))) { if (gMainMenuSelectionDepth >= 6) { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); } else { - gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11); + gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, arg0->column^0, arg0->row^0, arg0->column + 0x3F, arg0->row + 0x11); } } else { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 1, 1, 1, 0x000000FF); @@ -7286,11 +6791,11 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0x5B: /* switch 6 */ case 0x5C: /* switch 6 */ func_800A8A98(arg0); - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C8[arg0->type - 0x53]), arg0->column, arg0->row); + gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg0->type - 0x52]), arg0->column, arg0->row); func_800A8CA4(arg0); break; case 0x52: /* switch 6 */ - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C8[arg0->type - 0x53]), arg0->column, arg0->row); + gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg0->type - 0x52]), arg0->column, arg0->row); break; case 0x5F: /* switch 6 */ case 0x60: /* switch 6 */ @@ -7302,9 +6807,9 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0x54: /* switch 6 */ case 0x55: /* switch 6 */ case 0x56: /* switch 6 */ - temp_a0 = arg0->type - 0x53; - func_800A890C(temp_a0, arg0); - func_800A143C(arg0, temp_a0); + var_a1 = arg0->type - 0x53; + func_800A890C(var_a1, arg0); + func_800A143C(arg0, var_a1); break; case 0x5D: /* switch 6 */ func_800A8564(arg0); @@ -7339,16 +6844,16 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0x79: /* switch 6 */ case 0x7A: /* switch 6 */ case 0x7B: /* switch 6 */ - temp_a0 = arg0->type - 0x78; - func_800A90D4(temp_a0, arg0); - func_800A143C(arg0, temp_a0); + var_a1 = arg0->type - 0x78; + func_800A90D4(var_a1, arg0); + func_800A143C(arg0, var_a1); break; case 0x8C: /* switch 6 */ - if ((gMainMenuSelectionDepth >= 5) && (spAC == (arg0->type - spA8))) { + if ((gMainMenuSelectionDepth >= 5) && (var_a1 == (arg0->type - var_v1))) { if (gMainMenuSelectionDepth >= 6) { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF); } else { - gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11); + gDisplayListHead = draw_flash_select_case_slow(gDisplayListHead, arg0->column^0, arg0->row^0, arg0->column + 0x3F, arg0->row + 0x11); } } else { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x3F, arg0->row + 0x11, 1, 1, 1, 0x000000FF); @@ -7412,10 +6917,10 @@ void func_8009F5E0(struct_8018D9E0_entry *arg0) { case 0xB3: /* switch 6 */ case 0xB4: /* switch 6 */ if (arg0->cursor != 0) { - spA8 = arg0->type - 0xB1; - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[gCharacterSelections[spA8]]]), arg0->column, arg0->row); - func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, spA8, arg0->unk1C); - func_800A11D0(arg0, spA8, 0x000000FF); + var_v1 = arg0->type - 0xB1; + gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[gCharacterSelections[var_v1]]]), arg0->column, arg0->row); + func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, var_v1, arg0->unk1C); + func_800A11D0(arg0, var_v1, 0x000000FF); } break; case 0xB9: /* switch 6 */ @@ -7774,11 +7279,11 @@ void func_800A143C(struct_8018D9E0_entry *arg0, s32 arg1) { case 0: case 2: case 3: - gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C8[arg1]), arg0->column, arg0->row); + gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg1 + 1]), arg0->column, arg0->row); break; case 1: case 4: - gDisplayListHead = func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C8[arg1]), arg0->column, arg0->row, 2, arg0->unk1C); + gDisplayListHead = func_8009BC9C(gDisplayListHead, segmented_to_virtual_dupe(D_800E82C4[arg1 + 1]), arg0->column, arg0->row, 2, arg0->unk1C); break; } } @@ -8043,9 +7548,9 @@ void func_800A1FB0(struct_8018D9E0_entry *arg0) { case 0x2C: /* switch 1 */ case 0x2D: /* switch 1 */ set_text_color(2); - temp_v0 = D_8018EDEC - 0x2A; + var_s1 = D_8018EDEC - 0x2A; for (var_s2 = 0; var_s2 < 3; var_s2++) { - func_80093324(0x00000032, 0x55 + (0x14 * var_s2), D_800E78D0[(temp_v0 * 3) + var_s2], 0, 0.9f, 0.9f); + func_80093324(0x00000032, 0x55 + (0x14 * var_s2), D_800E78D0[(var_s1 * 3) + var_s2], 0, 0.9f, 0.9f); } break; case 0x34: /* switch 1 */ @@ -8053,17 +7558,17 @@ void func_800A1FB0(struct_8018D9E0_entry *arg0) { case 0x36: /* switch 1 */ case 0x37: /* switch 1 */ set_text_color(2); - temp_v0 = D_8018EDEC - 0x34; + var_s1 = D_8018EDEC - 0x34; for (var_s2 = 0; var_s2 < 4; var_s2++) { - func_80093324(0x00000023, 0x55 + (0x14 * var_s2), D_800E7890[(temp_v0 * 4) + var_s2], 0, 0.8f, 0.8f); + func_80093324(0x00000023, 0x55 + (0x14 * var_s2), D_800E7890[(var_s1 * 4) + var_s2], 0, 0.8f, 0.8f); } break; case 0x41: /* switch 1 */ case 0x42: /* switch 1 */ set_text_color(2); - temp_v0 = D_8018EDEC - 0x41; + var_s1 = D_8018EDEC - 0x41; for (var_s2 = 0; var_s2 < 3; var_s2++) { - func_80093324(0x00000041, 0x55 + (0x14 * var_s2), D_800E7900[(temp_v0 * 3) + var_s2], 0, 0.9f, 0.9f); + func_80093324(0x00000041, 0x55 + (0x14 * var_s2), D_800E7900[(var_s1 * 3) + var_s2], 0, 0.9f, 0.9f); } break; case 0x46: /* switch 1 */ @@ -10042,16 +9547,12 @@ void func_800A8270(s32 arg0, struct_8018D9E0_entry *arg1) { } } -#ifdef NON_MATCHING -// https://decomp.me/scratch/BgXsO -// There's too much stuff on stack, but it doesn't seem like -// any temp variables can be removed. void func_800A8564(struct_8018D9E0_entry *arg0) { - s32 temp_t0; - s32 temp_a2; s32 sp34; s32 var_a1; MkTexture *var_a0; + s32 temp_a2; + s32 temp_t0; var_a1 = 0; switch (arg0->type) { /* irregular */ @@ -10088,9 +9589,6 @@ void func_800A8564(struct_8018D9E0_entry *arg0) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A8564.s") -#endif void func_800A86E8(struct_8018D9E0_entry *arg0) { gDisplayListHead = draw_box_fill(gDisplayListHead, arg0->column, arg0->row, arg0->column + 0x64, arg0->row + 0x27, 1, 1, 1, 0xFF); @@ -10454,8 +9952,8 @@ void func_800A9710(struct_8018D9E0_entry *arg0) { } #ifdef MIPS_TO_C -//generated by m2c commit eefca95b040d7ee0c617bc58f9ac6cd1cf7bce87 on Sep-02-2023 -void func_800A97BC(struct_8018D9E0_entry *arg0, u32 arg3) { +//generated by m2c commit 3c194b80148d233bd38495ca3456dc7b201a0302 on Mar-22-2024 +void func_800A97BC(struct_8018D9E0_entry *arg0) { s32 temp_t4; s32 temp_t7; s8 *var_v1; @@ -10523,6 +10021,19 @@ void func_800A97BC(struct_8018D9E0_entry *arg0, u32 arg3) { } var_v1 -= 4; } while (var_v1 != D_800E86C4); + + // for (var_v1 = 0; var_v1 < 8; var_v1++) { + // huh = 8 - var_v1; + // if (D_800E86C4[huh] >= D_800E86C4[var_v1 + 2]) { + // D_800E86C4[huh] = D_800E86C4[huh - 1]; + // } else { + // if ((D_800E86C4[huh + 1] == 1) || (D_800E86C4[huh + 1] == 0)) { + // D_800E86C4[huh] = 0; + // } else { + // D_800E86C4[huh] = D_800E86C4[huh + 1] + 1; + // } + // } + // } D_800E86C4->unk8 = 0; D_800E86C4->unk0 = D_800E86C4->unk8; } @@ -10565,7 +10076,7 @@ void func_800A97BC(struct_8018D9E0_entry *arg0, u32 arg3) { } } if ((u32) var_v1_2 < (u32) (D_800E86C4 + 4)) { - var_v1_2->unk3 = (s8) var_v1_2->cursor; + var_v1_2->unk3 = (s8) var_v1_2->unk4; } else { temp_v0_8 = var_v1_2->unk2; if ((temp_v0_8 == 0x10) || (temp_v0_8 == 0)) { @@ -10576,6 +10087,17 @@ void func_800A97BC(struct_8018D9E0_entry *arg0, u32 arg3) { } var_v1_2 += 4; } while (var_v1_2 != (D_800E86C4 + 8)); + // for (var_v1 = 0; var_v1 < 8; var_v1++) { + // if (D_800E86C4[var_v1] < D_800E86C4[7 - var_v1]) { + // D_800E86C4[var_v1] = D_800E86C4[var_v1 + 1]; + // } else { + // if ((D_800E86C4[var_v1 - 1] == 16) || (D_800E86C4[var_v1 - 1] == 0)) { + // D_800E86C4[var_v1] = 0; + // } else { + // D_800E86C4[var_v1] = D_800E86C4[var_v1 - 1] + 1; + // } + // } + // } D_800E86C4->unk8 = 0; D_800E86C4->unk0 = D_800E86C4->unk8; } @@ -11430,25 +10952,27 @@ void func_800AB290(struct_8018D9E0_entry *arg0) { } } -#ifdef MIPS_TO_C +#ifdef NON_MATCHING // Decent work has been done, but not quite right // https://decomp.me/scratch/YLbkC void func_800AB314(struct_8018D9E0_entry *arg0) { s32 var_a1; - s32 one; - u32 var_v0; + s32 one = 1; + s32 four = 4; struct_8018D9E0_entry *sp24[4]; + s32 var_v0; for (var_a1 = 0; var_a1 < 4; var_a1++) { sp24[var_a1] = find_8018D9E0_entry_dupe(var_a1 + 0x5F); } - if (gModeSelection != 0) { - if (D_8018EDEC != 1U) { + switch (gModeSelection) { + default: + if (D_8018EDEC != one) { arg0->cursor = 0; arg0->unk20 = 0; for (var_a1 = 0; var_a1 < 4; var_a1++) { if (gCupCourseSelection == var_a1) { - sp24[var_a1]->visible = 1; + sp24[var_a1]->visible = one; if (arg0->unk1C != var_a1) { arg0->unk1C = var_a1; } @@ -11460,21 +10984,21 @@ void func_800AB314(struct_8018D9E0_entry *arg0) { } else { arg0->cursor = 3; for (var_a1 = 0; var_a1 < 4; var_a1++) { - sp24[var_a1]->visible = 1; + sp24[var_a1]->visible = one; sp24[var_a1]->priority = 6; } } - } else { - var_v0 = arg0->cursor; - switch (var_v0) { /* irregular */ + break; + case 0: + switch (arg0->cursor) { /* irregular */ case 0: if ((arg0->unk1C / 4) == gCupSelection) { arg0->unk20++; if (arg0->unk20 >= 0x33) { - arg0->cursor = 1; + arg0->cursor = one; arg0->unk20 = 0; - arg0->unk1C = (gCupSelection * 4); - arg0->unk1C++; + var_v0 = gCupSelection * 4; + arg0->unk1C = var_v0 + 1; } } else { arg0->unk20 = 0; @@ -11484,26 +11008,22 @@ void func_800AB314(struct_8018D9E0_entry *arg0) { arg0->cursor = 2; arg0->unk20 = 0; } - var_v0 = arg0->cursor; break; case 1: if ((arg0->unk1C / 4) != gCupSelection) { arg0->cursor = 0; - var_v0 = 0; arg0->unk20 = 0; arg0->unk1C = 0; } else { arg0->unk20++; if (arg0->unk20 >= 0x1F) { arg0->unk20 = 0; - arg0->unk1C = (gCupSelection * 4) + (((arg0->unk1C % 4) + 1) % 4); - var_v0 = arg0->cursor; + arg0->unk1C = (gCupSelection * 4) + (((arg0->unk1C % 4) + one) % 4); } else { if (D_8018EDEC == 3) { arg0->cursor = 2; arg0->unk20 = 0; } - var_v0 = arg0->cursor; } } break; @@ -11518,23 +11038,21 @@ void func_800AB314(struct_8018D9E0_entry *arg0) { arg0->unk20 = 0; arg0->unk1C = 0; } - var_v0 = arg0->cursor; break; case 3: if (D_8018EDEC != 3) { arg0->cursor = 0; arg0->unk20 = 0; arg0->unk1C = 0; - var_v0 = 0; } break; } - switch (var_v0) { + switch (arg0->cursor) { case 0: case 1: for (var_a1 = 0; var_a1 < 4; var_a1++) { if ((arg0->unk1C % 4) == var_a1) { - sp24[var_a1]->visible = 1; + sp24[var_a1]->visible = one; } else { sp24[var_a1]->visible = 0; } @@ -11546,22 +11064,23 @@ void func_800AB314(struct_8018D9E0_entry *arg0) { if (var_a1 == (arg0->unk1C % 4)) { sp24[var_a1]->priority = 6; } else if(arg0->unk20 < (var_a1 * 5)) { - sp24[var_a1]->priority = 4; + sp24[var_a1]->priority = four; } else { sp24[var_a1]->priority = 8; } - sp24[var_a1]->visible = 1; + sp24[var_a1]->visible = one; } break; case 3: for (var_a1 = 0; var_a1 < 4; var_a1++) { - sp24[var_a1]->visible = 1; + sp24[var_a1]->visible = one; sp24[var_a1]->priority = 6; } break; default: break; } + break; } } #else diff --git a/src/code_80091750.h b/src/code_80091750.h index f09255be3..6c660fb95 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -9,6 +9,18 @@ extern u32 _course_mario_raceway_dl_mio0SegmentRomStart[]; /* File specific types */ +/* +Known `types` for `struct_8018D9E0_entry` +0x53: "Mushroom Cup" box on the cup selection screen +0x54: "Flower Cup" box on the cup selection screen +0x55: "Star Cup" box on the cup selection screen +0x56: "Special Cup" box on the cup selection screen +0x5E: A box of static over the course images as the cup selection screen loads in. + It is near unnoticeable though as in practice it doesn't last long enough to be seen. + Try locking the word at `8018DC80` to see something like 0x20 just before confirming character selection to make it last longer + See `func_80096CD8` for the actual drawing of the static +*/ + typedef struct { /* 0x00 */ s32 type; // id maybe? /* 0x04 */ s32 cursor; // sound mode, maybe some other stuff @@ -151,8 +163,9 @@ Gfx *func_80096CD8(Gfx*, s32, s32, u32, u32); Gfx *func_80097274(Gfx*, s8, s32, s32, s32, s32, s32, s32, s32, s32, s32, u32, u32, u32); Gfx *func_80097A14(Gfx*, s8, s32, s32, s32, s32, s32, s32, s32, u32, u32); Gfx *func_80097AE4(Gfx*, s8, s32, s32, u8*, s32); -Gfx *func_80097E58(Gfx*, s8, s32, u32, u32, s32, s32, s32, s32, s32, s32, u32); -Gfx *func_800987D0(Gfx*, u32, u32, u32, u32, s32, s32, s32, s32, s32); +Gfx *func_80097E58(Gfx*, s8, s32, s32, s32, s32, s32, s32, u8*, u32, s32, u32); +Gfx *func_80098558(Gfx*, u32, u32, u32, u32, u32, u32, s32, s32); +Gfx *func_800987D0(Gfx*, u32, u32, u32, u32, s32, s32, s32, u32, s32); Gfx *draw_box_fill(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32); Gfx *draw_box(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32); Gfx *func_80098FC8(Gfx*, s32, s32, s32, s32); @@ -431,7 +444,7 @@ extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; extern s32 gCycleFlashMenu; extern s8 D_8018E7AC[]; extern s8 D_8018E7B0; -extern s32 D_8018E7B8[]; +extern u32 D_8018E7B8[]; extern u32 D_8018E7C8; extern u32 D_8018E7D0[]; extern s32 D_8018E7E0; @@ -570,7 +583,7 @@ extern MkTexture *D_800E8254[]; extern MkTexture *D_800E8274[]; extern MkTexture *D_800E8294[]; extern MkTexture *D_800E82B4[]; -extern MkTexture *D_800E82C8[]; +extern MkTexture *D_800E82C4[]; extern MkTexture *D_800E82F4[]; extern MkAnimation *D_800E8320[]; extern MkAnimation *D_800E8340[]; diff --git a/src/data/some_data.c b/src/data/some_data.c index b267c63e7..f927fa3df 100644 --- a/src/data/some_data.c +++ b/src/data/some_data.c @@ -351,7 +351,7 @@ f32 D_800E594C[][2] = { { -0.0, 0.0 }, }; -u16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 }; +s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 }; // Seems to be related to the Boos in Banshee Boardwalk SplineData23 D_800E5988 = { @@ -766,38 +766,40 @@ Vec3s D_800E634C[] = { { 0xf380, 0x0013, 0xfe14 }, }; -Vec3s gMoleSpawns[] = { - { 0x0303, 0x0014, 0xf81a }, - { 0x0327, 0x000f, 0xf7f1 }, - { 0x034f, 0x0012, 0xf808 }, - { 0x0391, 0x000e, 0xf7fa }, - { 0x03ab, 0x0015, 0xf833 }, - { 0x03ad, 0x0011, 0xf818 }, - { 0x03e2, 0x0011, 0xf836 }, - { 0x035f, 0x0016, 0xf826 }, - { 0x05dc, 0x0002, 0x0474 }, - { 0x05e6, 0x000f, 0x041a }, - { 0x0649, 0x0015, 0x03a7 }, - { 0x0509, 0x0003, 0x04f5 }, - { 0x05bc, 0x0016, 0x0416 }, - { 0x0564, 0x000c, 0x0482 }, - { 0x0511, 0x0013, 0x0492 }, - { 0x0635, 0x000b, 0x03ec }, - { 0x0586, 0x0003, 0x04a1 }, - { 0x057d, 0x0004, 0x04e6 }, - { 0x05b7, 0x0008, 0x045e }, - { 0x02bd, 0x0002, 0x04ff }, - { 0x032b, 0x0008, 0x04fe }, - { 0x0317, 0x0010, 0x04cd }, - { 0x036c, 0x000f, 0x04f2 }, - { 0x03d8, 0x0017, 0x04e0 }, - { 0x037b, 0x0014, 0x04da }, - { 0x0398, 0x000f, 0x0518 }, - { 0x0337, 0x0006, 0x052f }, - { 0x02cd, 0x0008, 0x04d7 }, - { 0x02b7, 0x0013, 0x0498 }, - { 0x0274, 0x0008, 0x04a7 }, - { 0x02d4, 0x0004, 0x053b }, +MoleSpawnUnion gMoleSpawns = { + { + { 0x0303, 0x0014, 0xf81a }, + { 0x0327, 0x000f, 0xf7f1 }, + { 0x034f, 0x0012, 0xf808 }, + { 0x0391, 0x000e, 0xf7fa }, + { 0x03ab, 0x0015, 0xf833 }, + { 0x03ad, 0x0011, 0xf818 }, + { 0x03e2, 0x0011, 0xf836 }, + { 0x035f, 0x0016, 0xf826 }, + { 0x05dc, 0x0002, 0x0474 }, + { 0x05e6, 0x000f, 0x041a }, + { 0x0649, 0x0015, 0x03a7 }, + { 0x0509, 0x0003, 0x04f5 }, + { 0x05bc, 0x0016, 0x0416 }, + { 0x0564, 0x000c, 0x0482 }, + { 0x0511, 0x0013, 0x0492 }, + { 0x0635, 0x000b, 0x03ec }, + { 0x0586, 0x0003, 0x04a1 }, + { 0x057d, 0x0004, 0x04e6 }, + { 0x05b7, 0x0008, 0x045e }, + { 0x02bd, 0x0002, 0x04ff }, + { 0x032b, 0x0008, 0x04fe }, + { 0x0317, 0x0010, 0x04cd }, + { 0x036c, 0x000f, 0x04f2 }, + { 0x03d8, 0x0017, 0x04e0 }, + { 0x037b, 0x0014, 0x04da }, + { 0x0398, 0x000f, 0x0518 }, + { 0x0337, 0x0006, 0x052f }, + { 0x02cd, 0x0008, 0x04d7 }, + { 0x02b7, 0x0013, 0x0498 }, + { 0x0274, 0x0008, 0x04a7 }, + { 0x02d4, 0x0004, 0x053b }, + } }; // Referenced by D_800E6724, which is unused diff --git a/src/data/some_data.h b/src/data/some_data.h index 881393de5..dd961fbe1 100644 --- a/src/data/some_data.h +++ b/src/data/some_data.h @@ -37,7 +37,7 @@ extern ThwompSpawn gThwompSpawns100CCExtra[]; extern ThwompSpawn gThomwpSpawns150CC[]; extern f32 D_800E594C[][2]; extern u64 D_800E5974; -extern u16 D_800E597C[]; +extern s16 D_800E597C[]; extern SplineData23 D_800E5988; extern SplineData24 D_800E5A44; extern SplineData25 D_800E5B08; @@ -60,7 +60,7 @@ extern SplineData25 D_800E61B4; extern SplineData23 D_800E6280; extern SplineData *D_800E633C[]; extern Vec3s D_800E634C[]; -extern Vec3s gMoleSpawns[]; +extern MoleSpawnUnion gMoleSpawns; extern SplineData23 D_800E641C; extern SplineData24 D_800E64D8; extern SplineData25 D_800E659C; diff --git a/src/render_objects.c b/src/render_objects.c index 8696dc912..8cef03f3c 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -1642,52 +1642,47 @@ void func_8004C628(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8 *texture) { gSPDisplayList(gDisplayListHead++, D_0D007EB8); } -#ifdef MIPS_TO_C -//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b -void func_8004C6FC(s16 arg0, s16 arg1, s8 *arg2, u32 arg3, u32 arg4) { - Gfx *temp_v0; - Gfx *temp_v0_2; - Gfx *temp_v0_4; - s32 temp_t5; +#ifdef NON_MATCHING +// https://decomp.me/scratch/TqXqn +// There's a weird fakematch concerning `athing`, don't know that to make of. Can't quite get it over the finish line though +void func_8004C6FC(s16 arg0, s16 arg1, u8 *texture, u32 width, u32 arg4) { s32 temp_v0_3; s32 var_s3; s32 var_s4; - s8 *var_s5; - u32 temp_t3; + s32 athing; + s32 temp_t3; u32 temp_t8; - u32 var_s0; - u32 var_s6; - u32 var_t2; + s32 heigth; + s32 var_s6; + u8 *textureCopy; - var_s4 = arg1 - (arg4 >> 1); + athing = arg0 - (width / 2); + var_s4 = arg1 - (arg4 / 2); + textureCopy = texture; gSPDisplayList(gDisplayListHead++, D_0D007EF8); - temp_t8 = arg3 * arg4 * 4; - temp_t3 = temp_t8 >> 0xC; - var_s5 = arg2; - var_s6 = temp_t8; - var_t2 = temp_t3; gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - if (temp_t8 & 0xFFF) { - var_t2 = temp_t3 + 1; + temp_t8 = width * arg4 * 4; + temp_t3 = temp_t8 / 4096; + if (temp_t8 % 4096) { + temp_t3++; } - var_s0 = arg4 / var_t2; - var_s3 = 0; - if ((s32) var_t2 > 0) { - do { - temp_t5 = arg3 * var_s0 * 4; - load_texture_tile_rgba32_nomirror(var_s5, (s32) arg3, (s32) var_s0); - func_8004B950(arg0 - (arg3 >> 1), var_s4, (s32) arg3, (s32) var_s0, 1); - temp_v0_3 = var_s6 - temp_t5; - var_s5 += temp_t5; - if (temp_v0_3 < 0) { - var_s0 = var_s6 / arg3; - } else { - var_s6 = (u32) temp_v0_3; - } - var_s3 += 1; - var_s4 += var_s0; - } while (var_s3 < (s32) var_t2); + heigth = arg4 / temp_t3; + var_s6 = temp_t3; + for (var_s3 = 0; var_s3 < var_s6; var_s3++) { + load_texture_tile_rgba32_nomirror(textureCopy, width, heigth); + func_8004B950(athing, var_s4, width, heigth, 1); + temp_v0_3 = temp_t8 - (width * heigth * 4); + textureCopy += (width * heigth * 4); + if (temp_v0_3 < 0) { + heigth = temp_t8 / width; + } else { + temp_t8 = temp_v0_3; + } + // Weird fakematch that is a HUGE improvement + athing += var_s4 * 0; + var_s4 += heigth; } + gSPDisplayList(gDisplayListHead++, D_0D007EB8); } #else @@ -1893,30 +1888,22 @@ void func_8004D4E8(s32 arg0, s32 arg1, u8 *texture, s32 arg3, s32 arg4, s32 arg5 } } -#ifdef NON_MATCHING -//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b -//? func_80044F34(s8 *, s32, s32); /* extern */ - -UNUSED void func_8004D654(s32 arg0, s32 arg1, u8 *texture, f32 arg3, s32 arg4, s32 arg5, s32 arg6, UNUSED s32 arg7, s32 width, s32 arg9, UNUSED s32 argA, s32 height) { - u8 *img; - s32 var_s3; +void func_8004D654(s32 arg0, s32 arg1, u8 *texture, f32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 width, s32 arg9, s32 argA, s32 height) { s32 i; - // Something weird with (width / 2). - var_s3 = arg1 - (width / 2); - img = texture; + s32 var_s3; + u8 *textureCopy; + + var_s3 = arg1 - (arg9 / 2); + textureCopy = texture; gSPDisplayList(gDisplayListHead++, D_0D008000); func_8004B480(arg4, arg5, arg6); - - for (i = 0; i < arg9 / height; i++) { - func_80044F34(img, width, height); - func_8004BB3C(arg0, var_s3, width, arg9, arg3); - img += (width * height) / 2; + for (i = 0; i < (arg9 / height); i++) { + func_80044F34(textureCopy, width, height); + func_8004BB3C(arg0, arg1, width, arg9, arg3); + textureCopy += (width * height) / 2; var_s3 += height; } } -#else -GLOBAL_ASM("asm/non_matchings/render_objects/func_8004D654.s") -#endif void func_8004D7B4(s32 arg0, s32 arg1, u8 *texture, s32 arg3, s32 arg4) { s32 sp5C; @@ -2331,36 +2318,47 @@ void func_8004F020(s32 arg0) { } #ifdef NON_MATCHING -//generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Dec-20-2023 +// https://decomp.me/scratch/FxA1w /** * characterId of 8 appears to be a type of null check or control flow alteration. */ +#define EXPLICIT_AND 1 void func_8004F168(s32 arg0, s32 playerId, s32 characterId) { + f32 thing0; + f32 thing1; + s16 temp_a0; + s16 temp_a1; Player *player = &gPlayerOne[playerId]; - s32 temp_a0; - s32 temp_a1; - if (gPlayerOne->type & PLAYER_EXISTS) { - temp_a0 = ((D_8018D2C0[arg0] + D_8018D2F0) - ((s16) D_8018D2B0 / 2)) + D_8018D2E0 + (s32) (player->pos[0] * D_8018D2A0); - temp_a1 = ((D_8018D2D8[arg0] + D_8018D2F8) - ((s16) D_8018D2B8 / 2)) + D_8018D2E8 + (s32) (player->pos[2] * D_8018D2A0); + if (player->type & (1 << 15)) { + thing0 = player->pos[0] * D_8018D2A0; + thing1 = player->pos[2] * D_8018D2A0; + temp_a0 = ((D_8018D2C0[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + D_8018D2E0 + (s16)(thing0); + temp_a1 = ((D_8018D2D8[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + D_8018D2E8 + (s16)(thing1); if (characterId != 8) { - if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != BATTLE) && (gModeSelection != TIME_TRIALS)) { - func_80046424((s32) temp_a0, (s32) temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, (u8 *) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); - // return; + if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) { + #if EXPLICIT_AND == 1 + func_80046424(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); + #else + func_80046424(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f, common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); + #endif } else { - func_800463B0((s32) temp_a0, (s32) temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, (u8 *) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); + #if EXPLICIT_AND == 1 + func_800463B0(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f, common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); + #else + func_800463B0(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f, common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon, 8, 8, 8, 8); + #endif } - //return; } else { if (gGPCurrentRaceRankByPlayerId[playerId] == 0) { - func_8004C450((s32) temp_a0, (s32) temp_a1, 8, 8, (u8 *) common_texture_minimap_progress_dot); - //return; + func_8004C450(temp_a0, temp_a1, 8, 8, (u8 *) common_texture_minimap_progress_dot); } else { - draw_hud_2d_texture((s32) temp_a0, (s32) temp_a1, 8, 8, (u8 *) common_texture_minimap_progress_dot); + func_8004C364(temp_a0, temp_a1, 8, 8, (u8 *) common_texture_minimap_progress_dot); } } } } +#undef EXPLICIT_AND #else GLOBAL_ASM("asm/non_matchings/render_objects/func_8004F168.s") #endif @@ -2798,6 +2796,7 @@ void func_80050C68(void) { // Something about the handling of the `player` variable is weird. // All commands are present and correct, 2 of them are out of position +// https://decomp.me/scratch/PvJ5D void func_80050E34(s32 playerId, s32 arg1) { s32 objectIndex; s32 spD0; @@ -3802,7 +3801,7 @@ void func_80054E10(s32 objectIndex) { void func_80054EB8(UNUSED s32 unused) { s32 someIndex; - for (someIndex = 0; someIndex < NUM_MAX_MOLES; someIndex++) { + for (someIndex = 0; someIndex < NUM_TOTAL_MOLES; someIndex++) { func_80054E10(gObjectParticle1[someIndex]); } } diff --git a/src/update_objects.c b/src/update_objects.c index 37037b091..decde7c65 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -3669,10 +3669,6 @@ s16 func_8007AFB0(s32 objectIndex, s32 arg1) { return randomItem; } -#ifdef NON_MATCHING -// https://decomp.me/scratch/yWKlx -// More stupid register allocation nonsense - s32 func_8007B040(s32 objectIndex, s32 playerId) { s16 stackPadding; s32 temp_v1; @@ -3696,8 +3692,7 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) { func_800C9060(playerId, 0x1900A058U); } var_t3 = 1; - gObjectList[objectIndex].unk_0A2 = var_v1; - gObjectList[objectIndex].itemDisplay = var_v1; + gObjectList[objectIndex].itemDisplay = gObjectList[objectIndex].unk_0A2 = var_v1; } else { for (var_v1_2 = 0; var_v1_2 < gPlayerCountSelection1; var_v1_2++) { temp_a0 = gItemWindowObjectByPlayerId[var_v1_2]; @@ -3711,11 +3706,11 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) { } if (var_a3 != 0) { var_v1 = random_int(var_a3); - temp_v1 = sp50[var_v1]; - gObjectList[objectIndex].unk_0D1 = temp_v1; temp_a1 = sp40[var_v1]; gObjectList[objectIndex].unk_0A2 = temp_a1; gObjectList[objectIndex].itemDisplay = temp_a1; + temp_v1 = sp50[var_v1]; + gObjectList[objectIndex].unk_0D1 = temp_v1; temp_a0 = gItemWindowObjectByPlayerId[temp_v1]; sp38 = &gPlayerOne[temp_v1]; func_800722A4(temp_a0, 1); @@ -3730,9 +3725,6 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) { } return var_t3; } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_8007B040.s") -#endif void func_8007B254(s32 objectIndex, s32 arg1) { s8 test; // why? @@ -4163,34 +4155,30 @@ void wrapper_update_boos(void) { update_boos(); } -#ifdef MIPS_TO_C -//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-27-2022 +#ifdef NON_MATCHING +// https://decomp.me/scratch/9JBIl +// No idea what the source of the diff is void func_8007C360(s32 objectIndex, Camera *camera) { - Objects *sp20; - s32 sp1C; s32 temp_t0; - s32 temp_t2; s32 var_t1; Objects *temp_a2; temp_a2 = &gObjectList[objectIndex]; - temp_t0 = (((temp_a2->unk_0BE[1] - (u16) camera->rot[1]) + 0x8000) & 0xFFFF) * 0x24; + temp_t0 = (u16)camera->rot[1]; + temp_t0 = (((temp_a2->direction_angle[1] - temp_t0) + 0x8000) & 0xFFFF) * 0x24; var_t1 = temp_t0 >> 0x10; if (temp_t0 < 0) { - var_t1 = (s32) (temp_t0 + 0xFFFF) >> 0x10; + var_t1 = temp_t0 + 0xFFFF; + var_t1 >>= 0x10; } - temp_t2 = var_t1 & 0xFFFF; - if (temp_t2 < 0x13) { - sp20 = temp_a2; - sp1C = temp_t2; - set_object_flag_status_false(objectIndex, 0x00000080); - temp_a2->itemDisplay = (s8) sp1C; - return; + var_t1 &= 0xFFFF; + if (var_t1 < 0x13) { + set_object_flag_status_false(objectIndex, 0x80); + temp_a2->itemDisplay = var_t1; + } else { + set_object_flag_status_true(objectIndex, 0x80); + temp_a2->itemDisplay = 0x24 - var_t1; } - sp20 = temp_a2; - sp1C = temp_t2; - set_object_flag_status_true(objectIndex, 0x00000080); - temp_a2->itemDisplay = 0x24 - temp_t2; } #else GLOBAL_ASM("asm/non_matchings/update_objects/func_8007C360.s") @@ -4210,34 +4198,28 @@ UNUSED void func_8007C49C(void) { } -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f +#ifdef NON_MATCHING +// https://decomp.me/scratch/IH8Vx +// No idea what the source of the diff is void func_8007C4A4(s32 objectIndex) { - Objects *sp20; - s32 sp1C; - s32 temp_t0; s32 temp_t8; - s32 var_t9; - Objects *temp_v1; + s32 var_t1; - temp_v1 = &gObjectList[objectIndex]; - temp_t8 = temp_v1->unk_0BE[1] * 0x24; - var_t9 = temp_t8 >> 0x10; + temp_t8 = gObjectList[objectIndex].direction_angle[1] * 0x24; + var_t1 = temp_t8 >> 0x10; if (temp_t8 < 0) { - var_t9 = (s32) (temp_t8 + 0xFFFF) >> 0x10; + var_t1 = temp_t8 + 0xFFFF; + var_t1 >>= 0x10; } - temp_t0 = var_t9 & 0xFFFF; - if (temp_t0 < 0x13) { - sp20 = temp_v1; - sp1C = temp_t0; - set_object_flag_status_false(objectIndex, 0x00000080); - temp_v1->itemDisplay = (s8) sp1C; - return; + var_t1 &= 0xFFFF; + if (var_t1 < 0x13) { + set_object_flag_status_false(objectIndex, 0x80); + gObjectList[objectIndex].itemDisplay = var_t1; + } + else { + set_object_flag_status_true(objectIndex, 0x80); + gObjectList[objectIndex].itemDisplay = 0x24 - var_t1; } - sp20 = temp_v1; - sp1C = temp_t0; - set_object_flag_status_true(objectIndex, 0x00000080); - temp_v1->itemDisplay = 0x24 - temp_t0; } #else GLOBAL_ASM("asm/non_matchings/update_objects/func_8007C4A4.s") @@ -5966,9 +5948,8 @@ void func_80080DE4(s32 arg0) { } #ifdef NON_MATCHING -extern f32 D_800E594C[][2]; -extern u16 D_800E597C[6]; - +// https://decomp.me/scratch/YMJDJ +// No idea what the problem is void func_80080E8C(s32 objectIndex1, s32 objectIndex2, s32 arg2) { u16 anAngle; f32 thing0; @@ -6347,17 +6328,6 @@ void func_80081D34(s32 objectIndex) { } } -#ifdef NON_MATCHING -/** - * Nonmatching due to regalloc stuff - * The use of the `offset` variable is really really weird - * The intent of the function appears to be choose a random mole from a given - * group of moles (decided by arg1) - * `offset` then would then be offsetting the indexing into gMoleSpawns - * so that we choose the appropriate spawn location for that mole - * But as its written, `offset` is triple what it ought to be. - * So there' something kind of fucky happening - **/ void func_80081FF4(s32 objectIndex, s32 arg1) { UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; @@ -6401,13 +6371,17 @@ void func_80081FF4(s32 objectIndex, s32 arg1) { break; } } - gObjectList[objectIndex].origin_pos[0] = gMoleSpawns[var_v1][offset + 0] * xOrientation; - gObjectList[objectIndex].origin_pos[1] = gMoleSpawns[var_v1][offset + 1] - 9.0; - gObjectList[objectIndex].origin_pos[2] = gMoleSpawns[var_v1][offset + 2]; + /* + Ideally `gMoleSpawns` wouldn't be a union at all and its just be a list of Vec3s + Even more ideally each mole group would have its own array for its spawns + gObjectList[objectIndex].origin_pos[0] = gMoleSpawns.asVec3sList[offset + var_v1][0] * xOrientation; + gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asVec3sList[offset + var_v1][1] - 9.0; + gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asVec3sList[offset + var_v1][2]; + */ + gObjectList[objectIndex].origin_pos[0] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 0] * xOrientation; + gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 1] - 9.0; + gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 2]; } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_80081FF4.s") -#endif void func_800821AC(s32 objectIndex, s32 arg1) { if (gObjectList[objectIndex].state != 0) { @@ -6671,16 +6645,19 @@ void update_crabs(void) { } #ifdef NON_MATCHING -// https://decomp.me/scratch/RquH0 -// Gollygee I sure love register allocation :^) +// https://decomp.me/scratch/PYAg4 +// Stack issue caused by the `test` variable, but removing it causes much, much larger differences void func_80082F1C(s32 objectIndex, s32 arg1) { + YVFlagPoleSpawn *test; gObjectList[objectIndex].model = (Gfx *) d_course_yoshi_valley_unk5; gObjectList[objectIndex].vertex = (Vtx *) d_course_yoshi_valley_unk4; gObjectList[objectIndex].sizeScaling = 0.027f; + if (test->rot && test->rot) {} + test = &D_800E5DF4[arg1]; func_80072488(objectIndex); - set_obj_origin_pos(objectIndex, D_800E5DF4[arg1].pos[0] * xOrientation, D_800E5DF4[arg1].pos[1], D_800E5DF4[arg1].pos[2]); + set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); - set_obj_direction_angle(objectIndex, 0U, D_800E5DF4[arg1].rot, 0U); + set_obj_direction_angle(objectIndex, 0U, test->rot, 0U); } #else GLOBAL_ASM("asm/non_matchings/update_objects/func_80082F1C.s") diff --git a/tools/doxygen_syms.md b/tools/doxygen_syms.md index 9f033ac32..1fd98846c 100644 --- a/tools/doxygen_syms.md +++ b/tools/doxygen_syms.md @@ -1918,6 +1918,7 @@ Variable Name | Memory Address [func_80097A14](@ref func_80097A14) | 0x80097A14 [func_80097AE4](@ref func_80097AE4) | 0x80097AE4 [func_80097E58](@ref func_80097E58) | 0x80097E58 +[func_80098558](@ref func_80098558) | 0x80098558 [func_800987D0](@ref func_800987D0) | 0x800987D0 [draw_box_fill](@ref draw_box_fill) | 0x80098C18 [draw_box](@ref draw_box) | 0x80098DF8 @@ -3310,7 +3311,7 @@ Variable Name | Memory Address [D_800E8274](@ref D_800E8274) | 0x800E8274 [D_800E8294](@ref D_800E8294) | 0x800E8294 [D_800E82B4](@ref D_800E82B4) | 0x800E82B4 -[D_800E82C8](@ref D_800E82C8) | 0x800E82C8 +[D_800E82C4](@ref D_800E82C4) | 0x800E82C4 [D_800E82F4](@ref D_800E82F4) | 0x800E82F4 [D_800E8320](@ref D_800E8320) | 0x800E8320 [D_800E8340](@ref D_800E8340) | 0x800E8340