diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..03ea4a3a8 --- /dev/null +++ b/.clang-format @@ -0,0 +1,18 @@ +IndentWidth: 4 +Language: Cpp +AlignAfterOpenBracket: Align +SortIncludes: false +ColumnLimit: 104 +PointerAlignment: Right +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +BinPackArguments: true +BinPackParameters: true +SpaceAfterCStyleCast: true +BreakBeforeBraces: Attach +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: NonAssignment +Cpp11BracedListStyle: false +IndentCaseLabels: true +AlignTrailingComments: true +UseTab: Never diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..8313a6dd0 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,6 @@ +--- +Checks: '-*,readability-braces-around-statements' +WarningsAsErrors: '' +HeaderFilterRegex: '(src|include|enhancements)\/.*\.h$' +FormatStyle: 'file' +CheckOptions: diff --git a/README.md b/README.md index a0000d54c..fd33c6b4c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=m2c)](https://ci.valandil.ca/job/mk64/job/master/) [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=nonmatching)](https://ci.valandil.ca/job/mk64/job/master/) -C Files left: ~22 out of 35 +C Files left: ~21 out of 35 # Mario Kart 64 This repo contains a work-in-progress decompilation of Mario Kart 64 (U). The project pursues historical and educational elements within the game found via taking it apart and putting it back together. Inspiration to do so not only emanates from the game's hardware and technology but also its immensely positive effects on the cultures and families of nearly every nationality. See [progress](#Progress) for more information. diff --git a/asm/non_matchings/ceremony_and_credits/func_80283430.s b/asm/non_matchings/ceremony_and_credits/func_80283430.s new file mode 100644 index 000000000..e318f5d0c --- /dev/null +++ b/asm/non_matchings/ceremony_and_credits/func_80283430.s @@ -0,0 +1,139 @@ +glabel func_80283430 +/* 126A70 80283430 27BDFFD0 */ addiu $sp, $sp, -0x30 +/* 126A74 80283434 AFB00020 */ sw $s0, 0x20($sp) +/* 126A78 80283438 3C108028 */ lui $s0, %hi(D_802876E0) # $s0, 0x8028 +/* 126A7C 8028343C 3C018028 */ lui $at, %hi(D_802876D8) # $at, 0x8028 +/* 126A80 80283440 261076E0 */ addiu $s0, %lo(D_802876E0) # addiu $s0, $s0, 0x76e0 +/* 126A84 80283444 AC2076D8 */ sw $zero, %lo(D_802876D8)($at) +/* 126A88 80283448 A200001C */ sb $zero, 0x1c($s0) +/* 126A8C 8028344C 3C0E800E */ lui $t6, %hi(D_800DC5E4) # $t6, 0x800e +/* 126A90 80283450 95CEC5E4 */ lhu $t6, %lo(D_800DC5E4)($t6) +/* 126A94 80283454 AFBF002C */ sw $ra, 0x2c($sp) +/* 126A98 80283458 3C018028 */ lui $at, %hi(D_802856C4) # $at, 0x8028 +/* 126A9C 8028345C 3C048028 */ lui $a0, %hi(D_802876E0+0xC) # $a0, 0x8028 +/* 126AA0 80283460 AFB20028 */ sw $s2, 0x28($sp) +/* 126AA4 80283464 AFB10024 */ sw $s1, 0x24($sp) +/* 126AA8 80283468 F7B40018 */ sdc1 $f20, 0x18($sp) +/* 126AAC 8028346C 248476EC */ addiu $a0, %lo(D_802876E0+0xC) # addiu $a0, $a0, 0x76ec +/* 126AB0 80283470 0C0A07F7 */ jal vec3f_clear +/* 126AB4 80283474 AC2E56C4 */ sw $t6, %lo(D_802856C4)($at) +/* 126AB8 80283478 4480A000 */ mtc1 $zero, $f20 +/* 126ABC 8028347C 02002025 */ move $a0, $s0 +/* 126AC0 80283480 3C0743FA */ lui $a3, 0x43fa +/* 126AC4 80283484 4405A000 */ mfc1 $a1, $f20 +/* 126AC8 80283488 4406A000 */ mfc1 $a2, $f20 +/* 126ACC 8028348C 0C0A07E8 */ jal vec3f_set_dupe +/* 126AD0 80283490 00000000 */ nop +/* 126AD4 80283494 3C048028 */ lui $a0, %hi(D_80287700+0x10) # $a0, 0x8028 +/* 126AD8 80283498 0C0A07F7 */ jal vec3f_clear +/* 126ADC 8028349C 24847710 */ addiu $a0, %lo(D_80287700+0x10) # addiu $a0, $a0, 0x7710 +/* 126AE0 802834A0 3C048028 */ lui $a0, %hi(D_80287700+0x4) # $a0, 0x8028 +/* 126AE4 802834A4 4405A000 */ mfc1 $a1, $f20 +/* 126AE8 802834A8 4406A000 */ mfc1 $a2, $f20 +/* 126AEC 802834AC 24847704 */ addiu $a0, %lo(D_80287700+0x4) # addiu $a0, $a0, 0x7704 +/* 126AF0 802834B0 0C0A07E8 */ jal vec3f_set_dupe +/* 126AF4 802834B4 3C0743FA */ lui $a3, 0x43fa +/* 126AF8 802834B8 3C048028 */ lui $a0, %hi(D_80287700+0x1C) # $a0, 0x8028 +/* 126AFC 802834BC 4405A000 */ mfc1 $a1, $f20 +/* 126B00 802834C0 4407A000 */ mfc1 $a3, $f20 +/* 126B04 802834C4 2484771C */ addiu $a0, %lo(D_80287700+0x1C) # addiu $a0, $a0, 0x771c +/* 126B08 802834C8 0C0A07E8 */ jal vec3f_set_dupe +/* 126B0C 802834CC 3C063F80 */ lui $a2, 0x3f80 +/* 126B10 802834D0 3C018028 */ lui $at, %hi(D_802876F8) # $at, 0x8028 +/* 126B14 802834D4 3C048028 */ lui $a0, %hi(D_80287728) # $a0, 0x8028 +/* 126B18 802834D8 E43476F8 */ swc1 $f20, %lo(D_802876F8)($at) +/* 126B1C 802834DC 0C0A07FD */ jal vec3s_clear +/* 126B20 802834E0 24847728 */ addiu $a0, %lo(D_80287728) # addiu $a0, $a0, 0x7728 +/* 126B24 802834E4 3C048028 */ lui $a0, %hi(D_80287728+0x6) # $a0, 0x8028 +/* 126B28 802834E8 0C0A07FD */ jal vec3s_clear +/* 126B2C 802834EC 2484772E */ addiu $a0, %lo(D_80287728+0x6) # addiu $a0, $a0, 0x772e +/* 126B30 802834F0 3C048028 */ lui $a0, %hi(D_80287728+0xC) # $a0, 0x8028 +/* 126B34 802834F4 0C0A07FD */ jal vec3s_clear +/* 126B38 802834F8 24847734 */ addiu $a0, %lo(D_80287728+0xC) # addiu $a0, $a0, 0x7734 +/* 126B3C 802834FC 3C048028 */ lui $a0, %hi(D_80287728+0x12) # $a0, 0x8028 +/* 126B40 80283500 0C0A07FD */ jal vec3s_clear +/* 126B44 80283504 2484773A */ addiu $a0, %lo(D_80287728+0x12) # addiu $a0, $a0, 0x773a +/* 126B48 80283508 3C018028 */ lui $at, %hi(D_80287740) # $at, 0x8028 +/* 126B4C 8028350C A4207740 */ sh $zero, %lo(D_80287740)($at) +/* 126B50 80283510 E4347744 */ swc1 $f20, %lo(D_80287740+0x4)($at) +/* 126B54 80283514 3C018028 */ lui $at, %hi(D_80287748+0x6) # $at, 0x8028 +/* 126B58 80283518 E4347748 */ swc1 $f20, %lo(D_80287740+0x8)($at) +/* 126B5C 8028351C A420774C */ sh $zero, %lo(D_80287740+0xC)($at) +/* 126B60 80283520 A420774E */ sh $zero, %lo(D_80287748+0x6)($at) +/* 126B64 80283524 3C018015 */ lui $at, %hi(D_80150130) # $at, 0x8015 +/* 126B68 80283528 C4240130 */ lwc1 $f4, %lo(D_80150130)($at) +/* 126B6C 8028352C 3C018028 */ lui $at, %hi(D_80287700) # $at, 0x8028 +/* 126B70 80283530 E4247700 */ swc1 $f4, %lo(D_80287700)($at) +/* 126B74 80283534 3C018028 */ lui $at, %hi(sCutsceneShot) # $at, 0x8028 +/* 126B78 80283538 A42076D0 */ sh $zero, %lo(sCutsceneShot)($at) +/* 126B7C 8028353C 3C018028 */ lui $at, %hi(gCutsceneShotTimer) # $at, 0x8028 +/* 126B80 80283540 A42076D2 */ sh $zero, %lo(gCutsceneShotTimer)($at) +/* 126B84 80283544 3C018028 */ lui $at, %hi(D_802876D4) # $at, 0x8028 +/* 126B88 80283548 0C0A0903 */ jal reset_spline +/* 126B8C 8028354C AC2076D4 */ sw $zero, %lo(D_802876D4)($at) +/* 126B90 80283550 3C048028 */ lui $a0, %hi(D_80287818) # $a0, 0x8028 +/* 126B94 80283554 3C028028 */ lui $v0, %hi(D_80287998) # $v0, 0x8028 +/* 126B98 80283558 3C058028 */ lui $a1, %hi(sCutsceneSplineSegmentProgress) # $a1, 0x8028 +/* 126B9C 8028355C 24A57B18 */ addiu $a1, %lo(sCutsceneSplineSegmentProgress) # addiu $a1, $a1, 0x7b18 +/* 126BA0 80283560 24427998 */ addiu $v0, %lo(D_80287998) # addiu $v0, $v0, 0x7998 +/* 126BA4 80283564 24847818 */ addiu $a0, %lo(D_80287818) # addiu $a0, $a0, 0x7818 +/* 126BA8 80283568 2403FFFF */ li $v1, -1 +.L8028356C: +/* 126BAC 8028356C 2442000C */ addiu $v0, $v0, 0xc +/* 126BB0 80283570 0045082B */ sltu $at, $v0, $a1 +/* 126BB4 80283574 2484000C */ addiu $a0, $a0, 0xc +/* 126BB8 80283578 A083FFF4 */ sb $v1, -0xc($a0) +/* 126BBC 8028357C 1420FFFB */ bnez $at, .L8028356C +/* 126BC0 80283580 A043FFF4 */ sb $v1, -0xc($v0) +/* 126BC4 80283584 3C118028 */ lui $s1, %hi(D_80287750) # $s1, 0x8028 +/* 126BC8 80283588 3C108028 */ lui $s0, 0x8028 +/* 126BCC 8028358C 3C128028 */ lui $s2, 0x8028 +/* 126BD0 80283590 26527824 */ addiu $s2, $s2, 0x7824 +/* 126BD4 80283594 2610775C */ addiu $s0, $s0, 0x775c +/* 126BD8 80283598 26317750 */ addiu $s1, %lo(D_80287750) # addiu $s1, $s1, 0x7750 +.L8028359C: +/* 126BDC 8028359C 0C0A07F7 */ jal vec3f_clear +/* 126BE0 802835A0 02202025 */ move $a0, $s1 +/* 126BE4 802835A4 0C0A07FD */ jal vec3s_clear +/* 126BE8 802835A8 02002025 */ move $a0, $s0 +/* 126BEC 802835AC 26100014 */ addiu $s0, $s0, 0x14 +/* 126BF0 802835B0 1612FFFA */ bne $s0, $s2, .L8028359C +/* 126BF4 802835B4 26310014 */ addiu $s1, $s1, 0x14 +/* 126BF8 802835B8 3C0F800E */ lui $t7, %hi(gGamestate) # $t7, 0x800e +/* 126BFC 802835BC 8DEFC50C */ lw $t7, %lo(gGamestate)($t7) +/* 126C00 802835C0 3C018028 */ lui $at, %hi(D_802856C0) # $at, 0x8028 +/* 126C04 802835C4 E43456C0 */ swc1 $f20, %lo(D_802856C0)($at) +/* 126C08 802835C8 24010005 */ li $at, 5 +/* 126C0C 802835CC 15E1000B */ bne $t7, $at, .L802835FC +/* 126C10 802835D0 3C0142F0 */ li $at, 0x42F00000 # 120.000000 +/* 126C14 802835D4 44810000 */ mtc1 $at, $f0 +/* 126C18 802835D8 3C018028 */ lui $at, %hi(D_802856B0) # $at, 0x8028 +/* 126C1C 802835DC E42056B0 */ swc1 $f0, %lo(D_802856B0)($at) +/* 126C20 802835E0 3C014140 */ li $at, 0x41400000 # 12.000000 +/* 126C24 802835E4 44813000 */ mtc1 $at, $f6 +/* 126C28 802835E8 3C018028 */ lui $at, %hi(D_802856B4) # $at, 0x8028 +/* 126C2C 802835EC E42656B4 */ swc1 $f6, %lo(D_802856B4)($at) +/* 126C30 802835F0 3C018028 */ lui $at, %hi(D_802856B8) # $at, 0x8028 +/* 126C34 802835F4 1000000D */ b .L8028362C +/* 126C38 802835F8 E42056B8 */ swc1 $f0, %lo(D_802856B8)($at) +.L802835FC: +/* 126C3C 802835FC 3C0142C4 */ li $at, 0x42C40000 # 98.000000 +/* 126C40 80283600 44814000 */ mtc1 $at, $f8 +/* 126C44 80283604 3C018028 */ lui $at, %hi(D_802856B0) # $at, 0x8028 +/* 126C48 80283608 E42856B0 */ swc1 $f8, %lo(D_802856B0)($at) +/* 126C4C 8028360C 3C014140 */ li $at, 0x41400000 # 12.000000 +/* 126C50 80283610 44815000 */ mtc1 $at, $f10 +/* 126C54 80283614 3C018028 */ lui $at, %hi(D_802856B4) # $at, 0x8028 +/* 126C58 80283618 E42A56B4 */ swc1 $f10, %lo(D_802856B4)($at) +/* 126C5C 8028361C 3C014250 */ li $at, 0x42500000 # 52.000000 +/* 126C60 80283620 44818000 */ mtc1 $at, $f16 +/* 126C64 80283624 3C018028 */ lui $at, %hi(D_802856B8) # $at, 0x8028 +/* 126C68 80283628 E43056B8 */ swc1 $f16, %lo(D_802856B8)($at) +.L8028362C: +/* 126C6C 8028362C 8FBF002C */ lw $ra, 0x2c($sp) +/* 126C70 80283630 D7B40018 */ ldc1 $f20, 0x18($sp) +/* 126C74 80283634 8FB00020 */ lw $s0, 0x20($sp) +/* 126C78 80283638 8FB10024 */ lw $s1, 0x24($sp) +/* 126C7C 8028363C 8FB20028 */ lw $s2, 0x28($sp) +/* 126C80 80283640 03E00008 */ jr $ra +/* 126C84 80283644 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/non_matchings/code_80281FA0/func_80283648.s b/asm/non_matchings/ceremony_and_credits/func_80283648.s similarity index 95% rename from asm/non_matchings/code_80281FA0/func_80283648.s rename to asm/non_matchings/ceremony_and_credits/func_80283648.s index b7cb69819..6a8af5972 100644 --- a/asm/non_matchings/code_80281FA0/func_80283648.s +++ b/asm/non_matchings/ceremony_and_credits/func_80283648.s @@ -20,9 +20,9 @@ glabel func_80283648 /* 126CD0 80283690 0C0A0CDB */ jal func_8028336C /* 126CD4 80283694 02002825 */ move $a1, $s0 /* 126CD8 80283698 304300FF */ andi $v1, $v0, 0xff -/* 126CDC 8028369C 3C018028 */ lui $at, %hi(D_802876FC) # $at, 0x8028 +/* 126CDC 8028369C 3C018028 */ lui $at, %hi(D_802876E0+0x1C) # $at, 0x8028 /* 126CE0 802836A0 10600090 */ beqz $v1, .L802838E4 -/* 126CE4 802836A4 A02376FC */ sb $v1, %lo(D_802876FC)($at) +/* 126CE4 802836A4 A02376FC */ sb $v1, %lo(D_802876E0+0x1C)($at) /* 126CE8 802836A8 3C048028 */ lui $a0, %hi(D_802876E0+0xC) # $a0, 0x8028 /* 126CEC 802836AC 248476EC */ addiu $a0, %lo(D_802876E0+0xC) # addiu $a0, $a0, 0x76ec /* 126CF0 802836B0 0C0A0802 */ jal vec3f_copy_dupe @@ -32,7 +32,7 @@ glabel func_80283648 /* 126D00 802836C0 0C0A0802 */ jal vec3f_copy_dupe /* 126D04 802836C4 8FA50034 */ lw $a1, 0x34($sp) /* 126D08 802836C8 3C048028 */ lui $a0, %hi(D_802876E0) # $a0, 0x8028 -/* 126D0C 802836CC 0C0A12BA */ jal func_80284AE8 +/* 126D0C 802836CC 0C0A12BA */ jal play_cutscene /* 126D10 802836D0 248476E0 */ addiu $a0, %lo(D_802876E0) # addiu $a0, $a0, 0x76e0 /* 126D14 802836D4 3C048028 */ lui $a0, %hi(D_802876E0+0xC) # $a0, 0x8028 /* 126D18 802836D8 3C058028 */ lui $a1, %hi(D_802876E0) # $a1, 0x8028 @@ -70,8 +70,8 @@ glabel func_80283648 /* 126D8C 8028374C 0C0A0941 */ jal func_80282504 /* 126D90 80283750 AFAF0010 */ sw $t7, 0x10($sp) .L80283754: -/* 126D94 80283754 3C018028 */ lui $at, %hi(D_802876F8) # $at, 0x8028 -/* 126D98 80283758 C42276F8 */ lwc1 $f2, %lo(D_802876F8)($at) +/* 126D94 80283754 3C018028 */ lui $at, %hi(D_802876E0+0x18) # $at, 0x8028 +/* 126D98 80283758 C42276F8 */ lwc1 $f2, %lo(D_802876E0+0x18)($at) /* 126D9C 8028375C 3C014780 */ li $at, 0x47800000 # 65536.000000 /* 126DA0 80283760 44816000 */ mtc1 $at, $f12 /* 126DA4 80283764 3C01C780 */ li $at, 0xC7800000 # -65536.000000 @@ -90,8 +90,8 @@ glabel func_80283648 /* 126DD4 80283794 460C1080 */ add.s $f2, $f2, $f12 /* 126DD8 80283798 4606103C */ c.lt.s $f2, $f6 .L8028379C: -/* 126DDC 8028379C 3C018028 */ lui $at, %hi(D_802876F8) # $at, 0x8028 -/* 126DE0 802837A0 E42276F8 */ swc1 $f2, %lo(D_802876F8)($at) +/* 126DDC 8028379C 3C018028 */ lui $at, %hi(D_802876E0+0x18) # $at, 0x8028 +/* 126DE0 802837A0 E42276F8 */ swc1 $f2, %lo(D_802876E0+0x18)($at) /* 126DE4 802837A4 46001006 */ mov.s $f0, $f2 /* 126DE8 802837A8 45020003 */ bc1fl .L802837B8 /* 126DEC 802837AC 4458F800 */ cfc1 $t8, $31 diff --git a/asm/non_matchings/code_80281FA0/func_802828C8.s b/asm/non_matchings/code_80281FA0/func_802828C8.s deleted file mode 100644 index e07ca8b14..000000000 --- a/asm/non_matchings/code_80281FA0/func_802828C8.s +++ /dev/null @@ -1,209 +0,0 @@ -glabel func_802828C8 -/* 125F08 802828C8 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 125F0C 802828CC AFBF002C */ sw $ra, 0x2c($sp) -/* 125F10 802828D0 AFB10028 */ sw $s1, 0x28($sp) -/* 125F14 802828D4 AFB00024 */ sw $s0, 0x24($sp) -/* 125F18 802828D8 AFA5009C */ sw $a1, 0x9c($sp) -/* 125F1C 802828DC 44800000 */ mtc1 $zero, $f0 -/* 125F20 802828E0 84E30000 */ lh $v1, ($a3) -/* 125F24 802828E4 8FAE00A8 */ lw $t6, 0xa8($sp) -/* 125F28 802828E8 00C08025 */ move $s0, $a2 -/* 125F2C 802828EC 00E08825 */ move $s1, $a3 -/* 125F30 802828F0 00004825 */ move $t1, $zero -/* 125F34 802828F4 46000386 */ mov.s $f14, $f0 -/* 125F38 802828F8 46000406 */ mov.s $f16, $f0 -/* 125F3C 802828FC 04610002 */ bgez $v1, .L80282908 -/* 125F40 80282900 C5CC0000 */ lwc1 $f12, ($t6) -/* 125F44 80282904 46000306 */ mov.s $f12, $f0 -.L80282908: -/* 125F48 80282908 240A000C */ li $t2, 12 -/* 125F4C 8028290C 006A0019 */ multu $v1, $t2 -/* 125F50 80282910 2408FFFF */ li $t0, -1 -/* 125F54 80282914 00007812 */ mflo $t7 -/* 125F58 80282918 020F1021 */ addu $v0, $s0, $t7 -/* 125F5C 8028291C 80580000 */ lb $t8, ($v0) -/* 125F60 80282920 11180009 */ beq $t0, $t8, .L80282948 -/* 125F64 80282924 00000000 */ nop -/* 125F68 80282928 8059000C */ lb $t9, 0xc($v0) -/* 125F6C 8028292C 11190006 */ beq $t0, $t9, .L80282948 -/* 125F70 80282930 00000000 */ nop -/* 125F74 80282934 804B0018 */ lb $t3, 0x18($v0) -/* 125F78 80282938 00036080 */ sll $t4, $v1, 2 -/* 125F7C 8028293C 01836023 */ subu $t4, $t4, $v1 -/* 125F80 80282940 150B0003 */ bne $t0, $t3, .L80282950 -/* 125F84 80282944 000C6080 */ sll $t4, $t4, 2 -.L80282948: -/* 125F88 80282948 100000A1 */ b .L80282BD0 -/* 125F8C 8028294C 24020001 */ li $v0, 1 -.L80282950: -/* 125F90 80282950 020C1021 */ addu $v0, $s0, $t4 -/* 125F94 80282954 844D0006 */ lh $t5, 6($v0) -/* 125F98 80282958 3C014380 */ li $at, 0x43800000 # 256.000000 -/* 125F9C 8028295C 44810000 */ mtc1 $at, $f0 -/* 125FA0 80282960 448D2000 */ mtc1 $t5, $f4 -/* 125FA4 80282964 00802825 */ move $a1, $a0 -/* 125FA8 80282968 8FA6009C */ lw $a2, 0x9c($sp) -/* 125FAC 8028296C 468021A0 */ cvt.s.w $f6, $f4 -/* 125FB0 80282970 27A70054 */ addiu $a3, $sp, 0x54 -/* 125FB4 80282974 E7A60054 */ swc1 $f6, 0x54($sp) -/* 125FB8 80282978 844E0008 */ lh $t6, 8($v0) -/* 125FBC 8028297C 448E4000 */ mtc1 $t6, $f8 -/* 125FC0 80282980 00000000 */ nop -/* 125FC4 80282984 468042A0 */ cvt.s.w $f10, $f8 -/* 125FC8 80282988 E7AA0058 */ swc1 $f10, 0x58($sp) -/* 125FCC 8028298C 844F000A */ lh $t7, 0xa($v0) -/* 125FD0 80282990 448F9000 */ mtc1 $t7, $f18 -/* 125FD4 80282994 00000000 */ nop -/* 125FD8 80282998 46809120 */ cvt.s.w $f4, $f18 -/* 125FDC 8028299C E7A4005C */ swc1 $f4, 0x5c($sp) -/* 125FE0 802829A0 80580004 */ lb $t8, 4($v0) -/* 125FE4 802829A4 44983000 */ mtc1 $t8, $f6 -/* 125FE8 802829A8 00000000 */ nop -/* 125FEC 802829AC 46803220 */ cvt.s.w $f8, $f6 -/* 125FF0 802829B0 46004282 */ mul.s $f10, $f8, $f0 -/* 125FF4 802829B4 E7AA0060 */ swc1 $f10, 0x60($sp) -/* 125FF8 802829B8 84590012 */ lh $t9, 0x12($v0) -/* 125FFC 802829BC 44999000 */ mtc1 $t9, $f18 -/* 126000 802829C0 00000000 */ nop -/* 126004 802829C4 46809120 */ cvt.s.w $f4, $f18 -/* 126008 802829C8 E7A40064 */ swc1 $f4, 0x64($sp) -/* 12600C 802829CC 844B0014 */ lh $t3, 0x14($v0) -/* 126010 802829D0 448B3000 */ mtc1 $t3, $f6 -/* 126014 802829D4 00000000 */ nop -/* 126018 802829D8 46803220 */ cvt.s.w $f8, $f6 -/* 12601C 802829DC E7A80068 */ swc1 $f8, 0x68($sp) -/* 126020 802829E0 844C0016 */ lh $t4, 0x16($v0) -/* 126024 802829E4 448C5000 */ mtc1 $t4, $f10 -/* 126028 802829E8 00000000 */ nop -/* 12602C 802829EC 468054A0 */ cvt.s.w $f18, $f10 -/* 126030 802829F0 E7B2006C */ swc1 $f18, 0x6c($sp) -/* 126034 802829F4 804D0010 */ lb $t5, 0x10($v0) -/* 126038 802829F8 448D2000 */ mtc1 $t5, $f4 -/* 12603C 802829FC 00000000 */ nop -/* 126040 80282A00 468021A0 */ cvt.s.w $f6, $f4 -/* 126044 80282A04 46003202 */ mul.s $f8, $f6, $f0 -/* 126048 80282A08 E7A80070 */ swc1 $f8, 0x70($sp) -/* 12604C 80282A0C 844E001E */ lh $t6, 0x1e($v0) -/* 126050 80282A10 448E5000 */ mtc1 $t6, $f10 -/* 126054 80282A14 00000000 */ nop -/* 126058 80282A18 468054A0 */ cvt.s.w $f18, $f10 -/* 12605C 80282A1C E7B20074 */ swc1 $f18, 0x74($sp) -/* 126060 80282A20 844F0020 */ lh $t7, 0x20($v0) -/* 126064 80282A24 448F2000 */ mtc1 $t7, $f4 -/* 126068 80282A28 27AF0064 */ addiu $t7, $sp, 0x64 -/* 12606C 80282A2C 468021A0 */ cvt.s.w $f6, $f4 -/* 126070 80282A30 E7A60078 */ swc1 $f6, 0x78($sp) -/* 126074 80282A34 84580022 */ lh $t8, 0x22($v0) -/* 126078 80282A38 44984000 */ mtc1 $t8, $f8 -/* 12607C 80282A3C 27B80074 */ addiu $t8, $sp, 0x74 -/* 126080 80282A40 468042A0 */ cvt.s.w $f10, $f8 -/* 126084 80282A44 E7AA007C */ swc1 $f10, 0x7c($sp) -/* 126088 80282A48 8059001C */ lb $t9, 0x1c($v0) -/* 12608C 80282A4C 44999000 */ mtc1 $t9, $f18 -/* 126090 80282A50 27B90084 */ addiu $t9, $sp, 0x84 -/* 126094 80282A54 46809120 */ cvt.s.w $f4, $f18 -/* 126098 80282A58 46002182 */ mul.s $f6, $f4, $f0 -/* 12609C 80282A5C E7A60080 */ swc1 $f6, 0x80($sp) -/* 1260A0 80282A60 844B002A */ lh $t3, 0x2a($v0) -/* 1260A4 80282A64 448B4000 */ mtc1 $t3, $f8 -/* 1260A8 80282A68 00000000 */ nop -/* 1260AC 80282A6C 468042A0 */ cvt.s.w $f10, $f8 -/* 1260B0 80282A70 E7AA0084 */ swc1 $f10, 0x84($sp) -/* 1260B4 80282A74 844C002C */ lh $t4, 0x2c($v0) -/* 1260B8 80282A78 448C9000 */ mtc1 $t4, $f18 -/* 1260BC 80282A7C 00000000 */ nop -/* 1260C0 80282A80 46809120 */ cvt.s.w $f4, $f18 -/* 1260C4 80282A84 E7A40088 */ swc1 $f4, 0x88($sp) -/* 1260C8 80282A88 844D002E */ lh $t5, 0x2e($v0) -/* 1260CC 80282A8C 448D3000 */ mtc1 $t5, $f6 -/* 1260D0 80282A90 00000000 */ nop -/* 1260D4 80282A94 46803220 */ cvt.s.w $f8, $f6 -/* 1260D8 80282A98 E7A8008C */ swc1 $f8, 0x8c($sp) -/* 1260DC 80282A9C 804E0028 */ lb $t6, 0x28($v0) -/* 1260E0 80282AA0 E7B00040 */ swc1 $f16, 0x40($sp) -/* 1260E4 80282AA4 E7AE0044 */ swc1 $f14, 0x44($sp) -/* 1260E8 80282AA8 448E5000 */ mtc1 $t6, $f10 -/* 1260EC 80282AAC AFA90094 */ sw $t1, 0x94($sp) -/* 1260F0 80282AB0 AFB90018 */ sw $t9, 0x18($sp) -/* 1260F4 80282AB4 468054A0 */ cvt.s.w $f18, $f10 -/* 1260F8 80282AB8 AFB80014 */ sw $t8, 0x14($sp) -/* 1260FC 80282ABC AFAF0010 */ sw $t7, 0x10($sp) -/* 126100 80282AC0 46009102 */ mul.s $f4, $f18, $f0 -/* 126104 80282AC4 0C0A09C0 */ jal func_80282700 -/* 126108 80282AC8 E7A40090 */ swc1 $f4, 0x90($sp) -/* 12610C 80282ACC 862B0000 */ lh $t3, ($s1) -/* 126110 80282AD0 240A000C */ li $t2, 12 -/* 126114 80282AD4 8FA400A8 */ lw $a0, 0xa8($sp) -/* 126118 80282AD8 016A0019 */ multu $t3, $t2 -/* 12611C 80282ADC 2408FFFF */ li $t0, -1 -/* 126120 80282AE0 8FA90094 */ lw $t1, 0x94($sp) -/* 126124 80282AE4 C7AE0044 */ lwc1 $f14, 0x44($sp) -/* 126128 80282AE8 C7B00040 */ lwc1 $f16, 0x40($sp) -/* 12612C 80282AEC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 126130 80282AF0 00006012 */ mflo $t4 -/* 126134 80282AF4 020C1021 */ addu $v0, $s0, $t4 -/* 126138 80282AF8 9443000E */ lhu $v1, 0xe($v0) -/* 12613C 80282AFC 5060000B */ beql $v1, $zero, .L80282B2C -/* 126140 80282B00 9443001A */ lhu $v1, 0x1a($v0) -/* 126144 80282B04 44834000 */ mtc1 $v1, $f8 -/* 126148 80282B08 44813000 */ mtc1 $at, $f6 -/* 12614C 80282B0C 04610005 */ bgez $v1, .L80282B24 -/* 126150 80282B10 468042A0 */ cvt.s.w $f10, $f8 -/* 126154 80282B14 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 126158 80282B18 44819000 */ mtc1 $at, $f18 -/* 12615C 80282B1C 00000000 */ nop -/* 126160 80282B20 46125280 */ add.s $f10, $f10, $f18 -.L80282B24: -/* 126164 80282B24 460A3383 */ div.s $f14, $f6, $f10 -/* 126168 80282B28 9443001A */ lhu $v1, 0x1a($v0) -.L80282B2C: -/* 12616C 80282B2C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 126170 80282B30 5060000B */ beql $v1, $zero, .L80282B60 -/* 126174 80282B34 460E8281 */ sub.s $f10, $f16, $f14 -/* 126178 80282B38 44834000 */ mtc1 $v1, $f8 -/* 12617C 80282B3C 44812000 */ mtc1 $at, $f4 -/* 126180 80282B40 04610005 */ bgez $v1, .L80282B58 -/* 126184 80282B44 468044A0 */ cvt.s.w $f18, $f8 -/* 126188 80282B48 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 12618C 80282B4C 44813000 */ mtc1 $at, $f6 -/* 126190 80282B50 00000000 */ nop -/* 126194 80282B54 46069480 */ add.s $f18, $f18, $f6 -.L80282B58: -/* 126198 80282B58 46122403 */ div.s $f16, $f4, $f18 -/* 12619C 80282B5C 460E8281 */ sub.s $f10, $f16, $f14 -.L80282B60: -/* 1261A0 80282B60 C4800000 */ lwc1 $f0, ($a0) -/* 1261A4 80282B64 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 1261A8 80282B68 44816000 */ mtc1 $at, $f12 -/* 1261AC 80282B6C 460A0202 */ mul.s $f8, $f0, $f10 -/* 1261B0 80282B70 460E4080 */ add.s $f2, $f8, $f14 -/* 1261B4 80282B74 46020180 */ add.s $f6, $f0, $f2 -/* 1261B8 80282B78 E4860000 */ swc1 $f6, ($a0) -/* 1261BC 80282B7C C4840000 */ lwc1 $f4, ($a0) -/* 1261C0 80282B80 4604603E */ c.le.s $f12, $f4 -/* 1261C4 80282B84 00000000 */ nop -/* 1261C8 80282B88 45020011 */ bc1fl .L80282BD0 -/* 1261CC 80282B8C 01201025 */ move $v0, $t1 -/* 1261D0 80282B90 862D0000 */ lh $t5, ($s1) -/* 1261D4 80282B94 25AE0001 */ addiu $t6, $t5, 1 -/* 1261D8 80282B98 A62E0000 */ sh $t6, ($s1) -/* 1261DC 80282B9C 862F0000 */ lh $t7, ($s1) -/* 1261E0 80282BA0 01EA0019 */ multu $t7, $t2 -/* 1261E4 80282BA4 0000C012 */ mflo $t8 -/* 1261E8 80282BA8 0218C821 */ addu $t9, $s0, $t8 -/* 1261EC 80282BAC 832B0024 */ lb $t3, 0x24($t9) -/* 1261F0 80282BB0 550B0004 */ bnel $t0, $t3, .L80282BC4 -/* 1261F4 80282BB4 C4920000 */ lwc1 $f18, ($a0) -/* 1261F8 80282BB8 A6200000 */ sh $zero, ($s1) -/* 1261FC 80282BBC 24090001 */ li $t1, 1 -/* 126200 80282BC0 C4920000 */ lwc1 $f18, ($a0) -.L80282BC4: -/* 126204 80282BC4 460C9281 */ sub.s $f10, $f18, $f12 -/* 126208 80282BC8 E48A0000 */ swc1 $f10, ($a0) -/* 12620C 80282BCC 01201025 */ move $v0, $t1 -.L80282BD0: -/* 126210 80282BD0 8FBF002C */ lw $ra, 0x2c($sp) -/* 126214 80282BD4 8FB00024 */ lw $s0, 0x24($sp) -/* 126218 80282BD8 8FB10028 */ lw $s1, 0x28($sp) -/* 12621C 80282BDC 03E00008 */ jr $ra -/* 126220 80282BE0 27BD0098 */ addiu $sp, $sp, 0x98 diff --git a/asm/non_matchings/code_80281FA0/func_802847CC.s b/asm/non_matchings/code_80281FA0/func_802847CC.s deleted file mode 100644 index 109b0290f..000000000 --- a/asm/non_matchings/code_80281FA0/func_802847CC.s +++ /dev/null @@ -1,210 +0,0 @@ -glabel func_802847CC -/* 127E0C 802847CC 3C018028 */ lui $at, %hi(D_802856B4) # $at, 0x8028 -/* 127E10 802847D0 4458F800 */ cfc1 $t8, $31 -/* 127E14 802847D4 24190001 */ li $t9, 1 -/* 127E18 802847D8 44D9F800 */ ctc1 $t9, $31 -/* 127E1C 802847DC C42456B4 */ lwc1 $f4, %lo(D_802856B4)($at) -/* 127E20 802847E0 3C0E800E */ lui $t6, %hi(D_800DC5E4) # $t6, 0x800e -/* 127E24 802847E4 95CEC5E4 */ lhu $t6, %lo(D_800DC5E4)($t6) -/* 127E28 802847E8 460021A4 */ cvt.w.s $f6, $f4 -/* 127E2C 802847EC 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 127E30 802847F0 3C028028 */ lui $v0, %hi(D_80286A10) # 0x8028 -/* 127E34 802847F4 000E7900 */ sll $t7, $t6, 4 -/* 127E38 802847F8 4459F800 */ cfc1 $t9, $31 -/* 127E3C 802847FC AFB00018 */ sw $s0, 0x18($sp) -/* 127E40 80284800 004F1021 */ addu $v0, $v0, $t7 -/* 127E44 80284804 33390078 */ andi $t9, $t9, 0x78 -/* 127E48 80284808 00808025 */ move $s0, $a0 -/* 127E4C 8028480C AFBF001C */ sw $ra, 0x1c($sp) -/* 127E50 80284810 13200013 */ beqz $t9, .L80284860 -/* 127E54 80284814 94426A10 */ lhu $v0, %lo(D_80286A10)($v0) # 0x6a10($v0) -/* 127E58 80284818 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 -/* 127E5C 8028481C 44813000 */ mtc1 $at, $f6 -/* 127E60 80284820 24190001 */ li $t9, 1 -/* 127E64 80284824 46062181 */ sub.s $f6, $f4, $f6 -/* 127E68 80284828 44D9F800 */ ctc1 $t9, $31 -/* 127E6C 8028482C 00000000 */ nop -/* 127E70 80284830 460031A4 */ cvt.w.s $f6, $f6 -/* 127E74 80284834 4459F800 */ cfc1 $t9, $31 -/* 127E78 80284838 00000000 */ nop -/* 127E7C 8028483C 33390078 */ andi $t9, $t9, 0x78 -/* 127E80 80284840 17200005 */ bnez $t9, .L80284858 -/* 127E84 80284844 00000000 */ nop -/* 127E88 80284848 44193000 */ mfc1 $t9, $f6 -/* 127E8C 8028484C 3C018000 */ lui $at, 0x8000 -/* 127E90 80284850 10000007 */ b .L80284870 -/* 127E94 80284854 0321C825 */ or $t9, $t9, $at -.L80284858: -/* 127E98 80284858 10000005 */ b .L80284870 -/* 127E9C 8028485C 2419FFFF */ li $t9, -1 -.L80284860: -/* 127EA0 80284860 44193000 */ mfc1 $t9, $f6 -/* 127EA4 80284864 00000000 */ nop -/* 127EA8 80284868 0720FFFB */ bltz $t9, .L80284858 -/* 127EAC 8028486C 00000000 */ nop -.L80284870: -/* 127EB0 80284870 00594823 */ subu $t1, $v0, $t9 -/* 127EB4 80284874 252AFFF6 */ addiu $t2, $t1, -0xa -/* 127EB8 80284878 44D8F800 */ ctc1 $t8, $31 -/* 127EBC 8028487C 3C048028 */ lui $a0, %hi(func_80283CD0) # $a0, 0x8028 -/* 127EC0 80284880 A7AA002E */ sh $t2, 0x2e($sp) -/* 127EC4 80284884 A7A2002C */ sh $v0, 0x2c($sp) -/* 127EC8 80284888 24843CD0 */ addiu $a0, %lo(func_80283CD0) # addiu $a0, $a0, 0x3cd0 -/* 127ECC 8028488C 02002825 */ move $a1, $s0 -/* 127ED0 80284890 00003025 */ move $a2, $zero -/* 127ED4 80284894 0C0A0CB1 */ jal func_802832C4 -/* 127ED8 80284898 00003825 */ move $a3, $zero -/* 127EDC 8028489C 3C048028 */ lui $a0, %hi(func_80283A00) # $a0, 0x8028 -/* 127EE0 802848A0 24843A00 */ addiu $a0, %lo(func_80283A00) # addiu $a0, $a0, 0x3a00 -/* 127EE4 802848A4 02002825 */ move $a1, $s0 -/* 127EE8 802848A8 24060008 */ li $a2, 8 -/* 127EEC 802848AC 0C0A0CB1 */ jal func_802832C4 -/* 127EF0 802848B0 24070008 */ li $a3, 8 -/* 127EF4 802848B4 3C048028 */ lui $a0, %hi(func_80283C78) # $a0, 0x8028 -/* 127EF8 802848B8 24843C78 */ addiu $a0, %lo(func_80283C78) # addiu $a0, $a0, 0x3c78 -/* 127EFC 802848BC 02002825 */ move $a1, $s0 -/* 127F00 802848C0 24060095 */ li $a2, 149 -/* 127F04 802848C4 0C0A0CB1 */ jal func_802832C4 -/* 127F08 802848C8 24070095 */ li $a3, 149 -/* 127F0C 802848CC 3C048028 */ lui $a0, %hi(func_80282434) # $a0, 0x8028 -/* 127F10 802848D0 24842434 */ addiu $a0, %lo(func_80282434) # addiu $a0, $a0, 0x2434 -/* 127F14 802848D4 02002825 */ move $a1, $s0 -/* 127F18 802848D8 00003025 */ move $a2, $zero -/* 127F1C 802848DC 0C0A0CB1 */ jal func_802832C4 -/* 127F20 802848E0 00003825 */ move $a3, $zero -/* 127F24 802848E4 3C0B800E */ lui $t3, %hi(D_800DC5E4) # $t3, 0x800e -/* 127F28 802848E8 956BC5E4 */ lhu $t3, %lo(D_800DC5E4)($t3) -/* 127F2C 802848EC 3C028028 */ lui $v0, %hi(D_80286A04) # 0x8028 -/* 127F30 802848F0 24010001 */ li $at, 1 -/* 127F34 802848F4 000B6100 */ sll $t4, $t3, 4 -/* 127F38 802848F8 004C1021 */ addu $v0, $v0, $t4 -/* 127F3C 802848FC 90426A04 */ lbu $v0, %lo(D_80286A04)($v0) # 0x6a04 -/* 127F40 80284900 3C048028 */ lui $a0, %hi(func_802839CC) # $a0, 0x8028 -/* 127F44 80284904 248439CC */ addiu $a0, %lo(func_802839CC) # addiu $a0, $a0, 0x39cc -/* 127F48 80284908 10410006 */ beq $v0, $at, .L80284924 -/* 127F4C 8028490C 02002825 */ move $a1, $s0 -/* 127F50 80284910 24010002 */ li $at, 2 -/* 127F54 80284914 10410013 */ beq $v0, $at, .L80284964 -/* 127F58 80284918 3C048028 */ lui $a0, %hi(func_802839B4) # 0x8028 -/* 127F5C 8028491C 10000029 */ b .L802849C4 -/* 127F60 80284920 3C048028 */ lui $a0, %hi(func_802839B4) # 0x8028 -.L80284924: -/* 127F64 80284924 00003025 */ move $a2, $zero -/* 127F68 80284928 0C0A0CB1 */ jal func_802832C4 -/* 127F6C 8028492C 2407FFFF */ li $a3, -1 -/* 127F70 80284930 97A6002E */ lhu $a2, 0x2e($sp) -/* 127F74 80284934 3C048028 */ lui $a0, %hi(func_802839E0) # $a0, 0x8028 -/* 127F78 80284938 248439E0 */ addiu $a0, %lo(func_802839E0) # addiu $a0, $a0, 0x39e0 -/* 127F7C 8028493C 24C6FFEC */ addiu $a2, $a2, -0x14 -/* 127F80 80284940 00066C00 */ sll $t5, $a2, 0x10 -/* 127F84 80284944 000D3403 */ sra $a2, $t5, 0x10 -/* 127F88 80284948 00063C00 */ sll $a3, $a2, 0x10 -/* 127F8C 8028494C 00077C03 */ sra $t7, $a3, 0x10 -/* 127F90 80284950 01E03825 */ move $a3, $t7 -/* 127F94 80284954 0C0A0CB1 */ jal func_802832C4 -/* 127F98 80284958 02002825 */ move $a1, $s0 -/* 127F9C 8028495C 10000040 */ b .L80284A60 -/* 127FA0 80284960 00000000 */ nop -.L80284964: -/* 127FA4 80284964 248439B4 */ addiu $a0, $a0, %lo(func_802839B4) # 0x39b4 -/* 127FA8 80284968 02002825 */ move $a1, $s0 -/* 127FAC 8028496C 00003025 */ move $a2, $zero -/* 127FB0 80284970 0C0A0CB1 */ jal func_802832C4 -/* 127FB4 80284974 00003825 */ move $a3, $zero -/* 127FB8 80284978 3C048028 */ lui $a0, %hi(func_80283D04) # $a0, 0x8028 -/* 127FBC 8028497C 24843D04 */ addiu $a0, %lo(func_80283D04) # addiu $a0, $a0, 0x3d04 -/* 127FC0 80284980 02002825 */ move $a1, $s0 -/* 127FC4 80284984 240600F7 */ li $a2, 247 -/* 127FC8 80284988 0C0A0CB1 */ jal func_802832C4 -/* 127FCC 8028498C 240700F7 */ li $a3, 247 -/* 127FD0 80284990 3C18800E */ lui $t8, %hi(D_800DC5E4) # $t8, 0x800e -/* 127FD4 80284994 9718C5E4 */ lhu $t8, %lo(D_800DC5E4)($t8) -/* 127FD8 80284998 3C088028 */ lui $t0, %hi(D_80286A04) # $t0, 0x8028 -/* 127FDC 8028499C 25086A04 */ addiu $t0, %lo(D_80286A04) # addiu $t0, $t0, 0x6a04 -/* 127FE0 802849A0 0018C900 */ sll $t9, $t8, 4 -/* 127FE4 802849A4 03281021 */ addu $v0, $t9, $t0 -/* 127FE8 802849A8 8C450004 */ lw $a1, 4($v0) -/* 127FEC 802849AC 8C460008 */ lw $a2, 8($v0) -/* 127FF0 802849B0 02002025 */ move $a0, $s0 -/* 127FF4 802849B4 0C0A0B64 */ jal func_80282D90 -/* 127FF8 802849B8 00003825 */ move $a3, $zero -/* 127FFC 802849BC 10000028 */ b .L80284A60 -/* 128000 802849C0 00000000 */ nop -.L802849C4: -/* 128004 802849C4 248439B4 */ addiu $a0, $a0, %lo(func_802839B4) # 0x39b4 -/* 128008 802849C8 02002825 */ move $a1, $s0 -/* 12800C 802849CC 00003025 */ move $a2, $zero -/* 128010 802849D0 0C0A0CB1 */ jal func_802832C4 -/* 128014 802849D4 00003825 */ move $a3, $zero -/* 128018 802849D8 97A2002E */ lhu $v0, 0x2e($sp) -/* 12801C 802849DC 3C048028 */ lui $a0, %hi(func_802839CC) # $a0, 0x8028 -/* 128020 802849E0 248439CC */ addiu $a0, %lo(func_802839CC) # addiu $a0, $a0, 0x39cc -/* 128024 802849E4 00023400 */ sll $a2, $v0, 0x10 -/* 128028 802849E8 00064C03 */ sra $t1, $a2, 0x10 -/* 12802C 802849EC 00093C00 */ sll $a3, $t1, 0x10 -/* 128030 802849F0 00075403 */ sra $t2, $a3, 0x10 -/* 128034 802849F4 01403825 */ move $a3, $t2 -/* 128038 802849F8 01203025 */ move $a2, $t1 -/* 12803C 802849FC 02002825 */ move $a1, $s0 -/* 128040 80284A00 0C0A0CB1 */ jal func_802832C4 -/* 128044 80284A04 AFA20024 */ sw $v0, 0x24($sp) -/* 128048 80284A08 8FA20024 */ lw $v0, 0x24($sp) -/* 12804C 80284A0C 3C048028 */ lui $a0, %hi(func_802839E0) # $a0, 0x8028 -/* 128050 80284A10 248439E0 */ addiu $a0, %lo(func_802839E0) # addiu $a0, $a0, 0x39e0 -/* 128054 80284A14 2446FFEC */ addiu $a2, $v0, -0x14 -/* 128058 80284A18 00065C00 */ sll $t3, $a2, 0x10 -/* 12805C 80284A1C 000B3403 */ sra $a2, $t3, 0x10 -/* 128060 80284A20 00063C00 */ sll $a3, $a2, 0x10 -/* 128064 80284A24 00076C03 */ sra $t5, $a3, 0x10 -/* 128068 80284A28 01A03825 */ move $a3, $t5 -/* 12806C 80284A2C 0C0A0CB1 */ jal func_802832C4 -/* 128070 80284A30 02002825 */ move $a1, $s0 -/* 128074 80284A34 3C0E800E */ lui $t6, %hi(D_800DC5E4) # $t6, 0x800e -/* 128078 80284A38 95CEC5E4 */ lhu $t6, %lo(D_800DC5E4)($t6) -/* 12807C 80284A3C 3C188028 */ lui $t8, %hi(D_80286A04) # $t8, 0x8028 -/* 128080 80284A40 27186A04 */ addiu $t8, %lo(D_80286A04) # addiu $t8, $t8, 0x6a04 -/* 128084 80284A44 000E7900 */ sll $t7, $t6, 4 -/* 128088 80284A48 01F81021 */ addu $v0, $t7, $t8 -/* 12808C 80284A4C 8C450004 */ lw $a1, 4($v0) -/* 128090 80284A50 8C460008 */ lw $a2, 8($v0) -/* 128094 80284A54 02002025 */ move $a0, $s0 -/* 128098 80284A58 0C0A0B64 */ jal func_80282D90 -/* 12809C 80284A5C 00003825 */ move $a3, $zero -.L80284A60: -/* 1280A0 80284A60 3C19800E */ lui $t9, %hi(gCCSelection) # $t9, 0x800e -/* 1280A4 80284A64 8F39C548 */ lw $t9, %lo(gCCSelection)($t9) -/* 1280A8 80284A68 24010003 */ li $at, 3 -/* 1280AC 80284A6C 3C08800E */ lui $t0, %hi(D_800DC5E4) # $t0, 0x800e -/* 1280B0 80284A70 17210007 */ bne $t9, $at, .L80284A90 -/* 1280B4 80284A74 3C0C8028 */ lui $t4, %hi(gCutsceneShotTimer) # $t4, 0x8028 -/* 1280B8 80284A78 9508C5E4 */ lhu $t0, %lo(D_800DC5E4)($t0) -/* 1280BC 80284A7C 3C0A8028 */ lui $t2, %hi(D_80286B34) # 0x8028 -/* 1280C0 80284A80 00084840 */ sll $t1, $t0, 1 -/* 1280C4 80284A84 01495021 */ addu $t2, $t2, $t1 -/* 1280C8 80284A88 954A6B34 */ lhu $t2, %lo(D_80286B34)($t2) -/* 1280CC 80284A8C A7AA002C */ sh $t2, 0x2c($sp) -.L80284A90: -/* 1280D0 80284A90 97AB002C */ lhu $t3, 0x2c($sp) -/* 1280D4 80284A94 858C76D2 */ lh $t4, %lo(gCutsceneShotTimer)($t4) -/* 1280D8 80284A98 3C02800E */ lui $v0, %hi(D_800DC5E4) # $v0, 0x800e -/* 1280DC 80284A9C 556C000E */ bnel $t3, $t4, .L80284AD8 -/* 1280E0 80284AA0 8FBF001C */ lw $ra, 0x1c($sp) -/* 1280E4 80284AA4 9442C5E4 */ lhu $v0, %lo(D_800DC5E4)($v0) -/* 1280E8 80284AA8 3C0E8028 */ lui $t6, %hi(D_80286A04) # $t6, 0x8028 -/* 1280EC 80284AAC 25CE6A04 */ addiu $t6, %lo(D_80286A04) # addiu $t6, $t6, 0x6a04 -/* 1280F0 80284AB0 00026900 */ sll $t5, $v0, 4 -/* 1280F4 80284AB4 01AE7821 */ addu $t7, $t5, $t6 -/* 1280F8 80284AB8 91F80000 */ lbu $t8, ($t7) -/* 1280FC 80284ABC 24010002 */ li $at, 2 -/* 128100 80284AC0 0002C900 */ sll $t9, $v0, 4 -/* 128104 80284AC4 13010003 */ beq $t8, $at, .L80284AD4 -/* 128108 80284AC8 032E4021 */ addu $t0, $t9, $t6 -/* 12810C 80284ACC 0C0A009A */ jal func_80280268 -/* 128110 80284AD0 91040011 */ lbu $a0, 0x11($t0) -.L80284AD4: -/* 128114 80284AD4 8FBF001C */ lw $ra, 0x1c($sp) -.L80284AD8: -/* 128118 80284AD8 8FB00018 */ lw $s0, 0x18($sp) -/* 12811C 80284ADC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 128120 80284AE0 03E00008 */ jr $ra -/* 128124 80284AE4 00000000 */ nop diff --git a/asm/non_matchings/memory/func_802A87A8.s b/asm/non_matchings/memory/func_802A87A8.s deleted file mode 100644 index cb209c92f..000000000 --- a/asm/non_matchings/memory/func_802A87A8.s +++ /dev/null @@ -1,40 +0,0 @@ -glabel func_802A87A8 -/* 111DB8 802A87A8 00047602 */ srl $t6, $a0, 0x18 -/* 111DBC 802A87AC 000E7880 */ sll $t7, $t6, 2 -/* 111DC0 802A87B0 3C188015 */ lui $t8, %hi(gSegmentTable) -/* 111DC4 802A87B4 030FC021 */ addu $t8, $t8, $t7 -/* 111DC8 802A87B8 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 111DCC 802A87BC 8F180258 */ lw $t8, %lo(gSegmentTable)($t8) -/* 111DD0 802A87C0 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 111DD4 802A87C4 0081C824 */ and $t9, $a0, $at -/* 111DD8 802A87C8 3C038016 */ lui $v1, %hi(gPrevLoadedAddress) # $v1, 0x8016 -/* 111DDC 802A87CC 00054880 */ sll $t1, $a1, 2 -/* 111DE0 802A87D0 2463F728 */ addiu $v1, %lo(gPrevLoadedAddress) # addiu $v1, $v1, -0x8d8 -/* 111DE4 802A87D4 3C018000 */ lui $at, 0x8000 -/* 111DE8 802A87D8 01254823 */ subu $t1, $t1, $a1 -/* 111DEC 802A87DC 03192021 */ addu $a0, $t8, $t9 -/* 111DF0 802A87E0 8C620000 */ lw $v0, ($v1) -/* 111DF4 802A87E4 00812021 */ addu $a0, $a0, $at -/* 111DF8 802A87E8 000948C0 */ sll $t1, $t1, 3 -/* 111DFC 802A87EC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 111E00 802A87F0 252A000F */ addiu $t2, $t1, 0xf -/* 111E04 802A87F4 2401FFF0 */ li $at, -16 -/* 111E08 802A87F8 01415824 */ and $t3, $t2, $at -/* 111E0C 802A87FC AFBF0014 */ sw $ra, 0x14($sp) -/* 111E10 802A8800 AFA5002C */ sw $a1, 0x2c($sp) -/* 111E14 802A8804 004B6021 */ addu $t4, $v0, $t3 -/* 111E18 802A8808 AC6C0000 */ sw $t4, ($v1) -/* 111E1C 802A880C 00402825 */ move $a1, $v0 -/* 111E20 802A8810 0C010034 */ jal mio0decode -/* 111E24 802A8814 AFA20018 */ sw $v0, 0x18($sp) -/* 111E28 802A8818 8FA40018 */ lw $a0, 0x18($sp) -/* 111E2C 802A881C 0C0AA1AA */ jal func_802A86A8 -/* 111E30 802A8820 8FA5002C */ lw $a1, 0x2c($sp) -/* 111E34 802A8824 3C058016 */ lui $a1, %hi(gHeapEndPtr) # $a1, 0x8016 -/* 111E38 802A8828 8CA5F72C */ lw $a1, %lo(gHeapEndPtr)($a1) -/* 111E3C 802A882C 0C0A9EE5 */ jal set_segment_base_addr -/* 111E40 802A8830 24040004 */ li $a0, 4 -/* 111E44 802A8834 8FBF0014 */ lw $ra, 0x14($sp) -/* 111E48 802A8838 27BD0028 */ addiu $sp, $sp, 0x28 -/* 111E4C 802A883C 03E00008 */ jr $ra -/* 111E50 802A8840 00000000 */ nop diff --git a/asm/non_matchings/render_courses/load_surface_map.s b/asm/non_matchings/render_courses/load_surface_map.s deleted file mode 100644 index ec717697a..000000000 --- a/asm/non_matchings/render_courses/load_surface_map.s +++ /dev/null @@ -1,279 +0,0 @@ -glabel load_surface_map -/* 0FA3BC 80290DAC 00047602 */ srl $t6, $a0, 0x18 -/* 0FA3C0 80290DB0 000E7880 */ sll $t7, $t6, 2 -/* 0FA3C4 80290DB4 3C188015 */ lui $t8, %hi(gSegmentTable) -/* 0FA3C8 80290DB8 030FC021 */ addu $t8, $t8, $t7 -/* 0FA3CC 80290DBC 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 0FA3D0 80290DC0 8F180258 */ lw $t8, %lo(gSegmentTable)($t8) -/* 0FA3D4 80290DC4 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 0FA3D8 80290DC8 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0FA3DC 80290DCC 0081C824 */ and $t9, $a0, $at -/* 0FA3E0 80290DD0 3C0C800E */ lui $t4, %hi(gIsMirrorMode) # $t4, 0x800e -/* 0FA3E4 80290DD4 8D8CC604 */ lw $t4, %lo(gIsMirrorMode)($t4) -/* 0FA3E8 80290DD8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0FA3EC 80290DDC 3C018000 */ lui $at, 0x8000 -/* 0FA3F0 80290DE0 03195021 */ addu $t2, $t8, $t9 -/* 0FA3F4 80290DE4 8CA90008 */ lw $t1, 8($a1) -/* 0FA3F8 80290DE8 8CA60004 */ lw $a2, 4($a1) -/* 0FA3FC 80290DEC 01415821 */ addu $t3, $t2, $at -/* 0FA400 80290DF0 1180001A */ beqz $t4, .L80290E5C -/* 0FA404 80290DF4 AFAB0024 */ sw $t3, 0x24($sp) -/* 0FA408 80290DF8 94C20026 */ lhu $v0, 0x26($a2) -/* 0FA40C 80290DFC 28412000 */ slti $at, $v0, 0x2000 -/* 0FA410 80290E00 50200004 */ beql $at, $zero, .L80290E14 -/* 0FA414 80290E04 28416000 */ slti $at, $v0, 0x6000 -/* 0FA418 80290E08 1000002B */ b .L80290EB8 -/* 0FA41C 80290E0C 24070002 */ li $a3, 2 -/* 0FA420 80290E10 28416000 */ slti $at, $v0, 0x6000 -.L80290E14: -/* 0FA424 80290E14 50200004 */ beql $at, $zero, .L80290E28 -/* 0FA428 80290E18 3401A000 */ li $at, 40960 -/* 0FA42C 80290E1C 10000026 */ b .L80290EB8 -/* 0FA430 80290E20 24070003 */ li $a3, 3 -/* 0FA434 80290E24 3401A000 */ li $at, 40960 -.L80290E28: -/* 0FA438 80290E28 0041082A */ slt $at, $v0, $at -/* 0FA43C 80290E2C 50200004 */ beql $at, $zero, .L80290E40 -/* 0FA440 80290E30 3401E000 */ li $at, 57344 -/* 0FA444 80290E34 10000020 */ b .L80290EB8 -/* 0FA448 80290E38 00003825 */ move $a3, $zero -/* 0FA44C 80290E3C 3401E000 */ li $at, 57344 -.L80290E40: -/* 0FA450 80290E40 0041082A */ slt $at, $v0, $at -/* 0FA454 80290E44 10200003 */ beqz $at, .L80290E54 -/* 0FA458 80290E48 00000000 */ nop -/* 0FA45C 80290E4C 1000001A */ b .L80290EB8 -/* 0FA460 80290E50 24070001 */ li $a3, 1 -.L80290E54: -/* 0FA464 80290E54 10000018 */ b .L80290EB8 -/* 0FA468 80290E58 24070002 */ li $a3, 2 -.L80290E5C: -/* 0FA46C 80290E5C 94C20026 */ lhu $v0, 0x26($a2) -/* 0FA470 80290E60 28412000 */ slti $at, $v0, 0x2000 -/* 0FA474 80290E64 50200004 */ beql $at, $zero, .L80290E78 -/* 0FA478 80290E68 28416000 */ slti $at, $v0, 0x6000 -/* 0FA47C 80290E6C 10000012 */ b .L80290EB8 -/* 0FA480 80290E70 24070002 */ li $a3, 2 -/* 0FA484 80290E74 28416000 */ slti $at, $v0, 0x6000 -.L80290E78: -/* 0FA488 80290E78 50200004 */ beql $at, $zero, .L80290E8C -/* 0FA48C 80290E7C 3401A000 */ li $at, 40960 -/* 0FA490 80290E80 1000000D */ b .L80290EB8 -/* 0FA494 80290E84 24070001 */ li $a3, 1 -/* 0FA498 80290E88 3401A000 */ li $at, 40960 -.L80290E8C: -/* 0FA49C 80290E8C 0041082A */ slt $at, $v0, $at -/* 0FA4A0 80290E90 50200004 */ beql $at, $zero, .L80290EA4 -/* 0FA4A4 80290E94 3401E000 */ li $at, 57344 -/* 0FA4A8 80290E98 10000007 */ b .L80290EB8 -/* 0FA4AC 80290E9C 00003825 */ move $a3, $zero -/* 0FA4B0 80290EA0 3401E000 */ li $at, 57344 -.L80290EA4: -/* 0FA4B4 80290EA4 0041082A */ slt $at, $v0, $at -/* 0FA4B8 80290EA8 10200003 */ beqz $at, .L80290EB8 -/* 0FA4BC 80290EAC 24070002 */ li $a3, 2 -/* 0FA4C0 80290EB0 10000001 */ b .L80290EB8 -/* 0FA4C4 80290EB4 24070003 */ li $a3, 3 -.L80290EB8: -/* 0FA4C8 80290EB8 A4A70036 */ sh $a3, 0x36($a1) -/* 0FA4CC 80290EBC 3C0D800E */ lui $t5, %hi(camera1) # $t5, 0x800e -/* 0FA4D0 80290EC0 8DADDB40 */ lw $t5, %lo(camera1)($t5) -/* 0FA4D4 80290EC4 240100B8 */ li $at, 184 -/* 0FA4D8 80290EC8 3C198015 */ lui $t9, %hi(D_80152300) -/* 0FA4DC 80290ECC 00CD7023 */ subu $t6, $a2, $t5 -/* 0FA4E0 80290ED0 01C1001A */ div $zero, $t6, $at -/* 0FA4E4 80290ED4 00007812 */ mflo $t7 -/* 0FA4E8 80290ED8 000FC040 */ sll $t8, $t7, 1 -/* 0FA4EC 80290EDC 0338C821 */ addu $t9, $t9, $t8 -/* 0FA4F0 80290EE0 97392300 */ lhu $t9, %lo(D_80152300)($t9) -/* 0FA4F4 80290EE4 24010001 */ li $at, 1 -/* 0FA4F8 80290EE8 57210080 */ bnel $t9, $at, .L802910EC -/* 0FA4FC 80290EEC 94C4005E */ lhu $a0, 0x5e($a2) -/* 0FA500 80290EF0 94C4005E */ lhu $a0, 0x5e($a2) -/* 0FA504 80290EF4 AFA90034 */ sw $t1, 0x34($sp) -/* 0FA508 80290EF8 A7A70022 */ sh $a3, 0x22($sp) -/* 0FA50C 80290EFC AFA60030 */ sw $a2, 0x30($sp) -/* 0FA510 80290F00 0C0AAF50 */ jal func_802ABD40 -/* 0FA514 80290F04 AFA5003C */ sw $a1, 0x3c($sp) -/* 0FA518 80290F08 8FA90034 */ lw $t1, 0x34($sp) -/* 0FA51C 80290F0C 9524011A */ lhu $a0, 0x11a($t1) -/* 0FA520 80290F10 0C0AAF50 */ jal func_802ABD40 -/* 0FA524 80290F14 A7A2001E */ sh $v0, 0x1e($sp) -/* 0FA528 80290F18 87A5001E */ lh $a1, 0x1e($sp) -/* 0FA52C 80290F1C 8FA60030 */ lw $a2, 0x30($sp) -/* 0FA530 80290F20 87A70022 */ lh $a3, 0x22($sp) -/* 0FA534 80290F24 00A21823 */ subu $v1, $a1, $v0 -/* 0FA538 80290F28 00035C00 */ sll $t3, $v1, 0x10 -/* 0FA53C 80290F2C 000B6403 */ sra $t4, $t3, 0x10 -/* 0FA540 80290F30 29810002 */ slti $at, $t4, 2 -/* 0FA544 80290F34 8FA8003C */ lw $t0, 0x3c($sp) -/* 0FA548 80290F38 10200022 */ beqz $at, .L80290FC4 -/* 0FA54C 80290F3C 8FA90034 */ lw $t1, 0x34($sp) -/* 0FA550 80290F40 2981FFFF */ slti $at, $t4, -1 -/* 0FA554 80290F44 1420001F */ bnez $at, .L80290FC4 -/* 0FA558 80290F48 240300FF */ li $v1, 255 -/* 0FA55C 80290F4C 14A30011 */ bne $a1, $v1, .L80290F94 -/* 0FA560 80290F50 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0FA564 80290F54 14430003 */ bne $v0, $v1, .L80290F64 -/* 0FA568 80290F58 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0FA56C 80290F5C 10000078 */ b .L80291140 -/* 0FA570 80290F60 85040038 */ lh $a0, 0x38($t0) -.L80290F64: -/* 0FA574 80290F64 44812000 */ mtc1 $at, $f4 -/* 0FA578 80290F68 C5260124 */ lwc1 $f6, 0x124($t1) -/* 0FA57C 80290F6C 00022400 */ sll $a0, $v0, 0x10 -/* 0FA580 80290F70 00046C03 */ sra $t5, $a0, 0x10 -/* 0FA584 80290F74 4606203C */ c.lt.s $f4, $f6 -/* 0FA588 80290F78 00000000 */ nop -/* 0FA58C 80290F7C 45000003 */ bc1f .L80290F8C -/* 0FA590 80290F80 00000000 */ nop -/* 0FA594 80290F84 1000006E */ b .L80291140 -/* 0FA598 80290F88 85040038 */ lh $a0, 0x38($t0) -.L80290F8C: -/* 0FA59C 80290F8C 1000006C */ b .L80291140 -/* 0FA5A0 80290F90 01A02025 */ move $a0, $t5 -.L80290F94: -/* 0FA5A4 80290F94 44814000 */ mtc1 $at, $f8 -/* 0FA5A8 80290F98 C4CA0068 */ lwc1 $f10, 0x68($a2) -/* 0FA5AC 80290F9C 00052400 */ sll $a0, $a1, 0x10 -/* 0FA5B0 80290FA0 00047403 */ sra $t6, $a0, 0x10 -/* 0FA5B4 80290FA4 460A403C */ c.lt.s $f8, $f10 -/* 0FA5B8 80290FA8 00000000 */ nop -/* 0FA5BC 80290FAC 45000003 */ bc1f .L80290FBC -/* 0FA5C0 80290FB0 00000000 */ nop -/* 0FA5C4 80290FB4 10000062 */ b .L80291140 -/* 0FA5C8 80290FB8 85040038 */ lh $a0, 0x38($t0) -.L80290FBC: -/* 0FA5CC 80290FBC 10000060 */ b .L80291140 -/* 0FA5D0 80290FC0 01C02025 */ move $a0, $t6 -.L80290FC4: -/* 0FA5D4 80290FC4 3C03800E */ lui $v1, %hi(gCurrentCourseId) # $v1, 0x800e -/* 0FA5D8 80290FC8 8463C5A0 */ lh $v1, %lo(gCurrentCourseId)($v1) -/* 0FA5DC 80290FCC 24010001 */ li $at, 1 -/* 0FA5E0 80290FD0 1061001B */ beq $v1, $at, .L80291040 -/* 0FA5E4 80290FD4 24010002 */ li $at, 2 -/* 0FA5E8 80290FD8 14610032 */ bne $v1, $at, .L802910A4 -/* 0FA5EC 80290FDC 28410011 */ slti $at, $v0, 0x11 -/* 0FA5F0 80290FE0 14200007 */ bnez $at, .L80291000 -/* 0FA5F4 80290FE4 240300FF */ li $v1, 255 -/* 0FA5F8 80290FE8 28410018 */ slti $at, $v0, 0x18 -/* 0FA5FC 80290FEC 10200004 */ beqz $at, .L80291000 -/* 0FA600 80290FF0 00022400 */ sll $a0, $v0, 0x10 -/* 0FA604 80290FF4 00047C03 */ sra $t7, $a0, 0x10 -/* 0FA608 80290FF8 10000051 */ b .L80291140 -/* 0FA60C 80290FFC 01E02025 */ move $a0, $t7 -.L80291000: -/* 0FA610 80291000 14430006 */ bne $v0, $v1, .L8029101C -/* 0FA614 80291004 00000000 */ nop -/* 0FA618 80291008 10A30004 */ beq $a1, $v1, .L8029101C -/* 0FA61C 8029100C 00052400 */ sll $a0, $a1, 0x10 -/* 0FA620 80291010 0004C403 */ sra $t8, $a0, 0x10 -/* 0FA624 80291014 1000004A */ b .L80291140 -/* 0FA628 80291018 03002025 */ move $a0, $t8 -.L8029101C: -/* 0FA62C 8029101C 10430006 */ beq $v0, $v1, .L80291038 -/* 0FA630 80291020 00000000 */ nop -/* 0FA634 80291024 14A30004 */ bne $a1, $v1, .L80291038 -/* 0FA638 80291028 00022400 */ sll $a0, $v0, 0x10 -/* 0FA63C 8029102C 0004CC03 */ sra $t9, $a0, 0x10 -/* 0FA640 80291030 10000043 */ b .L80291140 -/* 0FA644 80291034 03202025 */ move $a0, $t9 -.L80291038: -/* 0FA648 80291038 10000041 */ b .L80291140 -/* 0FA64C 8029103C 85040038 */ lh $a0, 0x38($t0) -.L80291040: -/* 0FA650 80291040 2841000E */ slti $at, $v0, 0xe -/* 0FA654 80291044 14200007 */ bnez $at, .L80291064 -/* 0FA658 80291048 240300FF */ li $v1, 255 -/* 0FA65C 8029104C 28410016 */ slti $at, $v0, 0x16 -/* 0FA660 80291050 10200004 */ beqz $at, .L80291064 -/* 0FA664 80291054 00022400 */ sll $a0, $v0, 0x10 -/* 0FA668 80291058 00045403 */ sra $t2, $a0, 0x10 -/* 0FA66C 8029105C 10000038 */ b .L80291140 -/* 0FA670 80291060 01402025 */ move $a0, $t2 -.L80291064: -/* 0FA674 80291064 14430006 */ bne $v0, $v1, .L80291080 -/* 0FA678 80291068 00000000 */ nop -/* 0FA67C 8029106C 10A30004 */ beq $a1, $v1, .L80291080 -/* 0FA680 80291070 00052400 */ sll $a0, $a1, 0x10 -/* 0FA684 80291074 00045C03 */ sra $t3, $a0, 0x10 -/* 0FA688 80291078 10000031 */ b .L80291140 -/* 0FA68C 8029107C 01602025 */ move $a0, $t3 -.L80291080: -/* 0FA690 80291080 10430006 */ beq $v0, $v1, .L8029109C -/* 0FA694 80291084 00000000 */ nop -/* 0FA698 80291088 14A30004 */ bne $a1, $v1, .L8029109C -/* 0FA69C 8029108C 00022400 */ sll $a0, $v0, 0x10 -/* 0FA6A0 80291090 00046403 */ sra $t4, $a0, 0x10 -/* 0FA6A4 80291094 1000002A */ b .L80291140 -/* 0FA6A8 80291098 01802025 */ move $a0, $t4 -.L8029109C: -/* 0FA6AC 8029109C 10000028 */ b .L80291140 -/* 0FA6B0 802910A0 85040038 */ lh $a0, 0x38($t0) -.L802910A4: -/* 0FA6B4 802910A4 240300FF */ li $v1, 255 -/* 0FA6B8 802910A8 14430003 */ bne $v0, $v1, .L802910B8 -/* 0FA6BC 802910AC 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0FA6C0 802910B0 10000023 */ b .L80291140 -/* 0FA6C4 802910B4 85040038 */ lh $a0, 0x38($t0) -.L802910B8: -/* 0FA6C8 802910B8 44818000 */ mtc1 $at, $f16 -/* 0FA6CC 802910BC C5320124 */ lwc1 $f18, 0x124($t1) -/* 0FA6D0 802910C0 00022400 */ sll $a0, $v0, 0x10 -/* 0FA6D4 802910C4 00046C03 */ sra $t5, $a0, 0x10 -/* 0FA6D8 802910C8 4612803C */ c.lt.s $f16, $f18 -/* 0FA6DC 802910CC 00000000 */ nop -/* 0FA6E0 802910D0 45000003 */ bc1f .L802910E0 -/* 0FA6E4 802910D4 00000000 */ nop -/* 0FA6E8 802910D8 10000019 */ b .L80291140 -/* 0FA6EC 802910DC 85040038 */ lh $a0, 0x38($t0) -.L802910E0: -/* 0FA6F0 802910E0 10000017 */ b .L80291140 -/* 0FA6F4 802910E4 01A02025 */ move $a0, $t5 -/* 0FA6F8 802910E8 94C4005E */ lhu $a0, 0x5e($a2) -.L802910EC: -/* 0FA6FC 802910EC A7A70022 */ sh $a3, 0x22($sp) -/* 0FA700 802910F0 AFA60030 */ sw $a2, 0x30($sp) -/* 0FA704 802910F4 0C0AAF50 */ jal func_802ABD40 -/* 0FA708 802910F8 AFA5003C */ sw $a1, 0x3c($sp) -/* 0FA70C 802910FC 8FA60030 */ lw $a2, 0x30($sp) -/* 0FA710 80291100 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0FA714 80291104 44812000 */ mtc1 $at, $f4 -/* 0FA718 80291108 C4C60068 */ lwc1 $f6, 0x68($a2) -/* 0FA71C 8029110C 00022400 */ sll $a0, $v0, 0x10 -/* 0FA720 80291110 00047403 */ sra $t6, $a0, 0x10 -/* 0FA724 80291114 4606203C */ c.lt.s $f4, $f6 -/* 0FA728 80291118 01C02025 */ move $a0, $t6 -/* 0FA72C 8029111C 87A70022 */ lh $a3, 0x22($sp) -/* 0FA730 80291120 8FA8003C */ lw $t0, 0x3c($sp) -/* 0FA734 80291124 45000003 */ bc1f .L80291134 -/* 0FA738 80291128 240300FF */ li $v1, 255 -/* 0FA73C 8029112C 10000004 */ b .L80291140 -/* 0FA740 80291130 85040038 */ lh $a0, 0x38($t0) -.L80291134: -/* 0FA744 80291134 14430002 */ bne $v0, $v1, .L80291140 -/* 0FA748 80291138 00000000 */ nop -/* 0FA74C 8029113C 85040038 */ lh $a0, 0x38($t0) -.L80291140: -/* 0FA750 80291140 3C058015 */ lui $a1, %hi(gDisplayListHead) # $a1, 0x8015 -/* 0FA754 80291144 24A50298 */ addiu $a1, %lo(gDisplayListHead) # addiu $a1, $a1, 0x298 -/* 0FA758 80291148 A5040038 */ sh $a0, 0x38($t0) -/* 0FA75C 8029114C 8CA30000 */ lw $v1, ($a1) -/* 0FA760 80291150 00047880 */ sll $t7, $a0, 2 -/* 0FA764 80291154 01E72021 */ addu $a0, $t7, $a3 -/* 0FA768 80291158 246A0008 */ addiu $t2, $v1, 8 -/* 0FA76C 8029115C ACAA0000 */ sw $t2, ($a1) -/* 0FA770 80291160 3C0B0600 */ lui $t3, 0x600 -/* 0FA774 80291164 2484FFFC */ addiu $a0, $a0, -4 -/* 0FA778 80291168 AC6B0000 */ sw $t3, ($v1) -/* 0FA77C 8029116C 8FAC0024 */ lw $t4, 0x24($sp) -/* 0FA780 80291170 0004C400 */ sll $t8, $a0, 0x10 -/* 0FA784 80291174 0018CC03 */ sra $t9, $t8, 0x10 -/* 0FA788 80291178 00196880 */ sll $t5, $t9, 2 -/* 0FA78C 8029117C 018D7021 */ addu $t6, $t4, $t5 -/* 0FA790 80291180 8DCF0000 */ lw $t7, ($t6) -/* 0FA794 80291184 AC6F0004 */ sw $t7, 4($v1) -/* 0FA798 80291188 8FBF0014 */ lw $ra, 0x14($sp) -/* 0FA79C 8029118C 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0FA7A0 80291190 03E00008 */ jr $ra -/* 0FA7A4 80291194 00000000 */ nop diff --git a/asm/non_matchings/render_courses/render_moo_moo_farm.s b/asm/non_matchings/render_courses/render_moo_moo_farm.s deleted file mode 100644 index 0b32de2d9..000000000 --- a/asm/non_matchings/render_courses/render_moo_moo_farm.s +++ /dev/null @@ -1,331 +0,0 @@ -glabel render_moo_moo_farm -/* 0FD54C 80293F3C 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0FD550 80293F40 AFBF001C */ sw $ra, 0x1c($sp) -/* 0FD554 80293F44 AFB10018 */ sw $s1, 0x18($sp) -/* 0FD558 80293F48 AFB00014 */ sw $s0, 0x14($sp) -/* 0FD55C 80293F4C AFA400C0 */ sw $a0, 0xc0($sp) -/* 0FD560 80293F50 84900038 */ lh $s0, 0x38($a0) -/* 0FD564 80293F54 84910036 */ lh $s1, 0x36($a0) -/* 0FD568 80293F58 3C04800E */ lui $a0, %hi(D_800DC610) # $a0, 0x800e -/* 0FD56C 80293F5C 3C05802C */ lui $a1, %hi(D_802B87D4) # $a1, 0x802c -/* 0FD570 80293F60 84A587D4 */ lh $a1, %lo(D_802B87D4)($a1) -/* 0FD574 80293F64 2484C610 */ addiu $a0, %lo(D_800DC610) # addiu $a0, $a0, -0x39f0 -/* 0FD578 80293F68 00003025 */ move $a2, $zero -/* 0FD57C 80293F6C 0C0AD759 */ jal func_802B5D64 -/* 0FD580 80293F70 24070001 */ li $a3, 1 -/* 0FD584 80293F74 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0FD588 80293F78 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0FD58C 80293F7C 8C620000 */ lw $v0, ($v1) -/* 0FD590 80293F80 3C18BB00 */ lui $t8, (0xBB000001 >> 16) # lui $t8, 0xbb00 -/* 0FD594 80293F84 37180001 */ ori $t8, (0xBB000001 & 0xFFFF) # ori $t8, $t8, 1 -/* 0FD598 80293F88 244F0008 */ addiu $t7, $v0, 8 -/* 0FD59C 80293F8C AC6F0000 */ sw $t7, ($v1) -/* 0FD5A0 80293F90 2419FFFF */ li $t9, -1 -/* 0FD5A4 80293F94 AC590004 */ sw $t9, 4($v0) -/* 0FD5A8 80293F98 AC580000 */ sw $t8, ($v0) -/* 0FD5AC 80293F9C 00403025 */ move $a2, $v0 -/* 0FD5B0 80293FA0 8C620000 */ lw $v0, ($v1) -/* 0FD5B4 80293FA4 24180200 */ li $t8, 512 -/* 0FD5B8 80293FA8 3C0FB700 */ lui $t7, 0xb700 -/* 0FD5BC 80293FAC 244E0008 */ addiu $t6, $v0, 8 -/* 0FD5C0 80293FB0 AC6E0000 */ sw $t6, ($v1) -/* 0FD5C4 80293FB4 AC4F0000 */ sw $t7, ($v0) -/* 0FD5C8 80293FB8 AC580004 */ sw $t8, 4($v0) -/* 0FD5CC 80293FBC 00403825 */ move $a3, $v0 -/* 0FD5D0 80293FC0 8C620000 */ lw $v0, ($v1) -/* 0FD5D4 80293FC4 3C0F0002 */ lui $t7, 2 -/* 0FD5D8 80293FC8 3C0EB600 */ lui $t6, 0xb600 -/* 0FD5DC 80293FCC 24590008 */ addiu $t9, $v0, 8 -/* 0FD5E0 80293FD0 AC790000 */ sw $t9, ($v1) -/* 0FD5E4 80293FD4 AC4E0000 */ sw $t6, ($v0) -/* 0FD5E8 80293FD8 AC4F0004 */ sw $t7, 4($v0) -/* 0FD5EC 80293FDC 00404025 */ move $t0, $v0 -/* 0FD5F0 80293FE0 8C620000 */ lw $v0, ($v1) -/* 0FD5F4 80293FE4 3C19FC12 */ lui $t9, (0xFC127E24 >> 16) # lui $t9, 0xfc12 -/* 0FD5F8 80293FE8 37397E24 */ ori $t9, (0xFC127E24 & 0xFFFF) # ori $t9, $t9, 0x7e24 -/* 0FD5FC 80293FEC 24580008 */ addiu $t8, $v0, 8 -/* 0FD600 80293FF0 AC780000 */ sw $t8, ($v1) -/* 0FD604 80293FF4 240EF9FC */ li $t6, -1540 -/* 0FD608 80293FF8 AC4E0004 */ sw $t6, 4($v0) -/* 0FD60C 80293FFC AC590000 */ sw $t9, ($v0) -/* 0FD610 80294000 00404825 */ move $t1, $v0 -/* 0FD614 80294004 8C620000 */ lw $v0, ($v1) -/* 0FD618 80294008 3C190055 */ lui $t9, (0x00552078 >> 16) # lui $t9, 0x55 -/* 0FD61C 8029400C 3C18B900 */ lui $t8, (0xB900031D >> 16) # lui $t8, 0xb900 -/* 0FD620 80294010 244F0008 */ addiu $t7, $v0, 8 -/* 0FD624 80294014 AC6F0000 */ sw $t7, ($v1) -/* 0FD628 80294018 3718031D */ ori $t8, (0xB900031D & 0xFFFF) # ori $t8, $t8, 0x31d -/* 0FD62C 8029401C 37392078 */ ori $t9, (0x00552078 & 0xFFFF) # ori $t9, $t9, 0x2078 -/* 0FD630 80294020 AC590004 */ sw $t9, 4($v0) -/* 0FD634 80294024 AC580000 */ sw $t8, ($v0) -/* 0FD638 80294028 00405025 */ move $t2, $v0 -/* 0FD63C 8029402C 8C620000 */ lw $v0, ($v1) -/* 0FD640 80294030 3C180700 */ lui $t8, (0x07004DF8 >> 16) # lui $t8, 0x700 -/* 0FD644 80294034 37184DF8 */ ori $t8, (0x07004DF8 & 0xFFFF) # ori $t8, $t8, 0x4df8 -/* 0FD648 80294038 244E0008 */ addiu $t6, $v0, 8 -/* 0FD64C 8029403C AC6E0000 */ sw $t6, ($v1) -/* 0FD650 80294040 3C0F0600 */ lui $t7, 0x600 -/* 0FD654 80294044 AC4F0000 */ sw $t7, ($v0) -/* 0FD658 80294048 AC580004 */ sw $t8, 4($v0) -/* 0FD65C 8029404C 00405825 */ move $t3, $v0 -/* 0FD660 80294050 8C620000 */ lw $v0, ($v1) -/* 0FD664 80294054 3C0F0700 */ lui $t7, (0x07005640 >> 16) # lui $t7, 0x700 -/* 0FD668 80294058 35EF5640 */ ori $t7, (0x07005640 & 0xFFFF) # ori $t7, $t7, 0x5640 -/* 0FD66C 8029405C 24590008 */ addiu $t9, $v0, 8 -/* 0FD670 80294060 AC790000 */ sw $t9, ($v1) -/* 0FD674 80294064 3C0E0600 */ lui $t6, 0x600 -/* 0FD678 80294068 AC4E0000 */ sw $t6, ($v0) -/* 0FD67C 8029406C AC4F0004 */ sw $t7, 4($v0) -/* 0FD680 80294070 00406025 */ move $t4, $v0 -/* 0FD684 80294074 8C620000 */ lw $v0, ($v1) -/* 0FD688 80294078 3C19BC00 */ lui $t9, (0xBC000008 >> 16) # lui $t9, 0xbc00 -/* 0FD68C 8029407C 37390008 */ ori $t9, (0xBC000008 & 0xFFFF) # ori $t9, $t9, 8 -/* 0FD690 80294080 24580008 */ addiu $t8, $v0, 8 -/* 0FD694 80294084 AC780000 */ sw $t8, ($v1) -/* 0FD698 80294088 3C1F802C */ lui $ra, %hi(D_802B87B0) # $ra, 0x802c -/* 0FD69C 8029408C AC590000 */ sw $t9, ($v0) -/* 0FD6A0 80294090 87FF87B0 */ lh $ra, %lo(D_802B87B0)($ra) -/* 0FD6A4 80294094 3C0E802C */ lui $t6, %hi(D_802B87B4) # $t6, 0x802c -/* 0FD6A8 80294098 85CE87B4 */ lh $t6, %lo(D_802B87B4)($t6) -/* 0FD6AC 8029409C 3C010001 */ lui $at, (0x0001F400 >> 16) # lui $at, 1 -/* 0FD6B0 802940A0 001FC023 */ negu $t8, $ra -/* 0FD6B4 802940A4 0018CA00 */ sll $t9, $t8, 8 -/* 0FD6B8 802940A8 3421F400 */ ori $at, (0x0001F400 & 0xFFFF) # ori $at, $at, 0xf400 -/* 0FD6BC 802940AC 01DF7823 */ subu $t7, $t6, $ra -/* 0FD6C0 802940B0 03217021 */ addu $t6, $t9, $at -/* 0FD6C4 802940B4 01CF001A */ div $zero, $t6, $t7 -/* 0FD6C8 802940B8 0000C012 */ mflo $t8 -/* 0FD6CC 802940BC AFAF0024 */ sw $t7, 0x24($sp) -/* 0FD6D0 802940C0 3319FFFF */ andi $t9, $t8, 0xffff -/* 0FD6D4 802940C4 00406825 */ move $t5, $v0 -/* 0FD6D8 802940C8 15E00002 */ bnez $t7, .L802940D4 -/* 0FD6DC 802940CC 00000000 */ nop -/* 0FD6E0 802940D0 0007000D */ break 7 -.L802940D4: -/* 0FD6E4 802940D4 2401FFFF */ li $at, -1 -/* 0FD6E8 802940D8 15E10004 */ bne $t7, $at, .L802940EC -/* 0FD6EC 802940DC 3C018000 */ lui $at, 0x8000 -/* 0FD6F0 802940E0 15C10002 */ bne $t6, $at, .L802940EC -/* 0FD6F4 802940E4 00000000 */ nop -/* 0FD6F8 802940E8 0006000D */ break 6 -.L802940EC: -/* 0FD6FC 802940EC 3C0E0001 */ lui $t6, (0x0001F400 >> 16) # lui $t6, 1 -/* 0FD700 802940F0 35CEF400 */ ori $t6, (0x0001F400 & 0xFFFF) # ori $t6, $t6, 0xf400 -/* 0FD704 802940F4 01CF001A */ div $zero, $t6, $t7 -/* 0FD708 802940F8 15E00002 */ bnez $t7, .L80294104 -/* 0FD70C 802940FC 00000000 */ nop -/* 0FD710 80294100 0007000D */ break 7 -.L80294104: -/* 0FD714 80294104 2401FFFF */ li $at, -1 -/* 0FD718 80294108 15E10004 */ bne $t7, $at, .L8029411C -/* 0FD71C 8029410C 3C018000 */ lui $at, 0x8000 -/* 0FD720 80294110 15C10002 */ bne $t6, $at, .L8029411C -/* 0FD724 80294114 00000000 */ nop -/* 0FD728 80294118 0006000D */ break 6 -.L8029411C: -/* 0FD72C 8029411C 00007012 */ mflo $t6 -/* 0FD730 80294120 000E7C00 */ sll $t7, $t6, 0x10 -/* 0FD734 80294124 01F9C025 */ or $t8, $t7, $t9 -/* 0FD738 80294128 ADB80004 */ sw $t8, 4($t5) -/* 0FD73C 8029412C 3C040900 */ lui $a0, %hi(moo_moo_farm_dls) # $a0, 0x900 -/* 0FD740 80294130 248401D0 */ addiu $a0, %lo(moo_moo_farm_dls) # addiu $a0, $a0, 0x1d0 -/* 0FD744 80294134 0C0A436B */ jal load_surface_map -/* 0FD748 80294138 8FA500C0 */ lw $a1, 0xc0($sp) -/* 0FD74C 8029413C 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015 -/* 0FD750 80294140 3C08FC12 */ lui $t0, (0xFC127E24 >> 16) # lui $t0, 0xfc12 -/* 0FD754 80294144 3C09B900 */ lui $t1, (0xB900031D >> 16) # lui $t1, 0xb900 -/* 0FD758 80294148 2A01000E */ slti $at, $s0, 0xe -/* 0FD75C 8029414C 3529031D */ ori $t1, (0xB900031D & 0xFFFF) # ori $t1, $t1, 0x31d -/* 0FD760 80294150 35087E24 */ ori $t0, (0xFC127E24 & 0xFFFF) # ori $t0, $t0, 0x7e24 -/* 0FD764 80294154 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298 -/* 0FD768 80294158 10200012 */ beqz $at, .L802941A4 -/* 0FD76C 8029415C 3C070600 */ lui $a3, 0x600 -/* 0FD770 80294160 2A01000B */ slti $at, $s0, 0xb -/* 0FD774 80294164 1420000F */ bnez $at, .L802941A4 -/* 0FD778 80294168 24060002 */ li $a2, 2 -/* 0FD77C 8029416C 12260005 */ beq $s1, $a2, .L80294184 -/* 0FD780 80294170 24010003 */ li $at, 3 -/* 0FD784 80294174 12210003 */ beq $s1, $at, .L80294184 -/* 0FD788 80294178 24010001 */ li $at, 1 -/* 0FD78C 8029417C 5621002E */ bnel $s1, $at, .L80294238 -/* 0FD790 80294180 8C620000 */ lw $v0, ($v1) -.L80294184: -/* 0FD794 80294184 8C620000 */ lw $v0, ($v1) -/* 0FD798 80294188 3C0F0601 */ lui $t7, %hi(D_06013FF8) # $t7, 0x601 -/* 0FD79C 8029418C 25EF3FF8 */ addiu $t7, %lo(D_06013FF8) # addiu $t7, $t7, 0x3ff8 -/* 0FD7A0 80294190 244E0008 */ addiu $t6, $v0, 8 -/* 0FD7A4 80294194 AC6E0000 */ sw $t6, ($v1) -/* 0FD7A8 80294198 AC4F0004 */ sw $t7, 4($v0) -/* 0FD7AC 8029419C 10000025 */ b .L80294234 -/* 0FD7B0 802941A0 AC470000 */ sw $a3, ($v0) -.L802941A4: -/* 0FD7B4 802941A4 2A010010 */ slti $at, $s0, 0x10 -/* 0FD7B8 802941A8 5020000A */ beql $at, $zero, .L802941D4 -/* 0FD7BC 802941AC 2A010013 */ slti $at, $s0, 0x13 -/* 0FD7C0 802941B0 8C620000 */ lw $v0, ($v1) -/* 0FD7C4 802941B4 3C180601 */ lui $t8, %hi(D_06013FF8) # $t8, 0x601 -/* 0FD7C8 802941B8 27183FF8 */ addiu $t8, %lo(D_06013FF8) # addiu $t8, $t8, 0x3ff8 -/* 0FD7CC 802941BC 24590008 */ addiu $t9, $v0, 8 -/* 0FD7D0 802941C0 AC790000 */ sw $t9, ($v1) -/* 0FD7D4 802941C4 AC580004 */ sw $t8, 4($v0) -/* 0FD7D8 802941C8 1000001A */ b .L80294234 -/* 0FD7DC 802941CC AC470000 */ sw $a3, ($v0) -/* 0FD7E0 802941D0 2A010013 */ slti $at, $s0, 0x13 -.L802941D4: -/* 0FD7E4 802941D4 1020000B */ beqz $at, .L80294204 -/* 0FD7E8 802941D8 24060002 */ li $a2, 2 -/* 0FD7EC 802941DC 52260016 */ beql $s1, $a2, .L80294238 -/* 0FD7F0 802941E0 8C620000 */ lw $v0, ($v1) -/* 0FD7F4 802941E4 8C620000 */ lw $v0, ($v1) -/* 0FD7F8 802941E8 3C0F0601 */ lui $t7, %hi(D_06013FF8) # $t7, 0x601 -/* 0FD7FC 802941EC 25EF3FF8 */ addiu $t7, %lo(D_06013FF8) # addiu $t7, $t7, 0x3ff8 -/* 0FD800 802941F0 244E0008 */ addiu $t6, $v0, 8 -/* 0FD804 802941F4 AC6E0000 */ sw $t6, ($v1) -/* 0FD808 802941F8 AC4F0004 */ sw $t7, 4($v0) -/* 0FD80C 802941FC 1000000D */ b .L80294234 -/* 0FD810 80294200 AC470000 */ sw $a3, ($v0) -.L80294204: -/* 0FD814 80294204 2A010014 */ slti $at, $s0, 0x14 -/* 0FD818 80294208 5020000B */ beql $at, $zero, .L80294238 -/* 0FD81C 8029420C 8C620000 */ lw $v0, ($v1) -/* 0FD820 80294210 56200009 */ bnel $s1, $zero, .L80294238 -/* 0FD824 80294214 8C620000 */ lw $v0, ($v1) -/* 0FD828 80294218 8C620000 */ lw $v0, ($v1) -/* 0FD82C 8029421C 3C180601 */ lui $t8, %hi(D_06013FF8) # $t8, 0x601 -/* 0FD830 80294220 27183FF8 */ addiu $t8, %lo(D_06013FF8) # addiu $t8, $t8, 0x3ff8 -/* 0FD834 80294224 24590008 */ addiu $t9, $v0, 8 -/* 0FD838 80294228 AC790000 */ sw $t9, ($v1) -/* 0FD83C 8029422C AC580004 */ sw $t8, 4($v0) -/* 0FD840 80294230 AC470000 */ sw $a3, ($v0) -.L80294234: -/* 0FD844 80294234 8C620000 */ lw $v0, ($v1) -.L80294238: -/* 0FD848 80294238 240FF9FC */ li $t7, -1540 -/* 0FD84C 8029423C 3C180055 */ lui $t8, (0x00552078 >> 16) # lui $t8, 0x55 -/* 0FD850 80294240 244E0008 */ addiu $t6, $v0, 8 -/* 0FD854 80294244 AC6E0000 */ sw $t6, ($v1) -/* 0FD858 80294248 AC4F0004 */ sw $t7, 4($v0) -/* 0FD85C 8029424C AC480000 */ sw $t0, ($v0) -/* 0FD860 80294250 8C620000 */ lw $v0, ($v1) -/* 0FD864 80294254 37182078 */ ori $t8, (0x00552078 & 0xFFFF) # ori $t8, $t8, 0x2078 -/* 0FD868 80294258 2A010010 */ slti $at, $s0, 0x10 -/* 0FD86C 8029425C 24590008 */ addiu $t9, $v0, 8 -/* 0FD870 80294260 AC790000 */ sw $t9, ($v1) -/* 0FD874 80294264 24060002 */ li $a2, 2 -/* 0FD878 80294268 AC580004 */ sw $t8, 4($v0) -/* 0FD87C 8029426C 14200010 */ bnez $at, .L802942B0 -/* 0FD880 80294270 AC490000 */ sw $t1, ($v0) -/* 0FD884 80294274 2A010018 */ slti $at, $s0, 0x18 -/* 0FD888 80294278 5020000E */ beql $at, $zero, .L802942B4 -/* 0FD88C 8029427C 2A010009 */ slti $at, $s0, 9 -/* 0FD890 80294280 12260003 */ beq $s1, $a2, .L80294290 -/* 0FD894 80294284 24010003 */ li $at, 3 -/* 0FD898 80294288 56210016 */ bnel $s1, $at, .L802942E4 -/* 0FD89C 8029428C 2A010004 */ slti $at, $s0, 4 -.L80294290: -/* 0FD8A0 80294290 8C620000 */ lw $v0, ($v1) -/* 0FD8A4 80294294 3C0F0700 */ lui $t7, (0x07005410 >> 16) # lui $t7, 0x700 -/* 0FD8A8 80294298 35EF5410 */ ori $t7, (0x07005410 & 0xFFFF) # ori $t7, $t7, 0x5410 -/* 0FD8AC 8029429C 244E0008 */ addiu $t6, $v0, 8 -/* 0FD8B0 802942A0 AC6E0000 */ sw $t6, ($v1) -/* 0FD8B4 802942A4 AC4F0004 */ sw $t7, 4($v0) -/* 0FD8B8 802942A8 1000000D */ b .L802942E0 -/* 0FD8BC 802942AC AC470000 */ sw $a3, ($v0) -.L802942B0: -/* 0FD8C0 802942B0 2A010009 */ slti $at, $s0, 9 -.L802942B4: -/* 0FD8C4 802942B4 5020000B */ beql $at, $zero, .L802942E4 -/* 0FD8C8 802942B8 2A010004 */ slti $at, $s0, 4 -/* 0FD8CC 802942BC 56260009 */ bnel $s1, $a2, .L802942E4 -/* 0FD8D0 802942C0 2A010004 */ slti $at, $s0, 4 -/* 0FD8D4 802942C4 8C620000 */ lw $v0, ($v1) -/* 0FD8D8 802942C8 3C180700 */ lui $t8, (0x07005410 >> 16) # lui $t8, 0x700 -/* 0FD8DC 802942CC 37185410 */ ori $t8, (0x07005410 & 0xFFFF) # ori $t8, $t8, 0x5410 -/* 0FD8E0 802942D0 24590008 */ addiu $t9, $v0, 8 -/* 0FD8E4 802942D4 AC790000 */ sw $t9, ($v1) -/* 0FD8E8 802942D8 AC580004 */ sw $t8, 4($v0) -/* 0FD8EC 802942DC AC470000 */ sw $a3, ($v0) -.L802942E0: -/* 0FD8F0 802942E0 2A010004 */ slti $at, $s0, 4 -.L802942E4: -/* 0FD8F4 802942E4 5020000C */ beql $at, $zero, .L80294318 -/* 0FD8F8 802942E8 2A010008 */ slti $at, $s0, 8 -/* 0FD8FC 802942EC 52200030 */ beql $s1, $zero, .L802943B0 -/* 0FD900 802942F0 8C620000 */ lw $v0, ($v1) -/* 0FD904 802942F4 8C620000 */ lw $v0, ($v1) -/* 0FD908 802942F8 3C0F0601 */ lui $t7, %hi(D_06014060) # $t7, 0x601 -/* 0FD90C 802942FC 25EF4060 */ addiu $t7, %lo(D_06014060) # addiu $t7, $t7, 0x4060 -/* 0FD910 80294300 244E0008 */ addiu $t6, $v0, 8 -/* 0FD914 80294304 AC6E0000 */ sw $t6, ($v1) -/* 0FD918 80294308 AC4F0004 */ sw $t7, 4($v0) -/* 0FD91C 8029430C 10000027 */ b .L802943AC -/* 0FD920 80294310 AC470000 */ sw $a3, ($v0) -/* 0FD924 80294314 2A010008 */ slti $at, $s0, 8 -.L80294318: -/* 0FD928 80294318 5020000C */ beql $at, $zero, .L8029434C -/* 0FD92C 8029431C 2A010016 */ slti $at, $s0, 0x16 -/* 0FD930 80294320 56260023 */ bnel $s1, $a2, .L802943B0 -/* 0FD934 80294324 8C620000 */ lw $v0, ($v1) -/* 0FD938 80294328 8C620000 */ lw $v0, ($v1) -/* 0FD93C 8029432C 3C180601 */ lui $t8, %hi(D_06014060) # $t8, 0x601 -/* 0FD940 80294330 27184060 */ addiu $t8, %lo(D_06014060) # addiu $t8, $t8, 0x4060 -/* 0FD944 80294334 24590008 */ addiu $t9, $v0, 8 -/* 0FD948 80294338 AC790000 */ sw $t9, ($v1) -/* 0FD94C 8029433C AC580004 */ sw $t8, 4($v0) -/* 0FD950 80294340 1000001A */ b .L802943AC -/* 0FD954 80294344 AC470000 */ sw $a3, ($v0) -/* 0FD958 80294348 2A010016 */ slti $at, $s0, 0x16 -.L8029434C: -/* 0FD95C 8029434C 5420000A */ bnel $at, $zero, .L80294378 -/* 0FD960 80294350 2A010012 */ slti $at, $s0, 0x12 -/* 0FD964 80294354 8C620000 */ lw $v0, ($v1) -/* 0FD968 80294358 3C0F0601 */ lui $t7, %hi(D_06014060) # $t7, 0x601 -/* 0FD96C 8029435C 25EF4060 */ addiu $t7, %lo(D_06014060) # addiu $t7, $t7, 0x4060 -/* 0FD970 80294360 244E0008 */ addiu $t6, $v0, 8 -/* 0FD974 80294364 AC6E0000 */ sw $t6, ($v1) -/* 0FD978 80294368 AC4F0004 */ sw $t7, 4($v0) -/* 0FD97C 8029436C 1000000F */ b .L802943AC -/* 0FD980 80294370 AC470000 */ sw $a3, ($v0) -/* 0FD984 80294374 2A010012 */ slti $at, $s0, 0x12 -.L80294378: -/* 0FD988 80294378 5420000D */ bnel $at, $zero, .L802943B0 -/* 0FD98C 8029437C 8C620000 */ lw $v0, ($v1) -/* 0FD990 80294380 12200003 */ beqz $s1, .L80294390 -/* 0FD994 80294384 24010003 */ li $at, 3 -/* 0FD998 80294388 56210009 */ bnel $s1, $at, .L802943B0 -/* 0FD99C 8029438C 8C620000 */ lw $v0, ($v1) -.L80294390: -/* 0FD9A0 80294390 8C620000 */ lw $v0, ($v1) -/* 0FD9A4 80294394 3C180601 */ lui $t8, %hi(D_06014060) # $t8, 0x601 -/* 0FD9A8 80294398 27184060 */ addiu $t8, %lo(D_06014060) # addiu $t8, $t8, 0x4060 -/* 0FD9AC 8029439C 24590008 */ addiu $t9, $v0, 8 -/* 0FD9B0 802943A0 AC790000 */ sw $t9, ($v1) -/* 0FD9B4 802943A4 AC580004 */ sw $t8, 4($v0) -/* 0FD9B8 802943A8 AC470000 */ sw $a3, ($v0) -.L802943AC: -/* 0FD9BC 802943AC 8C620000 */ lw $v0, ($v1) -.L802943B0: -/* 0FD9C0 802943B0 240FF3F9 */ li $t7, -3079 -/* 0FD9C4 802943B4 3C180055 */ lui $t8, (0x00553078 >> 16) # lui $t8, 0x55 -/* 0FD9C8 802943B8 244E0008 */ addiu $t6, $v0, 8 -/* 0FD9CC 802943BC AC6E0000 */ sw $t6, ($v1) -/* 0FD9D0 802943C0 AC4F0004 */ sw $t7, 4($v0) -/* 0FD9D4 802943C4 AC480000 */ sw $t0, ($v0) -/* 0FD9D8 802943C8 8C620000 */ lw $v0, ($v1) -/* 0FD9DC 802943CC 37183078 */ ori $t8, (0x00553078 & 0xFFFF) # ori $t8, $t8, 0x3078 -/* 0FD9E0 802943D0 3C0F0700 */ lui $t7, (0x070010C0 >> 16) # lui $t7, 0x700 -/* 0FD9E4 802943D4 24590008 */ addiu $t9, $v0, 8 -/* 0FD9E8 802943D8 AC790000 */ sw $t9, ($v1) -/* 0FD9EC 802943DC AC580004 */ sw $t8, 4($v0) -/* 0FD9F0 802943E0 AC490000 */ sw $t1, ($v0) -/* 0FD9F4 802943E4 8C620000 */ lw $v0, ($v1) -/* 0FD9F8 802943E8 35EF10C0 */ ori $t7, (0x070010C0 & 0xFFFF) # ori $t7, $t7, 0x10c0 -/* 0FD9FC 802943EC 244E0008 */ addiu $t6, $v0, 8 -/* 0FDA00 802943F0 AC6E0000 */ sw $t6, ($v1) -/* 0FDA04 802943F4 AC4F0004 */ sw $t7, 4($v0) -/* 0FDA08 802943F8 AC470000 */ sw $a3, ($v0) -/* 0FDA0C 802943FC 8FBF001C */ lw $ra, 0x1c($sp) -/* 0FDA10 80294400 8FB10018 */ lw $s1, 0x18($sp) -/* 0FDA14 80294404 8FB00014 */ lw $s0, 0x14($sp) -/* 0FDA18 80294408 03E00008 */ jr $ra -/* 0FDA1C 8029440C 27BD00C0 */ addiu $sp, $sp, 0xc0 diff --git a/data/data_121DA0.s b/data/data_121DA0.s deleted file mode 100644 index 2f32c118c..000000000 --- a/data/data_121DA0.s +++ /dev/null @@ -1,44 +0,0 @@ -# Mario Kart 64 (U) disassembly and split file -# generated by n64split v0.4a - N64 ROM splitter - -.include "macros.inc" - -.section .data - -glabel gFloatArray802B8790 -.float 1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3 - -glabel D_802B87B0 -.hword 995 -.hword 0 # fill - -glabel D_802B87B4 -.hword 1000 -.hword 0 # fill - -.word 0 # fill - -glabel D_802B87BC -.word 0 - -.word 0 # fill - -glabel D_802B87C4 -.word 0 - -glabel D_802B87C8 -.word 0 - -glabel D_802B87CC -.word 0 - -glabel D_802B87D0 -.hword 0 -.hword 0 # fill - -glabel D_802B87D4 -.hword 0 -.hword 0 # fill - -glabel D_802B87D8 -.hword 0 diff --git a/diff b/diff index 854a8c72d..8a901541c 100755 --- a/diff +++ b/diff @@ -1,3 +1,6 @@ #!/bin/bash +# note, this quick hack only works with five arguments. +# if you're trying to use six arguments, you need to add another `$6` etc. + python3 tools/asm-differ/diff.py $1 $2 $3 $4 $5 diff --git a/import b/import index 1468fd6af..73ba30c65 100755 --- a/import +++ b/import @@ -1,4 +1,7 @@ #!/bin/bash +# note, this quick hack only works with five arguments. +# if you're trying to use six arguments, you need to add another `$6` etc. + python3 tools/decomp-permuter/import.py $1 $2 $3 $4 $5 diff --git a/include/defines.h b/include/defines.h index 3a55604b0..dc90e1a2d 100644 --- a/include/defines.h +++ b/include/defines.h @@ -122,7 +122,7 @@ #define GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION 5 // Selecting CC for GP and Versus. Selecting "Begin" or "Data" for Time Trials. Unused for Battle #define CONFIRM_OK_SELECTION 6 #define CONFIRM_OK_SELECTION_FROM_BACK_OUT 7 -#define TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT 8 +#define TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT 8 /** * Options for gControllerPakMenuSelection diff --git a/include/sounds.h b/include/sounds.h new file mode 100644 index 000000000..99eda334b --- /dev/null +++ b/include/sounds.h @@ -0,0 +1,116 @@ +#ifndef SOUNDS_H +#define SOUNDS_H + +// todo: format like sm64 sounds.h +// The sound cue bit fields can be split up into its basic pieces and put back together. + + +/* Intro */ +#define SOUND_INTRO_LOGO 0x49018008 +// Welcome to Mario Kart. Used in intro and credits. +#define SOUND_INTRO_WELCOME 0x49009009 +#define SOUND_INTRO_ENTER_MENU 0x4900801A + +/* Menus */ +#define SOUND_MENU_OK_CLICKED 0x49008016 + +#define SOUND_MENU_CURSOR_MOVE 0x49008000 +#define SOUND_MENU_GO_BACK 0x49008002 +// Used elsewhere, seems same as above sound. +#define SOUND_ACTION_GO_BACK_2 0x49008005 + +#define SOUND_ACTION_UNKNOWN_CONFIRMATION 0x49008006 + +#define SOUND_MENU_SELECT 0x49008001 + +// Mario Grand Prix +#define SOUND_MENU_GP 0x4900900A +// Versus +#define SOUND_MENU_VERSUS 0x4900900C +// Time Trials +#define SOUND_MENU_TIME_TRIALS 0x4900900B +// Battle +#define SOUND_MENU_BATTLE 0x4900900D +// Select a level (Select a CC) +#define SOUND_MENU_SELECT_LEVEL 0x4900900E +// OK? +#define SOUND_MENU_OK 0x4900900F + +// Select your player +#define SOUND_MENU_SELECT_PLAYER 0x49009012 + +// Select map +#define SOUND_MENU_SELECT_MAP 0x49009013 + +// Plays in option if no controller pak. +#define SOUND_MENU_FILE_NOT_FOUND 0x4900FF07 + +// Option +#define SOUND_MENU_OPTION 0x49009010 +// Data +#define SOUND_MENU_DATA 0x49009011 + +// On delete course record? +#define SOUND_MENU_EXPLOSION 0x4900801D + +#define SOUND_MENU_STEREO 0x49008024 +#define SOUND_MENU_HEADPHONES 0x49008025 +#define SOUND_MENU_MONO 0x49008029 + + +/* Staging */ +// Red and orange staging lights that Lakitu holds. +#define SOUND_ACTION_COUNTDOWN_LIGHT 0x49008003 +#define SOUND_ACTION_GREEN_LIGHT 0x49008004 +// Activates when light turns green. +#define SOUND_ACTION_REV_ENGINE 0x49008018 +#define SOUND_ACTION_REV_ENGINE_2 0x49008019 + +/* Racing */ + +// Volume Mode and unknown +#define SOUND_ACTION_PING 0x4900801C + +#define SOUND_ACTION_TYRE_SQUEAL 0x100F908 + +// Falling rock and bomb sound. +#define SOUND_ACTION_EXPLOSION 0x19009005 + +#define SOUND_ACTION_EXPLOSION_2 0x1900F00C + +/* Items */ +// There's likely more of these but they are in func arguments. +// Did not rename in-case unrelated. +#define SOUND_ITEM_STAR 0x31029008 +#define SOUND_ITEM_THUNDERBOLT 0x5101C00C + + +/* Score Screen */ +// Coin pickup sound (perfect fourth; B to E) +#define SOUND_ACTION_COUNT_SCORE 0x49008017 +#define SOUND_ACTION_NEXT_COURSE 0x49008015 +// Same sound as ENTER_MENU +#define SOUND_ACTION_CONTINUE_UNKNOWN 0x4900801B + + +/* Ceremony */ +// Congratulation +#define SOUND_CEREMONY_CONGRATULATION 0x49009014 +#define SOUND_CEREMONY_BALLOON_POP 0x4900801E +#define SOUND_CEREMONY_FISH 0x4900801F +#define SOUND_CEREMONY_FISH_2 0x49008020 +#define SOUND_CEREMONY_SHOOT_TROPHY 0x49008021 +#define SOUND_CEREMONY_PODIUM 0x49008022 + +// The sound of the trophy. Plays in the background +#define SOUND_CEREMONY_TROPHY 0x49008023 + +/* Credits */ +// Hey, you're very good. See you next time! +#define SOUND_CREDITS_FAREWELL 0x49008026 + + + + + +#endif // SOUNDS_H \ No newline at end of file diff --git a/mk64.ld b/mk64.ld index 1f7a90e8a..23adcb673 100644 --- a/mk64.ld +++ b/mk64.ld @@ -331,7 +331,7 @@ SECTIONS BUILD_DIR/src/memory.o(.text); BUILD_DIR/src/actors_extended.o(.text); BUILD_DIR/src/math_util.o(.text); - BUILD_DIR/data/data_121DA0.o(.data); + BUILD_DIR/src/render_courses.o(.data); BUILD_DIR/src/actors.o(.data); BUILD_DIR/src/skybox_and_splitscreen.o(.data); BUILD_DIR/src/memory.o(.data); @@ -375,22 +375,22 @@ SECTIONS BUILD_DIR/src/camera_junk.o(.text); BUILD_DIR/src/code_80281780.o(.text); BUILD_DIR/src/code_80281C40.o(.text); - BUILD_DIR/src/code_80281FA0.o(.text); + BUILD_DIR/src/ceremony_and_credits.o(.text); BUILD_DIR/src/code_80280650.o(.data); BUILD_DIR/data/data_credits_128480.o(.data); BUILD_DIR/src/dl_unk_80284EE0.inc.o(.data); BUILD_DIR/src/credits_01.inc.o(.data); - BUILD_DIR/src/code_80281FA0.o(.data); + BUILD_DIR/src/ceremony_and_credits.o(.data); BUILD_DIR/data/data_credits_128480_1.o(.data); BUILD_DIR/src/camera_junk.o(.rodata); BUILD_DIR/data/data_credits_128480_2.o(.data); - BUILD_DIR/src/code_80281FA0.o(.rodata); + BUILD_DIR/src/ceremony_and_credits.o(.rodata); } END_SEG(code_80280000) BEGIN_NOLOAD(code_80280000) { BUILD_DIR/asm/bss_credits.o(.bss); - BUILD_DIR/src/code_80281FA0.o(.bss); + BUILD_DIR/src/ceremony_and_credits.o(.bss); } END_NOLOAD(code_80280000) diff --git a/permute b/permute new file mode 100755 index 000000000..d8ddaf374 --- /dev/null +++ b/permute @@ -0,0 +1,7 @@ +#!/bin/bash + +# note, this quick hack only works with three arguments. +# if you're trying to use four arguments, you need to add another `$4` etc. + +python3 tools/decomp-permuter/permuter.py $1 $2 $3 + diff --git a/permuter b/permuter index 1d008b2fa..d8ddaf374 100755 --- a/permuter +++ b/permuter @@ -1,4 +1,7 @@ #!/bin/bash +# note, this quick hack only works with three arguments. +# if you're trying to use four arguments, you need to add another `$4` etc. + python3 tools/decomp-permuter/permuter.py $1 $2 $3 diff --git a/progress.py b/progress.py index 7ddd19983..1a94fd830 100644 --- a/progress.py +++ b/progress.py @@ -90,7 +90,7 @@ seg2Files2 = [ ] seg3Files2 = [ "asm/non_matchings/code_80280650", - "asm/non_matchings/code_80281FA0", + "asm/non_matchings/ceremony_and_credits", ] audioFiles2 = [ "asm/non_matchings/audio" @@ -156,6 +156,7 @@ mainSegFiles = [ "build/us/src/code_800029B0", "build/us/src/code_80004740", "build/us/src/code_80005FD0", + "build/us/src/camera", "build/us/src/code_8001F980", "build/us/src/code_80027D00", "build/us/src/code_800431B0", @@ -190,7 +191,7 @@ seg3Files = [ "build/us/src/code_80280650", "build/us/src/code_80281780", "build/us/src/code_80281C40", - "build/us/src/code_80281FA0", + "build/us/src/ceremony_and_credits", ] segAudioFiles = [ "build/us/src/audio/effects", diff --git a/src/actors.c b/src/actors.c index ddb4d7cc6..253959953 100644 --- a/src/actors.c +++ b/src/actors.c @@ -15,6 +15,7 @@ #include "code_80005FD0.h" #include "code_80071F00.h" #include "code_8008C1D0.h" +#include s32 D_802BA050; s32 D_802BA054; @@ -858,7 +859,7 @@ void func_80298D7C(Camera *camera, Mat4 arg1, struct Actor *actor) { Vec3s sp88 = { 0, 0, 0 }; s32 test; - if (gGamestate == 9) { + if (gGamestate == CREDITS_SEQUENCE) { var_f22 = 9000000.0f; } else { var_f22 = 1000000.0f; @@ -2142,7 +2143,7 @@ void place_segment_06(struct ActorSpawnData *arg0) { } temp_s0 = &gActorList[func_8029EC88(position, rotation, velocity, actorType)]; - if (gGamestate == 9) { + if (gGamestate == CREDITS_SEQUENCE) { func_802976D8(temp_s0->rot); } else { func_802ADDC8(&temp_s0->unk30, 5.0f, temp_s0->pos[0], temp_s0->pos[1], temp_s0->pos[2]); @@ -3322,7 +3323,7 @@ void func_802A0450(Player *player, struct Actor *actor) { case ACTOR_FALLING_ROCK: if (!(player->unk_0BC & 0x80000000) && !(player->unk_000 & 0x100)) { if (func_8029FB80(player, actor) == 1) { - func_800C98B8(actor->pos, actor->velocity, 0x19009005U); + func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION); if ((gModeSelection == TIME_TRIALS) && !(player->unk_000 & 0x1000)) { D_80162DF8 = 1; } diff --git a/src/audio/external.c b/src/audio/external.c index 82ca2603c..a52059873 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -7,6 +7,7 @@ #include "audio/external.h" #include "audio/load.h" #include "audio/data.h" +#include // REQUIRES void in the argument list to match properly void func_800C13F0(void) { @@ -4239,11 +4240,11 @@ void play_sound2(s32 arg0) { s32 phi_a0_2; phi_a0 = arg0; - if ((arg0 == 0x49008018) && (gCurrentCourseId == 0x12)) { + if ((arg0 == SOUND_ACTION_REV_ENGINE) && (gCurrentCourseId == 0x12)) { phi_a0 = 0x49008027; } phi_a0_2 = phi_a0; - if ((phi_a0 == 0x49008019) && (gCurrentCourseId == 0x12)) { + if ((phi_a0 == SOUND_ACTION_REV_ENGINE_2) && (gCurrentCourseId == 0x12)) { phi_a0_2 = 0x49008028; } play_sound(phi_a0_2, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); @@ -4848,12 +4849,12 @@ extern s8 D_800EA16C; void func_800C9F90(s32 arg0) { if ((arg0 & 0xFF) != 0) { - play_sound2(0x49008005); + play_sound2(SOUND_ACTION_GO_BACK_2); func_800CBBB8(0xF1000000, 0); D_800EA16C = 1; return; } - play_sound2(0x49008006); + play_sound2(SOUND_ACTION_UNKNOWN_CONFIRMATION); func_800CBBB8(0xF2000000, 0); D_800EA16C = 0; } @@ -5273,7 +5274,7 @@ void func_800CA984(s32 arg0) { do { temp_v0_2 = func_800C1C88(temp_s5 & 0xFF, temp_v0->pos, &D_800EA1C8, &temp_v0->unk_098, (u8) var_s0, 0x31029008U); if (temp_v0_2 != NULL) { - play_sound(0x31029008U, temp_v0_2->unk18, var_s0 & 0xFF, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_STAR, temp_v0_2->unk18, var_s0 & 0xFF, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } temp_t2 = (var_s0 + 1) & 0xFF; var_s0 = temp_t2; @@ -5327,7 +5328,7 @@ void func_800CAB4C(u8 arg0) { block_4: func_800C36C4(0, 1, 0x55, 5); func_800C9060(arg0, 0x1900F013); - play_sound(0x5101C00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } D_800EA168 = 1; } @@ -5368,10 +5369,10 @@ extern ? D_800EA1DC; void func_800CAC60(s32 arg0) { if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) { - play_sound(0x1900F00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ACTION_EXPLOSION_2, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); if ((D_800EA10C.unk0 != 1) && (D_800EA10C.unk1 != 1)) { func_800C36C4(0, 1, 0x37, 5); - play_sound(0x5101C00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); D_800EA168 = 1; } } diff --git a/src/camera.c b/src/camera.c index d8a3ce6e6..9818fbdeb 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1397,7 +1397,7 @@ GLOBAL_ASM("asm/non_matchings/camera/func_8001F394.s") void func_8001F87C(s32 cameraId) { s32 playerIndex; // Why? - s32 test = cameraId; + s32 id = cameraId; if(gPlayerOne){} if (gActiveScreenMode == 0) { @@ -1409,9 +1409,9 @@ void func_8001F87C(s32 cameraId) { } if ((playerIndex == 7) && (D_80164A2C == 0x0000003C)) { D_80164A28 = 2; - D_80152300[test] = 1; - cameras[test].rot[1] = gPlayerOne[playerIndex].unk_02C[1]; - cameras[test].unk_2C = gPlayerOne[playerIndex].unk_02C[1]; + D_80152300[id] = 1; + cameras[id].rot[1] = gPlayerOne[playerIndex].unk_02C[1]; + cameras[id].unk_2C = gPlayerOne[playerIndex].unk_02C[1]; } } } diff --git a/src/camera.h b/src/camera.h index 8f13c4a9e..9be28ab6f 100644 --- a/src/camera.h +++ b/src/camera.h @@ -3,6 +3,17 @@ #include "common_structs.h" +// todo put this define in types.h or similar. +// Certain functions are marked as having return values, but do not +// actually return a value. This causes undefined behavior, which we'd rather +// avoid on modern GCC. This only impacts -O2 and can matter for both the function +// itself and functions that call it. +#ifdef AVOID_UB + #define BAD_RETURN(cmd) void +#else + #define BAD_RETURN(cmd) cmd +#endif + typedef struct { /* 0x00 */ Vec3f pos; /* 0x0C */ Vec3f lookAt; @@ -39,6 +50,9 @@ typedef struct { /* 0xB4 */ f32 unk_B4; } Camera; /* size = 0xB8 */ +typedef BAD_RETURN(s32) (*CameraEvent)(struct Camera *c); +typedef CameraEvent CutsceneShot; + // The camera used for cutscenes appears to // use a slightly different struct. // Or even no struct at all. diff --git a/src/ceremony_and_credits.c b/src/ceremony_and_credits.c new file mode 100644 index 000000000..82f90ca0c --- /dev/null +++ b/src/ceremony_and_credits.c @@ -0,0 +1,1826 @@ +/** + * @file ceremony_and_credits.c + * Implements cinematic camera for ceremony and credits scenes. + * Camera moves via splines. + */ + +#include +#include +#include +#include +#include "variables.h" +#include "math_util.h" +#include "ceremony_and_credits.h" +#include "objects.h" +#include "main.h" +#include "camera.h" +#include + +/* externs */ +void func_80280268(s32); + +extern f32 D_80150130[]; + +f32 D_802856B0 = 98.0f; +f32 D_802856B4 = 12.0f; +f32 D_802856B8 = 52.0f; +f32 D_802856BC = 52.0f; +f32 D_802856C0 = 0.0f; +s32 D_802856C4 = 0; + +s32 D_802856C8[3] = {0}; // padding? + +s16 sCutsceneShot; +s16 gCutsceneShotTimer; +s32 D_802876D4; +s32 D_802876D8; +s32 D_802876DC; // fake/padding? Or D8 is array? + +struct struct_80283431 { + Vec3f unk0; + Vec3s unkC; +}; + +struct struct_80283430 { + s8 unk0; // index + s8 unk1; // speed + u16 unk2; // point + s8 unk4; + s8 unk5; + Vec3s unk6; +}; +struct unkStruct_80283430 { + s16 unk0; + f32 unk4; +}; + +struct unkStruct_80283430_2 { + f32 unk0; + s16 unk4; + s16 unk6; +}; + + +struct b18 { + f32 unk0; + s16 unk4; + s16 unk6; + s8 unk8; +}; +//extern struct b18 sCutsceneSplineSegmentProgress; +//extern s16 sCutsceneSplineSegment; +//extern s16 D_80287B1E; +//extern s8 D_80287B20; + +struct credits_data_1FA0 { + Vec3f unk0; + s8 pad[0x10]; + s8 unk1C; + s8 unk1D; + s16 unk1E; + f32 unk20; + s8 pad2[0x24]; + s16 unk48[3]; + s16 unk4E[2]; + s16 un52; + s16 unk54[2]; + s16 unk58; + s16 unk5A[2]; + s16 unk5E; + s16 unk60; + s16 unk62; + f32 unk64; + f32 unk68; + s16 unk6C; + s16 unk6E; +}; + + +// Cinematic camera? Camera rails? +// CutsceneVariable? +/** + * Struct used to store cutscene info, like the camera's target position/focus. + * + * See the sCutsceneVars[] array in camera.c for more details. + */ +struct struct_D_802876D0 { + /* 0x00 */ Vec3f unk0; // E0 + /* 0x0C */ Vec3f unkC; // EC + /* 0x18 */ f32 unk18; + /* 0x1C */ s8 unk1C; + /* 0x00 */ f32 unk20; // D_80287700[0] = D_80150130[0] (f32); + /* 0x04 */ Vec3f unk24; // vec3f_set_dupe() + /* 0x10 */ Vec3f unk30; // " + /* 0x1C */ Vec3f unk3C; // " + /* 0x28 */ Vec3s unk48; + /* 0x2E */ Vec3s unk4E; + /* 0x30 */ Vec3s unk54; + /* 0x36 */ Vec3s unk5A; + /* 0x3C */ s16 unk60; + /* 0x3E */ s16 unk62; + /* 0x40 */ f32 unk64; + /* 0x44 */ f32 unk68; + /* 0x48 */ s16 unk6C; + /* 0x4A */ s16 unk6E; +}; + +struct PlayerGeometry { + /*0x00*/ struct Surface *currFloor; + /*0x04*/ f32 currFloorHeight; + /*0x08*/ s16 currFloorType; + /*0x0C*/ struct Surface *currCeil; + /*0x10*/ s16 currCeilType; + /*0x14*/ f32 currCeilHeight; + /*0x18*/ struct Surface *prevFloor; + /*0x1C*/ f32 prevFloorHeight; + /*0x20*/ s16 prevFloorType; + /*0x24*/ struct Surface *prevCeil; + /*0x28*/ f32 prevCeilHeight; + /*0x2C*/ s16 prevCeilType; + /// Unused, but recalculated every frame + /*0x30*/ f32 waterHeight; +}; + +// unk0 Vec3f lookat +// unk[12] Vec3f pos +s8 D_802876E0[24]; // todo: Should be CinematicCamera * ? Or cameraSplineRail? + +f32 D_802876F8; +s8 D_802876FC; + +f32 D_80287700[10]; +Vec3s D_80287728[4]; + +// static bss declared in func_80283430? +struct unkStruct_80283430 D_80287740; +struct unkStruct_80283430_2 D_80287748; +struct struct_80283431 D_80287750[10]; +struct struct_80283430 D_80287818[32]; +struct struct_80283430 D_80287998[32]; +f32 sCutsceneSplineSegmentProgress; +s16 sCutsceneSplineSegment; +s16 D_80287B1E; +s8 D_80287B20; + +void vec3f_set_dupe(Vec3f dest, f32 arg1, f32 arg2, f32 arg3) { + dest[0] = arg1; + dest[1] = arg2; + dest[2] = arg3; +} + +void vec3s_set_dupe(Vec3s dest, s16 arg1, s16 arg2, s16 arg3) { + dest[0] = arg1; + dest[1] = arg2; + dest[2] = arg3; +} + +void vec3f_clear(Vec3f arg0) { + arg0[0] = arg0[1] = arg0[2] = 0.0f; +} + +void vec3s_clear(Vec3s arg0) { + arg0[0] = arg0[1] = arg0[2] = 0; +} + +void vec3f_copy_dupe(Vec3f dest, Vec3f src) { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; +} + +void vec3s_copy_dupe(Vec3s dest, Vec3s src) { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; +} + +void func_80282040(void) { + +} + +void func_80282048(void) { + +} + +UNUSED void func_80282050(Vec3f dest, Vec3f src, s16 angle) { + Vec3f sp2C; + + vec3f_copy_dupe(sp2C, src); + dest[0] = (sp2C[2] * sins(angle)) + (sp2C[0] * coss(angle)); + dest[1] = sp2C[1]; + dest[2] = (sp2C[2] * coss(angle)) - (sp2C[0] * sins(angle)); +} + +UNUSED void func_802820F8(f32 *dest, f32 *src, s16 angle) { + Vec3f sp2C; + + vec3f_copy_dupe(sp2C, src); + dest[2] = (sp2C[2] * coss(angle)) - (sp2C[1] * sins(angle)); + dest[1] = (sp2C[2] * sins(angle)) + (sp2C[1] * coss(angle)); + dest[0] = sp2C[0]; +} + +/** + * Target f32 at given rate. + * Used for targeting playerTwo and playerThree. + * Also targets the trophy. + */ +s32 f32_lerp(f32 *dest, f32 src, f32 lerp) { + if (lerp > 1.0f) { + lerp = 1.0f; + } + + *dest = *dest + ((src - *dest) * lerp); + + if (src == *dest) { + return 0; + } + return 1; +} + +UNUSED s32 func_80282200(Vec3s arg0, s16 arg1, s16 arg2) { + s16 temp_v0 = *arg0; + + if (arg2 == 0) { + arg0[0] = arg1; + } else { + temp_v0 -= arg1; + temp_v0 -= (temp_v0 / arg2); + temp_v0 += arg1; + arg0[0] = temp_v0; + } + + if (arg1 == arg0[0]) { + return 0; + } + return 1; +} + +// Calculates fade in/out +s32 set_transition_colour_fade_alpha_ending(f32 *arg0, f32 arg1, f32 arg2) { + f32 temp_f0 = arg1 - *arg0; + + if (arg2 < 0.0f) { + arg2 = -1.0f * arg2; + } + + if (temp_f0 > 0.0f) { + temp_f0 -= arg2; + if (temp_f0 > 0.0f) { + *arg0 = arg1 - temp_f0; + } else { + *arg0 = arg1; + } + } else { + temp_f0 += arg2; + if (temp_f0 < 0.0f) { + *arg0 = arg1 - temp_f0; + } else { + *arg0 = arg1; + } + } + + if (arg1 == *arg0) { + return 0; + } + return 1; +} + +s32 func_80282364(s16 *arg0, s16 arg1, s16 arg2) { + s16 temp_v0 = arg1 - *arg0; + + if (arg2 < 0) { + arg2 = arg2 * -1; + } + if ( temp_v0 > 0) { + temp_v0 -= arg2; + if (temp_v0 >= 0) { + *arg0 = arg1 - temp_v0; + } else { + *arg0 = arg1; + } + } else { + temp_v0 += arg2; + if (temp_v0 <= 0) { + *arg0 = arg1 - temp_v0; + } else { + *arg0 = arg1; + } + } + + if (arg1 == *arg0) { + return 0; + } + return 1; +} + +void reset_spline(void) { + sCutsceneSplineSegment = 0; + sCutsceneSplineSegmentProgress = 0.0f; + D_80287B1E = 0; + D_80287B20 = 0; +} + +void func_80282434(Camera *arg0) { + reset_spline(); +} + +void func_80282454(Vec3f arg0, Vec3f arg1, f32 *distance, s16 *arg3, s16 *arg4) { + f32 xdist; + f32 ydist; + f32 zdist; + + xdist = arg1[0] - arg0[0]; + ydist = arg1[1] - arg0[1]; + zdist = arg1[2] - arg0[2]; + *distance = sqrtf((xdist * xdist) + (ydist * ydist) + (zdist * zdist)); + *arg3 = atan2s(ydist, sqrtf((xdist * xdist) + (zdist * zdist))); + *arg4 = atan2s(xdist, zdist); +} + +void func_80282504(Vec3f arg0, Vec3f arg1, f32 arg2, s16 arg3, s16 arg4) { + arg1[0] = arg0[0] + (arg2 * coss(arg3) * sins(arg4)); + arg1[1] = arg0[1] + (arg2 * sins(arg3)); + arg1[2] = arg0[2] + (arg2 * coss(arg3) * coss(arg4)); +} + +UNUSED void func_802825C8(Vec3f arg0, Vec3f arg1, Vec3f arg2, Vec3s arg3) { + Vec3f sp3C; + Vec3f sp30; + + // What's up with this? Why do we copy arg1 to an unused local variable? + vec3f_copy_dupe(sp3C, arg1); + sp30[2] = -((arg2[2] * coss(arg3[0])) - (arg2[1] * sins(arg3[0]))); + sp30[1] = (arg2[2] * sins(arg3[0])) + (arg2[1] * coss(arg3[0])); + sp30[0] = arg2[0]; + arg0[0] = arg1[0] + (sp30[2] * sins(arg3[1])) + (sp30[0] * coss(arg3[1])); + arg0[1] = arg1[1] + sp30[1]; + arg0[2] = arg1[2] + (sp30[2] * coss(arg3[1])) - (sp30[0] * sins(arg3[1])); +} + +// evaluate_cubic_spline +void func_80282700(f32 arg0, Vec3f arg1, Vec3f arg2, f32 arg3[], f32 arg4[], f32 arg5[], f32 arg6[]) +{ + f32 B[4]; + f32 a = arg0; + if (arg0 > 1.0f) + { + arg0 = 1.0f; + } + B[0] = (((1.0f - arg0) * (1.0f - arg0)) * (1.0f - arg0)) / 6.0f; + B[1] = ((((arg0 * arg0) * arg0) / 2.0f) - (arg0 * arg0)) + 0.6666667f; + B[2] = ((((((-arg0) * arg0) * arg0) / 2.0f) + ((arg0 * arg0) / 2.0f)) + (arg0 / 2.0f)) + 0.16666667f; + B[3] = ((arg0 * arg0) * arg0) / 6.0f; + + arg1[0] = B[0] * arg3[0] + B[1] * arg4[0] + B[2] * arg5[0] + B[3] * arg6[0]; + arg1[1] = B[0] * arg3[1] + B[1] * arg4[1] + B[2] * arg5[1] + B[3] * arg6[1]; + arg1[2] = B[0] * arg3[2] + B[1] * arg4[2] + B[2] * arg5[2] + B[3] * arg6[2]; + arg2[0] = B[0] * arg3[3] + B[1] * arg4[3] + B[2] * arg5[3] + B[3] * arg6[3]; +} + +struct CutsceneSplinePoint { + s8 index; + u8 speed; + Vec3s point; + +}; + +/** + * Computes the point that is `progress` percent of the way through segment `splineSegment` of `spline`, + * and stores the result in `p`. `progress` and `splineSegment` are updated if `progress` becomes >= 1.0. + * + * When neither of the next two points' speeds == 0, the number of frames is between 1 and 255. Otherwise + * it's infinite. + * + * To calculate the number of frames it will take to progress through a spline segment: + * If the next two speeds are the same and nonzero, it's 1.0 / firstSpeed. + * + * s1 and s2 are short hand for first/secondSpeed. The progress at any frame n is defined by a recurrency relation: + * p(n+1) = (s2 - s1 + 1) * p(n) + s1 + * Which can be written as + * p(n) = (s2 * ((s2 - s1 + 1)^(n) - 1)) / (s2 - s1) + * + * Solving for the number of frames: + * n = log(((s2 - s1) / s1) + 1) / log(s2 - s1 + 1) + * + * @return 1 if the point has reached the end of the spline, when `progress` reaches 1.0 or greater, and + * the 4th CutsceneSplinePoint in the current segment away from spline[splineSegment] has an index of -1. + */ +s32 move_point_along_spline(Vec3f p, Vec3f arg1, struct struct_80283430 spline[], s16 *splineSegment, f32 *progress) { + s32 finished = 0; + Mat4 controlPoints; + s32 i = 0; + f32 u = *progress; + f32 progressChange; + f32 firstSpeed = 0; + f32 secondSpeed = 0; + s32 segment = *splineSegment; + + if (*splineSegment < 0) { + u = 0; + } + + if ((spline[segment].unk0 == -1) || (spline[segment + 1].unk0 == -1) || (spline[segment + 2].unk0 == -1)) { + return 1; + } + + for (i = 0; i < 4; i++) { + controlPoints[i][0] = spline[segment + i].unk6[0]; + controlPoints[i][1] = spline[segment + i].unk6[1]; + controlPoints[i][2] = spline[segment + i].unk6[2]; + controlPoints[i][3] = spline[segment + i].unk4 * 256.0f; + } + + func_80282700(u, p, arg1, controlPoints[0], controlPoints[1], controlPoints[2], controlPoints[3]); + + if (spline[*splineSegment + 1].unk2 != 0) { + firstSpeed = 1.0f / spline[*splineSegment + 1].unk2; + } + + if (spline[*splineSegment + 2].unk2 != 0) { + secondSpeed = 1.0f / spline[*splineSegment + 2].unk2; + } + + progressChange = (((secondSpeed - firstSpeed)) * *progress + firstSpeed); + if (1 <= (*progress += progressChange)) { + (*splineSegment)++; + if (spline[*splineSegment + 3].unk0 == -1) { + *splineSegment = 0; + finished = 1; + } + (*progress)--; + } + return finished; +} + +void func_80282BE4(struct struct_80283430 *arg0, s8 arg1, u8 arg2, s8 arg3, Vec3s arg4, s32 arg5) +{ + arg0->unk0 = arg1; + arg0->unk2 = arg2; + arg0->unk4 = arg3; + if (arg5) { + arg0->unk6[0] = -arg4[0]; + } else { + arg0->unk6[0] = arg4[0]; + } + arg0->unk6[1] = arg4[1]; + arg0->unk6[2] = arg4[2]; +} + +void func_80282C40(struct struct_80283430 *arg0, struct struct_80282C40 *arg1, s32 arg2) +{ + s32 i = 0; + s32 j = 0; + func_80282BE4(&arg0[j], arg1[j].unk0, arg1[j].unk3, arg1[j].unk4, arg1[j].unk6, arg2); + + j++; + goto dummy_label_888430; + while(1) { + do { + +dummy_label_888430: ; + func_80282BE4(&arg0[j], arg1[i].unk0, arg1[i].unk3, arg1[i].unk4, arg1[i].unk6, arg2); + j++; + i++; + + } while (arg1[i].unk0 != -1); + if (j + 3 <= 30) { + func_80282BE4(&arg0[j], arg1->unk0, arg1[i].unk3, arg1[i].unk4, arg1[i].unk6, arg2); + func_80282BE4(&arg0[j + 1], arg1->unk0, 0, arg1[i].unk4, arg1[i].unk6, arg2); + func_80282BE4(&arg0[j + 2], arg1->unk0, 0, arg1[i].unk4, arg1[i].unk6, arg2); + func_80282BE4(&arg0[j + 3], -1, 0, arg1[i].unk4, arg1[i].unk6, arg2); + break; + } + } +} + +// todo: Cast to normal Camera? Or from CinematicCamera? +s32 func_80282D90(Camera *camera, struct struct_80286A04 *arg1, struct struct_80286A04 *arg2, s32 arg3) { + s32 res; + + cutscene_event(&func_80282434, camera, 0, 0); + func_80282C40(&D_80287818, arg1, arg3); + func_80282C40(&D_80287998, arg2, arg3); + + if (0) {}; // debug stub? + + res = move_point_along_spline(camera->lookAt, camera->up, &D_80287818, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress) | + move_point_along_spline(camera->pos, camera->up, &D_80287998, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); + return res; +} + +void func_80282E58(Camera *camera, struct struct_80282C40 *arg1, s32 arg2) { + //extern struct struct_80283430 D_80287818[]; + //extern s16 sCutsceneSplineSegment; + //extern f32 sCutsceneSplineSegmentProgress; + + func_80282C40(&D_80287818, arg1, arg2); + move_point_along_spline(camera->lookAt, camera->up, &D_80287818, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); +} + +void func_80282EAC(s32 arg0, struct struct_D_802876D0 *arg1, s16 arg2, s16 arg3, s16 arg4) +{ + if ((arg0 >= 0) && (arg0 < 3)) + { + if (arg1->unk48[arg0] < arg2) + { + arg1->unk48[arg0] = arg2; + arg1->unk5A[arg0] = arg3; + arg1->unk54[arg0] = arg4; + } + } +} + +void func_80282F00(s16 *arg0, s16 arg1) { + if (arg1 == -0x8000) { + *arg0 = (*arg0 & 0x8000) + 0xC000; + return; + } + *arg0 += arg1; +} + +void func_80282F44(s32 arg0, struct struct_D_802876D0 *arg1, Camera *camera) { + f32 sp5C; + s32 pad[2]; + s16 sp50[2]; + Vec3f pos; + Vec3f rot; + + vec3f_set_dupe(pos, camera->pos[0], camera->pos[1], camera->pos[2]); + vec3f_set_dupe(rot, camera->lookAt[0], camera->lookAt[1], camera->lookAt[2]); + if ((arg0 == 0) || (arg0 == 1)) { + if ((arg1->unk48[0] != 0) || (arg1->unk48[1] != 0)) { + func_80282454(pos, rot, &sp5C, &sp50[0], &sp50[1]); + sp50[arg0] += (((f32) arg1->unk48[arg0]) * sins(arg1->unk4E[arg0])); + if ((sp50[0] < 0x3800) && (sp50[0] >= -0x37FF)) { + func_80282504(pos, rot, sp5C, sp50[0], sp50[1]); + } + func_80282F00(&arg1->unk4E[arg0], arg1->unk54[arg0]); + if (func_80282364(&arg1->unk48[arg0], 0, arg1->unk5A[arg0]) == 0) { + arg1->unk4E[arg0] = 0; + } + } + camera->lookAt[0] = rot[0]; + camera->lookAt[1] = rot[1]; + camera->lookAt[2] = rot[2]; + } +} + +void func_802830B4(struct struct_D_802876D0 *arg0, s16 arg1, s16 arg2, s16 arg3) { + if (arg0->unk60 < arg1) { + arg0->unk60 = arg1; + arg0->unk6C = arg2; + arg0->unk68 = arg3; + } +} + +void func_80283100(struct struct_D_802876D0 *arg0, f32 *arg1) { + if (arg0->unk60 != 0) { + arg0->unk6E = (coss((u16) arg0->unk64) * arg0->unk60) / 256; + arg0->unk64 += arg0->unk68; + func_80282364(&arg0->unk60, 0, arg0->unk6C); + } else { + arg0->unk64 = 0.0f; + } + *arg1 = arg0->unk20 + (f32) arg0->unk6E; +} + +void func_80283240(s16 arg0) { + if (arg0 == 1) { + func_80282EAC(0, &D_802876E0, 0x100, 0x10, 0x4000); + func_80282EAC(1, &D_802876E0, 0x80, 0x20, 0x2000); + func_802830B4(&D_802876E0, 0x300, 0x20, 0x4000); + } +} + +/** + * Call the event while `start` <= gCutsceneTimer <= `end` + * If `end` is -1, call for the rest of the shot. + */ +s32 cutscene_event(CameraEvent event, Camera *camera, s16 start, s16 end) { + if (gCutsceneShotTimer >= start) { + if ((end == -1) || (end >= gCutsceneShotTimer)) { + event(camera); + } + } + return 0; +} + +s32 func_80283330(s32 arg0) { + if (arg0 != D_802876D8) { + D_802876D8 = arg0; + sCutsceneShot = 0; + gCutsceneShotTimer = 0; + D_802876D4 = 0; + } + return D_802876D8; +} + +extern s8 D_802874F5; +extern s32 D_802876D8; + +// todo: Does this match as a return of s8? +s32 func_8028336C(UNUSED struct struct_D_802876D0 *arg0, UNUSED Camera *camera) { + u8 sp20[] = { 2, 3, 4, 5, 5, 5, 5, 5 }; + if (D_802876D8 != 0) + { + return D_802876D8; + } + switch (gGamestate) + { + case ENDING_SEQUENCE: + D_802876D8 = sp20[D_802874F5]; + break; + + case CREDITS_SEQUENCE: + D_802876D8 = 6; + break; + + } + + if (gGamestate == CREDITS_SEQUENCE) + { + func_80283330(6); + } + return D_802876D8; +} + +s32 func_80283428(void) { + return 0; +} + +// Matches with static. Seems to not be correct though +#ifdef NON_MATCHING +// todo: D_802876E0???? CinematicCamera struct +void func_80283430(void) +{ + + //static struct struct_80283431 D_80287750[10]; + //static struct struct_80283430 D_80287818[32]; + //static struct struct_80283430 D_80287998[32]; + + //extern f32 sCutsceneSplineSegmentProgress; + + //extern s16 sCutsceneSplineSegment; + //extern s16 D_80287B1E; + //extern s8 D_80287B20; + s32 i; + + D_802876D8 = 0; + D_802876E0[28] = 0; + D_802856C4 = (s32) D_800DC5E4; + vec3f_clear(&D_802876E0[12]); + vec3f_set_dupe(&D_802876E0, 0.0f, 0.0f, 500.0f); + vec3f_clear(&D_80287700[4]); + vec3f_set_dupe(&D_80287700[1], 0.0f, 0.0f, 500.0f); + vec3f_set_dupe(&D_80287700[7], 0.0f, 1.0f, 0.0f); + D_802876F8 = 0.0f; + vec3s_clear(&D_80287728[0]); + vec3s_clear(&D_80287728[1]); + vec3s_clear(&D_80287728[2]); + vec3s_clear(&D_80287728[3]); + D_80287740.unk0 = 0; + D_80287740.unk4 = 0.0f; + D_80287748.unk0 = 0.0f; + D_80287748.unk4 = 0; + D_80287748.unk6 = 0; + D_80287700[0] = D_80150130[0]; + sCutsceneShot = 0; + gCutsceneShotTimer = 0; + D_802876D4 = 0; + reset_spline(); + for (i = 0; i < 32; i++) + { + D_80287818[i].unk0 = -1; + D_80287998[i].unk0 = -1; + } + + for (i = 0; i < 10; i++) + { + vec3f_clear(D_80287750[i].unk0); + vec3s_clear(D_80287750[i].unkC); + } + + D_802856C0 = 0.0f; + if (gGamestate == 5) + { + D_802856B0 = 120.0f; + D_802856B4 = 12.0f; + D_802856B8 = 120.0f; + } else { + D_802856B0 = 98.0f; + D_802856B4 = 12.0f; + D_802856B8 = 52.0f; + } +} +#else +GLOBAL_ASM("asm/non_matchings/ceremony_and_credits/func_80283430.s") +#endif + +#ifdef NON_MATCHING +//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de +//void func_80282F44(?, s32 *, Camera *); /* extern */ +//void func_80283100(s32 *, f32 *); /* extern */ +//s32 func_8028336C(s32 *, Camera *); /* extern */ +//void play_cutscene(s32 *); /* extern */ +//extern Vec3f D_802876EC; +//extern f32 D_802876F8; +//extern f32 D_80287704; +//extern f32 D_80287710; +//extern f32 D_8028771C; + +void play_cutscene(CinematicCamera *camera); + +// Camera init? or scene init? scene_entry_point? +s32 func_80283648(Camera *camera) { + s16 sp6E; + s16 sp6C; + f32 var_f0; + f32 sp64; + Vec3f sp58; + Vec3f sp4C; + Vec3f sp40; + u8 temp; + + //f32 D_802876F8 = 0; + //u8 D_802876FC; + + func_80283428(); + + vec3f_copy_dupe(&sp58, &camera->pos); + vec3f_copy_dupe(&sp4C, &camera->lookAt); + vec3f_copy_dupe(&sp40, &camera->up); + + temp = (u8)func_8028336C(&D_802876E0, camera); + D_802876FC = temp; + + if (temp != 0) + { + vec3f_copy_dupe(&D_802876E0[12], &camera->pos); + vec3f_copy_dupe(&D_802876E0, &camera->lookAt); + play_cutscene(D_802876E0); + func_80282454(&D_802876E0[12], D_802876E0, &sp64, &sp6E, &sp6C); + if (sp6E >= 0x3800) + { + sp6E = 0x3800; + } + if (sp6E < (-0x37FF)) + { + sp6E = -0x3800; + } + if ((sp6E == 0x3800) || ((sp6E == (-0x3800)))) + { + func_80282504(&D_802876E0[12], (f32 *) (&D_802876E0), sp64, sp6E, ((s32) sp6C)); + } + + var_f0 = D_802876F8; + + if (var_f0 > 65536.0f) + { + var_f0 -= 65536.0f; + } + if (var_f0 < (-65536.0f)) + { + var_f0 += 65536.0f; + } + + D_802876F8 = var_f0; + if (var_f0 < 0.0f) + { + var_f0 += 65536.0f; + } + camera->up[0] = sins(var_f0) * coss(sp6C); + camera->up[1] = coss(var_f0); + camera->up[2] = -sins(var_f0) * sins(sp6C); + vec3f_copy_dupe(camera->pos, &D_802876E0[12]); + vec3f_copy_dupe(&camera->lookAt, (f32 *) (&D_802876E0)); + + if ((gGamestate == 9) && (gIsMirrorMode != 0)) + { + camera->pos[0] = -camera->pos[0]; + camera->lookAt[0] = -camera->lookAt[0]; + } + } + func_80282F44(0, &D_802876E0, camera); + func_80282F44(1, &D_802876E0, camera); + func_80283100(&D_802876E0, D_80150130); + vec3f_copy_dupe(&D_80287700[4], &camera->pos); + vec3f_copy_dupe(&D_80287700[1], &camera->lookAt); + vec3f_copy_dupe(&D_80287700[7], &camera->up); + return D_802876D8; +} +#else +GLOBAL_ASM("asm/non_matchings/ceremony_and_credits/func_80283648.s") +#endif + +void func_80283968(Camera *camera) { + func_8028100C(-0xC6C, 0xD2, -0x1EF); +} + +void func_80283994(CinematicCamera *camera) { + func_80280FFC(); +} + +void func_802839B4(Camera *camera) { + D_802856B8 = 52.0f; +} + +void func_802839CC(Camera *camera) { + D_802856B8 = 0.0f; +} + +void func_802839E0(Camera *camera) { + func_80092C80(); +} + +/** + * Played at beginning of credits. + */ +void play_sound_welcome(Camera *camera) { + if (D_800DC5E4 == 0) { + play_sound2(SOUND_INTRO_WELCOME); + } +} + +void func_80283A34(CinematicCamera *camera) { + func_800CA0CC(); +} + +/** + * Played after receiving trophy. + */ +void play_sound_congratulation(Camera *camera) { + play_sound2(SOUND_CEREMONY_CONGRATULATION); +} + +/** + * Played in ceremony opening with ballons. + */ +void play_sound_balloon_pop(CinematicCamera *camera) { + play_sound2(SOUND_CEREMONY_BALLOON_POP); +} + +void play_sound_fish(Camera *camera) { + play_sound2(SOUND_CEREMONY_FISH); +} + +void play_sound_fish_2(Camera *camera) { + play_sound2(SOUND_CEREMONY_FISH_2); +} + +void play_sound_shoot_trophy(Camera *camera) { + play_sound2(SOUND_CEREMONY_SHOOT_TROPHY); +} + +void play_sound_podium(Camera *camera) { + play_sound2(SOUND_CEREMONY_PODIUM); +} + +/** + * Played in background nearly the entire ceremony + * Begins again or plays louder once the trophy appears. + */ +void play_sound_trophy(Camera *camera) { + play_sound2(SOUND_CEREMONY_TROPHY); +} + +void func_80283B6C(Camera *camera) { + func_800CA0B8(); + func_800C9060(0, SOUND_ACTION_EXPLOSION); + func_800CA0A0(); +} + +void func_80283BA4(Camera *camera) { + func_800CA0B8(); + func_800C90F4(0, (gPlayerFour->characterId * 0x10) + 0x29008004); + func_800CA0A0(); +} + +void func_80283BF0(CinematicCamera *camera) { + func_800C8EF8(0x1A); +} + +// +void func_80283C14(Camera *camera) { + func_800C8EF8(0x1B); +} + +void func_80283C38(Camera *camera) { + func_800CB134(); +} + +void func_80283C58(CinematicCamera *camera) { + func_800CB14C(); +} + +void func_80283C78(s32 arg0) { + if (D_800DC5E4 == 0) { + func_800C8EF8(0x1C); + } +} + +void func_80283CA8(CinematicCamera *camera) { + func_800CA008(0, 3); +} + +void func_80283CD0(s32 arg0) { + if (D_800DC5E4 == 0) { + func_800CA008(0, 2); + } +} + +/** + * End of credits farewell. + * "Hey, you're very good. See you next time!" + */ +void play_sound_farewell(s32 arg0) { + play_sound2(SOUND_CREDITS_FAREWELL); +} + + +// Camera rail spline animation +struct struct_80282C40 D_802856DC[] = { + // go to + { 0, 0, 0, 0, 0, 0, { 0xF576, 0x014E, 0xFE70 } }, + { 0, 0, 0, 0, 0, 0, { 0xF576, 0x014E, 0xFE70 } }, + { 0, 0, 0, 0, 0, 0, { 0xF422, 0x0103, 0xFE3C } }, + { 0, 0, 0, 0, 0, 0, { 0xF3E8, 0x0016, 0xFE34 } }, + { -1, 0, 0, 0, 0, 0, { 0xF3E8, 0x0016, 0xFE34 } }, +}; + +struct struct_80282C40 D_80285718[] = { + { 0, 0, 0, 61, 0, 0, { 0xF493, 0x0309, 0xFE4E } }, + { 0, 0, 0, 149, 0, 0, { 0xF494, 0x030A, 0xFE4E } }, + { 0, 0, 0, 94, 0, 0, { 0xF243, 0x0179, 0xFDF0 } }, + { 0, 0, 0, 60, 0, 0, { 0xF213, 0x00B1, 0xFDE9 } }, + { -1, 0, 0, 60, 0, 0, { 0xF213, 0x008D, 0xFDE9 } }, +}; + +struct struct_80282C40 D_80285754[] = { + { 0, 0, 0, 0, 0, 0, { 0xF4F4, 0xFFE2, 0xFF67} }, + { 0, 0, 0, 0, 0, 0, { 0xF51A, 0x0002, 0xFF5D} }, + { 0, 0, 0, 0, 0, 0, { 0xF57B, 0x004A, 0xFFB8} }, + { -1, 0, 0, 0, 0, 0, { 0xF608, 0x0065, 0xFFE4} }, +}; + +struct struct_80282C40 D_80285784[] = { + { 0, 0, 0, 186, 0, 0, { 0xF33E, 0x0009, 0x0053} }, + { 0, 0, 0, 89, 0, 0, { 0xF329, 0xFFA4, 0xFF8F} }, + { 0, 0, 0, 60, 0, 0, { 0xF39C, 0x004F, 0xFF2A} }, + { -1, 0, 0, 45, 0, 0, { 0xF44A, 0x00BE, 0xFF16} }, +}; + +struct struct_80282C40 D_802857B4[] = { + { 0, 0, 0, 0, 0, 0, { 0xF22C, 0xFFF4, 0x0067} }, + { -1, 0, 0, 0, 0, 0, { 0xF22C, 0xFFF4, 0x0067} }, +}; + +struct struct_80282C40 D_802857CC[] = { + { 0, 0, 0, 90, 0, 0, { 0xF3F8, 0xFFDB, 0xFC39} }, + { 0, 0, 0, 90, 0, 0, { 0xF419, 0xFFF8, 0xFC3B} }, + { -1, 0, 0, 101, 0, 0, { 0xF454, 0x000E, 0xFBFF} }, +}; + +struct struct_80282C40 D_802857F0[] = { + { 0, 0, 0, 0, 0, 0, { 0xF208, 0x004F, 0xFDC9} }, + { 0, 0, 0, 0, 0, 0, { 0xF20F, 0x004E, 0xFDCB} }, + { 0, 0, 0, 0, 0, 0, { 0xF23D, 0x0049, 0xFDDC} }, + { 0, 0, 0, 0, 0, 0, { 0xF284, 0x0044, 0xFDEF} }, + { 0, 0, 0, 0, 0, 0, { 0xF2BE, 0x0041, 0xFDFA} }, + { 0, 0, 0, 0, 0, 0, { 0xF2E5, 0x003E, 0xFE04} }, + { 0, 0, 0, 0, 0, 0, { 0xF303, 0x0039, 0xFE0A} }, + { -1, 0, 0, 0, 0, 0, { 0xF325, 0x0033, 0xFE11} }, +}; + +struct struct_80282C40 D_80285850[] = { + { 0, 0, 0, 30, 0, 0, { 0xF3D7, 0x0004, 0xFE77} }, + { 0, 0, 0, 30, 0, 0, { 0xF3E3, 0x000C, 0xFE6F} }, + { 0, 0, 0, 50, 0, 0, { 0xF421, 0x001E, 0xFE53} }, + { 0, 0, 0, 50, 0, 0, { 0xF468, 0x001C, 0xFE69} }, + { 0, 0, 0, 30, 0, 0, { 0xF4A4, 0x0016, 0xFE68} }, + { 0, 0, 0, 30, 0, 0, { 0xF4C9, 0xFFFE, 0xFE70} }, + { 0, 0, 0, 30, 0, 0, { 0xF4E3, 0xFFE1, 0xFE76} }, + { -1, 0, 0, 30, 0, 0, { 0xF505, 0xFFD1, 0xFE72} }, +}; + +struct struct_80282C40 D_802858B0[] = { + { 0, 0, 0, 0, 0, 0, { 0xF42B, 0x002D, 0xFE46} }, + { -1, 0, 0, 0, 0, 0, { 0xF42B, 0x002D, 0xFE46} }, +}; + +struct struct_80282C40 D_802858C8[] = { + { 0, 0, 0, 30, 0, 0, { 0xF246, 0x0073, 0xFDE7} }, + { -1, 0, 0, 30, 0, 0, { 0xF246, 0x0073, 0xFDE7} }, +}; + +struct struct_80282C40 D_802858E0[] = { + { 0, 0, 0, 0, 0, 0, { 0xF39F, 0x003C, 0xFE2F} }, + { -1, 0, 0, 0, 0, 0, { 0xF39F, 0x003C, 0xFE2F} }, +}; + +struct struct_80282C40 D_802858F8[] = { + { 0, 0, 0, 1, 0, 0, { 0xF245, 0x0187, 0xFDA1} }, + { -1, 0, 0, 1, 0, 0, { 0xF245, 0x0187, 0xFDA1} }, +}; + +struct struct_80282C40 D_80285910[] = { + { 0, 0, 0, 0, 0, 0, { 0xF4A0, 0x00B7, 0xFF6C} }, + { -1, 0, 0, 0, 0, 0, { 0xF4A0, 0x00B7, 0xFF6C} }, +}; + +struct struct_80282C40 D_80285928[] = { + { 0, 0, 0, 6, 0, 0, { 0xF340, 0x0025, 0xFE28} }, + { -1, 0, 0, 6, 0, 0, { 0xF340, 0x0025, 0xFE28} }, +}; + +// Is some of this unused? +struct struct_80282C40 D_80285940[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A } }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A } }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, + { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF203, 0xFF99, 0xFE62} }, + { 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, { 0xF200, 0xFFA4, 0xFE6D} }, + { 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, { 0xF1DA, 0x01AF, 0xFE7F} }, + { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1DA, 0x014B, 0xFE7F} }, + { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1DA, 0x00E7, 0xFE7F} }, + { 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, { 0xF1E1, 0x0015, 0xFE7D} }, + { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1E1, 0x000A, 0xFE71} }, + { 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1E0, 0x000C, 0xFE71} }, +}; + +struct Cutscene { + /* 0x0 */ void (*shot)(Camera*); + /* 0x4 */ s16 duration; + /* 0x6 */ //s16 pad; +}; /* size = 0x8 */ +extern struct Cutscene D_80285D10[]; +void func_80283D2C(CinematicCamera *camera) { + D_802856B8 = 120.0f; + cutscene_event(&func_80283CA8, camera, 0, 0); + cutscene_event(&func_80283A34, camera, 1, 1); + cutscene_event(&func_80283BF0, camera, 0, 0); + cutscene_event(&play_sound_balloon_pop, camera, 45, 45); + cutscene_event(&play_sound_balloon_pop, camera, 65, 65); + cutscene_event(&play_sound_balloon_pop, camera, 70, 70); + cutscene_event(&play_sound_balloon_pop, camera, 94, 94); + cutscene_event(&play_sound_balloon_pop, camera, 110, 110); + cutscene_event(&play_sound_balloon_pop, camera, 130, 130); + cutscene_event(&play_sound_balloon_pop, camera, 152, 152); + cutscene_event(&play_sound_balloon_pop, camera, 160, 160); + cutscene_event(&func_80283994, camera, D_80285D10[0].duration - 60, D_80285D10[0].duration - 60); + func_80282D90(camera, &D_802856DC, &D_80285718, 0); +} + +void func_80283EA0(Camera *camera) { + func_80282D90(camera, &D_80285754, &D_80285784, 0); +} + +void func_80283ED0(Camera *camera) { + vec3f_copy_dupe(camera->pos, gPlayerTwo->pos); +} + +void func_80283EF8(Camera *camera) { + f32_lerp(&camera->pos[0], gPlayerTwo->pos[0], 0.12f); + f32_lerp(&camera->pos[1], gPlayerTwo->pos[1], 0.12f); + f32_lerp(&camera->pos[2], gPlayerTwo->pos[2], 0.12f); +} + +void func_80283F6C(Camera *camera) { + cutscene_event(&func_80283ED0, camera, 0, 0); + cutscene_event(&func_80283EF8, camera, 0, -1); + func_80282E58(camera, &D_802857B4, 0); +} + +void func_80283FCC(Camera *camera) { + vec3f_copy_dupe(camera->pos, gPlayerThree->pos); +} + +void func_80283FF4(Camera *camera) { + f32_lerp(&camera->pos[0], gPlayerThree->pos[0], 0.12f); + f32_lerp(&camera->pos[1], gPlayerThree->pos[1], 0.12f); + f32_lerp(&camera->pos[2], gPlayerThree->pos[2], 0.12f); +} + +void func_80284068(Camera *camera) { + cutscene_event(&func_80283FCC, camera, 0, 0); + cutscene_event(&func_80283FF4, camera, 0, -1); + func_80282E58(camera, &D_802857CC, 0); +} + +void func_802840C8(Camera *camera) { + cutscene_event(&func_80283C14, camera, 5, 5); + + switch(D_802876D8) { + case 2: + func_80283EA0(camera); + break; + case 3: + func_80283F6C(camera); + break; + case 4: + func_80284068(camera); + break; + } +} + +void func_80284154(Camera *camera) { + func_80282D90(camera, &D_80285910, &D_80285928, 0); +} + +extern struct_80165C18_entry D_80165C20[]; +extern s32 D_80183EAC; + +void func_80284184(Camera *camera) +{ + f32 trophy; + trophy = ((D_80165C20[D_80183EAC].unk_000 - camera->lookAt[1]) * 0.899999976f) + camera->lookAt[1]; + f32_lerp(&camera->pos[1], trophy, 0.5); +} + +void func_802841E8(Camera *camera) { + func_80282E58(camera, &D_80285940, 0); + vec3f_set_dupe(camera->pos, -3202.0f, 90.0f, -478.0f); +} + +void func_8028422C(Camera *camera) { + cutscene_event(&play_sound_shoot_trophy, camera, 6, 6); + cutscene_event(&play_sound_trophy, camera, 30, 30); + cutscene_event(&func_802841E8, camera, 0, 0); + cutscene_event(&func_80284184, camera, 6, -1); +} + +void func_802842A8(Camera *camera) { + func_80282D90(camera, &D_802858B0, &D_802858C8, 0); +} + +void func_802842D8(Camera *camera) { + func_80282D90(camera, &D_802857F0, &D_80285850, 0); +} + +void func_80284308(Camera *camera) { + Player **sp30[4] = { + &gPlayerOne, + &gPlayerTwo, + &gPlayerThree, + &gPlayerFour + }; + Player *ply; + f32 x; + f32 y; + f32 z; + + cutscene_event(play_sound_congratulation, camera, 140, 140); + func_80282D90(camera, D_802858E0, D_802858F8, 0); + + ply = *(sp30[0] + D_802874F5); + + x = ply->pos[0] - gPlayerOne->pos[0]; + y = ply->pos[1] - gPlayerOne->pos[1]; + z = ply->pos[2] - gPlayerOne->pos[2]; + + camera->lookAt[0] += x; + camera->lookAt[2] += z; + camera->pos[0] += x; + camera->pos[2] += z; + camera->lookAt[1] += y; + camera->pos[1] += y; +} + +struct struct_80282C40 D_80285A10[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF33D, 0x002F, 0xFE5A} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF36B, 0x0028, 0xFE76} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A6, 0x0027, 0xFE6F} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C8, 0x002A, 0xFE4D} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3CF, 0x002F, 0xFE33} }, +}; + +struct struct_80282C40 D_80285A4C[] = { + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF4AC, 0xFFC1, 0xFD1A} }, + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF3D1, 0xFFF2, 0xFC8F} }, + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF2BA, 0xFFF2, 0xFCBA} }, + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF219, 0xFFF7, 0xFD56} }, + { 0xFF, 0x00, 0x00, 45, 0x00, 0x00, { 0xF1E8, 0xFFED, 0xFDD9} }, +}; + +struct struct_80282C40 D_80285A88[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D8, 0x0012, 0xFE0E} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D8, 0x0012, 0xFE0E} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D6, 0x001A, 0xFE0F} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D7, 0x001D, 0xFE0F} }, +}; + +struct struct_80282C40 D_80285AB8[] = { + { 0x00, 0x00, 0x00, 75, 0x00, 0x00, { 0xF1FB, 0x006C, 0xFE85} }, + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF1FB, 0x006C, 0xFE85} }, + { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF225, 0x00FB, 0xFE7A} }, + { 0xFF, 0x00, 0x00, 45, 0x00, 0x00, { 0xF21C, 0x00EB, 0xFE7C} }, +}; + +struct struct_80282C40 D_80285AE8[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A3, 0x004C, 0xFE22} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A3, 0x004C, 0xFE22} }, +}; + +struct struct_80282C40 D_80285B00[] = { + { 0x00, 0x00, 0x00, 30, 0x00, 0x00, { 0xF1BA, 0x0092, 0xFE22} }, + { 0xFF, 0x00, 0x00, 30, 0x00, 0x00, { 0xF1BA, 0x0092, 0xFE22} }, +}; + +struct struct_80282C40 D_80285B18[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF496, 0x0029, 0xFF27} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF496, 0x0029, 0xFF27} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4D5, 0xFFE3, 0xFF70} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54D, 0xFFE8, 0xFF9B} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54D, 0xFFE8, 0xFF9B} }, +}; + +struct struct_80282C40 D_80285B54[] = { + { 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, { 0xF307, 0x012F, 0xFE96} }, + { 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, { 0xF307, 0x012F, 0xFE96} }, + { 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, { 0xF326, 0x00CE, 0xFF12} }, + { 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, { 0xF35A, 0x0000, 0xFF9E} }, + { 0xFF, 0x00, 0x00, 0x41, 0x00, 0x00, { 0xF35A, 0x0000, 0xFF9E} }, +}; + +struct struct_80282C40 D_80285B90[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF5BB, 0x0008, 0xFE7E} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF5BB, 0x0008, 0xFE7E} }, +}; + +struct struct_80282C40 D_80285BA8[] = { + { 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, { 0xF7A6, 0x0044, 0xFECC} }, + { 0xFF, 0x00, 0x00, 0x05, 0x00, 0x00, { 0xF7A6, 0x0044, 0xFECC} }, + +// Unused? What's going on here? D_80285BC0 (no label existed) + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF6B9, 0x0021, 0xFEA5} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF6CD, 0x001B, 0xFEA9} }, + + { 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, + { 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, + { 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, + { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF4CE, 0x0046, 0xFE4D} }, + { 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF4EB, 0x0084, 0xFE5C} }, +}; + +struct struct_80282C40 D_80285C38[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4ED, 0xFFEB, 0xFF66} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4ED, 0xFFEB, 0xFF66} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF408, 0x0028, 0xFE82} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF32B, 0x0062, 0xFDD6} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF2A4, 0x006A, 0xFDA5} }, +}; + +struct struct_80282C40 D_80285C74[] = { + { 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, { 0xF616, 0xFFD8, 0x00F7} }, + { 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, { 0xF616, 0xFFD8, 0x00F7} }, + { 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, { 0xF558, 0xFFBB, 0xFFE4} }, + { 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, { 0xF481, 0xFFF0, 0xFF30} }, + { 0xFF, 0x00, 0x00, 0x28, 0x00, 0x00, { 0xF414, 0xFFED, 0xFEE1} }, +}; + +struct struct_80282C40 D_80285CB0[] = { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF551, 0xFFE7, 0xFFA5} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF551, 0xFFE7, 0xFFA5} }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54E, 0xFFE7, 0xFF82} }, + { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF544, 0xFFFA, 0xFF74} }, +}; + +struct struct_80282C40 D_80285CE0[] = { + { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF362, 0xFFF3, 0xFF62} }, + { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF362, 0xFFF3, 0xFF62} }, + { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF392, 0xFFF3, 0x0068} }, + { 0xFF, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF3E1, 0xFF47, 0x00A2} }, +}; + +void func_80284308(Camera *); + +struct Cutscene D_80285D10[] = { + { func_80283D2C, 330 }, + { func_802840C8, 270 }, + { func_802842D8, 247 }, + { func_80284418, 200 }, + { func_80284494, 170 }, + { func_802844FC, 108 }, + { func_8028422C, 140 }, + { func_802842A8, 270 }, + { func_80284308, 0x7FFF }, +}; + +void func_80284418(Camera *camera) { + cutscene_event(&play_sound_podium, camera, 0x52, 0x52); + cutscene_event(&play_sound_podium, camera, 0x48, 0x48); + cutscene_event(&play_sound_podium, camera, 0x3D, 0x3D); + func_80282D90(camera, &D_80285A10, &D_80285A4C, 0); +} + +void func_80284494(Camera *camera) { + cutscene_event(&play_sound_fish_2, camera, 0x1E, 0x1E); + cutscene_event(&func_80283968, camera, 0, 0); + func_80282D90(camera, &D_80285A88, &D_80285AB8, 0); +} + +void func_802844FC(Camera *camera) { + cutscene_event(&play_sound_fish, camera, 0x3B, 0x3B); + func_80282D90(camera, &D_80285AE8, &D_80285B00, 0); +} + +void func_8028454C(Camera *camera) { + cutscene_event(&func_80283CA8, camera, 0, 0); + cutscene_event(&func_80283A34, camera, 1, 1); + cutscene_event(&func_80283C38, camera, 0, 0); + cutscene_event(&func_80283994, camera, 0x3C, 0x3C); + func_80282D90(camera, &D_80285B18, &D_80285B54, 0); +} + +void func_802845EC(Camera *camera) { + func_80282D90(camera, &D_80285B90, &D_80285BA8, 0); +} + +void func_8028461C(Camera *camera) { + func_80283240(1); + func_80283B6C(camera); +} + +void func_80284648(Camera *camera) { + cutscene_event(&func_802845EC, camera, 0, 0); + cutscene_event(&func_8028461C, camera, 0x110, 0x110); + cutscene_event(&func_80283BA4, camera, 0x115, 0x115); +} + +UNUSED void func_802846AC(void) { + +} + +void func_802846B4(Camera *camera) { + func_80282D90(camera, &D_80285C38, &D_80285C74, 0); +} + +// todo: What does this even do? +void func_802846E4(Camera *camera) { + + func_80282D90(camera, &D_80285CB0, &D_80285CE0, 0); + camera->lookAt[0] += (gPlayerFour->pos[0] - -2796.0f); // <-- rodata + camera->lookAt[1] += (gPlayerFour->pos[1] - -29.0f); + camera->lookAt[2] += (gPlayerFour->pos[2] - -97.0f); + camera->pos[0] += (gPlayerFour->pos[0] - -2796.0f); + camera->pos[1] += (gPlayerFour->pos[1] - -29.0f); + camera->pos[2] += (gPlayerFour->pos[2] - -97.0f); +} + +struct Cutscene D_80285D58[] = { + { func_8028454C, 300 }, + { func_80284154, 175 }, + { func_802846B4, 200 }, + { func_802846E4, 184 }, + { func_80284648, 0x7FFF }, +}; + +struct struct_80285D80 D_80285D80[] = { + { 0, 0, 0, 0, 0, 0, { 0xffc6, 0x0000, 0xfc02 }}, + { 0, 0, 0, 0, 4, 0, { 0xffb9, 0x0005, 0xff53 }}, + { 0, 0, 0, 0, 10, 0, { 0xfec3, 0x0036, 0x009e }}, + { -1, 0, 0, 0, 0, 0, { 0xfc1a, 0xffdd, 0x0298 }}, + + { 0, 0, 0, 60, 0, 0, { 0xfeb1, 0xff45, 0xfd76 }}, + { 0, 0, 0, 60, 4, 0, { 0xfea7, 0xff73, 0x00da }}, + { 0, 0, 0, 60, 10, 0, { 0xfd94, 0xff9b, 0x020b }}, + { -1, 0, 0, 60, 0, 0, { 0xfa7b, 0x003c, 0x039c }}, + + { 0, 0, 0, 0, 0, 0, { 0x04a7, 0x004f, 0x060b }}, + { 0, 0, 0, 0, 0, 0, { 0x04a7, 0x004f, 0x060b }}, + { 0, 0, 0, 0, 0, 0, { 0x048a, 0x0068, 0x059a }}, + { 0, 0, 0, 0, 0, 0, { 0x0501, 0x0070, 0x04b7 }}, + { -1, 0, 0, 0, 0, 0, { 0x0569, 0x0042, 0x0410 }}, + { 0, 0, 0, 18, 0, 0, { 0x051c, 0x00b9, 0x07e5 }}, + { 0, 0, 0, 40, 0, 0, { 0x051c, 0x00b9, 0x07e5 }}, + { 0, 0, 0, 50, 0, 0, { 0x04f6, 0x0032, 0x077f }}, + { 0, 0, 0, 50, 0, 0, { 0x040d, 0x0023, 0x0664 }}, + { -1, 0, 0, 50, 0, 0, { 0x044d, 0x000c, 0x05a8 }}, + { 0, 0, 0, 0, 0, 0, { 0x00d1, 0x0070, 0xf5ab }}, + { 0, 0, 0, 0, 0, 0, { 0x00d1, 0x0070, 0xf5ab }}, + { 0, 0, 0, 0, 0, 0, { 0x0145, 0x0043, 0xf624 }}, + { -1, 0, 0, 0, 0, 0, { 0x01bb, 0x001b, 0xf6a9 }}, + { 0, 0, 0, 20, 0, 0, { 0x01be, 0xff8b, 0xf723 }}, + { 0, 0, 0, 30, 0, 0, { 0x01be, 0xff8b, 0xf721 }}, + { 0, 0, 0, 60, 0, 0, { 0x023d, 0xff7a, 0xf7a5 }}, + { -1, 0, 0, 60, 0, 0, { 0x02bb, 0x0047, 0xf854 }}, + { 0, 0, 0, 0, 0, 0, { 0xfd1a, 0x001f, 0x0aaa }}, + { 0, 0, 0, 0, 0, 0, { 0xfd1a, 0x0016, 0x0890 }}, + { 0, 0, 0, 0, 0, 0, { 0xfd1b, 0x0017, 0x05ee }}, + { 0, 0, 0, 0, 0, 0, { 0xfd24, 0x0013, 0x0325 }}, + { 0, 0, 0, 0, 0, 0, { 0xfcab, 0x0010, 0x01af }}, + { 0, 0, 0, 0, 0, 0, { 0xfb52, 0x0013, 0x0094 }}, + { 0, 0, 0, 0, 0, 0, { 0xfa51, 0x001a, 0x0055 }}, + { -1, 0, 0, 0, 0, 0, { 0xf8f5, 0x001b, 0x0053 }}, + { 0, 0, 0, 50, 0, 0, { 0xfd1f, 0xfeb7, 0x094f }}, + { 0, 0, 0, 50, 0, 0, { 0xfd21, 0xffdf, 0x069f }}, + { 0, 0, 0, 50, 0, 0, { 0xfd35, 0x0012, 0x03fa }}, + { 0, 0, 0, 30, 0, 0, { 0xfd32, 0xffe5, 0x0133 }}, + { 0, 0, 0, 30, 0, 0, { 0xfb92, 0x000e, 0x0011 }}, + { 0, 0, 0, 30, 0, 0, { 0xf993, 0x001c, 0xffb7 }}, + { 0, 0, 0, 40, 0, 0, { 0xf866, 0x0009, 0xfffb }}, + { -1, 0, 0, 30, 0, 0, { 0xf712, 0xffe7, 0x00c8 }}, + { 0, 0, 0, 0, 0, 0, { 0x079c, 0x00de, 0xf99e }}, + { 0, 0, 0, 0, 0, 0, { 0x079c, 0x00de, 0xf99e }}, + { 0, 0, 0, 0, 0, 0, { 0x077f, 0x0099, 0xf9a6 }}, + { 0, 0, 0, 0, 0, 0, { 0x0784, 0x005b, 0xf9a2 }}, + { 0, 0, 0, 0, 0, 0, { 0x0784, 0x005b, 0xf9a2 }}, + { -1, 0, 0, 0, 0, 0, { 0x0784, 0x005b, 0xf9a2 }}, + { 0, 0, 0, 55, 0, 0, { 0x0886, 0xffaa, 0xf863 }}, + { 0, 0, 0, 55, 0, 0, { 0x0887, 0xffaa, 0xf864 }}, + { 0, 0, 0, 55, 0, 0, { 0x0960, 0x0010, 0xf9ad }}, + { 0, 0, 0, 66, 0, 0, { 0x092b, 0x009e, 0xfaa4 }}, + { 0, 0, 0, 50, 0, 0, { 0x0930, 0x00a9, 0xfa98 }}, + { 0, 0, 0, 50, 0, 0, { 0x0932, 0x00a9, 0xfa95 }}, + { -1, 0, 0, 50, 0, 0, { 0x092f, 0x00a1, 0xfa9c }}, + { 0, 0, 0, 0, 0, 0, { 0xff37, 0x002d, 0xf9ab }}, + { 0, 0, 0, 0, 0, 0, { 0x007b, 0x0035, 0xfaef }}, + { 0, 0, 0, 0, 0, 0, { 0x01a6, 0x002d, 0xfc8e }}, + { -1, 0, 0, 0, 0, 0, { 0x0228, 0x0035, 0xfdad }}, + { 0, 0, 0, 60, 0, 0, { 0xfdc7, 0xffe6, 0xfaf6 }}, + { 0, 0, 0, 60, 0, 0, { 0xfed8, 0xffee, 0xfbf4 }}, + { 0, 0, 0, 60, 0, 0, { 0xffdc, 0xffe6, 0xfd46 }}, + { -1, 0, 0, 60, 0, 0, { 0x004b, 0xffe7, 0xfe2d }}, + { 0, 0, 0, 0, 0, 0, { 0xfc11, 0xffcd, 0x0096 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc11, 0xffcd, 0x0096 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc16, 0x0096, 0x007c }}, + { 0, 0, 0, 0, 0, 0, { 0xfc1e, 0x01e9, 0x0049 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc2c, 0x0419, 0xfff4 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc4e, 0x0615, 0xffc1 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc31, 0x077f, 0xfff1 }}, + { -1, 0, 0, 0, 0, 0, { 0xfc31, 0x077f, 0xfff1 }}, + { 0, 0, 0, 50, 0, 0, { 0xfc60, 0xff8e, 0xfead }}, + { 0, 0, 0, 26, 0, 0, { 0xfc61, 0xff85, 0xfeae }}, + { 0, 0, 0, 45, 0, 0, { 0xfc64, 0x0015, 0xfe9f }}, + { 0, 0, 0, 40, 0, 0, { 0xfc66, 0x0104, 0xfe93 }}, + { 0, 0, 0, 40, 0, 0, { 0xfcf6, 0x02c5, 0xfec2 }}, + { 0, 0, 0, 33, 0, 0, { 0xfcd2, 0x0446, 0xff38 }}, + { 0, 0, 0, 30, 0, 0, { 0xfc82, 0x05b0, 0xff46 }}, + { -1, 0, 0, 37, 0, 0, { 0xfc7d, 0x05ac, 0xff4d }}, + { 0, 0, 0, 0, 235, 0, { 0xfffb, 0x0047, 0xfe2b }}, + { 0, 0, 0, 0, 225, 0, { 0xfff5, 0x0015, 0xfb8a }}, + { 0, 0, 0, 0, 245, 0, { 0x0143, 0x001f, 0xfab2 }}, + { 0, 0, 0, 0, 39, 0, { 0x0230, 0x001d, 0xfaee }}, + { 0, 0, 0, 0, 25, 0, { 0x0294, 0x0012, 0xfb89 }}, + { 0, 0, 0, 0, 228, 0, { 0x04b4, 0x001c, 0xfb7b }}, + { 0, 0, 0, 0, 226, 0, { 0x0545, 0x0011, 0xfc7c }}, + { 0, 0, 0, 0, 244, 0, { 0x04aa, 0x001b, 0xfd89 }}, + { 0, 0, 0, 0, 0, 0, { 0x02f5, 0x000c, 0xfde2 }}, + { 0, 0, 0, 0, 0, 0, { 0x00cd, 0xffd6, 0xfde5 }}, + { 0, 0, 0, 0, 13, 0, { 0xfefa, 0xffdd, 0xfdcf }}, + { 0, 0, 0, 0, 16, 0, { 0xfdd8, 0xfff9, 0xfe2b }}, + { -1, 0, 0, 0, 0, 0, { 0xfd15, 0x0006, 0xff68 }}, + { 0, 0, 0, 30, 235, 0, { 0x0002, 0xffcd, 0xfc47 }}, + { 0, 0, 0, 30, 225, 0, { 0x00f6, 0xffc1, 0xf9e6 }}, + { 0, 0, 0, 30, 245, 0, { 0x032d, 0xffbe, 0xfaad }}, + { 0, 0, 0, 20, 39, 0, { 0x02c7, 0xffff, 0xfcca }}, + { 0, 0, 0, 30, 25, 0, { 0x047b, 0xffb4, 0xfb52 }}, + { 0, 0, 0, 20, 228, 0, { 0x05eb, 0xffed, 0xfcff }}, + { 0, 0, 0, 30, 226, 0, { 0x053d, 0xffbc, 0xfe69 }}, + { 0, 0, 0, 30, 244, 0, { 0x02c8, 0xffb7, 0xfde1 }}, + { 0, 0, 0, 30, 0, 0, { 0x0104, 0xffd6, 0xfe02 }}, + { 0, 0, 0, 30, 0, 0, { 0xfedf, 0xff8c, 0xfdef }}, + { 0, 0, 0, 30, 13, 0, { 0xfd19, 0xff9e, 0xfe46 }}, + { 0, 0, 0, 30, 16, 0, { 0xfcc0, 0xffcd, 0xffc7 }}, + { -1, 0, 0, 30, 0, 0, { 0xfc30, 0x0060, 0x011a }}, + { 0, 0, 0, 0, 0, 0, { 0xf4cf, 0x0217, 0x07f0 }}, + { 0, 0, 0, 0, 0, 0, { 0xf575, 0x018b, 0x0622 }}, + { 0, 0, 0, 0, 0, 0, { 0xf5e3, 0x0123, 0x04ee }}, + { 0, 0, 0, 0, 0, 0, { 0xf6a2, 0x01a8, 0x02dc }}, + { 0, 0, 0, 0, 0, 0, { 0xf68b, 0x0262, 0x0050 }}, + { 0, 0, 0, 0, 0, 0, { 0xf7b5, 0x0189, 0xfcdb }}, + { -1, 0, 0, 0, 0, 0, { 0xf8a8, 0x012d, 0xf7e1 }}, + { 0, 0, 0, 30, 0, 0, { 0xf558, 0x00f2, 0x0673 }}, + { 0, 0, 0, 30, 0, 0, { 0xf5fe, 0x0065, 0x04a5 }}, + { 0, 0, 0, 30, 0, 0, { 0xf665, 0xffe3, 0x0385 }}, + { 0, 0, 0, 30, 0, 0, { 0xf771, 0x011d, 0x012a }}, + { 0, 0, 0, 30, 0, 0, { 0xf7f7, 0x0186, 0xff48 }}, + { 0, 0, 0, 30, 0, 0, { 0xf873, 0x0116, 0xfe9c }}, + { -1, 0, 0, 42, 0, 0, { 0xf86d, 0x00e0, 0xf9cc }}, + { 0, 0, 0, 0, 0, 0, { 0x06d4, 0x00a6, 0xfae3 }}, + { 0, 0, 0, 0, 0, 0, { 0x06d4, 0x00a6, 0xfae3 }}, + { 0, 0, 0, 0, 0, 0, { 0x06fe, 0x0066, 0xf9cf }}, + { 0, 0, 0, 0, 0, 0, { 0x04f6, 0x0046, 0xf966 }}, + { 0, 0, 0, 0, 0, 0, { 0x017c, 0x0053, 0xfa6c }}, + { 0, 0, 0, 0, 0, 0, { 0xfec9, 0x003a, 0xfc36 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc6f, 0xffde, 0xfdc0 }}, + { 0, 0, 0, 0, 0, 0, { 0xfb17, 0xffbe, 0xfec7 }}, + { -1, 0, 0, 0, 0, 0, { 0xf96a, 0x00ab, 0x011b }}, + { 0, 0, 0, 9, 0, 0, { 0x06db, 0xffd3, 0xfca8 }}, + { 0, 0, 0, 30, 0, 0, { 0x06dc, 0xffdc, 0xfcac }}, + { 0, 0, 0, 25, 0, 0, { 0x077f, 0xffbe, 0xfb94 }}, + { 0, 0, 0, 25, 0, 0, { 0x06b5, 0xffbd, 0xfa16 }}, + { 0, 0, 0, 25, 0, 0, { 0x0359, 0xffd6, 0xfa1e }}, + { 0, 0, 0, 25, 0, 0, { 0x005b, 0xffb1, 0xfb2f }}, + { 0, 0, 0, 25, 0, 0, { 0xfdee, 0xff57, 0xfc9c }}, + { 0, 0, 0, 25, 0, 0, { 0xfc95, 0xff34, 0xfda4 }}, + { -1, 0, 0, 25, 0, 0, { 0xfa96, 0xfff6, 0xffb7 }}, + { 0, 0, 0, 0, 0, 0, { 0xfaef, 0xff6e, 0xfdaa }}, + { 0, 0, 0, 0, 0, 0, { 0xfaef, 0xff6e, 0xfdaa }}, + { 0, 0, 0, 0, 0, 0, { 0xfb54, 0xff68, 0xfdbf }}, + { 0, 0, 0, 0, 0, 0, { 0xfbb5, 0xff64, 0xfde0 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc0d, 0xff64, 0xfdfa }}, + { 0, 0, 0, 0, 0, 0, { 0xfc9f, 0xff64, 0xfe2b }}, + { 0, 0, 0, 0, 0, 0, { 0xfd80, 0xff61, 0xfe99 }}, + { 0, 0, 0, 0, 0, 0, { 0xfdca, 0xff66, 0xfeab }}, + { -1, 0, 0, 0, 0, 0, { 0xfe06, 0xff6d, 0xfebf }}, + { 0, 0, 0, 30, 0, 0, { 0xf911, 0xff0f, 0xfe1a }}, + { 0, 0, 0, 30, 0, 0, { 0xf911, 0xff0f, 0xfe1a }}, + { 0, 0, 0, 35, 0, 0, { 0xf9dd, 0xfe99, 0xfec0 }}, + { 0, 0, 0, 35, 0, 0, { 0xfb37, 0xfe86, 0xff8e }}, + { 0, 0, 0, 35, 0, 0, { 0xfcc7, 0xfe7a, 0xff8b }}, + { 0, 0, 0, 35, 0, 0, { 0xfe21, 0xff1d, 0xff62 }}, + { 0, 0, 0, 38, 0, 0, { 0xff5c, 0xff8e, 0xff2e }}, + { 0, 0, 0, 30, 0, 0, { 0xffa1, 0xff56, 0xff54 }}, + { -1, 0, 0, 30, 0, 0, { 0xffdf, 0xff4e, 0xff5d }}, + { 0, 0, 0, 0, 0, 0, { 0x0326, 0x0016, 0xfbe5 }}, + { 0, 0, 0, 0, 0, 0, { 0x0326, 0x0016, 0xfbe5 }}, + { 0, 0, 0, 0, 0, 0, { 0x0279, 0x001c, 0xfbdc }}, + { 0, 0, 0, 0, 0, 0, { 0x00e2, 0x0014, 0xfc78 }}, + { 0, 0, 0, 0, 0, 0, { 0x0010, 0x0015, 0xfdcf }}, + { 0, 0, 0, 0, 0, 0, { 0xffa5, 0x006f, 0xfead }}, + { -1, 0, 0, 0, 0, 0, { 0xffb3, 0x008e, 0xff63 }}, + { 0, 0, 0, 30, 0, 0, { 0x0381, 0xffa1, 0xfdc3 }}, + { 0, 0, 0, 30, 0, 0, { 0x0381, 0xffa1, 0xfdc3 }}, + { 0, 0, 0, 35, 0, 0, { 0x0237, 0xff21, 0xfd88 }}, + { 0, 0, 0, 35, 0, 0, { 0x005d, 0xff63, 0xfe39 }}, + { 0, 0, 0, 35, 0, 0, { 0xfef8, 0x007d, 0xff60 }}, + { 0, 0, 0, 30, 0, 0, { 0xfe07, 0x00c8, 0xffb7 }}, + { -1, 0, 0, 30, 0, 0, { 0xfdc3, 0x00d1, 0xff6a }}, + { 0, 0, 0, 0, 0, 0, { 0xfff9, 0x004d, 0xfd4b }}, + { 0, 0, 0, 0, 0, 0, { 0xff2a, 0x009e, 0xfcf8 }}, + { 0, 0, 0, 0, 0, 0, { 0xfe1b, 0x0174, 0xfd03 }}, + { 0, 0, 0, 0, 0, 0, { 0xfc2c, 0x0163, 0xfbea }}, + { 0, 0, 0, 0, 0, 0, { 0xfbc2, 0x003c, 0xfaa3 }}, + { 0, 0, 0, 0, 0, 0, { 0xfbf4, 0x0012, 0xf87d }}, + { -1, 0, 0, 0, 0, 0, { 0xfbf4, 0x0012, 0xf87d }}, + { 0, 0, 0, 37, 0, 0, { 0xfedb, 0xff54, 0xfc06 }}, + { 0, 0, 0, 37, 0, 0, { 0xfeb0, 0xff91, 0xfb66 }}, + { 0, 0, 0, 37, 0, 0, { 0xfe79, 0x0070, 0xfb62 }}, + { 0, 0, 0, 37, 0, 0, { 0xfde5, 0x00ac, 0xfb55 }}, + { 0, 0, 0, 37, 0, 0, { 0xfd9b, 0x0079, 0xfb3c }}, + { 0, 0, 0, 48, 0, 0, { 0xfd0d, 0x0037, 0xfa1a }}, + { -1, 0, 0, 30, 0, 0, { 0xfd20, 0x001d, 0xfa0d }}, + { 0, 0, 0, 0, 0, 0, { 0x0032, 0x0017, 0xfb25 }}, + { 0, 0, 0, 0, 0, 0, { 0x0032, 0x0011, 0xf7f3 }}, + { 0, 0, 0, 0, 0, 0, { 0xffef, 0x000a, 0xf6b4 }}, + { 0, 0, 0, 0, 0, 0, { 0xff34, 0x0008, 0xf54e }}, + { 0, 0, 0, 0, 0, 0, { 0xfe63, 0x0009, 0xf494 }}, + { 0, 0, 0, 0, 0, 0, { 0xfdd3, 0x0005, 0xf436 }}, + { 0, 0, 0, 0, 0, 0, { 0xfcc0, 0x0005, 0xf3ec }}, + { 0, 0, 0, 0, 0, 0, { 0xfba1, 0x0004, 0xf3e5 }}, + { 0, 0, 0, 0, 0, 0, { 0xfa43, 0x0002, 0xf3d4 }}, + { -1, 0, 0, 0, 0, 0, { 0xf96d, 0x0003, 0xf3f1 }}, + { 0, 0, 0, 30, 0, 0, { 0x0032, 0xff86, 0xf947 }}, + { 0, 0, 0, 30, 0, 0, { 0x0042, 0xff4f, 0xf627 }}, + { 0, 0, 0, 30, 0, 0, { 0x0181, 0xff13, 0xf612 }}, + { 0, 0, 0, 30, 0, 0, { 0x00eb, 0xff7e, 0xf60e }}, + { 0, 0, 0, 30, 0, 0, { 0x002b, 0xffc5, 0xf554 }}, + { 0, 0, 0, 30, 0, 0, { 0xff90, 0xffb2, 0xf508 }}, + { 0, 0, 0, 30, 0, 0, { 0xfeb4, 0x0011, 0xf3e0 }}, + { 0, 0, 0, 30, 0, 0, { 0xfd8c, 0x001a, 0xf386 }}, + { 0, 0, 0, 30, 0, 0, { 0xfc2b, 0x0067, 0xf3ae }}, + { -1, 0, 0, 30, 0, 0, { 0xfb56, 0x0051, 0xf3ac }}, + { 0, 0, 0, 0, 0, 0, { 0xf49d, 0x001e, 0x003a }}, + { 0, 0, 0, 0, 0, 0, { 0xf4c9, 0x003c, 0x0039 }}, + { 0, 0, 0, 0, 0, 0, { 0xf4f7, 0x005a, 0x0038 }}, + { 0, 0, 0, 0, 0, 0, { 0xf4f7, 0x005a, 0x0038 }}, + { 0, 0, 0, 0, 0, 0, { 0xf535, 0x0057, 0x0036 }}, + { 0, 0, 0, 0, 0, 0, { 0xf6ae, 0x0036, 0x001d }}, + { 0, 0, 0, 0, 0, 0, { 0xf6ce, 0x0031, 0x001c }}, + { -1, 0, 0, 0, 0, 0, { 0xf6ce, 0x0031, 0x001c }}, + { 0, 0, 0, 80, 0, 0, { 0xf669, 0xff5a, 0x004d }}, + { 0, 0, 0, 80, 0, 0, { 0xf69d, 0xff8d, 0x004b }}, + { 0, 0, 0, 80, 0, 0, { 0xf6d6, 0xffc8, 0x003b }}, + { 0, 0, 0, 5, 0, 0, { 0xf6d9, 0xffd3, 0x0040 }}, + { 0, 0, 0, 3, 0, 0, { 0xf717, 0xffd0, 0x0045 }}, + { 0, 0, 0, 4, 0, 0, { 0xf894, 0xffc5, 0x000f }}, + { 0, 0, 0, 4, 0, 0, { 0xf8b8, 0xffcc, 0x001a }}, + { -1, 0, 0, 4, 0, 0, { 0xf8b8, 0xffcc, 0x0014 }}, + { 0, 0, 0, 0, 0, 0, { 0xff61, 0x03ce, 0xf2bf }}, + { 0, 0, 0, 0, 0, 0, { 0xfd33, 0x038d, 0xf40f }}, + { 0, 0, 0, 0, 0, 0, { 0xfc59, 0x0366, 0xf4df }}, + { 0, 0, 0, 0, 0, 0, { 0xfbe7, 0x0321, 0xf5d5 }}, + { 0, 0, 0, 0, 0, 0, { 0xfb9a, 0x02a9, 0xf704 }}, + { 0, 0, 0, 0, 0, 0, { 0xfb58, 0x0220, 0xf8b1 }}, + { 0, 0, 0, 0, 0, 0, { 0xfabf, 0x01f3, 0xfa36 }}, + { 0, 0, 0, 0, 0, 0, { 0xf9f2, 0x01ef, 0xfb8d }}, + { 0, 0, 0, 0, 0, 0, { 0xf943, 0x01fe, 0xfd31 }}, + { 0, 0, 0, 0, 0, 0, { 0xf950, 0x0200, 0xfea3 }}, + { 0, 0, 0, 0, 0, 0, { 0xf9cd, 0x0214, 0xff83 }}, + { 0, 0, 0, 0, 0, 0, { 0xface, 0x022d, 0x000d }}, + { -1, 0, 0, 0, 0, 0, { 0xfbd8, 0x0231, 0x000d }}, + { 0, 0, 0, 20, 0, 0, { 0xfea7, 0x033c, 0xf478 }}, + { 0, 0, 0, 20, 0, 0, { 0xfcb7, 0x0306, 0xf5e1 }}, + { 0, 0, 0, 20, 0, 0, { 0xfbf7, 0x02d4, 0xf6b4 }}, + { 0, 0, 0, 20, 0, 0, { 0xfb96, 0x0278, 0xf7a5 }}, + { 0, 0, 0, 20, 0, 0, { 0xfb66, 0x0217, 0xf8e0 }}, + { 0, 0, 0, 20, 0, 0, { 0xfb26, 0x01c5, 0xfa9b }}, + { 0, 0, 0, 20, 0, 0, { 0xfadd, 0x01eb, 0xfc29 }}, + { 0, 0, 0, 28, 0, 0, { 0xfa89, 0x0208, 0xfd69 }}, + { 0, 0, 0, 29, 0, 0, { 0xfaf3, 0x020a, 0xfe2d }}, + { 0, 0, 0, 28, 0, 0, { 0xfb2b, 0x0226, 0xfe09 }}, + { 0, 0, 0, 28, 0, 0, { 0xfb39, 0x0216, 0xfe2c }}, + { 0, 0, 0, 28, 0, 0, { 0xfb08, 0x0202, 0xfe1f }}, + { -1, 0, 0, 28, 0, 0, { 0xfb31, 0x023f, 0xfe38 }}, + { 0, 0, 0, 0, 0, 0, { 0xfe5d, 0x01f9, 0xf67a }}, + { 0, 0, 0, 0, 0, 0, { 0xfd7a, 0x0136, 0xf7ab }}, + { 0, 0, 0, 0, 0, 0, { 0xfb8b, 0x0066, 0xfa4f }}, + { 0, 0, 0, 0, 0, 0, { 0xf9c4, 0x0032, 0xfc9f }}, + { 0, 0, 0, 0, 0, 0, { 0xf7b6, 0x0022, 0xfdda }}, + { 0, 0, 0, 0, 0, 0, { 0xf771, 0x0054, 0xfdec }}, + { -1, 0, 0, 0, 0, 0, { 0xf7df, 0x00a6, 0xfed5 }}, + { 0, 0, 0, 30, 0, 0, { 0xfd5a, 0x0107, 0xf7db }}, + { 0, 0, 0, 30, 0, 0, { 0xfc6f, 0x0063, 0xf918 }}, + { 0, 0, 0, 30, 0, 0, { 0xfa65, 0x002e, 0xfbe0 }}, + { 0, 0, 0, 30, 0, 0, { 0xf843, 0x0010, 0xfddc }}, + { 0, 0, 0, 30, 0, 0, { 0xf5d2, 0x000c, 0xfe55 }}, + { 0, 0, 0, 30, 0, 0, { 0xf57e, 0x006c, 0xfde9 }}, + { -1, 0, 0, 30, 0, 0, { 0xf5f2, 0x00a8, 0xfe82 }}, + { 0, 0, 0, 0, 0, 0, { 0xf8e5, 0x0181, 0x054b }}, + { 0, 0, 0, 0, 0, 0, { 0xfae4, 0x00b9, 0x0556 }}, + { 0, 0, 0, 0, 0, 0, { 0xfccc, 0x0010, 0x0556 }}, + { -1, 0, 0, 0, 0, 0, { 0xfd42, 0x0047, 0x056d }}, + { 0, 0, 0, 70, 0, 0, { 0xf88a, 0x00e8, 0x0378 }}, + { 0, 0, 0, 70, 0, 0, { 0xfc3e, 0x001d, 0x0410 }}, + { 0, 0, 0, 70, 0, 0, { 0xfea3, 0x0041, 0x05f7 }}, + { -1, 0, 0, 70, 0, 0, { 0xfeda, 0x0109, 0x0642 }}, +}; + +struct struct_80286A10 { + u16 unk0[4]; + struct struct_80285D80 *unk8; + struct struct_80285D80 *unkC; +}; + +// 0xC90 (80285D80 size) 3216 decimal. +struct struct_80286A04 D_80286A04[] = { + + { 0x01, 0x00, &D_80285D80[162], &D_80285D80[162], 0x0096 }, + { 0x00, 0x08, &D_80285D80[0], &D_80285D80[4], 0x00F1 }, + { 0x00, 0x09, &D_80285D80[8], &D_80285D80[13], 0x00F1 }, + { 0x00, 0x0B, &D_80285D80[26], &D_80285D80[34], 0x00F1 }, + { 0x00, 0x05, &D_80285D80[18], &D_80285D80[22], 0x00F1 }, + { 0x00, 0x02, &D_80285D80[42], &D_80285D80[48], 0x00F1 }, + { 0x00, 0x0E, &D_80285D80[259], &D_80285D80[263], 0x00F1 }, + { 0x00, 0x0C, &D_80285D80[55], &D_80285D80[59], 0x00F1 }, + { 0x00, 0x07, &D_80285D80[63], &D_80285D80[71], 0x00F1 }, + { 0x00, 0x01, &D_80285D80[79], &D_80285D80[92], 0x00F1 }, + { 0x00, 0x04, &D_80285D80[105], &D_80285D80[112], 0x00F1 }, + { 0x00, 0x12, &D_80285D80[119], &D_80285D80[128], 0x00F0 }, + { 0x00, 0x00, &D_80285D80[155], &D_80285D80[162], 0x00F0 }, + { 0x00, 0x06, &D_80285D80[169], &D_80285D80[176], 0x00F0 }, + { 0x00, 0x0A, &D_80285D80[183], &D_80285D80[193], 0x00F0 }, + { 0x00, 0x03, &D_80285D80[203], &D_80285D80[211], 0x00F0 }, + { 0x00, 0x0D, &D_80285D80[219], &D_80285D80[232], 0x00F0 }, + { 0x01, 0x00, &D_80285D80[162], &D_80285D80[162], 0x00F2 }, + { 0x02, 0x07, &D_80285D80[245], &D_80285D80[252], 0x00F0 }, +}; + + +u16 D_80286B34[] = { + 0x0096, 0x00F3, 0x00F3, 0x00F3, + 0x00F3, 0x00F3, 0x00F3, 0x00F3, + 0x00F3, 0x00F3, 0x00F3, 0x00F3, + 0x00F3, 0x00F3, 0x00F2, 0x00F2, + 0x00F2, 0x00F9, 0x00F0, 0x0000, +}; + +void func_802847CC(Camera *camera) { + u16 sp2E; + u16 sp2C; + // D_802856B4 cast to u32 triggers cfc1. + sp2E = D_80286A04[D_800DC5E4].unkC - (10 - (-(((u16)(u32) D_802856B4)))); + sp2C = D_80286A04[D_800DC5E4].unkC; + //sp2E = + cutscene_event(func_80283CD0, camera, 0, 0); + cutscene_event(play_sound_welcome, camera, 8, 8); + cutscene_event(func_80283C78, camera, 149, 149); + cutscene_event(func_80282434, camera, 0, 0); + switch (D_80286A04[D_800DC5E4].unk0) + { + case 1: + cutscene_event(func_802839CC, camera, 0, -1); + cutscene_event(func_802839E0, camera, sp2E - 0x14, sp2E - 0x14); + break; + + case 2: + cutscene_event(func_802839B4, camera, 0, 0); + cutscene_event(play_sound_farewell, camera, 247, 247); + func_80282D90(camera, D_80286A04[D_800DC5E4].unk4, D_80286A04[D_800DC5E4].unk8, 0); + break; + + default: + cutscene_event(func_802839B4, camera, 0, 0); + cutscene_event(func_802839CC, camera, sp2E, sp2E); + cutscene_event(func_802839E0, camera, sp2E - 0x14, sp2E - 0x14); + func_80282D90(camera, D_80286A04[D_800DC5E4].unk4, D_80286A04[D_800DC5E4].unk8, 0); + break; + + } + + if (gCCSelection == 3) + { + sp2C = D_80286B34[D_800DC5E4]; + } + if (gCutsceneShotTimer == sp2C) + { + if (D_80286A04[D_800DC5E4].unk0 != 2) + { + func_80280268(D_80286A04[D_800DC5E4 + 1].unk1); + } + } +} + +void func_802847CC(Camera*); + +// Start of credits cutscene? +struct Cutscene D_80286B5C[] = { + { func_802847CC, 0x7FFF }, +}; + +struct struct_80284AE8 { + u8 unk0[0x1C]; + u8 unk1C; +}; + +void play_cutscene(CinematicCamera *camera) { + s32 pad[3]; + s16 cutsceneDuration; + +#define CUTSCENE(id, cutscene) \ + case id: \ + cutsceneDuration = cutscene[sCutsceneShot].duration; \ + cutscene[sCutsceneShot].shot(camera); \ + + if (!camera->cutscene) { return; } + switch (camera->cutscene) { + CUTSCENE(2, D_80285D10) + break; + CUTSCENE(3, D_80285D10) + break; + CUTSCENE(4, D_80285D10) + break; + CUTSCENE(5, D_80285D58) + func_80283C58(camera); + break; + CUTSCENE(6, D_80286B5C) + break; + } + +#undef CUTSCENE + + if ((cutsceneDuration != 0) && ((gCutsceneShotTimer & 0xC000) == 0)) { + + if (gCutsceneShotTimer < 16383) { + gCutsceneShotTimer++; + } + if (gCutsceneShotTimer == cutsceneDuration) { + sCutsceneShot++; + gCutsceneShotTimer = 0; + reset_spline(); + } + } else { + if (gCutsceneShotTimer & 0x4000) { + gCutsceneShotTimer = 0; + reset_spline(); + } else { + D_802876D8 = 0; + sCutsceneShot = 0; + gCutsceneShotTimer = 0; + reset_spline(); + } + } + +} + +void func_80284CC0(void) { + f32 temp_f0; + f32 temp_f14; + + temp_f14 = D_802856B0 - D_802856C0; + if (temp_f14 < 0.0f) { + temp_f14 = 0.0f; + } + temp_f0 = D_802856B0 + D_802856C0; + // Note that this MUST be on one line. All hail significant whitespace in C! + do {if (temp_f0 > 240.0f) { temp_f0 = 239.0f; } } while (0); + + gDPPipeSync(gDisplayListHead++); + gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetCycleType(gDisplayListHead++, G_CYC_FILL); + gDPSetFillColor(gDisplayListHead++, (GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1))); + gDPFillRectangle(gDisplayListHead++, 0, 0, 319, (s32)temp_f14); + gDPFillRectangle(gDisplayListHead++, 0, (s32)temp_f0, 319, 239); + gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); + set_transition_colour_fade_alpha_ending(&D_802856C0, D_802856B8, D_802856BC / D_802856B4); +} + diff --git a/src/ceremony_and_credits.h b/src/ceremony_and_credits.h new file mode 100644 index 000000000..16bbfe38b --- /dev/null +++ b/src/ceremony_and_credits.h @@ -0,0 +1,141 @@ +#ifndef CEREMONY_AND_CREDITS_H +#define CEREMONY_AND_CREDITS_H + +#include "common_structs.h" + +struct struct_80282C40 { + s8 unk0; + s8 unk1; + s8 unk2; + u8 unk3; + s8 unk4; + s8 unk5; + Vec3s unk6; +}; + +struct struct_80285D80 { + u8 unk0[6]; + s16 unk6[3]; +}; + +struct struct_80286A04 { + u8 unk0; + u8 unk1; + struct struct_80285D80 *unk4; + struct struct_80285D80 *unk8; + u16 unkC; +}; + +/* Function Prototypes */ + +void vec3f_set_dupe(Vec3f, f32, f32, f32); +void vec3s_set_dupe(Vec3s, s16, s16, s16); +void vec3f_clear(Vec3f); +void vec3s_clear(Vec3s); +void vec3f_copy_dupe(Vec3f, Vec3f); +void vec3s_copy_dupe(Vec3s, Vec3s); +void func_80282040(); +void func_80282048(); +void func_80282050(Vec3f, Vec3f, s16); +void func_802820F8(Vec3f, Vec3f, s16); +s32 f32_lerp(f32*, f32, f32); +s32 func_80282200(s16*, s16, s16); +s32 set_transition_colour_fade_alpha_ending(f32*, f32, f32); +s32 func_80282364(s16*, s16, s16); +void reset_spline(); +void func_80282434(Camera*); +void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*); +void func_80282504(Vec3f, Vec3f, f32, s16, s16); +void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s); +s32 func_80282D90(Camera*, struct struct_80286A04*, struct struct_80286A04*, s32); +void func_80282E58(Camera*, struct struct_80282C40*, s32); +void func_80282F00(s16*, s16); +void func_80283240(s16); +s32 cutscene_event(CameraEvent event, Camera*, s16, s16); +s32 func_80283330(s32); +s32 func_80283428(); +void func_80283968(Camera*); +void func_80283994(CinematicCamera*); +void func_802839B4(Camera*); +void func_802839CC(Camera*); +void func_802839E0(Camera*); +void func_80283A34(CinematicCamera*); +void func_80283A54(Camera*); +void func_80283A7C(CinematicCamera*); +void func_80283B6C(Camera*); +void func_80283BA4(Camera*); +void func_80283BF0(CinematicCamera*); +void func_80283C14(Camera*); +void func_80283C38(Camera*); +void func_80283C58(CinematicCamera*); +void func_80283C78(s32); +void func_80283CA8(CinematicCamera*); +void func_80283CD0(s32); +void play_sound_farewell(s32); +void func_80283D2C(CinematicCamera*); +void func_80283EA0(Camera*); +void func_80283ED0(Camera*); +void func_80283EF8(Camera*); +void func_80283F6C(Camera*); +void func_80283FCC(Camera*); +void func_80283FF4(Camera*); +void func_80284068(Camera*); +void func_802840C8(Camera*); +void func_80284154(Camera*); +void func_80284184(Camera*); +void func_802841E8(Camera*); +void func_8028422C(Camera*); +void func_802842A8(Camera*); +void func_802842D8(Camera*); +void func_80284418(Camera*); +void func_80284494(Camera*); +void func_802844FC(Camera*); +void func_8028454C(Camera*); +void func_802845EC(Camera*); +void func_8028461C(Camera*); +void func_80284648(Camera*); +void func_802846AC(); +void func_802846B4(Camera*); +void func_80284CC0(); + +/* This is where I'd put my static data, if I had any */ + +extern u16 D_800DC5E4; +extern s32 D_80283FCC; +extern s32 D_80283FF4; +extern f32 D_802856B0; +extern f32 D_802856B4; +extern f32 D_802856B8; +extern f32 D_802856BC; +extern f32 D_802856C0; +extern struct struct_80282C40 D_802856DC[]; +extern struct struct_80282C40 D_80285718[]; +extern struct struct_80282C40 D_80285754[]; +extern struct struct_80282C40 D_80285784[]; +extern struct struct_80282C40 D_802857B4[]; +extern struct struct_80282C40 D_802857CC[]; +extern struct struct_80282C40 D_802857F0[]; +extern struct struct_80282C40 D_80285850[]; +extern struct struct_80282C40 D_802858B0[]; +extern struct struct_80282C40 D_802858C8[]; +extern struct struct_80282C40 D_80285910[]; +extern struct struct_80282C40 D_80285928[]; +extern struct struct_80282C40 D_80285940[]; +extern struct struct_80282C40 D_80285A10[]; +extern struct struct_80282C40 D_80285A4C[]; +extern struct struct_80282C40 D_80285A88[]; +extern struct struct_80282C40 D_80285AB8[]; +extern struct struct_80282C40 D_80285AE8[]; +extern struct struct_80282C40 D_80285B00[]; +extern struct struct_80282C40 D_80285B18[]; +extern struct struct_80282C40 D_80285B54[]; +extern struct struct_80282C40 D_80285B90[]; +extern struct struct_80282C40 D_80285BA8[]; +extern struct struct_80282C40 D_80285C38[]; +extern struct struct_80282C40 D_80285C74[]; +extern s16 D_80285D14; +extern s32 D_802876D4; +extern s32 D_802876D8; +//extern struct credits_data_1FA0 *D_802876E0; + +#endif // CEREMONY_AND_CREDITS_H diff --git a/src/code_80027D00.c b/src/code_80027D00.c index 8333e733d..c58bf3f46 100644 --- a/src/code_80027D00.c +++ b/src/code_80027D00.c @@ -3623,21 +3623,19 @@ f32 func_80030150(Player *player, s8 arg1) { var_f2 = (player->unk_094 / 18.0f) * 216.0f; if (var_f2 >= 8.0f) { if ((player->unk_0BC & 0x200) != 0x200) { - if(1) {} if ((s32) player->boundingBoxCorners[3].surfaceType >= 0xF) { // ??????? - } else { + } else var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[3].surfaceType]; - } - if ((s32) player->boundingBoxCorners[2].surfaceType < 0xF) { + + if ((s32) player->boundingBoxCorners[2].surfaceType < 0xF) var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[2].surfaceType]; - } - if ((s32) player->boundingBoxCorners[1].surfaceType < 0xF) { + + if ((s32) player->boundingBoxCorners[1].surfaceType < 0xF) var_f0 += D_800E2EB0[player->characterId][player->boundingBoxCorners[1].surfaceType]; - } - if ((s32) player->boundingBoxCorners[0].surfaceType < 0xF) { + + if ((s32) player->boundingBoxCorners[0].surfaceType < 0xF) var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[0].surfaceType]; - } } if (((player->unk_0BC & 8) != 8) && ((player->unk_0CA & 2) != 2)) { temp_lo = player->unk_0C4 / 182; diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index a91c41249..b28b9d012 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -4,6 +4,7 @@ #include "code_8006E9C0.h" #include "code_80071F00.h" #include "objects.h" +#include void func_8006E9C0(void) { @@ -610,22 +611,28 @@ block_26: GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F008.s") #endif -#ifdef MIPS_TO_C +//#ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void play_sound2(?); // extern +//void play_sound2(?); // extern extern u16 D_800DC5FC; extern s8 D_801657E4; extern s8 D_801657E6; extern s8 D_801657E8; extern s8 D_801657F0; extern s8 D_801657F8; -extern s8 D_80165800; extern s8 D_80165808; extern s8 D_80165810; extern s8 D_80165818; extern s8 D_80165820; extern s8 D_80165828; -extern ? D_80165832; + +struct UnkStr80165832 { + s8 unk0; + s8 unk1; +}; + +extern struct UnkStr80165832 D_80165800; +extern struct UnkStr80165832 D_80165832; void func_8006F824(s32 arg0) { D_80165808 = D_801657E4; @@ -636,12 +643,12 @@ void func_8006F824(s32 arg0) { D_80165832.unk0 = D_80165800.unk0; D_80165832.unk1 = D_80165800.unk1; if ((arg0 != 0) && (D_800DC5FC == 0)) { - play_sound2(0x4900801C); + play_sound2(SOUND_ACTION_PING); } } -#else -GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F824.s") -#endif +//#else +//GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F824.s") +//#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 diff --git a/src/code_80071F00.c b/src/code_80071F00.c index d633894ca..f3c8c6350 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -3846,7 +3846,7 @@ void func_80079380(s32 objectIndex, s32 arg1) { if (func_8007278C(objectIndex, 0x00000014) != 0) { temp_v1->unk_068 += 0x200; if (arg1 == 0) { - play_sound2(0x49008003); + play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT); return; } } @@ -3856,7 +3856,7 @@ void func_80079380(s32 objectIndex, s32 arg1) { return; case 9: if ((func_8007278C(objectIndex, 8) != 0) && (arg1 == 0)) { - play_sound2(0x49008003); + play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT); return; } break; @@ -3871,7 +3871,7 @@ void func_80079380(s32 objectIndex, s32 arg1) { if (func_8007278C(objectIndex, 8) != 0) { temp_v1->unk_068 += 0x200; if (arg1 == 0) { - play_sound2(0x49008004); + play_sound2(SOUND_ACTION_GREEN_LIGHT); return; } } diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index 35219497b..573f5a5cd 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -12,6 +12,7 @@ #include "code_80057C60.h" #include "code_8008C1D0.h" #include +#include UNUSED void func_unnamed(void) { @@ -237,7 +238,7 @@ void func_8008C528(Player *player, s8 arg1) { player->unk_042 = 0; if (((player->unk_000 & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->unk_000 & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005); - func_800C9060(arg1, 0x19009005); + func_800C9060(arg1, SOUND_ACTION_EXPLOSION); } else { func_800098FC(arg1, player); } @@ -1098,7 +1099,7 @@ void func_8008E6C0(Player *player, s8 arg1) if (((gModeSelection == VERSUS) && ((player->unk_000 & 0x1000) != 0)) && (D_800DC51C == 0)) { func_800CA24C(arg1); } - func_800C9060(arg1, 0x19009005); + func_800C9060(arg1, SOUND_ACTION_EXPLOSION); } else { func_800098FC(arg1, player); } @@ -1196,7 +1197,7 @@ void func_8008EAE0(Player* player, s8 arg1) { if (((player->unk_000 & 0x4000) == 0x4000) && ((player->unk_000 & 0x100) != 0x100)) { func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); - func_800C9060(arg1, 0x19009005); + func_800C9060(arg1, SOUND_ACTION_EXPLOSION); } else { func_800098FC(arg1, player); } diff --git a/src/code_80091750.c b/src/code_80091750.c index 797bbb4a4..8690447c9 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -13,6 +13,7 @@ #include "data_segment2.h" #include "code_800AF9B0.h" #include "variables.h" +#include // TODO: Move gGfxPool out of main.h // Unfortunately that's not a small effort due to weird import structure in this project #include "main.h" @@ -1788,7 +1789,7 @@ void func_80095574(void) { } var_v0_2 = gMenuTimingCounter; if (var_v0_2 == 2) { - play_sound2(0x49009009); + play_sound2(SOUND_INTRO_WELCOME); var_v0_2 = gMenuTimingCounter; } if (var_v0_2 >= 0x12D) { @@ -11709,7 +11710,7 @@ block_7: } if ((var_s1->unk20 != 0) && (var_s1->unk1C >= 3)) { var_s1->unk20 = 0; - play_sound2(0x49018008); + play_sound2(SOUND_INTRO_LOGO); } break; case 0xDA: /* switch 8 */ @@ -11727,7 +11728,7 @@ block_7: case 0: /* switch 9 */ if (gControllerFive->unk4 & 0x10) { var_s1->unk4 = (s32) 1U; - play_sound2(0x4900801C); + play_sound2(SOUND_ACTION_PING); } else { var_s1->visible = 0; } @@ -11753,7 +11754,7 @@ block_7: case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 5 */ case CONFIRM_OK_SELECTION: /* switch 5 */ case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 5 */ - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */ func_800A9C40(var_s1); break; } @@ -11776,7 +11777,7 @@ block_7: case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 6 */ case CONFIRM_OK_SELECTION: /* switch 6 */ case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 6 */ - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */ func_800A9C40(var_s1); break; } @@ -13032,7 +13033,7 @@ void func_800A9C40(struct_8018D9E0_entry *arg0) { case 1: func_800AA280(); temp_v0 = gMainMenuSelectionDepth; - if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { arg0->unk1C = 0x20; return; } @@ -13078,7 +13079,7 @@ void func_800A9D5C(struct_8018D9E0_entry *arg0) { switch (temp_t1) { case 2: temp_v0 = gMainMenuSelectionDepth; - if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { arg0->column = 0x00000080; arg0->row = 0x0000003E; return; @@ -13185,7 +13186,7 @@ block_5: arg0->row = (*(&D_800E86AC - 1 + D_8018EDF3) * 0x12) + temp_v0_2->row + 0x41; return; case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 2 */ - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 2 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 2 */ temp_v0_3 = func_800AAE68(temp_a1, temp_a2, sp20); temp_v1_2 = (arg0->type * 8) + -(sp24 * 8) + &D_800E70E8; arg0->column = temp_v0_3->column + temp_v1_2->unk0; @@ -13206,7 +13207,7 @@ block_5: case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 3 */ case CONFIRM_OK_SELECTION: /* switch 3 */ case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 3 */ - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 3 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 3 */ if ((temp_a1 != sp20) && (temp_a1 != sp1C)) { arg0->visible = 0; block_37: @@ -13242,7 +13243,7 @@ block_37: case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 4 */ case CONFIRM_OK_SELECTION: /* switch 4 */ case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 4 */ - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 4 */ + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 4 */ if ((temp_a1 != sp20) && (temp_a1 != sp1C)) { arg0->visible = 0; goto block_37; @@ -13281,7 +13282,7 @@ void func_800AA280(struct_8018D9E0_entry *arg0) { temp_v1 = gMainMenuSelectionDepth; temp_v0 = (arg0->type * 8) - 0x50 + &D_800E70A0; - if ((temp_v1 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v1 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) { + if ((temp_v1 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v1 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) { arg0->column = (s32) temp_v0->unk0; arg0->row = (s32) temp_v0->unk2; return; @@ -13327,7 +13328,7 @@ void func_800AA2EC(struct_8018D9E0_entry *arg0) { case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: case CONFIRM_OK_SELECTION: case CONFIRM_OK_SELECTION_FROM_BACK_OUT: - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: if ((arg0->unk4 == 0) && (temp_v0 = D_8018EDF3, (temp_v0 == 1)) && (*(&D_800E86AC - 1 + temp_v0) == 1)) { if (D_800E86F8 != 0) { sp20 = 0; @@ -14798,7 +14799,7 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { arg0 = temp_a3; *temp_v1_2 += 1; sp1C = temp_a1_2; - play_sound2(0x49008017, temp_a1_2, temp_a2_2, temp_a3); + play_sound2(SOUND_ACTION_COUNT_SCORE, temp_a1_2, temp_a2_2, temp_a3); phi_a3 = arg0; if ((*(D_8018D9BC + temp_a1_2) == 0) && (arg0->unk20 == 0)) { arg0->unk20 = 1; @@ -14883,7 +14884,7 @@ loop_41: if ((D_8018D9D8 != 0) && (D_800DDB24 != 0)) { temp_a3->unk4 = 0xC; temp_a3->unk20 = temp_a3->row; - play_sound2(0x49008015); + play_sound2(SOUND_ACTION_NEXT_COURSE); return; } break; @@ -15003,7 +15004,7 @@ block_24: if (temp_v0_3 >= 0xC) { temp_a1_2->unk4 = temp_v0_3 - 1; arg0 = temp_a1_2; - play_sound2(0x49008000, temp_a1_2); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); temp_f0 = (f64) arg0->unk24; phi_a1 = arg0; if (temp_f0 < 4.2) { @@ -15022,7 +15023,7 @@ block_24: if (temp_v0_4 < 0xC) { phi_a1->unk4 = temp_v0_4 + 1; arg0 = phi_a1; - play_sound2(0x49008000, phi_a1); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); temp_f0_2 = (f64) arg0->unk24; phi_a1_2 = arg0; if (temp_f0_2 < 4.2) { @@ -15037,7 +15038,7 @@ block_24: arg0 = phi_a1_2; func_8009DFE0(0x1E, phi_a1_2); func_800CA330(0x19); - play_sound2(0x4900801B); + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); temp_f0_3 = (f64) arg0->unk24; phi_a1_4 = arg0; if (temp_f0_3 < 4.2) { @@ -15146,7 +15147,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if (temp_v0_2 >= 0xB) { temp_a1_2->unk4 = temp_v0_2 - 1; arg0 = temp_a1_2; - play_sound2(0x49008000, temp_a1_2); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); temp_f0 = (f64) arg0->unk24; phi_a1 = arg0; if (temp_f0 < 4.2) { @@ -15165,7 +15166,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if (temp_v0_3 < 0xD) { phi_a1->unk4 = temp_v0_3 + 1; arg0 = phi_a1; - play_sound2(0x49008000, phi_a1); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); temp_f0_2 = (f64) arg0->unk24; phi_a1_2 = arg0; if (temp_f0_2 < 4.2) { @@ -15178,7 +15179,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if ((phi_v1 & 0x9000) != 0) { arg0 = phi_a1_2; func_8009DFE0(0x1E, phi_a1_2); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); if (gModeSelection == VERSUS) { D_8018EDF4 = (s8) arg0->unk4; } else { @@ -15491,7 +15492,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((D_80162DF8 == 1) && (temp_t2 == 9)) { arg0->unk4 = temp_t2 - 1; } - play_sound2(0x49008000, temp_a1); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); @@ -15517,7 +15518,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { arg0->unk4 = temp_v0_5 - 2; phi_a1_3 = gControllerOne->unk6; } else { - play_sound2(0x49008000, phi_a1_2); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2); temp_f0_2 = (f64) arg0->unk24; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); @@ -15543,7 +15544,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; sp28 = 1; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); phi_v1 = 1; break; case 2: /* switch 4 */ @@ -15584,13 +15585,13 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { break; } if (phi_v1_2 != 0) { - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } goto block_56; @@ -15598,17 +15599,17 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { block_56: if (D_8018EB7C >= D_8018EB78) { arg0->unk4 = 0xE; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (gControllerPakNumPagesFree >= 0x79) { arg0->unk4 = 0x13; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } arg0->unk4 = 0xE; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } } else { @@ -15616,7 +15617,7 @@ block_56: D_8018EDF5 = (s8) temp_v0_6; arg0->unk4 = 0x1E; arg0->unk20 = arg0->row; - play_sound2(0x49008015, phi_a1_3); + play_sound2(SOUND_ACTION_NEXT_COURSE, phi_a1_3); temp_f0_4 = (f64) arg0->unk24; if (temp_f0_4 < 4.2) { arg0->unk24 = (f32) (temp_f0_4 + 4.0); @@ -15698,7 +15699,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { arg0->unk4 = temp_v0 - 1; sp18 = temp_a2; arg0 = arg0; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); @@ -15716,7 +15717,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { arg0->unk4 = temp_v0_2 + 1; sp18 = temp_t2 + &gControllers; arg0 = arg0; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); temp_f0_2 = (f64) arg0->unk24; phi_a1 = arg0; if (temp_f0_2 < 4.2) { @@ -15730,7 +15731,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { temp_v0_3 = *(&D_800F0B50 + gModeSelection); if (phi_a1->unk4 != temp_v0_3) { phi_a1->unk4 = (s32) temp_v0_3; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } @@ -15744,7 +15745,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { } arg0 = phi_a1; func_8009DFE0(0x1E, phi_a1, temp_t2 + &gControllers, &gModeSelection); - play_sound2(0x4900801B); + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); func_800CA330(0x3C); temp_f0_3 = (f64) arg0->unk24; if (temp_f0_3 < 4.2) { @@ -15847,7 +15848,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } if ((gControllerOne->unk6 & 0x1000) != 0) { arg0->unk4 = 0xF; - play_sound2(0x49008005); + play_sound2(SOUND_ACTION_GO_BACK_2); return; } if (D_8018CAE0 != 0) { @@ -15881,7 +15882,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { temp_v1 = arg0->unk4; if (temp_v1 >= 0xC) { arg0->unk4 = temp_v1 - 1; - play_sound2(0x49008000, temp_a1); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1); temp_f0 = (f64) arg0->unk24; if (temp_f0 < 4.2) { arg0->unk24 = (f32) (temp_f0 + 4.0); @@ -15897,7 +15898,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { temp_v1_2 = arg0->unk4; if (temp_v1_2 < 0x10) { arg0->unk4 = temp_v1_2 + 1; - play_sound2(0x49008000, phi_a1); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1); temp_f0_2 = (f64) arg0->unk24; if (temp_f0_2 < 4.2) { arg0->unk24 = (f32) (temp_f0_2 + 4.0); @@ -15931,7 +15932,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } case 5: /* switch 3 */ if (phi_v1 != 0) { - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } if (D_800E86F8 == 0) { @@ -15963,13 +15964,13 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { break; } if (phi_v1_2 != 0) { - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } goto block_49; @@ -15977,21 +15978,21 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { block_49: if (D_8018EB7C >= D_8018EB78) { arg0->unk4 = 0x18; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (gControllerPakNumPagesFree >= 0x79) { arg0->unk4 = 0x20; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } arg0->unk4 = 0x18; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } func_8009DFE0(0x1E); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); func_800CA330(0x19); func_800CA388(0x19); temp_f0_4 = (f64) arg0->unk24; @@ -16011,7 +16012,7 @@ block_49: case 41: /* switch 1 */ if ((gControllerOne->unk6 & 0xD000) != 0) { arg0->unk4 = 0x10; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); temp_f0_5 = (f64) arg0->unk24; if (temp_f0_5 < 4.2) { arg0->unk24 = (f32) (temp_f0_5 + 4.0); @@ -16030,7 +16031,7 @@ block_49: temp_v1_3 = arg0->unk4; if (temp_v1_3 >= 0x1F) { arg0->unk4 = temp_v1_3 - 1; - play_sound2(0x49008000, temp_a1_2); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2); temp_f0_6 = (f64) arg0->unk24; if (temp_f0_6 < 4.2) { arg0->unk24 = (f32) (temp_f0_6 + 4.0); @@ -16044,7 +16045,7 @@ block_49: temp_v1_4 = arg0->unk4; if (temp_v1_4 < 0x1F) { arg0->unk4 = temp_v1_4 + 1; - play_sound2(0x49008000, phi_a1_2); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2); temp_f0_7 = (f64) arg0->unk24; if (temp_f0_7 < 4.2) { arg0->unk24 = (f32) (temp_f0_7 + 4.0); @@ -16056,7 +16057,7 @@ block_49: temp_a0_3 = gControllerOne->unk6; if ((temp_a0_3 & 0x4000) != 0) { arg0->unk4 = 0x10; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((temp_a0_3 & 0x9000) != 0) { @@ -16069,7 +16070,7 @@ block_49: } else { arg0->unk4 = 0x23; } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); temp_f0_8 = (f64) arg0->unk24; if (temp_f0_8 < 4.2) { arg0->unk24 = (f32) (temp_f0_8 + 4.0); @@ -16098,7 +16099,7 @@ block_49: phi_a0_2 = temp_a0_5; if (((temp_a1_3 & 0x800) != 0) && ((s32) (u32) arg0->unk4 >= 0x24)) { arg0->unk4 = (u32) arg0->unk4 - 1; - play_sound2(0x49008000, temp_a1_3); + play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_3); temp_f0_9 = (f64) arg0->unk24; if (temp_f0_9 < 4.2) { arg0->unk24 = (f32) (temp_f0_9 + 4.0); @@ -16113,7 +16114,7 @@ block_49: temp_v1_5 = arg0->unk4; if (temp_v1_5 < 0x24) { arg0->unk4 = temp_v1_5 + 1; - play_sound2(0x49008000, phi_a1_3); + play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_3); temp_f0_10 = (f64) arg0->unk24; if (temp_f0_10 < 4.2) { arg0->unk24 = (f32) (temp_f0_10 + 4.0); @@ -16124,14 +16125,14 @@ block_49: } if ((phi_a0_2 & 0x4000) != 0) { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((phi_a0_2 & 0x9000) != 0) { if (arg0->unk4 == 0x24) { arg0->unk4 = 0x28; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); temp_f0_11 = (f64) arg0->unk24; if (temp_f0_11 < 4.2) { arg0->unk24 = (f32) (temp_f0_11 + 4.0); @@ -16139,7 +16140,7 @@ block_49: } } else { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } @@ -16148,12 +16149,12 @@ block_49: if (arg0->unk1C == 1) { if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) != 0) { arg0->unk4 = 0x29; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (func_800B6178(arg0->unk20) != 0) { arg0->unk4 = 0x29; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } goto block_107; @@ -16403,10 +16404,10 @@ void func_800AF004(struct_8018D9E0_entry *arg0) { arg0->unk4 = 6; arg0->unk1C = 0; if ((s32) D_802874F5 < 3) { - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); return; } - play_sound2(0x4900801B); + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); return; } break; diff --git a/src/code_80280000.c b/src/code_80280000.c index 30b596a97..16fe7a833 100644 --- a/src/code_80280000.c +++ b/src/code_80280000.c @@ -55,7 +55,7 @@ void func_80280268(s32 arg0) { gIsInQuitToMenuTransition = 1; gQuitToMenuTransitionCounter = 5; D_802874A0 = 1; - if ((arg0 < 0) || ((arg0 >= 0x14))) { + if ((arg0 < 0) || ((arg0 >= 20))) { arg0 = 0; } gCreditsCourseId = arg0; diff --git a/src/code_80281C40.c b/src/code_80281C40.c index c1e63d3cb..0e9434959 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -9,7 +9,7 @@ #include "code_80091750.h" #include "code_80280650.h" #include "code_80281C40.h" -#include "code_80281FA0.h" +#include "ceremony_and_credits.h" void func_80281C40(void) { s32 i; diff --git a/src/code_80281FA0.c b/src/code_80281FA0.c deleted file mode 100644 index b5acfef89..000000000 --- a/src/code_80281FA0.c +++ /dev/null @@ -1,1810 +0,0 @@ -#include -#include -#include -#include -#include "variables.h" -#include "math_util.h" -#include "code_80281FA0.h" -#include "objects.h" -#include "main.h" - -extern f32 D_80150130[]; - -f32 D_802856B0 = 98.0f; -f32 D_802856B4 = 12.0f; -f32 D_802856B8 = 52.0f; -f32 D_802856BC = 52.0f; -f32 D_802856C0 = 0.0f; -s32 D_802856C4[4] = { 0 }; - -s16 sCutsceneShot; -s16 gCutsceneShotTimer; -s32 D_802876D4; -s32 D_802876D8; -s32 D_802876DC; // fake? Or D8 is array. - -// static bss declared in function. -extern f32 D_80287B18; -extern s16 D_80287B1C; -extern s16 D_80287B1E; -extern s8 D_80287B20; - -struct credits_data_1FA0 { - Vec3f unk0; - s8 pad[0x10]; - s8 unk1C; - s8 unk1D; - s16 unk1E; - f32 unk20; - s8 pad2[0x24]; - s16 unk48[3]; - s16 unk4E[2]; - s16 un52; - s16 unk54[2]; - s16 unk58; - s16 unk5A[2]; - s16 unk5E; - s16 unk60; - s16 unk62; - f32 unk64; - f32 unk68; - s16 unk6C; - s16 unk6E; -}; - -s8 D_802876E0[24]; // todo: Should be CinematicCamera * ? - -f32 D_802876F8; -s8 D_802876FC; - -f32 D_80287700[10]; -Vec3s D_80287728[4]; - -struct struct_80283431 { - Vec3f unk0; - Vec3s unkC; -}; - -struct struct_80283430 { - s8 unk0; - s8 unk1; - s16 unk2; - s8 unk4; - s8 unk5; - Vec3s unk6; -}; - -extern struct struct_80283430 D_80287818[]; -extern struct struct_80283430 D_80287998[]; - -extern struct struct_80283431 D_80287750[10]; - -void vec3f_set_dupe(Vec3f dest, f32 arg1, f32 arg2, f32 arg3) { - dest[0] = arg1; - dest[1] = arg2; - dest[2] = arg3; -} - -void vec3s_set_dupe(Vec3s dest, s16 arg1, s16 arg2, s16 arg3) { - dest[0] = arg1; - dest[1] = arg2; - dest[2] = arg3; -} - -void func_80281FDC(Vec3f arg0) { - arg0[2] = 0.0f; - arg0[1] = 0.0f; - arg0[0] = 0.0f; -} - -void func_80281FF4(Vec3s arg0) { - arg0[2] = 0; - arg0[1] = arg0[2]; - arg0[0] = arg0[2]; -} - -void vec3f_copy_dupe(Vec3f dest, Vec3f src) { - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; -} - -void vec3s_copy_dupe(Vec3s dest, Vec3s src) { - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; -} - -void func_80282040(void) { - -} - -void func_80282048(void) { - -} - -UNUSED void func_80282050(Vec3f dest, Vec3f src, s16 angle) { - Vec3f sp2C; - - vec3f_copy_dupe(sp2C, src); - dest[0] = (sp2C[2] * sins(angle)) + (sp2C[0] * coss(angle)); - dest[1] = sp2C[1]; - dest[2] = (sp2C[2] * coss(angle)) - (sp2C[0] * sins(angle)); -} - -UNUSED void func_802820F8(f32 *dest, f32 *src, s16 angle) { - Vec3f sp2C; - - vec3f_copy_dupe(sp2C, src); - dest[2] = (sp2C[2] * coss(angle)) - (sp2C[1] * sins(angle)); - dest[1] = (sp2C[2] * sins(angle)) + (sp2C[1] * coss(angle)); - dest[0] = sp2C[0]; -} - -// Called just before fish shoots trophy at awards cutscene. -s32 func_802821A0(Vec3f arg0, f32 arg1, f32 arg2) { - if (arg2 > 1.0f) { - arg2 = 1.0f; - } - - arg0[0] = arg0[0] + ((arg1 - arg0[0]) * arg2); - - if (arg1 == arg0[0]) { - return 0; - } - return 1; -} - -UNUSED s32 func_80282200(Vec3s arg0, s16 arg1, s16 arg2) { - s16 temp_v0 = *arg0; - - if (arg2 == 0) { - arg0[0] = arg1; - } else { - temp_v0 -= arg1; - temp_v0 -= (temp_v0 / arg2); - temp_v0 += arg1; - arg0[0] = temp_v0; - } - - if (arg1 == arg0[0]) { - return 0; - } - return 1; -} - -s32 func_802822AC(Vec3f arg0, f32 arg1, f32 arg2) { - f32 temp_f0 = arg1 - arg0[0]; - - if (arg2 < 0.0f) { - arg2 = -1.0f * arg2; - } - - if (temp_f0 > 0.0f) { - temp_f0 -= arg2; - if (temp_f0 > 0.0f) { - arg0[0] = arg1 - temp_f0; - } else { - arg0[0] = arg1; - } - } else { - temp_f0 += arg2; - if (temp_f0 < 0.0f) { - arg0[0] = arg1 - temp_f0; - } else { - arg0[0] = arg1; - } - } - - if (arg1 == arg0[0]) { - return 0; - } - return 1; -} - -s32 func_80282364(Vec3s arg0, s16 arg1, s16 arg2) { - s16 temp_v0 = arg1 - arg0[0]; - - if (arg2 < 0) { - arg2 = arg2 * -1; - } - if ( temp_v0 > 0) { - temp_v0 -= arg2; - if (temp_v0 >= 0) { - arg0[0] = arg1 - temp_v0; - } else { - arg0[0] = arg1; - } - } else { - temp_v0 += arg2; - if (temp_v0 <= 0) { - arg0[0] = arg1 - temp_v0; - } else { - arg0[0] = arg1; - } - } - - if (arg1 == arg0[0]) { - return 0; - } - return 1; -} - -void func_8028240C(void) { - D_80287B1C = 0; - D_80287B18 = 0.0f; - D_80287B1E = 0; - D_80287B20 = 0; -} - -void func_80282434(Camera *arg0) { - func_8028240C(); -} - -void func_80282454(Vec3f arg0, Vec3f arg1, f32 *distance, s16 *arg3, s16 *arg4) { - f32 xdist; - f32 ydist; - f32 zdist; - - xdist = arg1[0] - arg0[0]; - ydist = arg1[1] - arg0[1]; - zdist = arg1[2] - arg0[2]; - *distance = sqrtf((xdist * xdist) + (ydist * ydist) + (zdist * zdist)); - *arg3 = atan2s(ydist, sqrtf((xdist * xdist) + (zdist * zdist))); - *arg4 = atan2s(xdist, zdist); -} - -void func_80282504(Vec3f arg0, Vec3f arg1, f32 arg2, s16 arg3, s16 arg4) { - arg1[0] = arg0[0] + (arg2 * coss(arg3) * sins(arg4)); - arg1[1] = arg0[1] + (arg2 * sins(arg3)); - arg1[2] = arg0[2] + (arg2 * coss(arg3) * coss(arg4)); -} - -UNUSED void func_802825C8(Vec3f arg0, Vec3f arg1, Vec3f arg2, Vec3s arg3) { - Vec3f sp3C; - Vec3f sp30; - - // What's up with this? Why do we copy arg1 to an unused local variable? - vec3f_copy_dupe(sp3C, arg1); - sp30[2] = -((arg2[2] * coss(arg3[0])) - (arg2[1] * sins(arg3[0]))); - sp30[1] = (arg2[2] * sins(arg3[0])) + (arg2[1] * coss(arg3[0])); - sp30[0] = arg2[0]; - arg0[0] = arg1[0] + (sp30[2] * sins(arg3[1])) + (sp30[0] * coss(arg3[1])); - arg0[1] = arg1[1] + sp30[1]; - arg0[2] = arg1[2] + (sp30[2] * coss(arg3[1])) - (sp30[0] * sins(arg3[1])); -} - -// evaluate_cubic_spline -void func_80282700(f32 arg0, Vec3f arg1, Vec3f arg2, f32 arg3[], f32 arg4[], f32 arg5[], f32 arg6[]) -{ - f32 B[4]; - f32 a = arg0; - if (arg0 > 1.0f) - { - arg0 = 1.0f; - } - B[0] = (((1.0f - arg0) * (1.0f - arg0)) * (1.0f - arg0)) / 6.0f; - B[1] = ((((arg0 * arg0) * arg0) / 2.0f) - (arg0 * arg0)) + 0.6666667f; - B[2] = ((((((-arg0) * arg0) * arg0) / 2.0f) + ((arg0 * arg0) / 2.0f)) + (arg0 / 2.0f)) + 0.16666667f; - B[3] = ((arg0 * arg0) * arg0) / 6.0f; - - arg1[0] = B[0] * arg3[0] + B[1] * arg4[0] + B[2] * arg5[0] + B[3] * arg6[0]; - arg1[1] = B[0] * arg3[1] + B[1] * arg4[1] + B[2] * arg5[1] + B[3] * arg6[1]; - arg1[2] = B[0] * arg3[2] + B[1] * arg4[2] + B[2] * arg5[2] + B[3] * arg6[2]; - arg2[0] = B[0] * arg3[3] + B[1] * arg4[3] + B[2] * arg5[3] + B[3] * arg6[3]; -} - -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_80282700(f32, f32, f32 *, f32 *, f32 *, f32 *, f32 *, f32 *); /* extern */ -// move_point_along_spline -s32 func_802828C8(Vec3f *arg0, Vec3f *arg1, s32 arg2, s16 *arg3, f32 arg4) { - s32 sp94; - f32 sp90; - f32 sp8C; - f32 sp88; - f32 sp84; - f32 sp80; - f32 sp7C; - f32 sp78; - f32 sp74; - f32 sp70; - f32 sp6C; - f32 sp68; - f32 sp64; - f32 sp60; - f32 sp5C; - f32 sp58; - f32 sp54; - f32 sp44; - f32 sp40; - f32 temp_f0; - f32 var_f12; - f32 var_f14; - f32 var_f16; - s16 temp_v1; - s32 var_t1; - u16 temp_v1_2; - u16 temp_v1_3; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - - temp_v1 = *arg3; - var_f12 = *arg4; - if (temp_v1 < 0) { - var_f12 = 0.0f; - } - temp_v0 = arg2 + (temp_v1 * 0xC); - if ((temp_v0->unk0 == -1) || (temp_v0->unkC == -1) || (temp_v0->unk18 == -1)) { - return 1; - } - temp_v0_2 = arg2 + (temp_v1 * 0xC); - sp54 = (f32) temp_v0_2->unk6; - sp58 = (f32) temp_v0_2->unk8; - sp5C = (f32) temp_v0_2->unkA; - sp60 = (f32) temp_v0_2->unk4 * 256.0f; - sp64 = (f32) temp_v0_2->unk12; - sp68 = (f32) temp_v0_2->unk14; - sp6C = (f32) temp_v0_2->unk16; - sp70 = (f32) temp_v0_2->unk10 * 256.0f; - sp74 = (f32) temp_v0_2->unk1E; - sp78 = (f32) temp_v0_2->unk20; - sp7C = (f32) temp_v0_2->unk22; - sp80 = (f32) temp_v0_2->unk1C * 256.0f; - sp84 = (f32) temp_v0_2->unk2A; - sp88 = (f32) temp_v0_2->unk2C; - sp8C = (f32) temp_v0_2->unk2E; - sp40 = 0.0f; - sp44 = 0.0f; - sp94 = 0; - sp90 = (f32) temp_v0_2->unk28 * 256.0f; - func_80282700(var_f12, 0.0f, arg0, arg1, &sp54, &sp64, &sp74, &sp84); - var_t1 = sp94; - var_f14 = sp44; - var_f16 = sp40; - temp_v0_3 = arg2 + (*arg3 * 0xC); - temp_v1_2 = temp_v0_3->unkE; - if (temp_v1_2 != 0) { - var_f14 = 1.0f / (f32) temp_v1_2; - } - temp_v1_3 = temp_v0_3->unk1A; - if (temp_v1_3 != 0) { - var_f16 = 1.0f / (f32) temp_v1_3; - } - temp_f0 = *arg4; - *arg4 = temp_f0 + ((temp_f0 * (var_f16 - var_f14)) + var_f14); - if (*arg4 >= 1.0f) { - *arg3 += 1; - if ((arg2 + (*arg3 * 0xC))->unk24 == -1) { - *arg3 = 0; - var_t1 = 1; - } - *arg4 -= 1.0f; - } - return var_t1; -} -#else -GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_802828C8.s") -#endif - -struct struct_80282C40 { - s8 unk0; - s8 unk1; - s8 unk2; - u8 unk3; - s8 unk4; - s8 unk5; - Vec3s unk6; -}; - -void func_80282BE4(struct struct_80283430 *arg0, s8 arg1, u8 arg2, s8 arg3, Vec3s arg4, s32 arg5) -{ - arg0->unk0 = arg1; - arg0->unk2 = arg2; - arg0->unk4 = arg3; - if (arg5) { - arg0->unk6[0] = -arg4[0]; - } else { - arg0->unk6[0] = arg4[0]; - } - arg0->unk6[1] = arg4[1]; - arg0->unk6[2] = arg4[2]; -} - -void func_80282C40(struct struct_80283430 *arg0, struct struct_80282C40 *arg1, s32 arg2) -{ - s32 i = 0; - s32 j = 0; - func_80282BE4(&arg0[j], arg1[j].unk0, arg1[j].unk3, arg1[j].unk4, arg1[j].unk6, arg2); - - j++; - goto dummy_label_888430; - while(1) { - do { - -dummy_label_888430: ; - func_80282BE4(&arg0[j], arg1[i].unk0, arg1[i].unk3, arg1[i].unk4, arg1[i].unk6, arg2); - j++; - i++; - - } while (arg1[i].unk0 != -1); - if (j + 3 <= 30) { - func_80282BE4(&arg0[j], arg1->unk0, arg1[i].unk3, arg1[i].unk4, arg1[i].unk6, arg2); - func_80282BE4(&arg0[j + 1], arg1->unk0, 0, arg1[i].unk4, arg1[i].unk6, arg2); - func_80282BE4(&arg0[j + 2], arg1->unk0, 0, arg1[i].unk4, arg1[i].unk6, arg2); - func_80282BE4(&arg0[j + 3], -1, 0, arg1[i].unk4, arg1[i].unk6, arg2); - break; - } - } -} - -s32 func_80282D90(Camera *camera, struct struct_80282C40 *arg1, struct struct_80282C40 *arg2, s32 arg3) { - s32 res; - - func_802832C4(&func_80282434, camera, 0, 0); - func_80282C40(&D_80287818, arg1, arg3); - func_80282C40(&D_80287998, arg2, arg3); - - if (0) {}; // debug stub? - - res = func_802828C8(camera->lookAt, camera->up, &D_80287818, &D_80287B1C, &D_80287B18) | - func_802828C8(camera->pos, camera->up, &D_80287998, &D_80287B1C, &D_80287B18); - return res; -} - -void func_80282E58(Camera *camera, struct struct_80282C40 *arg1, s32 arg2) { - func_80282C40(&D_80287818, arg1, arg2); - func_802828C8(camera->lookAt, camera->up, &D_80287818, &D_80287B1C, &D_80287B18); -} - -void func_80282EAC(s32 arg0, struct credits_data_1FA0 *arg1, s16 arg2, s16 arg3, s16 arg4) -{ - if ((arg0 >= 0) && (arg0 < 3)) - { - if (arg1->unk48[arg0] < arg2) - { - arg1->unk48[arg0] = arg2; - arg1->unk5A[arg0] = arg3; - arg1->unk54[arg0] = arg4; - } - } -} - -void func_80282F00(s16 *arg0, s16 arg1) { - if (arg1 == -0x8000) { - *arg0 = (*arg0 & 0x8000) + 0xC000; - return; - } - *arg0 += arg1; -} - -void func_80282F44(s32 arg0, struct credits_data_1FA0 *arg1, Camera *camera) { - f32 sp5C; - s32 pad[2]; - s16 sp50[2]; - Vec3f pos; - Vec3f rot; - - vec3f_set_dupe(pos, camera->pos[0], camera->pos[1], camera->pos[2]); - vec3f_set_dupe(rot, camera->lookAt[0], camera->lookAt[1], camera->lookAt[2]); - if ((arg0 == 0) || (arg0 == 1)) { - if ((arg1->unk48[0] != 0) || (arg1->unk48[1] != 0)) { - func_80282454(pos, rot, &sp5C, &sp50[0], &sp50[1]); - sp50[arg0] += (((f32) arg1->unk48[arg0]) * sins(arg1->unk4E[arg0])); - if ((sp50[0] < 0x3800) && (sp50[0] >= -0x37FF)) { - func_80282504(pos, rot, sp5C, sp50[0], sp50[1]); - } - func_80282F00(&arg1->unk4E[arg0], arg1->unk54[arg0]); - if (func_80282364(&arg1->unk48[arg0], 0, arg1->unk5A[arg0]) == 0) { - arg1->unk4E[arg0] = 0; - } - } - camera->lookAt[0] = rot[0]; - camera->lookAt[1] = rot[1]; - camera->lookAt[2] = rot[2]; - } -} - -void func_802830B4(struct credits_data_1FA0 *arg0, s16 arg1, s16 arg2, s16 arg3) { - if (arg0->unk60 < arg1) { - arg0->unk60 = arg1; - arg0->unk6C = arg2; - arg0->unk68 = arg3; - } -} - -void func_80283100(struct credits_data_1FA0 *arg0, f32 *arg1) { - if (arg0->unk60 != 0) { - arg0->unk6E = (coss((u16) arg0->unk64) * arg0->unk60) / 256; - arg0->unk64 += arg0->unk68; - func_80282364(&arg0->unk60, 0, arg0->unk6C); - } else { - arg0->unk64 = 0.0f; - } - *arg1 = arg0->unk20 + (f32) arg0->unk6E; -} - -void func_80283240(s16 arg0) { - if (arg0 == 1) { - func_80282EAC(0, &D_802876E0, 0x100, 0x10, 0x4000); - func_80282EAC(1, &D_802876E0, 0x80, 0x20, 0x2000); - func_802830B4(&D_802876E0, 0x300, 0x20, 0x4000); - } -} - -s32 func_802832C4(void (*func_ptr)(s32), Camera *camera, s16 time2, s16 time) { - if ((gCutsceneShotTimer >= time2) && ((time == -1) || (time >= gCutsceneShotTimer))) { - func_ptr(camera); - } - return 0; -} - -s32 func_80283330(s32 arg0) { - if (arg0 != D_802876D8) { - D_802876D8 = arg0; - sCutsceneShot = 0; - gCutsceneShotTimer = 0; - D_802876D4 = 0; - } - return D_802876D8; -} - -extern s8 D_802874F5; -extern s32 D_802876D8; - -s32 func_8028336C(struct credits_data_1FA0 *arg0, Camera *camera) { - u8 sp20[] = { 2, 3, 4, 5, 5, 5, 5, 5 }; - if (D_802876D8 != 0) - { - return D_802876D8; - } - switch (gGamestate) - { - case 5: - D_802876D8 = sp20[D_802874F5]; - break; - - case 9: - D_802876D8 = 6; - break; - - } - - if (gGamestate == 9) - { - func_80283330(6); - } - return D_802876D8; -} - -s32 func_80283428(void) { - return 0; -} - - -struct unkStruct_80283430 { - s16 unk0; - f32 unk4; -}; - -struct unkStruct_80283430_2 { - f32 unk0; - s16 unk4; - s16 unk6; -}; - -// todo: D_802876E0???? CinematicCamera struct -void func_80283430(void) -{ - static struct unkStruct_80283430 D_80287740; - static struct unkStruct_80283430_2 D_80287748; - static struct struct_80283431 D_80287750[10]; - - static struct struct_80283430 D_80287818[32]; - static struct struct_80283430 D_80287998[32]; - - static f32 D_80287B18; - - static s16 D_80287B1C; - static s16 D_80287B1E; - - static s8 D_80287B20; - - s32 i; - - D_802876D8 = 0; - D_802876E0[28] = 0; - D_802856C4[0] = (s32) D_800DC5E4; - func_80281FDC(&D_802876E0[12]); - vec3f_set_dupe(&D_802876E0, 0.0f, 0.0f, 500.0f); - func_80281FDC(&D_80287700[4]); - vec3f_set_dupe(&D_80287700[1], 0.0f, 0.0f, 500.0f); - vec3f_set_dupe(&D_80287700[7], 0.0f, 1.0f, 0.0f); - D_802876F8 = 0.0f; - func_80281FF4(&D_80287728[0]); - func_80281FF4(&D_80287728[1]); - func_80281FF4(&D_80287728[2]); - func_80281FF4(&D_80287728[3]); - D_80287740.unk0 = 0; - D_80287740.unk4 = 0.0f; - D_80287748.unk0 = 0.0f; - D_80287748.unk4 = 0; - D_80287748.unk6 = 0; - D_80287700[0] = D_80150130[0]; - sCutsceneShot = 0; - gCutsceneShotTimer = 0; - D_802876D4 = 0; - func_8028240C(); - for (i = 0; i < 32; i++) - { - D_80287818[i].unk0 = -1; - D_80287998[i].unk0 = -1; - } - - for (i = 0; i < 10; i++) - { - func_80281FDC(D_80287750[i].unk0); - func_80281FF4(D_80287750[i].unkC); - } - - D_802856C0 = 0.0f; - if (gGamestate == 5) - { - D_802856B0 = 120.0f; - D_802856B4 = 12.0f; - D_802856B8 = 120.0f; - } else { - D_802856B0 = 98.0f; - D_802856B4 = 12.0f; - D_802856B8 = 52.0f; - } -} - -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -void func_80282F44(?, s32 *, Camera *); /* extern */ -void func_80283100(s32 *, f32 *); /* extern */ -s32 func_8028336C(s32 *, Camera *); /* extern */ -void func_80284AE8(s32 *); /* extern */ -//extern Vec3f D_802876EC; -extern f32 D_802876F8; -//extern f32 D_80287704; -//extern f32 D_80287710; -//extern f32 D_8028771C; - -s32 func_80283648(Camera *camera) { - s16 sp6E; - s16 sp6C; - f32 sp64; - f32 sp58; - f32 sp4C; - f32 sp40; - f32 sp38; - f32 *sp34; - f32 *sp30; - s32 sp2C; - f32 *temp_a1; - f32 *temp_a1_2; - f32 var_f0; - f32 var_f2; - s16 var_a3; - s32 temp_t9; - s8 temp_v1; - - func_80283428(); - vec3f_copy_dupe(&sp58, camera->pos); - temp_a1 = camera->lookAt; - sp34 = temp_a1; - vec3f_copy_dupe(&sp4C, temp_a1); - temp_a1_2 = camera->up; - sp30 = temp_a1_2; - vec3f_copy_dupe(&sp40, temp_a1_2); - temp_v1 = func_8028336C(&D_802876E0, camera) & 0xFF; - D_802876FC = temp_v1; - if (temp_v1 != 0) { - vec3f_copy_dupe(&D_802876E0[12], camera->pos); - vec3f_copy_dupe((f32 *) &D_802876E0, sp34); - func_80284AE8(&D_802876E0); - func_80282454(&D_802876E0[12], (f32 *) &D_802876E0, &sp64, &sp6E, &sp6C); - var_a3 = sp6E; - if (var_a3 >= 0x3800) { - var_a3 = 0x3800; - } - if (var_a3 < -0x37FF) { - var_a3 = -0x3800; - } - if ((var_a3 == 0x3800) || (sp6E = var_a3, (var_a3 == -0x3800))) { - sp6E = var_a3; - func_80282504(&D_802876E0[12], (f32 *) &D_802876E0, sp64, var_a3, (s16) (s32) sp6C); - } - var_f2 = D_802876F8; - if (var_f2 > 65536.0f) { - var_f2 -= 65536.0f; - } - if (var_f2 < -65536.0f) { - var_f2 += 65536.0f; - } - D_802876F8 = var_f2; - var_f0 = var_f2; - if (var_f2 < 0.0f) { - var_f0 = 65536.0f + var_f2; - } - temp_t9 = (u32) var_f0 & 0xFFFF; - sp2C = temp_t9; - sp38 = sins((u16) temp_t9); - camera->up[0] = coss((u16) sp6C) * sp38; - camera->up[1] = coss(unksp2E); - sp38 = sins(unksp2E); - camera->up[2] = sins((u16) sp6C) * -sp38; - vec3f_copy_dupe(camera->pos, &D_802876E0[12]); - vec3f_copy_dupe(sp34, (f32 *) &D_802876E0); - if ((gGamestate == 9) && (gIsMirrorMode != 0)) { - camera->pos[0] = -camera->pos[0]; - camera->lookAt[0] = -camera->lookAt[0]; - } - } - func_80282F44(0, &D_802876E0, camera); - func_80282F44(1, &D_802876E0, camera); - func_80283100(&D_802876E0, D_80150130); - vec3f_copy_dupe(&D_80287700[4], camera->pos); - vec3f_copy_dupe(&D_80287700[1], sp34); - vec3f_copy_dupe(&D_80287700[7], sp30); - return D_802876D8; -} -#else -GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80283648.s") -#endif - -void func_80283968(s32 arg0) { - func_8028100C(-0xC6C, 0xD2, -0x1EF); -} - -void func_80283994(s32 arg0) { - func_80280FFC(); -} - -void func_802839B4(s32 arg0) { - D_802856B8 = 52.0f; -} - -void func_802839CC(s32 arg0) { - D_802856B8 = 0.0f; -} - -void func_802839E0(s32 arg0) { - func_80092C80(); -} - -void func_80283A00(s32 arg0) { - if (D_800DC5E4 == 0) { - play_sound2(0x49009009); - } -} - -void func_80283A34(s32 arg0) { - func_800CA0CC(); -} - -void func_80283A54(s32 arg0) { - play_sound2(0x49009014); -} - -// Balloon pop -void func_80283A7C(s32 arg0) { - play_sound2(0x4900801E); -} - -void func_80283AA4(s32 arg0) { - play_sound2(0x4900801F); -} - -void func_80283ACC(s32 arg0) { - play_sound2(0x49008020); -} - -void func_80283AF4(s32 arg0) { - play_sound2(0x49008021); -} - -void func_80283B1C(s32 arg0) { - play_sound2(0x49008022); -} - -void func_80283B44(s32 arg0) { - play_sound2(0x49008023); -} - -void func_80283B6C(s32 arg0) { - func_800CA0B8(); - func_800C9060(0, 0x19009005); - func_800CA0A0(); -} - -void func_80283BA4(s32 arg0) { - func_800CA0B8(); - func_800C90F4(0, (gPlayerFour->characterId * 0x10) + 0x29008004); - func_800CA0A0(); -} - -void func_80283BF0(s32 arg0) { - func_800C8EF8(0x1A); -} - -void func_80283C14(s32 arg0) { - func_800C8EF8(0x1B); -} - -void func_80283C38(s32 arg0) { - func_800CB134(); -} - -void func_80283C58(CinematicCamera *arg0) { - func_800CB14C(); -} - -void func_80283C78(s32 arg0) { - if (D_800DC5E4 == 0) { - func_800C8EF8(0x1C); - } -} - -void func_80283CA8(s32 arg0) { - func_800CA008(0, 3); -} - -void func_80283CD0(s32 arg0) { - if (D_800DC5E4 == 0) { - func_800CA008(0, 2); - } -} - -// End of credits farewell -// "Hey, you're very good, see you next time." -void func_80283D04(s32 arg0) { - play_sound2(0x49008026); -} - - -// Camera rail spline animation -struct struct_80282C40 D_802856DC[] = { - // go to - { 0, 0, 0, 0, 0, 0, { 0xF576, 0x014E, 0xFE70 } }, - { 0, 0, 0, 0, 0, 0, { 0xF576, 0x014E, 0xFE70 } }, - { 0, 0, 0, 0, 0, 0, { 0xF422, 0x0103, 0xFE3C } }, - { 0, 0, 0, 0, 0, 0, { 0xF3E8, 0x0016, 0xFE34 } }, - { -1, 0, 0, 0, 0, 0, { 0xF3E8, 0x0016, 0xFE34 } }, -}; - -struct struct_80282C40 D_80285718[] = { - { 0, 0, 0, 61, 0, 0, { 0xF493, 0x0309, 0xFE4E } }, - { 0, 0, 0, 149, 0, 0, { 0xF494, 0x030A, 0xFE4E } }, - { 0, 0, 0, 94, 0, 0, { 0xF243, 0x0179, 0xFDF0 } }, - { 0, 0, 0, 60, 0, 0, { 0xF213, 0x00B1, 0xFDE9 } }, - { -1, 0, 0, 60, 0, 0, { 0xF213, 0x008D, 0xFDE9 } }, -}; - -struct struct_80282C40 D_80285754[] = { - { 0, 0, 0, 0, 0, 0, { 0xF4F4, 0xFFE2, 0xFF67} }, - { 0, 0, 0, 0, 0, 0, { 0xF51A, 0x0002, 0xFF5D} }, - { 0, 0, 0, 0, 0, 0, { 0xF57B, 0x004A, 0xFFB8} }, - { -1, 0, 0, 0, 0, 0, { 0xF608, 0x0065, 0xFFE4} }, -}; - -struct struct_80282C40 D_80285784[] = { - { 0, 0, 0, 186, 0, 0, { 0xF33E, 0x0009, 0x0053} }, - { 0, 0, 0, 89, 0, 0, { 0xF329, 0xFFA4, 0xFF8F} }, - { 0, 0, 0, 60, 0, 0, { 0xF39C, 0x004F, 0xFF2A} }, - { -1, 0, 0, 45, 0, 0, { 0xF44A, 0x00BE, 0xFF16} }, -}; - -struct struct_80282C40 D_802857B4[] = { - { 0, 0, 0, 0, 0, 0, { 0xF22C, 0xFFF4, 0x0067} }, - { -1, 0, 0, 0, 0, 0, { 0xF22C, 0xFFF4, 0x0067} }, -}; - -struct struct_80282C40 D_802857CC[] = { - { 0, 0, 0, 90, 0, 0, { 0xF3F8, 0xFFDB, 0xFC39} }, - { 0, 0, 0, 90, 0, 0, { 0xF419, 0xFFF8, 0xFC3B} }, - { -1, 0, 0, 101, 0, 0, { 0xF454, 0x000E, 0xFBFF} }, -}; - -struct struct_80282C40 D_802857F0[] = { - { 0, 0, 0, 0, 0, 0, { 0xF208, 0x004F, 0xFDC9} }, - { 0, 0, 0, 0, 0, 0, { 0xF20F, 0x004E, 0xFDCB} }, - { 0, 0, 0, 0, 0, 0, { 0xF23D, 0x0049, 0xFDDC} }, - { 0, 0, 0, 0, 0, 0, { 0xF284, 0x0044, 0xFDEF} }, - { 0, 0, 0, 0, 0, 0, { 0xF2BE, 0x0041, 0xFDFA} }, - { 0, 0, 0, 0, 0, 0, { 0xF2E5, 0x003E, 0xFE04} }, - { 0, 0, 0, 0, 0, 0, { 0xF303, 0x0039, 0xFE0A} }, - { -1, 0, 0, 0, 0, 0, { 0xF325, 0x0033, 0xFE11} }, -}; - -struct struct_80282C40 D_80285850[] = { - { 0, 0, 0, 30, 0, 0, { 0xF3D7, 0x0004, 0xFE77} }, - { 0, 0, 0, 30, 0, 0, { 0xF3E3, 0x000C, 0xFE6F} }, - { 0, 0, 0, 50, 0, 0, { 0xF421, 0x001E, 0xFE53} }, - { 0, 0, 0, 50, 0, 0, { 0xF468, 0x001C, 0xFE69} }, - { 0, 0, 0, 30, 0, 0, { 0xF4A4, 0x0016, 0xFE68} }, - { 0, 0, 0, 30, 0, 0, { 0xF4C9, 0xFFFE, 0xFE70} }, - { 0, 0, 0, 30, 0, 0, { 0xF4E3, 0xFFE1, 0xFE76} }, - { -1, 0, 0, 30, 0, 0, { 0xF505, 0xFFD1, 0xFE72} }, -}; - -struct struct_80282C40 D_802858B0[] = { - { 0, 0, 0, 0, 0, 0, { 0xF42B, 0x002D, 0xFE46} }, - { -1, 0, 0, 0, 0, 0, { 0xF42B, 0x002D, 0xFE46} }, -}; - -struct struct_80282C40 D_802858C8[] = { - { 0, 0, 0, 30, 0, 0, { 0xF246, 0x0073, 0xFDE7} }, - { -1, 0, 0, 30, 0, 0, { 0xF246, 0x0073, 0xFDE7} }, -}; - -struct struct_80282C40 D_802858E0[] = { - { 0, 0, 0, 0, 0, 0, { 0xF39F, 0x003C, 0xFE2F} }, - { -1, 0, 0, 0, 0, 0, { 0xF39F, 0x003C, 0xFE2F} }, -}; - -struct struct_80282C40 D_802858F8[] = { - { 0, 0, 0, 1, 0, 0, { 0xF245, 0x0187, 0xFDA1} }, - { -1, 0, 0, 1, 0, 0, { 0xF245, 0x0187, 0xFDA1} }, -}; - -struct struct_80282C40 D_80285910[] = { - { 0, 0, 0, 0, 0, 0, { 0xF4A0, 0x00B7, 0xFF6C} }, - { -1, 0, 0, 0, 0, 0, { 0xF4A0, 0x00B7, 0xFF6C} }, -}; - -struct struct_80282C40 D_80285928[] = { - { 0, 0, 0, 6, 0, 0, { 0xF340, 0x0025, 0xFE28} }, - { -1, 0, 0, 6, 0, 0, { 0xF340, 0x0025, 0xFE28} }, -}; - -// Is some of this unused? -struct struct_80282C40 D_80285940[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A } }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A } }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C3, 0x006B, 0xFE1A} }, - { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF203, 0xFF99, 0xFE62} }, - { 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, { 0xF200, 0xFFA4, 0xFE6D} }, - { 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, { 0xF1DA, 0x01AF, 0xFE7F} }, - { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1DA, 0x014B, 0xFE7F} }, - { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1DA, 0x00E7, 0xFE7F} }, - { 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, { 0xF1E1, 0x0015, 0xFE7D} }, - { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1E1, 0x000A, 0xFE71} }, - { 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF1E0, 0x000C, 0xFE71} }, -}; -// todo: label from sm64 -struct _struct_D_80286B5C_0x8 { - /* 0x0 */ void (*shot)(Camera*); - /* 0x4 */ s16 unk4; - /* 0x6 */ s16 pad; -}; /* size = 0x8 */ -extern struct _struct_D_80286B5C_0x8 D_80285D10[]; -void func_80283D2C(Camera *camera) { - D_802856B8 = 120.0f; - func_802832C4(&func_80283CA8, camera, 0, 0); - func_802832C4(&func_80283A34, camera, 1, 1); - func_802832C4(&func_80283BF0, camera, 0, 0); - func_802832C4(&func_80283A7C, camera, 45, 45); - func_802832C4(&func_80283A7C, camera, 65, 65); - func_802832C4(&func_80283A7C, camera, 70, 70); - func_802832C4(&func_80283A7C, camera, 94, 94); - func_802832C4(&func_80283A7C, camera, 110, 110); - func_802832C4(&func_80283A7C, camera, 130, 130); - func_802832C4(&func_80283A7C, camera, 152, 152); - func_802832C4(&func_80283A7C, camera, 160, 160); - // 330 // 330 - 60 todo: import var - func_802832C4(&func_80283994, camera, D_80285D10[0].unk4 - 60, D_80285D10[0].unk4 - 60); - func_80282D90(camera, &D_802856DC, &D_80285718, 0); -} - -void func_80283EA0(Camera *camera) { - func_80282D90(camera, &D_80285754, &D_80285784, 0); -} - -void func_80283ED0(Camera *camera) { - vec3f_copy_dupe(camera->pos, gPlayerTwo->pos); -} - -void func_80283EF8(Camera *camera) { - func_802821A0(&camera->pos[0], gPlayerTwo->pos[0], 0.12f); - func_802821A0(&camera->pos[1], gPlayerTwo->pos[1], 0.12f); - func_802821A0(&camera->pos[2], gPlayerTwo->pos[2], 0.12f); -} - -void func_80283F6C(Camera *camera) { - func_802832C4(&func_80283ED0, camera, 0, 0); - func_802832C4(&func_80283EF8, camera, 0, -1); - func_80282E58(camera, &D_802857B4, 0); -} - -void func_80283FCC(Camera *camera) { - vec3f_copy_dupe(camera->pos, gPlayerThree->pos); -} - -void func_80283FF4(Camera *camera) { - func_802821A0(&camera->pos[0], gPlayerThree->pos[0], 0.12f); - func_802821A0(&camera->pos[1], gPlayerThree->pos[1], 0.12f); - func_802821A0(&camera->pos[2], gPlayerThree->pos[2], 0.12f); -} - -void func_80284068(Camera *camera) { - func_802832C4(&func_80283FCC, camera, 0, 0); - func_802832C4(&func_80283FF4, camera, 0, -1); - func_80282E58(camera, &D_802857CC, 0); -} - -void func_802840C8(Camera *camera) { - func_802832C4(&func_80283C14, camera, 5, 5); - - switch(D_802876D8) { - case 2: - func_80283EA0(camera); - break; - case 3: - func_80283F6C(camera); - break; - case 4: - func_80284068(camera); - break; - } -} - -void func_80284154(Camera *camera) { - func_80282D90(camera, &D_80285910, &D_80285928, 0); -} - -extern struct_80165C18_entry D_80165C20[]; -extern s32 D_80183EAC; - -void func_80284184(Camera *camera) -{ - f32 new_var2; - new_var2 = ((D_80165C20[D_80183EAC].unk_000 - camera->lookAt[1]) * 0.899999976f) + camera->lookAt[1]; - func_802821A0(&camera->pos[1], new_var2, 0.5); -} - -void func_802841E8(Camera *camera) { - func_80282E58(camera, &D_80285940, 0); - vec3f_set_dupe(camera->pos, -3202.0f, 90.0f, -478.0f); -} - -void func_8028422C(Camera *camera) { - func_802832C4(&func_80283AF4, camera, 6, 6); - func_802832C4(&func_80283B44, camera, 30, 30); - func_802832C4(&func_802841E8, camera, 0, 0); - func_802832C4(&func_80284184, camera, 6, -1); -} - -void func_802842A8(s32 arg0) { - func_80282D90(arg0, &D_802858B0, &D_802858C8, 0); -} - -void func_802842D8(s32 arg0) { - func_80282D90(arg0, &D_802857F0, &D_80285850, 0); -} - -void func_80284308(Camera *camera) { - Player **sp30[4] = { - &gPlayerOne, - &gPlayerTwo, - &gPlayerThree, - &gPlayerFour - }; - Player *ply; - f32 x; - f32 y; - f32 z; - - func_802832C4(func_80283A54, camera, 140, 140); - func_80282D90(camera, D_802858E0, D_802858F8, 0); - - ply = *(sp30[0] + D_802874F5); - - x = ply->pos[0] - gPlayerOne->pos[0]; - y = ply->pos[1] - gPlayerOne->pos[1]; - z = ply->pos[2] - gPlayerOne->pos[2]; - - camera->lookAt[0] += x; - camera->lookAt[2] += z; - camera->pos[0] += x; - camera->pos[2] += z; - camera->lookAt[1] += y; - camera->pos[1] += y; -} - -struct struct_80282C40 D_80285A10[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF33D, 0x002F, 0xFE5A} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF36B, 0x0028, 0xFE76} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A6, 0x0027, 0xFE6F} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3C8, 0x002A, 0xFE4D} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3CF, 0x002F, 0xFE33} }, -}; - -struct struct_80282C40 D_80285A4C[] = { - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF4AC, 0xFFC1, 0xFD1A} }, - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF3D1, 0xFFF2, 0xFC8F} }, - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF2BA, 0xFFF2, 0xFCBA} }, - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF219, 0xFFF7, 0xFD56} }, - { 0xFF, 0x00, 0x00, 45, 0x00, 0x00, { 0xF1E8, 0xFFED, 0xFDD9} }, -}; - - -struct struct_80282C40 D_80285A88[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D8, 0x0012, 0xFE0E} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D8, 0x0012, 0xFE0E} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D6, 0x001A, 0xFE0F} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3D7, 0x001D, 0xFE0F} }, -}; - -struct struct_80282C40 D_80285AB8[] = { - { 0x00, 0x00, 0x00, 75, 0x00, 0x00, { 0xF1FB, 0x006C, 0xFE85} }, - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF1FB, 0x006C, 0xFE85} }, - { 0x00, 0x00, 0x00, 45, 0x00, 0x00, { 0xF225, 0x00FB, 0xFE7A} }, - { 0xFF, 0x00, 0x00, 45, 0x00, 0x00, { 0xF21C, 0x00EB, 0xFE7C} }, -}; - -struct struct_80282C40 D_80285AE8[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A3, 0x004C, 0xFE22} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF3A3, 0x004C, 0xFE22} }, -}; - -struct struct_80282C40 D_80285B00[] = { - { 0x00, 0x00, 0x00, 30, 0x00, 0x00, { 0xF1BA, 0x0092, 0xFE22} }, - { 0xFF, 0x00, 0x00, 30, 0x00, 0x00, { 0xF1BA, 0x0092, 0xFE22} }, -}; - -struct struct_80282C40 D_80285B18[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF496, 0x0029, 0xFF27} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF496, 0x0029, 0xFF27} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4D5, 0xFFE3, 0xFF70} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54D, 0xFFE8, 0xFF9B} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54D, 0xFFE8, 0xFF9B} }, -}; - -struct struct_80282C40 D_80285B54[] = { - { 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, { 0xF307, 0x012F, 0xFE96} }, - { 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, { 0xF307, 0x012F, 0xFE96} }, - { 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, { 0xF326, 0x00CE, 0xFF12} }, - { 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, { 0xF35A, 0x0000, 0xFF9E} }, - { 0xFF, 0x00, 0x00, 0x41, 0x00, 0x00, { 0xF35A, 0x0000, 0xFF9E} }, -}; - -struct struct_80282C40 D_80285B90[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF5BB, 0x0008, 0xFE7E} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF5BB, 0x0008, 0xFE7E} }, -}; - -struct struct_80282C40 D_80285BA8[] = { - { 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, { 0xF7A6, 0x0044, 0xFECC} }, - { 0xFF, 0x00, 0x00, 0x05, 0x00, 0x00, { 0xF7A6, 0x0044, 0xFECC} }, - -// Unused? What's going on here? D_80285BC0 (no label existed) - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF690, 0x0018, 0xFE9E} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF6B9, 0x0021, 0xFEA5} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF6CD, 0x001B, 0xFEA9} }, - - { 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, - { 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, - { 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, { 0xF4A5, 0xFFF0, 0xFE49} }, - { 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF4CE, 0x0046, 0xFE4D} }, - { 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, { 0xF4EB, 0x0084, 0xFE5C} }, -}; - -struct struct_80282C40 D_80285C38[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4ED, 0xFFEB, 0xFF66} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF4ED, 0xFFEB, 0xFF66} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF408, 0x0028, 0xFE82} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF32B, 0x0062, 0xFDD6} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF2A4, 0x006A, 0xFDA5} }, -}; - -struct struct_80282C40 D_80285C74[] = { - { 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, { 0xF616, 0xFFD8, 0x00F7} }, - { 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, { 0xF616, 0xFFD8, 0x00F7} }, - { 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, { 0xF558, 0xFFBB, 0xFFE4} }, - { 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, { 0xF481, 0xFFF0, 0xFF30} }, - { 0xFF, 0x00, 0x00, 0x28, 0x00, 0x00, { 0xF414, 0xFFED, 0xFEE1} }, -}; - -struct struct_80282C40 D_80285CB0[] = { - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF551, 0xFFE7, 0xFFA5} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF551, 0xFFE7, 0xFFA5} }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF54E, 0xFFE7, 0xFF82} }, - { 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, { 0xF544, 0xFFFA, 0xFF74} }, -}; - -struct struct_80282C40 D_80285CE0[] = { - { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF362, 0xFFF3, 0xFF62} }, - { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF362, 0xFFF3, 0xFF62} }, - { 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF392, 0xFFF3, 0x0068} }, - { 0xFF, 0x00, 0x00, 0x19, 0x00, 0x00, { 0xF3E1, 0xFF47, 0x00A2} }, -}; - -void func_80284308(Camera *); - -struct _struct_D_80286B5C_0x8 D_80285D10[] = { - { func_80283D2C, 330 }, - { func_802840C8, 270 }, - { func_802842D8, 247 }, - { func_80284418, 200 }, - { func_80284494, 170 }, - { func_802844FC, 108 }, - { func_8028422C, 140 }, - { func_802842A8, 270 }, - { func_80284308, 0x7FFF }, -}; - -void func_80284418(s32 arg0) { - func_802832C4(&func_80283B1C, arg0, 0x52, 0x52); - func_802832C4(&func_80283B1C, arg0, 0x48, 0x48); - func_802832C4(&func_80283B1C, arg0, 0x3D, 0x3D); - func_80282D90(arg0, &D_80285A10, &D_80285A4C, 0); -} - -void func_80284494(s32 arg0) { - func_802832C4(&func_80283ACC, arg0, 0x1E, 0x1E); - func_802832C4(&func_80283968, arg0, 0, 0); - func_80282D90(arg0, &D_80285A88, &D_80285AB8, 0); -} - -void func_802844FC(s32 arg0) { - func_802832C4(&func_80283AA4, arg0, 0x3B, 0x3B); - func_80282D90(arg0, &D_80285AE8, &D_80285B00, 0); -} - -void func_8028454C(s32 arg0) { - func_802832C4(&func_80283CA8, arg0, 0, 0); - func_802832C4(&func_80283A34, arg0, 1, 1); - func_802832C4(&func_80283C38, arg0, 0, 0); - func_802832C4(&func_80283994, arg0, 0x3C, 0x3C); - func_80282D90(arg0, &D_80285B18, &D_80285B54, 0); -} - -void func_802845EC(s32 arg0) { - func_80282D90(arg0, &D_80285B90, &D_80285BA8, 0); -} - -void func_8028461C(s32 arg0) { - func_80283240(1); - func_80283B6C(arg0); -} - -void func_80284648(s32 arg0) { - func_802832C4(&func_802845EC, arg0, 0, 0); - func_802832C4(&func_8028461C, arg0, 0x110, 0x110); - func_802832C4(&func_80283BA4, arg0, 0x115, 0x115); -} - -UNUSED void func_802846AC(void) { - -} - -void func_802846B4(s32 arg0) { - func_80282D90(arg0, &D_80285C38, &D_80285C74, 0); -} - -// todo: What does this even do? -void func_802846E4(Camera *camera) { - - func_80282D90(camera, &D_80285CB0, &D_80285CE0, 0); - camera->lookAt[0] += (gPlayerFour->pos[0] - -2796.0f); // <-- rodata - camera->lookAt[1] += (gPlayerFour->pos[1] - -29.0f); - camera->lookAt[2] += (gPlayerFour->pos[2] - -97.0f); - camera->pos[0] += (gPlayerFour->pos[0] - -2796.0f); - camera->pos[1] += (gPlayerFour->pos[1] - -29.0f); - camera->pos[2] += (gPlayerFour->pos[2] - -97.0f); -} - -struct _struct_D_80286B5C_0x8 D_80285D58[] = { - { func_8028454C, 300 }, - { func_80284154, 175 }, - { func_802846B4, 200 }, - { func_802846E4, 184 }, - { func_80284648, 0x7FFF }, -}; - -#ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 -void func_80280268(u8); /* extern */ -static ? D_80286A04; /* unable to generate initializer */ -static ? D_80286A10; /* unable to generate initializer */ -static u16 D_80286B34[0x14] = { - 0x0096, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F3, - 0x00F2, - 0x00F2, - 0x00F2, - 0x00F9, - 0x00F0, - 0, -}; -f32 D_802856B4 = 12.0f; - -void func_802847CC(s32 arg0) { - u16 sp2E; - u16 sp2C; - s32 sp24; - f32 temp_f4; - s16 temp_a2; - s16 temp_a2_2; - s32 var_t9; - u16 temp_v0; - u16 temp_v0_5; - u8 temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - - temp_f4 = D_802856B4; - temp_v0 = *(&D_80286A10 + (D_800DC5E4 * 0x10)); - if ((M2C_ERROR(cfc1) & 0x78) != 0) { - if ((M2C_ERROR(cfc1) & 0x78) == 0) { - var_t9 = (s32) (temp_f4 - 2.1474836e9f) | 0x80000000; - } else { - goto block_3; - } - } else { - var_t9 = (s32) temp_f4; - if (var_t9 < 0) { -block_3: - var_t9 = -1; - } - } - sp2E = (temp_v0 - var_t9) - 0xA; - sp2C = temp_v0; - func_802832C4(func_80283CD0, arg0, 0, 0); - func_802832C4(func_80283A00, arg0, 8, 8); - func_802832C4(func_80283C78, arg0, 0x0095, 0x0095); - func_802832C4(func_80282434, arg0, 0, 0); - temp_v0_2 = *(&D_80286A04 + (D_800DC5E4 * 0x10)); - switch (temp_v0_2) { /* irregular */ - case 1: - func_802832C4(func_802839CC, arg0, 0, -1); - temp_a2 = sp2E - 0x14; - func_802832C4(func_802839E0, arg0, temp_a2, temp_a2); - break; - case 2: - func_802832C4(func_802839B4, arg0, 0, 0); - func_802832C4(func_80283D04, arg0, 0x00F7, 0x00F7); - temp_v0_3 = (D_800DC5E4 * 0x10) + &D_80286A04; - func_80282D90(arg0, temp_v0_3->unk4, temp_v0_3->unk8, 0); - break; - default: - func_802832C4(func_802839B4, arg0, 0, 0); - sp24 = (s32) sp2E; - func_802832C4(func_802839CC, arg0, (s16) sp2E, (s16) sp2E); - temp_a2_2 = sp2E - 0x14; - func_802832C4(func_802839E0, arg0, temp_a2_2, temp_a2_2); - temp_v0_4 = (D_800DC5E4 * 0x10) + &D_80286A04; - func_80282D90(arg0, temp_v0_4->unk4, temp_v0_4->unk8, 0); - break; - } - if (gCCSelection == CC_EXTRA) { - sp2C = D_80286B34[D_800DC5E4]; - } - if (sp2C == gCutsceneShotTimer) { - temp_v0_5 = D_800DC5E4; - if (*((temp_v0_5 * 0x10) + &D_80286A04) != 2) { - func_80280268(((temp_v0_5 * 0x10) + &D_80286A04)->unk11); - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_802847CC.s") -#endif - -unsigned char D_80285D80[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC6, 0x00, 0x00, 0xFC, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xFF, 0xB9, 0x00, 0x05, 0xFF, 0x53, - 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0xFE, 0xC3, 0x00, 0x36, 0x00, 0x9E, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x1A, 0xFF, 0xDD, 0x02, 0x98, - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xFE, 0xB1, 0xFF, 0x45, 0xFD, 0x76, - 0x00, 0x00, 0x00, 0x3C, 0x04, 0x00, 0xFE, 0xA7, 0xFF, 0x73, 0x00, 0xDA, - 0x00, 0x00, 0x00, 0x3C, 0x0A, 0x00, 0xFD, 0x94, 0xFF, 0x9B, 0x02, 0x0B, - 0xFF, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xFA, 0x7B, 0x00, 0x3C, 0x03, 0x9C, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xA7, 0x00, 0x4F, 0x06, 0x0B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xA7, 0x00, 0x4F, 0x06, 0x0B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8A, 0x00, 0x68, 0x05, 0x9A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x70, 0x04, 0xB7, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x69, 0x00, 0x42, 0x04, 0x10, - 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x05, 0x1C, 0x00, 0xB9, 0x07, 0xE5, - 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x05, 0x1C, 0x00, 0xB9, 0x07, 0xE5, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x04, 0xF6, 0x00, 0x32, 0x07, 0x7F, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x04, 0x0D, 0x00, 0x23, 0x06, 0x64, - 0xFF, 0x00, 0x00, 0x32, 0x00, 0x00, 0x04, 0x4D, 0x00, 0x0C, 0x05, 0xA8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1, 0x00, 0x70, 0xF5, 0xAB, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1, 0x00, 0x70, 0xF5, 0xAB, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x45, 0x00, 0x43, 0xF6, 0x24, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xBB, 0x00, 0x1B, 0xF6, 0xA9, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x01, 0xBE, 0xFF, 0x8B, 0xF7, 0x23, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0xBE, 0xFF, 0x8B, 0xF7, 0x21, - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x02, 0x3D, 0xFF, 0x7A, 0xF7, 0xA5, - 0xFF, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x02, 0xBB, 0x00, 0x47, 0xF8, 0x54, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x1A, 0x00, 0x1F, 0x0A, 0xAA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x1A, 0x00, 0x16, 0x08, 0x90, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x1B, 0x00, 0x17, 0x05, 0xEE, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x24, 0x00, 0x13, 0x03, 0x25, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xAB, 0x00, 0x10, 0x01, 0xAF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x52, 0x00, 0x13, 0x00, 0x94, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x51, 0x00, 0x1A, 0x00, 0x55, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF5, 0x00, 0x1B, 0x00, 0x53, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0xFD, 0x1F, 0xFE, 0xB7, 0x09, 0x4F, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0xFD, 0x21, 0xFF, 0xDF, 0x06, 0x9F, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0xFD, 0x35, 0x00, 0x12, 0x03, 0xFA, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFD, 0x32, 0xFF, 0xE5, 0x01, 0x33, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFB, 0x92, 0x00, 0x0E, 0x00, 0x11, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF9, 0x93, 0x00, 0x1C, 0xFF, 0xB7, - 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0xF8, 0x66, 0x00, 0x09, 0xFF, 0xFB, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF7, 0x12, 0xFF, 0xE7, 0x00, 0xC8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x9C, 0x00, 0xDE, 0xF9, 0x9E, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x9C, 0x00, 0xDE, 0xF9, 0x9E, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x7F, 0x00, 0x99, 0xF9, 0xA6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x84, 0x00, 0x5B, 0xF9, 0xA2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x84, 0x00, 0x5B, 0xF9, 0xA2, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x84, 0x00, 0x5B, 0xF9, 0xA2, - 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x08, 0x86, 0xFF, 0xAA, 0xF8, 0x63, - 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x08, 0x87, 0xFF, 0xAA, 0xF8, 0x64, - 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x60, 0x00, 0x10, 0xF9, 0xAD, - 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x09, 0x2B, 0x00, 0x9E, 0xFA, 0xA4, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x30, 0x00, 0xA9, 0xFA, 0x98, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x32, 0x00, 0xA9, 0xFA, 0x95, - 0xFF, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x2F, 0x00, 0xA1, 0xFA, 0x9C, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x37, 0x00, 0x2D, 0xF9, 0xAB, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0x00, 0x35, 0xFA, 0xEF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xA6, 0x00, 0x2D, 0xFC, 0x8E, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x28, 0x00, 0x35, 0xFD, 0xAD, - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xFD, 0xC7, 0xFF, 0xE6, 0xFA, 0xF6, - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xFE, 0xD8, 0xFF, 0xEE, 0xFB, 0xF4, - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xFF, 0xDC, 0xFF, 0xE6, 0xFD, 0x46, - 0xFF, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x4B, 0xFF, 0xE7, 0xFE, 0x2D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x11, 0xFF, 0xCD, 0x00, 0x96, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x11, 0xFF, 0xCD, 0x00, 0x96, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x16, 0x00, 0x96, 0x00, 0x7C, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x1E, 0x01, 0xE9, 0x00, 0x49, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x2C, 0x04, 0x19, 0xFF, 0xF4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x4E, 0x06, 0x15, 0xFF, 0xC1, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x31, 0x07, 0x7F, 0xFF, 0xF1, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x31, 0x07, 0x7F, 0xFF, 0xF1, - 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0xFC, 0x60, 0xFF, 0x8E, 0xFE, 0xAD, - 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0xFC, 0x61, 0xFF, 0x85, 0xFE, 0xAE, - 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0xFC, 0x64, 0x00, 0x15, 0xFE, 0x9F, - 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0xFC, 0x66, 0x01, 0x04, 0xFE, 0x93, - 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0xFC, 0xF6, 0x02, 0xC5, 0xFE, 0xC2, - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0xFC, 0xD2, 0x04, 0x46, 0xFF, 0x38, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFC, 0x82, 0x05, 0xB0, 0xFF, 0x46, - 0xFF, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFC, 0x7D, 0x05, 0xAC, 0xFF, 0x4D, - 0x00, 0x00, 0x00, 0x00, 0xEB, 0x00, 0xFF, 0xFB, 0x00, 0x47, 0xFE, 0x2B, - 0x00, 0x00, 0x00, 0x00, 0xE1, 0x00, 0xFF, 0xF5, 0x00, 0x15, 0xFB, 0x8A, - 0x00, 0x00, 0x00, 0x00, 0xF5, 0x00, 0x01, 0x43, 0x00, 0x1F, 0xFA, 0xB2, - 0x00, 0x00, 0x00, 0x00, 0x27, 0x00, 0x02, 0x30, 0x00, 0x1D, 0xFA, 0xEE, - 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x02, 0x94, 0x00, 0x12, 0xFB, 0x89, - 0x00, 0x00, 0x00, 0x00, 0xE4, 0x00, 0x04, 0xB4, 0x00, 0x1C, 0xFB, 0x7B, - 0x00, 0x00, 0x00, 0x00, 0xE2, 0x00, 0x05, 0x45, 0x00, 0x11, 0xFC, 0x7C, - 0x00, 0x00, 0x00, 0x00, 0xF4, 0x00, 0x04, 0xAA, 0x00, 0x1B, 0xFD, 0x89, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xF5, 0x00, 0x0C, 0xFD, 0xE2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0xFF, 0xD6, 0xFD, 0xE5, - 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0xFE, 0xFA, 0xFF, 0xDD, 0xFD, 0xCF, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xFD, 0xD8, 0xFF, 0xF9, 0xFE, 0x2B, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x15, 0x00, 0x06, 0xFF, 0x68, - 0x00, 0x00, 0x00, 0x1E, 0xEB, 0x00, 0x00, 0x02, 0xFF, 0xCD, 0xFC, 0x47, - 0x00, 0x00, 0x00, 0x1E, 0xE1, 0x00, 0x00, 0xF6, 0xFF, 0xC1, 0xF9, 0xE6, - 0x00, 0x00, 0x00, 0x1E, 0xF5, 0x00, 0x03, 0x2D, 0xFF, 0xBE, 0xFA, 0xAD, - 0x00, 0x00, 0x00, 0x14, 0x27, 0x00, 0x02, 0xC7, 0xFF, 0xFF, 0xFC, 0xCA, - 0x00, 0x00, 0x00, 0x1E, 0x19, 0x00, 0x04, 0x7B, 0xFF, 0xB4, 0xFB, 0x52, - 0x00, 0x00, 0x00, 0x14, 0xE4, 0x00, 0x05, 0xEB, 0xFF, 0xED, 0xFC, 0xFF, - 0x00, 0x00, 0x00, 0x1E, 0xE2, 0x00, 0x05, 0x3D, 0xFF, 0xBC, 0xFE, 0x69, - 0x00, 0x00, 0x00, 0x1E, 0xF4, 0x00, 0x02, 0xC8, 0xFF, 0xB7, 0xFD, 0xE1, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xD6, 0xFE, 0x02, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFE, 0xDF, 0xFF, 0x8C, 0xFD, 0xEF, - 0x00, 0x00, 0x00, 0x1E, 0x0D, 0x00, 0xFD, 0x19, 0xFF, 0x9E, 0xFE, 0x46, - 0x00, 0x00, 0x00, 0x1E, 0x10, 0x00, 0xFC, 0xC0, 0xFF, 0xCD, 0xFF, 0xC7, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFC, 0x30, 0x00, 0x60, 0x01, 0x1A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xCF, 0x02, 0x17, 0x07, 0xF0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x75, 0x01, 0x8B, 0x06, 0x22, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xE3, 0x01, 0x23, 0x04, 0xEE, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xA2, 0x01, 0xA8, 0x02, 0xDC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0x8B, 0x02, 0x62, 0x00, 0x50, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0xB5, 0x01, 0x89, 0xFC, 0xDB, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xA8, 0x01, 0x2D, 0xF7, 0xE1, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF5, 0x58, 0x00, 0xF2, 0x06, 0x73, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF5, 0xFE, 0x00, 0x65, 0x04, 0xA5, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF6, 0x65, 0xFF, 0xE3, 0x03, 0x85, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF7, 0x71, 0x01, 0x1D, 0x01, 0x2A, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF7, 0xF7, 0x01, 0x86, 0xFF, 0x48, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF8, 0x73, 0x01, 0x16, 0xFE, 0x9C, - 0xFF, 0x00, 0x00, 0x2A, 0x00, 0x00, 0xF8, 0x6D, 0x00, 0xE0, 0xF9, 0xCC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xD4, 0x00, 0xA6, 0xFA, 0xE3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xD4, 0x00, 0xA6, 0xFA, 0xE3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xFE, 0x00, 0x66, 0xF9, 0xCF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xF6, 0x00, 0x46, 0xF9, 0x66, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x7C, 0x00, 0x53, 0xFA, 0x6C, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC9, 0x00, 0x3A, 0xFC, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x6F, 0xFF, 0xDE, 0xFD, 0xC0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x17, 0xFF, 0xBE, 0xFE, 0xC7, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x6A, 0x00, 0xAB, 0x01, 0x1B, - 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x06, 0xDB, 0xFF, 0xD3, 0xFC, 0xA8, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x06, 0xDC, 0xFF, 0xDC, 0xFC, 0xAC, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x07, 0x7F, 0xFF, 0xBE, 0xFB, 0x94, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x06, 0xB5, 0xFF, 0xBD, 0xFA, 0x16, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x03, 0x59, 0xFF, 0xD6, 0xFA, 0x1E, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x5B, 0xFF, 0xB1, 0xFB, 0x2F, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0xFD, 0xEE, 0xFF, 0x57, 0xFC, 0x9C, - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0xFC, 0x95, 0xFF, 0x34, 0xFD, 0xA4, - 0xFF, 0x00, 0x00, 0x19, 0x00, 0x00, 0xFA, 0x96, 0xFF, 0xF6, 0xFF, 0xB7, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xEF, 0xFF, 0x6E, 0xFD, 0xAA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xEF, 0xFF, 0x6E, 0xFD, 0xAA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x54, 0xFF, 0x68, 0xFD, 0xBF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xB5, 0xFF, 0x64, 0xFD, 0xE0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0D, 0xFF, 0x64, 0xFD, 0xFA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x9F, 0xFF, 0x64, 0xFE, 0x2B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x80, 0xFF, 0x61, 0xFE, 0x99, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xCA, 0xFF, 0x66, 0xFE, 0xAB, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xFF, 0x6D, 0xFE, 0xBF, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF9, 0x11, 0xFF, 0x0F, 0xFE, 0x1A, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF9, 0x11, 0xFF, 0x0F, 0xFE, 0x1A, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0xF9, 0xDD, 0xFE, 0x99, 0xFE, 0xC0, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0xFB, 0x37, 0xFE, 0x86, 0xFF, 0x8E, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0xFC, 0xC7, 0xFE, 0x7A, 0xFF, 0x8B, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0xFE, 0x21, 0xFF, 0x1D, 0xFF, 0x62, - 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0xFF, 0x5C, 0xFF, 0x8E, 0xFF, 0x2E, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFF, 0xA1, 0xFF, 0x56, 0xFF, 0x54, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFF, 0xDF, 0xFF, 0x4E, 0xFF, 0x5D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x26, 0x00, 0x16, 0xFB, 0xE5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x26, 0x00, 0x16, 0xFB, 0xE5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x79, 0x00, 0x1C, 0xFB, 0xDC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE2, 0x00, 0x14, 0xFC, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x15, 0xFD, 0xCF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xA5, 0x00, 0x6F, 0xFE, 0xAD, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xB3, 0x00, 0x8E, 0xFF, 0x63, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x03, 0x81, 0xFF, 0xA1, 0xFD, 0xC3, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x03, 0x81, 0xFF, 0xA1, 0xFD, 0xC3, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x02, 0x37, 0xFF, 0x21, 0xFD, 0x88, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x5D, 0xFF, 0x63, 0xFE, 0x39, - 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0xFE, 0xF8, 0x00, 0x7D, 0xFF, 0x60, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFE, 0x07, 0x00, 0xC8, 0xFF, 0xB7, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFD, 0xC3, 0x00, 0xD1, 0xFF, 0x6A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF9, 0x00, 0x4D, 0xFD, 0x4B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x2A, 0x00, 0x9E, 0xFC, 0xF8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x1B, 0x01, 0x74, 0xFD, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x2C, 0x01, 0x63, 0xFB, 0xEA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xC2, 0x00, 0x3C, 0xFA, 0xA3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xF4, 0x00, 0x12, 0xF8, 0x7D, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xF4, 0x00, 0x12, 0xF8, 0x7D, - 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFE, 0xDB, 0xFF, 0x54, 0xFC, 0x06, - 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFE, 0xB0, 0xFF, 0x91, 0xFB, 0x66, - 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFE, 0x79, 0x00, 0x70, 0xFB, 0x62, - 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFD, 0xE5, 0x00, 0xAC, 0xFB, 0x55, - 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0xFD, 0x9B, 0x00, 0x79, 0xFB, 0x3C, - 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFD, 0x0D, 0x00, 0x37, 0xFA, 0x1A, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFD, 0x20, 0x00, 0x1D, 0xFA, 0x0D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x17, 0xFB, 0x25, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x11, 0xF7, 0xF3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xEF, 0x00, 0x0A, 0xF6, 0xB4, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x34, 0x00, 0x08, 0xF5, 0x4E, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x63, 0x00, 0x09, 0xF4, 0x94, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xD3, 0x00, 0x05, 0xF4, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xC0, 0x00, 0x05, 0xF3, 0xEC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xA1, 0x00, 0x04, 0xF3, 0xE5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x43, 0x00, 0x02, 0xF3, 0xD4, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x6D, 0x00, 0x03, 0xF3, 0xF1, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x32, 0xFF, 0x86, 0xF9, 0x47, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x42, 0xFF, 0x4F, 0xF6, 0x27, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0x81, 0xFF, 0x13, 0xF6, 0x12, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xEB, 0xFF, 0x7E, 0xF6, 0x0E, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x2B, 0xFF, 0xC5, 0xF5, 0x54, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFF, 0x90, 0xFF, 0xB2, 0xF5, 0x08, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFE, 0xB4, 0x00, 0x11, 0xF3, 0xE0, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFD, 0x8C, 0x00, 0x1A, 0xF3, 0x86, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFC, 0x2B, 0x00, 0x67, 0xF3, 0xAE, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFB, 0x56, 0x00, 0x51, 0xF3, 0xAC, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x9D, 0x00, 0x1E, 0x00, 0x3A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xC9, 0x00, 0x3C, 0x00, 0x39, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xF7, 0x00, 0x5A, 0x00, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xF7, 0x00, 0x5A, 0x00, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5, 0x35, 0x00, 0x57, 0x00, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xAE, 0x00, 0x36, 0x00, 0x1D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xCE, 0x00, 0x31, 0x00, 0x1C, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xCE, 0x00, 0x31, 0x00, 0x1C, - 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0xF6, 0x69, 0xFF, 0x5A, 0x00, 0x4D, - 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0xF6, 0x9D, 0xFF, 0x8D, 0x00, 0x4B, - 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0xF6, 0xD6, 0xFF, 0xC8, 0x00, 0x3B, - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xF6, 0xD9, 0xFF, 0xD3, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xF7, 0x17, 0xFF, 0xD0, 0x00, 0x45, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xF8, 0x94, 0xFF, 0xC5, 0x00, 0x0F, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xF8, 0xB8, 0xFF, 0xCC, 0x00, 0x1A, - 0xFF, 0x00, 0x00, 0x04, 0x00, 0x00, 0xF8, 0xB8, 0xFF, 0xCC, 0x00, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x61, 0x03, 0xCE, 0xF2, 0xBF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x33, 0x03, 0x8D, 0xF4, 0x0F, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x59, 0x03, 0x66, 0xF4, 0xDF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xE7, 0x03, 0x21, 0xF5, 0xD5, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x9A, 0x02, 0xA9, 0xF7, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x58, 0x02, 0x20, 0xF8, 0xB1, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xBF, 0x01, 0xF3, 0xFA, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xF2, 0x01, 0xEF, 0xFB, 0x8D, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x43, 0x01, 0xFE, 0xFD, 0x31, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x50, 0x02, 0x00, 0xFE, 0xA3, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xCD, 0x02, 0x14, 0xFF, 0x83, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xCE, 0x02, 0x2D, 0x00, 0x0D, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xD8, 0x02, 0x31, 0x00, 0x0D, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFE, 0xA7, 0x03, 0x3C, 0xF4, 0x78, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFC, 0xB7, 0x03, 0x06, 0xF5, 0xE1, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFB, 0xF7, 0x02, 0xD4, 0xF6, 0xB4, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFB, 0x96, 0x02, 0x78, 0xF7, 0xA5, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFB, 0x66, 0x02, 0x17, 0xF8, 0xE0, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFB, 0x26, 0x01, 0xC5, 0xFA, 0x9B, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0xFA, 0xDD, 0x01, 0xEB, 0xFC, 0x29, - 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFA, 0x89, 0x02, 0x08, 0xFD, 0x69, - 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0xFA, 0xF3, 0x02, 0x0A, 0xFE, 0x2D, - 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFB, 0x2B, 0x02, 0x26, 0xFE, 0x09, - 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFB, 0x39, 0x02, 0x16, 0xFE, 0x2C, - 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFB, 0x08, 0x02, 0x02, 0xFE, 0x1F, - 0xFF, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFB, 0x31, 0x02, 0x3F, 0xFE, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x5D, 0x01, 0xF9, 0xF6, 0x7A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x7A, 0x01, 0x36, 0xF7, 0xAB, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x8B, 0x00, 0x66, 0xFA, 0x4F, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xC4, 0x00, 0x32, 0xFC, 0x9F, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0xB6, 0x00, 0x22, 0xFD, 0xDA, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x71, 0x00, 0x54, 0xFD, 0xEC, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0xDF, 0x00, 0xA6, 0xFE, 0xD5, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFD, 0x5A, 0x01, 0x07, 0xF7, 0xDB, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFC, 0x6F, 0x00, 0x63, 0xF9, 0x18, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xFA, 0x65, 0x00, 0x2E, 0xFB, 0xE0, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF8, 0x43, 0x00, 0x10, 0xFD, 0xDC, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF5, 0xD2, 0x00, 0x0C, 0xFE, 0x55, - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF5, 0x7E, 0x00, 0x6C, 0xFD, 0xE9, - 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0xF5, 0xF2, 0x00, 0xA8, 0xFE, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xE5, 0x01, 0x81, 0x05, 0x4B, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xE4, 0x00, 0xB9, 0x05, 0x56, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xCC, 0x00, 0x10, 0x05, 0x56, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x42, 0x00, 0x47, 0x05, 0x6D, - 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0xF8, 0x8A, 0x00, 0xE8, 0x03, 0x78, - 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0xFC, 0x3E, 0x00, 0x1D, 0x04, 0x10, - 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0xFE, 0xA3, 0x00, 0x41, 0x05, 0xF7, - 0xFF, 0x00, 0x00, 0x46, 0x00, 0x00, 0xFE, 0xDA, 0x01, 0x09, 0x06, 0x42 -}; - - -s32 D_80286A04[] = {0x01000000, 0x80286518, 0x80286518}; - -u8 D_80286A10[] = { - 0x00, 0x96, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x28, 0x5D, 0x80, - 0x80, 0x28, 0x5D, 0xB0, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, - 0x80, 0x28, 0x5D, 0xE0, 0x80, 0x28, 0x5E, 0x1C, 0x00, 0xF1, 0x00, 0x00, - 0x00, 0x0B, 0x00, 0x00, 0x80, 0x28, 0x5E, 0xB8, 0x80, 0x28, 0x5F, 0x18, - 0x00, 0xF1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x28, 0x5E, 0x58, - 0x80, 0x28, 0x5E, 0x88, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, - 0x80, 0x28, 0x5F, 0x78, 0x80, 0x28, 0x5F, 0xC0, 0x00, 0xF1, 0x00, 0x00, - 0x00, 0x0E, 0x00, 0x00, 0x80, 0x28, 0x69, 0xA4, 0x80, 0x28, 0x69, 0xD4, - 0x00, 0xF1, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x80, 0x28, 0x60, 0x14, - 0x80, 0x28, 0x60, 0x44, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, - 0x80, 0x28, 0x60, 0x74, 0x80, 0x28, 0x60, 0xD4, 0x00, 0xF1, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x80, 0x28, 0x61, 0x34, 0x80, 0x28, 0x61, 0xD0, - 0x00, 0xF1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x80, 0x28, 0x62, 0x6C, - 0x80, 0x28, 0x62, 0xC0, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, - 0x80, 0x28, 0x63, 0x14, 0x80, 0x28, 0x63, 0x80, 0x00, 0xF0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x28, 0x64, 0xC4, 0x80, 0x28, 0x65, 0x18, - 0x00, 0xF0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x80, 0x28, 0x65, 0x6C, - 0x80, 0x28, 0x65, 0xC0, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, - 0x80, 0x28, 0x66, 0x14, 0x80, 0x28, 0x66, 0x8C, 0x00, 0xF0, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x80, 0x28, 0x67, 0x04, 0x80, 0x28, 0x67, 0x64, - 0x00, 0xF0, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x80, 0x28, 0x67, 0xC4, - 0x80, 0x28, 0x68, 0x60, 0x00, 0xF0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x80, 0x28, 0x65, 0x18, 0x80, 0x28, 0x65, 0x18, 0x00, 0xF2, 0x00, 0x00, - 0x02, 0x07, 0x00, 0x00, 0x80, 0x28, 0x68, 0xFC, 0x80, 0x28, 0x69, 0x50, - 0x00, 0xF0, 0x00, 0x00 -}; - -s32 D_80286B34[] = { - 0x009600F3, 0x00F300F3, - 0x00F300F3, 0x00F300F3, - 0x00F300F3, 0x00F300F3, - 0x00F300F3, 0x00F200F2, - 0x00F200F9, 0x00F00000, -}; -void func_802847CC(s32); - -struct _struct_D_80286B5C_0x8 D_80286B5C[] = { - { func_802847CC, 0x7FFF }, -}; - -//#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de - -struct struct_80284AE8 { - u8 unk0[0x1C]; - u8 unk1C; -}; - -void func_80284AE8(CinematicCamera *c) { - s32 pad[3]; - s16 cutsceneDuration; - -#define CUTSCENE(id, cutscene) \ - case id: \ - cutsceneDuration = cutscene[sCutsceneShot].unk4; \ - cutscene[sCutsceneShot].shot(c); \ - - if (!c->cutscene) { return; } - switch (c->cutscene) { - CUTSCENE(2, D_80285D10) - break; - CUTSCENE(3, D_80285D10) - break; - CUTSCENE(4, D_80285D10) - break; - CUTSCENE(5, D_80285D58) - func_80283C58(c); - break; - CUTSCENE(6, D_80286B5C) - break; - } - -#undef CUTSCENE - - if ((cutsceneDuration != 0) && ((gCutsceneShotTimer & 0xC000) == 0)) { - - if (gCutsceneShotTimer < 16383) { - gCutsceneShotTimer++; - } - if (gCutsceneShotTimer == cutsceneDuration) { - sCutsceneShot++; - gCutsceneShotTimer = 0; - func_8028240C(); - } - } else { - if (gCutsceneShotTimer & 0x4000) { - gCutsceneShotTimer = 0; - func_8028240C(); - } else { - D_802876D8 = 0; - sCutsceneShot = 0; - gCutsceneShotTimer = 0; - func_8028240C(); - } - } - -} - -void func_80284CC0(void) { - f32 temp_f0; - f32 temp_f14; - - temp_f14 = D_802856B0 - D_802856C0; - if (temp_f14 < 0.0f) { - temp_f14 = 0.0f; - } - temp_f0 = D_802856B0 + D_802856C0; - // Note that this MUST be on one line. All hail significant whitespace in C! - do {if (temp_f0 > 240.0f) { temp_f0 = 239.0f; } } while (0); - - gDPPipeSync(gDisplayListHead++); - gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); - gDPSetCycleType(gDisplayListHead++, G_CYC_FILL); - gDPSetFillColor(gDisplayListHead++, (GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1))); - gDPFillRectangle(gDisplayListHead++, 0, 0, 319, (s32)temp_f14); - gDPFillRectangle(gDisplayListHead++, 0, (s32)temp_f0, 319, 239); - gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); - func_802822AC(&D_802856C0, D_802856B8, D_802856BC / D_802856B4); -} - diff --git a/src/code_80281FA0.h b/src/code_80281FA0.h deleted file mode 100644 index 268416104..000000000 --- a/src/code_80281FA0.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef CODE_80281FA0_h -#define CODE_80281FA0_h - -#include "common_structs.h" - -/* Function Prototypes */ - -void vec3f_set_dupe(Vec3f, f32, f32, f32); -void vec3s_set_dupe(Vec3s, s16, s16, s16); -void func_80281FDC(Vec3f); -void func_80281FF4(Vec3s); -void vec3f_copy_dupe(Vec3f, Vec3f); -void vec3s_copy_dupe(Vec3s, Vec3s); -void func_80282040(); -void func_80282048(); -void func_80282050(Vec3f, Vec3f, s16); -void func_802820F8(Vec3f, Vec3f, s16); -s32 func_802821A0(f32*, f32, f32); -s32 func_80282200(s16*, s16, s16); -s32 func_802822AC(f32*, f32, f32); -s32 func_80282364(s16*, s16, s16); -void func_8028240C(); -void func_80282434(Camera*); -void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*); -void func_80282504(Vec3f, Vec3f, f32, s16, s16); -void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s); -//s32 func_80282D90(Camera*, struct struct_80282C40*, struct struct_80282C40*, s32); -//void func_80282E58(Camera*, s16*, s32); -void func_80282F00(s16*, s16); -void func_80283240(s16); -s32 func_802832C4(void (*)(s32), Camera*, s16, s16); -s32 func_80283330(s32); -s32 func_80283428(); -void func_80283968(s32); -void func_80283994(s32); -void func_802839B4(s32); -void func_802839CC(s32); -void func_802839E0(s32); -void func_80283A00(s32); -void func_80283A34(s32); -void func_80283A54(s32); -void func_80283A7C(s32); -void func_80283AA4(s32); -void func_80283ACC(s32); -void func_80283AF4(s32); -void func_80283B1C(s32); -void func_80283B44(s32); -void func_80283B6C(s32); -void func_80283BA4(s32); -void func_80283BF0(s32); -void func_80283C14(s32); -void func_80283C38(s32); -void func_80283C58(CinematicCamera*); -void func_80283C78(s32); -void func_80283CA8(s32); -void func_80283CD0(s32); -void func_80283D04(s32); -void func_80283D2C(Camera*); -void func_80283EA0(Camera*); -void func_80283ED0(Camera*); -void func_80283EF8(Camera*); -void func_80283F6C(Camera*); -void func_80283FCC(Camera*); -void func_80283FF4(Camera*); -void func_80284068(Camera*); -void func_802840C8(Camera*); -void func_80284154(Camera*); -void func_80284184(Camera*); -void func_802841E8(Camera*); -void func_8028422C(Camera*); -void func_802842A8(s32); -void func_802842D8(s32); -void func_80284418(s32 arg0); -void func_80284494(s32 arg0); -void func_802844FC(s32 arg0); -void func_8028454C(s32 arg0); -void func_802845EC(s32 arg0); -void func_8028461C(s32 arg0); -void func_80284648(s32 arg0); -void func_802846AC(); -void func_802846B4(s32 arg0); -void func_80284CC0(); - -/* This is where I'd put my static data, if I had any */ - -extern u16 D_800DC5E4; -extern s32 D_80283FCC; -extern s32 D_80283FF4; -extern f32 D_802856B0; -extern f32 D_802856B4; -extern f32 D_802856B8; -extern f32 D_802856BC; -extern f32 D_802856C0; -//extern struct struct_80282C40 D_802856DC[]; -//extern s32 D_80285718[]; -//extern s32 D_80285754[]; -//extern s32 D_80285784[]; -//extern s32 D_802857B4[]; -//extern s32 D_802857CC[]; -//extern s32 D_802857F0; -//extern s32 D_80285850; -//extern s32 D_802858B0; -//extern s32 D_802858C8; -//extern s32 D_80285910; -//extern s32 D_80285928; -//extern s32 D_80285940; -//extern s32 D_80285A10; -//extern s32 D_80285A4C; -//extern s32 D_80285A88; -//extern s32 D_80285AB8; -//extern s32 D_80285AE8; -//extern s32 D_80285B00; -//extern s32 D_80285B18; -//extern s32 D_80285B54; -//extern s32 D_80285B90; -//extern s32 D_80285BA8; -//extern s32 D_80285C38; -//extern s32 D_80285C74; -extern s16 D_80285D14; -extern s32 D_802876D4; -extern s32 D_802876D8; -//extern struct credits_data_1FA0 *D_802876E0; - -#endif diff --git a/src/memory.c b/src/memory.c index 1339f9f01..31ca33a65 100644 --- a/src/memory.c +++ b/src/memory.c @@ -430,29 +430,21 @@ void func_802A86A8(mk64_Vtx *arg0, u32 arg1) { GLOBAL_ASM("asm/non_matchings/memory/func_802A86A8.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//void func_802A86A8(u8 *, s32); // extern -void func_802A87A8(s32 arg0, u32 arg1) { - //u8 *sp18; - u8 temp_v0; - u32 endptr; - u32 *addr; +void func_802A87A8(s32 arg0, u32 vertexCount) { + s32 pad; + u32 segment = SEGMENT_NUMBER2(arg0); + u32 offset = SEGMENT_OFFSET(arg0); + s32 old; + s32 addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + s32 temp_v0 = ALIGN16(vertexCount * 0x18); - temp_v0 = ALIGN16(arg1 * 0x18); + old = gPrevLoadedAddress; gPrevLoadedAddress += temp_v0; - addr = VIRTUAL_TO_PHYSICAL2(&gSegmentTable[((arg0 >> 0x18) * 4)] + arg0); - // &gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000 - //sp18 = temp_v0; - mio0decode(addr, temp_v0); - func_802A86A8(temp_v0, arg1); - endptr = gHeapEndPtr; - set_segment_base_addr(4, endptr); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802A87A8.s") -#endif + mio0decode(addr, old); + func_802A86A8(old, vertexCount); + set_segment_base_addr(4, gHeapEndPtr); +} UNUSED void func_802A8844(void) { diff --git a/src/menus.c b/src/menus.c index 95995ddbf..b1c4fa946 100644 --- a/src/menus.c +++ b/src/menus.c @@ -14,6 +14,7 @@ #include "code_800B45E0.h" #include "main.h" #include "staff_ghosts.h" +#include /** Externs to be put into headers **/ extern s16 D_8015F892; // bss unknown @@ -51,7 +52,7 @@ s8 gDebugGotoScene; s8 D_8018EDFB; s8 D_8018EDFC; s32 gMenuTimingCounter; -s32 D_8018EE04; +s32 gMenuDelayTimer; s8 D_8018EE08; s8 gCupSelection; s8 D_8018EE0A; @@ -172,7 +173,7 @@ void update_menus(void) { if (D_800E86A4 == 0) { for (controllerIdx = 0; controllerIdx < 4; controllerIdx++) { - // Quick jump through menus using the start button. + // Debug, quick jump through menus using the start button. if ((func_800B4520() == 0) && (gEnableDebugMode) && ((gControllers[controllerIdx].buttonPressed & START_BUTTON) != 0)) { // this is certainly a way to write these... switch (gMenuSelection) { @@ -181,7 +182,7 @@ void update_menus(void) { // deliberate (?) fallthru case MAIN_MENU: case PLAYER_SELECT_MENU: - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); break; } @@ -268,7 +269,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { sp2C = FALSE; if ((btnAndStick & CONT_DOWN) && (D_8018EDEC < 0x18)) { D_8018EDEC += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -278,7 +279,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B066C if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x16)) { D_8018EDEC -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -295,7 +296,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0758 if (btnAndStick & CONT_B) { func_8009E280(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); if (gSoundMode != sp38->unk4) { gSaveDataSoundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); @@ -318,16 +319,16 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } func_800B44BC(); switch (gSoundMode) { - case SOUND_STEREO: play_sound2(0x49008024); return; - case SOUND_HEADPHONES: play_sound2(0x49008025); return; - case SOUND_MONO: play_sound2(0x49008029); return; + case SOUND_STEREO: play_sound2(SOUND_MENU_STEREO); return; + case SOUND_HEADPHONES: play_sound2(SOUND_MENU_HEADPHONES); return; + case SOUND_MONO: play_sound2(SOUND_MENU_MONO); return; } break; case 0x17: switch(func_800B5DA4()) { case -1: D_8018EDEC = 0x2B; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; case 0: func_800B6798(); @@ -336,24 +337,24 @@ void options_menu_act(struct Controller *controller, u16 arg1) { case -1: D_8018EDEC = 0x46; sp38->unk4 = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); break; case 0: func_800B6708(); break; case 1: D_8018EDEC = 0x34; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; case 4: D_8018EDEC = 0x37; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; case 2: case 3: default: D_8018EDEC = 0x35; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); break; } // L800B09DC @@ -361,44 +362,44 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // but that is too big for the size of the struct... unsized array off the end? if (sp2C == -1 && !sp30->ghostDataSaved && !((u8 *)sp30)[0x84]) { D_8018EDEC = 0x2A; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } // L800B0A20 if (sp2C == 0) { if (sp30->ghostDataSaved) { D_8018EDEC = 0x28; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } else if (((u8 *)sp30)[0x84]) { D_8018EDEC = 0x29; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } else { D_8018EDEC = 0x2A; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } // else return? return; case 1: D_8018EDEC = 0x2C; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; case 2: default: D_8018EDEC = 0x2D; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } case 0x18: { D_8018EDEC = 0x1E; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } case 0x15: { func_8009E280(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } @@ -411,7 +412,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if ((btnAndStick & CONT_DOWN) && (D_8018EDEC < 0x1F)) { D_8018EDEC += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -420,7 +421,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0B74 if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x1F)) { D_8018EDEC -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -429,7 +430,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0BF8 if (btnAndStick & CONT_B) { D_8018EDEC = 0x18; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } // L800B0C20 @@ -437,13 +438,13 @@ void options_menu_act(struct Controller *controller, u16 arg1) { switch (D_8018EDEC) { case 0x1E: D_8018EDEC = 0x18; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); break; case 0x1F: D_8018EDEC = 0x20; func_800B46D0(); D_800DC5AC = 0; - play_sound2(0x4900801D); + play_sound2(SOUND_MENU_EXPLOSION); break; } } @@ -453,7 +454,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if (btnAndStick & (CONT_A | CONT_B | CONT_START)) { D_8018EDEC = 0x18; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } break; } @@ -462,7 +463,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if ((btnAndStick & CONT_DOWN) && (D_8018EDEC < 0x29) && (sp30[1].ghostDataSaved)) { D_8018EDEC += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -471,7 +472,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0D38 if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x29) && sp30->ghostDataSaved) { D_8018EDEC -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -480,7 +481,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0DD0 if (btnAndStick & CONT_B) { D_8018EDEC = 0x17; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } // L800B0DF4 @@ -491,7 +492,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } else { D_8018EDEC = 0x32; } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } break; } @@ -502,7 +503,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { if ((sp30[sp38->unk20].courseIndex != ((0, (D_8018EE10 + (D_8018EDEC - 0x32))->courseIndex))) || ((D_8018EE10 + (D_8018EDEC - 0x32))->ghostDataSaved == 0)) { if ((btnAndStick & CONT_DOWN) && (D_8018EDEC < 0x33)) { D_8018EDEC += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -510,7 +511,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x33)) { D_8018EDEC -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -520,7 +521,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B0FA4 if (btnAndStick & CONT_B) { D_8018EDEC = sp38->unk20 + 0x28; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & CONT_A) { // L800B0FCC sp38->unk1C = D_8018EDEC - 0x32; @@ -530,7 +531,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { D_8018EDEC = 0x3A; sp38->unk4 = 0; } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } break; } @@ -547,7 +548,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if (btnAndStick & (CONT_A | CONT_B | CONT_START)) { D_8018EDEC = 0x17; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } break; } @@ -556,7 +557,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if ((btnAndStick & CONT_RIGHT) && D_8018EDEC < 0x39) { D_8018EDEC += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -565,7 +566,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B10C4 if ((btnAndStick & CONT_LEFT) && D_8018EDEC >= 0x39) { D_8018EDEC -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp38->unk24 < 4.2) { sp38->unk24 += 4.0; } @@ -574,16 +575,16 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B114C if (btnAndStick & CONT_B) { D_8018EDEC = sp38->unk1C + 0x32; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if (btnAndStick & CONT_A) { if (D_8018EDEC == 0x38) { D_8018EDEC = 0x17; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else { D_8018EDEC = 0x3A; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); sp38->unk4 = 0; } } @@ -609,7 +610,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { // L800B1230 if (res != 0) { D_8018EDEC = 0x42; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } // L800B1254 @@ -619,7 +620,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { } if (res != 0) { D_8018EDEC = 0x41; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } // L800B12DC @@ -642,7 +643,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) { { if (func_800B6A68()) { D_8018EDEC = 0x36; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else if (sp30->ghostDataSaved) { D_8018EDEC = 0x28; } else { @@ -674,48 +675,48 @@ void data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if ((buttonAndStickPress & 0x400) != 0) { if ((gTimeTrialDataCourseIndex % 4) != 3) { ++gTimeTrialDataCourseIndex; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick up pressed, move selection up if not already in top row if ((buttonAndStickPress & 0x800) != 0) { if ((gTimeTrialDataCourseIndex & 3) != 0) { --gTimeTrialDataCourseIndex; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick right pressed, move selection right if not already in right-most column if ((buttonAndStickPress & 0x100) != 0) { if ((gTimeTrialDataCourseIndex / 4) != 3) { gTimeTrialDataCourseIndex += 4; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If DPad/Stick left pressed, move selection left if not already in left-most column if ((buttonAndStickPress & 0x200) != 0) { if ((gTimeTrialDataCourseIndex / 4) != 0) { gTimeTrialDataCourseIndex -= 4; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // If B pressed, go to main menu if ((buttonAndStickPress & 0x4000) != 0) { func_8009E258(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } // If A pressed, go to selected course's records if ((buttonAndStickPress & 0x8000) != 0) { gCourseRecordsMenuSelection = 0; func_8009E1C0(); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); } } // If D_8018EDEC != 1 and A pressed, go to main menu // (Will D_8018EDEC ever not equal 1 when entering the data menu?) else if ((buttonAndStickPress & 0x8000) != 0) { func_8009E258(); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); } } } @@ -738,12 +739,12 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { { if ((btnAndStick & CONT_LEFT) && (gTimeTrialDataCourseIndex > 0)) { gTimeTrialDataCourseIndex -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if ((btnAndStick & CONT_RIGHT) && (gTimeTrialDataCourseIndex < 15)) { gTimeTrialDataCourseIndex += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } sp28 = find_8018D9E0_entry_dupe(0xE8); @@ -763,7 +764,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if (gCourseRecordsMenuSelection == 1 && sp24->unknownBytes[0] == 0) { gCourseRecordsMenuSelection -= 1; } - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp28->unk24 < 4.2) { sp28->unk24 += 4.0; } @@ -783,7 +784,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { gCourseRecordsMenuSelection = 1; } } else { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp28->unk24 < 4.2) { sp28->unk24 += 4.0; } @@ -793,18 +794,18 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if (btnAndStick & CONT_B) { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & CONT_A) { if (sp28->unk24 < 4.2) { sp28->unk24 += 4.0; } if (gCourseRecordsMenuSelection == 0) { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else { D_8018EDEC = 0x0C; D_8018EDF9 = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } } break; @@ -814,7 +815,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { sp28 = find_8018D9E0_entry_dupe(0xE9); if ((btnAndStick & CONT_UP) && (D_8018EDF9 > 0)) { D_8018EDF9 -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp28->unk24 < 4.2) { sp28->unk24 += 4.0; } @@ -823,7 +824,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if ((btnAndStick & CONT_DOWN) && (D_8018EDF9 <= 0)) { D_8018EDF9 += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (sp28->unk24 < 4.2) { sp28->unk24 += 4.0; } @@ -832,7 +833,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if (btnAndStick & CONT_B) { D_8018EDEC = 0xB; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & CONT_A) { if (D_8018EDF9 != 0) { res = 0; @@ -841,7 +842,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { { func_800B4728(gTimeTrialDataCourseIndex); func_800B559C(gTimeTrialDataCourseIndex); - play_sound2(0x4900801D); + play_sound2(SOUND_MENU_EXPLOSION); res = -1; break; } @@ -851,9 +852,9 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { if (res >= 0) { if (func_800B69BC(res) != 0){ D_8018EDEC = 0x0D; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else { - play_sound2(0x4900801D); + play_sound2(SOUND_MENU_EXPLOSION); D_8018EDEC = 0x0B; } } @@ -865,7 +866,7 @@ void course_data_menu_act(struct Controller *controller, UNUSED u16 arg1) { D_8018EDEC = 0xB; } } else { - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); D_8018EDEC = 0xB; } } @@ -908,25 +909,25 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { case CONTROLLER_PAK_MENU_SELECT_RECORD: if ((buttonAndStickPress & 0x9000) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } if ((buttonAndStickPress & 0x300) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_END; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; case CONTROLLER_PAK_MENU_END: if ((buttonAndStickPress & 0x9000) != 0) { - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); func_8009E1C0(); D_800E86F8 = 0; return; } if ((buttonAndStickPress & 0x300) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_SELECT_RECORD; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; @@ -935,13 +936,13 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { selectedTableRow = D_800E86C4[gControllerPakSelectedTableRow + 2] - 1; if (D_8018EB38[selectedTableRow] == 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_QUIT; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } } else if ((buttonAndStickPress & 0x4000) != 0) { if (D_800E86D0[0] == 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_SELECT_RECORD; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } else if ((buttonAndStickPress & 0x800) != 0) { @@ -951,11 +952,11 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { gControllerPakSelectedTableRow = 0; if (D_800E86C4[gControllerPakSelectedTableRow + 2] != 1) { D_800E86D0[0] = 2; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } } else { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } } @@ -965,11 +966,11 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { gControllerPakSelectedTableRow = CONTROLLER_PAK_MENU_QUIT; if (D_800E86C4[gControllerPakSelectedTableRow + 2] != 0x10) { D_800E86D0[0] = 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } } else { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } } @@ -977,29 +978,29 @@ void controller_pak_menu_act(struct Controller* controller, UNUSED u16 arg1) { case CONTROLLER_PAK_MENU_QUIT: if ((buttonAndStickPress & 0xD000) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((buttonAndStickPress & 0x300) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_ERASE; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; case CONTROLLER_PAK_MENU_ERASE: if ((buttonAndStickPress & 0x9000) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_GO_TO_ERASING; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } if ((buttonAndStickPress & 0x4000) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_TABLE_GAME_DATA; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((buttonAndStickPress & 0x300) != 0) { gControllerPakMenuSelection = CONTROLLER_PAK_MENU_QUIT; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); return; } break; @@ -1048,17 +1049,17 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { if (func_800B4520() == 0) { if (arg1 == 0) { - D_8018EE04 += 1; + gMenuDelayTimer += 1; } switch (gDebugMenuSelection) { case DEBUG_MENU_DISABLED: { sp28 = FALSE; - if ((D_8018EE04 >= 0x2E) && (btnAndStick & (CONT_A | CONT_START))) { + if ((gMenuDelayTimer >= 0x2E) && (btnAndStick & (CONT_A | CONT_START))) { func_8009E1C0(); func_800CA330(0x19); - play_sound2(0x4900801A); + play_sound2(SOUND_INTRO_ENTER_MENU); } else { break; } @@ -1067,7 +1068,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { case DEBUG_MENU_DEBUG_MODE: { if (btnAndStick & (CONT_RIGHT | CONT_LEFT)) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (gEnableDebugMode) { gEnableDebugMode = FALSE; } else { @@ -1075,7 +1076,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { } } if (btnAndStick & CONT_DOWN) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); gDebugMenuSelection = DEBUG_MENU_COURSE; } break; @@ -1083,7 +1084,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { case DEBUG_MENU_COURSE: { if (btnAndStick & CONT_RIGHT) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (gCurrentCourseId < 0x13) { gCurrentCourseId += 1; } else { @@ -1091,7 +1092,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { } } if (btnAndStick & CONT_LEFT) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (gCurrentCourseId > 0) { gCurrentCourseId -= 1; } else { @@ -1099,11 +1100,11 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { } } if (btnAndStick & CONT_UP) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); gDebugMenuSelection = DEBUG_MENU_DEBUG_MODE; } if (btnAndStick & CONT_DOWN) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); gDebugMenuSelection = DEBUG_MENU_SCREEN_MODE; } break; @@ -1112,21 +1113,21 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { { if ((btnAndStick & CONT_RIGHT) && (D_8018EDF1 < 4)) { D_8018EDF1 += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); gScreenModeSelection = D_800F2B50[D_8018EDF1]; } if ((btnAndStick & CONT_LEFT) && (D_8018EDF1 > 0)) { D_8018EDF1 -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); gScreenModeSelection = D_800F2B50[D_8018EDF1]; } if (btnAndStick & CONT_UP) { gDebugMenuSelection = DEBUG_MENU_COURSE; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (btnAndStick & CONT_DOWN) { gDebugMenuSelection = DEBUG_MENU_PLAYER; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } break; } @@ -1134,19 +1135,19 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { { if ((btnAndStick & CONT_RIGHT) && (*gCharacterSelections < 7)) { gCharacterSelections[0] += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if ((btnAndStick & CONT_LEFT) && (gCharacterSelections[0] > 0)) { gCharacterSelections[0] -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (btnAndStick & CONT_UP) { gDebugMenuSelection = DEBUG_MENU_SCREEN_MODE; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (btnAndStick & CONT_DOWN) { gDebugMenuSelection = DEBUG_MENU_SOUND_MODE; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } break; } @@ -1157,7 +1158,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { if (gSoundMode == SOUND_UNUSED) { gSoundMode = SOUND_MONO; } - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); func_800B44BC(); gSaveDataSoundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); @@ -1168,18 +1169,18 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { if (gSoundMode == SOUND_UNUSED) { gSoundMode = SOUND_HEADPHONES; } - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); func_800B44BC(); gSaveDataSoundMode = gSoundMode; write_save_data_grand_prix_points_and_sound_mode(); } if (btnAndStick & CONT_UP) { gDebugMenuSelection = DEBUG_MENU_PLAYER; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (btnAndStick & CONT_DOWN) { gDebugMenuSelection = DEBUG_MENU_GIVE_ALL_GOLD_CUP; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } break; } @@ -1187,20 +1188,20 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { { if (btnAndStick & CONT_UP) { gDebugMenuSelection = DEBUG_MENU_SOUND_MODE; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (btnAndStick & CONT_B) { for (i = 0; i < 16; i++) { func_800B5404(0, i); } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); break; } else if (btnAndStick & CONT_L) { reset_save_data_grand_prix_points_and_sound_mode(); for (i = 0; i < 16; i++) { func_800B5404(i / 4, i); } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); break; } else if (btnAndStick & CONT_LEFT) { reset_save_data_grand_prix_points_and_sound_mode(); @@ -1211,7 +1212,7 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { func_800B5404(i / 4, i); } } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } else { break; } @@ -1241,16 +1242,16 @@ void splash_menu_act(struct Controller *controller, u16 arg1) { gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_EXTRA; } } - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); } else if ((btnAndStick & CONT_B) && (controller->button & Z_TRIG)) { func_8009E1C0(); func_800CA330(0x19); gDebugMenuSelection = DEBUG_MENU_EXITED; gDebugGotoScene = DEBUG_GOTO_CREDITS_SEQUENCE_CC_50; - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); } else if (btnAndStick & CONT_R) { gDebugMenuSelection = DEBUG_MENU_DISABLED; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } } } @@ -1314,12 +1315,12 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if ((btnAndStick & CONT_RIGHT) && D_8018EDF3 < 4) { D_8018EDF3 += 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if ((btnAndStick & CONT_LEFT) && D_8018EDF3 >= 2) { D_8018EDF3 -= 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } // L800B2B38 gPlayerCountSelection1 = D_8018EDF3; @@ -1334,24 +1335,24 @@ void main_menu_act(struct Controller *controller, u16 arg1) { func_8009E0F0(0x14); func_800CA330(0x19); D_8018EDE0 = 1; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_A) { // L800B2C00 gMainMenuSelectionDepth = GAME_MODE_SELECTION; func_800B44AC(); - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_L) { // L800B2C58 gMainMenuSelectionDepth = OPTIONS_SELECTION; func_8009E280(); - play_sound2(0x49009010); + play_sound2(SOUND_MENU_OPTION); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_R) { gMainMenuSelectionDepth = DATA_SELECTION; func_8009E258(); - play_sound2(0x49009011); + play_sound2(SOUND_MENU_DATA); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else { newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; @@ -1364,7 +1365,7 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if (D_800E86AC[D_8018EDF3 - 1] < D_800F2B58[D_8018EDF3 + 7]) { D_800E86AC[D_8018EDF3 - 1] += 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // L800B2D94 @@ -1372,33 +1373,33 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if (D_800E86AC[D_8018EDF3 - 1] > 0) { D_800E86AC[D_8018EDF3 - 1] -= 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // L800B2DE0 if (btnAndStick & CONT_B) { gMainMenuSelectionDepth = PLAYER_NUM_SELECTION; func_800B44AC(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_A) { // L800B2E3C switch(gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]) { case 0: gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; - play_sound2(0x4900900A); + play_sound2(SOUND_MENU_GP); break; case 2: gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; - play_sound2(0x4900900C); + play_sound2(SOUND_MENU_VERSUS); break; case 1: gMainMenuSelectionDepth = GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION; - play_sound2(0x4900900B); + play_sound2(SOUND_MENU_TIME_TRIALS); break; case 3: gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; - play_sound2(0x4900900D); + play_sound2(SOUND_MENU_BATTLE); break; default: gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; @@ -1414,13 +1415,13 @@ void main_menu_act(struct Controller *controller, u16 arg1) { break; } case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: - case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: + case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: { if (1); if ((arg1 == 0) && (++gMenuTimingCounter == 100 || gMenuTimingCounter % 300 == 0)) { // L800B2FAC if (gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]] == 0 || gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]] == 2) { - play_sound2(0x4900900E); + play_sound2(SOUND_MENU_SELECT_LEVEL); } } // L800B3000 @@ -1428,7 +1429,7 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if ((btnAndStick & CONT_UP) && (sp28 > 0)) { D_800E86B0[D_8018EDF3 - 1][D_800E86AC[D_8018EDF3 - 1]] -= 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } // L800B3068 if (btnAndStick & CONT_DOWN) { @@ -1447,7 +1448,7 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if (sp24) { D_800E86B0[D_8018EDF3 - 1][D_8018EDF3] += 1; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } // L800B3150 @@ -1455,17 +1456,17 @@ void main_menu_act(struct Controller *controller, u16 arg1) { if (btnAndStick & CONT_B) { gMainMenuSelectionDepth = GAME_MODE_SELECTION; func_800B44AC(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_A) { // L800B31DC func_800B44AC(); if (D_8018EDF3 == 1 && D_800E86AC[D_8018EDF3 - 1] == 1 && sp28 == 1) { func_8009E258(); - play_sound2(0x49009011); + play_sound2(SOUND_MENU_DATA); } else { gMainMenuSelectionDepth = CONFIRM_OK_SELECTION; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); gMenuTimingCounter = 0; } newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; @@ -1479,7 +1480,7 @@ void main_menu_act(struct Controller *controller, u16 arg1) { case CONFIRM_OK_SELECTION_FROM_BACK_OUT: { if ((arg1 == 0) && (++gMenuTimingCounter == 60 || gMenuTimingCounter % 300 == 0)) { - play_sound2(0x4900900F); + play_sound2(SOUND_MENU_OK); } // L800B330C if (btnAndStick & CONT_B) { @@ -1496,13 +1497,13 @@ void main_menu_act(struct Controller *controller, u16 arg1) { } // L800B3384 func_800B44AC(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); gMenuTimingCounter = 0; newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else if (btnAndStick & CONT_A) { // L800B33D8 func_8009E1C0(); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); func_800B28C8(); newMode = gGameModeFromNumPlayersAndRowSelection[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1]]; } else { @@ -1560,7 +1561,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (gCharacterGridSelections[arg1] == 0) { if (btnAndStick & CONT_B) { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } return; } @@ -1568,10 +1569,10 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (btnAndStick & CONT_B) { if (D_8018EDE8[arg1]) { D_8018EDE8[arg1] = FALSE; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } } // L800B3684 @@ -1603,7 +1604,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { // L800B37B0 if (is_character_spot_free(gCharacterGridSelections[arg1] + 5)) { gCharacterGridSelections[arg1] += 5; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } return; @@ -1613,7 +1614,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (gCharacterGridSelections[arg1] == 2 || gCharacterGridSelections[arg1] == 3 || gCharacterGridSelections[arg1] == 4) { if (is_character_spot_free(gCharacterGridSelections[arg1] + 3)) { gCharacterGridSelections[arg1] += 3; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } return; @@ -1623,7 +1624,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (gCharacterGridSelections[arg1] == 5 || gCharacterGridSelections[arg1] == 6 || gCharacterGridSelections[arg1] == 7) { if (is_character_spot_free(gCharacterGridSelections[arg1] - 3)) { gCharacterGridSelections[arg1] -= 3; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } return; @@ -1633,7 +1634,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { if (gCharacterGridSelections[arg1] == 6 || gCharacterGridSelections[arg1] == 7 || gCharacterGridSelections[arg1] == 8) { if (is_character_spot_free(gCharacterGridSelections[arg1] - 5)) { gCharacterGridSelections[arg1] -= 5; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } return; @@ -1645,7 +1646,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { // L800B391C if (is_character_spot_free(gCharacterGridSelections[arg1] + 1)) { gCharacterGridSelections[arg1] += 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); break; } gCharacterGridSelections[arg1] += 1; @@ -1660,7 +1661,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { do { if (is_character_spot_free(gCharacterGridSelections[arg1] - 1)) { gCharacterGridSelections[arg1] -= 1; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); break; } gCharacterGridSelections[arg1] -= 1; @@ -1677,7 +1678,7 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { } // L800B3A30 if (is_character_spot_free(gCharacterGridSelections[arg1])) { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } break; @@ -1687,16 +1688,16 @@ void player_select_menu_act(struct Controller *controller, u16 arg1) { { if (!arg1 && (++gMenuTimingCounter == 60 || gMenuSelection % 300 == 0)) { // L800B3A94 - play_sound2(0x4900900F); + play_sound2(SOUND_MENU_OK); } // L800B3AA4 if (btnAndStick & CONT_B) { D_8018EDEE = 1; D_8018EDE8[arg1] = FALSE; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (btnAndStick & CONT_A) { func_8009E1C0(); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); func_8000F124(); } break; @@ -1729,29 +1730,29 @@ void course_select_menu_act(struct Controller *arg0, u16 arg1) { D_8018EE0A = gCupSelection; ++gCupSelection; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } } if (((buttonAndStickPress & 0x200) != 0) && (gCupSelection > MUSHROOM_CUP)) { D_8018EE0A = gCupSelection; --gCupSelection; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } D_800DC540 = gCupSelection; gCurrentCourseId = gCupCourseOrder[gCupSelection][gCupCourseSelection]; if ((buttonAndStickPress & 0x4000) != 0) { func_8009E208(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if ((buttonAndStickPress & 0x8000) != 0) { if (gModeSelection != GRAND_PRIX) { D_8018EDEC = 2; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } else { D_8018EDEC = 3; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); gCurrentCourseId = gCupCourseOrder[gCupSelection][CUP_COURSE_ONE]; gMenuTimingCounter = 0; } @@ -1763,12 +1764,12 @@ void course_select_menu_act(struct Controller *arg0, u16 arg1) { if (((buttonAndStickPress & 0x400) != 0) && (gCupCourseSelection < CUP_COURSE_FOUR)) { ++gCupCourseSelection; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } if (((buttonAndStickPress & 0x800) != 0) && (gCupCourseSelection > CUP_COURSE_ONE)) { --gCupCourseSelection; func_800B44AC(); - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); } gCurrentCourseId = gCupCourseOrder[gCupSelection][gCupCourseSelection]; @@ -1779,19 +1780,19 @@ void course_select_menu_act(struct Controller *arg0, u16 arg1) { func_8009E208(); } func_800B44AC(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((buttonAndStickPress & 0x8000) != 0) { D_8018EDEC = 3; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); func_800B44AC(); gMenuTimingCounter = 0; } break; case 3: if ((arg1 == 0) && ((++gMenuTimingCounter == 0x3C) || ((gMenuTimingCounter % 300) == 0))) { - play_sound2(0x4900900F); + play_sound2(SOUND_MENU_OK); } if ((buttonAndStickPress & 0x4000) != 0) { @@ -1809,13 +1810,13 @@ void course_select_menu_act(struct Controller *arg0, u16 arg1) { } func_800B44AC(); - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if ((buttonAndStickPress & 0x8000) != 0) { func_8009E1C0(); func_800CA330(0x19); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); } break; } @@ -1827,7 +1828,7 @@ void func_800B3F74(s32 menuSelection) { gDebugMenuSelection = DEBUG_MENU_DISABLED; gMenuTimingCounter = 0; - D_8018EE04 = 0; + gMenuDelayTimer = 0; D_8018EE08 = 0; D_8015F890 = 0; D_8015F892 = 0; @@ -1909,7 +1910,7 @@ void func_800B3F74(s32 menuSelection) { // why... switch (gMainMenuSelectionDepth) { default: - gMainMenuSelectionDepth = TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT; + gMainMenuSelectionDepth = TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT; break; case OPTIONS_SELECTION: case DATA_SELECTION: @@ -1943,7 +1944,7 @@ void func_800B3F74(s32 menuSelection) { D_8018EDE8[i] = FALSE; gCharacterSelections[i] = i; } - play_sound2(0x49009012); + play_sound2(SOUND_MENU_SELECT_PLAYER); } else { func_800CA008(0, 0); func_800CB2C4(); @@ -1991,7 +1992,7 @@ void func_800B3F74(s32 menuSelection) { gGamestateNext = 0; func_800C8EAC(2); } - play_sound2(0x49009013); + play_sound2(SOUND_MENU_SELECT_MAP); D_8018EE0A = 0; if (gModeSelection == GRAND_PRIX) { gCupCourseSelection = 0; diff --git a/src/race_logic.c b/src/race_logic.c index 9fda20f48..d3a8f64e7 100644 --- a/src/race_logic.c +++ b/src/race_logic.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "camera.h" #include "waypoints.h" #include "staff_ghosts.h" @@ -903,7 +904,7 @@ loop_2: if ((temp_t7 & 0xFFFF) >= 3) { D_800DC5A8 = 0; } - play_sound2(0x4900801C); + play_sound2(SOUND_ACTION_PING); func_800029B0(); } } @@ -1006,8 +1007,8 @@ void func_8028FCBC(void) { if (D_800DC51C == 0) { if (gModeSelection == GRAND_PRIX) { func_800C8EF8(11); - play_sound2(0x49008018); - play_sound2(0x49008019); + play_sound2(SOUND_ACTION_REV_ENGINE); + play_sound2(SOUND_ACTION_REV_ENGINE_2); } else { func_800C8EF8(22); } diff --git a/src/render_courses.c b/src/render_courses.c index e26d33ccb..e35cc6be1 100644 --- a/src/render_courses.c +++ b/src/render_courses.c @@ -9,6 +9,21 @@ #include "code_80281780.h" #include "render_courses.h" +f32 gFloatArray802B8790[] = { + 1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3 +}; +s16 D_802B87B0 = 995; +s16 D_802B87B4 = 1000; +UNUSED s32 D_802B87B8 = 0; +s32 D_802B87BC = 0; +UNUSED s32 D_802B87C0 = 0; +s32 D_802B87C4 = 0; +s32 D_802B87C8 = 0; +s32 D_802B87CC = 0; +s16 D_802B87D0 = 0; +s16 D_802B87D4 = 0; +s16 D_802B87D8 = 0; + s32 func_80290C20(Camera *camera) { if (camera->unk_54.unk34 == 0) { return 1; @@ -48,137 +63,119 @@ void func_80290CAC(uintptr_t arg0) { } } -#ifdef MIPS_TO_C -//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de -extern u16 D_80152300; -s16 gCurrentCourseId; /* unable to generate initializer */ +extern u16 D_80152300[]; +s16 func_802ABD40(u16); -void load_surface_map(u32 arg0, struct UnkStruct_800DC5EC *arg1) { - Player *sp34; - Camera *sp30; - void *sp24; - s16 sp22; - s16 sp1E; - Camera *temp_a2; - Gfx *temp_v1_3; - Player *temp_t1; - s16 temp_v0_3; - s16 temp_v0_4; - s16 temp_v1; - s16 temp_v1_2; - s16 var_a0; +void load_surface_map(s32 arg0, struct UnkStruct_800DC5EC *arg1) { + Player *temp_t1 = arg1->player; + Camera *temp_a2 = arg1->camera; + u32 segment = SEGMENT_NUMBER2(arg0); + u32 offset = SEGMENT_OFFSET(arg0); + s32 *addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); s16 var_a3; + s16 temp_v1; + s16 sp1E; + s16 temp_v0_3; u16 temp_v0; - u16 temp_v0_2; - - temp_t1 = arg1->player; - temp_a2 = arg1->camera; - sp24 = gSegmentTable[arg0 >> 0x18] + (arg0 & 0xFFFFFF) + 0x80000000; - if (gIsMirrorMode != 0) { + + if (gIsMirrorMode) { temp_v0 = (u16) temp_a2->rot[1]; - if ((s32) temp_v0 < 0x2000) { + if (temp_v0 < 0x2000) { var_a3 = 2; - } else if ((s32) temp_v0 < 0x6000) { + } else if (temp_v0 < 0x6000) { var_a3 = 3; - } else if ((s32) temp_v0 < 0xA000) { + } else if (temp_v0 < 0xA000) { var_a3 = 0; - } else if ((s32) temp_v0 < 0xE000) { + } else if (temp_v0 < 0xE000) { var_a3 = 1; } else { var_a3 = 2; } } else { - temp_v0_2 = (u16) temp_a2->rot[1]; - if ((s32) temp_v0_2 < 0x2000) { + temp_v0 = (u16) temp_a2->rot[1]; + if (temp_v0 < 0x2000) { var_a3 = 2; - } else if ((s32) temp_v0_2 < 0x6000) { + } else if (temp_v0 < 0x6000) { var_a3 = 1; - } else if ((s32) temp_v0_2 < 0xA000) { + } + else if (temp_v0 < 0xA000) { var_a3 = 0; - } else { + } + else if (temp_v0 < 0xE000) { + var_a3 = 3; + } + else { var_a3 = 2; - if ((s32) temp_v0_2 < 0xE000) { - var_a3 = 3; - } } } arg1->playerDirection = var_a3; - if (*(&D_80152300 + (((s32) (temp_a2 - camera1) / 184) * 2)) == 1) { - sp34 = temp_t1; - sp22 = var_a3; - sp30 = temp_a2; + + if (D_80152300[temp_a2 - camera1] == 1) { sp1E = func_802ABD40(temp_a2->unk_54.unk3A); temp_v0_3 = func_802ABD40(temp_t1->unk_110.unk3A); temp_v1 = sp1E - temp_v0_3; if ((temp_v1 < 2) && (temp_v1 >= -1)) { - if (sp1E == 0x00FF) { - if (temp_v0_3 == 0x00FF) { - goto block_60; + if (sp1E == 255) { + if (temp_v0_3 == 255) { + temp_v1 = arg1->pathCounter; + } else if (temp_t1->unk_110.unk3C[2] > 30.0f) { + temp_v1 = arg1->pathCounter; + } else { + temp_v1 = temp_v0_3; } - if (temp_t1->unk_110.unk44 > 30.0f) { - goto block_60; - } - var_a0 = temp_v0_3; - } else { - if (temp_a2->unk_54.unk44 > 30.0f) { - goto block_60; - } - var_a0 = sp1E; + } else if (temp_a2->unk_54.unk3C[2] > 30.0f) { + temp_v1 = arg1->pathCounter; + } else { + temp_v1 = sp1E; } } else { - temp_v1_2 = gCurrentCourseId; - if (temp_v1_2 != 1) { - if (temp_v1_2 == 2) { - if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) { - var_a0 = temp_v0_3; - } else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) { - var_a0 = sp1E; - } else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) { - var_a0 = temp_v0_3; + + switch(gCurrentCourseId) { + case 2: + if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) { + temp_v1 = temp_v0_3; + } else if ((temp_v0_3 == 255) && (sp1E != 255)) { + temp_v1 = sp1E; + } else if ((temp_v0_3 != 255) && (sp1E == 255)) { + temp_v1 = temp_v0_3; + } else { + temp_v1 = arg1->pathCounter; + } + break; + case 1: + if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) { + temp_v1 = temp_v0_3; + } else if ((temp_v0_3 == 255) && (sp1E != 255)) { + temp_v1 = sp1E; + } else if ((temp_v0_3 != 255) && (sp1E == 255)) { + temp_v1 = temp_v0_3; } else { - goto block_60; + temp_v1 = arg1->pathCounter; } - } else { - if (temp_v0_3 == 0x00FF) { - goto block_60; + break; + default: + if (temp_v0_3 == 255) { + temp_v1 = arg1->pathCounter; + } else if (temp_t1->unk_110.unk3C[2] > 30.0f) { + temp_v1 = arg1->pathCounter; + } else { + temp_v1 = temp_v0_3; } - if (temp_t1->unk_110.unk44 > 30.0f) { - goto block_60; - } - var_a0 = temp_v0_3; - } - } else if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) { - var_a0 = temp_v0_3; - } else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) { - var_a0 = sp1E; - } else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) { - var_a0 = temp_v0_3; - } else { - goto block_60; + break; } } } else { - sp22 = var_a3; - sp30 = temp_a2; - temp_v0_4 = func_802ABD40(temp_a2->unk_54.unk3A); - var_a0 = temp_v0_4; - if (temp_a2->unk_54.unk44 > 30.0f) { - goto block_60; - } - if (temp_v0_4 == 0x00FF) { -block_60: - var_a0 = arg1->pathCounter; + temp_v1 = func_802ABD40(temp_a2->unk_54.unk3A); + if (temp_a2->unk_54.unk3C[2] > 30.0f) { + temp_v1 = arg1->pathCounter; + } else if (temp_v1 == 255) { + temp_v1 = arg1->pathCounter; } } - arg1->pathCounter = var_a0; - temp_v1_3 = gDisplayListHead; - gDisplayListHead = temp_v1_3 + 8; - temp_v1_3->words.w0 = 0x06000000; - temp_v1_3->words.w1 = *(sp24 + ((s16) (((var_a0 * 4) + var_a3) - 4) * 4)); + arg1->pathCounter = temp_v1; + temp_v1 = ((temp_v1 - 1) * 4) + var_a3; + gSPDisplayList(gDisplayListHead++, addr[temp_v1]); } -#else -GLOBAL_ASM("asm/non_matchings/render_courses/load_surface_map.s") -#endif void func_80291198(void) { gSPDisplayList(gDisplayListHead++, 0x07001140); @@ -1329,21 +1326,9 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) { } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//extern void func_802B5D64(u32, u16, s32, s32); // extern -extern Gfx D_06013FF8[]; -extern Gfx D_06014060[]; -extern Lights1 D_800DC610[]; -extern s16 D_802B87B0; -extern s16 D_802B87B4; -extern s16 D_802B87D4; -extern Gfx moo_moo_farm_dls[]; -extern Gfx D_06013FF8[]; -extern Gfx D_06014060[]; - +// Missing {} around if statements necessary for matching. void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) { - s32 pad[12]; + s32 pad[13]; s16 temp_s0 = arg0->pathCounter; s16 temp_s1 = arg0->playerDirection; @@ -1360,54 +1345,51 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) { load_surface_map(&moo_moo_farm_dls, arg0); if ((temp_s0 < 14) && (temp_s0 > 10)) { - if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) { + if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1)) gSPDisplayList(gDisplayListHead++, D_06013FF8); - } + } else if (temp_s0 < 16) { gSPDisplayList(gDisplayListHead++, D_06013FF8); } else if (temp_s0 < 19) { - if (temp_s1 != 2) { + if (temp_s1 != 2) gSPDisplayList(gDisplayListHead++, D_06013FF8); - } + } else if (temp_s0 < 20) { - if (temp_s1 == 0) { + if (temp_s1 == 0) gSPDisplayList(gDisplayListHead++, D_06013FF8); - } + } gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); if ((temp_s0 >= 16) && (temp_s0 < 24)) { - if ((temp_s1 == 2) || (temp_s1 == 3)) { + if ((temp_s1 == 2) || (temp_s1 == 3)) gSPDisplayList(gDisplayListHead++, 0x07005410); - } + } else if (temp_s0 < 9) { - if (temp_s1 == 2) { + if (temp_s1 == 2) gSPDisplayList(gDisplayListHead++, 0x07005410); - } + } if (temp_s0 < 4) { - if (temp_s1 != 0) { + if (temp_s1 != 0) gSPDisplayList(gDisplayListHead++, D_06014060); - } + } else if (temp_s0 < 8) { - if (temp_s1 == 2) { + if (temp_s1 == 2) gSPDisplayList(gDisplayListHead++, D_06014060); - } + } else if (temp_s0 >= 22) { gSPDisplayList(gDisplayListHead++, D_06014060); } else if (temp_s0 >= 18) { - if ((temp_s1 == 0) || (temp_s1 == 3)) { + if ((temp_s1 == 0) || (temp_s1 == 3)) gSPDisplayList(gDisplayListHead++, D_06014060); - } + } gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); gSPDisplayList(gDisplayListHead++, 0x070010C0); } -#else -GLOBAL_ASM("asm/non_matchings/render_courses/render_moo_moo_farm.s") -#endif void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) { s32 pad[13]; diff --git a/src/render_courses.h b/src/render_courses.h index f1c1b9062..ed1e3daea 100644 --- a/src/render_courses.h +++ b/src/render_courses.h @@ -60,7 +60,6 @@ extern s32 D_8015F5A0; extern s32 D_800DC5DC; extern s32 D_800DC5E0; -extern s16 D_802B87D8; extern s32 D_802B87C4; extern s32 D_802B87C8; extern s32 D_802B87CC; @@ -70,8 +69,6 @@ extern Gfx mario_raceway_dls[]; extern s32 D_801625EC; extern s32 D_801625F0; extern s32 D_801625F4; -extern s16 D_802B87B0; -extern s16 D_802B87B4; extern Gfx choco_mountain_dls[]; extern s32 D_802B87BC; extern Gfx bowsers_castle_dls[]; @@ -85,9 +82,11 @@ extern Gfx luigi_raceway_dls[]; extern s32 D_801625EC; extern s32 D_801625F0; extern s32 D_801625F4; -extern s16 D_802B87B0; -extern s16 D_802B87B4; -extern s16 D_802B87D4; + +extern Gfx D_06013FF8[]; +extern Gfx D_06014060[]; +extern Lights1 D_800DC610[]; +extern Gfx moo_moo_farm_dls[]; extern Gfx toads_turnpike_dls[]; @@ -95,7 +94,6 @@ extern Lights1 D_800DC610[]; // Light data? extern u8 kalimari_desert_dls[]; extern u8 sherbet_land_dls[]; extern Gfx wario_stadium_dls[]; -extern s16 D_802B87D0; extern Gfx dks_jungle_parkway_dls[]; extern Gfx D_060071B0[];