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

Various SFX fixes (#237)

* Various SFX fixes

* Fix sfx references in z_en_zl2.c
This commit is contained in:
Roman971 2020-07-05 05:30:21 +02:00 committed by GitHub
parent a5aee3d691
commit 61544b873d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 362 additions and 342 deletions

View file

@ -1697,16 +1697,16 @@ void func_8002F850(GlobalContext* globalCtx, Actor* actor) {
if (actor->bgCheckFlags & 0x20) {
if (actor->waterY < 20.0f) {
sfxId = NA_SE_PL_WALK_WATER0;
sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG;
} else {
sfxId = NA_SE_PL_WALK_WATER1;
sfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG;
}
} else {
sfxId = func_80041F34(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource);
}
func_80078914(&actor->projectedPos, NA_SE_EV_BOMB_BOUND);
func_80078914(&actor->projectedPos, sfxId + 0x800);
func_80078914(&actor->projectedPos, sfxId + SFX_FLAG);
}
void func_8002F8F0(Actor* actor, u16 sfxId) {
@ -1732,15 +1732,15 @@ void func_8002F974(Actor* actor, u16 sfxId) {
actor->sfx = sfxId;
}
void func_8002F994(Actor* actor, s32 sfxId) {
void func_8002F994(Actor* actor, s32 arg1) {
actor->flags |= 0x10000000;
actor->flags &= ~0x00380000;
if (sfxId < NA_SE_PL_LAND_GRASS) {
actor->sfx = NA_SE_PL_WALK_DIRT;
} else if (sfxId < NA_SE_PL_DIVE_BUBBLE) {
actor->sfx = NA_SE_PL_WALK_CONCRETE;
if (arg1 < 40) {
actor->sfx = NA_SE_PL_WALK_DIRT - SFX_FLAG;
} else if (arg1 < 100) {
actor->sfx = NA_SE_PL_WALK_CONCRETE - SFX_FLAG;
} else {
actor->sfx = NA_SE_PL_WALK_SAND;
actor->sfx = NA_SE_PL_WALK_SAND - SFX_FLAG;
}
}
@ -2263,7 +2263,7 @@ void func_80030ED8(Actor* actor) {
} else if (actor->flags & 0x200000) {
func_800788CC(actor->sfx);
} else if (actor->flags & 0x10000000) {
func_800F4C58(&D_801333D4, 0x2021, (s8)(actor->sfx - 1));
func_800F4C58(&D_801333D4, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1));
} else {
func_80078914(&actor->projectedPos, actor->sfx);
}

View file

@ -3518,7 +3518,7 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode, u8 arg2) {
if (camera->status == 7) {
switch (phi_v0) {
case 1:
func_80078884(NA_SE_PL_WALK_GROUND);
func_80078884(NA_SE_PL_WALK_GROUND - SFX_FLAG);
break;
case 2:
if (1 == camera->globalCtx->roomCtx.curRoom.unk_03) {

View file

@ -1408,14 +1408,14 @@ s32 func_8005E4F8(Collider* left, ColliderBody* rightBody) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
} else if (rightBody->flags == 1) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
} else if (2 == rightBody->flags) {
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
} else if (rightBody->flags == 2) {
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
} else if (rightBody->flags == 3) {
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
}
}
}

View file

@ -358,7 +358,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
if (sp3F != 0) {
globalCtx->envCtx.unk_E6 = 1;
}
func_800788CC(0x20C0);
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
break;
case 33:
gSaveContext.unk_1422 = 1;

View file

@ -317,7 +317,7 @@ void func_8001D608(EnAObj* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxMinF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
if (this->dyna.actor.speedXZ != 0.0f) {
Audio_PlayActorSound2(&this->dyna.actor, 0x200A);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
}
this->dyna.unk_154 = 0.0f;

View file

@ -2422,7 +2422,8 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
gSaveContext.magic += 4;
if (gSaveContext.gameMode == 0 && gSaveContext.sceneSetupIndex < 4) {
Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
}
// Translates to: "Storage MAGIC_NOW=%d (%d)"
@ -2550,7 +2551,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
break;
case 10:
gSaveContext.magic += 4;
Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (gSaveContext.magic >= gSaveContext.unk_13F8) {
gSaveContext.magic = gSaveContext.unk_13F8;
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;

View file

@ -404,8 +404,8 @@ void Gameplay_Init(GlobalContext* globalCtx) {
Interface_SetSceneRestrictions(globalCtx);
func_800758AC(globalCtx);
gSaveContext.seqIndex = globalCtx->soundCtx.musicSeq;
gSaveContext.nightSeqIndex = globalCtx->soundCtx.nighttimeSFX;
gSaveContext.seqIndex = globalCtx->soundCtx.seqIndex;
gSaveContext.nightSeqIndex = globalCtx->soundCtx.nightSeqIndex;
func_8002DF18(globalCtx, PLAYER);
func_800A390C(globalCtx, &globalCtx->animationCtx);
gSaveContext.respawnFlag = 0;
@ -714,7 +714,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
break;
case 13:
Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (globalCtx->sceneLoadFlag == -0x14) {
if (globalCtx->envCtx.unk_E7 < 0x6E) {
gTrnsnUnkState = 0;
@ -747,7 +747,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
break;
case 15:
Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (globalCtx->sceneLoadFlag == -0x14) {
if (globalCtx->envCtx.unk_E7 <= 0) {
gTrnsnUnkState = 0;

View file

@ -441,8 +441,8 @@ void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) {
// Scene Command 0x15: Sound Settings
void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq;
globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX;
globalCtx->soundCtx.seqIndex = cmd->soundSettings.seqIndex;
globalCtx->soundCtx.nightSeqIndex = cmd->soundSettings.nightSeqIndex;
if (gSaveContext.seqIndex == 0xFF) {
Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000);