1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Document parts of audio (#1000)

* Minor labelling

* progress

* play percentage -> delay

* duration -> gatetime

* more

* more

* more

* seqIdx -> playerIdx

* more

* more

* more

* more

* format

* fix comment

* filters

* more

* media

* confusion

* Sync load is actually slow load

* AudioHeap prefix

* more

* more

* reformat

* more

* more

* AudioLoad

* more

* more

* seq banks

* more consistent

* more

* name last function in audio_load

* More audio_synthesis

* clean up audio tables

* minor

* slow/fast load ramAddr

* format

* remove unused

* Remove union

* remove padding

* audio bank -> sound font

* seqLayer -> layer

* stuff

* seqChannel -> channel

* ChannelLayer -> Layer

* remove define, add bug comment

* format

* more

* cache enum

* more

* AudioSeq function prefix

* naming

* bankIdx -> bankId

* more

* format

* review

* more

* fixes

* avoid hardcoded sfxid's

* SE -> Sfx

Co-authored-by: zelda2774 <zelda2774@invalid>
This commit is contained in:
zelda2774 2021-11-07 17:58:50 +01:00 committed by GitHub
parent 823a3c0754
commit 5ad7cf9dbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 3493 additions and 3508 deletions

View file

@ -72,7 +72,7 @@ void BgHakaShip_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgHakaShip* this = THIS;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
func_800F89E8(&this->bellSoundPos);
Audio_StopSfxByPos(&this->bellSoundPos);
}
void BgHakaShip_ChildUpdatePosition(BgHakaShip* this, GlobalContext* globalCtx) {

View file

@ -200,7 +200,7 @@ void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyCylinder(globalCtx, &this->colliderCylinder);
}
func_800F89E8(&this->unk_16C);
Audio_StopSfxByPos(&this->unk_16C);
}
void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) {

View file

@ -112,7 +112,7 @@ void BgHidanRock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(globalCtx, &this->collider);
func_800F89E8(&this->unk_170);
Audio_StopSfxByPos(&this->unk_170);
}
void func_8088B24C(BgHidanRock* this) {

View file

@ -335,7 +335,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, GlobalContext* globalCtx) {
if (this->unk16C > 3.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WEB_VIBRATION);
} else {
Audio_StopSfx(NA_SE_EV_WEB_VIBRATION);
Audio_StopSfxById(NA_SE_EV_WEB_VIBRATION);
}
}
BgYdanSp_UpdateFloorWebCollision(this);

View file

@ -688,7 +688,7 @@ void BossFd2_Death(BossFd2* this, GlobalContext* globalCtx) {
if ((this->work[FD2_HOLE_COUNTER] == 1) || (this->work[FD2_HOLE_COUNTER] == 40)) {
this->work[FD2_SCREAM_TIMER] = 20;
if (this->work[FD2_HOLE_COUNTER] == 40) {
Audio_StopSfx(NA_SE_EN_VALVAISA_DEAD);
Audio_StopSfxById(NA_SE_EN_VALVAISA_DEAD);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_VALVAISA_DAMAGE2);

View file

@ -1022,11 +1022,11 @@ void func_808FFCFC(BossGanon2* this, GlobalContext* globalCtx) {
ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2800) {
this->unk_311 = false;
func_80900580(this, globalCtx);
Audio_StopSfx(NA_SE_EN_MGANON_UNARI);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
} else if ((this->actor.bgCheckFlags & 8) && func_808FFA24(this, globalCtx)) {
this->unk_311 = false;
func_80900580(this, globalCtx);
Audio_StopSfx(NA_SE_EN_MGANON_UNARI);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
}
}
@ -1889,12 +1889,12 @@ void func_80902524(BossGanon2* this, GlobalContext* globalCtx) {
func_809000A0(this, globalCtx);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
Audio_StopSfx(NA_SE_EN_MGANON_UNARI);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
} else if ((this->actionFunc == func_80900890) && (acHitInfo->toucher.dmgFlags & 0x9000200)) {
this->unk_316 = 60;
this->unk_342 = 5;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
Audio_StopSfx(NA_SE_EN_MGANON_UNARI);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
this->actor.colChkInfo.health -= 2;
temp_v0_4 = this->actor.colChkInfo.health;
if (temp_v0_4 < 0x15 && this->unk_334 == 0) {
@ -1920,7 +1920,7 @@ void func_80902524(BossGanon2* this, GlobalContext* globalCtx) {
this->unk_344 = 0x32;
this->unk_342 = 5;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MGANON_DAMAGE);
Audio_StopSfx(NA_SE_EN_MGANON_UNARI);
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
phi_v1_2 = 1;
if (acHitInfo->toucher.dmgFlags & 0x9000200) {
if (acHitInfo->toucher.dmgFlags & 0x8000000) {

View file

@ -1837,7 +1837,7 @@ void BossGoma_UpdateHit(BossGoma* this, GlobalContext* globalCtx) {
} else if (this->actionFunc != BossGoma_FloorStunned && this->patienceTimer != 0 &&
(acHitInfo->toucher.dmgFlags & 0x00000005)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_DAM2);
Audio_StopSfx(NA_SE_EN_GOMA_CRY1);
Audio_StopSfxById(NA_SE_EN_GOMA_CRY1);
this->invincibilityFrames = 10;
BossGoma_SetupFloorStunned(this);
this->sfxFaintTimer = 100;

View file

@ -2262,7 +2262,7 @@ void BossMo_UpdateTent(Actor* thisx, GlobalContext* globalCtx) {
this->actor.draw = NULL;
if (this->tent2KillTimer > 20) {
Actor_Kill(&this->actor);
func_800F89E8(&this->tentTipPos);
Audio_StopSfxByPos(&this->tentTipPos);
sMorphaTent2 = NULL;
}
return;

View file

@ -342,7 +342,7 @@ void BossSst_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyJntSph(globalCtx, &this->colliderJntSph);
Collider_DestroyCylinder(globalCtx, &this->colliderCyl);
func_800F89E8(&this->center);
Audio_StopSfxByPos(&this->center);
}
void BossSst_HeadSetupLurk(BossSst* this) {

View file

@ -338,7 +338,7 @@ void EnDivingGame_SetupRupeeThrow(EnDivingGame* this, GlobalContext* globalCtx)
void EnDivingGame_RupeeThrow(EnDivingGame* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (func_800C0DB4(globalCtx, &this->actor.projectedPos)) {
func_800F6828(0);
Audio_SetExtraFilter(0);
}
if (this->subCamId != 0) {
Math_ApproachF(&this->camEye.x, this->unk_2D0.x, this->unk_2DC.x, this->unk_2E8.x * this->unk_318);

View file

@ -244,7 +244,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, GlobalContext* globalCtx) {
scorePos.y = this->actor.world.pos.y + 20.0f;
scorePos.z = this->actor.world.pos.z;
EffectSsExtra_Spawn(globalCtx, &scorePos, &scoreVel, &scoreAccel, 4, 2);
Audio_StopSfx(NA_SE_SY_TRE_BOX_APPEAR);
Audio_StopSfxById(NA_SE_SY_TRE_BOX_APPEAR);
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
// "Big hit"
osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 大当り ☆☆☆☆☆ %d\n" VT_RST, this->hitCounter);

View file

@ -838,7 +838,7 @@ void EnGeldB_SetupSlash(EnGeldB* this) {
this->action = GELDB_SLASH;
this->spinAttackState = 0;
this->actor.speedXZ = 0.0f;
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
EnGeldB_SetupAction(this, EnGeldB_Slash);
}
@ -1363,7 +1363,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) {
this->damageEffect = this->actor.colChkInfo.damageEffect;
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1);
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) ||
(this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) {
if (this->action != GELDB_STUNNED) {

View file

@ -506,12 +506,12 @@ s16 EnGo2_GetStateGoronCityLink(GlobalContext* globalCtx, EnGo2* this) {
if (globalCtx->msgCtx.choiceIndex == 0) {
this->actor.textId = gSaveContext.infTable[16] & 0x800 ? 0x3033 : 0x3035;
if (this->actor.textId == 0x3035) {
Audio_StopSfx(0x39EB);
Audio_StopSfxById(NA_SE_EN_GOLON_CRY);
}
} else {
this->actor.textId = gSaveContext.infTable[16] & 0x800 ? 0x3036 : 0x3033;
if (this->actor.textId == 0x3036) {
Audio_StopSfx(0x39EB);
Audio_StopSfxById(NA_SE_EN_GOLON_CRY);
}
}
func_8010B720(globalCtx, this->actor.textId);

View file

@ -899,7 +899,7 @@ void EnHorse_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnHorse* this = THIS;
if (this->stateFlags & ENHORSE_DRAW) {
func_800F89E8(&this->unk_21C);
Audio_StopSfxByPos(&this->unk_21C);
}
func_800A6888(globalCtx, &this->skin);
Collider_DestroyCylinder(globalCtx, &this->cyl1);

View file

@ -699,7 +699,7 @@ void EnPoField_SoulInteract(EnPoField* this, GlobalContext* globalCtx) {
}
if (func_8010BDBC(&globalCtx->msgCtx) == 4) {
if (func_80106BC8(globalCtx) != 0) {
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
if (globalCtx->msgCtx.choiceIndex == 0) {
if (Inventory_HasEmptyBottle()) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_BIG_GET);

View file

@ -443,7 +443,7 @@ void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) {
void func_80ADE950(EnPoh* this, s32 arg1) {
if (arg1) {
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
}
this->actionFunc = func_80AE009C;
@ -816,7 +816,7 @@ void EnPoh_TalkRegular(EnPoh* this, GlobalContext* globalCtx) {
}
if (func_8010BDBC(&globalCtx->msgCtx) == 4) {
if (func_80106BC8(globalCtx) != 0) {
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG);
if (globalCtx->msgCtx.choiceIndex == 0) {
if (Inventory_HasEmptyBottle()) {
this->actor.textId = 0x5008;

View file

@ -894,7 +894,7 @@ void func_80860F84(EnTest* this, GlobalContext* globalCtx) {
void EnTest_SetupSlashDown(EnTest* this) {
Animation_PlayOnce(&this->skelAnime, &gStalfosDownSlashAnim);
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
this->swordCollider.base.atFlags &= ~AT_BOUNCED;
this->unk_7C8 = 0x10;
this->actor.speedXZ = 0.0f;
@ -1076,7 +1076,7 @@ void EnTest_JumpBack(EnTest* this, GlobalContext* globalCtx) {
void EnTest_SetupJumpslash(EnTest* this) {
Animation_PlayOnce(&this->skelAnime, &gStalfosJumpAnim);
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
this->timer = 0;
this->unk_7C8 = 0x17;
this->actor.velocity.y = 10.0f;
@ -1669,7 +1669,7 @@ void EnTest_UpdateDamage(EnTest* this, GlobalContext* globalCtx) {
this->unk_7DC = player->unk_845;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, false);
func_800F8A44(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
if ((this->actor.colChkInfo.damageEffect == STALFOS_DMGEFF_STUN) ||
(this->actor.colChkInfo.damageEffect == STALFOS_DMGEFF_FREEZE) ||

View file

@ -404,7 +404,7 @@ void EnViewer_UpdateImpl(EnViewer* this, GlobalContext* globalCtx) {
break;
}
} else {
func_800F67A0(0);
Audio_SetBaseFilter(0);
switch (this->state) {
case 0:
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &object_opening_demo1_Anim_00504C, 1.0f);

View file

@ -307,7 +307,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
if ((player->stateFlags1 & 0x100000) || (player->stateFlags1 & 0x8000000) || !(player->actor.bgCheckFlags & 1) ||
((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos)))) {
Audio_StopSfx(NA_SE_EN_FALL_AIM);
Audio_StopSfxById(NA_SE_EN_FALL_AIM);
this->timer = 0x82;
}

View file

@ -177,7 +177,7 @@ void func_80B42F74(EnYabusameMark* this, GlobalContext* globalCtx) {
func_800F5C64(NA_BGM_ITEM_GET | 0x900);
}
if (scoreIndex == 1) {
Audio_StopSfx(NA_SE_SY_TRE_BOX_APPEAR);
Audio_StopSfxById(NA_SE_SY_TRE_BOX_APPEAR);
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
}
if (scoreIndex == 0) {

View file

@ -1292,7 +1292,7 @@ void func_808326F0(Player* this) {
s32 i;
for (i = 0; i < 4; i++) {
Audio_StopSfx((u16)(*entry + this->ageProperties->unk_92));
Audio_StopSfxById((u16)(*entry + this->ageProperties->unk_92));
entry++;
}
}
@ -5540,10 +5540,10 @@ void func_8083D36C(GlobalContext* globalCtx, Player* this) {
void func_8083D53C(GlobalContext* globalCtx, Player* this) {
if (this->actor.yDistToWater < this->ageProperties->unk_2C) {
func_800F67A0(0);
Audio_SetBaseFilter(0);
this->unk_840 = 0;
} else {
func_800F67A0(32);
Audio_SetBaseFilter(0x20);
if (this->unk_840 < 300) {
this->unk_840++;
}