1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 23:14:37 +00:00

Match func_800EEA50 + some surrounding doc (#916)

* Match func_800EEA50

* Document some audio debug stuff

* more doc

* more doc

* formatting

* Fix enums, and some more bits of doc

* review

* LIM -> MAX

* missed review suggestion...

* more review

* ganon comments

* more review

* 🐍☠️

* more review

* Update functions.h

* quotes

* review

Co-authored-by: zelda2774 <zelda2774@invalid>
This commit is contained in:
zelda2774 2021-08-30 02:08:41 +02:00 committed by GitHub
parent 28e72bb486
commit a75c70358c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1562 additions and 5496 deletions

View file

@ -1,14 +1,14 @@
glabel func_800F2464 glabel AudioDebug_ProcessInput_SEFlagSwap
/* B69604 800F2464 3C058013 */ lui $a1, %hi(D_80131F00) # $a1, 0x8013 /* B69604 800F2464 3C058013 */ lui $a1, %hi(sAudioSEFlagSwapIsEditing) # $a1, 0x8013
/* B69608 800F2468 24A51F00 */ addiu $a1, %lo(D_80131F00) # addiu $a1, $a1, 0x1f00 /* B69608 800F2468 24A51F00 */ addiu $a1, %lo(sAudioSEFlagSwapIsEditing) # addiu $a1, $a1, 0x1f00
/* B6960C 800F246C 90AE0000 */ lbu $t6, ($a1) /* B6960C 800F246C 90AE0000 */ lbu $t6, ($a1)
/* B69610 800F2470 27BDFFF8 */ addiu $sp, $sp, -8 /* B69610 800F2470 27BDFFF8 */ addiu $sp, $sp, -8
/* B69614 800F2474 3C028017 */ lui $v0, %hi(sDebugPadPress) # $v0, 0x8017 /* B69614 800F2474 3C028017 */ lui $v0, %hi(sDebugPadPress) # $v0, 0x8017
/* B69618 800F2478 15C0003F */ bnez $t6, .L800F2578 /* B69618 800F2478 15C0003F */ bnez $t6, .L800F2578
/* B6961C 800F247C 00000000 */ nop /* B6961C 800F247C 00000000 */ nop
/* B69620 800F2480 8C42BAB8 */ lw $v0, %lo(sDebugPadPress)($v0) /* B69620 800F2480 8C42BAB8 */ lw $v0, %lo(sDebugPadPress)($v0)
/* B69624 800F2484 3C048013 */ lui $a0, %hi(D_80131F04) # $a0, 0x8013 /* B69624 800F2484 3C048013 */ lui $a0, %hi(sAudioSEFlagSwapSel) # $a0, 0x8013
/* B69628 800F2488 24841F04 */ addiu $a0, %lo(D_80131F04) # addiu $a0, $a0, 0x1f04 /* B69628 800F2488 24841F04 */ addiu $a0, %lo(sAudioSEFlagSwapSel) # addiu $a0, $a0, 0x1f04
/* B6962C 800F248C 304F0800 */ andi $t7, $v0, 0x800 /* B6962C 800F248C 304F0800 */ andi $t7, $v0, 0x800
/* B69630 800F2490 11E00008 */ beqz $t7, .L800F24B4 /* B69630 800F2490 11E00008 */ beqz $t7, .L800F24B4
/* B69634 800F2494 304C0400 */ andi $t4, $v0, 0x400 /* B69634 800F2494 304C0400 */ andi $t4, $v0, 0x400
@ -21,9 +21,9 @@ glabel func_800F2464
.L800F24B0: .L800F24B0:
/* B69650 800F24B0 A0990000 */ sb $t9, ($a0) /* B69650 800F24B0 A0990000 */ sb $t9, ($a0)
.L800F24B4: .L800F24B4:
/* B69654 800F24B4 3C048013 */ lui $a0, %hi(D_80131F04) # $a0, 0x8013 /* B69654 800F24B4 3C048013 */ lui $a0, %hi(sAudioSEFlagSwapSel) # $a0, 0x8013
/* B69658 800F24B8 11800008 */ beqz $t4, .L800F24DC /* B69658 800F24B8 11800008 */ beqz $t4, .L800F24DC
/* B6965C 800F24BC 24841F04 */ addiu $a0, %lo(D_80131F04) # addiu $a0, $a0, 0x1f04 /* B6965C 800F24BC 24841F04 */ addiu $a0, %lo(sAudioSEFlagSwapSel) # addiu $a0, $a0, 0x1f04
/* B69660 800F24C0 90830000 */ lbu $v1, ($a0) /* B69660 800F24C0 90830000 */ lbu $v1, ($a0)
/* B69664 800F24C4 28610009 */ slti $at, $v1, 9 /* B69664 800F24C4 28610009 */ slti $at, $v1, 9
/* B69668 800F24C8 10200003 */ beqz $at, .L800F24D8 /* B69668 800F24C8 10200003 */ beqz $at, .L800F24D8
@ -42,20 +42,20 @@ glabel func_800F2464
/* B69690 800F24F0 13000009 */ beqz $t8, .L800F2518 /* B69690 800F24F0 13000009 */ beqz $t8, .L800F2518
/* B69694 800F24F4 30591000 */ andi $t9, $v0, 0x1000 /* B69694 800F24F4 30591000 */ andi $t9, $v0, 0x1000
/* B69698 800F24F8 90860000 */ lbu $a2, ($a0) /* B69698 800F24F8 90860000 */ lbu $a2, ($a0)
/* B6969C 800F24FC 3C018017 */ lui $at, %hi(D_8016E2E0) /* B6969C 800F24FC 3C018017 */ lui $at, %hi(gAudioSEFlagSwapSource)
/* B696A0 800F2500 00063040 */ sll $a2, $a2, 1 /* B696A0 800F2500 00063040 */ sll $a2, $a2, 1
/* B696A4 800F2504 00260821 */ addu $at, $at, $a2 /* B696A4 800F2504 00260821 */ addu $at, $at, $a2
/* B696A8 800F2508 A420E2E0 */ sh $zero, %lo(D_8016E2E0)($at) /* B696A8 800F2508 A420E2E0 */ sh $zero, %lo(gAudioSEFlagSwapSource)($at)
/* B696AC 800F250C 3C018017 */ lui $at, %hi(D_8016E2F8) /* B696AC 800F250C 3C018017 */ lui $at, %hi(gAudioSEFlagSwapTarget)
/* B696B0 800F2510 00260821 */ addu $at, $at, $a2 /* B696B0 800F2510 00260821 */ addu $at, $at, $a2
/* B696B4 800F2514 A420E2F8 */ sh $zero, %lo(D_8016E2F8)($at) /* B696B4 800F2514 A420E2F8 */ sh $zero, %lo(gAudioSEFlagSwapTarget)($at)
.L800F2518: .L800F2518:
/* B696B8 800F2518 1320008E */ beqz $t9, .L800F2754 /* B696B8 800F2518 1320008E */ beqz $t9, .L800F2754
/* B696BC 800F251C 3C0C8017 */ lui $t4, %hi(D_8016E2E0) # $t4, 0x8017 /* B696BC 800F251C 3C0C8017 */ lui $t4, %hi(gAudioSEFlagSwapSource) # $t4, 0x8017
/* B696C0 800F2520 90830000 */ lbu $v1, ($a0) /* B696C0 800F2520 90830000 */ lbu $v1, ($a0)
/* B696C4 800F2524 3C0D8017 */ lui $t5, %hi(D_8016E2F8) # $t5, 0x8017 /* B696C4 800F2524 3C0D8017 */ lui $t5, %hi(gAudioSEFlagSwapTarget) # $t5, 0x8017
/* B696C8 800F2528 25ADE2F8 */ addiu $t5, %lo(D_8016E2F8) # addiu $t5, $t5, -0x1d08 /* B696C8 800F2528 25ADE2F8 */ addiu $t5, %lo(gAudioSEFlagSwapTarget) # addiu $t5, $t5, -0x1d08
/* B696CC 800F252C 258CE2E0 */ addiu $t4, %lo(D_8016E2E0) # addiu $t4, $t4, -0x1d20 /* B696CC 800F252C 258CE2E0 */ addiu $t4, %lo(gAudioSEFlagSwapSource) # addiu $t4, $t4, -0x1d20
/* B696D0 800F2530 00033040 */ sll $a2, $v1, 1 /* B696D0 800F2530 00033040 */ sll $a2, $v1, 1
/* B696D4 800F2534 00CC3821 */ addu $a3, $a2, $t4 /* B696D4 800F2534 00CC3821 */ addu $a3, $a2, $t4
/* B696D8 800F2538 10600004 */ beqz $v1, .L800F254C /* B696D8 800F2538 10600004 */ beqz $v1, .L800F254C
@ -67,13 +67,13 @@ glabel func_800F2464
/* B696EC 800F254C 24030009 */ li $v1, 9 /* B696EC 800F254C 24030009 */ li $v1, 9
.L800F2550: .L800F2550:
/* B696F0 800F2550 00032840 */ sll $a1, $v1, 1 /* B696F0 800F2550 00032840 */ sll $a1, $v1, 1
/* B696F4 800F2554 3C0E8017 */ lui $t6, %hi(D_8016E2E0) /* B696F4 800F2554 3C0E8017 */ lui $t6, %hi(gAudioSEFlagSwapSource)
/* B696F8 800F2558 01C57021 */ addu $t6, $t6, $a1 /* B696F8 800F2558 01C57021 */ addu $t6, $t6, $a1
/* B696FC 800F255C 95CEE2E0 */ lhu $t6, %lo(D_8016E2E0)($t6) /* B696FC 800F255C 95CEE2E0 */ lhu $t6, %lo(gAudioSEFlagSwapSource)($t6)
/* B69700 800F2560 3C0F8017 */ lui $t7, %hi(D_8016E2F8) /* B69700 800F2560 3C0F8017 */ lui $t7, %hi(gAudioSEFlagSwapTarget)
/* B69704 800F2564 01E57821 */ addu $t7, $t7, $a1 /* B69704 800F2564 01E57821 */ addu $t7, $t7, $a1
/* B69708 800F2568 A4EE0000 */ sh $t6, ($a3) /* B69708 800F2568 A4EE0000 */ sh $t6, ($a3)
/* B6970C 800F256C 95EFE2F8 */ lhu $t7, %lo(D_8016E2F8)($t7) /* B6970C 800F256C 95EFE2F8 */ lhu $t7, %lo(gAudioSEFlagSwapTarget)($t7)
/* B69710 800F2570 10000078 */ b .L800F2754 /* B69710 800F2570 10000078 */ b .L800F2754
/* B69714 800F2574 A50F0000 */ sh $t7, ($t0) /* B69714 800F2574 A50F0000 */ sh $t7, ($t0)
.L800F2578: .L800F2578:
@ -82,8 +82,8 @@ glabel func_800F2464
/* B69720 800F2580 30580200 */ andi $t8, $v0, 0x200 /* B69720 800F2580 30580200 */ andi $t8, $v0, 0x200
/* B69724 800F2584 1300000A */ beqz $t8, .L800F25B0 /* B69724 800F2584 1300000A */ beqz $t8, .L800F25B0
/* B69728 800F2588 304D0100 */ andi $t5, $v0, 0x100 /* B69728 800F2588 304D0100 */ andi $t5, $v0, 0x100
/* B6972C 800F258C 3C038013 */ lui $v1, %hi(D_80131F08) # $v1, 0x8013 /* B6972C 800F258C 3C038013 */ lui $v1, %hi(sAudioSEFlagSwapNibbleSel) # $v1, 0x8013
/* B69730 800F2590 24631F08 */ addiu $v1, %lo(D_80131F08) # addiu $v1, $v1, 0x1f08 /* B69730 800F2590 24631F08 */ addiu $v1, %lo(sAudioSEFlagSwapNibbleSel) # addiu $v1, $v1, 0x1f08
/* B69734 800F2594 90640000 */ lbu $a0, ($v1) /* B69734 800F2594 90640000 */ lbu $a0, ($v1)
/* B69738 800F2598 240C0007 */ li $t4, 7 /* B69738 800F2598 240C0007 */ li $t4, 7
/* B6973C 800F259C 18800003 */ blez $a0, .L800F25AC /* B6973C 800F259C 18800003 */ blez $a0, .L800F25AC
@ -93,9 +93,9 @@ glabel func_800F2464
.L800F25AC: .L800F25AC:
/* B6974C 800F25AC A06C0000 */ sb $t4, ($v1) /* B6974C 800F25AC A06C0000 */ sb $t4, ($v1)
.L800F25B0: .L800F25B0:
/* B69750 800F25B0 3C038013 */ lui $v1, %hi(D_80131F08) # $v1, 0x8013 /* B69750 800F25B0 3C038013 */ lui $v1, %hi(sAudioSEFlagSwapNibbleSel) # $v1, 0x8013
/* B69754 800F25B4 11A00008 */ beqz $t5, .L800F25D8 /* B69754 800F25B4 11A00008 */ beqz $t5, .L800F25D8
/* B69758 800F25B8 24631F08 */ addiu $v1, %lo(D_80131F08) # addiu $v1, $v1, 0x1f08 /* B69758 800F25B8 24631F08 */ addiu $v1, %lo(sAudioSEFlagSwapNibbleSel) # addiu $v1, $v1, 0x1f08
/* B6975C 800F25BC 90640000 */ lbu $a0, ($v1) /* B6975C 800F25BC 90640000 */ lbu $a0, ($v1)
/* B69760 800F25C0 28810007 */ slti $at, $a0, 7 /* B69760 800F25C0 28810007 */ slti $at, $a0, 7
/* B69764 800F25C4 10200003 */ beqz $at, .L800F25D4 /* B69764 800F25C4 10200003 */ beqz $at, .L800F25D4
@ -113,8 +113,8 @@ glabel func_800F2464
.L800F25EC: .L800F25EC:
/* B6978C 800F25EC 1080000B */ beqz $a0, .L800F261C /* B6978C 800F25EC 1080000B */ beqz $a0, .L800F261C
/* B69790 800F25F0 30460400 */ andi $a2, $v0, 0x400 /* B69790 800F25F0 30460400 */ andi $a2, $v0, 0x400
/* B69794 800F25F4 3C188017 */ lui $t8, %hi(D_8016BAB0) # $t8, 0x8017 /* B69794 800F25F4 3C188017 */ lui $t8, %hi(sDebugPadHold) # $t8, 0x8017
/* B69798 800F25F8 8F18BAB0 */ lw $t8, %lo(D_8016BAB0)($t8) /* B69798 800F25F8 8F18BAB0 */ lw $t8, %lo(sDebugPadHold)($t8)
/* B6979C 800F25FC 24090001 */ li $t1, 1 /* B6979C 800F25FC 24090001 */ li $t1, 1
/* B697A0 800F2600 33190008 */ andi $t9, $t8, 8 /* B697A0 800F2600 33190008 */ andi $t9, $t8, 8
/* B697A4 800F2604 53200005 */ beql $t9, $zero, .L800F261C /* B697A4 800F2604 53200005 */ beql $t9, $zero, .L800F261C
@ -126,8 +126,8 @@ glabel func_800F2464
.L800F261C: .L800F261C:
/* B697BC 800F261C 10C00009 */ beqz $a2, .L800F2644 /* B697BC 800F261C 10C00009 */ beqz $a2, .L800F2644
/* B697C0 800F2620 87A90006 */ lh $t1, 6($sp) /* B697C0 800F2620 87A90006 */ lh $t1, 6($sp)
/* B697C4 800F2624 3C0C8017 */ lui $t4, %hi(D_8016BAB0) # $t4, 0x8017 /* B697C4 800F2624 3C0C8017 */ lui $t4, %hi(sDebugPadHold) # $t4, 0x8017
/* B697C8 800F2628 8D8CBAB0 */ lw $t4, %lo(D_8016BAB0)($t4) /* B697C8 800F2628 8D8CBAB0 */ lw $t4, %lo(sDebugPadHold)($t4)
/* B697CC 800F262C 2409FFFF */ li $t1, -1 /* B697CC 800F262C 2409FFFF */ li $t1, -1
/* B697D0 800F2630 318D0008 */ andi $t5, $t4, 8 /* B697D0 800F2630 318D0008 */ andi $t5, $t4, 8
/* B697D4 800F2634 11A00003 */ beqz $t5, .L800F2644 /* B697D4 800F2634 11A00003 */ beqz $t5, .L800F2644
@ -136,13 +136,13 @@ glabel func_800F2464
/* B697E0 800F2640 2409FFF8 */ li $t1, -8 /* B697E0 800F2640 2409FFF8 */ li $t1, -8
.L800F2644: .L800F2644:
/* B697E4 800F2644 90660000 */ lbu $a2, ($v1) /* B697E4 800F2644 90660000 */ lbu $a2, ($v1)
/* B697E8 800F2648 3C048013 */ lui $a0, %hi(D_80131F04) # $a0, 0x8013 /* B697E8 800F2648 3C048013 */ lui $a0, %hi(sAudioSEFlagSwapSel) # $a0, 0x8013
/* B697EC 800F264C 24841F04 */ addiu $a0, %lo(D_80131F04) # addiu $a0, $a0, 0x1f04 /* B697EC 800F264C 24841F04 */ addiu $a0, %lo(sAudioSEFlagSwapSel) # addiu $a0, $a0, 0x1f04
/* B697F0 800F2650 28C10004 */ slti $at, $a2, 4 /* B697F0 800F2650 28C10004 */ slti $at, $a2, 4
/* B697F4 800F2654 10200015 */ beqz $at, .L800F26AC /* B697F4 800F2654 10200015 */ beqz $at, .L800F26AC
/* B697F8 800F2658 3C188017 */ lui $t8, %hi(D_8016E2E0) # $t8, 0x8017 /* B697F8 800F2658 3C188017 */ lui $t8, %hi(gAudioSEFlagSwapSource) # $t8, 0x8017
/* B697FC 800F265C 908E0000 */ lbu $t6, ($a0) /* B697FC 800F265C 908E0000 */ lbu $t6, ($a0)
/* B69800 800F2660 2718E2E0 */ addiu $t8, %lo(D_8016E2E0) # addiu $t8, $t8, -0x1d20 /* B69800 800F2660 2718E2E0 */ addiu $t8, %lo(gAudioSEFlagSwapSource) # addiu $t8, $t8, -0x1d20
/* B69804 800F2664 00065823 */ negu $t3, $a2 /* B69804 800F2664 00065823 */ negu $t3, $a2
/* B69808 800F2668 000E7840 */ sll $t7, $t6, 1 /* B69808 800F2668 000E7840 */ sll $t7, $t6, 1
/* B6980C 800F266C 01F83821 */ addu $a3, $t7, $t8 /* B6980C 800F266C 01F83821 */ addu $a3, $t7, $t8
@ -162,11 +162,11 @@ glabel func_800F2464
/* B69844 800F26A4 10000017 */ b .L800F2704 /* B69844 800F26A4 10000017 */ b .L800F2704
/* B69848 800F26A8 A4F80000 */ sh $t8, ($a3) /* B69848 800F26A8 A4F80000 */ sh $t8, ($a3)
.L800F26AC: .L800F26AC:
/* B6984C 800F26AC 3C048013 */ lui $a0, %hi(D_80131F04) # $a0, 0x8013 /* B6984C 800F26AC 3C048013 */ lui $a0, %hi(sAudioSEFlagSwapSel) # $a0, 0x8013
/* B69850 800F26B0 24841F04 */ addiu $a0, %lo(D_80131F04) # addiu $a0, $a0, 0x1f04 /* B69850 800F26B0 24841F04 */ addiu $a0, %lo(sAudioSEFlagSwapSel) # addiu $a0, $a0, 0x1f04
/* B69854 800F26B4 90990000 */ lbu $t9, ($a0) /* B69854 800F26B4 90990000 */ lbu $t9, ($a0)
/* B69858 800F26B8 3C0D8017 */ lui $t5, %hi(D_8016E2F8) # $t5, 0x8017 /* B69858 800F26B8 3C0D8017 */ lui $t5, %hi(gAudioSEFlagSwapTarget) # $t5, 0x8017
/* B6985C 800F26BC 25ADE2F8 */ addiu $t5, %lo(D_8016E2F8) # addiu $t5, $t5, -0x1d08 /* B6985C 800F26BC 25ADE2F8 */ addiu $t5, %lo(gAudioSEFlagSwapTarget) # addiu $t5, $t5, -0x1d08
/* B69860 800F26C0 00196040 */ sll $t4, $t9, 1 /* B69860 800F26C0 00196040 */ sll $t4, $t9, 1
/* B69864 800F26C4 018D4021 */ addu $t0, $t4, $t5 /* B69864 800F26C4 018D4021 */ addu $t0, $t4, $t5
/* B69868 800F26C8 95070000 */ lhu $a3, ($t0) /* B69868 800F26C8 95070000 */ lhu $a3, ($t0)
@ -185,10 +185,10 @@ glabel func_800F2464
/* B6989C 800F26FC 032C6821 */ addu $t5, $t9, $t4 /* B6989C 800F26FC 032C6821 */ addu $t5, $t9, $t4
/* B698A0 800F2700 A50D0000 */ sh $t5, ($t0) /* B698A0 800F2700 A50D0000 */ sh $t5, ($t0)
.L800F2704: .L800F2704:
/* B698A4 800F2704 3C048013 */ lui $a0, %hi(D_80131F04) # $a0, 0x8013 /* B698A4 800F2704 3C048013 */ lui $a0, %hi(sAudioSEFlagSwapSel) # $a0, 0x8013
/* B698A8 800F2708 304E8000 */ andi $t6, $v0, 0x8000 /* B698A8 800F2708 304E8000 */ andi $t6, $v0, 0x8000
/* B698AC 800F270C 11C00002 */ beqz $t6, .L800F2718 /* B698AC 800F270C 11C00002 */ beqz $t6, .L800F2718
/* B698B0 800F2710 24841F04 */ addiu $a0, %lo(D_80131F04) # addiu $a0, $a0, 0x1f04 /* B698B0 800F2710 24841F04 */ addiu $a0, %lo(sAudioSEFlagSwapSel) # addiu $a0, $a0, 0x1f04
/* B698B4 800F2714 A0A00000 */ sb $zero, ($a1) /* B698B4 800F2714 A0A00000 */ sb $zero, ($a1)
.L800F2718: .L800F2718:
/* B698B8 800F2718 304F4000 */ andi $t7, $v0, 0x4000 /* B698B8 800F2718 304F4000 */ andi $t7, $v0, 0x4000
@ -199,21 +199,21 @@ glabel func_800F2464
/* B698CC 800F272C 2B010004 */ slti $at, $t8, 4 /* B698CC 800F272C 2B010004 */ slti $at, $t8, 4
/* B698D0 800F2730 10200005 */ beqz $at, .L800F2748 /* B698D0 800F2730 10200005 */ beqz $at, .L800F2748
/* B698D4 800F2734 00063040 */ sll $a2, $a2, 1 /* B698D4 800F2734 00063040 */ sll $a2, $a2, 1
/* B698D8 800F2738 3C018017 */ lui $at, %hi(D_8016E2E0) /* B698D8 800F2738 3C018017 */ lui $at, %hi(gAudioSEFlagSwapSource)
/* B698DC 800F273C 00260821 */ addu $at, $at, $a2 /* B698DC 800F273C 00260821 */ addu $at, $at, $a2
/* B698E0 800F2740 10000004 */ b .L800F2754 /* B698E0 800F2740 10000004 */ b .L800F2754
/* B698E4 800F2744 A420E2E0 */ sh $zero, %lo(D_8016E2E0)($at) /* B698E4 800F2744 A420E2E0 */ sh $zero, %lo(gAudioSEFlagSwapSource)($at)
.L800F2748: .L800F2748:
/* B698E8 800F2748 3C018017 */ lui $at, %hi(D_8016E2F8) /* B698E8 800F2748 3C018017 */ lui $at, %hi(gAudioSEFlagSwapTarget)
/* B698EC 800F274C 00260821 */ addu $at, $at, $a2 /* B698EC 800F274C 00260821 */ addu $at, $at, $a2
/* B698F0 800F2750 A420E2F8 */ sh $zero, %lo(D_8016E2F8)($at) /* B698F0 800F2750 A420E2F8 */ sh $zero, %lo(gAudioSEFlagSwapTarget)($at)
.L800F2754: .L800F2754:
/* B698F4 800F2754 30590002 */ andi $t9, $v0, 2 /* B698F4 800F2754 30590002 */ andi $t9, $v0, 2
.L800F2758: .L800F2758:
/* B698F8 800F2758 13200006 */ beqz $t9, .L800F2774 /* B698F8 800F2758 13200006 */ beqz $t9, .L800F2774
/* B698FC 800F275C 304E0004 */ andi $t6, $v0, 4 /* B698FC 800F275C 304E0004 */ andi $t6, $v0, 4
/* B69900 800F2760 3C038013 */ lui $v1, %hi(D_801333F4) # $v1, 0x8013 /* B69900 800F2760 3C038013 */ lui $v1, %hi(gAudioSEFlagSwapOff) # $v1, 0x8013
/* B69904 800F2764 246333F4 */ addiu $v1, %lo(D_801333F4) # addiu $v1, $v1, 0x33f4 /* B69904 800F2764 246333F4 */ addiu $v1, %lo(gAudioSEFlagSwapOff) # addiu $v1, $v1, 0x33f4
/* B69908 800F2768 906C0000 */ lbu $t4, ($v1) /* B69908 800F2768 906C0000 */ lbu $t4, ($v1)
/* B6990C 800F276C 398D0001 */ xori $t5, $t4, 1 /* B6990C 800F276C 398D0001 */ xori $t5, $t4, 1
/* B69910 800F2770 A06D0000 */ sb $t5, ($v1) /* B69910 800F2770 A06D0000 */ sb $t5, ($v1)
@ -221,8 +221,8 @@ glabel func_800F2464
/* B69914 800F2774 11C00008 */ beqz $t6, .L800F2798 /* B69914 800F2774 11C00008 */ beqz $t6, .L800F2798
/* B69918 800F2778 00000000 */ nop /* B69918 800F2778 00000000 */ nop
/* B6991C 800F277C 908F0000 */ lbu $t7, ($a0) /* B6991C 800F277C 908F0000 */ lbu $t7, ($a0)
/* B69920 800F2780 3C188017 */ lui $t8, %hi(D_8016E310) # $t8, 0x8017 /* B69920 800F2780 3C188017 */ lui $t8, %hi(gAudioSEFlagSwapMode) # $t8, 0x8017
/* B69924 800F2784 2718E310 */ addiu $t8, %lo(D_8016E310) # addiu $t8, $t8, -0x1cf0 /* B69924 800F2784 2718E310 */ addiu $t8, %lo(gAudioSEFlagSwapMode) # addiu $t8, $t8, -0x1cf0
/* B69928 800F2788 01F81021 */ addu $v0, $t7, $t8 /* B69928 800F2788 01F81021 */ addu $v0, $t7, $t8
/* B6992C 800F278C 90590000 */ lbu $t9, ($v0) /* B6992C 800F278C 90590000 */ lbu $t9, ($v0)
/* B69930 800F2790 3B2C0001 */ xori $t4, $t9, 1 /* B69930 800F2790 3B2C0001 */ xori $t4, $t9, 1

View file

@ -40,7 +40,7 @@ glabel func_800EE824
/* B65A50 800EE8B0 1000001B */ b .L800EE920 /* B65A50 800EE8B0 1000001B */ b .L800EE920
/* B65A54 800EE8B4 A4231C88 */ sh $v1, %lo(D_80131C88)($at) /* B65A54 800EE8B4 A4231C88 */ sh $v1, %lo(D_80131C88)($at)
.L800EE8B8: .L800EE8B8:
/* B65A58 800EE8B8 0C03DC98 */ jal func_800F7260 /* B65A58 800EE8B8 0C03DC98 */ jal Audio_SetSoundBanksMute
/* B65A5C 800EE8BC 00002025 */ move $a0, $zero /* B65A5C 800EE8BC 00002025 */ move $a0, $zero
/* B65A60 800EE8C0 3C048013 */ lui $a0, %hi(D_80131C84) # $a0, 0x8013 /* B65A60 800EE8C0 3C048013 */ lui $a0, %hi(D_80131C84) # $a0, 0x8013
/* B65A64 800EE8C4 0C03B616 */ jal func_800ED858 /* B65A64 800EE8C4 0C03B616 */ jal func_800ED858

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
glabel func_800F7680 glabel Audio_ProcessSoundRequest
/* B6E820 800F7680 27BDFFA8 */ addiu $sp, $sp, -0x58 /* B6E820 800F7680 27BDFFA8 */ addiu $sp, $sp, -0x58
/* B6E824 800F7684 3C0E8013 */ lui $t6, %hi(D_801333A4) # $t6, 0x8013 /* B6E824 800F7684 3C0E8013 */ lui $t6, %hi(sSoundRequestReadIndex) # $t6, 0x8013
/* B6E828 800F7688 91CE33A4 */ lbu $t6, %lo(D_801333A4)($t6) /* B6E828 800F7688 91CE33A4 */ lbu $t6, %lo(sSoundRequestReadIndex)($t6)
/* B6E82C 800F768C 3C188017 */ lui $t8, %hi(D_8016C9A0) # $t8, 0x8017 /* B6E82C 800F768C 3C188017 */ lui $t8, %hi(sSoundRequests) # $t8, 0x8017
/* B6E830 800F7690 2718C9A0 */ addiu $t8, %lo(D_8016C9A0) # addiu $t8, $t8, -0x3660 /* B6E830 800F7690 2718C9A0 */ addiu $t8, %lo(sSoundRequests) # addiu $t8, $t8, -0x3660
/* B6E834 800F7694 000E7880 */ sll $t7, $t6, 2 /* B6E834 800F7694 000E7880 */ sll $t7, $t6, 2
/* B6E838 800F7698 01EE7823 */ subu $t7, $t7, $t6 /* B6E838 800F7698 01EE7823 */ subu $t7, $t7, $t6
/* B6E83C 800F769C 000F78C0 */ sll $t7, $t7, 3 /* B6E83C 800F769C 000F78C0 */ sll $t7, $t7, 3
@ -29,7 +29,7 @@ glabel func_800F7680
/* B6E88C 800F76EC 13000009 */ beqz $t8, .L800F7714 /* B6E88C 800F76EC 13000009 */ beqz $t8, .L800F7714
/* B6E890 800F76F0 3C048013 */ lui $a0, %hi(D_80133340) # $a0, 0x8013 /* B6E890 800F76F0 3C048013 */ lui $a0, %hi(D_80133340) # $a0, 0x8013
/* B6E894 800F76F4 24843340 */ addiu $a0, %lo(D_80133340) # addiu $a0, $a0, 0x3340 /* B6E894 800F76F4 24843340 */ addiu $a0, %lo(D_80133340) # addiu $a0, $a0, 0x3340
/* B6E898 800F76F8 0C03CB5B */ jal func_800F2D6C /* B6E898 800F76F8 0C03CB5B */ jal AudioDebug_ScrPrt
/* B6E89C 800F76FC AFAA0050 */ sw $t2, 0x50($sp) /* B6E89C 800F76FC AFAA0050 */ sw $t2, 0x50($sp)
/* B6E8A0 800F7700 8FAA0050 */ lw $t2, 0x50($sp) /* B6E8A0 800F7700 8FAA0050 */ lw $t2, 0x50($sp)
/* B6E8A4 800F7704 95550000 */ lhu $s5, ($t2) /* B6E8A4 800F7704 95550000 */ lhu $s5, ($t2)

View file

@ -34,12 +34,12 @@ glabel Audio_ProcessSeqCmd
/* B706C8 800F9528 3C048013 */ lui $a0, %hi(D_80133390) # $a0, 0x8013 /* B706C8 800F9528 3C048013 */ lui $a0, %hi(D_80133390) # $a0, 0x8013
/* B706CC 800F952C 00102C02 */ srl $a1, $s0, 0x10 /* B706CC 800F952C 00102C02 */ srl $a1, $s0, 0x10
/* B706D0 800F9530 30A5FFFF */ andi $a1, $a1, 0xffff /* B706D0 800F9530 30A5FFFF */ andi $a1, $a1, 0xffff
/* B706D4 800F9534 0C03CB5B */ jal func_800F2D6C /* B706D4 800F9534 0C03CB5B */ jal AudioDebug_ScrPrt
/* B706D8 800F9538 24843390 */ addiu $a0, %lo(D_80133390) # addiu $a0, $a0, 0x3390 /* B706D8 800F9538 24843390 */ addiu $a0, %lo(D_80133390) # addiu $a0, $a0, 0x3390
/* B706DC 800F953C 3C048013 */ lui $a0, %hi(D_80133398) # $a0, 0x8013 /* B706DC 800F953C 3C048013 */ lui $a0, %hi(D_80133398) # $a0, 0x8013
/* B706E0 800F9540 02002825 */ move $a1, $s0 /* B706E0 800F9540 02002825 */ move $a1, $s0
/* B706E4 800F9544 30A5FFFF */ andi $a1, $a1, 0xffff /* B706E4 800F9544 30A5FFFF */ andi $a1, $a1, 0xffff
/* B706E8 800F9548 0C03CB5B */ jal func_800F2D6C /* B706E8 800F9548 0C03CB5B */ jal AudioDebug_ScrPrt
/* B706EC 800F954C 24843398 */ addiu $a0, %lo(D_80133398) # addiu $a0, $a0, 0x3398 /* B706EC 800F954C 24843398 */ addiu $a0, %lo(D_80133398) # addiu $a0, $a0, 0x3398
.L800F9550: .L800F9550:
/* B706F0 800F9550 3C010F00 */ lui $at, 0xf00 /* B706F0 800F9550 3C010F00 */ lui $at, 0xf00
@ -757,10 +757,10 @@ glabel L800F9F68
/* B71154 800F9FB4 A0393408 */ sb $t9, %lo(D_80133408)($at) /* B71154 800F9FB4 A0393408 */ sb $t9, %lo(D_80133408)($at)
glabel L800F9FB8 glabel L800F9FB8
/* B71158 800F9FB8 320EFF00 */ andi $t6, $s0, 0xff00 /* B71158 800F9FB8 320EFF00 */ andi $t6, $s0, 0xff00
/* B7115C 800F9FBC 3C038013 */ lui $v1, %hi(D_80133414) # $v1, 0x8013 /* B7115C 800F9FBC 3C038013 */ lui $v1, %hi(gAudioSpecId) # $v1, 0x8013
/* B71160 800F9FC0 000E7A02 */ srl $t7, $t6, 8 /* B71160 800F9FC0 000E7A02 */ srl $t7, $t6, 8
/* B71164 800F9FC4 3C018013 */ lui $at, %hi(D_801333CC) # $at, 0x8013 /* B71164 800F9FC4 3C018013 */ lui $at, %hi(D_801333CC) # $at, 0x8013
/* B71168 800F9FC8 24633414 */ addiu $v1, %lo(D_80133414) # addiu $v1, $v1, 0x3414 /* B71168 800F9FC8 24633414 */ addiu $v1, %lo(gAudioSpecId) # addiu $v1, $v1, 0x3414
/* B7116C 800F9FCC A02F33CC */ sb $t7, %lo(D_801333CC)($at) /* B7116C 800F9FCC A02F33CC */ sb $t7, %lo(D_801333CC)($at)
/* B71170 800F9FD0 90780000 */ lbu $t8, ($v1) /* B71170 800F9FD0 90780000 */ lbu $t8, ($v1)
/* B71174 800F9FD4 A0700000 */ sb $s0, ($v1) /* B71174 800F9FD4 A0700000 */ sb $s0, ($v1)

View file

@ -204,7 +204,7 @@ glabel func_800758AC
/* AECCC0 80075B20 0C00084C */ jal osSyncPrintf /* AECCC0 80075B20 0C00084C */ jal osSyncPrintf
/* AECCC4 80075B24 2484C724 */ addiu $a0, %lo(D_8013C724) # addiu $a0, $a0, -0x38dc /* AECCC4 80075B24 2484C724 */ addiu $a0, %lo(D_8013C724) # addiu $a0, $a0, -0x38dc
/* AECCC8 80075B28 8FA20018 */ lw $v0, 0x18($sp) /* AECCC8 80075B28 8FA20018 */ lw $v0, 0x18($sp)
/* AECCCC 80075B2C 0C03D9B0 */ jal func_800F66C0 /* AECCCC 80075B2C 0C03D9B0 */ jal Audio_SetEnvReverb
/* AECCD0 80075B30 80441CC0 */ lb $a0, 0x1cc0($v0) /* AECCD0 80075B30 80441CC0 */ lb $a0, 0x1cc0($v0)
/* AECCD4 80075B34 8FBF0014 */ lw $ra, 0x14($sp) /* AECCD4 80075B34 8FBF0014 */ lw $ra, 0x14($sp)
.L80075B38: .L80075B38:

View file

@ -1715,7 +1715,7 @@ glabel L8010D768
/* B84950 8010D7B0 008E2021 */ addu $a0, $a0, $t6 /* B84950 8010D7B0 008E2021 */ addu $a0, $a0, $t6
/* B84954 8010D7B4 0C03D719 */ jal func_800F5C64 /* B84954 8010D7B4 0C03D719 */ jal func_800F5C64
/* B84958 8010D7B8 94843CE0 */ lhu $a0, %lo(D_80153CE0)($a0) /* B84958 8010D7B8 94843CE0 */ lhu $a0, %lo(D_80153CE0)($a0)
/* B8495C 8010D7BC 0C03DC98 */ jal func_800F7260 /* B8495C 8010D7BC 0C03DC98 */ jal Audio_SetSoundBanksMute
/* B84960 8010D7C0 24040020 */ li $a0, 32 /* B84960 8010D7C0 24040020 */ li $a0, 32
.L8010D7C4: .L8010D7C4:
/* B84964 8010D7C4 3C010001 */ lui $at, 1 /* B84964 8010D7C4 3C010001 */ lui $at, 1
@ -2982,7 +2982,7 @@ glabel L8010E904
/* B85BB8 8010EA18 10000095 */ b .L8010EC70 /* B85BB8 8010EA18 10000095 */ b .L8010EC70
/* B85BBC 8010EA1C 92026304 */ lbu $v0, 0x6304($s0) /* B85BBC 8010EA1C 92026304 */ lbu $v0, 0x6304($s0)
glabel L8010EA20 glabel L8010EA20
/* B85BC0 8010EA20 0C03E3FD */ jal func_800F8FF4 /* B85BC0 8010EA20 0C03E3FD */ jal Audio_IsSfxPlaying
/* B85BC4 8010EA24 24044836 */ li $a0, 18486 /* B85BC4 8010EA24 24044836 */ li $a0, 18486
/* B85BC8 8010EA28 1440000F */ bnez $v0, .L8010EA68 /* B85BC8 8010EA28 1440000F */ bnez $v0, .L8010EA68
/* B85BCC 8010EA2C 00000000 */ nop /* B85BCC 8010EA2C 00000000 */ nop

View file

@ -470,7 +470,7 @@ glabel L8010F8F8
.L8010FCB0: .L8010FCB0:
/* B86E50 8010FCB0 0C041C91 */ jal func_80107244 /* B86E50 8010FCB0 0C041C91 */ jal func_80107244
/* B86E54 8010FCB4 8FA40030 */ lw $a0, 0x30($sp) /* B86E54 8010FCB4 8FA40030 */ lw $a0, 0x30($sp)
/* B86E58 8010FCB8 0C03DA47 */ jal func_800F691C /* B86E58 8010FCB8 0C03DA47 */ jal Audio_PlaySoundIfNotInCutscene
/* B86E5C 8010FCBC 00002025 */ move $a0, $zero /* B86E5C 8010FCBC 00002025 */ move $a0, $zero
/* B86E60 8010FCC0 8FB90030 */ lw $t9, 0x30($sp) /* B86E60 8010FCC0 8FB90030 */ lw $t9, 0x30($sp)
/* B86E64 8010FCC4 240A0002 */ li $t2, 2 /* B86E64 8010FCC4 240A0002 */ li $t2, 2

View file

@ -36,10 +36,10 @@ glabel D_801305C0
glabel D_801305C4 glabel D_801305C4
.incbin "baserom.z64", 0xBA7764, 0x8 .incbin "baserom.z64", 0xBA7764, 0x8
glabel D_801305CC glabel sAudioIncreasingTranspose
.incbin "baserom.z64", 0xBA776C, 0x4 .incbin "baserom.z64", 0xBA776C, 0x4
glabel D_801305D0 glabel gMorphaTransposeTable
.incbin "baserom.z64", 0xBA7770, 0x10 .incbin "baserom.z64", 0xBA7770, 0x10
glabel sPrevChargeLevel glabel sPrevChargeLevel
@ -63,25 +63,25 @@ glabel D_80130604
glabel D_80130608 glabel D_80130608
.incbin "baserom.z64", 0xBA77A8, 0x4 .incbin "baserom.z64", 0xBA77A8, 0x4
glabel D_8013060C glabel sAudioCutsceneFlag
.incbin "baserom.z64", 0xBA77AC, 0x4 .incbin "baserom.z64", 0xBA77AC, 0x4
glabel D_80130610 glabel sSpecReverb
.incbin "baserom.z64", 0xBA77B0, 0x4 .incbin "baserom.z64", 0xBA77B0, 0x4
glabel D_80130614 glabel sAudioEnvReverb
.incbin "baserom.z64", 0xBA77B4, 0x4 .incbin "baserom.z64", 0xBA77B4, 0x4
glabel D_80130618 glabel sAudioCodeReverb
.incbin "baserom.z64", 0xBA77B8, 0x4 .incbin "baserom.z64", 0xBA77B8, 0x4
glabel D_8013061C glabel D_8013061C
.incbin "baserom.z64", 0xBA77BC, 0x4 .incbin "baserom.z64", 0xBA77BC, 0x4
glabel D_80130620 glabel sAudioEnemyDist
.incbin "baserom.z64", 0xBA77C0, 0x4 .incbin "baserom.z64", 0xBA77C0, 0x4
glabel D_80130624 glabel sAudioEnemyVol
.incbin "baserom.z64", 0xBA77C4, 0x4 .incbin "baserom.z64", 0xBA77C4, 0x4
glabel D_80130628 glabel D_80130628
@ -111,7 +111,7 @@ glabel D_80130644
glabel D_80130648 glabel D_80130648
.incbin "baserom.z64", 0xBA77E8, 0x4 .incbin "baserom.z64", 0xBA77E8, 0x4
glabel D_8013064C glabel sSariaBgmPtr
.incbin "baserom.z64", 0xBA77EC, 0x4 .incbin "baserom.z64", 0xBA77EC, 0x4
glabel D_80130650 glabel D_80130650
@ -123,7 +123,7 @@ glabel D_80130654
glabel D_80130658 glabel D_80130658
.incbin "baserom.z64", 0xBA77F8, 0x70 .incbin "baserom.z64", 0xBA77F8, 0x70
glabel D_801306C8 glabel sSpecReverbs
.incbin "baserom.z64", 0xBA7868, 0x14 .incbin "baserom.z64", 0xBA7868, 0x14
glabel D_801306DC glabel D_801306DC
@ -300,37 +300,37 @@ glabel D_80131C88
glabel D_80131C8C glabel D_80131C8C
.incbin "baserom.z64", 0xBA8E2C, 0x4 .incbin "baserom.z64", 0xBA8E2C, 0x4
glabel D_80131C90 glabel sAudioUpdateDuration
.incbin "baserom.z64", 0xBA8E30, 0x4 .incbin "baserom.z64", 0xBA8E30, 0x4
glabel D_80131C94 glabel sAudioUpdateDurationMax
.incbin "baserom.z64", 0xBA8E34, 0x4 .incbin "baserom.z64", 0xBA8E34, 0x4
glabel D_80131C98 glabel sAudioDebugEverOpened
.incbin "baserom.z64", 0xBA8E38, 0x4 .incbin "baserom.z64", 0xBA8E38, 0x4
glabel D_80131C9C glabel sAudioSEMuted
.incbin "baserom.z64", 0xBA8E3C, 0x4 .incbin "baserom.z64", 0xBA8E3C, 0x4
glabel D_80131CA0 glabel sAudioDebugPage
.incbin "baserom.z64", 0xBA8E40, 0x4 .incbin "baserom.z64", 0xBA8E40, 0x4
glabel D_80131CA4 glabel sAudioSndContSel
.incbin "baserom.z64", 0xBA8E44, 0x4 .incbin "baserom.z64", 0xBA8E44, 0x4
glabel D_80131CA8 glabel sAudioDebugTextColor
.incbin "baserom.z64", 0xBA8E48, 0x4 .incbin "baserom.z64", 0xBA8E48, 0x4
glabel D_80131CAC glabel sAudioDebugPageNames
.incbin "baserom.z64", 0xBA8E4C, 0x15C .incbin "baserom.z64", 0xBA8E4C, 0x15C
glabel D_80131E08 glabel sAudioSndContWork
.incbin "baserom.z64", 0xBA8FA8, 0x18 .incbin "baserom.z64", 0xBA8FA8, 0x18
glabel D_80131E20 glabel sAudioSndContWorkLims
.incbin "baserom.z64", 0xBA8FC0, 0x18 .incbin "baserom.z64", 0xBA8FC0, 0x18
glabel D_80131E38 glabel sSoundBankNames
.incbin "baserom.z64", 0xBA8FD8, 0xB .incbin "baserom.z64", 0xBA8FD8, 0xB
.incbin "baserom.z64", 0xBA8FE3, 0xB .incbin "baserom.z64", 0xBA8FE3, 0xB
.incbin "baserom.z64", 0xBA8FEE, 0xB .incbin "baserom.z64", 0xBA8FEE, 0xB
@ -339,91 +339,91 @@ glabel D_80131E38
.incbin "baserom.z64", 0xBA900F, 0xB .incbin "baserom.z64", 0xBA900F, 0xB
.incbin "baserom.z64", 0xBA901A, 0xE .incbin "baserom.z64", 0xBA901A, 0xE
glabel D_80131E88 glabel sSoundModeNames
.incbin "baserom.z64", 0xBA9028, 0x34 .incbin "baserom.z64", 0xBA9028, 0x34
glabel D_80131EBC glabel sAudioIntInfoX
.incbin "baserom.z64", 0xBA905C, 0x4 .incbin "baserom.z64", 0xBA905C, 0x4
glabel D_80131EC0 glabel sAudioIntInfoY
.incbin "baserom.z64", 0xBA9060, 0x4 .incbin "baserom.z64", 0xBA9060, 0x4
glabel D_80131EC4 glabel sAudioIntInfoSel
.incbin "baserom.z64", 0xBA9064, 0x4 .incbin "baserom.z64", 0xBA9064, 0x4
glabel D_80131EC8 glabel sAudioIntInfoBankPage
.incbin "baserom.z64", 0xBA9068, 0x8 .incbin "baserom.z64", 0xBA9068, 0x8
glabel D_80131ED0 glabel sAudioScrPrtSel
.incbin "baserom.z64", 0xBA9070, 0x4 .incbin "baserom.z64", 0xBA9070, 0x4
glabel sAudioScreenPrintInd glabel sAudioScrPrtInd
.incbin "baserom.z64", 0xBA9074, 0x4 .incbin "baserom.z64", 0xBA9074, 0x4
glabel sAudioScreenPrintOverflow glabel sAudioScrPrtOverflow
.incbin "baserom.z64", 0xBA9078, 0x4 .incbin "baserom.z64", 0xBA9078, 0x4
glabel D_80131EDC glabel sAudioScrPrtX
.incbin "baserom.z64", 0xBA907C, 0x4 .incbin "baserom.z64", 0xBA907C, 0x4
glabel D_80131EE0 glabel sAudioScrPrtY
.incbin "baserom.z64", 0xBA9080, 0x4 .incbin "baserom.z64", 0xBA9080, 0x4
glabel D_80131EE4 glabel sAudioScrPrtWork
.incbin "baserom.z64", 0xBA9084, 0xC .incbin "baserom.z64", 0xBA9084, 0xC
glabel D_80131EF0 glabel sAudioScrPrtWorkLims
.incbin "baserom.z64", 0xBA9090, 0xC .incbin "baserom.z64", 0xBA9090, 0xC
glabel D_80131EFC glabel sAudioSubTrackInfoSpec
.incbin "baserom.z64", 0xBA909C, 0x4 .incbin "baserom.z64", 0xBA909C, 0x4
glabel D_80131F00 glabel sAudioSEFlagSwapIsEditing
.incbin "baserom.z64", 0xBA90A0, 0x4 .incbin "baserom.z64", 0xBA90A0, 0x4
glabel D_80131F04 glabel sAudioSEFlagSwapSel
.incbin "baserom.z64", 0xBA90A4, 0x4 .incbin "baserom.z64", 0xBA90A4, 0x4
glabel D_80131F08 glabel sAudioSEFlagSwapNibbleSel
.incbin "baserom.z64", 0xBA90A8, 0x4 .incbin "baserom.z64", 0xBA90A8, 0x4
glabel D_80131F0C glabel sAudioSEFlagSwapModeNames
.incbin "baserom.z64", 0xBA90AC, 0xC .incbin "baserom.z64", 0xBA90AC, 0xC
glabel D_80131F18 glabel sAudioSEParamChgSel
.incbin "baserom.z64", 0xBA90B8, 0x4 .incbin "baserom.z64", 0xBA90B8, 0x4
glabel D_80131F1C glabel sAudioSEParamChgBitSel
.incbin "baserom.z64", 0xBA90BC, 0x4 .incbin "baserom.z64", 0xBA90BC, 0x4
glabel D_80131F20 glabel sAudioSEParamChgWork
.incbin "baserom.z64", 0xBA90C0, 0x8 .incbin "baserom.z64", 0xBA90C0, 0x8
glabel D_80131F28 glabel sAudioSubTrackInfoPlayerSel
.incbin "baserom.z64", 0xBA90C8, 0x4 .incbin "baserom.z64", 0xBA90C8, 0x4
glabel D_80131F2C glabel sAudioSubTrackInfoChannelSel
.incbin "baserom.z64", 0xBA90CC, 0x4 .incbin "baserom.z64", 0xBA90CC, 0x4
glabel D_80131F30 glabel sSeqPlayerPeakNumLayers
.incbin "baserom.z64", 0xBA90D0, 0x14 .incbin "baserom.z64", 0xBA90D0, 0x14
glabel D_80131F44 glabel sAudioSceneNames
.incbin "baserom.z64", 0xBA90E4, 0x8 .incbin "baserom.z64", 0xBA90E4, 0x8
glabel D_80131F4C glabel sAudioBlkChgBgmWork
.incbin "baserom.z64", 0xBA90EC, 0x4 .incbin "baserom.z64", 0xBA90EC, 0x4
glabel D_80131F50 glabel sAudioBlkChgBgmSel
.incbin "baserom.z64", 0xBA90F0, 0x4 .incbin "baserom.z64", 0xBA90F0, 0x4
glabel D_80131F54 glabel sBoolStrs
.incbin "baserom.z64", 0xBA90F4, 0x10 .incbin "baserom.z64", 0xBA90F4, 0x10
glabel D_80131F64 glabel sAudioNatureFailed
.incbin "baserom.z64", 0xBA9104, 0x4 .incbin "baserom.z64", 0xBA9104, 0x4
glabel D_80131F68 glabel sPeakNumNotes
.incbin "baserom.z64", 0xBA9108, 0x4 .incbin "baserom.z64", 0xBA9108, 0x4
glabel D_80131F6C glabel D_80131F6C

View file

@ -30,7 +30,7 @@ glabel D_8016C820
glabel D_8016C8B0 glabel D_8016C8B0
.space 0xF0 .space 0xF0
glabel D_8016C9A0 glabel sSoundRequests
.space 0x1800 .space 0x1800
glabel D_8016E1A0 glabel D_8016E1A0
@ -48,19 +48,19 @@ glabel D_8016E1B8
glabel D_8016E260 glabel D_8016E260
.space 0x4 .space 0x4
glabel D_8016E264 glabel gSoundBankMuted
.space 0xC .space 0xC
glabel D_8016E270 glabel D_8016E270
.space 0x70 .space 0x70
glabel D_8016E2E0 glabel gAudioSEFlagSwapSource
.space 0x18 .space 0x18
glabel D_8016E2F8 glabel gAudioSEFlagSwapTarget
.space 0x18 .space 0x18
glabel D_8016E310 glabel gAudioSEFlagSwapMode
.space 0x10 .space 0x10
glabel D_8016E320 glabel D_8016E320

View file

@ -24,7 +24,7 @@ glabel D_8013340C
glabel D_80133410 glabel D_80133410
.incbin "baserom.z64", 0xBAA5B0, 0x4 .incbin "baserom.z64", 0xBAA5B0, 0x4
glabel D_80133414 glabel gAudioSpecId
.incbin "baserom.z64", 0xBAA5B4, 0x4 .incbin "baserom.z64", 0xBAA5B4, 0x4
glabel D_80133418 glabel D_80133418
@ -63,7 +63,7 @@ glabel D_801336F0
glabel D_80133738 glabel D_80133738
.incbin "baserom.z64", 0xBAA8D8, 0x90 .incbin "baserom.z64", 0xBAA8D8, 0x90
glabel gAudioSessionPresets glabel gAudioSpecs
.incbin "baserom.z64", 0xBAA968, 0xC .incbin "baserom.z64", 0xBAA968, 0xC
.word D_80133420 .word D_80133420
.incbin "baserom.z64", 0xBAA978, 0x34 .incbin "baserom.z64", 0xBAA978, 0x34

View file

@ -2003,7 +2003,7 @@ s32 Audio_SyncLoadSample(s32 arg0, s32 arg1, u8* arg2);
s32 Audio_SyncLoadSeq(s32 seqIdx, u8* ramAddr, u8* arg2); s32 Audio_SyncLoadSeq(s32 seqIdx, u8* ramAddr, u8* arg2);
void Audio_AsyncLoadReqInit(void); void Audio_AsyncLoadReqInit(void);
void func_800E4D94(void); void func_800E4D94(void);
void func_800E4EEC(s32 arg0, s32 arg1, u8* arg2); void func_800E4EEC(s32 tableType, s32 arg1, u8* arg2);
void func_800E4F58(void); void func_800E4F58(void);
void func_800E4FB0(void); void func_800E4FB0(void);
AudioTask* func_800E4FE0(void); AudioTask* func_800E4FE0(void);
@ -2074,92 +2074,50 @@ void Audio_ProcessSequence(SequencePlayer* seqPlayer);
void Audio_ResetSequencePlayer(SequencePlayer* seqPlayer); void Audio_ResetSequencePlayer(SequencePlayer* seqPlayer);
void func_800EC734(s32 seqPlayerIdx); void func_800EC734(s32 seqPlayerIdx);
void Audio_InitSequencePlayers(void); void Audio_InitSequencePlayers(void);
// ? Audio_GetOcaInput(?);
// ? Audio_OcaAdjStick(?);
// ? func_800ECAF0(?);
// ? Audio_OcaMapNoteValue(?);
// ? func_800ECB7C(?);
void func_800ECC04(u16); void func_800ECC04(u16);
// ? func_800ECDBC(?);
// ? func_800ECDF8(?);
// ? func_800ED200(?);
// ? func_800ED458(?);
void func_800ED858(u8); void func_800ED858(u8);
void func_800ED93C(s8 songIdx, s8 arg1); void func_800ED93C(s8 songIdx, s8 arg1);
// ? func_800EDA3C(?); void func_800EE170(u8);
// ? func_800EDD68(?); OcarinaStaff* func_800EE3C8(void);
// ? func_800EE170(?);
// ? func_800EE29C(?);
// ? func_800EE2D4(?);
// ? func_800EE318(?);
// ? func_800EE3C8(?);
OcarinaStaff* func_800EE3D4(void); OcarinaStaff* func_800EE3D4(void);
OcarinaStaff* Audio_OcaGetDisplayStaff(void); OcarinaStaff* Audio_OcaGetDisplayStaff(void);
// ? func_800EE404(?); void func_800EE57C(u8 minigameIdx);
// ? func_800EE57C(?); s32 func_800EE5EC(void);
// ? func_800EE5EC(?);
// ? func_800EE6F4(?);
void func_800EE824(void); void func_800EE824(void);
// ? func_800EE930(?); void AudioDebug_Draw(GfxPrint* printer);
// ? func_800EE97C(?); void AudioDebug_ScrPrt(const s8* str, u16 num);
// ? func_800EE9D0(?);
void func_800EEA50(GfxPrint* printer);
// ? func_800F1BDC(?);
// ? func_800F2150(?);
// ? func_800F227C(?);
// ? func_800F2464(?);
// ? func_800F27A0(?);
// ? func_800F28AC(?);
// ? func_800F28B4(?);
// ? func_800F29FC(?);
// ? func_800F2A04(?);
void func_800F2D6C(const s8* str, u16 num);
// ? func_800F2E28(?);
void func_800F3054(void); void func_800F3054(void);
// ? func_800F3188(?); void Audio_SetSoundProperties(u8 bankIdx, u8 entryIdx, u8 channelIdx);
// ? func_800F32F0(?);
// ? func_800F3468(?);
// ? func_800F35EC(?);
// ? func_800F37B8(?);
// ? func_800F3990(?);
void func_800F3A08(u8, u8, u8);
// ? func_800F3ED4(?);
void func_800F3F3C(u8); void func_800F3F3C(u8);
// ? func_800F3F84(?); void func_800F4010(Vec3f* pos, u16 sfxId, f32);
void func_800F4010(Vec3f*, u16 sfxId, f32); void Audio_PlaySoundRandom(Vec3f* pos, u16 baseSfxId, u8 randLim);
void func_800F41E0(Vec3f*, u16 sfxId, u8); void func_800F4138(Vec3f* pos, u16 sfxId, f32);
void func_800F4138(Vec3f*, u16 sfxId, f32); void func_800F4190(Vec3f* pos, u16 sfxId);
void func_800F4190(Vec3f*, u16 sfxId);
void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2);
void func_800F4414(Vec3f* pos, u16 sfxId, f32); void func_800F4414(Vec3f* pos, u16 sfxId, f32);
void func_800F44EC(s8 arg0, s8 arg1); void func_800F44EC(s8 arg0, s8 arg1);
void func_800F4524(Vec3f* arg0, u16 arg1, s8 arg2); void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2);
void func_800F4254(Vec3f* pos, u8 arg1); void func_800F4254(Vec3f* pos, u8 arg1);
void func_800F436C(Vec3f*, u16 sfxId, f32 arg2); void func_800F436C(Vec3f*, u16 sfxId, f32 arg2);
void func_800F4414(Vec3f*, u16 sfxId, f32 arg2); void func_800F4414(Vec3f*, u16 sfxId, f32 arg2);
void func_800F4634(Vec3f*, f32); void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale);
void func_800F46E0(Vec3f* pos, f32 arg0); void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale);
// ? func_800F4784(?);
void func_800F47BC(void); void func_800F47BC(void);
void func_800F47FC(void); void func_800F47FC(void);
void func_800F483C(u8 arg0, u8 arg1); void func_800F483C(u8 targetVol, u8 volFadeTimer);
void func_800F4870(u8); void func_800F4870(u8);
// ? func_800F491C(?);
void func_800F4A54(u8); void func_800F4A54(u8);
// ? func_800F4A70(?); void Audio_PlaySoundIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones);
void func_800F4B58(Vec3f*, s16, u8*); void Audio_ResetIncreasingTranspose(void);
void func_800F4BE8(void); void Audio_PlaySoundTransposed(Vec3f* pos, u16 sfxId, s8 semitone);
void func_800F4BF4(Vec3f*, u16 sfxId, s8); void func_800F4C58(Vec3f* pos, u16 sfxId, u8);
void func_800F4C58(Vec3f*, u16 sfxId, u8); void func_800F4E30(Vec3f* pos, f32);
void func_800F4E30(Vec3f*, f32); void Audio_ClearSariaBgm(void);
// ? func_800F50CC(?); void Audio_ClearSariaBgmAtPos(Vec3f* pos);
void* func_800F50EC(Vec3f*); void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax);
// ? func_800F510C(?); void Audio_ClearSariaBgm2(void);
void func_800F52A0(Vec3f*, u16, u16); void func_800F5510(u16 seqId);
void func_800F5504(); void func_800F5550(u16 seqId);
// ? func_800F5510(?);
// ? func_800F5550(?);
// ? func_800F56A8(?);
void func_800F574C(f32 arg0, u8 arg2); void func_800F574C(f32 arg0, u8 arg2);
void func_800F5718(void); void func_800F5718(void);
void func_800F5918(void); void func_800F5918(void);
@ -2171,21 +2129,19 @@ void func_800F5B58(void);
void func_800F5BF0(u8 arg0); void func_800F5BF0(u8 arg0);
void func_800F5C64(u16); void func_800F5C64(u16);
void func_800F5C2C(void); void func_800F5C2C(void);
// ? func_800F5CF8(?); void func_800F5E18(u8 seqIdx, u16 seqId, u8 fadeTimer, s8 arg3, s8 arg4);
// ? func_800F5E18(?);
void func_800F5E90(u8); void func_800F5E90(u8);
void func_800F6114(f32); void func_800F6114(f32 dist);
void func_800F6268(f32, u16); void func_800F6268(f32 dist, u16);
void func_800F64E0(u8 arg0); void func_800F64E0(u8 arg0);
void func_800F6584(u8 arg0); void func_800F6584(u8 arg0);
void func_800F66C0(s8 echo); void Audio_SetEnvReverb(s8 reverb);
void func_800F66DC(s8); void Audio_SetCodeReverb(s8 reverb);
void func_800F6700(s8 outputMode); void func_800F6700(s8 outputMode);
void func_800F67A0(u8); void func_800F67A0(u8);
void func_800F6828(u8); void func_800F6828(u8);
void func_800F68BC(s8); void Audio_SetCutsceneFlag(s8 flag);
// ? func_800F68D4(?); void Audio_PlaySoundIfNotInCutscene(u16 sfxId);
// ? func_800F691C(?);
void func_800F6964(u16); void func_800F6964(u16);
void func_800F6AB0(u16); void func_800F6AB0(u16);
// ? Audio_DisableAllSeq(?); // ? Audio_DisableAllSeq(?);
@ -2199,12 +2155,11 @@ void func_800F70F8();
void func_800F711C(); void func_800F711C();
void func_800F7170(void); void func_800F7170(void);
// ? func_800F71BC(?); // ? func_800F71BC(?);
void func_800F7260(u16); void Audio_SetSoundBanksMute(u16 muteMask);
void Audio_QueueSeqCmdMute(u8); void Audio_QueueSeqCmdMute(u8);
void Audio_ClearBGMMute(u8); void Audio_ClearBGMMute(u8);
void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* a1, u8 a2, f32* a3, f32* a4, s8* a5); void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 a2, f32* freqScale, f32* a4, s8* reverbAdd);
// ? func_800F74E0(?); void Audio_ProcessSoundRequest(void);
void func_800F7680(void);
void func_800F7B54(u8, u8); void func_800F7B54(u8, u8);
void func_800F7CEC(u8); void func_800F7CEC(u8);
void func_800F8480(u8); void func_800F8480(u8);
@ -2219,18 +2174,18 @@ s32 func_800FA11C(u32, u32);
void func_800F8A44(Vec3f* pos, u16 sfxId); void func_800F8A44(Vec3f* pos, u16 sfxId);
void func_800F8BA0(u8, u16); void func_800F8BA0(u8, u16);
void Audio_StopSfx(u32 sfxId); void Audio_StopSfx(u32 sfxId);
void func_800F8E3C(void); void Audio_ProcessSoundRequests(void);
void func_800F8EA0(u8, u8, u16); void func_800F8EA0(u8, u8, u16);
void func_800F8F34(u8); void func_800F8F34(u8);
void func_800F8F88(void); void func_800F8F88(void);
u8 func_800F8FF4(u32 sfxId); u8 Audio_IsSfxPlaying(u32 sfxId);
void func_800F905C(void); void func_800F905C(void);
void func_800F9474(u8, u16); void func_800F9474(u8, u16);
void Audio_ProcessSeqCmd(u32); void Audio_ProcessSeqCmd(u32);
void Audio_ProcessSeqCmds(void); void Audio_ProcessSeqCmds(void);
void func_800FA174(u8); void func_800FA174(u8);
void func_800FA18C(u8, u8); void func_800FA18C(u8, u8);
void Audio_SetVolScale(u8, u8, u8, u8); void Audio_SetVolScale(u8 seqIdx, u8 scaleIdx, u8 targetVol, u8 volFadeTimer);
void func_800FA3DC(void); void func_800FA3DC(void);
u8 func_800FAD34(void); u8 func_800FAD34(void);
void func_800FADF8(void); void func_800FADF8(void);
@ -2248,8 +2203,8 @@ void GfxPrint_Init(GfxPrint*);
void GfxPrint_Destroy(GfxPrint*); void GfxPrint_Destroy(GfxPrint*);
void GfxPrint_Open(GfxPrint*, Gfx*); void GfxPrint_Open(GfxPrint*, Gfx*);
Gfx* GfxPrint_Close(GfxPrint*); Gfx* GfxPrint_Close(GfxPrint*);
void GfxPrint_VPrintf(GfxPrint*, const char*, va_list); s32 GfxPrint_VPrintf(GfxPrint*, const char*, va_list);
void GfxPrint_Printf(GfxPrint*, const char*, ...); s32 GfxPrint_Printf(GfxPrint*, const char*, ...);
void func_800FBCE0(); void func_800FBCE0();
void func_800FBFD8(void); void func_800FBFD8(void);
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd); void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd);
@ -2356,8 +2311,8 @@ void __osDisplayArena(Arena* arena);
void ArenaImpl_FaultClient(Arena* arena); void ArenaImpl_FaultClient(Arena* arena);
u32 __osCheckArena(Arena* arena); u32 __osCheckArena(Arena* arena);
u8 func_800FF334(Arena* arena); u8 func_800FF334(Arena* arena);
void PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args);
void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...);
void Sleep_Cycles(OSTime cycles); void Sleep_Cycles(OSTime cycles);
void Sleep_Nsec(u32 nsec); void Sleep_Nsec(u32 nsec);
void Sleep_Usec(u32 usec); void Sleep_Usec(u32 usec);

View file

@ -374,24 +374,17 @@ extern s32 D_80130514;
extern u8 D_80130570[8]; extern u8 D_80130570[8];
extern u8 D_80130578[4][7]; extern u8 D_80130578[4][7];
extern u8 D_80130594[4][7]; extern u8 D_80130594[4][7];
//extern ? D_801305B0;
//extern ? D_801305B4; //extern ? D_801305B4;
//extern ? D_801305B8; //extern ? D_801305B8;
//extern ? D_801305BC; //extern ? D_801305BC;
//extern ? D_801305C0; //extern ? D_801305C0;
//extern ? D_801305CC; extern u8 gMorphaTransposeTable[16];
extern u8 D_801305D0[];
//extern ? D_801305E0; //extern ? D_801305E0;
//extern ? D_801305F4; //extern ? D_801305F4;
//extern ? D_80130600; //extern ? D_80130600;
//extern ? D_80130604; //extern ? D_80130604;
//extern ? D_80130608; //extern ? D_80130608;
//extern ? D_8013060C;
//extern ? D_80130610;
//extern ? D_80130614;
//extern ? D_80130618;
//extern ? D_8013061C; //extern ? D_8013061C;
//extern ? D_80130624;
//extern ? D_80130628; //extern ? D_80130628;
//extern ? D_8013062C; //extern ? D_8013062C;
//extern ? D_80130630; //extern ? D_80130630;
@ -401,7 +394,6 @@ extern u8 D_801305D0[];
//extern ? D_80130640; //extern ? D_80130640;
//extern ? D_80130644; //extern ? D_80130644;
//extern ? D_80130648; //extern ? D_80130648;
//extern ? D_8013064C;
//extern ? D_80130650; //extern ? D_80130650;
//extern ? D_80130654; //extern ? D_80130654;
//extern ? D_80130658; //extern ? D_80130658;
@ -462,52 +454,11 @@ extern OcarinaSongInfo gOcarinaSongNotes[];
//extern ? D_80131C80; //extern ? D_80131C80;
//extern ? D_80131C84; //extern ? D_80131C84;
//extern ? D_80131C88; //extern ? D_80131C88;
//extern ? D_80131C90;
//extern ? D_80131C94;
//extern ? D_80131C98;
//extern ? D_80131C9C;
//extern ? D_80131CA0;
//extern ? D_80131CA4;
//extern ? D_80131CA8;
//extern ? D_80131CAC;
//extern ? D_80131E08;
//extern ? D_80131E20;
//extern ? D_80131E38;
//extern ? D_80131E88;
//extern ? D_80131EBC;
//extern ? D_80131EC0;
//extern ? D_80131EC4;
//extern ? D_80131EC8;
//extern ? D_80131ED0;
//extern ? sAudioScreenPrintInd;
//extern ? sAudioScreenPrintOverflow;
//extern ? D_80131EDC;
//extern ? D_80131EE0;
//extern ? D_80131EE4;
//extern ? D_80131EFC;
//extern ? D_80131F00;
//extern ? D_80131F04;
//extern ? D_80131F08;
//extern ? D_80131F0C;
//extern ? D_80131F18;
//extern ? D_80131F1C;
//extern ? D_80131F20;
//extern ? D_80131F28;
//extern ? D_80131F2C;
//extern ? D_80131F30;
//extern ? D_80131F44;
//extern ? D_80131F4C;
//extern ? D_80131F50;
//extern ? D_80131F54;
//extern ? D_80131F64;
//extern ? D_80131F68;
//extern ? D_80131F6C; //extern ? D_80131F6C;
extern Struct_8013331C *D_8013331C[]; extern Struct_8013331C *D_8013331C[];
//extern ? D_80133344; //extern ? D_80133344;
extern char D_80133390[]; extern char D_80133390[];
extern char D_80133398[]; extern char D_80133398[];
extern u8 D_801333A0;
extern u8 D_801333A4;
extern SoundBankEntry* gSoundBanks[7]; extern SoundBankEntry* gSoundBanks[7];
extern u8 sBankSizes[7]; extern u8 sBankSizes[7];
extern u8 D_801333CC; extern u8 D_801333CC;
@ -516,15 +467,15 @@ extern Vec3f D_801333D4;
extern f32 D_801333E0; extern f32 D_801333E0;
extern s8 D_801333E8; extern s8 D_801333E8;
extern u8 D_801333F0; extern u8 D_801333F0;
extern u8 D_801333F4; extern u8 gAudioSEFlagSwapOff;
extern u8 D_801333F8; extern u8 D_801333F8;
//extern ? sSeqCmdWrPos; //extern ? sSeqCmdWrPos;
//extern ? sSeqCmdRdPos; //extern ? sSeqCmdRdPos;
//extern ? D_80133408; //extern ? D_80133408;
//extern ? D_8013340C; //extern ? D_8013340C;
//extern ? D_80133414; extern u8 gAudioSpecId;
//extern ? D_80133418; //extern ? D_80133418;
extern AudioSessionSettings gAudioSessionPresets[18]; extern AudioSpec gAudioSpecs[18];
extern s32 gOverlayLogSeverity; extern s32 gOverlayLogSeverity;
//extern ? D_80134480; //extern ? D_80134480;
//extern ? D_80134484; //extern ? D_80134484;
@ -3213,26 +3164,19 @@ extern OSMesgQueue D_8016B6E0;
//extern OSMesg D_8016B6F8; //extern OSMesg D_8016B6F8;
extern u8* D_8016B738[]; extern u8* D_8016B738[];
//extern u32 D_8016B780; //extern u32 D_8016B780;
//extern ? sAudioUpdateStartTime;
//extern ? sAudioUpdateEndTime;
//extern ? D_8016B7A8; //extern ? D_8016B7A8;
//extern ? D_8016B7AC; //extern ? D_8016B7AC;
//extern ? D_8016B7B0; //extern ? D_8016B7B0;
//extern ? D_8016B7B8;
//extern ? D_8016B7C8;
//extern ? D_8016B7D8; //extern ? D_8016B7D8;
//extern ? D_8016B7DC; //extern ? D_8016B7DC;
//extern ? D_8016B7E0; //extern ? D_8016B7E0;
//extern ? sAudioScreenPrintBuf;
//extern ? D_8016B8B0; //extern ? D_8016B8B0;
//extern ? D_8016B8B1; //extern ? D_8016B8B1;
//extern ? D_8016B8B2; //extern ? D_8016B8B2;
//extern ? D_8016B8B3; //extern ? D_8016B8B3;
//extern ? D_8016B8B4;
//extern ? D_8016B8B8; //extern ? D_8016B8B8;
//extern ? D_8016B9B8; //extern ? D_8016B9B8;
//extern ? D_8016B9D8; //extern ? D_8016B9D8;
//extern ? D_8016B9E0;
//extern ? D_8016B9F2; //extern ? D_8016B9F2;
//extern ? D_8016B9F3; //extern ? D_8016B9F3;
//extern ? D_8016B9F4; //extern ? D_8016B9F4;
@ -3243,27 +3187,12 @@ extern u8* D_8016B738[];
//extern ? D_8016BA04; //extern ? D_8016BA04;
//extern ? D_8016BA08; //extern ? D_8016BA08;
//extern ? D_8016BA09; //extern ? D_8016BA09;
//extern ? sCurOcarinaBtnPress;
//extern ? D_8016BA10; //extern ? D_8016BA10;
//extern ? sPrevOcarinaBtnPress;
//extern ? D_8016BA18; //extern ? D_8016BA18;
//extern ? sCurOcarinaSong;
//extern ? sOcarinaSongAppendPos;
//extern ? sOcarinaHasStartedSong;
//extern ? gOcarinaSongNotestartIdx;
//extern ? sOcarinaSongCnt;
//extern ? sOcarinaAvailSongs;
//extern ? D_8016BA2E; //extern ? D_8016BA2E;
//extern ? D_8016BA50; //extern ? D_8016BA50;
//extern ? D_8016BA70; //extern ? D_8016BA70;
//extern ? sLearnSongExpectedNote;
//extern ? D_8016BAA0; //extern ? D_8016BAA0;
//extern ? D_8016BAA8;
//extern ? D_8016BAB0;
//extern ? sDebugPadPressRaw;
//extern ? sDebugPadPress;
//extern ? sAudioUpdateTaskStart;
//extern ? sAudioUpdateTaskEnd;
extern SoundBankEntry D_8016BAD0[9]; extern SoundBankEntry D_8016BAD0[9];
extern SoundBankEntry D_8016BC80[12]; extern SoundBankEntry D_8016BC80[12];
extern SoundBankEntry D_8016BEC0[22]; extern SoundBankEntry D_8016BEC0[22];
@ -3271,20 +3200,18 @@ extern SoundBankEntry D_8016C2E0[20];
extern SoundBankEntry D_8016C6A0[8]; extern SoundBankEntry D_8016C6A0[8];
extern SoundBankEntry D_8016C820[3]; extern SoundBankEntry D_8016C820[3];
extern SoundBankEntry D_8016C8B0[5]; extern SoundBankEntry D_8016C8B0[5];
//extern ? D_8016C9A0;
extern u8 D_8016E1A0[7]; extern u8 D_8016E1A0[7];
extern u8 D_8016E1A8[7]; extern u8 D_8016E1A8[7];
extern u8 D_8016E1B0[7]; extern u8 D_8016E1B0[7];
extern Struct_800F7CEC D_8016E1B8[7][3]; // total size = 0xA8 extern Struct_800F7CEC D_8016E1B8[7][3]; // total size = 0xA8
extern u8 D_8016E260; extern u8 D_8016E260;
extern u8 D_8016E264[]; extern u8 gSoundBankMuted[];
//extern ? D_8016E270; //extern ? D_8016E270;
extern u16 D_8016E2E0[]; extern u16 gAudioSEFlagSwapSource[10];
extern u16 D_8016E2F8[]; extern u16 gAudioSEFlagSwapTarget[10];
extern u8 D_8016E310[]; extern u8 gAudioSEFlagSwapMode[10];
//extern ? D_8016E320; //extern ? D_8016E320;
//extern ? D_8016E348; //extern ? D_8016E348;
//extern ? sAudioSeqCmds;
extern unk_D_8016E750 D_8016E750[4]; extern unk_D_8016E750 D_8016E750[4];
//extern ? D_8016EE8B; //extern ? D_8016EE8B;
extern AudioContext gAudioContext; // at 0x8016F180 extern AudioContext gAudioContext; // at 0x8016F180

View file

@ -273,7 +273,7 @@ typedef struct {
/*?0x148 */ u32 bankDmaCurrDevAddr; /*?0x148 */ u32 bankDmaCurrDevAddr;
/*?0x14C */ s32 bankDmaRemaining; /*?0x14C */ s32 bankDmaRemaining;
/* */ u8 pad_150[8]; /* */ u8 pad_150[8];
/* 0x158 */ s8 unk_158[8]; // seqVariationEu? soundScriptIO? /* 0x158 */ s8 unk_158[8]; // "port" according to debug strings. seqVariationEu? soundScriptIO?
} SequencePlayer; // size = 0x160 } SequencePlayer; // size = 0x160
typedef struct { typedef struct {
@ -592,10 +592,10 @@ typedef struct {
/* 0x2C */ u32 temporaryUnusedMem; /* 0x2C */ u32 temporaryUnusedMem;
/* 0x30 */ s32 unk_30; /* 0x30 */ s32 unk_30;
/* 0x34 */ s32 unk_34; /* 0x34 */ s32 unk_34;
} AudioSessionSettings; // size = 0x38 } AudioSpec; // size = 0x38
typedef struct { typedef struct {
/* 0x00 */ s16 presetUnk4; /* 0x00 */ s16 specUnk4;
/* 0x02 */ u16 frequency; /* 0x02 */ u16 frequency;
/* 0x04 */ u16 aiFrequency; /* 0x04 */ u16 aiFrequency;
/* 0x06 */ s16 samplesPerFrameTarget; /* 0x06 */ s16 samplesPerFrameTarget;
@ -836,7 +836,7 @@ typedef struct {
typedef struct { typedef struct {
/* 0x0000 */ OSTask task; /* 0x0000 */ OSTask task;
/* 0x0040 */ OSMesgQueue* taskQueue; /* 0x0040 */ OSMesgQueue* taskQueue;
/* 0x0044 */ void* unk_44; // probbly a message that gets unused. /* 0x0044 */ void* unk_44; // probably a message that gets unused.
/* 0x0048 */ char unk_48[0x8]; /* 0x0048 */ char unk_48[0x8];
} AudioTask; // size = 0x50 } AudioTask; // size = 0x50
@ -861,9 +861,9 @@ typedef struct {
} RelocInfo; } RelocInfo;
typedef enum { typedef enum {
SEQUENCE_TABLE, /* 0 */ SEQUENCE_TABLE,
BANK_TABLE, /* 1 */ BANK_TABLE,
AUDIO_TABLE /* 2 */ AUDIO_TABLE
} AudioTableType; } AudioTableType;
typedef struct { typedef struct {
@ -976,7 +976,7 @@ typedef struct {
/* 0x3468 */ u8 bankLoadStatus[0x30]; /* 0x3468 */ u8 bankLoadStatus[0x30];
/* 0x3498 */ u8 seqLoadStatus[0x80]; /* 0x3498 */ u8 seqLoadStatus[0x80];
/* 0x3518 */ volatile u8 resetStatus; /* 0x3518 */ volatile u8 resetStatus;
/* 0x3519 */ u8 audioResetPresetIdToLoad; /* 0x3519 */ u8 audioResetSpecIdToLoad;
/* 0x351C */ s32 audioResetFadeOutFramesLeft; /* 0x351C */ s32 audioResetFadeOutFramesLeft;
/* 0x3520 */ f32* unk_3520; /* 0x3520 */ f32* unk_3520;
/* 0x3524 */ u8* audioHeap; /* 0x3524 */ u8* audioHeap;
@ -1068,13 +1068,13 @@ typedef struct {
} unk_D_8016E750; // size = 0x264 } unk_D_8016E750; // size = 0x264
typedef enum { typedef enum {
BANK_PLAYER, /* 0 */ BANK_PLAYER,
BANK_ITEM, /* 1 */ BANK_ITEM,
BANK_ENV, /* 2 */ BANK_ENV,
BANK_ENEMY, /* 3 */ BANK_ENEMY,
BANK_SYSTEM, /* 4 */ BANK_SYSTEM,
BANK_OCARINA, /* 5 */ BANK_OCARINA,
BANK_VOICE /* 6 */ BANK_VOICE
} SoundBankTypes; } SoundBankTypes;
typedef struct { typedef struct {
@ -1082,18 +1082,18 @@ typedef struct {
/* 0x04 */ f32* posY; /* 0x04 */ f32* posY;
/* 0x08 */ f32* posZ; /* 0x08 */ f32* posZ;
/* 0x0C */ u8 unk_C; /* 0x0C */ u8 unk_C;
/* 0x10 */ f32* unk_10; /* 0x10 */ f32* freqScale;
/* 0x14 */ f32* unk_14; /* 0x14 */ f32* unk_14;
/* 0x18 */ s8* unk_18; /* 0x18 */ s8* reverbAdd;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 dist;
/* 0x20 */ u32 unk_20; /* 0x20 */ u32 unk_20;
/* 0x24 */ u8 unk_24; /* 0x24 */ u8 unk_24;
/* 0x26 */ u16 unk_26; /* 0x26 */ u16 unk_26;
/* 0x28 */ u16 unk_28; // "flag" /* 0x28 */ u16 unk_28; // "flag"
/* 0x2A */ u8 unk_2A; /* 0x2A */ u8 unk_2A;
/* 0x2B */ u8 unk_2B; /* 0x2B */ u8 unk_2B;
/* 0x2C */ u8 prev; // prev bank index /* 0x2C */ u8 prev;
/* 0x2D */ u8 next; // next bank index /* 0x2D */ u8 next;
/* 0x2E */ u8 unk_2E; /* 0x2E */ u8 unk_2E;
/* 0x2F */ u8 unk_2F; /* 0x2F */ u8 unk_2F;
} SoundBankEntry; // size = 0x30 } SoundBankEntry; // size = 0x30

View file

@ -673,7 +673,7 @@ void func_800DF7C4(void) {
s32 i; s32 i;
s32 j; s32 j;
if (gAudioContext.audioBufferParameters.presetUnk4 == 2) { if (gAudioContext.audioBufferParameters.specUnk4 == 2) {
count = 2; count = 2;
} else { } else {
count = 1; count = 1;
@ -703,7 +703,7 @@ s32 Audio_ResetStep(void) {
s32 j; s32 j;
s32 sp24; s32 sp24;
if (gAudioContext.audioBufferParameters.presetUnk4 == 2) { if (gAudioContext.audioBufferParameters.specUnk4 == 2) {
sp24 = 2; sp24 = 2;
} else { } else {
sp24 = 1; sp24 = 1;
@ -787,11 +787,11 @@ void Audio_InitHeap(void) {
s32 i; s32 i;
s32 j; s32 j;
s32 pad2; s32 pad2;
AudioSessionSettings* preset = &gAudioSessionPresets[gAudioContext.audioResetPresetIdToLoad]; AudioSpec* spec;
preset = &gAudioSessionPresets[gAudioContext.audioResetPresetIdToLoad]; spec = &gAudioSpecs[gAudioContext.audioResetSpecIdToLoad];
gAudioContext.sampleDmaReqCnt = 0; gAudioContext.sampleDmaReqCnt = 0;
gAudioContext.audioBufferParameters.frequency = preset->frequency; gAudioContext.audioBufferParameters.frequency = spec->frequency;
gAudioContext.audioBufferParameters.aiFrequency = osAiSetFrequency(gAudioContext.audioBufferParameters.frequency); gAudioContext.audioBufferParameters.aiFrequency = osAiSetFrequency(gAudioContext.audioBufferParameters.frequency);
gAudioContext.audioBufferParameters.samplesPerFrameTarget = gAudioContext.audioBufferParameters.samplesPerFrameTarget =
((gAudioContext.audioBufferParameters.frequency / gAudioContext.refreshRate) + 0xF) & 0xFFF0; ((gAudioContext.audioBufferParameters.frequency / gAudioContext.refreshRate) + 0xF) & 0xFFF0;
@ -811,15 +811,15 @@ void Audio_InitHeap(void) {
(1.0f / 256.0f) / gAudioContext.audioBufferParameters.updatesPerFrame; (1.0f / 256.0f) / gAudioContext.audioBufferParameters.updatesPerFrame;
gAudioContext.audioBufferParameters.unk_24 = gAudioContext.audioBufferParameters.updatesPerFrame * 0.25f; gAudioContext.audioBufferParameters.unk_24 = gAudioContext.audioBufferParameters.updatesPerFrame * 0.25f;
gAudioContext.audioBufferParameters.updatesPerFrameInv = 1.0f / gAudioContext.audioBufferParameters.updatesPerFrame; gAudioContext.audioBufferParameters.updatesPerFrameInv = 1.0f / gAudioContext.audioBufferParameters.updatesPerFrame;
gAudioContext.unk_2874 = preset->unk_10; gAudioContext.unk_2874 = spec->unk_10;
gAudioContext.unk_2878 = preset->unk_12; gAudioContext.unk_2878 = spec->unk_12;
gAudioContext.maxSimultaneousNotes = preset->maxSimultaneousNotes; gAudioContext.maxSimultaneousNotes = spec->maxSimultaneousNotes;
gAudioContext.audioBufferParameters.numSequencePlayers = preset->numSequencePlayers; gAudioContext.audioBufferParameters.numSequencePlayers = spec->numSequencePlayers;
if (gAudioContext.audioBufferParameters.numSequencePlayers > 4) { if (gAudioContext.audioBufferParameters.numSequencePlayers > 4) {
gAudioContext.audioBufferParameters.numSequencePlayers = 4; gAudioContext.audioBufferParameters.numSequencePlayers = 4;
} }
gAudioContext.unk_2 = preset->unk_14; gAudioContext.unk_2 = spec->unk_14;
gAudioContext.tempoInternalToExternal = (u32)(gAudioContext.audioBufferParameters.updatesPerFrame * 2880000.0f / gAudioContext.tempoInternalToExternal = (u32)(gAudioContext.audioBufferParameters.updatesPerFrame * 2880000.0f /
gTatumsPerBeat / gAudioContext.unk_2960); gTatumsPerBeat / gAudioContext.unk_2960);
@ -828,22 +828,22 @@ void Audio_InitHeap(void) {
gAudioContext.unk_2870 /= gAudioContext.audioBufferParameters.aiFrequency; gAudioContext.unk_2870 /= gAudioContext.audioBufferParameters.aiFrequency;
gAudioContext.unk_2870 /= gAudioContext.tempoInternalToExternal; gAudioContext.unk_2870 /= gAudioContext.tempoInternalToExternal;
gAudioContext.audioBufferParameters.presetUnk4 = preset->unk_04; gAudioContext.audioBufferParameters.specUnk4 = spec->unk_04;
gAudioContext.audioBufferParameters.samplesPerFrameTarget *= gAudioContext.audioBufferParameters.presetUnk4; gAudioContext.audioBufferParameters.samplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.maxAiBufferLength *= gAudioContext.audioBufferParameters.presetUnk4; gAudioContext.audioBufferParameters.maxAiBufferLength *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.minAiBufferLength *= gAudioContext.audioBufferParameters.presetUnk4; gAudioContext.audioBufferParameters.minAiBufferLength *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.updatesPerFrame *= gAudioContext.audioBufferParameters.presetUnk4; gAudioContext.audioBufferParameters.updatesPerFrame *= gAudioContext.audioBufferParameters.specUnk4;
if (gAudioContext.audioBufferParameters.presetUnk4 >= 2) { if (gAudioContext.audioBufferParameters.specUnk4 >= 2) {
gAudioContext.audioBufferParameters.maxAiBufferLength -= 0x10; gAudioContext.audioBufferParameters.maxAiBufferLength -= 0x10;
} }
gAudioContext.maxAudioCmds = gAudioContext.maxAudioCmds =
gAudioContext.maxSimultaneousNotes * 0x10 * gAudioContext.audioBufferParameters.updatesPerFrame + gAudioContext.maxSimultaneousNotes * 0x10 * gAudioContext.audioBufferParameters.updatesPerFrame +
preset->numReverbs * 0x18 + 0x140; spec->numReverbs * 0x18 + 0x140;
persistentMem = preset->persistentSeqMem + preset->persistentBankMem + preset->persistentUnusedMem + 0x10; persistentMem = spec->persistentSeqMem + spec->persistentBankMem + spec->persistentUnusedMem + 0x10;
temporaryMem = preset->temporarySeqMem + preset->temporaryBankMem + preset->temporaryUnusedMem + 0x10; temporaryMem = spec->temporarySeqMem + spec->temporaryBankMem + spec->temporaryUnusedMem + 0x10;
totalMem = persistentMem + temporaryMem; totalMem = persistentMem + temporaryMem;
wantMisc = gAudioContext.audioSessionPool.size - totalMem - 0x100; wantMisc = gAudioContext.audioSessionPool.size - totalMem - 0x100;
@ -857,13 +857,13 @@ void Audio_InitHeap(void) {
gAudioContext.seqAndBankPoolSplit.wantPersistent = persistentMem; gAudioContext.seqAndBankPoolSplit.wantPersistent = persistentMem;
gAudioContext.seqAndBankPoolSplit.wantTemporary = temporaryMem; gAudioContext.seqAndBankPoolSplit.wantTemporary = temporaryMem;
Audio_SeqAndBankPoolInit(&gAudioContext.seqAndBankPoolSplit); Audio_SeqAndBankPoolInit(&gAudioContext.seqAndBankPoolSplit);
gAudioContext.persistentCommonPoolSplit.wantSeq = preset->persistentSeqMem; gAudioContext.persistentCommonPoolSplit.wantSeq = spec->persistentSeqMem;
gAudioContext.persistentCommonPoolSplit.wantBank = preset->persistentBankMem; gAudioContext.persistentCommonPoolSplit.wantBank = spec->persistentBankMem;
gAudioContext.persistentCommonPoolSplit.wantUnused = preset->persistentUnusedMem; gAudioContext.persistentCommonPoolSplit.wantUnused = spec->persistentUnusedMem;
Audio_PersistentPoolsInit(&gAudioContext.persistentCommonPoolSplit); Audio_PersistentPoolsInit(&gAudioContext.persistentCommonPoolSplit);
gAudioContext.temporaryCommonPoolSplit.wantSeq = preset->temporarySeqMem; gAudioContext.temporaryCommonPoolSplit.wantSeq = spec->temporarySeqMem;
gAudioContext.temporaryCommonPoolSplit.wantBank = preset->temporaryBankMem; gAudioContext.temporaryCommonPoolSplit.wantBank = spec->temporaryBankMem;
gAudioContext.temporaryCommonPoolSplit.wantUnused = preset->temporaryUnusedMem; gAudioContext.temporaryCommonPoolSplit.wantUnused = spec->temporaryUnusedMem;
Audio_TemporaryPoolsInit(&gAudioContext.temporaryCommonPoolSplit); Audio_TemporaryPoolsInit(&gAudioContext.temporaryCommonPoolSplit);
Audio_ResetLoadStatus(); Audio_ResetLoadStatus();
@ -886,9 +886,9 @@ void Audio_InitHeap(void) {
gAudioContext.synthesisReverbs[i].useReverb = 0; gAudioContext.synthesisReverbs[i].useReverb = 0;
} }
gAudioContext.numSynthesisReverbs = preset->numReverbs; gAudioContext.numSynthesisReverbs = spec->numReverbs;
for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) { for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) {
ReverbSettings* settings = &preset->reverbSettings[i]; ReverbSettings* settings = &spec->reverbSettings[i];
SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[i]; SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[i];
reverb->downsampleRate = settings->downsampleRate; reverb->downsampleRate = settings->downsampleRate;
reverb->windowSize = settings->windowSize * 64; reverb->windowSize = settings->windowSize * 64;
@ -961,7 +961,7 @@ void Audio_InitHeap(void) {
Audio_ResetSequencePlayer(&gAudioContext.seqPlayers[j]); Audio_ResetSequencePlayer(&gAudioContext.seqPlayers[j]);
} }
func_800E0634(preset->unk_30, preset->unk_34); func_800E0634(spec->unk_30, spec->unk_34);
func_800E1618(gAudioContext.maxSimultaneousNotes); func_800E1618(gAudioContext.maxSimultaneousNotes);
gAudioContext.unk_176C = 0; gAudioContext.unk_176C = 0;
Audio_SyncLoadsInit(); Audio_SyncLoadsInit();

View file

@ -7,7 +7,7 @@ typedef enum { LOAD_STATUS_WAITING, LOAD_STATUS_START, LOAD_STATUS_LOADING, LOAD
/* forward declarations */ /* forward declarations */
s32 func_800E217C(s32 playerIdx, s32, s32); s32 func_800E217C(s32 playerIdx, s32, s32);
unk_ldr* func_800E2454(u32 arg0); unk_ldr* func_800E2454(u32 bankId);
AudioBankSample* Audio_GetBankSample(s32 bankId, s32 sfxId); AudioBankSample* Audio_GetBankSample(s32 bankId, s32 sfxId);
void Audio_ProcessAsyncLoads(s32 arg0); void Audio_ProcessAsyncLoads(s32 arg0);
void Audio_HandleAsyncMsg(AsyncLoadReq* arg0, s32 arg1); void Audio_HandleAsyncMsg(AsyncLoadReq* arg0, s32 arg1);
@ -16,7 +16,7 @@ void func_800E4198(s32, unk_ldr*, RelocInfo*, s32);
void Audio_SampleReloc(AudioBankSound* sound, u32, RelocInfo*); void Audio_SampleReloc(AudioBankSound* sound, u32, RelocInfo*);
void func_800E202C(s32 arg0); void func_800E202C(s32 arg0);
u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2); u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2);
u8* func_800E2558(u32 tableType, u32 bankId, s32* didAllocate); u8* func_800E2558(u32 tableType, u32 tableIdx, s32* didAllocate);
u32 Audio_GetTableIndex(s32 tableType, u32 tableIdx); u32 Audio_GetTableIndex(s32 tableType, u32 tableIdx);
void* func_800E27A4(s32 tableType, s32 id); void* func_800E27A4(s32 tableType, s32 id);
void* Audio_GetLoadTable(s32 tableType); void* Audio_GetLoadTable(s32 tableType);
@ -83,8 +83,8 @@ void func_800E1618(s32 arg0) {
gAudioContext.unk_288C = gAudioContext.unk_2874; gAudioContext.unk_288C = gAudioContext.unk_2874;
gAudioContext.sampleDmaReqs = gAudioContext.sampleDmaReqs =
Audio_Alloc(&gAudioContext.notesAndBuffersPool, 4 * gAudioContext.maxSimultaneousNotes * sizeof(SampleDmaReq) * Audio_Alloc(&gAudioContext.notesAndBuffersPool, 4 * gAudioContext.maxSimultaneousNotes * sizeof(SampleDmaReq) *
gAudioContext.audioBufferParameters.presetUnk4); gAudioContext.audioBufferParameters.specUnk4);
t2 = 3 * gAudioContext.maxSimultaneousNotes * gAudioContext.audioBufferParameters.presetUnk4; t2 = 3 * gAudioContext.maxSimultaneousNotes * gAudioContext.audioBufferParameters.specUnk4;
for (i = 0; i < t2; i++) { for (i = 0; i < t2; i++) {
temp_s0 = &gAudioContext.sampleDmaReqs[gAudioContext.sampleDmaReqCnt]; temp_s0 = &gAudioContext.sampleDmaReqs[gAudioContext.sampleDmaReqCnt];
temp_s0->ramAddr = func_800DE2B0(&gAudioContext.notesAndBuffersPool, gAudioContext.unk_288C); temp_s0->ramAddr = func_800DE2B0(&gAudioContext.notesAndBuffersPool, gAudioContext.unk_288C);
@ -310,8 +310,8 @@ s32 func_800E1D64(s32 arg0, s32 arg1, s32 arg2) {
} }
} }
void Audio_AsyncLoad(s32 arg0, s32 arg1, s32 arg2, s32 arg3, OSMesgQueue* queue) { void Audio_AsyncLoad(s32 tableType, s32 arg1, s32 arg2, s32 arg3, OSMesgQueue* queue) {
if (Audio_AsyncLoadInner(arg0, arg1, arg2, arg3, queue) == NULL) { if (Audio_AsyncLoadInner(tableType, arg1, arg2, arg3, queue) == NULL) {
osSendMesg(queue, -1, OS_MESG_NOBLOCK); osSendMesg(queue, -1, OS_MESG_NOBLOCK);
} }
} }
@ -352,8 +352,8 @@ void func_800E1F7C(s32 arg0) {
while (phi_s2 > 0) { while (phi_s2 > 0) {
phi_s2--; phi_s2--;
temp_s0 = Audio_GetTableIndex(1, gAudioContext.unk_283Cb[phi_s1++]); temp_s0 = Audio_GetTableIndex(BANK_TABLE, gAudioContext.unk_283Cb[phi_s1++]);
if (func_800E04E8(1, temp_s0) == NULL) { if (func_800E04E8(BANK_TABLE, temp_s0) == NULL) {
func_800E202C(temp_s0); func_800E202C(temp_s0);
Audio_SetBankLoadStatus(temp_s0, 0); Audio_SetBankLoadStatus(temp_s0, 0);
} }
@ -430,7 +430,7 @@ s32 func_800E217C(s32 playerIdx, s32 seqId, s32 arg2) {
Audio_ResetSequencePlayer(seqPlayer); Audio_ResetSequencePlayer(seqPlayer);
seqPlayer->seqId = seqId; seqPlayer->seqId = seqId;
seqPlayer->defaultBank = Audio_GetTableIndex(1, phi_s2); seqPlayer->defaultBank = Audio_GetTableIndex(BANK_TABLE, phi_s2);
seqPlayer->seqData = seqData; seqPlayer->seqData = seqData;
seqPlayer->enabled = 1; seqPlayer->enabled = 1;
seqPlayer->scriptState.pc = seqData; seqPlayer->scriptState.pc = seqData;
@ -446,11 +446,11 @@ u8* func_800E22C4(s32 seqId) {
s32 pad; s32 pad;
s32 sp20; s32 sp20;
if (gAudioContext.seqLoadStatus[Audio_GetTableIndex(0, seqId)] == 1) { if (gAudioContext.seqLoadStatus[Audio_GetTableIndex(SEQUENCE_TABLE, seqId)] == 1) {
return NULL; return NULL;
} }
return func_800E2558(0, seqId, &sp20); return func_800E2558(SEQUENCE_TABLE, seqId, &sp20);
} }
u32 func_800E2318(u32 arg0, u32* arg1) { u32 func_800E2318(u32 arg0, u32* arg1) {
@ -460,12 +460,11 @@ u32 func_800E2318(u32 arg0, u32* arg1) {
u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2) { u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2) {
void* temp_v0; void* temp_v0;
AudioTable* audioTable; AudioTable* audioTable;
u32 temp_s0; u32 temp_s0 = Audio_GetTableIndex(AUDIO_TABLE, arg0);
s8 tmp; s8 tmp;
temp_s0 = Audio_GetTableIndex(2, arg0); audioTable = Audio_GetLoadTable(AUDIO_TABLE);
audioTable = Audio_GetLoadTable(2); if (temp_v0 = func_800E27A4(AUDIO_TABLE, temp_s0), temp_v0 != NULL) {
if (temp_v0 = func_800E27A4(2, temp_s0), temp_v0 != NULL) {
if (gAudioContext.audioTableLoadStatus[temp_s0] != 1) { if (gAudioContext.audioTableLoadStatus[temp_s0] != 1) {
Audio_SetAudtabLoadStatus(temp_s0, 2); Audio_SetAudtabLoadStatus(temp_s0, 2);
} }
@ -474,7 +473,7 @@ u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2) {
} else if (tmp = audioTable->entries[arg0].unk_09, tmp == 4 || arg2 == 1) { } else if (tmp = audioTable->entries[arg0].unk_09, tmp == 4 || arg2 == 1) {
*arg1 = audioTable->entries[arg0].unk_08; *arg1 = audioTable->entries[arg0].unk_08;
return audioTable->entries[temp_s0].romAddr; return audioTable->entries[temp_s0].romAddr;
} else if (temp_v0 = func_800E2558(2, arg0, &arg2), temp_v0 != NULL) { } else if (temp_v0 = func_800E2558(AUDIO_TABLE, arg0, &arg2), temp_v0 != NULL) {
*arg1 = 0; *arg1 = 0;
return temp_v0; return temp_v0;
} else { } else {
@ -483,15 +482,14 @@ u32 func_800E2338(u32 arg0, u32* arg1, s32 arg2) {
} }
} }
unk_ldr* func_800E2454(u32 arg0) { unk_ldr* func_800E2454(u32 bankId) {
u8* temp_ret; u8* temp_ret;
s32 unk02; s32 unk02;
s32 unk03; s32 unk03;
s32 sp38; s32 sp38;
RelocInfo relocInfo; RelocInfo relocInfo;
s32 idx; s32 idx = Audio_GetTableIndex(BANK_TABLE, bankId);
idx = Audio_GetTableIndex(BANK_TABLE, arg0);
if (gAudioContext.bankLoadStatus[idx] == 1) { if (gAudioContext.bankLoadStatus[idx] == 1) {
return NULL; return NULL;
} }
@ -512,7 +510,7 @@ unk_ldr* func_800E2454(u32 arg0) {
relocInfo.unk_0C = 0; relocInfo.unk_0C = 0;
} }
temp_ret = func_800E2558(1, arg0, &sp38); temp_ret = func_800E2558(BANK_TABLE, bankId, &sp38);
if (temp_ret == 0) { if (temp_ret == 0) {
return NULL; return NULL;
} }
@ -523,7 +521,7 @@ unk_ldr* func_800E2454(u32 arg0) {
return temp_ret; return temp_ret;
} }
u8* func_800E2558(u32 tableType, u32 bankId, s32* didAllocate) { u8* func_800E2558(u32 tableType, u32 tableIdx, s32* didAllocate) {
u32 size; u32 size;
AudioTable* table; AudioTable* table;
s32 pad; s32 pad;
@ -534,7 +532,7 @@ u8* func_800E2558(u32 tableType, u32 bankId, s32* didAllocate) {
u8* ret; u8* ret;
u32 id; u32 id;
id = Audio_GetTableIndex(tableType, bankId); id = Audio_GetTableIndex(tableType, tableIdx);
ret = func_800E27A4(tableType, id); ret = func_800E27A4(tableType, id);
if (ret != NULL) { if (ret != NULL) {
*didAllocate = false; *didAllocate = false;
@ -543,8 +541,8 @@ u8* func_800E2558(u32 tableType, u32 bankId, s32* didAllocate) {
table = Audio_GetLoadTable(tableType); table = Audio_GetLoadTable(tableType);
size = table->entries[id].size; size = table->entries[id].size;
size = ALIGN16(size); size = ALIGN16(size);
sp40 = table->entries[bankId].unk_08; sp40 = table->entries[tableIdx].unk_08;
sp24 = table->entries[bankId].unk_09; sp24 = table->entries[tableIdx].unk_09;
romAddr = table->entries[id].romAddr; romAddr = table->entries[id].romAddr;
switch (sp24) { switch (sp24) {
case 0: case 0:
@ -804,10 +802,10 @@ s32 Audio_DMA(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ra
void func_800E2CB8(void) { void func_800E2CB8(void) {
} }
void func_800E2CC0(u32 arg0, u32 arg1) { void func_800E2CC0(u32 tableType, u32 bankId) {
s32 sp1C; s32 sp1C;
func_800E2558(arg0, arg1, &sp1C); func_800E2558(tableType, bankId, &sp1C);
} }
void* Audio_AsyncLoadInner(s32 tableType, s32 arg1, s32 arg2, s32 arg3, OSMesgQueue* retQueue) { void* Audio_AsyncLoadInner(s32 tableType, s32 arg1, s32 arg2, s32 arg3, OSMesgQueue* retQueue) {
@ -1018,7 +1016,7 @@ void Audio_ContextInit(void* heap, u32 heapSize) {
gAudioContext.unk_283C = &D_80155340; gAudioContext.unk_283C = &D_80155340;
gAudioContext.seqTabEntCnt = gAudioContext.sequenceTable->header.entryCnt; gAudioContext.seqTabEntCnt = gAudioContext.sequenceTable->header.entryCnt;
gAudioContext.audioResetPresetIdToLoad = 0; gAudioContext.audioResetSpecIdToLoad = 0;
gAudioContext.resetStatus = 1; gAudioContext.resetStatus = 1;
Audio_ResetStep(); Audio_ResetStep();
@ -1205,8 +1203,8 @@ s32 Audio_SyncLoadSeq(s32 seqIdx, u8* ramAddr, u8* isDone) {
return -1; return -1;
} }
seqIdx = Audio_GetTableIndex(0, seqIdx); seqIdx = Audio_GetTableIndex(SEQUENCE_TABLE, seqIdx);
seqTable = Audio_GetLoadTable(0); seqTable = Audio_GetLoadTable(SEQUENCE_TABLE);
syncLoad = &gAudioContext.syncLoads[gAudioContext.syncLoadPos]; syncLoad = &gAudioContext.syncLoads[gAudioContext.syncLoadPos];
if (syncLoad->status == LOAD_STATUS_DONE) { if (syncLoad->status == LOAD_STATUS_DONE) {
syncLoad->status = LOAD_STATUS_WAITING; syncLoad->status = LOAD_STATUS_WAITING;
@ -1618,10 +1616,10 @@ void func_800E4EDC(void) {
void func_800E4EE4(void) { void func_800E4EE4(void) {
} }
void func_800E4EEC(s32 arg0, s32 arg1, u8* arg2) { void func_800E4EEC(s32 tableType, s32 arg1, u8* arg2) {
static u32 D_801304DC = 0; static u32 D_801304DC = 0;
D_8016B738[D_801304DC] = arg2; D_8016B738[D_801304DC] = arg2;
Audio_AsyncLoad(arg0, arg1, 0, D_801304DC, &D_8016B6E0); Audio_AsyncLoad(tableType, arg1, 0, D_801304DC, &D_8016B6E0);
D_801304DC++; D_801304DC++;
if (D_801304DC == 0x10) { if (D_801304DC == 0x10) {
D_801304DC = 0; D_801304DC = 0;

View file

@ -55,13 +55,13 @@ AudioTask* func_800E5000(void) {
s32 i; s32 i;
gAudioContext.totalTaskCnt++; gAudioContext.totalTaskCnt++;
if (gAudioContext.totalTaskCnt % (gAudioContext.audioBufferParameters.presetUnk4) != 0) { if (gAudioContext.totalTaskCnt % (gAudioContext.audioBufferParameters.specUnk4) != 0) {
if (D_801755D0 != NULL) { if (D_801755D0 != NULL) {
D_801755D0(); D_801755D0();
} }
if ((gAudioContext.totalTaskCnt % gAudioContext.audioBufferParameters.presetUnk4) + 1 == if ((gAudioContext.totalTaskCnt % gAudioContext.audioBufferParameters.specUnk4) + 1 ==
gAudioContext.audioBufferParameters.presetUnk4) { gAudioContext.audioBufferParameters.specUnk4) {
return sWaitingAudioTask; return sWaitingAudioTask;
} else { } else {
return NULL; return NULL;
@ -114,7 +114,7 @@ AudioTask* func_800E5000(void) {
if (gAudioContext.resetStatus != 0) { if (gAudioContext.resetStatus != 0) {
if (Audio_ResetStep() == 0) { if (Audio_ResetStep() == 0) {
if (gAudioContext.resetStatus == 0) { if (gAudioContext.resetStatus == 0) {
osSendMesg(gAudioContext.audioResetQueueP, gAudioContext.audioResetPresetIdToLoad, OS_MESG_NOBLOCK); osSendMesg(gAudioContext.audioResetQueueP, gAudioContext.audioResetSpecIdToLoad, OS_MESG_NOBLOCK);
} }
sWaitingAudioTask = NULL; sWaitingAudioTask = NULL;
@ -196,7 +196,7 @@ AudioTask* func_800E5000(void) {
sMaxAbiCmdCnt = abiCmdCnt; sMaxAbiCmdCnt = abiCmdCnt;
} }
if (gAudioContext.audioBufferParameters.presetUnk4 == 1) { if (gAudioContext.audioBufferParameters.specUnk4 == 1) {
return gAudioContext.currTask; return gAudioContext.currTask;
} else { } else {
sWaitingAudioTask = gAudioContext.currTask; sWaitingAudioTask = gAudioContext.currTask;
@ -289,7 +289,7 @@ void func_800E5584(AudioCmd* cmd) {
return; return;
case 0xF9: case 0xF9:
gAudioContext.resetStatus = 5; gAudioContext.resetStatus = 5;
gAudioContext.audioResetPresetIdToLoad = cmd->asUInt; gAudioContext.audioResetSpecIdToLoad = cmd->asUInt;
return; return;
case 0xFB: case 0xFB:
D_801755D0 = (void (*)(void))cmd->asUInt; D_801755D0 = (void (*)(void))cmd->asUInt;
@ -508,7 +508,7 @@ s32 func_800E5EDC(void) {
if (osRecvMesg(gAudioContext.audioResetQueueP, (OSMesg*)&sp18, OS_MESG_NOBLOCK) == -1) { if (osRecvMesg(gAudioContext.audioResetQueueP, (OSMesg*)&sp18, OS_MESG_NOBLOCK) == -1) {
return 0; return 0;
} else if (gAudioContext.audioResetPresetIdToLoad != sp18) { } else if (gAudioContext.audioResetSpecIdToLoad != sp18) {
return -1; return -1;
} else { } else {
return 1; return 1;
@ -531,10 +531,10 @@ s32 func_800E5F88(u32 resetPreloadID) {
resetStatus = gAudioContext.resetStatus; resetStatus = gAudioContext.resetStatus;
if (resetStatus != 0) { if (resetStatus != 0) {
Audio_ResetCmdQueue(); Audio_ResetCmdQueue();
if (gAudioContext.audioResetPresetIdToLoad == resetPreloadID) { if (gAudioContext.audioResetSpecIdToLoad == resetPreloadID) {
return -2; return -2;
} else if (resetStatus > 2) { } else if (resetStatus > 2) {
gAudioContext.audioResetPresetIdToLoad = resetPreloadID; gAudioContext.audioResetSpecIdToLoad = resetPreloadID;
return -3; return -3;
} else { } else {
osRecvMesg(gAudioContext.audioResetQueueP, &msg, OS_MESG_BLOCK); osRecvMesg(gAudioContext.audioResetQueueP, &msg, OS_MESG_BLOCK);

File diff suppressed because it is too large Load diff

View file

@ -6,10 +6,10 @@ typedef struct {
/* 0x00 */ u16 sfxId; /* 0x00 */ u16 sfxId;
/* 0x04 */ Vec3f* pos; /* 0x04 */ Vec3f* pos;
/* 0x08 */ u8 unk_8; /* 0x08 */ u8 unk_8;
/* 0x0C */ f32* unk_C; /* 0x0C */ f32* freqScale;
/* 0x10 */ f32* unk_10; /* 0x10 */ f32* unk_10;
/* 0x14 */ s8* unk_14; /* 0x14 */ s8* reverbAdd;
} Struct_800F738C; // size = 0x18 } SoundRequest; // size = 0x18
typedef struct { typedef struct {
/* 0x00 */ f32 unk_0; /* 0x00 */ f32 unk_0;
@ -18,7 +18,8 @@ typedef struct {
/* 0x0C */ u16 unk_C; /* 0x0C */ u16 unk_C;
} Struct_800F8EA0; // size = 0x10 } Struct_800F8EA0; // size = 0x10
// rodata for func_800F7680 (this file) // rodata for Audio_ProcessSoundRequest (this file)
// (probably moved to .data due to -use_readwrite_const)
char D_80133340[] = "SE"; char D_80133340[] = "SE";
// rodata for func_800F7CEC (this file) // rodata for func_800F7CEC (this file)
@ -32,9 +33,10 @@ char D_80133390[] = "SEQ H";
char D_80133398[] = " L"; char D_80133398[] = " L";
// data // data
u8 D_801333A0 = 0;
u8 D_801333A4 = 0; // sSoundRequests ring buffer endpoints. read index <= write index, wrapping around mod 256.
u8 sSoundRequestWriteIndex = 0;
u8 sSoundRequestReadIndex = 0;
/** /**
* Array of pointers to arrays of SoundBankEntry of sizes: 9, 12, 22, 20, 8, 3, 5 * Array of pointers to arrays of SoundBankEntry of sizes: 9, 12, 22, 20, 8, 3, 5
@ -60,36 +62,36 @@ u8 D_801333CC = 0;
u16 D_801333D0 = 0; u16 D_801333D0 = 0;
Vec3f D_801333D4 = { 0.0f, 0.0f, 0.0f }; Vec3f D_801333D4 = { 0.0f, 0.0f, 0.0f }; // default pos
f32 D_801333E0 = 1.0f; f32 D_801333E0 = 1.0f; // default freqScale
UNK_TYPE D_801333E4 = 0; s32 D_801333E4 = 0; // unused
s8 D_801333E8 = 0; s8 D_801333E8 = 0; // default reverbAdd
UNK_TYPE D_801333EC = 0; s32 D_801333EC = 0; // unused
u8 D_801333F0 = 0; u8 D_801333F0 = 0;
u8 D_801333F4 = 0; u8 gAudioSEFlagSwapOff = 0;
u8 D_801333F8 = 0; u8 D_801333F8 = 0;
extern Struct_800F738C D_8016C9A0[]; extern SoundRequest sSoundRequests[0x100];
extern Struct_800F8EA0 D_8016E270[]; extern Struct_800F8EA0 D_8016E270[7];
extern Struct_8013331C* D_8013331C[9]; extern Struct_8013331C* D_8013331C[9];
void func_800F7260(u16 arg0) { void Audio_SetSoundBanksMute(u16 muteMask) {
u8 bankId; u8 bankId;
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) {
if (arg0 & 1) { if (muteMask & 1) {
D_8016E264[bankId] = 1; gSoundBankMuted[bankId] = true;
} else { } else {
D_8016E264[bankId] = 0; gSoundBankMuted[bankId] = false;
} }
arg0 = (arg0 >> 1) & 0xFFFF; muteMask = muteMask >> 1;
} }
} }
@ -107,98 +109,96 @@ void Audio_ClearBGMMute(u8 arg0) {
} }
} }
// a3 = freq scale factor for ocarina // a4 is often the same as freqScale. (u8)(*a4 * 127.0f) is sent to script on IO port 2
// a5 = reverb add void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 a2, f32* freqScale, f32* a4, s8* reverbAdd) {
void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* a1, u8 a2, f32* a3, f32* a4, s8* a5) {
u8 i; u8 i;
Struct_800F738C* phi_v0; SoundRequest* req;
if (D_8016E264[SFX_BANK_SHIFT(sfxId)] == 0) { if (!gSoundBankMuted[SFX_BANK_SHIFT(sfxId)]) {
phi_v0 = &D_8016C9A0[D_801333A0]; req = &sSoundRequests[sSoundRequestWriteIndex];
if (D_801333F4 == 0) { if (!gAudioSEFlagSwapOff) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
if (sfxId == D_8016E2E0[i]) { if (sfxId == gAudioSEFlagSwapSource[i]) {
if (D_8016E310[i] == 0) { if (gAudioSEFlagSwapMode[i] == 0) { // "SWAP"
sfxId = D_8016E2F8[i]; sfxId = gAudioSEFlagSwapTarget[i];
} else { } else { // "ADD"
phi_v0->sfxId = D_8016E2F8[i]; req->sfxId = gAudioSEFlagSwapTarget[i];
phi_v0->pos = a1; req->pos = pos;
phi_v0->unk_8 = a2; req->unk_8 = a2;
phi_v0->unk_C = a3; req->freqScale = freqScale;
phi_v0->unk_10 = a4; req->unk_10 = a4;
phi_v0->unk_14 = a5; req->reverbAdd = reverbAdd;
D_801333A0++; sSoundRequestWriteIndex++;
phi_v0 = &D_8016C9A0[D_801333A0]; req = &sSoundRequests[sSoundRequestWriteIndex];
} }
i = 10; i = 10; // "break;"
} }
} }
} }
phi_v0->sfxId = sfxId; req->sfxId = sfxId;
phi_v0->pos = a1; req->pos = pos;
phi_v0->unk_8 = a2; req->unk_8 = a2;
phi_v0->unk_C = a3; req->freqScale = freqScale;
phi_v0->unk_10 = a4; req->unk_10 = a4;
phi_v0->unk_14 = a5; req->reverbAdd = reverbAdd;
D_801333A0++; sSoundRequestWriteIndex++;
} }
} }
void func_800F74E0(u8 arg0, SoundBankEntry* arg1) { void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) {
Struct_800F738C* entry; SoundRequest* req;
s32 phi_a0; s32 remove;
u8 i = D_801333A4; u8 i = sSoundRequestReadIndex;
for (i; i != D_801333A0; i++) { for (; i != sSoundRequestWriteIndex; i++) {
phi_a0 = false; remove = false;
entry = &D_8016C9A0[i]; req = &sSoundRequests[i];
switch (arg0) { switch (aspect) {
case 0: case 0:
if (SFX_BANK_MASK(entry->sfxId) == SFX_BANK_MASK(arg1->unk_28)) { if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28)) {
phi_a0 = true; remove = true;
} }
break; break;
case 1: case 1:
if (SFX_BANK_MASK(entry->sfxId) == SFX_BANK_MASK(arg1->unk_28) && (&entry->pos->x == arg1->posX)) { if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->unk_28) && (&req->pos->x == cmp->posX)) {
phi_a0 = true; remove = true;
} }
break; break;
case 2: case 2:
if (&entry->pos->x == arg1->posX) { if (&req->pos->x == cmp->posX) {
phi_a0 = true; remove = true;
} }
break; break;
case 3: case 3:
if (&entry->pos->x == arg1->posX && entry->sfxId == arg1->unk_28) { if (&req->pos->x == cmp->posX && req->sfxId == cmp->unk_28) {
phi_a0 = true; remove = true;
} }
break; break;
case 4: case 4:
if (entry->unk_8 == arg1->unk_C && entry->sfxId == arg1->unk_28) { if (req->unk_8 == cmp->unk_C && req->sfxId == cmp->unk_28) {
phi_a0 = true; remove = true;
} }
break; break;
case 5: case 5:
if (entry->sfxId == arg1->unk_28) { if (req->sfxId == cmp->unk_28) {
phi_a0 = true; remove = true;
} }
break; break;
} }
if (phi_a0) { if (remove) {
entry->sfxId = 0; req->sfxId = 0;
} }
// i++;
} }
} }
#ifdef NON_MATCHING #ifdef NON_MATCHING
// Down to a/v regalloc and some stuff where the compiler gets confused about reusing values. There's some fake 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. // stuff to improve regalloc enough to verify equivalence.
void func_800F7680(void) { void Audio_ProcessSoundRequest(void) {
u16 flag1; u16 flag1;
u8 sp55; u8 sp55;
u8 phi_a1; u8 phi_a1;
Struct_800F738C* sp50; SoundRequest* req; // sp50
SoundBankEntry* temp_v0; SoundBankEntry* temp_v0;
Struct_8013331C* sp48; Struct_8013331C* sp48;
s32 phi_s5; s32 phi_s5;
@ -206,25 +206,25 @@ void func_800F7680(void) {
u8 phi_s1; u8 phi_s1;
u16 flag2; u16 flag2;
sp50 = &D_8016C9A0[D_801333A4]; req = &sSoundRequests[sSoundRequestReadIndex];
phi_s1 = 0x80; phi_s1 = 0x80;
if (sp50->sfxId == 0) { if (req->sfxId == 0) {
return; return;
} }
phi_s5 = SFX_BANK(sp50->sfxId); phi_s5 = SFX_BANK(req->sfxId);
if ((1 << phi_s5) & D_801333F0) { if ((1 << phi_s5) & D_801333F0) {
func_800F2D6C(D_80133340, sp50->sfxId); AudioDebug_ScrPrt((const s8*)D_80133340, req->sfxId);
phi_s5 = SFX_BANK(sp50->sfxId); phi_s5 = SFX_BANK(req->sfxId);
} }
sp55 = 0; sp55 = 0;
phi_a1 = gSoundBanks[phi_s5][0].next; phi_a1 = gSoundBanks[phi_s5][0].next;
while (phi_a1 != 0xFF && phi_a1 != 0) { while (phi_a1 != 0xFF && phi_a1 != 0) {
if (gSoundBanks[phi_s5][phi_a1].posX == &sp50->pos->x) { if (gSoundBanks[phi_s5][phi_a1].posX == &req->pos->x) {
sp48 = &D_8013331C[SFX_BANK_SHIFT(sp50->sfxId)][SFX_INDEX(sp50->sfxId)]; 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)) { if (!(!(sp48->unk_2 & 0x20) || sp48->unk_0 != gSoundBanks[phi_s5][phi_a1].unk_24)) {
return; return;
} }
if (gSoundBanks[phi_s5][phi_a1].unk_28 == sp50->sfxId) { if (gSoundBanks[phi_s5][phi_a1].unk_28 == req->sfxId) {
sp55 = D_80130594[D_801333CC][phi_s5]; sp55 = D_80130594[D_801333CC][phi_s5];
} else { } else {
//! @bug possibly uninitialized sp43 ? confirm when matching //! @bug possibly uninitialized sp43 ? confirm when matching
@ -243,20 +243,20 @@ void func_800F7680(void) {
} }
} }
if (D_80130594[D_801333CC][phi_s5] == sp55) { if (D_80130594[D_801333CC][phi_s5] == sp55) {
flag2 = sp50->sfxId & 0xC00; // Problem is around here flag2 = req->sfxId & 0xC00; // Problem is around here
sp48 = &D_8013331C[SFX_BANK_SHIFT(sp50->sfxId)][SFX_INDEX(sp50->sfxId)]; sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
if ((flag2) || (D_8013331C[SFX_BANK_SHIFT(sp50->sfxId)][SFX_INDEX(sp50->sfxId)].unk_2 & 4) || if ((flag2) || (D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].unk_2 & 4) ||
(phi_a1 == phi_s1)) { (phi_a1 == phi_s1)) {
if ((gSoundBanks[phi_s5][phi_a1].unk_26 & 8) && gSoundBanks[phi_s5][phi_a1].unk_2A != 1) { 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); Audio_ClearBGMMute(gSoundBanks[phi_s5][phi_a1].unk_2E);
} }
gSoundBanks[phi_s5][phi_a1].unk_C = sp50->unk_8; gSoundBanks[phi_s5][phi_a1].unk_C = req->unk_8;
gSoundBanks[phi_s5][phi_a1].unk_28 = sp50->sfxId; gSoundBanks[phi_s5][phi_a1].unk_28 = req->sfxId;
gSoundBanks[phi_s5][phi_a1].unk_2A = 1; gSoundBanks[phi_s5][phi_a1].unk_2A = 1;
gSoundBanks[phi_s5][phi_a1].unk_2B = 2; gSoundBanks[phi_s5][phi_a1].unk_2B = 2;
gSoundBanks[phi_s5][phi_a1].unk_10 = sp50->unk_C; gSoundBanks[phi_s5][phi_a1].freqScale = req->freqScale;
gSoundBanks[phi_s5][phi_a1].unk_14 = sp50->unk_10; gSoundBanks[phi_s5][phi_a1].unk_14 = req->unk_10;
gSoundBanks[phi_s5][phi_a1].unk_18 = sp50->unk_14; gSoundBanks[phi_s5][phi_a1].reverbAdd = req->reverbAdd;
gSoundBanks[phi_s5][phi_a1].unk_26 = sp48->unk_2; gSoundBanks[phi_s5][phi_a1].unk_26 = sp48->unk_2;
gSoundBanks[phi_s5][phi_a1].unk_24 = sp48->unk_0; gSoundBanks[phi_s5][phi_a1].unk_24 = sp48->unk_0;
if (!sp48->unk_2) {} if (!sp48->unk_2) {}
@ -273,17 +273,17 @@ void func_800F7680(void) {
if (gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next != 0xFF && phi_a1 != 0) { if (gSoundBanks[phi_s5][D_8016E1A8[phi_s5]].next != 0xFF && phi_a1 != 0) {
phi_a1 = D_8016E1A8[phi_s5]; phi_a1 = D_8016E1A8[phi_s5];
temp_v0 = &gSoundBanks[phi_s5][phi_a1]; temp_v0 = &gSoundBanks[phi_s5][phi_a1];
temp_v0->posX = &sp50->pos->x; temp_v0->posX = &req->pos->x;
temp_v0->posY = &sp50->pos->y; temp_v0->posY = &req->pos->y;
temp_v0->posZ = &sp50->pos->z; temp_v0->posZ = &req->pos->z;
temp_v0->unk_C = sp50->unk_8; temp_v0->unk_C = req->unk_8;
temp_v0->unk_10 = sp50->unk_C; temp_v0->freqScale = req->freqScale;
temp_v0->unk_14 = sp50->unk_10; temp_v0->unk_14 = req->unk_10;
temp_v0->unk_18 = sp50->unk_14; temp_v0->reverbAdd = req->reverbAdd;
sp48 = &D_8013331C[SFX_BANK_SHIFT(sp50->sfxId)][SFX_INDEX(sp50->sfxId)]; sp48 = &D_8013331C[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
temp_v0->unk_26 = sp48->unk_2; temp_v0->unk_26 = sp48->unk_2;
temp_v0->unk_24 = sp48->unk_0; temp_v0->unk_24 = sp48->unk_0;
temp_v0->unk_28 = sp50->sfxId; temp_v0->unk_28 = req->sfxId;
temp_v0->unk_2A = 1; temp_v0->unk_2A = 1;
temp_v0->unk_2B = 2; temp_v0->unk_2B = 2;
temp_v0->prev = D_8016E1A0[phi_s5]; temp_v0->prev = D_8016E1A0[phi_s5];
@ -295,8 +295,8 @@ void func_800F7680(void) {
} }
} }
#else #else
void func_800F7680(void); void Audio_ProcessSoundRequest(void);
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800F7260/func_800F7680.s") #pragma GLOBAL_ASM("asm/non_matchings/code/code_800F7260/Audio_ProcessSoundRequest.s")
#endif #endif
void func_800F7B54(u8 bankId, u8 bankIndex) { void func_800F7B54(u8 bankId, u8 bankIndex) {
@ -327,27 +327,26 @@ void func_800F7B54(u8 bankId, u8 bankIndex) {
} }
void func_800F7CEC(u8 arg0) { void func_800F7CEC(u8 arg0) {
u8 phi_a1; u8 phi_s3;
u8 spAE; u8 spAE;
u8 phi_s4; u8 phi_s4;
u8 spAC; u8 i;
u8 phi_s3; u8 j;
u8 phi_s0; u8 phi_s0;
u8 spA9; u8 spA9;
u8 phi_v1_5; u8 phi_v1_5;
u8 temp1;
u8 temp2; u8 temp2;
u16 temp3; u16 temp3;
f32 tempf1; f32 tempf1;
SoundBankEntry* temp_s2; SoundBankEntry* entry;
Struct_800F7CEC sp84[3]; Struct_800F7CEC sp84[3];
Struct_800F7CEC* temp_s4_3; Struct_800F7CEC* temp_s4_3;
s32 pad; s32 pad;
phi_s3 = 0; phi_s3 = 0;
for (spAC = 0; spAC < 3; spAC++) { for (i = 0; i < 3; i++) {
sp84[spAC].unk_0 = 0x7FFFFFFF; sp84[i].unk_0 = 0x7FFFFFFF;
sp84[spAC].unk_4 = 0xFF; sp84[i].unk_4 = 0xFF;
} }
phi_s4 = gSoundBanks[arg0][0].next; phi_s4 = gSoundBanks[arg0][0].next;
phi_s0 = 0; phi_s0 = 0;
@ -361,51 +360,51 @@ void func_800F7CEC(u8 arg0) {
if (gSoundBanks[arg0][phi_s4].unk_2B == 0) { if (gSoundBanks[arg0][phi_s4].unk_2B == 0) {
func_800F7B54(arg0, phi_s4); func_800F7B54(arg0, phi_s4);
} else if (gSoundBanks[arg0][phi_s4].unk_2A != 0) { } else if (gSoundBanks[arg0][phi_s4].unk_2A != 0) {
temp_s2 = &gSoundBanks[arg0][phi_s4]; entry = &gSoundBanks[arg0][phi_s4];
if (&D_801333D4.x == temp_s2[0].posX) { if (&D_801333D4.x == entry[0].posX) {
temp_s2->unk_1C = 0.0f; entry->dist = 0.0f;
} else { } else {
tempf1 = *temp_s2->posY * 1; tempf1 = *entry->posY * 1;
temp_s2->unk_1C = (SQ(*temp_s2->posX) + SQ(tempf1) + SQ(*temp_s2->posZ)) * 1; entry->dist = (SQ(*entry->posX) + SQ(tempf1) + SQ(*entry->posZ)) * 1;
} }
spA9 = temp_s2->unk_24; spA9 = entry->unk_24;
if (temp_s2->unk_26 & 0x10) { if (entry->unk_26 & 0x10) {
temp_s2->unk_20 = SQ(0xFF - spA9) * 0x1690; entry->unk_20 = SQ(0xFF - spA9) * 0x1690;
} else { } else {
if (temp_s2->unk_1C > 0x7FFFFFD0) { if (entry->dist > 0x7FFFFFD0) {
temp_s2->unk_1C = 0x70000008; entry->dist = 0x70000008;
osSyncPrintf(D_80133344, temp_s2->unk_28, temp_s2->posX, temp_s2->posZ, *temp_s2->posX, osSyncPrintf(D_80133344, entry->unk_28, entry->posX, entry->posZ, *entry->posX,
*temp_s2->posY, *temp_s2->posZ); *entry->posY, *entry->posZ);
} }
temp3 = temp_s2->unk_28; temp3 = entry->unk_28;
temp_s2->unk_20 = (u32)temp_s2->unk_1C + (SQ(0xFF - spA9) * 0x1690) + temp3 - temp3; entry->unk_20 = (u32)entry->dist + (SQ(0xFF - spA9) * 0x1690) + temp3 - temp3;
if (*temp_s2->posZ < 0.0f) { if (*entry->posZ < 0.0f) {
temp_s2->unk_20 += (s32)(-*temp_s2->posZ * 6.0f); entry->unk_20 += (s32)(-*entry->posZ * 6.0f);
} }
} }
if (temp_s2->unk_1C > 1.0e10f) { if (entry->dist > SQ(1e5f)) {
if (temp_s2->unk_2A == 4) { if (entry->unk_2A == 4) {
Audio_QueueCmdS8((temp_s2->unk_2E << 8) | 0x6020000, 0); Audio_QueueCmdS8((entry->unk_2E << 8) | 0x6020000, 0);
if (temp_s2->unk_28 & 0xC00) { if (entry->unk_28 & 0xC00) {
func_800F7B54(arg0, phi_s4); func_800F7B54(arg0, phi_s4);
phi_s4 = phi_s0; phi_s4 = phi_s0;
} }
} }
} else { } else {
spAE = D_80130578[D_801333CC][arg0]; spAE = D_80130578[D_801333CC][arg0];
for (spAC = 0; spAC < spAE; spAC++) { for (i = 0; i < spAE; i++) {
if (sp84[spAC].unk_0 >= temp_s2->unk_20) { if (sp84[i].unk_0 >= entry->unk_20) {
if (phi_s3 < D_80130578[D_801333CC][arg0]) { if (phi_s3 < D_80130578[D_801333CC][arg0]) {
phi_s3++; phi_s3++;
} }
for (phi_a1 = spAE - 1; phi_a1 > spAC; phi_a1--) { for (j = spAE - 1; j > i; j--) {
sp84[phi_a1].unk_0 = sp84[phi_a1 - 1].unk_0; sp84[j].unk_0 = sp84[j - 1].unk_0;
sp84[phi_a1].unk_4 = sp84[phi_a1 - 1].unk_4; sp84[j].unk_4 = sp84[j - 1].unk_4;
} }
sp84[spAC].unk_0 = temp_s2->unk_20; sp84[i].unk_0 = entry->unk_20;
sp84[spAC].unk_4 = phi_s4; sp84[i].unk_4 = phi_s4;
spAC = spAE; i = spAE;
} }
} }
} }
@ -413,40 +412,39 @@ void func_800F7CEC(u8 arg0) {
} }
phi_s4 = gSoundBanks[arg0][phi_s0].next; phi_s4 = gSoundBanks[arg0][phi_s0].next;
} }
for (spAC = 0; spAC < phi_s3; spAC++) { for (i = 0; i < phi_s3; i++) {
temp_s2 = &gSoundBanks[arg0][sp84[spAC].unk_4]; entry = &gSoundBanks[arg0][sp84[i].unk_4];
if (temp_s2->unk_2A == 1) { if (entry->unk_2A == 1) {
temp_s2->unk_2A = 2; entry->unk_2A = 2;
} else if (temp_s2->unk_2A == 4) { } else if (entry->unk_2A == 4) {
temp_s2->unk_2A = 3; entry->unk_2A = 3;
} }
} }
spAE = D_80130578[D_801333CC][arg0]; spAE = D_80130578[D_801333CC][arg0];
for (spAC = 0; spAC < spAE; spAC++) { for (i = 0; i < spAE; i++) {
phi_v1_5 = 0; phi_v1_5 = 0;
temp_s4_3 = &D_8016E1B8[arg0][spAC]; temp_s4_3 = &D_8016E1B8[arg0][i];
temp1 = temp_s4_3->unk_4;
if (temp_s4_3->unk_4 == 0xFF) { if (temp_s4_3->unk_4 == 0xFF) {
phi_v1_5 = 1; phi_v1_5 = 1;
} else { } else {
temp_s2 = &gSoundBanks[arg0][temp_s4_3[0].unk_4]; entry = &gSoundBanks[arg0][temp_s4_3[0].unk_4];
if (temp_s2->unk_2A == 4) { if (entry->unk_2A == 4) {
if (temp_s2->unk_28 & 0xC00) { if (entry->unk_28 & 0xC00) {
func_800F7B54(arg0, temp_s4_3->unk_4); func_800F7B54(arg0, temp_s4_3->unk_4);
} else { } else {
temp_s2->unk_2A = 1; entry->unk_2A = 1;
} }
phi_v1_5 = 1; phi_v1_5 = 1;
} else if (temp_s2->unk_2A == 0) { } else if (entry->unk_2A == 0) {
temp_s4_3->unk_4 = 0xFF; temp_s4_3->unk_4 = 0xFF;
phi_v1_5 = 1; phi_v1_5 = 1;
} else { } else {
for (phi_a1 = 0; phi_a1 < spAE; phi_a1++) { for (j = 0; j < spAE; j++) {
if (temp_s4_3->unk_4 == sp84[phi_a1].unk_4) { if (temp_s4_3->unk_4 == sp84[j].unk_4) {
sp84[phi_a1].unk_4 = 0xFF; sp84[j].unk_4 = 0xFF;
phi_a1 = spAE; j = spAE;
} }
} }
phi_s3--; phi_s3--;
@ -454,8 +452,8 @@ void func_800F7CEC(u8 arg0) {
} }
if (phi_v1_5 == 1) { if (phi_v1_5 == 1) {
for (phi_a1 = 0; phi_a1 < spAE; phi_a1++) { for (j = 0; j < spAE; j++) {
temp2 = sp84[phi_a1].unk_4; temp2 = sp84[j].unk_4;
if ((temp2 != 0xFF) && (gSoundBanks[arg0][temp2].unk_2A != 3)) { if ((temp2 != 0xFF) && (gSoundBanks[arg0][temp2].unk_2A != 3)) {
for (phi_s0 = 0; phi_s0 < spAE; phi_s0++) { for (phi_s0 = 0; phi_s0 < spAE; phi_s0++) {
if (temp2 == D_8016E1B8[arg0][phi_s0].unk_4) { if (temp2 == D_8016E1B8[arg0][phi_s0].unk_4) {
@ -466,14 +464,14 @@ void func_800F7CEC(u8 arg0) {
if (phi_v1_5 == 1) { if (phi_v1_5 == 1) {
temp_s4_3->unk_4 = temp2; temp_s4_3->unk_4 = temp2;
sp84[phi_a1].unk_4 = 0xFF; sp84[j].unk_4 = 0xFF;
phi_a1 = spAE + 1; j = spAE + 1;
phi_s3--; phi_s3--;
} }
} }
} }
if (phi_a1 == spAE) { if (j == spAE) {
temp_s4_3->unk_4 = 0xFF; temp_s4_3->unk_4 = 0xFF;
} }
} }
@ -512,7 +510,7 @@ void func_800F8480(u8 bankId) {
break; break;
} }
} }
func_800F3A08(bankId, bankIndex, D_8016E260); Audio_SetSoundProperties(bankId, bankIndex, D_8016E260);
Audio_QueueCmdS8(0x06020000 | ((D_8016E260 & 0xFF) << 8), 1); 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->unk_28 & 0xFF);
if (D_80130570[bankId] != 0) { if (D_80130570[bankId] != 0) {
@ -526,7 +524,7 @@ void func_800F8480(u8 bankId) {
} else if ((u8)seqChannel->soundScriptIO[1] == 0xFF) { } else if ((u8)seqChannel->soundScriptIO[1] == 0xFF) {
func_800F7B54(bankId, bankIndex); func_800F7B54(bankId, bankIndex);
} else if (entry->unk_2A == 3) { } else if (entry->unk_2A == 3) {
func_800F3A08(bankId, bankIndex, D_8016E260); Audio_SetSoundProperties(bankId, bankIndex, D_8016E260);
if (entry->unk_28 & 0xC00) { if (entry->unk_28 & 0xC00) {
entry->unk_2A = 4; entry->unk_2A = 4;
} else { } else {
@ -541,7 +539,7 @@ void func_800F8480(u8 bankId) {
void func_800F87A0(u8 bankId) { void func_800F87A0(u8 bankId) {
SoundBankEntry* entry; SoundBankEntry* entry;
s32 pad; s32 pad;
SoundBankEntry sp48; SoundBankEntry cmp;
u8 bankIndex = gSoundBanks[bankId][0].next; u8 bankIndex = gSoundBanks[bankId][0].next;
while (bankIndex != 0xFF) { while (bankIndex != 0xFF) {
@ -554,8 +552,8 @@ void func_800F87A0(u8 bankId) {
} }
bankIndex = gSoundBanks[bankId][0].next; bankIndex = gSoundBanks[bankId][0].next;
} }
sp48.unk_28 = bankId << 12; cmp.unk_28 = bankId << 12;
func_800F74E0(0, &sp48); Audio_RemoveMatchingSoundRequests(0, &cmp);
} }
void func_800F8884(u8 bankId, Vec3f* pos) { void func_800F8884(u8 bankId, Vec3f* pos) {
@ -580,30 +578,30 @@ void func_800F8884(u8 bankId, Vec3f* pos) {
} }
void func_800F89A0(u8 bankId, Vec3f* pos) { void func_800F89A0(u8 bankId, Vec3f* pos) {
SoundBankEntry sp18; SoundBankEntry cmp;
func_800F8884(bankId, pos); func_800F8884(bankId, pos);
sp18.unk_28 = bankId << 12; cmp.unk_28 = bankId << 12;
sp18.posX = &pos->x; cmp.posX = &pos->x;
func_800F74E0(1, &sp18); Audio_RemoveMatchingSoundRequests(1, &cmp);
} }
void func_800F89E8(Vec3f* pos) { void func_800F89E8(Vec3f* pos) {
u8 i; u8 i;
SoundBankEntry sp24; SoundBankEntry cmp;
for (i = 0; i < ARRAY_COUNT(gSoundBanks); i++) { for (i = 0; i < ARRAY_COUNT(gSoundBanks); i++) {
func_800F8884(i, pos); func_800F8884(i, pos);
} }
sp24.posX = &pos->x; cmp.posX = &pos->x;
func_800F74E0(2, &sp24); Audio_RemoveMatchingSoundRequests(2, &cmp);
} }
void func_800F8A44(Vec3f* pos, u16 sfxId) { void func_800F8A44(Vec3f* pos, u16 sfxId) {
SoundBankEntry* entry; SoundBankEntry* entry;
u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;
u8 bankIndex2 = 0; u8 bankIndex2 = 0;
SoundBankEntry sp50; SoundBankEntry cmp;
while (bankIndex != 0xFF) { while (bankIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
@ -622,16 +620,16 @@ void func_800F8A44(Vec3f* pos, u16 sfxId) {
bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next; bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next;
} }
} }
sp50.posX = &pos->x; cmp.posX = &pos->x;
sp50.unk_28 = sfxId; cmp.unk_28 = sfxId;
func_800F74E0(3, &sp50); Audio_RemoveMatchingSoundRequests(3, &cmp);
} }
void func_800F8BA0(u8 arg0, u16 sfxId) { void func_800F8BA0(u8 arg0, u16 sfxId) {
SoundBankEntry* entry; SoundBankEntry* entry;
u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;
u8 bankIndex2 = 0; u8 bankIndex2 = 0;
SoundBankEntry sp58; SoundBankEntry cmp;
while (bankIndex != 0xFF) { while (bankIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
@ -649,16 +647,16 @@ void func_800F8BA0(u8 arg0, u16 sfxId) {
bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next; bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next;
} }
} }
sp58.unk_C = arg0; cmp.unk_C = arg0;
sp58.unk_28 = sfxId; cmp.unk_28 = sfxId;
func_800F74E0(4, &sp58); Audio_RemoveMatchingSoundRequests(4, &cmp);
} }
void Audio_StopSfx(u32 sfxId) { void Audio_StopSfx(u32 sfxId) {
SoundBankEntry* entry; SoundBankEntry* entry;
u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;
u8 bankIndex2 = 0; u8 bankIndex2 = 0;
SoundBankEntry sp50; SoundBankEntry cmp;
while (bankIndex != 0xFF) { while (bankIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex]; entry = &gSoundBanks[SFX_BANK(sfxId)][bankIndex];
@ -674,14 +672,14 @@ void Audio_StopSfx(u32 sfxId) {
} }
bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next; bankIndex = gSoundBanks[SFX_BANK(sfxId)][bankIndex2].next;
} }
sp50.unk_28 = sfxId; cmp.unk_28 = sfxId;
func_800F74E0(5, &sp50); Audio_RemoveMatchingSoundRequests(5, &cmp);
} }
void func_800F8E3C(void) { void Audio_ProcessSoundRequests(void) {
while (D_801333A0 != D_801333A4) { while (sSoundRequestWriteIndex != sSoundRequestReadIndex) {
func_800F7680(); Audio_ProcessSoundRequest();
D_801333A4++; sSoundRequestReadIndex++;
} }
} }
@ -718,7 +716,7 @@ void func_800F8F88(void) {
} }
} }
u8 func_800F8FF4(u32 sfxId) { u8 Audio_IsSfxPlaying(u32 sfxId) {
SoundBankEntry* entry; SoundBankEntry* entry;
u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 bankIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;
@ -737,14 +735,14 @@ void func_800F905C(void) {
u8 i; u8 i;
u8 bankIndex; u8 bankIndex;
D_801333A0 = 0; sSoundRequestWriteIndex = 0;
D_801333A4 = 0; sSoundRequestReadIndex = 0;
D_801333D0 = 0; D_801333D0 = 0;
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) {
D_8016E1A0[bankId] = 0; D_8016E1A0[bankId] = 0;
D_8016E1A8[bankId] = 1; D_8016E1A8[bankId] = 1;
D_8016E1B0[bankId] = 0; D_8016E1B0[bankId] = 0;
D_8016E264[bankId] = 0; gSoundBankMuted[bankId] = false;
D_8016E270[bankId].unk_0 = 1.0f; D_8016E270[bankId].unk_0 = 1.0f;
D_8016E270[bankId].unk_C = 0; D_8016E270[bankId].unk_C = 0;
} }
@ -765,9 +763,9 @@ void func_800F905C(void) {
} }
if (D_801333F8 == 0) { if (D_801333F8 == 0) {
for (bankId = 0; bankId < 10; bankId++) { for (bankId = 0; bankId < 10; bankId++) {
D_8016E2E0[bankId] = 0; gAudioSEFlagSwapSource[bankId] = 0;
D_8016E2F8[bankId] = 0; gAudioSEFlagSwapTarget[bankId] = 0;
D_8016E310[bankId] = 0; gAudioSEFlagSwapMode[bankId] = 0;
} }
D_801333F8++; D_801333F8++;
} }

View file

@ -163,7 +163,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
GfxPrint_Init(&printer); GfxPrint_Init(&printer);
GfxPrint_Open(&printer, newDList); GfxPrint_Open(&printer, newDList);
func_800EEA50(&printer); AudioDebug_Draw(&printer);
newDList = GfxPrint_Close(&printer); newDList = GfxPrint_Close(&printer);
GfxPrint_Destroy(&printer); GfxPrint_Destroy(&printer);
} }

View file

@ -361,13 +361,13 @@ Gfx* GfxPrint_Close(GfxPrint* this) {
return ret; return ret;
} }
void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) { s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
PrintUtils_VPrintf((PrintCallback*)&this->callback, fmt, args); return PrintUtils_VPrintf((PrintCallback*)&this->callback, fmt, args);
} }
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) { s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
GfxPrint_VPrintf(this, fmt, args); return GfxPrint_VPrintf(this, fmt, args);
} }

View file

@ -1,12 +1,12 @@
#include "global.h" #include "global.h"
void PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) { s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args) {
_Printf(*pfn, pfn, fmt, args); return _Printf(*pfn, pfn, fmt, args);
} }
void PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) { s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
PrintUtils_VPrintf(pfn, fmt, args); return PrintUtils_VPrintf(pfn, fmt, args);
} }

View file

@ -143,7 +143,7 @@ void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx) {
ShrinkWindow_SetVal(0x20); ShrinkWindow_SetVal(0x20);
if (func_8006472C(globalCtx, csCtx, 1.0f)) { if (func_8006472C(globalCtx, csCtx, 1.0f)) {
func_800F68BC(1); Audio_SetCutsceneFlag(1);
csCtx->state++; csCtx->state++;
} }
} }
@ -154,7 +154,7 @@ void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
ShrinkWindow_SetVal(0x20); ShrinkWindow_SetVal(0x20);
if (func_8006472C(globalCtx, csCtx, 1.0f)) { if (func_8006472C(globalCtx, csCtx, 1.0f)) {
func_800F68BC(1); Audio_SetCutsceneFlag(1);
csCtx->state++; csCtx->state++;
} }
} }
@ -457,7 +457,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
((csCtx->frames > 20) && CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) && ((csCtx->frames > 20) && CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) &&
(gSaveContext.fileNum != 0xFEDC))) { (gSaveContext.fileNum != 0xFEDC))) {
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
func_800F68BC(0); Audio_SetCutsceneFlag(0);
gSaveContext.unk_1410 = 1; gSaveContext.unk_1410 = 1;
// Translates to: "FUTURE FORK DESIGNATION=No. [%d]" // Translates to: "FUTURE FORK DESIGNATION=No. [%d]"
@ -781,7 +781,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break; break;
case 54: case 54:
gSaveContext.gameMode = 3; gSaveContext.gameMode = 3;
func_800F7260(0x6F); Audio_SetSoundBanksMute(0x6F);
globalCtx->linkAgeOnLoad = 1; globalCtx->linkAgeOnLoad = 1;
globalCtx->nextEntranceIndex = 0x0117; globalCtx->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF2; gSaveContext.cutsceneIndex = 0xFFF2;
@ -1161,7 +1161,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break; break;
case 117: case 117:
gSaveContext.gameMode = 3; gSaveContext.gameMode = 3;
func_800F7260(0x6F); Audio_SetSoundBanksMute(0x6F);
globalCtx->linkAgeOnLoad = 0; globalCtx->linkAgeOnLoad = 0;
globalCtx->nextEntranceIndex = 0x00CD; globalCtx->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF7; gSaveContext.cutsceneIndex = 0xFFF7;
@ -1887,7 +1887,7 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) {
void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) { void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) {
if (func_8006472C(globalCtx, csCtx, 0.0f)) { if (func_8006472C(globalCtx, csCtx, 0.0f)) {
func_800F68BC(0); Audio_SetCutsceneFlag(0);
csCtx->state = CS_STATE_IDLE; csCtx->state = CS_STATE_IDLE;
} }
} }
@ -1921,7 +1921,7 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
func_8005B1A4(globalCtx->cameraPtrs[D_8015FCC6]); func_8005B1A4(globalCtx->cameraPtrs[D_8015FCC6]);
} }
func_800F68BC(0); Audio_SetCutsceneFlag(0);
csCtx->state = CS_STATE_IDLE; csCtx->state = CS_STATE_IDLE;
} }
} }
@ -1948,7 +1948,7 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) {
csCtx->state++; csCtx->state++;
if (csCtx->state == CS_STATE_SKIPPABLE_INIT) { if (csCtx->state == CS_STATE_SKIPPABLE_INIT) {
func_800F68BC(1); Audio_SetCutsceneFlag(1);
csCtx->frames = 0xFFFF; csCtx->frames = 0xFFFF;
csCtx->unk_18 = 0xFFFF; csCtx->unk_18 = 0xFFFF;

View file

@ -619,5 +619,5 @@ void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) {
if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) { if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) {
Map_SavePlayerInitialInfo(globalCtx); Map_SavePlayerInitialInfo(globalCtx);
} }
func_800F66C0(globalCtx->roomCtx.curRoom.echo); Audio_SetEnvReverb(globalCtx->roomCtx.curRoom.echo);
} }

View file

@ -153,9 +153,9 @@ void BgSpot03Taki_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->bufferIndex = this->bufferIndex == 0; this->bufferIndex = this->bufferIndex == 0;
if (this->state > WATERFALL_CLOSED && this->state < WATERFALL_CLOSING) { if (this->state >= WATERFALL_OPENING_IDLE && this->state <= WATERFALL_OPENED) {
func_800F46E0(&this->dyna.actor.projectedPos, 0.5f); Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 0.5f);
} else { } else {
func_800F46E0(&this->dyna.actor.projectedPos, 1.0f); Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 1.0f);
} }
} }

View file

@ -490,7 +490,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 30.0f; swingRateAccel = 30.0f;
swingSizeAccel = 60.0f; swingSizeAccel = 60.0f;
if (((this->sfxTimer % 16) == 0) && (this->timers[0] < 30)) { if (((this->sfxTimer % 16) == 0) && (this->timers[0] < 30)) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0); Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
} }
} else if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SHAKE) { } else if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SHAKE) {
if (this->timers[0] > 40) { if (this->timers[0] > 40) {
@ -503,7 +503,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 30.0f; swingRateAccel = 30.0f;
swingSizeAccel = 60.0f; swingSizeAccel = 60.0f;
if ((this->sfxTimer % 32) == 0) { if ((this->sfxTimer % 32) == 0) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0); Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
func_800AA000(0, 100, 5, 2); func_800AA000(0, 100, 5, 2);
func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92); func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
} }
@ -517,7 +517,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
swingRateAccel = 70.0f; swingRateAccel = 70.0f;
swingSizeAccel = 70.0f; swingSizeAccel = 70.0f;
if ((this->sfxTimer % 16) == 0) { if ((this->sfxTimer % 16) == 0) {
func_800F4B58(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, D_801305D0); Audio_PlaySoundIncreasinglyTransposed(&this->tentTipPos, NA_SE_EN_MOFER_WAVE, gMorphaTransposeTable);
func_800AA000(0, 160, 5, 4); func_800AA000(0, 160, 5, 4);
func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92); func_8002F7DC(&player->actor, NA_SE_VO_LI_FREEZE + player->ageProperties->unk_92);
} }
@ -630,7 +630,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
if ((this->timers[0] == 0) && !HAS_LINK(otherTent)) { if ((this->timers[0] == 0) && !HAS_LINK(otherTent)) {
this->work[MO_TENT_ACTION_STATE] = MO_TENT_SWING; this->work[MO_TENT_ACTION_STATE] = MO_TENT_SWING;
this->timers[0] = 50; this->timers[0] = 50;
func_800F4BE8(); Audio_ResetIncreasingTranspose();
this->attackAngleMod = Rand_CenteredFloat(0x1000); this->attackAngleMod = Rand_CenteredFloat(0x1000);
} }
} else { } else {
@ -772,7 +772,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
this->timers[0] = 150; this->timers[0] = 150;
this->mashCounter = 0; this->mashCounter = 0;
this->sfxTimer = 30; this->sfxTimer = 30;
func_800F4BE8(); Audio_ResetIncreasingTranspose();
func_80064520(globalCtx, &globalCtx->csCtx); func_80064520(globalCtx, &globalCtx->csCtx);
this->csCamera = Gameplay_CreateSubCamera(globalCtx); this->csCamera = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT); Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);

View file

@ -50,8 +50,8 @@ typedef enum {
/* 7 */ MO_CORE_FLOAT_MAX /* 7 */ MO_CORE_FLOAT_MAX
} BossMoCoreF32Var; } BossMoCoreF32Var;
#define MO_SHORT_MAX MAX(MO_TENT_SHORT_MAX, MO_CORE_SHORT_MAX) #define MO_SHORT_MAX MAX((s32)MO_TENT_SHORT_MAX, (s32)MO_CORE_SHORT_MAX)
#define MO_FLOAT_MAX MAX(MO_TENT_FLOAT_MAX, MO_CORE_FLOAT_MAX) #define MO_FLOAT_MAX MAX((s32)MO_TENT_FLOAT_MAX, (s32)MO_CORE_FLOAT_MAX)
typedef struct BossMo { typedef struct BossMo {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;

View file

@ -176,7 +176,7 @@ static f32 sGrowingScale[] = {
270.0f, 270.0f,
}; };
static u8 sPitchSmallFrog[] = { static u8 sSmallFrogNotes[] = {
5, // C-Down Ocarina 5, // C-Down Ocarina
2, // A Button Ocarina 2, // A Button Ocarina
9, // C-Right Ocarina 9, // C-Right Ocarina
@ -184,7 +184,7 @@ static u8 sPitchSmallFrog[] = {
14, // C Up Ocarina 14, // C Up Ocarina
}; };
static s8 sPitchLargeFrog[] = { static s8 sLargeFrogNotes[] = {
-7, // C-Down Ocarina -7, // C-Down Ocarina
-10, // A Button Ocarina -10, // A Button Ocarina
-3, // C-Right Ocarina -3, // C-Right Ocarina
@ -583,15 +583,15 @@ void EnFr_UpdateActive(Actor* thisx, GlobalContext* globalCtx) {
s32 EnFr_SetupJumpingUp(EnFr* this, s32 frogIndex) { s32 EnFr_SetupJumpingUp(EnFr* this, s32 frogIndex) {
EnFr* frog = sEnFrPointers.frogs[frogIndex]; EnFr* frog = sEnFrPointers.frogs[frogIndex];
u8 audioPitch; u8 semitone;
if (frog != NULL && frog->isJumpingUp == false) { if (frog != NULL && frog->isJumpingUp == false) {
audioPitch = frog->growingScaleIndex == 3 ? sPitchLargeFrog[frogIndex] : sPitchSmallFrog[frogIndex]; semitone = frog->growingScaleIndex == 3 ? sLargeFrogNotes[frogIndex] : sSmallFrogNotes[frogIndex];
if (this->songIndex == FROG_CHOIR_SONG) { if (this->songIndex == FROG_CHOIR_SONG) {
frog->isJumpingToFrogSong = true; frog->isJumpingToFrogSong = true;
} }
frog->isJumpingUp = true; frog->isJumpingUp = true;
func_800F4BF4(&frog->actor.projectedPos, NA_SE_EV_FROG_JUMP, (s8)audioPitch); Audio_PlaySoundTransposed(&frog->actor.projectedPos, NA_SE_EV_FROG_JUMP, semitone);
return true; return true;
} else { } else {
return false; return false;

View file

@ -85,19 +85,19 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->type = (this->actor.params >> 0xC) & 0xF; this->type = (this->actor.params >> 0xC) & 0xF;
this->switchFlag = this->actor.params & 0x3F; this->switchFlag = this->actor.params & 0x3F;
this->numEffects = ARRAY_COUNT(this->effects); this->numEffects = ARRAY_COUNT(this->effects);
// index // "index"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type);
// save // "save"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ\t ☆☆☆☆☆ %x\n" VT_RST, this->switchFlag); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ\t ☆☆☆☆☆ %x\n" VT_RST, this->switchFlag);
switch (this->type) { switch (this->type) {
case ENGSWITCH_SILVER_TRACKER: case ENGSWITCH_SILVER_TRACKER:
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
// parent switch spawn // "parent switch spawn"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params);
sCollectedCount = 0; sCollectedCount = 0;
this->silverCount = this->actor.params >> 6; this->silverCount = this->actor.params >> 6;
this->silverCount &= 0x3F; this->silverCount &= 0x3F;
// maximum number of checks // "maximum number of checks"
osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount); osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount);
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
if (Flags_GetSwitch(globalCtx, this->switchFlag)) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
@ -110,7 +110,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
break; break;
case ENGSWITCH_SILVER_RUPEE: case ENGSWITCH_SILVER_RUPEE:
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
// child switch spawn // "child switch spawn"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 子スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 子スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params);
this->colorIdx = 5; this->colorIdx = 5;
this->numEffects = 20; this->numEffects = 20;
@ -128,7 +128,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
break; break;
case ENGSWITCH_ARCHERY_POT: case ENGSWITCH_ARCHERY_POT:
osSyncPrintf("\n\n"); osSyncPrintf("\n\n");
// Horseback archery destructible pot // "Horseback archery destructible pot"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめぶち抜き壷 ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめぶち抜き壷 ☆☆☆☆☆ \n" VT_RST);
this->actor.gravity = -3.0f; this->actor.gravity = -3.0f;
this->colorIdx = Rand_ZeroFloat(2.99f); this->colorIdx = Rand_ZeroFloat(2.99f);
@ -142,9 +142,9 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->objIndex = Object_GetIndex(&globalCtx->objectCtx, this->objId); this->objIndex = Object_GetIndex(&globalCtx->objectCtx, this->objId);
if (this->objIndex < 0) { if (this->objIndex < 0) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
// what? // "what?"
osSyncPrintf(VT_FGCOL(PURPLE) " なにみの? %d\n" VT_RST "\n", this->objIndex); osSyncPrintf(VT_FGCOL(PURPLE) " なにみの? %d\n" VT_RST "\n", this->objIndex);
// bank is funny // "bank is funny"
osSyncPrintf(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params); osSyncPrintf(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params);
} }
this->collider.dim.radius = 24; this->collider.dim.radius = 24;
@ -208,21 +208,21 @@ void EnGSwitch_WaitForObject(EnGSwitch* this, GlobalContext* globalCtx) {
} }
void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, GlobalContext* globalCtx) { void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, GlobalContext* globalCtx) {
static s8 rupeePitches[] = { 0, 2, 4, 5, 7 }; static s8 majorScale[] = { 0, 2, 4, 5, 7 };
if (this->pitchIndex < sCollectedCount) { if (this->noteIndex < sCollectedCount) {
if (sCollectedCount < 5) { if (sCollectedCount < 5) {
// sound? // "sound?"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->pitchIndex); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->noteIndex);
func_800F4BF4(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, rupeePitches[this->pitchIndex]); Audio_PlaySoundTransposed(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]);
this->pitchIndex = sCollectedCount; this->noteIndex = sCollectedCount;
} }
} }
if (sCollectedCount >= this->silverCount) { if (sCollectedCount >= this->silverCount) {
// It is now the end of the century. // "It is now the end of the century."
// This another reference to Hokuto no Ken. // This another reference to Hokuto no Ken.
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 時はまさに世紀末〜 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 時はまさに世紀末〜 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
// Last! // "Last!"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ らすとぉ! ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ らすとぉ! ☆☆☆☆☆ \n" VT_RST);
if ((globalCtx->sceneNum == SCENE_MEN) && (this->actor.room == 2)) { if ((globalCtx->sceneNum == SCENE_MEN) && (this->actor.room == 2)) {
Flags_SetTempClear(globalCtx, this->actor.room); Flags_SetTempClear(globalCtx, this->actor.room);
@ -346,7 +346,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) {
gallery->targetState[this->index] = ENSYATEKIHIT_HIT; gallery->targetState[this->index] = ENSYATEKIHIT_HIT;
func_80078884(NA_SE_EV_HIT_SOUND); func_80078884(NA_SE_EV_HIT_SOUND);
func_80078884(NA_SE_SY_GET_RUPY); func_80078884(NA_SE_SY_GET_RUPY);
// Yeah ! // "Yeah !"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ いぇぇーす!HIT!! ☆☆☆☆☆ %d\n" VT_RST, gallery->hitCount); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ いぇぇーす!HIT!! ☆☆☆☆☆ %d\n" VT_RST, gallery->hitCount);
EnGSwitch_Break(this, globalCtx); EnGSwitch_Break(this, globalCtx);
this->killTimer = 50; this->killTimer = 50;

View file

@ -50,7 +50,7 @@ typedef struct EnGSwitch {
/* 0x0164 */ s16 waitTimer; // time rupee waits before retreating /* 0x0164 */ s16 waitTimer; // time rupee waits before retreating
/* 0x0166 */ s16 moveMode; // Type of movement in the shooting gallery /* 0x0166 */ s16 moveMode; // Type of movement in the shooting gallery
/* 0x0168 */ s16 moveState; // Appear or retreat (for blue rupees and the stationary green one) /* 0x0168 */ s16 moveState; // Appear or retreat (for blue rupees and the stationary green one)
/* 0x016A */ s16 pitchIndex; /* 0x016A */ s16 noteIndex;
/* 0x016C */ Vec3f targetPos; /* 0x016C */ Vec3f targetPos;
/* 0x0178 */ s8 objIndex; /* 0x0178 */ s8 objIndex;
/* 0x017C */ ColliderCylinder collider; /* 0x017C */ ColliderCylinder collider;

View file

@ -605,7 +605,8 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) {
void func_80A7A304(EnIn* this, GlobalContext* globalCtx) { void func_80A7A304(EnIn* this, GlobalContext* globalCtx) {
if (this->skelAnime.animation == &object_in_Anim_015814 || this->skelAnime.animation == &object_in_Anim_01646C) { if (this->skelAnime.animation == &object_in_Anim_015814 || this->skelAnime.animation == &object_in_Anim_01646C) {
if (this->skelAnime.curFrame == 8.0f) { if (this->skelAnime.curFrame == 8.0f) {
func_800F41E0(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0, 2); Audio_PlaySoundRandom(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0,
NA_SE_VO_IN_LASH_1 - NA_SE_VO_IN_LASH_0 + 1);
} }
} }
if (this->skelAnime.animation == &object_in_Anim_018C38 && this->skelAnime.curFrame == 20.0f) { if (this->skelAnime.animation == &object_in_Anim_018C38 && this->skelAnime.curFrame == 20.0f) {

View file

@ -141,7 +141,7 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) {
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) { CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) {
if (globalCtx->sceneLoadFlag != 20) { if (globalCtx->sceneLoadFlag != 20) {
func_800F68BC(0); Audio_SetCutsceneFlag(0);
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8); &D_801333E8);

View file

@ -34,7 +34,7 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) {
this->pathIndex = (this->actor.params >> 8) & 0xFF; this->pathIndex = (this->actor.params >> 8) & 0xFF;
this->actor.params = this->actor.params & 0xFF; this->actor.params = this->actor.params & 0xFF;
if (this->actor.params >= RS_MAX) { if (this->actor.params >= RS_MAX) { // used for ganon and ganon_boss scenes
func_800F4870(this->actor.params - RS_MAX); func_800F4870(this->actor.params - RS_MAX);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else if (this->actor.params == RS_UNK_F7) { } else if (this->actor.params == RS_UNK_F7) {
@ -51,9 +51,9 @@ void EnRiverSound_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnRiverSound* this = THIS; EnRiverSound* this = THIS;
if (this->actor.params == RS_SARIAS_SONG) { if (this->actor.params == RS_SARIAS_SONG) {
func_800F50EC(&this->actor.projectedPos); Audio_ClearSariaBgmAtPos(&this->actor.projectedPos);
} else if (this->actor.params == RS_UNK_13) { } else if (this->actor.params == RS_UNK_13) {
func_800F5504(); Audio_ClearSariaBgm2();
} }
} }
@ -236,15 +236,15 @@ void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->playSound = true; this->playSound = true;
} else if ((this->actor.params == RS_UNK_0) || (this->actor.params == RS_UNK_4) || } else if ((this->actor.params == RS_UNK_0) || (this->actor.params == RS_UNK_4) ||
(this->actor.params == RS_UNK_5)) { (this->actor.params == RS_UNK_5)) {
func_800F4634(&this->actor.projectedPos, soundPitch[this->soundPitchIndex]); Audio_PlaySoundRiver(&this->actor.projectedPos, soundPitch[this->soundPitchIndex]);
} else if (this->actor.params == RS_UNK_11) { } else if (this->actor.params == RS_UNK_11) {
func_800F4A54(90); func_800F4A54(90);
} else if (this->actor.params == RS_SARIAS_SONG) { } else if (this->actor.params == RS_SARIAS_SONG) {
func_800F4E30(&this->actor.projectedPos, this->actor.xzDistToPlayer); func_800F4E30(&this->actor.projectedPos, this->actor.xzDistToPlayer);
} else if (this->actor.params == RS_UNK_13) { } else if (this->actor.params == RS_UNK_13) {
func_800F52A0(&this->actor.home.pos, 62, 1000); Audio_PlaySariaBgm(&this->actor.home.pos, 62, 1000);
} else if (this->actor.params == RS_UNK_19) { } else if (this->actor.params == RS_UNK_19) {
func_800F52A0(&this->actor.home.pos, 40, 800); Audio_PlaySariaBgm(&this->actor.home.pos, 40, 800);
} else if ((this->actor.params == RS_SANDSTORM) || (this->actor.params == RS_CHAMBER_OF_SAGES_1) || } else if ((this->actor.params == RS_SANDSTORM) || (this->actor.params == RS_CHAMBER_OF_SAGES_1) ||
(this->actor.params == RS_CHAMBER_OF_SAGES_2) || (this->actor.params == RS_RUMBLING)) { (this->actor.params == RS_CHAMBER_OF_SAGES_2) || (this->actor.params == RS_RUMBLING)) {
func_800788CC(soundEffects[this->actor.params]); func_800788CC(soundEffects[this->actor.params]);

View file

@ -1443,7 +1443,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) { if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT; sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
} }
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) { if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) { if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState =
SKULL_KID_OCARINA_PLAY_NOTES; SKULL_KID_OCARINA_PLAY_NOTES;
@ -1456,7 +1456,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) { if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT; sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
} }
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) { if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
func_80106AA8(globalCtx); func_80106AA8(globalCtx);
this->songFailTimer = 160; this->songFailTimer = 160;
} }
@ -1477,7 +1477,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
break; break;
case 0x30: case 0x30:
if (func_800F8FF4(NA_SE_SY_METRONOME) == 0) { if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) { if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState =
SKULL_KID_OCARINA_PLAY_NOTES; SKULL_KID_OCARINA_PLAY_NOTES;

View file

@ -1605,7 +1605,7 @@ void EnZl2_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (thisx->params) { switch (thisx->params) {
case 1: case 1:
func_800F7260(0x6F); Audio_SetSoundBanksMute(0x6F);
break; break;
case 4: case 4:
gSaveContext.timer2State = 0; gSaveContext.timer2State = 0;

View file

@ -1018,7 +1018,7 @@ void func_80B55808(EnZl3* this) {
} }
void func_80B5582C(EnZl3* this) { void func_80B5582C(EnZl3* this) {
func_800F41E0(&D_80B5A488, NA_SE_VO_Z1_CRY_0, 2); Audio_PlaySoundRandom(&D_80B5A488, NA_SE_VO_Z1_CRY_0, NA_SE_VO_Z1_CRY_1 - NA_SE_VO_Z1_CRY_0 + 1);
} }
void func_80B5585C(EnZl3* this) { void func_80B5585C(EnZl3* this) {

View file

@ -9427,7 +9427,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) {
} }
if (this->actor.category == ACTORCAT_PLAYER) { if (this->actor.category == ACTORCAT_PLAYER) {
func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId)); Audio_SetCodeReverb(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId));
if (this->actor.floorBgId == BGCHECK_SCENE) { if (this->actor.floorBgId == BGCHECK_SCENE) {
func_80074CE8(globalCtx, func_80074CE8(globalCtx,