diff --git a/asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s b/asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s deleted file mode 100644 index 5049097554..0000000000 --- a/asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s +++ /dev/null @@ -1,329 +0,0 @@ -glabel Audio_ProcessSoundRequest -/* B6E820 800F7680 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* B6E824 800F7684 3C0E8013 */ lui $t6, %hi(sSoundRequestReadIndex) # $t6, 0x8013 -/* B6E828 800F7688 91CE33A4 */ lbu $t6, %lo(sSoundRequestReadIndex)($t6) -/* B6E82C 800F768C 3C188017 */ lui $t8, %hi(sSoundRequests) # $t8, 0x8017 -/* B6E830 800F7690 2718C9A0 */ addiu $t8, %lo(sSoundRequests) # addiu $t8, $t8, -0x3660 -/* B6E834 800F7694 000E7880 */ sll $t7, $t6, 2 -/* B6E838 800F7698 01EE7823 */ subu $t7, $t7, $t6 -/* B6E83C 800F769C 000F78C0 */ sll $t7, $t7, 3 -/* B6E840 800F76A0 AFBF002C */ sw $ra, 0x2c($sp) -/* B6E844 800F76A4 AFB50028 */ sw $s5, 0x28($sp) -/* B6E848 800F76A8 AFB40024 */ sw $s4, 0x24($sp) -/* B6E84C 800F76AC AFB30020 */ sw $s3, 0x20($sp) -/* B6E850 800F76B0 AFB2001C */ sw $s2, 0x1c($sp) -/* B6E854 800F76B4 AFB10018 */ sw $s1, 0x18($sp) -/* B6E858 800F76B8 AFB00014 */ sw $s0, 0x14($sp) -/* B6E85C 800F76BC 01F85021 */ addu $t2, $t7, $t8 -/* B6E860 800F76C0 95450000 */ lhu $a1, ($t2) -/* B6E864 800F76C4 24110080 */ li $s1, 128 -/* B6E868 800F76C8 24190001 */ li $t9, 1 -/* B6E86C 800F76CC 10A00118 */ beqz $a1, .L800F7B30 -/* B6E870 800F76D0 30B5F000 */ andi $s5, $a1, 0xf000 -/* B6E874 800F76D4 3C0F8013 */ lui $t7, %hi(D_801333F0) # $t7, 0x8013 -/* B6E878 800F76D8 91EF33F0 */ lbu $t7, %lo(D_801333F0)($t7) -/* B6E87C 800F76DC 0015AB03 */ sra $s5, $s5, 0xc -/* B6E880 800F76E0 32B500FF */ andi $s5, $s5, 0xff -/* B6E884 800F76E4 02B97004 */ sllv $t6, $t9, $s5 -/* B6E888 800F76E8 01CFC024 */ and $t8, $t6, $t7 -/* B6E88C 800F76EC 13000009 */ beqz $t8, .L800F7714 -/* B6E890 800F76F0 3C048013 */ lui $a0, %hi(D_80133340) # $a0, 0x8013 -/* B6E894 800F76F4 24843340 */ addiu $a0, %lo(D_80133340) # addiu $a0, $a0, 0x3340 -/* B6E898 800F76F8 0C03CB5B */ jal AudioDebug_ScrPrt -/* B6E89C 800F76FC AFAA0050 */ sw $t2, 0x50($sp) -/* B6E8A0 800F7700 8FAA0050 */ lw $t2, 0x50($sp) -/* B6E8A4 800F7704 95550000 */ lhu $s5, ($t2) -/* B6E8A8 800F7708 32B5F000 */ andi $s5, $s5, 0xf000 -/* B6E8AC 800F770C 0015AB03 */ sra $s5, $s5, 0xc -/* B6E8B0 800F7710 32B500FF */ andi $s5, $s5, 0xff -.L800F7714: -/* B6E8B4 800F7714 3C0E8013 */ lui $t6, %hi(gSoundBanks) # $t6, 0x8013 -/* B6E8B8 800F7718 25CE33A8 */ addiu $t6, %lo(gSoundBanks) # addiu $t6, $t6, 0x33a8 -/* B6E8BC 800F771C 0015C880 */ sll $t9, $s5, 2 -/* B6E8C0 800F7720 032E4021 */ addu $t0, $t9, $t6 -/* B6E8C4 800F7724 8D0B0000 */ lw $t3, ($t0) -/* B6E8C8 800F7728 240300FF */ li $v1, 255 -/* B6E8CC 800F772C 00006025 */ move $t4, $zero -/* B6E8D0 800F7730 9165002D */ lbu $a1, 0x2d($t3) -/* B6E8D4 800F7734 106500AE */ beq $v1, $a1, .L800F79F0 -/* B6E8D8 800F7738 00A01025 */ move $v0, $a1 -/* B6E8DC 800F773C 10A000AC */ beqz $a1, .L800F79F0 -/* B6E8E0 800F7740 24140030 */ li $s4, 48 -/* B6E8E4 800F7744 3C138013 */ lui $s3, %hi(D_8013331C) # $s3, 0x8013 -/* B6E8E8 800F7748 2673331C */ addiu $s3, %lo(D_8013331C) # addiu $s3, $s3, 0x331c -/* B6E8EC 800F774C 93B20043 */ lbu $s2, 0x43($sp) -.L800F7750: -/* B6E8F0 800F7750 00B40019 */ multu $a1, $s4 -/* B6E8F4 800F7754 8D580004 */ lw $t8, 4($t2) -/* B6E8F8 800F7758 00007812 */ mflo $t7 -/* B6E8FC 800F775C 016F8021 */ addu $s0, $t3, $t7 -/* B6E900 800F7760 8E190000 */ lw $t9, ($s0) -/* B6E904 800F7764 57190096 */ bnel $t8, $t9, .L800F79C0 -/* B6E908 800F7768 240300FF */ li $v1, 255 -/* B6E90C 800F776C 95470000 */ lhu $a3, ($t2) -/* B6E910 800F7770 00077303 */ sra $t6, $a3, 0xc -/* B6E914 800F7774 31CF00FF */ andi $t7, $t6, 0xff -/* B6E918 800F7778 000FC080 */ sll $t8, $t7, 2 -/* B6E91C 800F777C 0278C821 */ addu $t9, $s3, $t8 -/* B6E920 800F7780 8F2D0000 */ lw $t5, ($t9) -/* B6E924 800F7784 30FF01FF */ andi $ra, $a3, 0x1ff -/* B6E928 800F7788 001FF880 */ sll $ra, $ra, 2 -/* B6E92C 800F778C 01BF3021 */ addu $a2, $t5, $ra -/* B6E930 800F7790 94CE0002 */ lhu $t6, 2($a2) -/* B6E934 800F7794 31CF0020 */ andi $t7, $t6, 0x20 -/* B6E938 800F7798 11E00005 */ beqz $t7, .L800F77B0 -/* B6E93C 800F779C 3C0E8013 */ lui $t6, %hi(D_801333CC) # $t6, 0x8013 -/* B6E940 800F77A0 90D80000 */ lbu $t8, ($a2) -/* B6E944 800F77A4 92190024 */ lbu $t9, 0x24($s0) -/* B6E948 800F77A8 531900E2 */ beql $t8, $t9, .L800F7B34 -/* B6E94C 800F77AC 8FBF002C */ lw $ra, 0x2c($sp) -.L800F77B0: -/* B6E950 800F77B0 91CE33CC */ lbu $t6, %lo(D_801333CC)($t6) -/* B6E954 800F77B4 3C028013 */ lui $v0, %hi(D_80130594) -/* B6E958 800F77B8 96030028 */ lhu $v1, 0x28($s0) -/* B6E95C 800F77BC 000E78C0 */ sll $t7, $t6, 3 -/* B6E960 800F77C0 01EE7823 */ subu $t7, $t7, $t6 -/* B6E964 800F77C4 01F5C021 */ addu $t8, $t7, $s5 -/* B6E968 800F77C8 00581021 */ addu $v0, $v0, $t8 -/* B6E96C 800F77CC 90420594 */ lbu $v0, %lo(D_80130594)($v0) -/* B6E970 800F77D0 14E30004 */ bne $a3, $v1, .L800F77E4 -/* B6E974 800F77D4 00404825 */ move $t1, $v0 -/* B6E978 800F77D8 304C00FF */ andi $t4, $v0, 0xff -/* B6E97C 800F77DC 10000027 */ b .L800F787C -/* B6E980 800F77E0 01801825 */ move $v1, $t4 -.L800F77E4: -/* B6E984 800F77E4 1580000C */ bnez $t4, .L800F7818 -/* B6E988 800F77E8 3064FFFF */ andi $a0, $v1, 0xffff -/* B6E98C 800F77EC 0004CB03 */ sra $t9, $a0, 0xc -/* B6E990 800F77F0 332E00FF */ andi $t6, $t9, 0xff -/* B6E994 800F77F4 000E7880 */ sll $t7, $t6, 2 -/* B6E998 800F77F8 026FC021 */ addu $t8, $s3, $t7 -/* B6E99C 800F77FC 8F190000 */ lw $t9, ($t8) -/* B6E9A0 800F7800 308E01FF */ andi $t6, $a0, 0x1ff -/* B6E9A4 800F7804 000E7880 */ sll $t7, $t6, 2 -/* B6E9A8 800F7808 032FC021 */ addu $t8, $t9, $t7 -/* B6E9AC 800F780C 30B100FF */ andi $s1, $a1, 0xff -/* B6E9B0 800F7810 1000000F */ b .L800F7850 -/* B6E9B4 800F7814 93120000 */ lbu $s2, ($t8) -.L800F7818: -/* B6E9B8 800F7818 920E0024 */ lbu $t6, 0x24($s0) -/* B6E9BC 800F781C 3064FFFF */ andi $a0, $v1, 0xffff -/* B6E9C0 800F7820 0004CB03 */ sra $t9, $a0, 0xc -/* B6E9C4 800F7824 01D2082A */ slt $at, $t6, $s2 -/* B6E9C8 800F7828 10200009 */ beqz $at, .L800F7850 -/* B6E9CC 800F782C 332F00FF */ andi $t7, $t9, 0xff -/* B6E9D0 800F7830 000FC080 */ sll $t8, $t7, 2 -/* B6E9D4 800F7834 02787021 */ addu $t6, $s3, $t8 -/* B6E9D8 800F7838 8DD90000 */ lw $t9, ($t6) -/* B6E9DC 800F783C 308F01FF */ andi $t7, $a0, 0x1ff -/* B6E9E0 800F7840 000FC080 */ sll $t8, $t7, 2 -/* B6E9E4 800F7844 03387021 */ addu $t6, $t9, $t8 -/* B6E9E8 800F7848 30B100FF */ andi $s1, $a1, 0xff -/* B6E9EC 800F784C 91D20000 */ lbu $s2, ($t6) -.L800F7850: -/* B6E9F0 800F7850 258C0001 */ addiu $t4, $t4, 1 -/* B6E9F4 800F7854 318C00FF */ andi $t4, $t4, 0xff -/* B6E9F8 800F7858 15890008 */ bne $t4, $t1, .L800F787C -/* B6E9FC 800F785C 01801825 */ move $v1, $t4 -/* B6EA00 800F7860 90CF0000 */ lbu $t7, ($a2) -/* B6EA04 800F7864 00002825 */ move $a1, $zero -/* B6EA08 800F7868 01F2082A */ slt $at, $t7, $s2 -/* B6EA0C 800F786C 14200003 */ bnez $at, .L800F787C -/* B6EA10 800F7870 00000000 */ nop -/* B6EA14 800F7874 10000001 */ b .L800F787C -/* B6EA18 800F7878 322500FF */ andi $a1, $s1, 0xff -.L800F787C: -/* B6EA1C 800F787C 1469004F */ bne $v1, $t1, .L800F79BC -/* B6EA20 800F7880 00051080 */ sll $v0, $a1, 2 -/* B6EA24 800F7884 00451023 */ subu $v0, $v0, $a1 -/* B6EA28 800F7888 00021100 */ sll $v0, $v0, 4 -/* B6EA2C 800F788C 30F90C00 */ andi $t9, $a3, 0xc00 -/* B6EA30 800F7890 01BF1821 */ addu $v1, $t5, $ra -/* B6EA34 800F7894 17200007 */ bnez $t9, .L800F78B4 -/* B6EA38 800F7898 01628021 */ addu $s0, $t3, $v0 -/* B6EA3C 800F789C 94780002 */ lhu $t8, 2($v1) -/* B6EA40 800F78A0 330E0004 */ andi $t6, $t8, 4 -/* B6EA44 800F78A4 55C00004 */ bnezl $t6, .L800F78B8 -/* B6EA48 800F78A8 960F0026 */ lhu $t7, 0x26($s0) -/* B6EA4C 800F78AC 5625003C */ bnel $s1, $a1, .L800F79A0 -/* B6EA50 800F78B0 920E002A */ lbu $t6, 0x2a($s0) -.L800F78B4: -/* B6EA54 800F78B4 960F0026 */ lhu $t7, 0x26($s0) -.L800F78B8: -/* B6EA58 800F78B8 31F90008 */ andi $t9, $t7, 8 -/* B6EA5C 800F78BC 53200014 */ beql $t9, $zero, .L800F7910 -/* B6EA60 800F78C0 914F0008 */ lbu $t7, 8($t2) -/* B6EA64 800F78C4 9218002A */ lbu $t8, 0x2a($s0) -/* B6EA68 800F78C8 24010001 */ li $at, 1 -/* B6EA6C 800F78CC 53010010 */ beql $t8, $at, .L800F7910 -/* B6EA70 800F78D0 914F0008 */ lbu $t7, 8($t2) -/* B6EA74 800F78D4 9204002E */ lbu $a0, 0x2e($s0) -/* B6EA78 800F78D8 A3AC0055 */ sb $t4, 0x55($sp) -/* B6EA7C 800F78DC AFAA0050 */ sw $t2, 0x50($sp) -/* B6EA80 800F78E0 AFA8003C */ sw $t0, 0x3c($sp) -/* B6EA84 800F78E4 AFA30048 */ sw $v1, 0x48($sp) -/* B6EA88 800F78E8 0C03DCC7 */ jal Audio_ClearBGMMute -/* B6EA8C 800F78EC AFA20030 */ sw $v0, 0x30($sp) -/* B6EA90 800F78F0 8FA8003C */ lw $t0, 0x3c($sp) -/* B6EA94 800F78F4 8FA20030 */ lw $v0, 0x30($sp) -/* B6EA98 800F78F8 8FA30048 */ lw $v1, 0x48($sp) -/* B6EA9C 800F78FC 8D0E0000 */ lw $t6, ($t0) -/* B6EAA0 800F7900 8FAA0050 */ lw $t2, 0x50($sp) -/* B6EAA4 800F7904 93AC0055 */ lbu $t4, 0x55($sp) -/* B6EAA8 800F7908 01C28021 */ addu $s0, $t6, $v0 -/* B6EAAC 800F790C 914F0008 */ lbu $t7, 8($t2) -.L800F7910: -/* B6EAB0 800F7910 A20F000C */ sb $t7, 0xc($s0) -/* B6EAB4 800F7914 8D180000 */ lw $t8, ($t0) -/* B6EAB8 800F7918 95590000 */ lhu $t9, ($t2) -/* B6EABC 800F791C 240F0001 */ li $t7, 1 -/* B6EAC0 800F7920 03027021 */ addu $t6, $t8, $v0 -/* B6EAC4 800F7924 A5D90028 */ sh $t9, 0x28($t6) -/* B6EAC8 800F7928 8D180000 */ lw $t8, ($t0) -/* B6EACC 800F792C 240E0002 */ li $t6, 2 -/* B6EAD0 800F7930 0302C821 */ addu $t9, $t8, $v0 -/* B6EAD4 800F7934 A32F002A */ sb $t7, 0x2a($t9) -/* B6EAD8 800F7938 8D180000 */ lw $t8, ($t0) -/* B6EADC 800F793C 03027821 */ addu $t7, $t8, $v0 -/* B6EAE0 800F7940 A1EE002B */ sb $t6, 0x2b($t7) -/* B6EAE4 800F7944 8D180000 */ lw $t8, ($t0) -/* B6EAE8 800F7948 8D59000C */ lw $t9, 0xc($t2) -/* B6EAEC 800F794C 03027021 */ addu $t6, $t8, $v0 -/* B6EAF0 800F7950 ADD90010 */ sw $t9, 0x10($t6) -/* B6EAF4 800F7954 8D180000 */ lw $t8, ($t0) -/* B6EAF8 800F7958 8D4F0010 */ lw $t7, 0x10($t2) -/* B6EAFC 800F795C 0302C821 */ addu $t9, $t8, $v0 -/* B6EB00 800F7960 AF2F0014 */ sw $t7, 0x14($t9) -/* B6EB04 800F7964 8D180000 */ lw $t8, ($t0) -/* B6EB08 800F7968 8D4E0014 */ lw $t6, 0x14($t2) -/* B6EB0C 800F796C 03027821 */ addu $t7, $t8, $v0 -/* B6EB10 800F7970 ADEE0018 */ sw $t6, 0x18($t7) -/* B6EB14 800F7974 8D180000 */ lw $t8, ($t0) -/* B6EB18 800F7978 94790002 */ lhu $t9, 2($v1) -/* B6EB1C 800F797C 03027021 */ addu $t6, $t8, $v0 -/* B6EB20 800F7980 A5D90026 */ sh $t9, 0x26($t6) -/* B6EB24 800F7984 8D180000 */ lw $t8, ($t0) -/* B6EB28 800F7988 906F0000 */ lbu $t7, ($v1) -/* B6EB2C 800F798C 0302C821 */ addu $t9, $t8, $v0 -/* B6EB30 800F7990 A32F0024 */ sb $t7, 0x24($t9) -/* B6EB34 800F7994 10000008 */ b .L800F79B8 -/* B6EB38 800F7998 8D0B0000 */ lw $t3, ($t0) -/* B6EB3C 800F799C 920E002A */ lbu $t6, 0x2a($s0) -.L800F79A0: -/* B6EB40 800F79A0 24010005 */ li $at, 5 -/* B6EB44 800F79A4 24180004 */ li $t8, 4 -/* B6EB48 800F79A8 55C10004 */ bnel $t6, $at, .L800F79BC -/* B6EB4C 800F79AC 00002825 */ move $a1, $zero -/* B6EB50 800F79B0 A218002A */ sb $t8, 0x2a($s0) -/* B6EB54 800F79B4 8D0B0000 */ lw $t3, ($t0) -.L800F79B8: -/* B6EB58 800F79B8 00002825 */ move $a1, $zero -.L800F79BC: -/* B6EB5C 800F79BC 240300FF */ li $v1, 255 -.L800F79C0: -/* B6EB60 800F79C0 10A00006 */ beqz $a1, .L800F79DC -/* B6EB64 800F79C4 00A01025 */ move $v0, $a1 -/* B6EB68 800F79C8 00B40019 */ multu $a1, $s4 -/* B6EB6C 800F79CC 00007812 */ mflo $t7 -/* B6EB70 800F79D0 016FC821 */ addu $t9, $t3, $t7 -/* B6EB74 800F79D4 9325002D */ lbu $a1, 0x2d($t9) -/* B6EB78 800F79D8 00A01025 */ move $v0, $a1 -.L800F79DC: -/* B6EB7C 800F79DC 10620004 */ beq $v1, $v0, .L800F79F0 -/* B6EB80 800F79E0 00000000 */ nop -/* B6EB84 800F79E4 1440FF5A */ bnez $v0, .L800F7750 -/* B6EB88 800F79E8 00000000 */ nop -/* B6EB8C 800F79EC A3B20043 */ sb $s2, 0x43($sp) -.L800F79F0: -/* B6EB90 800F79F0 3C0E8017 */ lui $t6, %hi(D_8016E1A8) # $t6, 0x8017 -/* B6EB94 800F79F4 25CEE1A8 */ addiu $t6, %lo(D_8016E1A8) # addiu $t6, $t6, -0x1e58 -/* B6EB98 800F79F8 02AE3021 */ addu $a2, $s5, $t6 -/* B6EB9C 800F79FC 90C90000 */ lbu $t1, ($a2) -/* B6EBA0 800F7A00 24140030 */ li $s4, 48 -/* B6EBA4 800F7A04 3C138013 */ lui $s3, %hi(D_8013331C) # $s3, 0x8013 -/* B6EBA8 800F7A08 01340019 */ multu $t1, $s4 -/* B6EBAC 800F7A0C 2673331C */ addiu $s3, %lo(D_8013331C) # addiu $s3, $s3, 0x331c -/* B6EBB0 800F7A10 0000C012 */ mflo $t8 -/* B6EBB4 800F7A14 01787821 */ addu $t7, $t3, $t8 -/* B6EBB8 800F7A18 91F9002D */ lbu $t9, 0x2d($t7) -/* B6EBBC 800F7A1C 50790045 */ beql $v1, $t9, .L800F7B34 -/* B6EBC0 800F7A20 8FBF002C */ lw $ra, 0x2c($sp) -/* B6EBC4 800F7A24 10400042 */ beqz $v0, .L800F7B30 -/* B6EBC8 800F7A28 312500FF */ andi $a1, $t1, 0xff -/* B6EBCC 800F7A2C 00B40019 */ multu $a1, $s4 -/* B6EBD0 800F7A30 8D580004 */ lw $t8, 4($t2) -/* B6EBD4 800F7A34 240500FF */ li $a1, 255 -/* B6EBD8 800F7A38 00007012 */ mflo $t6 -/* B6EBDC 800F7A3C 016E1021 */ addu $v0, $t3, $t6 -/* B6EBE0 800F7A40 AC580000 */ sw $t8, ($v0) -/* B6EBE4 800F7A44 8D4F0004 */ lw $t7, 4($t2) -/* B6EBE8 800F7A48 25F90004 */ addiu $t9, $t7, 4 -/* B6EBEC 800F7A4C AC590004 */ sw $t9, 4($v0) -/* B6EBF0 800F7A50 8D4E0004 */ lw $t6, 4($t2) -/* B6EBF4 800F7A54 25D80008 */ addiu $t8, $t6, 8 -/* B6EBF8 800F7A58 AC580008 */ sw $t8, 8($v0) -/* B6EBFC 800F7A5C 914F0008 */ lbu $t7, 8($t2) -/* B6EC00 800F7A60 A04F000C */ sb $t7, 0xc($v0) -/* B6EC04 800F7A64 8D59000C */ lw $t9, 0xc($t2) -/* B6EC08 800F7A68 AC590010 */ sw $t9, 0x10($v0) -/* B6EC0C 800F7A6C 8D4E0010 */ lw $t6, 0x10($t2) -/* B6EC10 800F7A70 AC4E0014 */ sw $t6, 0x14($v0) -/* B6EC14 800F7A74 8D580014 */ lw $t8, 0x14($t2) -/* B6EC18 800F7A78 AC580018 */ sw $t8, 0x18($v0) -/* B6EC1C 800F7A7C 95470000 */ lhu $a3, ($t2) -/* B6EC20 800F7A80 00077B03 */ sra $t7, $a3, 0xc -/* B6EC24 800F7A84 31F900FF */ andi $t9, $t7, 0xff -/* B6EC28 800F7A88 00197080 */ sll $t6, $t9, 2 -/* B6EC2C 800F7A8C 026EC021 */ addu $t8, $s3, $t6 -/* B6EC30 800F7A90 8F0F0000 */ lw $t7, ($t8) -/* B6EC34 800F7A94 30F901FF */ andi $t9, $a3, 0x1ff -/* B6EC38 800F7A98 00197080 */ sll $t6, $t9, 2 -/* B6EC3C 800F7A9C 01EE1821 */ addu $v1, $t7, $t6 -/* B6EC40 800F7AA0 94780002 */ lhu $t8, 2($v1) -/* B6EC44 800F7AA4 240E0001 */ li $t6, 1 -/* B6EC48 800F7AA8 A4580026 */ sh $t8, 0x26($v0) -/* B6EC4C 800F7AAC 90790000 */ lbu $t9, ($v1) -/* B6EC50 800F7AB0 24180002 */ li $t8, 2 -/* B6EC54 800F7AB4 A0590024 */ sb $t9, 0x24($v0) -/* B6EC58 800F7AB8 954F0000 */ lhu $t7, ($t2) -/* B6EC5C 800F7ABC 3C198017 */ lui $t9, %hi(D_8016E1A0) # $t9, 0x8017 -/* B6EC60 800F7AC0 2739E1A0 */ addiu $t9, %lo(D_8016E1A0) # addiu $t9, $t9, -0x1e60 -/* B6EC64 800F7AC4 A04E002A */ sb $t6, 0x2a($v0) -/* B6EC68 800F7AC8 A058002B */ sb $t8, 0x2b($v0) -/* B6EC6C 800F7ACC 02B92021 */ addu $a0, $s5, $t9 -/* B6EC70 800F7AD0 A44F0028 */ sh $t7, 0x28($v0) -/* B6EC74 800F7AD4 908F0000 */ lbu $t7, ($a0) -/* B6EC78 800F7AD8 A04F002C */ sb $t7, 0x2c($v0) -/* B6EC7C 800F7ADC 90990000 */ lbu $t9, ($a0) -/* B6EC80 800F7AE0 8D180000 */ lw $t8, ($t0) -/* B6EC84 800F7AE4 90CE0000 */ lbu $t6, ($a2) -/* B6EC88 800F7AE8 03340019 */ multu $t9, $s4 -/* B6EC8C 800F7AEC 00007812 */ mflo $t7 -/* B6EC90 800F7AF0 030FC821 */ addu $t9, $t8, $t7 -/* B6EC94 800F7AF4 A32E002D */ sb $t6, 0x2d($t9) -/* B6EC98 800F7AF8 90C90000 */ lbu $t1, ($a2) -/* B6EC9C 800F7AFC 8D0B0000 */ lw $t3, ($t0) -/* B6ECA0 800F7B00 01340019 */ multu $t1, $s4 -/* B6ECA4 800F7B04 A0890000 */ sb $t1, ($a0) -/* B6ECA8 800F7B08 0000C012 */ mflo $t8 -/* B6ECAC 800F7B0C 01787821 */ addu $t7, $t3, $t8 -/* B6ECB0 800F7B10 91EE002D */ lbu $t6, 0x2d($t7) -/* B6ECB4 800F7B14 31D900FF */ andi $t9, $t6, 0xff -/* B6ECB8 800F7B18 03340019 */ multu $t9, $s4 -/* B6ECBC 800F7B1C A0CE0000 */ sb $t6, ($a2) -/* B6ECC0 800F7B20 0000C012 */ mflo $t8 -/* B6ECC4 800F7B24 01787821 */ addu $t7, $t3, $t8 -/* B6ECC8 800F7B28 A1E5002C */ sb $a1, 0x2c($t7) -/* B6ECCC 800F7B2C A045002D */ sb $a1, 0x2d($v0) -.L800F7B30: -/* B6ECD0 800F7B30 8FBF002C */ lw $ra, 0x2c($sp) -.L800F7B34: -/* B6ECD4 800F7B34 8FB00014 */ lw $s0, 0x14($sp) -/* B6ECD8 800F7B38 8FB10018 */ lw $s1, 0x18($sp) -/* B6ECDC 800F7B3C 8FB2001C */ lw $s2, 0x1c($sp) -/* B6ECE0 800F7B40 8FB30020 */ lw $s3, 0x20($sp) -/* B6ECE4 800F7B44 8FB40024 */ lw $s4, 0x24($sp) -/* B6ECE8 800F7B48 8FB50028 */ lw $s5, 0x28($sp) -/* B6ECEC 800F7B4C 03E00008 */ jr $ra -/* B6ECF0 800F7B50 27BD0058 */ addiu $sp, $sp, 0x58 - diff --git a/include/z64audio.h b/include/z64audio.h index af758b55e6..aab78500b2 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -1088,7 +1088,7 @@ typedef struct { /* 0x20 */ u32 unk_20; /* 0x24 */ u8 unk_24; /* 0x26 */ u16 unk_26; - /* 0x28 */ u16 unk_28; // "flag" + /* 0x28 */ u16 sfxId; /* 0x2A */ u8 unk_2A; /* 0x2B */ u8 unk_2B; /* 0x2C */ u8 prev; diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c index 1d18761b66..7b9ee43877 100644 --- a/src/code/code_800EC960.c +++ b/src/code/code_800EC960.c @@ -1275,7 +1275,7 @@ void AudioDebug_Draw(GfxPrint* printer) { while (i != 0xFF) { GfxPrint_SetPos(printer, 3, 7 + j++); - GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSoundBanks[ind][i].unk_28, + GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSoundBanks[ind][i].sfxId, gSoundBanks[ind][i].unk_2A, gSoundBanks[ind][i].unk_20); i = gSoundBanks[ind][i].next; } @@ -1341,7 +1341,7 @@ void AudioDebug_Draw(GfxPrint* printer) { if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) { GfxPrint_Printf(printer, "%2X %5d %5d %5d %02X %04X %04X", entryIndex, (s32)*entry->posX, (s32)*entry->posY, (s32)*entry->posZ, entry->unk_24, entry->unk_26, - entry->unk_28); + entry->sfxId); } else { GfxPrint_Printf(printer, "FF ----- ----- ----- -- ---- ----"); } @@ -1349,7 +1349,7 @@ void AudioDebug_Draw(GfxPrint* printer) { if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) { GfxPrint_Printf(printer, "%2X %5d %5d %5d %3d %3d %04X", entryIndex, (s32)*entry->posX, (s32)*entry->posY, (s32)*entry->posZ, (s32)(chan->volume * 127.1f), - chan->newPan, entry->unk_28); + chan->newPan, entry->sfxId); } else { GfxPrint_Printf(printer, "FF ----- ----- ----- --- --- ----"); } @@ -1357,13 +1357,13 @@ void AudioDebug_Draw(GfxPrint* printer) { if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) { GfxPrint_Printf(printer, "%2X %5d %5d %5d %3d %3d %04X", entryIndex, (s32)*entry->posX, (s32)*entry->posY, (s32)*entry->posZ, (s32)(chan->freqScale * 100.0f), - chan->reverb, entry->unk_28); + chan->reverb, entry->sfxId); } else { GfxPrint_Printf(printer, "FF ----- ----- ----- --- --- ----"); } } else if (sAudioIntInfoBankPage[k] == 4) { if ((entryIndex != 0xFF) && ((entry->unk_2A == 4) || (entry->unk_2A == 5))) { - GfxPrint_Printf(printer, "%2X %04X", entryIndex, entry->unk_28); + GfxPrint_Printf(printer, "%2X %04X", entryIndex, entry->sfxId); } else { GfxPrint_Printf(printer, "FF ----"); } @@ -2581,7 +2581,7 @@ s8 Audio_ComputeSoundReverb(u8 bankIdx, u8 entryIdx, u8 channelIdx) { } reverb = *entry->reverbAdd + distAdd + scriptAdd; - if ((bankIdx != BANK_OCARINA) || !((entry->unk_28 & 0x1FF) < 2)) { + if ((bankIdx != BANK_OCARINA) || !((entry->sfxId & 0x1FF) < 2)) { reverb += sAudioEnvReverb + sAudioCodeReverb + sSpecReverb; } @@ -3160,7 +3160,7 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) { } for (i = 0; i < D_80130578[D_801333CC][bank]; i++) { - if ((D_8016E1B8[bank][i].unk_4 != 0xFF) && (sfxId == gSoundBanks[bank][D_8016E1B8[bank][i].unk_4].unk_28)) { + if ((D_8016E1B8[bank][i].unk_4 != 0xFF) && (sfxId == gSoundBanks[bank][D_8016E1B8[bank][i].unk_4].sfxId)) { Audio_QueueCmdS8(_SHIFTL(6, 24, 8) | _SHIFTL(2, 16, 8) | _SHIFTL(phi_s1, 8, 8) | _SHIFTL(6, 0, 8), arg2); } phi_s1++; diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index 9ed8e83825..b1d4196ddc 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -155,12 +155,12 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) { req = &sSoundRequests[i]; switch (aspect) { case 0: - if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28)) { + if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId)) { remove = true; } break; case 1: - if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28) && (&req->pos->x == cmp->posX)) { + if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId) && (&req->pos->x == cmp->posX)) { remove = true; } break; @@ -170,17 +170,17 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) { } break; case 3: - if (&req->pos->x == cmp->posX && req->sfxId == cmp->unk_28) { + if (&req->pos->x == cmp->posX && req->sfxId == cmp->sfxId) { remove = true; } break; case 4: - if (req->unk_8 == cmp->unk_C && req->sfxId == cmp->unk_28) { + if (req->unk_8 == cmp->unk_C && req->sfxId == cmp->sfxId) { remove = true; } break; case 5: - if (req->sfxId == cmp->unk_28) { + if (req->sfxId == cmp->sfxId) { remove = true; } break; @@ -191,113 +191,104 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) { } } -#ifdef NON_MATCHING -// Down to a/v regalloc and some stuff where the compiler gets confused about reusing values. There's some fake matching -// stuff to improve regalloc enough to verify equivalence. void Audio_ProcessSoundRequest(void) { - u16 flag1; - u8 sp55; - u8 phi_a1; - SoundRequest* req; // sp50 - SoundBankEntry* temp_v0; + u16 sfxId; + u8 count; + u8 index; + SoundRequest* req; + SoundBankEntry* entry; Struct_8013331C* sp48; - s32 phi_s5; - u8 sp43; - u8 phi_s1; - u16 flag2; + s32 bankId; + u8 bestValue; + u8 bestIndex; req = &sSoundRequests[sSoundRequestReadIndex]; - phi_s1 = 0x80; + bestIndex = 0x80; if (req->sfxId == 0) { return; } - phi_s5 = SFX_BANK(req->sfxId); - if ((1 << phi_s5) & D_801333F0) { + bankId = SFX_BANK(req->sfxId); + if ((1 << bankId) & D_801333F0) { AudioDebug_ScrPrt((const s8*)D_80133340, req->sfxId); - phi_s5 = SFX_BANK(req->sfxId); + bankId = SFX_BANK(req->sfxId); } - sp55 = 0; - phi_a1 = gSoundBanks[phi_s5][0].next; - while (phi_a1 != 0xFF && phi_a1 != 0) { - if (gSoundBanks[phi_s5][phi_a1].posX == &req->pos->x) { - sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)]; - if (!(!(sp48->unk_2 & 0x20) || sp48->unk_0 != gSoundBanks[phi_s5][phi_a1].unk_24)) { + count = 0; + index = gSoundBanks[bankId][0].next; + while (index != 0xFF && index != 0) { + if (gSoundBanks[bankId][index].posX == &req->pos->x) { + if ((D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_2 & 0x20) && + D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_0 == + gSoundBanks[bankId][index].unk_24) { return; } - if (gSoundBanks[phi_s5][phi_a1].unk_28 == req->sfxId) { - sp55 = D_80130594[D_801333CC][phi_s5]; + if (gSoundBanks[bankId][index].sfxId == req->sfxId) { + count = D_80130594[D_801333CC][bankId]; } else { - //! @bug possibly uninitialized sp43 ? confirm when matching - if (sp55 == 0) { - phi_s1 = phi_a1; - flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF; - sp43 = D_8013331C[SFX_BANK_SHIFT(flag1)][SFX_INDEX(flag1)].unk_0; - } else if (gSoundBanks[phi_s5][phi_a1].unk_24 < sp43) { - phi_s1 = phi_a1; - flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF; - sp43 = D_8013331C[SFX_BANK_SHIFT(flag1)][SFX_INDEX(flag1)].unk_0; + if (count == 0) { + bestIndex = index; + sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF; + bestValue = D_8013331C[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].unk_0; + } else if (gSoundBanks[bankId][index].unk_24 < bestValue) { + bestIndex = index; + sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF; + bestValue = D_8013331C[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].unk_0; } - sp55++; - if (sp55 == D_80130594[D_801333CC][phi_s5]) { - phi_a1 = (sp48->unk_0 >= sp43) ? phi_s1 : 0; + count++; + if (count == D_80130594[D_801333CC][bankId]) { + index = (D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_0 >= bestValue) + ? bestIndex + : 0; } } - if (D_80130594[D_801333CC][phi_s5] == sp55) { - flag2 = req->sfxId & 0xC00; // Problem is around here + if (count == D_80130594[D_801333CC][bankId]) { sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)]; - if ((flag2) || (D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_2 & 4) || - (phi_a1 == phi_s1)) { - if ((gSoundBanks[phi_s5][phi_a1].unk_26 & 8) && gSoundBanks[phi_s5][phi_a1].unk_2A != 1) { - Audio_ClearBGMMute(gSoundBanks[phi_s5][phi_a1].unk_2E); + if ((req->sfxId & 0xC00) || (sp48->unk_2 & 4) || (index == bestIndex)) { + if ((gSoundBanks[bankId][index].unk_26 & 8) && gSoundBanks[bankId][index].unk_2A != 1) { + Audio_ClearBGMMute(gSoundBanks[bankId][index].unk_2E); } - gSoundBanks[phi_s5][phi_a1].unk_C = req->unk_8; - gSoundBanks[phi_s5][phi_a1].unk_28 = req->sfxId; - gSoundBanks[phi_s5][phi_a1].unk_2A = 1; - gSoundBanks[phi_s5][phi_a1].unk_2B = 2; - gSoundBanks[phi_s5][phi_a1].freqScale = req->freqScale; - gSoundBanks[phi_s5][phi_a1].unk_14 = req->unk_10; - gSoundBanks[phi_s5][phi_a1].reverbAdd = req->reverbAdd; - gSoundBanks[phi_s5][phi_a1].unk_26 = sp48->unk_2; - gSoundBanks[phi_s5][phi_a1].unk_24 = sp48->unk_0; - if (!sp48->unk_2) {} - } else if (gSoundBanks[phi_s5][phi_a1].unk_2A == 5) { - gSoundBanks[phi_s5][phi_a1].unk_2A = 4; + gSoundBanks[bankId][index].unk_C = req->unk_8; + gSoundBanks[bankId][index].sfxId = req->sfxId; + gSoundBanks[bankId][index].unk_2A = 1; + gSoundBanks[bankId][index].unk_2B = 2; + gSoundBanks[bankId][index].freqScale = req->freqScale; + gSoundBanks[bankId][index].unk_14 = req->unk_10; + gSoundBanks[bankId][index].reverbAdd = req->reverbAdd; + gSoundBanks[bankId][index].unk_26 = sp48->unk_2; + gSoundBanks[bankId][index].unk_24 = sp48->unk_0; + } else if (gSoundBanks[bankId][index].unk_2A == 5) { + gSoundBanks[bankId][index].unk_2A = 4; } - phi_a1 = 0; + index = 0; } } - if (phi_a1 != 0) { - phi_a1 = gSoundBanks[phi_s5][phi_a1].next; + if (index != 0) { + index = gSoundBanks[bankId][index].next; } } - if (gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next != 0xFF && phi_a1 != 0) { - phi_a1 = D_8016E1A8[phi_s5]; - temp_v0 = &gSoundBanks[phi_s5][phi_a1]; - temp_v0->posX = &req->pos->x; - temp_v0->posY = &req->pos->y; - temp_v0->posZ = &req->pos->z; - temp_v0->unk_C = req->unk_8; - temp_v0->freqScale = req->freqScale; - temp_v0->unk_14 = req->unk_10; - temp_v0->reverbAdd = req->reverbAdd; + if (gSoundBanks[bankId][D_8016E1A8[bankId]].next != 0xFF && index != 0) { + index = D_8016E1A8[bankId]; + entry = &gSoundBanks[bankId][index]; + entry->posX = &req->pos->x; + entry->posY = &req->pos->y; + entry->posZ = &req->pos->z; + entry->unk_C = req->unk_8; + entry->freqScale = req->freqScale; + entry->unk_14 = req->unk_10; + entry->reverbAdd = req->reverbAdd; sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)]; - temp_v0->unk_26 = sp48->unk_2; - temp_v0->unk_24 = sp48->unk_0; - temp_v0->unk_28 = req->sfxId; - temp_v0->unk_2A = 1; - temp_v0->unk_2B = 2; - temp_v0->prev = D_8016E1A0[phi_s5]; - gSoundBanks[phi_s5][D_8016E1A0[phi_s5]].next = D_8016E1A8[phi_s5]; - D_8016E1A0[phi_s5] = D_8016E1A8[phi_s5]; - D_8016E1A8[phi_s5] = gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next; - gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].prev = 0xFF; - temp_v0->next = 0xFF; + entry->unk_26 = sp48->unk_2; + entry->unk_24 = sp48->unk_0; + entry->sfxId = req->sfxId; + entry->unk_2A = 1; + entry->unk_2B = 2; + entry->prev = D_8016E1A0[bankId]; + gSoundBanks[bankId][D_8016E1A0[bankId]].next = D_8016E1A8[bankId]; + D_8016E1A0[bankId] = D_8016E1A8[bankId]; + D_8016E1A8[bankId] = gSoundBanks[bankId][D_8016E1A8[bankId]].next; + gSoundBanks[bankId][D_8016E1A8[bankId]].prev = 0xFF; + entry->next = 0xFF; } } -#else -void Audio_ProcessSoundRequest(void); -#pragma GLOBAL_ASM("asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s") -#endif void func_800F7B54(u8 bankId, u8 bankIndex) { SoundBankEntry* entry = &gSoundBanks[bankId][bankIndex]; @@ -351,9 +342,9 @@ void func_800F7CEC(u8 arg0) { phi_s4 = gSoundBanks[arg0][0].next; phi_s0 = 0; while (phi_s4 != 0xFF) { - if ((1 == gSoundBanks[arg0][phi_s4].unk_2A) && (gSoundBanks[arg0][phi_s4].unk_28 & 0xC00)) { + if ((1 == gSoundBanks[arg0][phi_s4].unk_2A) && (gSoundBanks[arg0][phi_s4].sfxId & 0xC00)) { gSoundBanks[arg0][phi_s4].unk_2B--; - } else if (!(gSoundBanks[arg0][phi_s4].unk_28 & 0xC00) && (gSoundBanks[arg0][phi_s4].unk_2A == 5)) { + } else if (!(gSoundBanks[arg0][phi_s4].sfxId & 0xC00) && (gSoundBanks[arg0][phi_s4].unk_2A == 5)) { Audio_QueueCmdS8((gSoundBanks[arg0][phi_s4].unk_2E << 8) | 0x6020000, 0); func_800F7B54(arg0, phi_s4); } @@ -374,10 +365,10 @@ void func_800F7CEC(u8 arg0) { } else { if (entry->dist > 0x7FFFFFD0) { entry->dist = 0x70000008; - osSyncPrintf(D_80133344, entry->unk_28, entry->posX, entry->posZ, *entry->posX, - *entry->posY, *entry->posZ); + osSyncPrintf(D_80133344, entry->sfxId, entry->posX, entry->posZ, *entry->posX, *entry->posY, + *entry->posZ); } - temp3 = entry->unk_28; + temp3 = entry->sfxId; entry->unk_20 = (u32)entry->dist + (SQ(0xFF - spA9) * 0x1690) + temp3 - temp3; if (*entry->posZ < 0.0f) { entry->unk_20 += (s32)(-*entry->posZ * 6.0f); @@ -386,7 +377,7 @@ void func_800F7CEC(u8 arg0) { if (entry->dist > SQ(1e5f)) { if (entry->unk_2A == 4) { Audio_QueueCmdS8((entry->unk_2E << 8) | 0x6020000, 0); - if (entry->unk_28 & 0xC00) { + if (entry->sfxId & 0xC00) { func_800F7B54(arg0, phi_s4); phi_s4 = phi_s0; } @@ -431,7 +422,7 @@ void func_800F7CEC(u8 arg0) { } else { entry = &gSoundBanks[arg0][temp_s4_3[0].unk_4]; if (entry->unk_2A == 4) { - if (entry->unk_28 & 0xC00) { + if (entry->sfxId & 0xC00) { func_800F7B54(arg0, temp_s4_3->unk_4); } else { entry->unk_2A = 1; @@ -512,11 +503,11 @@ void func_800F8480(u8 bankId) { } Audio_SetSoundProperties(bankId, bankIndex, D_8016E260); Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8), 1); - Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 4, entry->unk_28 & 0xFF); + Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 4, entry->sfxId & 0xFF); if (D_80130570[bankId] != 0) { - Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 5, (entry->unk_28 & 0x100) >> 8); + Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8) | 5, (entry->sfxId & 0x100) >> 8); } - if (entry->unk_28 & 0xC00) { + if (entry->sfxId & 0xC00) { entry->unk_2A = 4; } else { entry->unk_2A = 5; @@ -525,7 +516,7 @@ void func_800F8480(u8 bankId) { func_800F7B54(bankId, bankIndex); } else if (entry->unk_2A == 3) { Audio_SetSoundProperties(bankId, bankIndex, D_8016E260); - if (entry->unk_28 & 0xC00) { + if (entry->sfxId & 0xC00) { entry->unk_2A = 4; } else { entry->unk_2A = 5; @@ -552,7 +543,7 @@ void func_800F87A0(u8 bankId) { } bankIndex = gSoundBanks[bankId][0].next; } - cmp.unk_28 = bankId << 12; + cmp.sfxId = bankId << 12; Audio_RemoveMatchingSoundRequests(0, &cmp); } @@ -581,7 +572,7 @@ void func_800F89A0(u8 bankId, Vec3f* pos) { SoundBankEntry cmp; func_800F8884(bankId, pos); - cmp.unk_28 = bankId << 12; + cmp.sfxId = bankId << 12; cmp.posX = &pos->x; Audio_RemoveMatchingSoundRequests(1, &cmp); } @@ -605,7 +596,7 @@ void func_800F8A44(Vec3f* pos, u16 sfxId) { while (bankIndex != 0xFF) { entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; - if (entry->posX == &pos->x && entry->unk_28 == sfxId) { + if (entry->posX == &pos->x && entry->sfxId == sfxId) { if (entry->unk_2A >= 3) { Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0); } @@ -621,7 +612,7 @@ void func_800F8A44(Vec3f* pos, u16 sfxId) { } } cmp.posX = &pos->x; - cmp.unk_28 = sfxId; + cmp.sfxId = sfxId; Audio_RemoveMatchingSoundRequests(3, &cmp); } @@ -633,7 +624,7 @@ void func_800F8BA0(u8 arg0, u16 sfxId) { while (bankIndex != 0xFF) { entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; - if (entry->unk_C == arg0 && entry->unk_28 == sfxId) { + if (entry->unk_C == arg0 && entry->sfxId == sfxId) { if (entry->unk_2A >= 3) { Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0); } @@ -648,7 +639,7 @@ void func_800F8BA0(u8 arg0, u16 sfxId) { } } cmp.unk_C = arg0; - cmp.unk_28 = sfxId; + cmp.sfxId = sfxId; Audio_RemoveMatchingSoundRequests(4, &cmp); } @@ -660,7 +651,7 @@ void Audio_StopSfx(u32 sfxId) { while (bankIndex != 0xFF) { entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; - if (entry->unk_28 == sfxId) { + if (entry->sfxId == sfxId) { if (entry->unk_2A >= 3) { Audio_QueueCmdS8(0x06020000 | ((entry->unk_2E & 0xFF) << 8), 0); } @@ -672,7 +663,7 @@ void Audio_StopSfx(u32 sfxId) { } bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next; } - cmp.unk_28 = sfxId; + cmp.sfxId = sfxId; Audio_RemoveMatchingSoundRequests(5, &cmp); } @@ -722,7 +713,7 @@ u8 Audio_IsSfxPlaying(u32 sfxId) { while (bankIndex != 0xFF) { entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; - if (entry->unk_28 == sfxId) { + if (entry->sfxId == sfxId) { return true; } bankIndex = entry->next;