From e73681ce743c934508e87619f01e1ce0ee01aab0 Mon Sep 17 00:00:00 2001 From: glankk Date: Wed, 21 Apr 2021 19:51:44 +0200 Subject: [PATCH] ovl_En_River_Sound 1 non-matching (#786) * ovl_En_River_Sound * Implement review suggestions, run through clang-format * Responding to PR comments * Use CHECK_QUEST_ITEM, run through clang-tidy. --- .../ovl_En_River_Sound/EnRiverSound_Destroy.s | 24 -- .../ovl_En_River_Sound/EnRiverSound_Draw.s | 96 -------- .../ovl_En_River_Sound/EnRiverSound_Init.s | 61 ----- .../ovl_En_River_Sound/EnRiverSound_Update.s | 129 ---------- .../actors/ovl_En_River_Sound/func_80AE6BC0.s | 211 ---------------- data/overlays/actors/z_en_river_sound.data.s | 24 -- include/functions.h | 3 + spec | 5 +- .../ovl_En_River_Sound/z_en_river_sound.c | 225 +++++++++++++++++- .../ovl_En_River_Sound/z_en_river_sound.h | 4 +- 10 files changed, 228 insertions(+), 554 deletions(-) delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Destroy.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Draw.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Init.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Update.s delete mode 100644 asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6BC0.s delete mode 100644 data/overlays/actors/z_en_river_sound.data.s diff --git a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Destroy.s deleted file mode 100644 index b443a11c56..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Destroy.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel EnRiverSound_Destroy -/* 000D0 80AE6A00 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 000D4 80AE6A04 AFBF0014 */ sw $ra, 0x0014($sp) -/* 000D8 80AE6A08 AFA40018 */ sw $a0, 0x0018($sp) -/* 000DC 80AE6A0C AFA5001C */ sw $a1, 0x001C($sp) -/* 000E0 80AE6A10 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 000E4 80AE6A14 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 000E8 80AE6A18 54410006 */ bnel $v0, $at, .L80AE6A34 -/* 000EC 80AE6A1C 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -/* 000F0 80AE6A20 0C03D43B */ jal func_800F50EC -/* 000F4 80AE6A24 248400E4 */ addiu $a0, $a0, 0x00E4 ## $a0 = 000000E4 -/* 000F8 80AE6A28 10000007 */ beq $zero, $zero, .L80AE6A48 -/* 000FC 80AE6A2C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00100 80AE6A30 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -.L80AE6A34: -/* 00104 80AE6A34 54410004 */ bnel $v0, $at, .L80AE6A48 -/* 00108 80AE6A38 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0010C 80AE6A3C 0C03D541 */ jal func_800F5504 -/* 00110 80AE6A40 00000000 */ nop -/* 00114 80AE6A44 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE6A48: -/* 00118 80AE6A48 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0011C 80AE6A4C 03E00008 */ jr $ra -/* 00120 80AE6A50 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Draw.s deleted file mode 100644 index 1e5e353236..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Draw.s +++ /dev/null @@ -1,96 +0,0 @@ -glabel EnRiverSound_Draw -/* 00758 80AE7088 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 0075C 80AE708C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00760 80AE7090 AFA5001C */ sw $a1, 0x001C($sp) -/* 00764 80AE7094 908E014C */ lbu $t6, 0x014C($a0) ## 0000014C -/* 00768 80AE7098 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 0076C 80AE709C 240F0001 */ addiu $t7, $zero, 0x0001 ## $t7 = 00000001 -/* 00770 80AE70A0 55C00004 */ bnel $t6, $zero, .L80AE70B4 -/* 00774 80AE70A4 84E2001C */ lh $v0, 0x001C($a3) ## 0000001C -/* 00778 80AE70A8 10000045 */ beq $zero, $zero, .L80AE71C0 -/* 0077C 80AE70AC A08F014C */ sb $t7, 0x014C($a0) ## 0000014C -/* 00780 80AE70B0 84E2001C */ lh $v0, 0x001C($a3) ## 0000001C -.L80AE70B4: -/* 00784 80AE70B4 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 00788 80AE70B8 50400006 */ beql $v0, $zero, .L80AE70D4 -/* 0078C 80AE70BC 90F8014D */ lbu $t8, 0x014D($a3) ## 0000014D -/* 00790 80AE70C0 10410003 */ beq $v0, $at, .L80AE70D0 -/* 00794 80AE70C4 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00798 80AE70C8 5441000B */ bnel $v0, $at, .L80AE70F8 -/* 0079C 80AE70CC 2401000B */ addiu $at, $zero, 0x000B ## $at = 0000000B -.L80AE70D0: -/* 007A0 80AE70D0 90F8014D */ lbu $t8, 0x014D($a3) ## 0000014D -.L80AE70D4: -/* 007A4 80AE70D4 3C0580AE */ lui $a1, %hi(D_80AE7224) ## $a1 = 80AE0000 -/* 007A8 80AE70D8 24E400E4 */ addiu $a0, $a3, 0x00E4 ## $a0 = 000000E4 -/* 007AC 80AE70DC 0018C880 */ sll $t9, $t8, 2 -/* 007B0 80AE70E0 00B92821 */ addu $a1, $a1, $t9 -/* 007B4 80AE70E4 0C03D18D */ jal func_800F4634 -/* 007B8 80AE70E8 8CA57224 */ lw $a1, %lo(D_80AE7224)($a1) -/* 007BC 80AE70EC 10000035 */ beq $zero, $zero, .L80AE71C4 -/* 007C0 80AE70F0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 007C4 80AE70F4 2401000B */ addiu $at, $zero, 0x000B ## $at = 0000000B -.L80AE70F8: -/* 007C8 80AE70F8 54410006 */ bnel $v0, $at, .L80AE7114 -/* 007CC 80AE70FC 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 007D0 80AE7100 0C03D295 */ jal func_800F4A54 -/* 007D4 80AE7104 2404005A */ addiu $a0, $zero, 0x005A ## $a0 = 0000005A -/* 007D8 80AE7108 1000002E */ beq $zero, $zero, .L80AE71C4 -/* 007DC 80AE710C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 007E0 80AE7110 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -.L80AE7114: -/* 007E4 80AE7114 14410005 */ bne $v0, $at, .L80AE712C -/* 007E8 80AE7118 24E400E4 */ addiu $a0, $a3, 0x00E4 ## $a0 = 000000E4 -/* 007EC 80AE711C 0C03D38C */ jal func_800F4E30 -/* 007F0 80AE7120 8CE50090 */ lw $a1, 0x0090($a3) ## 00000090 -/* 007F4 80AE7124 10000027 */ beq $zero, $zero, .L80AE71C4 -/* 007F8 80AE7128 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE712C: -/* 007FC 80AE712C 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -/* 00800 80AE7130 14410006 */ bne $v0, $at, .L80AE714C -/* 00804 80AE7134 24E40008 */ addiu $a0, $a3, 0x0008 ## $a0 = 00000008 -/* 00808 80AE7138 2405003E */ addiu $a1, $zero, 0x003E ## $a1 = 0000003E -/* 0080C 80AE713C 0C03D4A8 */ jal func_800F52A0 -/* 00810 80AE7140 240603E8 */ addiu $a2, $zero, 0x03E8 ## $a2 = 000003E8 -/* 00814 80AE7144 1000001F */ beq $zero, $zero, .L80AE71C4 -/* 00818 80AE7148 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE714C: -/* 0081C 80AE714C 24010013 */ addiu $at, $zero, 0x0013 ## $at = 00000013 -/* 00820 80AE7150 14410006 */ bne $v0, $at, .L80AE716C -/* 00824 80AE7154 24E40008 */ addiu $a0, $a3, 0x0008 ## $a0 = 00000008 -/* 00828 80AE7158 24050028 */ addiu $a1, $zero, 0x0028 ## $a1 = 00000028 -/* 0082C 80AE715C 0C03D4A8 */ jal func_800F52A0 -/* 00830 80AE7160 24060320 */ addiu $a2, $zero, 0x0320 ## $a2 = 00000320 -/* 00834 80AE7164 10000017 */ beq $zero, $zero, .L80AE71C4 -/* 00838 80AE7168 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE716C: -/* 0083C 80AE716C 2401000E */ addiu $at, $zero, 0x000E ## $at = 0000000E -/* 00840 80AE7170 10410008 */ beq $v0, $at, .L80AE7194 -/* 00844 80AE7174 00024040 */ sll $t0, $v0, 1 -/* 00848 80AE7178 24010010 */ addiu $at, $zero, 0x0010 ## $at = 00000010 -/* 0084C 80AE717C 10410005 */ beq $v0, $at, .L80AE7194 -/* 00850 80AE7180 24010011 */ addiu $at, $zero, 0x0011 ## $at = 00000011 -/* 00854 80AE7184 10410003 */ beq $v0, $at, .L80AE7194 -/* 00858 80AE7188 24010012 */ addiu $at, $zero, 0x0012 ## $at = 00000012 -/* 0085C 80AE718C 14410007 */ bne $v0, $at, .L80AE71AC -/* 00860 80AE7190 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -.L80AE7194: -/* 00864 80AE7194 3C0480AE */ lui $a0, %hi(D_80AE71F8) ## $a0 = 80AE0000 -/* 00868 80AE7198 00882021 */ addu $a0, $a0, $t0 -/* 0086C 80AE719C 0C01E233 */ jal func_800788CC -/* 00870 80AE71A0 948471F8 */ lhu $a0, %lo(D_80AE71F8)($a0) -/* 00874 80AE71A4 10000007 */ beq $zero, $zero, .L80AE71C4 -/* 00878 80AE71A8 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE71AC: -/* 0087C 80AE71AC 00024840 */ sll $t1, $v0, 1 -/* 00880 80AE71B0 3C0580AE */ lui $a1, %hi(D_80AE71F8) ## $a1 = 80AE0000 -/* 00884 80AE71B4 00A92821 */ addu $a1, $a1, $t1 -/* 00888 80AE71B8 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 0088C 80AE71BC 94A571F8 */ lhu $a1, %lo(D_80AE71F8)($a1) -.L80AE71C0: -/* 00890 80AE71C0 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE71C4: -/* 00894 80AE71C4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00898 80AE71C8 03E00008 */ jr $ra -/* 0089C 80AE71CC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Init.s b/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Init.s deleted file mode 100644 index 2329dce72f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Init.s +++ /dev/null @@ -1,61 +0,0 @@ -glabel EnRiverSound_Init -/* 00000 80AE6930 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00004 80AE6934 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00008 80AE6938 AFA40018 */ sw $a0, 0x0018($sp) -/* 0000C 80AE693C AFA5001C */ sw $a1, 0x001C($sp) -/* 00010 80AE6940 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 00014 80AE6944 00802825 */ or $a1, $a0, $zero ## $a1 = 00000000 -/* 00018 80AE6948 A080014C */ sb $zero, 0x014C($a0) ## 0000014C -/* 0001C 80AE694C 305800FF */ andi $t8, $v0, 0x00FF ## $t8 = 00000000 -/* 00020 80AE6950 A498001C */ sh $t8, 0x001C($a0) ## 0000001C -/* 00024 80AE6954 00027203 */ sra $t6, $v0, 8 -/* 00028 80AE6958 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 0002C 80AE695C 31CF00FF */ andi $t7, $t6, 0x00FF ## $t7 = 00000000 -/* 00030 80AE6960 A48F014E */ sh $t7, 0x014E($a0) ## 0000014E -/* 00034 80AE6964 284100F8 */ slti $at, $v0, 0x00F8 -/* 00038 80AE6968 14200008 */ bne $at, $zero, .L80AE698C -/* 0003C 80AE696C 2444FF08 */ addiu $a0, $v0, 0xFF08 ## $a0 = FFFFFF08 -/* 00040 80AE6970 308400FF */ andi $a0, $a0, 0x00FF ## $a0 = 00000008 -/* 00044 80AE6974 0C03D21C */ jal func_800F4870 -/* 00048 80AE6978 AFA50018 */ sw $a1, 0x0018($sp) -/* 0004C 80AE697C 0C00B55C */ jal Actor_Kill - -/* 00050 80AE6980 8FA40018 */ lw $a0, 0x0018($sp) -/* 00054 80AE6984 1000001B */ beq $zero, $zero, .L80AE69F4 -/* 00058 80AE6988 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE698C: -/* 0005C 80AE698C 240100F7 */ addiu $at, $zero, 0x00F7 ## $at = 000000F7 -/* 00060 80AE6990 14410007 */ bne $v0, $at, .L80AE69B0 -/* 00064 80AE6994 24040004 */ addiu $a0, $zero, 0x0004 ## $a0 = 00000004 -/* 00068 80AE6998 0C03DBED */ jal func_800F6FB4 -/* 0006C 80AE699C AFA50018 */ sw $a1, 0x0018($sp) -/* 00070 80AE69A0 0C00B55C */ jal Actor_Kill - -/* 00074 80AE69A4 8FA40018 */ lw $a0, 0x0018($sp) -/* 00078 80AE69A8 10000012 */ beq $zero, $zero, .L80AE69F4 -/* 0007C 80AE69AC 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE69B0: -/* 00080 80AE69B0 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 00084 80AE69B4 1441000E */ bne $v0, $at, .L80AE69F0 -/* 00088 80AE69B8 3C038012 */ lui $v1, %hi(gBitFlags) -/* 0008C 80AE69BC 24637120 */ addiu $v1, %lo(gBitFlags) -/* 00090 80AE69C0 3C028016 */ lui $v0, %hi(gSaveContext+0xa4) -/* 00094 80AE69C4 8C42E704 */ lw $v0, %lo(gSaveContext+0xa4)($v0) -/* 00098 80AE69C8 8C790030 */ lw $t9, 0x0030($v1) ## 80127150 -/* 0009C 80AE69CC 03224024 */ and $t0, $t9, $v0 -/* 000A0 80AE69D0 11000005 */ beq $t0, $zero, .L80AE69E8 -/* 000A4 80AE69D4 00000000 */ nop -/* 000A8 80AE69D8 8C690038 */ lw $t1, 0x0038($v1) ## 80127158 -/* 000AC 80AE69DC 01225024 */ and $t2, $t1, $v0 -/* 000B0 80AE69E0 51400004 */ beql $t2, $zero, .L80AE69F4 -/* 000B4 80AE69E4 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE69E8: -/* 000B8 80AE69E8 0C00B55C */ jal Actor_Kill - -/* 000BC 80AE69EC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -.L80AE69F0: -/* 000C0 80AE69F0 8FBF0014 */ lw $ra, 0x0014($sp) -.L80AE69F4: -/* 000C4 80AE69F4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 000C8 80AE69F8 03E00008 */ jr $ra -/* 000CC 80AE69FC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Update.s b/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Update.s deleted file mode 100644 index 74653b0de7..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Update.s +++ /dev/null @@ -1,129 +0,0 @@ -glabel EnRiverSound_Update -/* 0058C 80AE6EBC 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00590 80AE6EC0 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00594 80AE6EC4 AFB00020 */ sw $s0, 0x0020($sp) -/* 00598 80AE6EC8 AFA5004C */ sw $a1, 0x004C($sp) -/* 0059C 80AE6ECC 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 -/* 005A0 80AE6ED0 8FB8004C */ lw $t8, 0x004C($sp) -/* 005A4 80AE6ED4 3C190001 */ lui $t9, 0x0001 ## $t9 = 00010000 -/* 005A8 80AE6ED8 AFAF003C */ sw $t7, 0x003C($sp) -/* 005AC 80AE6EDC 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 005B0 80AE6EE0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 005B4 80AE6EE4 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 005B8 80AE6EE8 10400005 */ beq $v0, $zero, .L80AE6F00 -/* 005BC 80AE6EEC 0338C821 */ addu $t9, $t9, $t8 -/* 005C0 80AE6EF0 10410003 */ beq $v0, $at, .L80AE6F00 -/* 005C4 80AE6EF4 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 005C8 80AE6EF8 54410049 */ bnel $v0, $at, .L80AE7020 -/* 005CC 80AE6EFC 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -.L80AE6F00: -/* 005D0 80AE6F00 8608014E */ lh $t0, 0x014E($s0) ## 0000014E -/* 005D4 80AE6F04 8F391E08 */ lw $t9, 0x1E08($t9) ## 00011E08 -/* 005D8 80AE6F08 3C0D8016 */ lui $t5, %hi(gSegments) -/* 005DC 80AE6F0C 000848C0 */ sll $t1, $t0, 3 -/* 005E0 80AE6F10 03291021 */ addu $v0, $t9, $t1 -/* 005E4 80AE6F14 8C430004 */ lw $v1, 0x0004($v0) ## 00000004 -/* 005E8 80AE6F18 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 005EC 80AE6F1C 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 005F0 80AE6F20 00035100 */ sll $t2, $v1, 4 -/* 005F4 80AE6F24 000A5F02 */ srl $t3, $t2, 28 -/* 005F8 80AE6F28 000B6080 */ sll $t4, $t3, 2 -/* 005FC 80AE6F2C 01AC6821 */ addu $t5, $t5, $t4 -/* 00600 80AE6F30 8DAD6FA8 */ lw $t5, %lo(gSegments)($t5) -/* 00604 80AE6F34 00617024 */ and $t6, $v1, $at -/* 00608 80AE6F38 8FA6003C */ lw $a2, 0x003C($sp) -/* 0060C 80AE6F3C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00610 80AE6F40 90450000 */ lbu $a1, 0x0000($v0) ## 00000000 -/* 00614 80AE6F44 26070024 */ addiu $a3, $s0, 0x0024 ## $a3 = 00000024 -/* 00618 80AE6F48 01AE2021 */ addu $a0, $t5, $t6 -/* 0061C 80AE6F4C 00812021 */ addu $a0, $a0, $at -/* 00620 80AE6F50 AFA70030 */ sw $a3, 0x0030($sp) -/* 00624 80AE6F54 0C2B9AF0 */ jal func_80AE6BC0 -/* 00628 80AE6F58 24C60024 */ addiu $a2, $a2, 0x0024 ## $a2 = 00000024 -/* 0062C 80AE6F5C 10400045 */ beq $v0, $zero, .L80AE7074 -/* 00630 80AE6F60 8FA4004C */ lw $a0, 0x004C($sp) -/* 00634 80AE6F64 8FAF0030 */ lw $t7, 0x0030($sp) -/* 00638 80AE6F68 248407C0 */ addiu $a0, $a0, 0x07C0 ## $a0 = 000007C0 -/* 0063C 80AE6F6C AFA4002C */ sw $a0, 0x002C($sp) -/* 00640 80AE6F70 26050078 */ addiu $a1, $s0, 0x0078 ## $a1 = 00000078 -/* 00644 80AE6F74 27A60034 */ addiu $a2, $sp, 0x0034 ## $a2 = FFFFFFEC -/* 00648 80AE6F78 02003825 */ or $a3, $s0, $zero ## $a3 = 00000000 -/* 0064C 80AE6F7C 0C00F269 */ jal BgCheck_EntityRaycastFloor4 -/* 00650 80AE6F80 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00654 80AE6F84 3C01C6FA */ lui $at, 0xC6FA ## $at = C6FA0000 -/* 00658 80AE6F88 44812000 */ mtc1 $at, $f4 ## $f4 = -32000.00 -/* 0065C 80AE6F8C 8FA4002C */ lw $a0, 0x002C($sp) -/* 00660 80AE6F90 8FA60034 */ lw $a2, 0x0034($sp) -/* 00664 80AE6F94 46040032 */ c.eq.s $f0, $f4 -/* 00668 80AE6F98 00000000 */ nop -/* 0066C 80AE6F9C 45030006 */ bc1tl .L80AE6FB8 -/* 00670 80AE6FA0 A200014D */ sb $zero, 0x014D($s0) ## 0000014D -/* 00674 80AE6FA4 0C010830 */ jal SurfaceType_GetConveyorSpeed -/* 00678 80AE6FA8 8E050078 */ lw $a1, 0x0078($s0) ## 00000078 -/* 0067C 80AE6FAC 10000002 */ beq $zero, $zero, .L80AE6FB8 -/* 00680 80AE6FB0 A202014D */ sb $v0, 0x014D($s0) ## 0000014D -/* 00684 80AE6FB4 A200014D */ sb $zero, 0x014D($s0) ## 0000014D -.L80AE6FB8: -/* 00688 80AE6FB8 9202014D */ lbu $v0, 0x014D($s0) ## 0000014D -/* 0068C 80AE6FBC 1440000E */ bne $v0, $zero, .L80AE6FF8 -/* 00690 80AE6FC0 2459FFFF */ addiu $t9, $v0, 0xFFFF ## $t9 = FFFFFFFF -/* 00694 80AE6FC4 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 00698 80AE6FC8 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 0069C 80AE6FCC 14410003 */ bne $v0, $at, .L80AE6FDC -/* 006A0 80AE6FD0 00000000 */ nop -/* 006A4 80AE6FD4 10000027 */ beq $zero, $zero, .L80AE7074 -/* 006A8 80AE6FD8 A200014D */ sb $zero, 0x014D($s0) ## 0000014D -.L80AE6FDC: -/* 006AC 80AE6FDC 14400004 */ bne $v0, $zero, .L80AE6FF0 -/* 006B0 80AE6FE0 24080002 */ addiu $t0, $zero, 0x0002 ## $t0 = 00000002 -/* 006B4 80AE6FE4 24180001 */ addiu $t8, $zero, 0x0001 ## $t8 = 00000001 -/* 006B8 80AE6FE8 10000022 */ beq $zero, $zero, .L80AE7074 -/* 006BC 80AE6FEC A218014D */ sb $t8, 0x014D($s0) ## 0000014D -.L80AE6FF0: -/* 006C0 80AE6FF0 10000020 */ beq $zero, $zero, .L80AE7074 -/* 006C4 80AE6FF4 A208014D */ sb $t0, 0x014D($s0) ## 0000014D -.L80AE6FF8: -/* 006C8 80AE6FF8 332300FF */ andi $v1, $t9, 0x00FF ## $v1 = 000000FF -/* 006CC 80AE6FFC 28610003 */ slti $at, $v1, 0x0003 -/* 006D0 80AE7000 14200004 */ bne $at, $zero, .L80AE7014 -/* 006D4 80AE7004 A219014D */ sb $t9, 0x014D($s0) ## 0000014D -/* 006D8 80AE7008 24090002 */ addiu $t1, $zero, 0x0002 ## $t1 = 00000002 -/* 006DC 80AE700C 10000019 */ beq $zero, $zero, .L80AE7074 -/* 006E0 80AE7010 A209014D */ sb $t1, 0x014D($s0) ## 0000014D -.L80AE7014: -/* 006E4 80AE7014 10000017 */ beq $zero, $zero, .L80AE7074 -/* 006E8 80AE7018 A203014D */ sb $v1, 0x014D($s0) ## 0000014D -/* 006EC 80AE701C 2401000D */ addiu $at, $zero, 0x000D ## $at = 0000000D -.L80AE7020: -/* 006F0 80AE7020 10410004 */ beq $v0, $at, .L80AE7034 -/* 006F4 80AE7024 8FA4003C */ lw $a0, 0x003C($sp) -/* 006F8 80AE7028 24010013 */ addiu $at, $zero, 0x0013 ## $at = 00000013 -/* 006FC 80AE702C 14410006 */ bne $v0, $at, .L80AE7048 -/* 00700 80AE7030 8FAA004C */ lw $t2, 0x004C($sp) -.L80AE7034: -/* 00704 80AE7034 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 -/* 00708 80AE7038 0C00B6F4 */ jal func_8002DBD0 -/* 0070C 80AE703C 26060024 */ addiu $a2, $s0, 0x0024 ## $a2 = 00000024 -/* 00710 80AE7040 1000000D */ beq $zero, $zero, .L80AE7078 -/* 00714 80AE7044 8FBF0024 */ lw $ra, 0x0024($sp) -.L80AE7048: -/* 00718 80AE7048 854B00A4 */ lh $t3, 0x00A4($t2) ## 000000A4 -/* 0071C 80AE704C 24010012 */ addiu $at, $zero, 0x0012 ## $at = 00000012 -/* 00720 80AE7050 01402025 */ or $a0, $t2, $zero ## $a0 = 00000000 -/* 00724 80AE7054 55610008 */ bnel $t3, $at, .L80AE7078 -/* 00728 80AE7058 8FBF0024 */ lw $ra, 0x0024($sp) -/* 0072C 80AE705C 0C00B337 */ jal Flags_GetClear - -/* 00730 80AE7060 82050003 */ lb $a1, 0x0003($s0) ## 00000003 -/* 00734 80AE7064 50400004 */ beql $v0, $zero, .L80AE7078 -/* 00738 80AE7068 8FBF0024 */ lw $ra, 0x0024($sp) -/* 0073C 80AE706C 0C00B55C */ jal Actor_Kill - -/* 00740 80AE7070 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80AE7074: -/* 00744 80AE7074 8FBF0024 */ lw $ra, 0x0024($sp) -.L80AE7078: -/* 00748 80AE7078 8FB00020 */ lw $s0, 0x0020($sp) -/* 0074C 80AE707C 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00750 80AE7080 03E00008 */ jr $ra -/* 00754 80AE7084 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6BC0.s b/asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6BC0.s deleted file mode 100644 index 5d32fca5ca..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6BC0.s +++ /dev/null @@ -1,211 +0,0 @@ -.late_rodata -glabel D_80AE7230 - .float 10000.0 -glabel D_80AE7234 - .float 10000.0 - -.text -glabel func_80AE6BC0 -/* 00290 80AE6BC0 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78 -/* 00294 80AE6BC4 3C0F80AE */ lui $t7, %hi(D_80AE71F0) ## $t7 = 80AE0000 -/* 00298 80AE6BC8 AFBF0034 */ sw $ra, 0x0034($sp) -/* 0029C 80AE6BCC AFB50030 */ sw $s5, 0x0030($sp) -/* 002A0 80AE6BD0 AFB4002C */ sw $s4, 0x002C($sp) -/* 002A4 80AE6BD4 AFB30028 */ sw $s3, 0x0028($sp) -/* 002A8 80AE6BD8 AFB20024 */ sw $s2, 0x0024($sp) -/* 002AC 80AE6BDC AFB10020 */ sw $s1, 0x0020($sp) -/* 002B0 80AE6BE0 AFB0001C */ sw $s0, 0x001C($sp) -/* 002B4 80AE6BE4 F7B40010 */ sdc1 $f20, 0x0010($sp) -/* 002B8 80AE6BE8 AFA40088 */ sw $a0, 0x0088($sp) -/* 002BC 80AE6BEC 25EF71F0 */ addiu $t7, $t7, %lo(D_80AE71F0) ## $t7 = 80AE71F0 -/* 002C0 80AE6BF0 8DF90000 */ lw $t9, 0x0000($t7) ## 80AE71F0 -/* 002C4 80AE6BF4 8DF80004 */ lw $t8, 0x0004($t7) ## 80AE71F4 -/* 002C8 80AE6BF8 27AE0078 */ addiu $t6, $sp, 0x0078 ## $t6 = FFFFFFF0 -/* 002CC 80AE6BFC 3C0180AE */ lui $at, %hi(D_80AE7230) ## $at = 80AE0000 -/* 002D0 80AE6C00 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF0 -/* 002D4 80AE6C04 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF4 -/* 002D8 80AE6C08 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 002DC 80AE6C0C 00C0A025 */ or $s4, $a2, $zero ## $s4 = 00000000 -/* 002E0 80AE6C10 00E0A825 */ or $s5, $a3, $zero ## $s5 = 00000000 -/* 002E4 80AE6C14 C4347230 */ lwc1 $f20, %lo(D_80AE7230)($at) -/* 002E8 80AE6C18 18A0001E */ blez $a1, .L80AE6C94 -/* 002EC 80AE6C1C 00008825 */ or $s1, $zero, $zero ## $s1 = 00000000 -/* 002F0 80AE6C20 8FB00088 */ lw $s0, 0x0088($sp) -/* 002F4 80AE6C24 27B30048 */ addiu $s3, $sp, 0x0048 ## $s3 = FFFFFFC0 -.L80AE6C28: -/* 002F8 80AE6C28 86080000 */ lh $t0, 0x0000($s0) ## 00000000 -/* 002FC 80AE6C2C 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 -/* 00300 80AE6C30 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFC0 -/* 00304 80AE6C34 44882000 */ mtc1 $t0, $f4 ## $f4 = 0.00 -/* 00308 80AE6C38 00000000 */ nop -/* 0030C 80AE6C3C 468021A0 */ cvt.s.w $f6, $f4 -/* 00310 80AE6C40 E7A60048 */ swc1 $f6, 0x0048($sp) -/* 00314 80AE6C44 86090002 */ lh $t1, 0x0002($s0) ## 00000002 -/* 00318 80AE6C48 44894000 */ mtc1 $t1, $f8 ## $f8 = 0.00 -/* 0031C 80AE6C4C 00000000 */ nop -/* 00320 80AE6C50 468042A0 */ cvt.s.w $f10, $f8 -/* 00324 80AE6C54 E7AA004C */ swc1 $f10, 0x004C($sp) -/* 00328 80AE6C58 860A0004 */ lh $t2, 0x0004($s0) ## 00000004 -/* 0032C 80AE6C5C 448A8000 */ mtc1 $t2, $f16 ## $f16 = 0.00 -/* 00330 80AE6C60 00000000 */ nop -/* 00334 80AE6C64 468084A0 */ cvt.s.w $f18, $f16 -/* 00338 80AE6C68 0C01DFE4 */ jal Math_Vec3f_DistXYZ - -/* 0033C 80AE6C6C E7B20050 */ swc1 $f18, 0x0050($sp) -/* 00340 80AE6C70 4614003C */ c.lt.s $f0, $f20 -/* 00344 80AE6C74 00000000 */ nop -/* 00348 80AE6C78 45020004 */ bc1fl .L80AE6C8C -/* 0034C 80AE6C7C 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000001 -/* 00350 80AE6C80 46000506 */ mov.s $f20, $f0 -/* 00354 80AE6C84 AFB10080 */ sw $s1, 0x0080($sp) -/* 00358 80AE6C88 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000002 -.L80AE6C8C: -/* 0035C 80AE6C8C 1632FFE6 */ bne $s1, $s2, .L80AE6C28 -/* 00360 80AE6C90 26100006 */ addiu $s0, $s0, 0x0006 ## $s0 = 00000006 -.L80AE6C94: -/* 00364 80AE6C94 3C0180AE */ lui $at, %hi(D_80AE7234) ## $at = 80AE0000 -/* 00368 80AE6C98 C4247234 */ lwc1 $f4, %lo(D_80AE7234)($at) -/* 0036C 80AE6C9C 8FAB0080 */ lw $t3, 0x0080($sp) -/* 00370 80AE6CA0 27B30048 */ addiu $s3, $sp, 0x0048 ## $s3 = FFFFFFC0 -/* 00374 80AE6CA4 4614203E */ c.le.s $f4, $f20 -/* 00378 80AE6CA8 8FAD0088 */ lw $t5, 0x0088($sp) -/* 0037C 80AE6CAC 000B6080 */ sll $t4, $t3, 2 -/* 00380 80AE6CB0 45020004 */ bc1fl .L80AE6CC4 -/* 00384 80AE6CB4 018B6023 */ subu $t4, $t4, $t3 -/* 00388 80AE6CB8 10000076 */ beq $zero, $zero, .L80AE6E94 -/* 0038C 80AE6CBC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 00390 80AE6CC0 018B6023 */ subu $t4, $t4, $t3 -.L80AE6CC4: -/* 00394 80AE6CC4 000C6040 */ sll $t4, $t4, 1 -/* 00398 80AE6CC8 018D8021 */ addu $s0, $t4, $t5 -/* 0039C 80AE6CCC 860E0000 */ lh $t6, 0x0000($s0) ## 00000006 -/* 003A0 80AE6CD0 448E3000 */ mtc1 $t6, $f6 ## $f6 = 0.00 -/* 003A4 80AE6CD4 00000000 */ nop -/* 003A8 80AE6CD8 46803220 */ cvt.s.w $f8, $f6 -/* 003AC 80AE6CDC E7A8006C */ swc1 $f8, 0x006C($sp) -/* 003B0 80AE6CE0 860F0002 */ lh $t7, 0x0002($s0) ## 00000008 -/* 003B4 80AE6CE4 448F5000 */ mtc1 $t7, $f10 ## $f10 = 0.00 -/* 003B8 80AE6CE8 00000000 */ nop -/* 003BC 80AE6CEC 46805420 */ cvt.s.w $f16, $f10 -/* 003C0 80AE6CF0 E7B00070 */ swc1 $f16, 0x0070($sp) -/* 003C4 80AE6CF4 86180004 */ lh $t8, 0x0004($s0) ## 0000000A -/* 003C8 80AE6CF8 44989000 */ mtc1 $t8, $f18 ## $f18 = 0.00 -/* 003CC 80AE6CFC 00000000 */ nop -/* 003D0 80AE6D00 46809120 */ cvt.s.w $f4, $f18 -/* 003D4 80AE6D04 11600015 */ beq $t3, $zero, .L80AE6D5C -/* 003D8 80AE6D08 E7A40074 */ swc1 $f4, 0x0074($sp) -/* 003DC 80AE6D0C 8619FFFA */ lh $t9, -0x0006($s0) ## 00000000 -/* 003E0 80AE6D10 02602025 */ or $a0, $s3, $zero ## $a0 = FFFFFFC0 -/* 003E4 80AE6D14 27A5006C */ addiu $a1, $sp, 0x006C ## $a1 = FFFFFFE4 -/* 003E8 80AE6D18 44993000 */ mtc1 $t9, $f6 ## $f6 = 0.00 -/* 003EC 80AE6D1C 02803025 */ or $a2, $s4, $zero ## $a2 = 00000000 -/* 003F0 80AE6D20 27A70054 */ addiu $a3, $sp, 0x0054 ## $a3 = FFFFFFCC -/* 003F4 80AE6D24 46803220 */ cvt.s.w $f8, $f6 -/* 003F8 80AE6D28 E7A80048 */ swc1 $f8, 0x0048($sp) -/* 003FC 80AE6D2C 8608FFFC */ lh $t0, -0x0004($s0) ## 00000002 -/* 00400 80AE6D30 44885000 */ mtc1 $t0, $f10 ## $f10 = 0.00 -/* 00404 80AE6D34 00000000 */ nop -/* 00408 80AE6D38 46805420 */ cvt.s.w $f16, $f10 -/* 0040C 80AE6D3C E7B0004C */ swc1 $f16, 0x004C($sp) -/* 00410 80AE6D40 8609FFFE */ lh $t1, -0x0002($s0) ## 00000004 -/* 00414 80AE6D44 44899000 */ mtc1 $t1, $f18 ## $f18 = 0.00 -/* 00418 80AE6D48 00000000 */ nop -/* 0041C 80AE6D4C 46809120 */ cvt.s.w $f4, $f18 -/* 00420 80AE6D50 0C2B9A95 */ jal func_80AE6A54 -/* 00424 80AE6D54 E7A40050 */ swc1 $f4, 0x0050($sp) -/* 00428 80AE6D58 AFA20078 */ sw $v0, 0x0078($sp) -.L80AE6D5C: -/* 0042C 80AE6D5C 8FAA0080 */ lw $t2, 0x0080($sp) -/* 00430 80AE6D60 254C0001 */ addiu $t4, $t2, 0x0001 ## $t4 = 00000001 -/* 00434 80AE6D64 51920016 */ beql $t4, $s2, .L80AE6DC0 -/* 00438 80AE6D68 8FB80078 */ lw $t8, 0x0078($sp) -/* 0043C 80AE6D6C 860D0006 */ lh $t5, 0x0006($s0) ## 0000000C -/* 00440 80AE6D70 27A4006C */ addiu $a0, $sp, 0x006C ## $a0 = FFFFFFE4 -/* 00444 80AE6D74 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFC0 -/* 00448 80AE6D78 448D3000 */ mtc1 $t5, $f6 ## $f6 = 0.00 -/* 0044C 80AE6D7C 02803025 */ or $a2, $s4, $zero ## $a2 = 00000000 -/* 00450 80AE6D80 27A70060 */ addiu $a3, $sp, 0x0060 ## $a3 = FFFFFFD8 -/* 00454 80AE6D84 46803220 */ cvt.s.w $f8, $f6 -/* 00458 80AE6D88 E7A80048 */ swc1 $f8, 0x0048($sp) -/* 0045C 80AE6D8C 860E0008 */ lh $t6, 0x0008($s0) ## 0000000E -/* 00460 80AE6D90 448E5000 */ mtc1 $t6, $f10 ## $f10 = 0.00 -/* 00464 80AE6D94 00000000 */ nop -/* 00468 80AE6D98 46805420 */ cvt.s.w $f16, $f10 -/* 0046C 80AE6D9C E7B0004C */ swc1 $f16, 0x004C($sp) -/* 00470 80AE6DA0 860F000A */ lh $t7, 0x000A($s0) ## 00000010 -/* 00474 80AE6DA4 448F9000 */ mtc1 $t7, $f18 ## $f18 = 0.00 -/* 00478 80AE6DA8 00000000 */ nop -/* 0047C 80AE6DAC 46809120 */ cvt.s.w $f4, $f18 -/* 00480 80AE6DB0 0C2B9A95 */ jal func_80AE6A54 -/* 00484 80AE6DB4 E7A40050 */ swc1 $f4, 0x0050($sp) -/* 00488 80AE6DB8 AFA2007C */ sw $v0, 0x007C($sp) -/* 0048C 80AE6DBC 8FB80078 */ lw $t8, 0x0078($sp) -.L80AE6DC0: -/* 00490 80AE6DC0 8FAB007C */ lw $t3, 0x007C($sp) -/* 00494 80AE6DC4 8FB90078 */ lw $t9, 0x0078($sp) -/* 00498 80AE6DC8 1300001A */ beq $t8, $zero, .L80AE6E34 -/* 0049C 80AE6DCC 00000000 */ nop -/* 004A0 80AE6DD0 11600018 */ beq $t3, $zero, .L80AE6E34 -/* 004A4 80AE6DD4 27A40054 */ addiu $a0, $sp, 0x0054 ## $a0 = FFFFFFCC -/* 004A8 80AE6DD8 27A50060 */ addiu $a1, $sp, 0x0060 ## $a1 = FFFFFFD8 -/* 004AC 80AE6DDC 02803025 */ or $a2, $s4, $zero ## $a2 = 00000000 -/* 004B0 80AE6DE0 0C2B9A95 */ jal func_80AE6A54 -/* 004B4 80AE6DE4 02A03825 */ or $a3, $s5, $zero ## $a3 = 00000000 -/* 004B8 80AE6DE8 14400029 */ bne $v0, $zero, .L80AE6E90 -/* 004BC 80AE6DEC C7A60054 */ lwc1 $f6, 0x0054($sp) -/* 004C0 80AE6DF0 C7A80060 */ lwc1 $f8, 0x0060($sp) -/* 004C4 80AE6DF4 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 004C8 80AE6DF8 44810000 */ mtc1 $at, $f0 ## $f0 = 0.50 -/* 004CC 80AE6DFC 46083280 */ add.s $f10, $f6, $f8 -/* 004D0 80AE6E00 46005402 */ mul.s $f16, $f10, $f0 -/* 004D4 80AE6E04 E6B00000 */ swc1 $f16, 0x0000($s5) ## 00000000 -/* 004D8 80AE6E08 C7A40064 */ lwc1 $f4, 0x0064($sp) -/* 004DC 80AE6E0C C7B20058 */ lwc1 $f18, 0x0058($sp) -/* 004E0 80AE6E10 46049180 */ add.s $f6, $f18, $f4 -/* 004E4 80AE6E14 46003202 */ mul.s $f8, $f6, $f0 -/* 004E8 80AE6E18 E6A80004 */ swc1 $f8, 0x0004($s5) ## 00000004 -/* 004EC 80AE6E1C C7B00068 */ lwc1 $f16, 0x0068($sp) -/* 004F0 80AE6E20 C7AA005C */ lwc1 $f10, 0x005C($sp) -/* 004F4 80AE6E24 46105480 */ add.s $f18, $f10, $f16 -/* 004F8 80AE6E28 46009102 */ mul.s $f4, $f18, $f0 -/* 004FC 80AE6E2C 10000018 */ beq $zero, $zero, .L80AE6E90 -/* 00500 80AE6E30 E6A40008 */ swc1 $f4, 0x0008($s5) ## 00000008 -.L80AE6E34: -/* 00504 80AE6E34 13200008 */ beq $t9, $zero, .L80AE6E58 -/* 00508 80AE6E38 8FA8007C */ lw $t0, 0x007C($sp) -/* 0050C 80AE6E3C C7A60054 */ lwc1 $f6, 0x0054($sp) -/* 00510 80AE6E40 E6A60000 */ swc1 $f6, 0x0000($s5) ## 00000000 -/* 00514 80AE6E44 C7A80058 */ lwc1 $f8, 0x0058($sp) -/* 00518 80AE6E48 E6A80004 */ swc1 $f8, 0x0004($s5) ## 00000004 -/* 0051C 80AE6E4C C7AA005C */ lwc1 $f10, 0x005C($sp) -/* 00520 80AE6E50 1000000F */ beq $zero, $zero, .L80AE6E90 -/* 00524 80AE6E54 E6AA0008 */ swc1 $f10, 0x0008($s5) ## 00000008 -.L80AE6E58: -/* 00528 80AE6E58 11000008 */ beq $t0, $zero, .L80AE6E7C -/* 0052C 80AE6E5C C7A6006C */ lwc1 $f6, 0x006C($sp) -/* 00530 80AE6E60 C7B00060 */ lwc1 $f16, 0x0060($sp) -/* 00534 80AE6E64 E6B00000 */ swc1 $f16, 0x0000($s5) ## 00000000 -/* 00538 80AE6E68 C7B20064 */ lwc1 $f18, 0x0064($sp) -/* 0053C 80AE6E6C E6B20004 */ swc1 $f18, 0x0004($s5) ## 00000004 -/* 00540 80AE6E70 C7A40068 */ lwc1 $f4, 0x0068($sp) -/* 00544 80AE6E74 10000006 */ beq $zero, $zero, .L80AE6E90 -/* 00548 80AE6E78 E6A40008 */ swc1 $f4, 0x0008($s5) ## 00000008 -.L80AE6E7C: -/* 0054C 80AE6E7C E6A60000 */ swc1 $f6, 0x0000($s5) ## 00000000 -/* 00550 80AE6E80 C7A80070 */ lwc1 $f8, 0x0070($sp) -/* 00554 80AE6E84 E6A80004 */ swc1 $f8, 0x0004($s5) ## 00000004 -/* 00558 80AE6E88 C7AA0074 */ lwc1 $f10, 0x0074($sp) -/* 0055C 80AE6E8C E6AA0008 */ swc1 $f10, 0x0008($s5) ## 00000008 -.L80AE6E90: -/* 00560 80AE6E90 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80AE6E94: -/* 00564 80AE6E94 8FBF0034 */ lw $ra, 0x0034($sp) -/* 00568 80AE6E98 D7B40010 */ ldc1 $f20, 0x0010($sp) -/* 0056C 80AE6E9C 8FB0001C */ lw $s0, 0x001C($sp) -/* 00570 80AE6EA0 8FB10020 */ lw $s1, 0x0020($sp) -/* 00574 80AE6EA4 8FB20024 */ lw $s2, 0x0024($sp) -/* 00578 80AE6EA8 8FB30028 */ lw $s3, 0x0028($sp) -/* 0057C 80AE6EAC 8FB4002C */ lw $s4, 0x002C($sp) -/* 00580 80AE6EB0 8FB50030 */ lw $s5, 0x0030($sp) -/* 00584 80AE6EB4 03E00008 */ jr $ra -/* 00588 80AE6EB8 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000 diff --git a/data/overlays/actors/z_en_river_sound.data.s b/data/overlays/actors/z_en_river_sound.data.s deleted file mode 100644 index d556df9774..0000000000 --- a/data/overlays/actors/z_en_river_sound.data.s +++ /dev/null @@ -1,24 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel En_River_Sound_InitVars - .word 0x003B0100, 0x00000030, 0x00010000, 0x00000150 -.word EnRiverSound_Init -.word EnRiverSound_Destroy -.word EnRiverSound_Update -.word EnRiverSound_Draw -glabel D_80AE71F0 - .word 0x00000000, 0x00000000 -glabel D_80AE71F8 - .word 0x00002028, 0x200B2007, 0x00000000, 0x2032203B, 0x20302041, 0x205D0000, 0x20A60000, 0x20C020CA, 0x20D620D7, 0x20980000, 0x203120E5 -glabel D_80AE7224 - .word 0x3F333333, 0x3F800000, 0x3FB33333 - diff --git a/include/functions.h b/include/functions.h index 1478ed3185..a87be395ce 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2258,15 +2258,18 @@ void func_800F436C(Vec3f*, u16 sfxId, f32 arg2); void func_800F4414(Vec3f*, u16 sfxId, f32 arg2); void func_800F44EC(UNK_TYPE arg0, UNK_TYPE arg1); void func_800F4524(Vec3f*, u16 sfxId, u8); +void func_800F4634(Vec3f*, f32); void func_800F46E0(Vec3f* pos, f32 arg0); // ? func_800F4784(?); void func_800F47BC(void); void func_800F47FC(void); void func_800F483C(UNK_TYPE arg0, UNK_TYPE arg1); +void func_800F4870(u8); // ? func_800F491C(?); // ? func_800F4A70(?); void func_800F4BF4(Vec3f*, u16 sfxId, s8); void func_800F4C58(Vec3f*, u16 sfxId, u8); +void func_800F4E30(Vec3f*, f32); // ? func_800F50CC(?); // ? func_800F510C(?); // ? func_800F5510(?); diff --git a/spec b/spec index 62e06a92c2..1655cc296d 100644 --- a/spec +++ b/spec @@ -2789,8 +2789,11 @@ endseg beginseg name "ovl_En_River_Sound" include "build/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.o" - include "build/data/overlays/actors/z_en_river_sound.data.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_En_River_Sound/ovl_En_River_Sound_reloc.o" +#else include "build/data/overlays/actors/z_en_river_sound.reloc.o" +#endif endseg beginseg diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 63018b1ec0..c5ccca83ad 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -15,7 +15,6 @@ void EnRiverSound_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnRiverSound_Update(Actor* thisx, GlobalContext* globalCtx); void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit En_River_Sound_InitVars = { ACTOR_EN_RIVER_SOUND, ACTORCAT_BG, @@ -27,15 +26,227 @@ const ActorInit En_River_Sound_InitVars = { (ActorFunc)EnRiverSound_Update, (ActorFunc)EnRiverSound_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Destroy.s") +void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) { + EnRiverSound* this = THIS; + this->unk_14C = 0; + this->pathIndex = (this->actor.params >> 8) & 0xFF; + this->actor.params = this->actor.params & 0xFF; + + if (this->actor.params >= 248) { + func_800F4870(this->actor.params - 248); + Actor_Kill(&this->actor); + } else if (this->actor.params == 247) { + func_800F6FB4(4); + Actor_Kill(&this->actor); + } else if (this->actor.params == 12) { + if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) { + Actor_Kill(&this->actor); + } + } +} + +void EnRiverSound_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnRiverSound* this = THIS; + + if (this->actor.params == 12) { + func_800F50EC(&this->actor.projectedPos); + } else if (this->actor.params == 13) { + func_800F5504(); + } +} + +#ifdef NON_MATCHING +// If anyone wants to try and figure this shit out, be my guest. I'm done. +s32 func_80AE6A54(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) { + Vec3f sp2C; + Vec3f sp20; + Vec3f sp14; + f32 f; + f32 g; + f32 h; + + sp20.x = arg0->x - arg2->x; + sp20.y = arg0->y - arg2->y; + sp20.z = arg0->z - arg2->z; + + sp14.x = arg1->x - arg2->x; + sp14.y = arg1->y - arg2->y; + sp14.z = arg1->z - arg2->z; + + sp2C.x = sp14.x - sp20.x; + sp2C.y = sp14.y - sp20.y; + sp2C.z = sp14.z - sp20.z; + + f = sp20.z * sp2C.z + (sp2C.x * sp20.x + sp2C.y * sp20.y); + g = sp14.z * sp2C.z + (sp2C.x * sp14.x + sp2C.y * sp14.y); + h = sp2C.z * sp2C.z + (sp2C.x * sp2C.x + sp2C.y * sp2C.y); + + if (g * f < 0) { + arg3->x = sp2C.x * (-f / h) + arg0->x; + arg3->y = sp2C.y * (-f / h) + arg0->y; + arg3->z = sp2C.z * (-f / h) + arg0->z; + + return 1; + } else { + return 0; + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6A54.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/func_80AE6BC0.s") +s32 func_80AE6BC0(Vec3s* points, s32 numPoints, Vec3f* pos, Vec3f* res) { + s32 i; + s32 pointIdx; + s32 sp78[2] = { 0, 0 }; + Vec3f pointLoc; + Vec3f sp60; + Vec3f sp54; + Vec3f vec; + f32 pointDist = 10000.0f; + Vec3s* point; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Update.s") + for (i = 0; i < numPoints; i++) { + f32 d; + vec.x = points[i].x; + vec.y = points[i].y; + vec.z = points[i].z; + d = Math_Vec3f_DistXYZ(pos, &vec); + if (d < pointDist) { + pointDist = d; + pointIdx = i; + } + } + if (pointDist >= 10000.0f) { + return 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_River_Sound/EnRiverSound_Draw.s") + point = &points[pointIdx]; + pointLoc.x = point->x; + pointLoc.y = point->y; + pointLoc.z = point->z; + if (pointIdx != 0) { + vec.x = point[-1].x; + vec.y = point[-1].y; + vec.z = point[-1].z; + sp78[0] = func_80AE6A54(&vec, &pointLoc, pos, &sp54); + } + if (pointIdx + 1 != numPoints) { + vec.x = point[1].x; + vec.y = point[1].y; + vec.z = point[1].z; + sp78[1] = func_80AE6A54(&pointLoc, &vec, pos, &sp60); + } + + if (sp78[0] && sp78[1]) { + if (!func_80AE6A54(&sp54, &sp60, pos, res)) { + res->x = (sp54.x + sp60.x) * 0.5f; + res->y = (sp54.y + sp60.y) * 0.5f; + res->z = (sp54.z + sp60.z) * 0.5f; + } + } else if (sp78[0]) { + res->x = sp54.x; + res->y = sp54.y; + res->z = sp54.z; + } else if (sp78[1]) { + res->x = sp60.x; + res->y = sp60.y; + res->z = sp60.z; + } else { + res->x = pointLoc.x; + res->y = pointLoc.y; + res->z = pointLoc.z; + } + + return 1; +} + +void EnRiverSound_Update(Actor* thisx, GlobalContext* globalCtx) { + Path* path; + Vec3f* pos; + Player* player = PLAYER; + EnRiverSound* this = THIS; + s32 sp34; + + if (thisx->params == 0 || thisx->params == 4 || thisx->params == 5) { + path = &globalCtx->setupPathList[this->pathIndex]; + pos = &thisx->world.pos; + + if (func_80AE6BC0(SEGMENTED_TO_VIRTUAL(path->points), path->count, &player->actor.world.pos, pos)) { + if (BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &thisx->floorPoly, &sp34, thisx, pos) != + BGCHECK_Y_MIN) { + this->unk_14D = SurfaceType_GetConveyorSpeed(&globalCtx->colCtx, thisx->floorPoly, sp34); + } else { + this->unk_14D = 0; + } + + if (this->unk_14D == 0) { + if (thisx->params == 4) { + this->unk_14D = 0; + } else if (thisx->params == 0) { + this->unk_14D = 1; + } else { + this->unk_14D = 2; + } + } else { + this->unk_14D--; + this->unk_14D = CLAMP_MAX(this->unk_14D, 2); + } + } + } else if (thisx->params == 13 || thisx->params == 19) { + func_8002DBD0(&player->actor, &thisx->home.pos, &thisx->world.pos); + } else if (globalCtx->sceneNum == SCENE_DDAN_BOSS && Flags_GetClear(globalCtx, thisx->room)) { + Actor_Kill(thisx); + } +} + +void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnRiverSound* this = THIS; + + static s16 D_80AE71F8[] = { + 0, + NA_SE_EV_WATER_WALL - SFX_FLAG, + NA_SE_EV_MAGMA_LEVEL - SFX_FLAG, + NA_SE_EV_WATER_WALL_BIG - SFX_FLAG, + 0, + 0, + NA_SE_EV_MAGMA_LEVEL_M - SFX_FLAG, + NA_SE_EV_MAGMA_LEVEL_L - SFX_FLAG, + NA_SE_EV_WATERDROP - SFX_FLAG, + NA_SE_EV_FOUNTAIN - SFX_FLAG, + NA_SE_EV_CROWD - SFX_FLAG, + 0, + NA_SE_EV_SARIA_MELODY - SFX_FLAG, + 0, + NA_SE_EV_SAND_STORM - SFX_FLAG, + NA_SE_EV_WATER_BUBBLE - SFX_FLAG, + NA_SE_EV_KENJA_ENVIROMENT_0 - SFX_FLAG, + NA_SE_EV_KENJA_ENVIROMENT_1 - SFX_FLAG, + NA_SE_EV_EARTHQUAKE - SFX_FLAG, + 0, + NA_SE_EV_TORCH - SFX_FLAG, + NA_SE_EV_COW_CRY_LV - SFX_FLAG, + }; + static f32 D_80AE7224[] = { 0.7f, 1.0f, 1.4f }; + + if (this->unk_14C == 0) { + this->unk_14C = 1; + } else if (this->actor.params == 0 || this->actor.params == 4 || this->actor.params == 5) { + func_800F4634(&this->actor.projectedPos, D_80AE7224[this->unk_14D]); + } else if (this->actor.params == 11) { + func_800F4A54(90); + } else if (this->actor.params == 12) { + func_800F4E30(&this->actor.projectedPos, this->actor.xzDistToPlayer); + } else if (this->actor.params == 13) { + func_800F52A0(&this->actor.home, 62, 1000); + } else if (this->actor.params == 19) { + func_800F52A0(&this->actor.home, 40, 800); + } else if (this->actor.params == 14 || this->actor.params == 16 || this->actor.params == 17 || + this->actor.params == 18) { + func_800788CC(D_80AE71F8[this->actor.params]); + } else { + Audio_PlayActorSound2(&this->actor, D_80AE71F8[this->actor.params]); + } +} diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index 31716d9dae..1371199960 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -8,7 +8,9 @@ struct EnRiverSound; typedef struct EnRiverSound { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x4]; + /* 0x014C */ u8 unk_14C; + /* 0x014D */ u8 unk_14D; + /* 0x014E */ s16 pathIndex; } EnRiverSound; // size = 0x0150 extern const ActorInit En_River_Sound_InitVars;