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

Rename "Sound" to "Sfx" (#1292)

* First attempt

* More

* rename

* more sound -> sfx / sound effect (#7)

* PR Suggestions

* PR Suggestions

* Small fix

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
engineer124 2022-07-30 07:05:27 -06:00 committed by GitHub
parent 1652b7e5d7
commit 1d19f37b26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
321 changed files with 2879 additions and 2904 deletions

View file

@ -502,7 +502,7 @@ void EnJj_Update(EnJj *this, PlayState *play) {
} else { } else {
this->actionFunc(this); this->actionFunc(this);
if (this->skelAnime.curFrame == 41.0f) { if (this->skelAnime.curFrame == 41.0f) {
Audio_PlayActorSound2((Actor *) this, (u16)0x28B6U); Audio_PlayActorSfx2((Actor *) this, (u16)0x28B6U);
} }
} }
func_80A87B1C(this); func_80A87B1C(this);
@ -526,7 +526,7 @@ void EnJj_Update(Actor *thisx, PlayState *play) {
} else { } else {
this->actionFunc(this, play); this->actionFunc(this, play);
if (this->skelAnime.curFrame == 41.0f) { if (this->skelAnime.curFrame == 41.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_JABJAB_GROAN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_JABJAB_GROAN);
} }
} }
func_80A87B1C(this); func_80A87B1C(this);
@ -687,7 +687,7 @@ void func_80A87D94(EnJj *this, PlayState *play) {
} }
} }
if ((phi_v1 & 1) != 0) { if ((phi_v1 & 1) != 0) {
Audio_PlayActorSound2((Actor *) this, (u16)0x206DU); Audio_PlayActorSfx2((Actor *) this, (u16)0x206DU);
temp_v0_2 = this->unk_308; temp_v0_2 = this->unk_308;
if ((s32) temp_v0_2 >= -0x1450) { if ((s32) temp_v0_2 >= -0x1450) {
this->unk_308 = temp_v0_2 - 0x66; this->unk_308 = temp_v0_2 - 0x66;
@ -763,7 +763,7 @@ void func_80A87D94(EnJj *this, PlayState *play) {
break; break;
} }
if ((phi_v1 & 1) != 0) { if ((phi_v1 & 1) != 0) {
Audio_PlayActorSound2((Actor *) this, (u16)0x206DU); Audio_PlayActorSfx2((Actor *) this, (u16)0x206DU);
temp_v0_2 = this->unk_308; temp_v0_2 = this->unk_308;
if ((s32) temp_v0_2 >= -0x1450) { if ((s32) temp_v0_2 >= -0x1450) {
this->unk_308 = temp_v0_2 - 0x66; this->unk_308 = temp_v0_2 - 0x66;
@ -771,9 +771,9 @@ void func_80A87D94(EnJj *this, PlayState *play) {
} }
} }
``` ```
(notice that this time we need a `default` to deal with the innermost if contents). If you try to replace `0x206D` in the `Audio_PlayActorSound2`, you will find there is no such sfxId in the list: this is because some sound effects have an extra offset of `0x800` to do with setting flags. Adding `0x800` to the sfxId shows that this sound effect is `NA_SE_EV_JABJAB_BREATHE`. To correct this to the id in the function, we have a macro `SFX_FLAG`, and it should therefore be (notice that this time we need a `default` to deal with the innermost if contents). If you try to replace `0x206D` in the `Audio_PlayActorSfx2`, you will find there is no such sfxId in the list: this is because some sound effects have an extra offset of `0x800` to do with setting flags. Adding `0x800` to the sfxId shows that this sound effect is `NA_SE_EV_JABJAB_BREATHE`. To correct this to the id in the function, we have a macro `SFX_FLAG`, and it should therefore be
```C ```C
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG);
``` ```
As usual, most of the remaining temps look fake. The only one that does not is possibly `phi_v1`. However, the way in which they are used here makes it hard to tell if they are fake, and if so, how to replace them. I encourage you to try this yourself, with the aid of the diff script; the final, matching result, with other cleanup, is hidden below As usual, most of the remaining temps look fake. The only one that does not is possibly `phi_v1`. However, the way in which they are used here makes it hard to tell if they are fake, and if so, how to replace them. I encourage you to try this yourself, with the aid of the diff script; the final, matching result, with other cleanup, is hidden below
@ -814,7 +814,7 @@ void func_80A87D94(EnJj* this, PlayState* play) {
break; break;
} }
if ((this->unk_30A & 1) != 0) { if ((this->unk_30A & 1) != 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_JABJAB_BREATHE - SFX_FLAG);
if (this->unk_308 >= -5200) { if (this->unk_308 >= -5200) {
this->unk_308 -= 102; this->unk_308 -= 102;
} }

View file

@ -320,7 +320,7 @@ void EffectSsExtra_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
void EffectSsFCircle_Spawn(PlayState* play, Actor* actor, Vec3f* pos, s16 radius, s16 height); void EffectSsFCircle_Spawn(PlayState* play, Actor* actor, Vec3f* pos, s16 radius, s16 height);
void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused, s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused,
s32 arg14, s16 playSound); s32 arg14, s16 playSfx);
void EffectSsDeadDd_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, void EffectSsDeadDd_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s16 primR, s16 primG, s16 primB, s16 alpha, s16 envR, s16 envG, s16 envB, s16 alphaStep, s16 primR, s16 primG, s16 primB, s16 alpha, s16 envR, s16 envG, s16 envB, s16 alphaStep,
s32 life); s32 life);
@ -443,7 +443,7 @@ void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5); void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5);
void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4); void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_8002F7DC(Actor* actor, u16 sfxId); void func_8002F7DC(Actor* actor, u16 sfxId);
void Audio_PlayActorSound2(Actor* actor, u16 sfxId); void Audio_PlayActorSfx2(Actor* actor, u16 sfxId);
void func_8002F850(PlayState* play, Actor* actor); void func_8002F850(PlayState* play, Actor* actor);
void func_8002F8F0(Actor* actor, u16 sfxId); void func_8002F8F0(Actor* actor, u16 sfxId);
void func_8002F91C(Actor* actor, u16 sfxId); void func_8002F91C(Actor* actor, u16 sfxId);
@ -795,7 +795,7 @@ void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v); void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v); void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v); void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Vec3f* pos); void CollisionCheck_SpawnShieldParticlesMetalSfx(PlayState* play, Vec3f* v, Vec3f* pos);
void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v); void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* actorPos); void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* actorPos);
s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos,
@ -825,9 +825,9 @@ void Cutscene_HandleConditionalTriggers(PlayState* play);
void Cutscene_SetSegment(PlayState* play, void* segment); void Cutscene_SetSegment(PlayState* play, void* segment);
void* MemCpy(void* dest, const void* src, s32 len); void* MemCpy(void* dest, const void* src, s32 len);
void GetItem_Draw(PlayState* play, s16 drawId); void GetItem_Draw(PlayState* play, s16 drawId);
void SoundSource_InitAll(PlayState* play); void SfxSource_InitAll(PlayState* play);
void SoundSource_UpdateAll(PlayState* play); void SfxSource_UpdateAll(PlayState* play);
void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId); void SfxSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId);
u16 ElfMessage_GetSariaText(PlayState* play); u16 ElfMessage_GetSariaText(PlayState* play);
u16 ElfMessage_GetCUpText(PlayState* play); u16 ElfMessage_GetCUpText(PlayState* play);
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet); u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet);
@ -1901,10 +1901,10 @@ void AudioOcarina_PlayLongScarecrowAfterCredits(void);
void AudioDebug_Draw(GfxPrint* printer); void AudioDebug_Draw(GfxPrint* printer);
void AudioDebug_ScrPrt(const char* str, u16 num); void AudioDebug_ScrPrt(const char* str, u16 num);
void func_800F3054(void); void func_800F3054(void);
void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx); void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIdx);
void Audio_PlayCutsceneEffectsSequence(u8 csEffectType); void Audio_PlayCutsceneEffectsSequence(u8 csEffectType);
void func_800F4010(Vec3f* pos, u16 sfxId, f32); void func_800F4010(Vec3f* pos, u16 sfxId, f32);
void Audio_PlaySoundRandom(Vec3f* pos, u16 baseSfxId, u8 randLim); void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim);
void func_800F4138(Vec3f* pos, u16 sfxId, f32); void func_800F4138(Vec3f* pos, u16 sfxId, f32);
void func_800F4190(Vec3f* pos, u16 sfxId); void func_800F4190(Vec3f* pos, u16 sfxId);
void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2);
@ -1912,16 +1912,16 @@ 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* pos, u16 sfxId, s8 arg2); void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2);
void func_800F4254(Vec3f* pos, u8 level); void func_800F4254(Vec3f* pos, u8 level);
void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale); void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale);
void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale); void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale);
void func_800F47BC(void); void func_800F47BC(void);
void func_800F47FC(void); void func_800F47FC(void);
void func_800F483C(u8 targetVol, u8 volFadeTimer); void func_800F483C(u8 targetVol, u8 volFadeTimer);
void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel); void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel);
void Audio_LowerMainBgmVolume(u8 volume); void Audio_LowerMainBgmVolume(u8 volume);
void Audio_PlaySoundIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones); void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones);
void Audio_ResetIncreasingTranspose(void); void Audio_ResetIncreasingTranspose(void);
void Audio_PlaySoundTransposed(Vec3f* pos, u16 sfxId, s8 semitone); void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone);
void func_800F4C58(Vec3f* pos, u16 sfxId, u8); void func_800F4C58(Vec3f* pos, u16 sfxId, u8);
void func_800F4E30(Vec3f* pos, f32); void func_800F4E30(Vec3f* pos, f32);
void Audio_ClearSariaBgm(void); void Audio_ClearSariaBgm(void);
@ -1953,7 +1953,7 @@ void func_800F6700(s8 audioSetting);
void Audio_SetBaseFilter(u8); void Audio_SetBaseFilter(u8);
void Audio_SetExtraFilter(u8); void Audio_SetExtraFilter(u8);
void Audio_SetCutsceneFlag(s8 flag); void Audio_SetCutsceneFlag(s8 flag);
void Audio_PlaySoundIfNotInCutscene(u16 sfxId); void Audio_PlaySfxIfNotInCutscene(u16 sfxId);
void func_800F6964(u16); void func_800F6964(u16);
void func_800F6AB0(u16); void func_800F6AB0(u16);
// ? Audio_DisableAllSeq(?); // ? Audio_DisableAllSeq(?);
@ -1966,13 +1966,13 @@ void Audio_Init(void);
void Audio_InitSound(void); void Audio_InitSound(void);
void func_800F7170(void); void func_800F7170(void);
void func_800F71BC(s32 arg0); void func_800F71BC(s32 arg0);
void Audio_SetSoundBanksMute(u16 muteMask); void Audio_SetSfxBanksMute(u16 muteMask);
void Audio_QueueSeqCmdMute(u8 channelIdx); void Audio_QueueSeqCmdMute(u8 channelIdx);
void Audio_ClearBGMMute(u8 channelIdx); void Audio_ClearBGMMute(u8 channelIdx);
void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd); void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd);
void Audio_ProcessSoundRequest(void); void Audio_ProcessSfxRequest(void);
void Audio_ChooseActiveSounds(u8 bankId); void Audio_ChooseActiveSfx(u8 bankId);
void Audio_PlayActiveSounds(u8 bankId); void Audio_PlayActiveSfx(u8 bankId);
void Audio_StopSfxByBank(u8 bankId); void Audio_StopSfxByBank(u8 bankId);
void func_800F8884(u8 bankId, Vec3f* pos); void func_800F8884(u8 bankId, Vec3f* pos);
void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos); void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos);
@ -1982,10 +1982,10 @@ void Audio_QueueSeqCmd(u32 cmd);
void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId); void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId);
void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId); void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId);
void Audio_StopSfxById(u32 sfxId); void Audio_StopSfxById(u32 sfxId);
void Audio_ProcessSoundRequests(void); void Audio_ProcessSfxRequests(void);
void func_800F8F88(void); void func_800F8F88(void);
u8 Audio_IsSfxPlaying(u32 sfxId); u8 Audio_IsSfxPlaying(u32 sfxId);
void Audio_ResetSounds(void); void Audio_ResetSfx(void);
void func_800F9474(u8, u16); void func_800F9474(u8, u16);
void func_800F94FC(u32); void func_800F94FC(u32);
void Audio_ProcessSeqCmd(u32); void Audio_ProcessSeqCmd(u32);

View file

@ -9,7 +9,7 @@ typedef enum {
/* 4 */ BANK_SYSTEM, /* 4 */ BANK_SYSTEM,
/* 5 */ BANK_OCARINA, /* 5 */ BANK_OCARINA,
/* 6 */ BANK_VOICE /* 6 */ BANK_VOICE
} SoundBankType; } SfxBankType;
typedef enum { typedef enum {
/* 0 */ SFX_STATE_EMPTY, /* 0 */ SFX_STATE_EMPTY,
@ -39,7 +39,7 @@ typedef struct {
/* 0x2D */ u8 next; /* 0x2D */ u8 next;
/* 0x2E */ u8 channelIdx; /* 0x2E */ u8 channelIdx;
/* 0x2F */ u8 unk_2F; /* 0x2F */ u8 unk_2F;
} SoundBankEntry; // size = 0x30 } SfxBankEntry; // size = 0x30
/* /*
* SFX IDs * SFX IDs
@ -89,9 +89,9 @@ typedef enum {
typedef struct { typedef struct {
u32 priority; // lower is more prioritized u32 priority; // lower is more prioritized
u8 entryIndex; u8 entryIndex;
} ActiveSound; } ActiveSfx;
// SoundParams bit-packing // SfxParams bit-packing
#define SFX_PARAM_01_SHIFT 0 #define SFX_PARAM_01_SHIFT 0
#define SFX_PARAM_01_MASK (3 << SFX_PARAM_01_SHIFT) #define SFX_PARAM_01_MASK (3 << SFX_PARAM_01_SHIFT)
@ -116,6 +116,6 @@ typedef struct {
typedef struct { typedef struct {
u8 importance; u8 importance;
u16 params; u16 params;
} SoundParams; } SfxParams;
#endif #endif

View file

@ -129,7 +129,7 @@ extern f32 gDefaultPanVolume[128];
extern s16 gLowPassFilterData[16 * 8]; extern s16 gLowPassFilterData[16 * 8];
extern s16 gHighPassFilterData[15 * 8]; extern s16 gHighPassFilterData[15 * 8];
extern s32 gAudioContextInitalized; extern s32 gAudioContextInitalized;
extern u8 gIsLargeSoundBank[7]; extern u8 gIsLargeSfxBank[7];
extern u8 gChannelsPerBank[4][7]; extern u8 gChannelsPerBank[4][7];
extern u8 gUsedChannelsPerBank[4][7]; extern u8 gUsedChannelsPerBank[4][7];
extern u8 gMorphaTransposeTable[16]; extern u8 gMorphaTransposeTable[16];
@ -137,13 +137,13 @@ extern u8* gFrogsSongPtr;
extern OcarinaNote* gScarecrowLongSongPtr; extern OcarinaNote* gScarecrowLongSongPtr;
extern u8* gScarecrowSpawnSongPtr; extern u8* gScarecrowSpawnSongPtr;
extern OcarinaSongButtons gOcarinaSongButtons[]; extern OcarinaSongButtons gOcarinaSongButtons[];
extern SoundParams* gSoundParams[7]; extern SfxParams* gSfxParams[7];
extern char D_80133390[]; extern char D_80133390[];
extern char D_80133398[]; extern char D_80133398[];
extern u8 gSoundRequestWriteIndex; extern u8 gSfxRequestWriteIndex;
extern u8 gSoundRequestReadIndex; extern u8 gSfxRequestReadIndex;
extern SoundBankEntry* gSoundBanks[7]; extern SfxBankEntry* gSfxBanks[7];
extern u8 gSoundBankSizes[]; extern u8 gSfxBankSizes[];
extern u8 gSfxChannelLayout; extern u8 gSfxChannelLayout;
extern u16 D_801333D0; extern u16 D_801333D0;
extern Vec3f gSfxDefaultPos; extern Vec3f gSfxDefaultPos;
@ -208,15 +208,15 @@ extern volatile OSTime gRSPGFXTotalTime;
extern volatile OSTime gRSPOtherTotalTime; extern volatile OSTime gRSPOtherTotalTime;
extern volatile OSTime gRDPTotalTime; extern volatile OSTime gRDPTotalTime;
extern SoundBankEntry D_8016BAD0[9]; extern SfxBankEntry D_8016BAD0[9];
extern SoundBankEntry D_8016BC80[12]; extern SfxBankEntry D_8016BC80[12];
extern SoundBankEntry D_8016BEC0[22]; extern SfxBankEntry D_8016BEC0[22];
extern SoundBankEntry D_8016C2E0[20]; extern SfxBankEntry D_8016C2E0[20];
extern SoundBankEntry D_8016C6A0[8]; extern SfxBankEntry D_8016C6A0[8];
extern SoundBankEntry D_8016C820[3]; extern SfxBankEntry D_8016C820[3];
extern SoundBankEntry D_8016C8B0[5]; extern SfxBankEntry D_8016C8B0[5];
extern ActiveSound gActiveSounds[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8 extern ActiveSfx gActiveSfx[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8
extern u8 gSoundBankMuted[]; extern u8 gSfxBankMuted[];
extern u16 gAudioSfxSwapSource[10]; extern u16 gAudioSfxSwapSource[10];
extern u16 gAudioSfxSwapTarget[10]; extern u16 gAudioSfxSwapTarget[10];
extern u8 gAudioSfxSwapMode[10]; extern u8 gAudioSfxSwapMode[10];

View file

@ -365,7 +365,7 @@ typedef struct {
/* 0x00 */ u16 countdown; /* 0x00 */ u16 countdown;
/* 0x04 */ Vec3f worldPos; /* 0x04 */ Vec3f worldPos;
/* 0x10 */ Vec3f projectedPos; /* 0x10 */ Vec3f projectedPos;
} SoundSource; // size = 0x1C } SfxSource; // size = 0x1C
typedef enum { typedef enum {
/* 0x00 */ SKYBOX_NONE, /* 0x00 */ SKYBOX_NONE,
@ -1151,7 +1151,7 @@ typedef struct PlayState {
/* 0x007C0 */ CollisionContext colCtx; /* 0x007C0 */ CollisionContext colCtx;
/* 0x01C24 */ ActorContext actorCtx; /* 0x01C24 */ ActorContext actorCtx;
/* 0x01D64 */ CutsceneContext csCtx; // "demo_play" /* 0x01D64 */ CutsceneContext csCtx; // "demo_play"
/* 0x01DB4 */ SoundSource soundSources[16]; /* 0x01DB4 */ SfxSource sfxSources[16];
/* 0x01F74 */ SramContext sramCtx; /* 0x01F74 */ SramContext sramCtx;
/* 0x01F78 */ SkyboxContext skyboxCtx; /* 0x01F78 */ SkyboxContext skyboxCtx;
/* 0x020D8 */ MessageContext msgCtx; // "message" /* 0x020D8 */ MessageContext msgCtx; // "message"

View file

@ -189,7 +189,7 @@ typedef struct Actor {
/* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data" /* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data"
/* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank" /* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank"
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
/* 0x020 */ u16 sfx; // SFX ID to play. Sound plays when value is set, then is cleared the following update cycle /* 0x020 */ u16 sfx; // SFX ID to play. Sfx plays when value is set, then is cleared the following update cycle
/* 0x024 */ PosRot world; // Position/rotation in the world /* 0x024 */ PosRot world; // Position/rotation in the world
/* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot /* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot
/* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position /* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position

View file

@ -332,7 +332,7 @@ typedef enum {
#define BUMP_HOOKABLE (1 << 2) // Can be hooked if actor has hookability flags set. #define BUMP_HOOKABLE (1 << 2) // Can be hooked if actor has hookability flags set.
#define BUMP_NO_AT_INFO (1 << 3) // Does not give its info to the AT collider that hit it. #define BUMP_NO_AT_INFO (1 << 3) // Does not give its info to the AT collider that hit it.
#define BUMP_NO_DAMAGE (1 << 4) // Does not take damage. #define BUMP_NO_DAMAGE (1 << 4) // Does not take damage.
#define BUMP_NO_SWORD_SFX (1 << 5) // Does not have a sound when hit by player-attached AT colliders. #define BUMP_NO_SWORD_SFX (1 << 5) // Does not have a sound effect when hit by player-attached AT colliders.
#define BUMP_NO_HITMARK (1 << 6) // Skips hit effects. #define BUMP_NO_HITMARK (1 << 6) // Skips hit effects.
#define BUMP_DRAW_HITMARK (1 << 7) // Draw hitmark for AC collision this frame. #define BUMP_DRAW_HITMARK (1 << 7) // Draw hitmark for AC collision this frame.

4
spec
View file

@ -318,7 +318,7 @@ beginseg
include "build/src/code/z_demo.o" include "build/src/code/z_demo.o"
include "build/src/code/code_80069420.o" include "build/src/code/code_80069420.o"
include "build/src/code/z_draw.o" include "build/src/code/z_draw.o"
include "build/src/code/z_sound_source.o" include "build/src/code/z_sfx_source.o"
include "build/src/code/z_elf_message.o" include "build/src/code/z_elf_message.o"
include "build/src/code/z_face_reaction.o" include "build/src/code/z_face_reaction.o"
include "build/src/code/code_8006C3A0.o" include "build/src/code/code_8006C3A0.o"
@ -423,7 +423,7 @@ beginseg
include "build/src/code/audio_effects.o" include "build/src/code/audio_effects.o"
include "build/src/code/audio_seqplayer.o" include "build/src/code/audio_seqplayer.o"
include "build/src/code/code_800EC960.o" include "build/src/code/code_800EC960.o"
include "build/src/code/audio_sound_params.o" include "build/src/code/audio_sfx_params.o"
include "build/src/code/code_800F7260.o" include "build/src/code/code_800F7260.o"
include "build/src/code/code_800F9280.o" include "build/src/code/code_800F9280.o"
include "build/src/code/audio_external_data.o" include "build/src/code/audio_external_data.o"

View file

@ -1,12 +1,12 @@
#include "ultra64.h" #include "ultra64.h"
#include "global.h" #include "global.h"
// sSoundRequests ring buffer endpoints. read index <= write index, wrapping around mod 256. // sSfxRequests ring buffer endpoints. read index <= write index, wrapping around mod 256.
u8 gSoundRequestWriteIndex = 0; u8 gSfxRequestWriteIndex = 0;
u8 gSoundRequestReadIndex = 0; u8 gSfxRequestReadIndex = 0;
/** /**
* Array of pointers to arrays of SoundBankEntry of sizes: 9, 12, 22, 20, 8, 3, 5 * Array of pointers to arrays of SfxBankEntry of sizes: 9, 12, 22, 20, 8, 3, 5
* *
* 0 : Player Bank size 9 * 0 : Player Bank size 9
* 1 : Item Bank size 12 * 1 : Item Bank size 12
@ -16,11 +16,11 @@ u8 gSoundRequestReadIndex = 0;
* 5 : Ocarina Bank size 3 * 5 : Ocarina Bank size 3
* 6 : Voice Bank size 5 * 6 : Voice Bank size 5
*/ */
SoundBankEntry* gSoundBanks[7] = { SfxBankEntry* gSfxBanks[7] = {
D_8016BAD0, D_8016BC80, D_8016BEC0, D_8016C2E0, D_8016C6A0, D_8016C820, D_8016C8B0, D_8016BAD0, D_8016BC80, D_8016BEC0, D_8016C2E0, D_8016C6A0, D_8016C820, D_8016C8B0,
}; };
u8 gSoundBankSizes[ARRAY_COUNT(gSoundBanks)] = { u8 gSfxBankSizes[ARRAY_COUNT(gSfxBanks)] = {
ARRAY_COUNT(D_8016BAD0), ARRAY_COUNT(D_8016BC80), ARRAY_COUNT(D_8016BEC0), ARRAY_COUNT(D_8016C2E0), ARRAY_COUNT(D_8016BAD0), ARRAY_COUNT(D_8016BC80), ARRAY_COUNT(D_8016BEC0), ARRAY_COUNT(D_8016C2E0),
ARRAY_COUNT(D_8016C6A0), ARRAY_COUNT(D_8016C820), ARRAY_COUNT(D_8016C8B0), ARRAY_COUNT(D_8016C6A0), ARRAY_COUNT(D_8016C820), ARRAY_COUNT(D_8016C8B0),
}; };

View file

@ -5,37 +5,37 @@
{ importance, ((((distParam) << SFX_PARAM_01_SHIFT) & SFX_PARAM_01_MASK) | \ { importance, ((((distParam) << SFX_PARAM_01_SHIFT) & SFX_PARAM_01_MASK) | \
(((randParam) << SFX_PARAM_67_SHIFT) & SFX_PARAM_67_MASK) | (flags)) }, (((randParam) << SFX_PARAM_67_SHIFT) & SFX_PARAM_67_MASK) | (flags)) },
SoundParams sEnemyBankParams[] = { SfxParams sEnemyBankParams[] = {
#include "tables/sfx/enemybank_table.h" #include "tables/sfx/enemybank_table.h"
}; };
SoundParams sPlayerBankParams[] = { SfxParams sPlayerBankParams[] = {
#include "tables/sfx/playerbank_table.h" #include "tables/sfx/playerbank_table.h"
}; };
SoundParams sItemBankParams[] = { SfxParams sItemBankParams[] = {
#include "tables/sfx/itembank_table.h" #include "tables/sfx/itembank_table.h"
}; };
SoundParams sEnvBankParams[] = { SfxParams sEnvBankParams[] = {
#include "tables/sfx/environmentbank_table.h" #include "tables/sfx/environmentbank_table.h"
}; };
SoundParams sSystemBankParams[] = { SfxParams sSystemBankParams[] = {
#include "tables/sfx/systembank_table.h" #include "tables/sfx/systembank_table.h"
}; };
SoundParams sOcarinaBankParams[] = { SfxParams sOcarinaBankParams[] = {
#include "tables/sfx/ocarinabank_table.h" #include "tables/sfx/ocarinabank_table.h"
}; };
SoundParams sVoiceBankParams[] = { SfxParams sVoiceBankParams[] = {
#include "tables/sfx/voicebank_table.h" #include "tables/sfx/voicebank_table.h"
}; };
#undef DEFINE_SFX #undef DEFINE_SFX
SoundParams* gSoundParams[7] = { SfxParams* gSfxParams[7] = {
sPlayerBankParams, sItemBankParams, sEnvBankParams, sEnemyBankParams, sPlayerBankParams, sItemBankParams, sEnvBankParams, sEnemyBankParams,
sSystemBankParams, sOcarinaBankParams, sVoiceBankParams, sSystemBankParams, sOcarinaBankParams, sVoiceBankParams,
}; };

View file

@ -93,7 +93,7 @@ typedef struct {
s8 y; s8 y;
} OcarinaStick; } OcarinaStick;
u8 gIsLargeSoundBank[7] = { 0, 0, 0, 1, 0, 0, 0 }; u8 gIsLargeSfxBank[7] = { 0, 0, 0, 1, 0, 0, 0 };
// Only the first row of these is supported by sequence 0. (gSfxChannelLayout is always 0.) // Only the first row of these is supported by sequence 0. (gSfxChannelLayout is always 0.)
u8 gChannelsPerBank[4][7] = { u8 gChannelsPerBank[4][7] = {
@ -1739,8 +1739,8 @@ void AudioOcarina_PlayControllerInput(u8 unused) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 7, sOcarinaInstrumentId - 1); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 7, sOcarinaInstrumentId - 1);
// Sets pitch to io port 5 // Sets pitch to io port 5
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 5, sCurOcarinaPitch); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 5, sCurOcarinaPitch);
Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &sCurOcarinaBendFreq, &sRelativeOcarinaVolume, Audio_PlaySfxGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &sCurOcarinaBendFreq, &sRelativeOcarinaVolume,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} else if ((sPrevOcarinaPitch != OCARINA_PITCH_NONE) && (sCurOcarinaPitch == OCARINA_PITCH_NONE)) { } else if ((sPrevOcarinaPitch != OCARINA_PITCH_NONE) && (sCurOcarinaPitch == OCARINA_PITCH_NONE)) {
// Stops ocarina sound when transitioning from playing to not playing a note // Stops ocarina sound when transitioning from playing to not playing a note
Audio_StopSfxById(NA_SE_OC_OCARINA); Audio_StopSfxById(NA_SE_OC_OCARINA);
@ -1778,7 +1778,7 @@ void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) {
AudioOcarina_PlayControllerInput(false); AudioOcarina_PlayControllerInput(false);
Audio_StopSfxById(NA_SE_OC_OCARINA); Audio_StopSfxById(NA_SE_OC_OCARINA);
Audio_SetSoundBanksMute(0); Audio_SetSfxBanksMute(0);
sPlaybackState = 0; sPlaybackState = 0;
sPlaybackStaffPos = 0; sPlaybackStaffPos = 0;
sIsOcarinaInputEnabled = false; sIsOcarinaInputEnabled = false;
@ -1912,8 +1912,8 @@ void AudioOcarina_PlaybackSong(void) {
// Sets sPlaybackPitch to channelIdx io port 5 // Sets sPlaybackPitch to channelIdx io port 5
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 5, Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | SFX_CHANNEL_OCARINA << 8 | 5,
sPlaybackPitch & 0x3F); sPlaybackPitch & 0x3F);
Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &sRelativeNotePlaybackBend, Audio_PlaySfxGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &sRelativeNotePlaybackBend,
&sRelativeNotePlaybackVolume, &gSfxDefaultReverb); &sRelativeNotePlaybackVolume, &gSfxDefaultReverb);
} else { } else {
Audio_StopSfxById(NA_SE_OC_OCARINA); Audio_StopSfxById(NA_SE_OC_OCARINA);
} }
@ -2276,7 +2276,7 @@ void AudioOcarina_PlayLongScarecrowAfterCredits(void) {
} }
break; break;
case 1: case 1:
Audio_SetSoundBanksMute(0); Audio_SetSfxBanksMute(0);
AudioOcarina_SetInstrument(sScarecrowAfterCreditsIntrumentId); AudioOcarina_SetInstrument(sScarecrowAfterCreditsIntrumentId);
AudioOcarina_SetPlaybackSong(OCARINA_SONG_SCARECROW_LONG + 1, 1); AudioOcarina_SetPlaybackSong(OCARINA_SONG_SCARECROW_LONG + 1, 1);
sScarecrowAfterCreditsIntrumentId++; sScarecrowAfterCreditsIntrumentId++;
@ -2339,7 +2339,7 @@ char sAudioDebugPageNames[15][23] = {
}; };
u16 sAudioSndContWork[11] = { 0 }; u16 sAudioSndContWork[11] = { 0 };
u16 sAudioSndContWorkLims[11] = { 128, 128, 7, 512, 4, 2, 16, 32, 2, 2, 2 }; u16 sAudioSndContWorkLims[11] = { 128, 128, 7, 512, 4, 2, 16, 32, 2, 2, 2 };
char sSoundBankNames[7][11] = { "PLAYER", "ITEM", "ENVIROMENT", "ENEMY", "SYSTEM", "OCARINA", "VOICE" }; char sSfxBankNames[7][11] = { "PLAYER", "ITEM", "ENVIROMENT", "ENEMY", "SYSTEM", "OCARINA", "VOICE" };
char sSoundModeNames[5][10] = { "W-STEREO", "HEADPHONE", "3D SOUND", "MONO", "" }; char sSoundModeNames[5][10] = { "W-STEREO", "HEADPHONE", "3D SOUND", "MONO", "" };
s8 sAudioIntInfoX = 0; s8 sAudioIntInfoX = 0;
s8 sAudioIntInfoY = 0; s8 sAudioIntInfoY = 0;
@ -2480,17 +2480,17 @@ void AudioDebug_Draw(GfxPrint* printer) {
GfxPrint_Printf(printer, "PUSH CONT-4 A-BTN"); GfxPrint_Printf(printer, "PUSH CONT-4 A-BTN");
ind = (s8)sAudioSndContWork[2]; ind = (s8)sAudioSndContWork[2];
i = gSoundBanks[ind][0].next; i = gSfxBanks[ind][0].next;
j = 0; j = 0;
SETCOL(255, 255, 255); SETCOL(255, 255, 255);
GfxPrint_SetPos(printer, 3, 6); GfxPrint_SetPos(printer, 3, 6);
GfxPrint_Printf(printer, "SE HANDLE:%s", sSoundBankNames[ind]); GfxPrint_Printf(printer, "SE HANDLE:%s", sSfxBankNames[ind]);
while (i != 0xFF) { while (i != 0xFF) {
GfxPrint_SetPos(printer, 3, 7 + j++); GfxPrint_SetPos(printer, 3, 7 + j++);
GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSoundBanks[ind][i].sfxId, gSoundBanks[ind][i].state, GfxPrint_Printf(printer, "%02x %04x %02x %08x", i, gSfxBanks[ind][i].sfxId, gSfxBanks[ind][i].state,
gSoundBanks[ind][i].priority); gSfxBanks[ind][i].priority);
i = gSoundBanks[ind][i].next; i = gSfxBanks[ind][i].next;
} }
break; break;
@ -2507,7 +2507,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
GfxPrint_Printf(printer, "Seq 1 : %2x", sAudioSndContWork[1]); GfxPrint_Printf(printer, "Seq 1 : %2x", sAudioSndContWork[1]);
GfxPrint_SetPos(printer, 3, 6); GfxPrint_SetPos(printer, 3, 6);
GfxPrint_Printf(printer, "SE HD : %2x %s", sAudioSndContWork[2], sSoundBankNames[sAudioSndContWork[2]]); GfxPrint_Printf(printer, "SE HD : %2x %s", sAudioSndContWork[2], sSfxBankNames[sAudioSndContWork[2]]);
GfxPrint_SetPos(printer, 3, 7); GfxPrint_SetPos(printer, 3, 7);
GfxPrint_Printf(printer, "SE No. :%3x", sAudioSndContWork[3]); GfxPrint_Printf(printer, "SE No. :%3x", sAudioSndContWork[3]);
@ -2543,11 +2543,11 @@ void AudioDebug_Draw(GfxPrint* printer) {
SETCOL(255, 255, 255); SETCOL(255, 255, 255);
} }
GfxPrint_SetPos(printer, 2 + sAudioIntInfoX, 4 + ind + sAudioIntInfoY); GfxPrint_SetPos(printer, 2 + sAudioIntInfoX, 4 + ind + sAudioIntInfoY);
GfxPrint_Printf(printer, "%s <%d>", sSoundBankNames[k], sAudioIntInfoBankPage[k]); GfxPrint_Printf(printer, "%s <%d>", sSfxBankNames[k], sAudioIntInfoBankPage[k]);
for (k2 = 0; k2 < gChannelsPerBank[gSfxChannelLayout][k]; k2++) { for (k2 = 0; k2 < gChannelsPerBank[gSfxChannelLayout][k]; k2++) {
#define entryIndex (gActiveSounds[k][k2].entryIndex) #define entryIndex (gActiveSfx[k][k2].entryIndex)
#define entry (&gSoundBanks[k][entryIndex]) #define entry (&gSfxBanks[k][entryIndex])
#define chan (gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[entry->channelIdx]) #define chan (gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[entry->channelIdx])
GfxPrint_SetPos(printer, 2 + sAudioIntInfoX, 5 + ind + sAudioIntInfoY); GfxPrint_SetPos(printer, 2 + sAudioIntInfoX, 5 + ind + sAudioIntInfoY);
if (sAudioIntInfoBankPage[k] == 1) { if (sAudioIntInfoBankPage[k] == 1) {
@ -2613,25 +2613,25 @@ void AudioDebug_Draw(GfxPrint* printer) {
GfxPrint_Printf(printer, "Color : %d", sAudioScrPrtWork[2]); GfxPrint_Printf(printer, "Color : %d", sAudioScrPrtWork[2]);
GfxPrint_SetPos(printer, 3, 7); GfxPrint_SetPos(printer, 3, 7);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[0], sAudioScrPrtWork[3]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[0], sAudioScrPrtWork[3]);
GfxPrint_SetPos(printer, 3, 8); GfxPrint_SetPos(printer, 3, 8);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[1], sAudioScrPrtWork[4]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[1], sAudioScrPrtWork[4]);
GfxPrint_SetPos(printer, 3, 9); GfxPrint_SetPos(printer, 3, 9);
GfxPrint_Printf(printer, "ENVRONM : %d", sAudioScrPrtWork[5]); GfxPrint_Printf(printer, "ENVRONM : %d", sAudioScrPrtWork[5]);
GfxPrint_SetPos(printer, 3, 10); GfxPrint_SetPos(printer, 3, 10);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[3], sAudioScrPrtWork[6]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[3], sAudioScrPrtWork[6]);
GfxPrint_SetPos(printer, 3, 11); GfxPrint_SetPos(printer, 3, 11);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[4], sAudioScrPrtWork[7]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[4], sAudioScrPrtWork[7]);
GfxPrint_SetPos(printer, 3, 12); GfxPrint_SetPos(printer, 3, 12);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[5], sAudioScrPrtWork[8]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[5], sAudioScrPrtWork[8]);
GfxPrint_SetPos(printer, 3, 13); GfxPrint_SetPos(printer, 3, 13);
GfxPrint_Printf(printer, "%s : %d", sSoundBankNames[6], sAudioScrPrtWork[9]); GfxPrint_Printf(printer, "%s : %d", sSfxBankNames[6], sAudioScrPrtWork[9]);
GfxPrint_SetPos(printer, 3, 14); GfxPrint_SetPos(printer, 3, 14);
GfxPrint_Printf(printer, "SEQ ENT : %d", sAudioScrPrtWork[10]); GfxPrint_Printf(printer, "SEQ ENT : %d", sAudioScrPrtWork[10]);
@ -3000,22 +3000,22 @@ void AudioDebug_Draw(GfxPrint* printer) {
SETCOL(255, 255, 255); SETCOL(255, 255, 255);
GfxPrint_SetPos(printer, 3, 4); GfxPrint_SetPos(printer, 3, 4);
GfxPrint_Printf(printer, "SE HD : %02x %s", sAudioSfxParamChgWork[0], GfxPrint_Printf(printer, "SE HD : %02x %s", sAudioSfxParamChgWork[0],
sSoundBankNames[sAudioSfxParamChgWork[0]]); sSfxBankNames[sAudioSfxParamChgWork[0]]);
GfxPrint_SetPos(printer, 3, 5); GfxPrint_SetPos(printer, 3, 5);
GfxPrint_Printf(printer, "SE No. : %02x", sAudioSfxParamChgWork[1]); GfxPrint_Printf(printer, "SE No. : %02x", sAudioSfxParamChgWork[1]);
GfxPrint_SetPos(printer, 20, 6); GfxPrint_SetPos(printer, 20, 6);
GfxPrint_Printf(printer, " : %04x", GfxPrint_Printf(printer, " : %04x",
gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params); gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params);
GfxPrint_SetPos(printer, 3, 6); GfxPrint_SetPos(printer, 3, 6);
GfxPrint_Printf( GfxPrint_Printf(
printer, "SE SW %s", printer, "SE SW %s",
AudioDebug_ToStringBinary(gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params, 16)); AudioDebug_ToStringBinary(gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params, 16));
SETCOL(127, 255, 127); SETCOL(127, 255, 127);
digitStr[0] = (char)('0' + ((gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params >> digitStr[0] = (char)('0' + ((gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params >>
(15 - sAudioSfxParamChgBitSel)) & (15 - sAudioSfxParamChgBitSel)) &
1)); 1));
GfxPrint_SetPos(printer, 12 + sAudioSfxParamChgBitSel, 6); GfxPrint_SetPos(printer, 12 + sAudioSfxParamChgBitSel, 6);
@ -3024,7 +3024,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
SETCOL(255, 255, 255); SETCOL(255, 255, 255);
GfxPrint_SetPos(printer, 3, 7); GfxPrint_SetPos(printer, 3, 7);
GfxPrint_Printf(printer, "SE PR : %02x", GfxPrint_Printf(printer, "SE PR : %02x",
gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance); gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance);
break; break;
case PAGE_FREE_AREA: case PAGE_FREE_AREA:
@ -3161,9 +3161,9 @@ void AudioDebug_ProcessInput_SndCont(void) {
break; break;
case 2: case 2:
case 3: case 3:
Audio_PlaySoundGeneral(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG, Audio_PlaySfxGeneral(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG,
&gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
break; break;
case 4: case 4:
func_800F6700(sAudioSndContWork[sAudioSndContSel]); func_800F6700(sAudioSndContWork[sAudioSndContSel]);
@ -3185,7 +3185,7 @@ void AudioDebug_ProcessInput_SndCont(void) {
case 9: case 9:
break; break;
case 10: case 10:
Audio_SetSoundBanksMute(sAudioSndContWork[sAudioSndContSel] * 0x7F); Audio_SetSfxBanksMute(sAudioSndContWork[sAudioSndContSel] * 0x7F);
break; break;
} }
} }
@ -3537,7 +3537,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) {
sAudioSfxParamChgWork[sAudioSfxParamChgSel] &= 0x1FF; sAudioSfxParamChgWork[sAudioSfxParamChgSel] &= 0x1FF;
} }
} else if (sAudioSfxParamChgSel == 3) { } else if (sAudioSfxParamChgSel == 3) {
gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance -= step; gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance -= step;
} else { } else {
sAudioSfxParamChgBitSel = (sAudioSfxParamChgBitSel - 1) & 0xF; sAudioSfxParamChgBitSel = (sAudioSfxParamChgBitSel - 1) & 0xF;
} }
@ -3556,7 +3556,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) {
sAudioSfxParamChgWork[sAudioSfxParamChgSel] &= 0x1FF; sAudioSfxParamChgWork[sAudioSfxParamChgSel] &= 0x1FF;
} }
} else if (sAudioSfxParamChgSel == 3) { } else if (sAudioSfxParamChgSel == 3) {
gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance += step; gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].importance += step;
} else { } else {
sAudioSfxParamChgBitSel = (sAudioSfxParamChgBitSel + 1) & 0xF; sAudioSfxParamChgBitSel = (sAudioSfxParamChgBitSel + 1) & 0xF;
} }
@ -3564,8 +3564,8 @@ void AudioDebug_ProcessInput_SfxParamChg(void) {
if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) {
sfx = (u16)(sAudioSfxParamChgWork[0] << 12) + sAudioSfxParamChgWork[1] + SFX_FLAG; sfx = (u16)(sAudioSfxParamChgWork[0] << 12) + sAudioSfxParamChgWork[1] + SFX_FLAG;
Audio_PlaySoundGeneral(sfx, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfx, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) {
@ -3574,7 +3574,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) {
if (CHECK_BTN_ANY(sDebugPadPress, BTN_CDOWN)) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_CDOWN)) {
if (sAudioSfxParamChgSel == 2) { if (sAudioSfxParamChgSel == 2) {
gSoundParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params ^= gSfxParams[sAudioSfxParamChgWork[0]][sAudioSfxParamChgWork[1]].params ^=
(1 << (0xF - sAudioSfxParamChgBitSel)); (1 << (0xF - sAudioSfxParamChgBitSel));
} }
} }
@ -3615,7 +3615,7 @@ void AudioDebug_ProcessInput(void) {
} }
if (sAudioSfxMuted) { if (sAudioSfxMuted) {
Audio_SetSoundBanksMute(0x6F); Audio_SetSfxBanksMute(0x6F);
} }
if (CHECK_BTN_ANY(sDebugPadPress, BTN_L)) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_L)) {
@ -3654,7 +3654,7 @@ void AudioDebug_ProcessInput(void) {
if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) {
sAudioSfxMuted ^= 1; sAudioSfxMuted ^= 1;
if (!sAudioSfxMuted) { if (!sAudioSfxMuted) {
Audio_SetSoundBanksMute(0); Audio_SetSfxBanksMute(0);
} }
} }
break; break;
@ -3712,7 +3712,7 @@ void func_800F3054(void) {
if (gAudioSpecId == 7) { if (gAudioSpecId == 7) {
Audio_ClearSariaBgm(); Audio_ClearSariaBgm();
} }
Audio_ProcessSoundRequests(); Audio_ProcessSfxRequests();
Audio_ProcessSeqCmds(); Audio_ProcessSeqCmds();
func_800F8F88(); func_800F8F88();
func_800FA3DC(); func_800FA3DC();
@ -3734,8 +3734,8 @@ void func_800F314C(s8 arg0) {
Audio_QueueCmdS32(0x82 << 24 | SEQ_PLAYER_BGM_MAIN << 16 | (((u8)arg0 & 0xFF) << 8), 1); Audio_QueueCmdS32(0x82 << 24 | SEQ_PLAYER_BGM_MAIN << 16 | (((u8)arg0 & 0xFF) << 8), 1);
} }
f32 Audio_ComputeSoundVolume(u8 bankId, u8 entryIdx) { f32 Audio_ComputeSfxVolume(u8 bankId, u8 entryIdx) {
SoundBankEntry* bankEntry = &gSoundBanks[bankId][entryIdx]; SfxBankEntry* bankEntry = &gSfxBanks[bankId][entryIdx];
f32 minDist; f32 minDist;
f32 baseDist; f32 baseDist;
f32 ret; f32 ret;
@ -3779,10 +3779,10 @@ f32 Audio_ComputeSoundVolume(u8 bankId, u8 entryIdx) {
return ret; return ret;
} }
s8 Audio_ComputeSoundReverb(u8 bankId, u8 entryIdx, u8 channelIdx) { s8 Audio_ComputeSfxReverb(u8 bankId, u8 entryIdx, u8 channelIdx) {
s8 distAdd = 0; s8 distAdd = 0;
s32 scriptAdd = 0; s32 scriptAdd = 0;
SoundBankEntry* entry = &gSoundBanks[bankId][entryIdx]; SfxBankEntry* entry = &gSfxBanks[bankId][entryIdx];
s32 reverb; s32 reverb;
if (!(entry->sfxParams & SFX_FLAG_12)) { if (!(entry->sfxParams & SFX_FLAG_12)) {
@ -3812,7 +3812,7 @@ s8 Audio_ComputeSoundReverb(u8 bankId, u8 entryIdx, u8 channelIdx) {
return reverb; return reverb;
} }
s8 Audio_ComputeSoundPanSigned(f32 x, f32 z, u8 token) { s8 Audio_ComputeSfxPanSigned(f32 x, f32 z, u8 token) {
f32 absX; f32 absX;
f32 absZ; f32 absZ;
f32 pan; f32 pan;
@ -3855,9 +3855,9 @@ s8 Audio_ComputeSoundPanSigned(f32 x, f32 z, u8 token) {
return (s8)((pan * 127.0f) + 0.5f); return (s8)((pan * 127.0f) + 0.5f);
} }
f32 Audio_ComputeSoundFreqScale(u8 bankId, u8 entryIdx) { f32 Audio_ComputeSfxFreqScale(u8 bankId, u8 entryIdx) {
s32 phi_v0 = 0; s32 phi_v0 = 0;
SoundBankEntry* entry = &gSoundBanks[bankId][entryIdx]; SfxBankEntry* entry = &gSfxBanks[bankId][entryIdx];
f32 unk1C; f32 unk1C;
f32 freq = 1.0f; f32 freq = 1.0f;
@ -3908,7 +3908,7 @@ f32 Audio_ComputeSoundFreqScale(u8 bankId, u8 entryIdx) {
return freq; return freq;
} }
u8 func_800F37B8(f32 behindScreenZ, SoundBankEntry* arg1, s8 arg2) { u8 func_800F37B8(f32 behindScreenZ, SfxBankEntry* arg1, s8 arg2) {
s8 phi_v0; s8 phi_v0;
u8 phi_v1; u8 phi_v1;
f32 phi_f0; f32 phi_f0;
@ -3968,7 +3968,7 @@ s8 func_800F3990(f32 arg0, u16 sfxParams) {
return ret | 1; return ret | 1;
} }
void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx) { void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIdx) {
f32 vol = 1.0f; f32 vol = 1.0f;
s8 volS8; s8 volS8;
s8 reverb = 0; s8 reverb = 0;
@ -3979,7 +3979,7 @@ void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx) {
s8 sp38 = 0; s8 sp38 = 0;
f32 behindScreenZ; f32 behindScreenZ;
u8 baseFilter = 0; u8 baseFilter = 0;
SoundBankEntry* entry = &gSoundBanks[bankId][entryIdx]; SfxBankEntry* entry = &gSfxBanks[bankId][entryIdx];
switch (bankId) { switch (bankId) {
case BANK_PLAYER: case BANK_PLAYER:
@ -3993,10 +3993,10 @@ void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx) {
FALLTHROUGH; FALLTHROUGH;
case BANK_OCARINA: case BANK_OCARINA:
entry->dist = sqrtf(entry->dist); entry->dist = sqrtf(entry->dist);
vol = Audio_ComputeSoundVolume(bankId, entryIdx) * *entry->vol; vol = Audio_ComputeSfxVolume(bankId, entryIdx) * *entry->vol;
reverb = Audio_ComputeSoundReverb(bankId, entryIdx, channelIdx); reverb = Audio_ComputeSfxReverb(bankId, entryIdx, channelIdx);
panSigned = Audio_ComputeSoundPanSigned(*entry->posX, *entry->posZ, entry->token); panSigned = Audio_ComputeSfxPanSigned(*entry->posX, *entry->posZ, entry->token);
freqScale = Audio_ComputeSoundFreqScale(bankId, entryIdx) * *entry->freqScale; freqScale = Audio_ComputeSfxFreqScale(bankId, entryIdx) * *entry->freqScale;
if (sSoundMode == SOUNDMODE_SURROUND) { if (sSoundMode == SOUNDMODE_SURROUND) {
behindScreenZ = sBehindScreenZ[(entry->sfxParams & SFX_FLAG_10) >> SFX_FLAG_10_SHIFT]; behindScreenZ = sBehindScreenZ[(entry->sfxParams & SFX_FLAG_10) >> SFX_FLAG_10_SHIFT];
@ -4092,7 +4092,7 @@ void Audio_ResetSfxChannelState(void) {
} }
void Audio_PlayCutsceneEffectsSequence(u8 csEffectType) { void Audio_PlayCutsceneEffectsSequence(u8 csEffectType) {
if (gSoundBankMuted[0] != 1) { if (gSfxBankMuted[0] != 1) {
Audio_StartSeq(SEQ_PLAYER_BGM_SUB, 0, NA_BGM_CUTSCENE_EFFECTS); Audio_StartSeq(SEQ_PLAYER_BGM_SUB, 0, NA_BGM_CUTSCENE_EFFECTS);
Audio_SeqCmd8(SEQ_PLAYER_BGM_SUB, 0, 0, csEffectType); Audio_SeqCmd8(SEQ_PLAYER_BGM_SUB, 0, 0, csEffectType);
} }
@ -4120,7 +4120,7 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) {
D_80131C8C = arg2; D_80131C8C = arg2;
sp24 = func_800F3F84(arg2); sp24 = func_800F3F84(arg2);
Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb);
if ((sfxId & 0xF0) == 0xB0) { if ((sfxId & 0xF0) == 0xB0) {
phi_f0 = 0.3f; phi_f0 = 0.3f;
@ -4138,23 +4138,23 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) {
sfxId2 = NA_SE_PL_METALEFFECT_KID; sfxId2 = NA_SE_PL_METALEFFECT_KID;
} }
D_8016B7AC = (sp24 * 0.7) + 0.3; D_8016B7AC = (sp24 * 0.7) + 0.3;
Audio_PlaySoundGeneral(sfxId2, pos, 4, &D_8016B7B0, &D_8016B7AC, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId2, pos, 4, &D_8016B7B0, &D_8016B7AC, &gSfxDefaultReverb);
} }
} }
void func_800F4138(Vec3f* pos, u16 sfxId, f32 arg2) { void func_800F4138(Vec3f* pos, u16 sfxId, f32 arg2) {
func_800F3F84(arg2); func_800F3F84(arg2);
Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb);
} }
void func_800F4190(Vec3f* pos, u16 sfxId) { void func_800F4190(Vec3f* pos, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801305B0, &gSfxDefaultFreqAndVolScale, &D_801305B4); Audio_PlaySfxGeneral(sfxId, pos, 4, &D_801305B0, &gSfxDefaultFreqAndVolScale, &D_801305B4);
} }
void Audio_PlaySoundRandom(Vec3f* pos, u16 baseSfxId, u8 randLim) { void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim) {
u8 offset = Audio_NextRandom() % randLim; u8 offset = Audio_NextRandom() % randLim;
Audio_PlaySoundGeneral(baseSfxId + offset, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(baseSfxId + offset, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
void func_800F4254(Vec3f* pos, u8 level) { void func_800F4254(Vec3f* pos, u8 level) {
@ -4163,12 +4163,12 @@ void func_800F4254(Vec3f* pos, u8 level) {
D_801305F4 = D_801305E4[level]; D_801305F4 = D_801305E4[level];
switch (level) { switch (level) {
case 1: case 1:
Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
break; break;
case 2: case 2:
Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
break; break;
} }
@ -4176,8 +4176,8 @@ void func_800F4254(Vec3f* pos, u8 level) {
} }
if (level != 0) { if (level != 0) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_CHARGE - SFX_FLAG, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_CHARGE - SFX_FLAG, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} }
@ -4189,14 +4189,14 @@ void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2) {
} }
if (D_8016B7D8 > 0.5f) { if (D_8016B7D8 > 0.5f) {
Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
void func_800F4414(Vec3f* pos, u16 sfxId, f32 arg2) { void func_800F4414(Vec3f* pos, u16 sfxId, f32 arg2) {
D_801305B8--; D_801305B8--;
if (D_801305B8 == 0) { if (D_801305B8 == 0) {
Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (arg2 > 2.0f) { if (arg2 > 2.0f) {
arg2 = 2.0f; arg2 = 2.0f;
@ -4213,12 +4213,12 @@ void func_800F44EC(s8 arg0, s8 arg1) {
void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2) { void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2) {
D_8016B7DC = arg2; D_8016B7DC = arg2;
Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &D_8016B7DC); Audio_PlaySfxGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &D_8016B7DC);
} }
void func_800F4578(Vec3f* pos, u16 sfxId, f32 arg2) { void func_800F4578(Vec3f* pos, u16 sfxId, f32 arg2) {
D_8016B7E0 = arg2; D_8016B7E0 = arg2;
Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &D_8016B7E0, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &D_8016B7E0, &gSfxDefaultReverb);
} }
void func_800F45D0(f32 arg0) { void func_800F45D0(f32 arg0) {
@ -4226,7 +4226,7 @@ void func_800F45D0(f32 arg0) {
func_800F436C(&gSfxDefaultPos, 0, (0.15f * arg0) + 1.4f); func_800F436C(&gSfxDefaultPos, 0, (0.15f * arg0) + 1.4f);
} }
void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale) { void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale) {
if (!Audio_IsSfxPlaying(NA_SE_EV_RIVER_STREAM - SFX_FLAG)) { if (!Audio_IsSfxPlaying(NA_SE_EV_RIVER_STREAM - SFX_FLAG)) {
sRiverFreqScaleLerp.value = freqScale; sRiverFreqScaleLerp.value = freqScale;
} else if (freqScale != sRiverFreqScaleLerp.value) { } else if (freqScale != sRiverFreqScaleLerp.value) {
@ -4234,11 +4234,11 @@ void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale) {
sRiverFreqScaleLerp.remainingFrames = 40; sRiverFreqScaleLerp.remainingFrames = 40;
sRiverFreqScaleLerp.step = (sRiverFreqScaleLerp.target - sRiverFreqScaleLerp.value) / 40; sRiverFreqScaleLerp.step = (sRiverFreqScaleLerp.target - sRiverFreqScaleLerp.value) / 40;
} }
Audio_PlaySoundGeneral(NA_SE_EV_RIVER_STREAM - SFX_FLAG, pos, 4, &sRiverFreqScaleLerp.value, Audio_PlaySfxGeneral(NA_SE_EV_RIVER_STREAM - SFX_FLAG, pos, 4, &sRiverFreqScaleLerp.value,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale) { void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale) {
if (!Audio_IsSfxPlaying(NA_SE_EV_WATER_WALL_BIG - SFX_FLAG)) { if (!Audio_IsSfxPlaying(NA_SE_EV_WATER_WALL_BIG - SFX_FLAG)) {
sWaterfallFreqScaleLerp.value = freqScale; sWaterfallFreqScaleLerp.value = freqScale;
} else if (freqScale != sWaterfallFreqScaleLerp.value) { } else if (freqScale != sWaterfallFreqScaleLerp.value) {
@ -4246,8 +4246,8 @@ void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale) {
sWaterfallFreqScaleLerp.remainingFrames = 40; sWaterfallFreqScaleLerp.remainingFrames = 40;
sWaterfallFreqScaleLerp.step = (sWaterfallFreqScaleLerp.target - sWaterfallFreqScaleLerp.value) / 40; sWaterfallFreqScaleLerp.step = (sWaterfallFreqScaleLerp.target - sWaterfallFreqScaleLerp.value) / 40;
} }
Audio_PlaySoundGeneral(NA_SE_EV_WATER_WALL_BIG - SFX_FLAG, pos, 4, &sWaterfallFreqScaleLerp.value, Audio_PlaySfxGeneral(NA_SE_EV_WATER_WALL_BIG - SFX_FLAG, pos, 4, &sWaterfallFreqScaleLerp.value,
&sWaterfallFreqScaleLerp.value, &gSfxDefaultReverb); &sWaterfallFreqScaleLerp.value, &gSfxDefaultReverb);
} }
void Audio_StepFreqLerp(FreqLerp* lerp) { void Audio_StepFreqLerp(FreqLerp* lerp) {
@ -4389,9 +4389,9 @@ void Audio_UpdateRiverSoundVolumes(void) {
} }
} }
void Audio_PlaySoundIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones) { void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones) {
Audio_PlaySoundGeneral(sfxId, pos, 4, &gPitchFrequencies[semitones[sAudioIncreasingTranspose] + 39], Audio_PlaySfxGeneral(sfxId, pos, 4, &gPitchFrequencies[semitones[sAudioIncreasingTranspose] + 39],
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sAudioIncreasingTranspose < 15) { if (sAudioIncreasingTranspose < 15) {
sAudioIncreasingTranspose++; sAudioIncreasingTranspose++;
@ -4402,9 +4402,9 @@ void Audio_ResetIncreasingTranspose(void) {
sAudioIncreasingTranspose = 0; sAudioIncreasingTranspose = 0;
} }
void Audio_PlaySoundTransposed(Vec3f* pos, u16 sfxId, s8 semitone) { void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone) {
Audio_PlaySoundGeneral(sfxId, pos, 4, &gPitchFrequencies[semitone + 39], &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, pos, 4, &gPitchFrequencies[semitone + 39], &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) { void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) {
@ -4418,14 +4418,14 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) {
} }
for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) { for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) {
if ((gActiveSounds[bankId][i].entryIndex != 0xFF) && if ((gActiveSfx[bankId][i].entryIndex != 0xFF) &&
(sfxId == gSoundBanks[bankId][gActiveSounds[bankId][i].entryIndex].sfxId)) { (sfxId == gSfxBanks[bankId][gActiveSfx[bankId][i].entryIndex].sfxId)) {
Audio_QueueCmdS8( Audio_QueueCmdS8(
_SHIFTL(0x6, 24, 8) | _SHIFTL(SEQ_PLAYER_SFX, 16, 8) | _SHIFTL(phi_s1, 8, 8) | _SHIFTL(6, 0, 8), arg2); _SHIFTL(0x6, 24, 8) | _SHIFTL(SEQ_PLAYER_SFX, 16, 8) | _SHIFTL(phi_s1, 8, 8) | _SHIFTL(6, 0, 8), arg2);
} }
phi_s1++; phi_s1++;
} }
Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySfxGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
void func_800F4E30(Vec3f* pos, f32 arg1) { void func_800F4E30(Vec3f* pos, f32 arg1) {
@ -4958,12 +4958,12 @@ void func_800F6268(f32 dist, u16 arg1) {
void func_800F64E0(u8 arg0) { void func_800F64E0(u8 arg0) {
D_80130608 = arg0; D_80130608 = arg0;
if (arg0 != 0) { if (arg0 != 0) {
Audio_PlaySoundGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Audio_QueueCmdS32(0xF1000000, 0); Audio_QueueCmdS32(0xF1000000, 0);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_WIN_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_WIN_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Audio_QueueCmdS32(0xF2000000, 0); Audio_QueueCmdS32(0xF2000000, 0);
} }
} }
@ -5044,8 +5044,8 @@ void Audio_SetBaseFilter(u8 filter) {
if (filter == 0) { if (filter == 0) {
Audio_StopSfxById(NA_SE_PL_IN_BUBBLE); Audio_StopSfxById(NA_SE_PL_IN_BUBBLE);
} else if (sAudioBaseFilter == 0) { } else if (sAudioBaseFilter == 0) {
Audio_PlaySoundGeneral(NA_SE_PL_IN_BUBBLE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_PL_IN_BUBBLE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
sAudioBaseFilter = filter; sAudioBaseFilter = filter;
@ -5071,15 +5071,15 @@ void Audio_SetCutsceneFlag(s8 flag) {
sAudioCutsceneFlag = flag; sAudioCutsceneFlag = flag;
} }
void Audio_PlaySoundGeneralIfNotInCutscene(u16 sfxId, Vec3f* pos, u8 arg2, f32* freqScale, f32* arg4, s8* reverbAdd) { void Audio_PlaySfxGeneralIfNotInCutscene(u16 sfxId, Vec3f* pos, u8 arg2, f32* freqScale, f32* arg4, s8* reverbAdd) {
if (!sAudioCutsceneFlag) { if (!sAudioCutsceneFlag) {
Audio_PlaySoundGeneral(sfxId, pos, arg2, freqScale, arg4, reverbAdd); Audio_PlaySfxGeneral(sfxId, pos, arg2, freqScale, arg4, reverbAdd);
} }
} }
void Audio_PlaySoundIfNotInCutscene(u16 sfxId) { void Audio_PlaySfxIfNotInCutscene(u16 sfxId) {
Audio_PlaySoundGeneralIfNotInCutscene(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneralIfNotInCutscene(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
void func_800F6964(u16 arg0) { void func_800F6964(u16 arg0) {
@ -5272,7 +5272,7 @@ void Audio_InitSound(void) {
AudioOcarina_ResetStaffs(); AudioOcarina_ResetStaffs();
Audio_ResetSfxChannelState(); Audio_ResetSfxChannelState();
func_800FAEB4(); func_800FAEB4();
Audio_ResetSounds(); Audio_ResetSfx();
func_800F9280(SEQ_PLAYER_SFX, 0, 0x70, 10); func_800F9280(SEQ_PLAYER_SFX, 0, 0x70, 10);
} }
@ -5289,7 +5289,7 @@ void func_800F71BC(s32 arg0) {
AudioOcarina_ResetStaffs(); AudioOcarina_ResetStaffs();
Audio_ResetSfxChannelState(); Audio_ResetSfxChannelState();
func_800FADF8(); func_800FADF8();
Audio_ResetSounds(); Audio_ResetSfx();
} }
void func_800F7208(void) { void func_800F7208(void) {

View file

@ -9,7 +9,7 @@ typedef struct {
/* 0x0C */ f32* freqScale; /* 0x0C */ f32* freqScale;
/* 0x10 */ f32* vol; /* 0x10 */ f32* vol;
/* 0x14 */ s8* reverbAdd; /* 0x14 */ s8* reverbAdd;
} SoundRequest; // size = 0x18 } SfxRequest; // size = 0x18
typedef struct { typedef struct {
/* 0x00 */ f32 value; /* 0x00 */ f32 value;
@ -18,33 +18,33 @@ typedef struct {
/* 0x0C */ u16 remainingFrames; /* 0x0C */ u16 remainingFrames;
} UnusedBankLerp; // size = 0x10 } UnusedBankLerp; // size = 0x10
SoundBankEntry D_8016BAD0[9]; SfxBankEntry D_8016BAD0[9];
SoundBankEntry D_8016BC80[12]; SfxBankEntry D_8016BC80[12];
SoundBankEntry D_8016BEC0[22]; SfxBankEntry D_8016BEC0[22];
SoundBankEntry D_8016C2E0[20]; SfxBankEntry D_8016C2E0[20];
SoundBankEntry D_8016C6A0[8]; SfxBankEntry D_8016C6A0[8];
SoundBankEntry D_8016C820[3]; SfxBankEntry D_8016C820[3];
SoundBankEntry D_8016C8B0[5]; SfxBankEntry D_8016C8B0[5];
SoundRequest sSoundRequests[0x100]; SfxRequest sSfxRequests[0x100];
u8 sSoundBankListEnd[7]; u8 sSfxBankListEnd[7];
u8 sSoundBankFreeListStart[7]; u8 sSfxBankFreeListStart[7];
u8 sSoundBankUnused[7]; u8 sSfxBankUnused[7];
ActiveSound gActiveSounds[7][3]; ActiveSfx gActiveSfx[7][3];
u8 sCurSfxPlayerChannelIdx; u8 sCurSfxPlayerChannelIdx;
u8 gSoundBankMuted[7]; u8 gSfxBankMuted[7];
UnusedBankLerp sUnusedBankLerp[7]; UnusedBankLerp sUnusedBankLerp[7];
u16 gAudioSfxSwapSource[10]; u16 gAudioSfxSwapSource[10];
u16 gAudioSfxSwapTarget[10]; u16 gAudioSfxSwapTarget[10];
u8 gAudioSfxSwapMode[10]; u8 gAudioSfxSwapMode[10];
void Audio_SetSoundBanksMute(u16 muteMask) { void Audio_SetSfxBanksMute(u16 muteMask) {
u8 bankId; u8 bankId;
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) {
if (muteMask & 1) { if (muteMask & 1) {
gSoundBankMuted[bankId] = true; gSfxBankMuted[bankId] = true;
} else { } else {
gSoundBankMuted[bankId] = false; gSfxBankMuted[bankId] = false;
} }
muteMask = muteMask >> 1; muteMask = muteMask >> 1;
} }
@ -64,12 +64,12 @@ void Audio_ClearBGMMute(u8 channelIdx) {
} }
} }
void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd) { void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd) {
u8 i; u8 i;
SoundRequest* req; SfxRequest* req;
if (!gSoundBankMuted[SFX_BANK_SHIFT(sfxId)]) { if (!gSfxBankMuted[SFX_BANK_SHIFT(sfxId)]) {
req = &sSoundRequests[gSoundRequestWriteIndex]; req = &sSfxRequests[gSfxRequestWriteIndex];
if (!gAudioSfxSwapOff) { if (!gAudioSfxSwapOff) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
if (sfxId == gAudioSfxSwapSource[i]) { if (sfxId == gAudioSfxSwapSource[i]) {
@ -82,8 +82,8 @@ void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32
req->freqScale = freqScale; req->freqScale = freqScale;
req->vol = vol; req->vol = vol;
req->reverbAdd = reverbAdd; req->reverbAdd = reverbAdd;
gSoundRequestWriteIndex++; gSfxRequestWriteIndex++;
req = &sSoundRequests[gSoundRequestWriteIndex]; req = &sSfxRequests[gSfxRequestWriteIndex];
} }
i = 10; // "break;" i = 10; // "break;"
} }
@ -95,18 +95,18 @@ void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32
req->freqScale = freqScale; req->freqScale = freqScale;
req->vol = vol; req->vol = vol;
req->reverbAdd = reverbAdd; req->reverbAdd = reverbAdd;
gSoundRequestWriteIndex++; gSfxRequestWriteIndex++;
} }
} }
void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) { void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* cmp) {
SoundRequest* req; SfxRequest* req;
s32 remove; s32 remove;
u8 i = gSoundRequestReadIndex; u8 i = gSfxRequestReadIndex;
for (; i != gSoundRequestWriteIndex; i++) { for (; i != gSfxRequestWriteIndex; i++) {
remove = false; remove = false;
req = &sSoundRequests[i]; req = &sSfxRequests[i];
switch (aspect) { switch (aspect) {
case 0: case 0:
if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId)) { if (SFX_BANK_MASK(req->sfxId) == SFX_BANK_MASK(cmp->sfxId)) {
@ -145,18 +145,18 @@ void Audio_RemoveMatchingSoundRequests(u8 aspect, SoundBankEntry* cmp) {
} }
} }
void Audio_ProcessSoundRequest(void) { void Audio_ProcessSfxRequest(void) {
u16 sfxId; u16 sfxId;
u8 count; u8 count;
u8 index; u8 index;
SoundRequest* req; SfxRequest* req;
SoundBankEntry* entry; SfxBankEntry* entry;
SoundParams* soundParams; SfxParams* sfxParams;
s32 bankId; s32 bankId;
u8 evictImportance; u8 evictImportance;
u8 evictIndex; u8 evictIndex;
req = &sSoundRequests[gSoundRequestReadIndex]; req = &sSfxRequests[gSfxRequestReadIndex];
evictIndex = 0x80; evictIndex = 0x80;
if (req->sfxId == 0) { if (req->sfxId == 0) {
return; return;
@ -167,29 +167,29 @@ void Audio_ProcessSoundRequest(void) {
bankId = SFX_BANK(req->sfxId); bankId = SFX_BANK(req->sfxId);
} }
count = 0; count = 0;
index = gSoundBanks[bankId][0].next; index = gSfxBanks[bankId][0].next;
while (index != 0xFF && index != 0) { while (index != 0xFF && index != 0) {
if (gSoundBanks[bankId][index].posX == &req->pos->x) { if (gSfxBanks[bankId][index].posX == &req->pos->x) {
if ((gSoundParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].params & SFX_FLAG_5) && if ((gSfxParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].params & SFX_FLAG_5) &&
gSoundParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].importance == gSfxParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].importance ==
gSoundBanks[bankId][index].sfxImportance) { gSfxBanks[bankId][index].sfxImportance) {
return; return;
} }
if (gSoundBanks[bankId][index].sfxId == req->sfxId) { if (gSfxBanks[bankId][index].sfxId == req->sfxId) {
count = gUsedChannelsPerBank[gSfxChannelLayout][bankId]; count = gUsedChannelsPerBank[gSfxChannelLayout][bankId];
} else { } else {
if (count == 0) { if (count == 0) {
evictIndex = index; evictIndex = index;
sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF; sfxId = gSfxBanks[bankId][index].sfxId & 0xFFFF;
evictImportance = gSoundParams[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].importance; evictImportance = gSfxParams[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].importance;
} else if (gSoundBanks[bankId][index].sfxImportance < evictImportance) { } else if (gSfxBanks[bankId][index].sfxImportance < evictImportance) {
evictIndex = index; evictIndex = index;
sfxId = gSoundBanks[bankId][index].sfxId & 0xFFFF; sfxId = gSfxBanks[bankId][index].sfxId & 0xFFFF;
evictImportance = gSoundParams[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].importance; evictImportance = gSfxParams[SFX_BANK_SHIFT(sfxId)][SFX_INDEX(sfxId)].importance;
} }
count++; count++;
if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) { if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) {
if (gSoundParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].importance >= evictImportance) { if (gSfxParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)].importance >= evictImportance) {
index = evictIndex; index = evictIndex;
} else { } else {
index = 0; index = 0;
@ -197,34 +197,34 @@ void Audio_ProcessSoundRequest(void) {
} }
} }
if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) { if (count == gUsedChannelsPerBank[gSfxChannelLayout][bankId]) {
soundParams = &gSoundParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)]; sfxParams = &gSfxParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
if ((req->sfxId & 0xC00) || (soundParams->params & SFX_FLAG_2) || (index == evictIndex)) { if ((req->sfxId & 0xC00) || (sfxParams->params & SFX_FLAG_2) || (index == evictIndex)) {
if ((gSoundBanks[bankId][index].sfxParams & SFX_FLAG_3) && if ((gSfxBanks[bankId][index].sfxParams & SFX_FLAG_3) &&
gSoundBanks[bankId][index].state != SFX_STATE_QUEUED) { gSfxBanks[bankId][index].state != SFX_STATE_QUEUED) {
Audio_ClearBGMMute(gSoundBanks[bankId][index].channelIdx); Audio_ClearBGMMute(gSfxBanks[bankId][index].channelIdx);
} }
gSoundBanks[bankId][index].token = req->token; gSfxBanks[bankId][index].token = req->token;
gSoundBanks[bankId][index].sfxId = req->sfxId; gSfxBanks[bankId][index].sfxId = req->sfxId;
gSoundBanks[bankId][index].state = SFX_STATE_QUEUED; gSfxBanks[bankId][index].state = SFX_STATE_QUEUED;
gSoundBanks[bankId][index].freshness = 2; gSfxBanks[bankId][index].freshness = 2;
gSoundBanks[bankId][index].freqScale = req->freqScale; gSfxBanks[bankId][index].freqScale = req->freqScale;
gSoundBanks[bankId][index].vol = req->vol; gSfxBanks[bankId][index].vol = req->vol;
gSoundBanks[bankId][index].reverbAdd = req->reverbAdd; gSfxBanks[bankId][index].reverbAdd = req->reverbAdd;
gSoundBanks[bankId][index].sfxParams = soundParams->params; gSfxBanks[bankId][index].sfxParams = sfxParams->params;
gSoundBanks[bankId][index].sfxImportance = soundParams->importance; gSfxBanks[bankId][index].sfxImportance = sfxParams->importance;
} else if (gSoundBanks[bankId][index].state == SFX_STATE_PLAYING_2) { } else if (gSfxBanks[bankId][index].state == SFX_STATE_PLAYING_2) {
gSoundBanks[bankId][index].state = SFX_STATE_PLAYING_1; gSfxBanks[bankId][index].state = SFX_STATE_PLAYING_1;
} }
index = 0; index = 0;
} }
} }
if (index != 0) { if (index != 0) {
index = gSoundBanks[bankId][index].next; index = gSfxBanks[bankId][index].next;
} }
} }
if (gSoundBanks[bankId][sSoundBankFreeListStart[bankId]].next != 0xFF && index != 0) { if (gSfxBanks[bankId][sSfxBankFreeListStart[bankId]].next != 0xFF && index != 0) {
index = sSoundBankFreeListStart[bankId]; index = sSfxBankFreeListStart[bankId];
entry = &gSoundBanks[bankId][index]; entry = &gSfxBanks[bankId][index];
entry->posX = &req->pos->x; entry->posX = &req->pos->x;
entry->posY = &req->pos->y; entry->posY = &req->pos->y;
entry->posZ = &req->pos->z; entry->posZ = &req->pos->z;
@ -232,85 +232,85 @@ void Audio_ProcessSoundRequest(void) {
entry->freqScale = req->freqScale; entry->freqScale = req->freqScale;
entry->vol = req->vol; entry->vol = req->vol;
entry->reverbAdd = req->reverbAdd; entry->reverbAdd = req->reverbAdd;
soundParams = &gSoundParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)]; sfxParams = &gSfxParams[SFX_BANK_SHIFT(req->sfxId)][SFX_INDEX(req->sfxId)];
entry->sfxParams = soundParams->params; entry->sfxParams = sfxParams->params;
entry->sfxImportance = soundParams->importance; entry->sfxImportance = sfxParams->importance;
entry->sfxId = req->sfxId; entry->sfxId = req->sfxId;
entry->state = SFX_STATE_QUEUED; entry->state = SFX_STATE_QUEUED;
entry->freshness = 2; entry->freshness = 2;
entry->prev = sSoundBankListEnd[bankId]; entry->prev = sSfxBankListEnd[bankId];
gSoundBanks[bankId][sSoundBankListEnd[bankId]].next = sSoundBankFreeListStart[bankId]; gSfxBanks[bankId][sSfxBankListEnd[bankId]].next = sSfxBankFreeListStart[bankId];
sSoundBankListEnd[bankId] = sSoundBankFreeListStart[bankId]; sSfxBankListEnd[bankId] = sSfxBankFreeListStart[bankId];
sSoundBankFreeListStart[bankId] = gSoundBanks[bankId][sSoundBankFreeListStart[bankId]].next; sSfxBankFreeListStart[bankId] = gSfxBanks[bankId][sSfxBankFreeListStart[bankId]].next;
gSoundBanks[bankId][sSoundBankFreeListStart[bankId]].prev = 0xFF; gSfxBanks[bankId][sSfxBankFreeListStart[bankId]].prev = 0xFF;
entry->next = 0xFF; entry->next = 0xFF;
} }
} }
void Audio_RemoveSoundBankEntry(u8 bankId, u8 entryIndex) { void Audio_RemoveSfxBankEntry(u8 bankId, u8 entryIndex) {
SoundBankEntry* entry = &gSoundBanks[bankId][entryIndex]; SfxBankEntry* entry = &gSfxBanks[bankId][entryIndex];
u8 i; u8 i;
if (entry->sfxParams & SFX_FLAG_3) { if (entry->sfxParams & SFX_FLAG_3) {
Audio_ClearBGMMute(entry->channelIdx); Audio_ClearBGMMute(entry->channelIdx);
} }
if (entryIndex == sSoundBankListEnd[bankId]) { if (entryIndex == sSfxBankListEnd[bankId]) {
sSoundBankListEnd[bankId] = entry->prev; sSfxBankListEnd[bankId] = entry->prev;
} else { } else {
gSoundBanks[bankId][entry->next].prev = entry->prev; gSfxBanks[bankId][entry->next].prev = entry->prev;
} }
gSoundBanks[bankId][entry->prev].next = entry->next; gSfxBanks[bankId][entry->prev].next = entry->next;
entry->next = sSoundBankFreeListStart[bankId]; entry->next = sSfxBankFreeListStart[bankId];
entry->prev = 0xFF; entry->prev = 0xFF;
gSoundBanks[bankId][sSoundBankFreeListStart[bankId]].prev = entryIndex; gSfxBanks[bankId][sSfxBankFreeListStart[bankId]].prev = entryIndex;
sSoundBankFreeListStart[bankId] = entryIndex; sSfxBankFreeListStart[bankId] = entryIndex;
entry->state = SFX_STATE_EMPTY; entry->state = SFX_STATE_EMPTY;
for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) { for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) {
if (gActiveSounds[bankId][i].entryIndex == entryIndex) { if (gActiveSfx[bankId][i].entryIndex == entryIndex) {
gActiveSounds[bankId][i].entryIndex = 0xFF; gActiveSfx[bankId][i].entryIndex = 0xFF;
i = gChannelsPerBank[gSfxChannelLayout][bankId]; i = gChannelsPerBank[gSfxChannelLayout][bankId];
} }
} }
} }
void Audio_ChooseActiveSounds(u8 bankId) { void Audio_ChooseActiveSfx(u8 bankId) {
u8 numChosenSounds; u8 numChosenSfx;
u8 numChannels; u8 numChannels;
u8 entryIndex; u8 entryIndex;
u8 i; u8 i;
u8 j; u8 j;
u8 k; u8 k;
u8 sfxImportance; u8 sfxImportance;
u8 needNewSound; u8 needNewSfx;
u8 chosenEntryIndex; u8 chosenEntryIndex;
u16 temp3; u16 temp3;
f32 tempf1; f32 tempf1;
SoundBankEntry* entry; SfxBankEntry* entry;
ActiveSound chosenSounds[MAX_CHANNELS_PER_BANK]; ActiveSfx chosenSfx[MAX_CHANNELS_PER_BANK];
ActiveSound* activeSound; ActiveSfx* activeSfx;
s32 pad; s32 pad;
numChosenSounds = 0; numChosenSfx = 0;
for (i = 0; i < MAX_CHANNELS_PER_BANK; i++) { for (i = 0; i < MAX_CHANNELS_PER_BANK; i++) {
chosenSounds[i].priority = 0x7FFFFFFF; chosenSfx[i].priority = 0x7FFFFFFF;
chosenSounds[i].entryIndex = 0xFF; chosenSfx[i].entryIndex = 0xFF;
} }
entryIndex = gSoundBanks[bankId][0].next; entryIndex = gSfxBanks[bankId][0].next;
k = 0; k = 0;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
if ((gSoundBanks[bankId][entryIndex].state == SFX_STATE_QUEUED) && if ((gSfxBanks[bankId][entryIndex].state == SFX_STATE_QUEUED) &&
(gSoundBanks[bankId][entryIndex].sfxId & 0xC00)) { (gSfxBanks[bankId][entryIndex].sfxId & 0xC00)) {
gSoundBanks[bankId][entryIndex].freshness--; gSfxBanks[bankId][entryIndex].freshness--;
} else if (!(gSoundBanks[bankId][entryIndex].sfxId & 0xC00) && } else if (!(gSfxBanks[bankId][entryIndex].sfxId & 0xC00) &&
(gSoundBanks[bankId][entryIndex].state == SFX_STATE_PLAYING_2)) { (gSfxBanks[bankId][entryIndex].state == SFX_STATE_PLAYING_2)) {
Audio_QueueCmdS8((gSoundBanks[bankId][entryIndex].channelIdx << 8) | 0x6020000, 0); Audio_QueueCmdS8((gSfxBanks[bankId][entryIndex].channelIdx << 8) | 0x6020000, 0);
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
} }
if (gSoundBanks[bankId][entryIndex].freshness == 0) { if (gSfxBanks[bankId][entryIndex].freshness == 0) {
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
} else if (gSoundBanks[bankId][entryIndex].state != SFX_STATE_EMPTY) { } else if (gSfxBanks[bankId][entryIndex].state != SFX_STATE_EMPTY) {
entry = &gSoundBanks[bankId][entryIndex]; entry = &gSfxBanks[bankId][entryIndex];
if (&gSfxDefaultPos.x == entry[0].posX) { if (&gSfxDefaultPos.x == entry[0].posX) {
entry->dist = 0.0f; entry->dist = 0.0f;
@ -338,33 +338,33 @@ void Audio_ChooseActiveSounds(u8 bankId) {
if (entry->state == SFX_STATE_PLAYING_1) { if (entry->state == SFX_STATE_PLAYING_1) {
Audio_QueueCmdS8((entry->channelIdx << 8) | 0x6020000, 0); Audio_QueueCmdS8((entry->channelIdx << 8) | 0x6020000, 0);
if (entry->sfxId & 0xC00) { if (entry->sfxId & 0xC00) {
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
entryIndex = k; entryIndex = k;
} }
} }
} else { } else {
numChannels = gChannelsPerBank[gSfxChannelLayout][bankId]; numChannels = gChannelsPerBank[gSfxChannelLayout][bankId];
for (i = 0; i < numChannels; i++) { for (i = 0; i < numChannels; i++) {
if (chosenSounds[i].priority >= entry->priority) { if (chosenSfx[i].priority >= entry->priority) {
if (numChosenSounds < gChannelsPerBank[gSfxChannelLayout][bankId]) { if (numChosenSfx < gChannelsPerBank[gSfxChannelLayout][bankId]) {
numChosenSounds++; numChosenSfx++;
} }
for (j = numChannels - 1; j > i; j--) { for (j = numChannels - 1; j > i; j--) {
chosenSounds[j].priority = chosenSounds[j - 1].priority; chosenSfx[j].priority = chosenSfx[j - 1].priority;
chosenSounds[j].entryIndex = chosenSounds[j - 1].entryIndex; chosenSfx[j].entryIndex = chosenSfx[j - 1].entryIndex;
} }
chosenSounds[i].priority = entry->priority; chosenSfx[i].priority = entry->priority;
chosenSounds[i].entryIndex = entryIndex; chosenSfx[i].entryIndex = entryIndex;
i = numChannels; // "break;" i = numChannels; // "break;"
} }
} }
} }
k = entryIndex; k = entryIndex;
} }
entryIndex = gSoundBanks[bankId][k].next; entryIndex = gSfxBanks[bankId][k].next;
} }
for (i = 0; i < numChosenSounds; i++) { for (i = 0; i < numChosenSfx; i++) {
entry = &gSoundBanks[bankId][chosenSounds[i].entryIndex]; entry = &gSfxBanks[bankId][chosenSfx[i].entryIndex];
if (entry->state == SFX_STATE_QUEUED) { if (entry->state == SFX_STATE_QUEUED) {
entry->state = SFX_STATE_READY; entry->state = SFX_STATE_READY;
} else if (entry->state == SFX_STATE_PLAYING_1) { } else if (entry->state == SFX_STATE_PLAYING_1) {
@ -375,72 +375,72 @@ void Audio_ChooseActiveSounds(u8 bankId) {
// Pick something to play for all channels. // Pick something to play for all channels.
numChannels = gChannelsPerBank[gSfxChannelLayout][bankId]; numChannels = gChannelsPerBank[gSfxChannelLayout][bankId];
for (i = 0; i < numChannels; i++) { for (i = 0; i < numChannels; i++) {
needNewSound = false; needNewSfx = false;
activeSound = &gActiveSounds[bankId][i]; activeSfx = &gActiveSfx[bankId][i];
if (activeSound->entryIndex == 0xFF) { if (activeSfx->entryIndex == 0xFF) {
needNewSound = true; needNewSfx = true;
} else { } else {
entry = &gSoundBanks[bankId][activeSound[0].entryIndex]; entry = &gSfxBanks[bankId][activeSfx[0].entryIndex];
if (entry->state == SFX_STATE_PLAYING_1) { if (entry->state == SFX_STATE_PLAYING_1) {
if (entry->sfxId & 0xC00) { if (entry->sfxId & 0xC00) {
Audio_RemoveSoundBankEntry(bankId, activeSound->entryIndex); Audio_RemoveSfxBankEntry(bankId, activeSfx->entryIndex);
} else { } else {
entry->state = SFX_STATE_QUEUED; entry->state = SFX_STATE_QUEUED;
} }
needNewSound = true; needNewSfx = true;
} else if (entry->state == SFX_STATE_EMPTY) { } else if (entry->state == SFX_STATE_EMPTY) {
activeSound->entryIndex = 0xFF; activeSfx->entryIndex = 0xFF;
needNewSound = true; needNewSfx = true;
} else { } else {
// Sound is already playing as it should, nothing to do. // Sfx is already playing as it should, nothing to do.
for (j = 0; j < numChannels; j++) { for (j = 0; j < numChannels; j++) {
if (activeSound->entryIndex == chosenSounds[j].entryIndex) { if (activeSfx->entryIndex == chosenSfx[j].entryIndex) {
chosenSounds[j].entryIndex = 0xFF; chosenSfx[j].entryIndex = 0xFF;
j = numChannels; j = numChannels;
} }
} }
numChosenSounds--; numChosenSfx--;
} }
} }
if (needNewSound == true) { if (needNewSfx == true) {
for (j = 0; j < numChannels; j++) { for (j = 0; j < numChannels; j++) {
chosenEntryIndex = chosenSounds[j].entryIndex; chosenEntryIndex = chosenSfx[j].entryIndex;
if ((chosenEntryIndex != 0xFF) && if ((chosenEntryIndex != 0xFF) &&
(gSoundBanks[bankId][chosenEntryIndex].state != SFX_STATE_PLAYING_REFRESH)) { (gSfxBanks[bankId][chosenEntryIndex].state != SFX_STATE_PLAYING_REFRESH)) {
for (k = 0; k < numChannels; k++) { for (k = 0; k < numChannels; k++) {
if (chosenEntryIndex == gActiveSounds[bankId][k].entryIndex) { if (chosenEntryIndex == gActiveSfx[bankId][k].entryIndex) {
needNewSound = false; needNewSfx = false;
k = numChannels; // "break;" k = numChannels; // "break;"
} }
} }
if (needNewSound == true) { if (needNewSfx == true) {
activeSound->entryIndex = chosenEntryIndex; activeSfx->entryIndex = chosenEntryIndex;
chosenSounds[j].entryIndex = 0xFF; chosenSfx[j].entryIndex = 0xFF;
j = numChannels + 1; j = numChannels + 1;
numChosenSounds--; numChosenSfx--;
} }
} }
} }
if (j == numChannels) { if (j == numChannels) {
// nothing found // nothing found
activeSound->entryIndex = 0xFF; activeSfx->entryIndex = 0xFF;
} }
} }
} }
} }
void Audio_PlayActiveSounds(u8 bankId) { void Audio_PlayActiveSfx(u8 bankId) {
u8 entryIndex; u8 entryIndex;
SequenceChannel* channel; SequenceChannel* channel;
SoundBankEntry* entry; SfxBankEntry* entry;
u8 i; u8 i;
for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) { for (i = 0; i < gChannelsPerBank[gSfxChannelLayout][bankId]; i++) {
entryIndex = gActiveSounds[bankId][i].entryIndex; entryIndex = gActiveSfx[bankId][i].entryIndex;
if (entryIndex != 0xFF) { if (entryIndex != 0xFF) {
entry = &gSoundBanks[bankId][entryIndex]; entry = &gSfxBanks[bankId][entryIndex];
channel = gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIdx]; channel = gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIdx];
if (entry->state == SFX_STATE_READY) { if (entry->state == SFX_STATE_READY) {
entry->channelIdx = sCurSfxPlayerChannelIdx; entry->channelIdx = sCurSfxPlayerChannelIdx;
@ -463,11 +463,11 @@ void Audio_PlayActiveSounds(u8 bankId) {
break; break;
} }
} }
Audio_SetSoundProperties(bankId, entryIndex, sCurSfxPlayerChannelIdx); Audio_SetSfxProperties(bankId, entryIndex, sCurSfxPlayerChannelIdx);
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8), 1); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8), 1);
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 4, Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 4,
entry->sfxId & 0xFF); entry->sfxId & 0xFF);
if (gIsLargeSoundBank[bankId]) { if (gIsLargeSfxBank[bankId]) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 5, Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 5,
(entry->sfxId & 0x100) >> 8); (entry->sfxId & 0x100) >> 8);
} }
@ -477,9 +477,9 @@ void Audio_PlayActiveSounds(u8 bankId) {
entry->state = SFX_STATE_PLAYING_2; entry->state = SFX_STATE_PLAYING_2;
} }
} else if ((u8)channel->soundScriptIO[1] == 0xFF) { } else if ((u8)channel->soundScriptIO[1] == 0xFF) {
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
} else if (entry->state == SFX_STATE_PLAYING_REFRESH) { } else if (entry->state == SFX_STATE_PLAYING_REFRESH) {
Audio_SetSoundProperties(bankId, entryIndex, sCurSfxPlayerChannelIdx); Audio_SetSfxProperties(bankId, entryIndex, sCurSfxPlayerChannelIdx);
if (entry->sfxId & 0xC00) { if (entry->sfxId & 0xC00) {
entry->state = SFX_STATE_PLAYING_1; entry->state = SFX_STATE_PLAYING_1;
} else { } else {
@ -492,149 +492,149 @@ void Audio_PlayActiveSounds(u8 bankId) {
} }
void Audio_StopSfxByBank(u8 bankId) { void Audio_StopSfxByBank(u8 bankId) {
SoundBankEntry* entry; SfxBankEntry* entry;
s32 pad; s32 pad;
SoundBankEntry cmp; SfxBankEntry cmp;
u8 entryIndex = gSoundBanks[bankId][0].next; u8 entryIndex = gSfxBanks[bankId][0].next;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[bankId][entryIndex]; entry = &gSfxBanks[bankId][entryIndex];
if (entry->state >= SFX_STATE_PLAYING_REFRESH) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0);
} }
if (entry->state != SFX_STATE_EMPTY) { if (entry->state != SFX_STATE_EMPTY) {
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
} }
entryIndex = gSoundBanks[bankId][0].next; entryIndex = gSfxBanks[bankId][0].next;
} }
cmp.sfxId = bankId << 12; cmp.sfxId = bankId << 12;
Audio_RemoveMatchingSoundRequests(0, &cmp); Audio_RemoveMatchingSfxRequests(0, &cmp);
} }
void func_800F8884(u8 bankId, Vec3f* pos) { void func_800F8884(u8 bankId, Vec3f* pos) {
SoundBankEntry* entry; SfxBankEntry* entry;
u8 entryIndex = gSoundBanks[bankId][0].next; u8 entryIndex = gSfxBanks[bankId][0].next;
u8 prevEntryIndex = 0; u8 prevEntryIndex = 0;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[bankId][entryIndex]; entry = &gSfxBanks[bankId][entryIndex];
if (entry->posX == &pos->x) { if (entry->posX == &pos->x) {
if (entry->state >= SFX_STATE_PLAYING_REFRESH) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0);
} }
if (entry->state != SFX_STATE_EMPTY) { if (entry->state != SFX_STATE_EMPTY) {
Audio_RemoveSoundBankEntry(bankId, entryIndex); Audio_RemoveSfxBankEntry(bankId, entryIndex);
} }
} else { } else {
prevEntryIndex = entryIndex; prevEntryIndex = entryIndex;
} }
entryIndex = gSoundBanks[bankId][prevEntryIndex].next; entryIndex = gSfxBanks[bankId][prevEntryIndex].next;
} }
} }
void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos) { void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos) {
SoundBankEntry cmp; SfxBankEntry cmp;
func_800F8884(bankId, pos); func_800F8884(bankId, pos);
cmp.sfxId = bankId << 12; cmp.sfxId = bankId << 12;
cmp.posX = &pos->x; cmp.posX = &pos->x;
Audio_RemoveMatchingSoundRequests(1, &cmp); Audio_RemoveMatchingSfxRequests(1, &cmp);
} }
void Audio_StopSfxByPos(Vec3f* pos) { void Audio_StopSfxByPos(Vec3f* pos) {
u8 i; u8 i;
SoundBankEntry cmp; SfxBankEntry cmp;
for (i = 0; i < ARRAY_COUNT(gSoundBanks); i++) { for (i = 0; i < ARRAY_COUNT(gSfxBanks); i++) {
func_800F8884(i, pos); func_800F8884(i, pos);
} }
cmp.posX = &pos->x; cmp.posX = &pos->x;
Audio_RemoveMatchingSoundRequests(2, &cmp); Audio_RemoveMatchingSfxRequests(2, &cmp);
} }
void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId) { void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId) {
SoundBankEntry* entry; SfxBankEntry* entry;
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 entryIndex = gSfxBanks[SFX_BANK(sfxId)][0].next;
u8 prevEntryIndex = 0; u8 prevEntryIndex = 0;
SoundBankEntry cmp; SfxBankEntry cmp;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; entry = &gSfxBanks[SFX_BANK(sfxId)][entryIndex];
if (entry->posX == &pos->x && entry->sfxId == sfxId) { if (entry->posX == &pos->x && entry->sfxId == sfxId) {
if (entry->state >= SFX_STATE_PLAYING_REFRESH) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0);
} }
if (entry->state != SFX_STATE_EMPTY) { if (entry->state != SFX_STATE_EMPTY) {
Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); Audio_RemoveSfxBankEntry(SFX_BANK(sfxId), entryIndex);
} }
entryIndex = 0xFF; entryIndex = 0xFF;
} else { } else {
prevEntryIndex = entryIndex; prevEntryIndex = entryIndex;
} }
if (entryIndex != 0xFF) { if (entryIndex != 0xFF) {
entryIndex = gSoundBanks[SFX_BANK(sfxId)][prevEntryIndex].next; entryIndex = gSfxBanks[SFX_BANK(sfxId)][prevEntryIndex].next;
} }
} }
cmp.posX = &pos->x; cmp.posX = &pos->x;
cmp.sfxId = sfxId; cmp.sfxId = sfxId;
Audio_RemoveMatchingSoundRequests(3, &cmp); Audio_RemoveMatchingSfxRequests(3, &cmp);
} }
void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId) { void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId) {
SoundBankEntry* entry; SfxBankEntry* entry;
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 entryIndex = gSfxBanks[SFX_BANK(sfxId)][0].next;
u8 prevEntryIndex = 0; u8 prevEntryIndex = 0;
SoundBankEntry cmp; SfxBankEntry cmp;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; entry = &gSfxBanks[SFX_BANK(sfxId)][entryIndex];
if (entry->token == token && entry->sfxId == sfxId) { if (entry->token == token && entry->sfxId == sfxId) {
if (entry->state >= SFX_STATE_PLAYING_REFRESH) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0);
} }
if (entry->state != SFX_STATE_EMPTY) { if (entry->state != SFX_STATE_EMPTY) {
Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); Audio_RemoveSfxBankEntry(SFX_BANK(sfxId), entryIndex);
} }
} else { } else {
prevEntryIndex = entryIndex; prevEntryIndex = entryIndex;
} }
if (entryIndex != 0xFF) { if (entryIndex != 0xFF) {
entryIndex = gSoundBanks[SFX_BANK(sfxId)][prevEntryIndex].next; entryIndex = gSfxBanks[SFX_BANK(sfxId)][prevEntryIndex].next;
} }
} }
cmp.token = token; cmp.token = token;
cmp.sfxId = sfxId; cmp.sfxId = sfxId;
Audio_RemoveMatchingSoundRequests(4, &cmp); Audio_RemoveMatchingSfxRequests(4, &cmp);
} }
void Audio_StopSfxById(u32 sfxId) { void Audio_StopSfxById(u32 sfxId) {
SoundBankEntry* entry; SfxBankEntry* entry;
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 entryIndex = gSfxBanks[SFX_BANK(sfxId)][0].next;
u8 prevEntryIndex = 0; u8 prevEntryIndex = 0;
SoundBankEntry cmp; SfxBankEntry cmp;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; entry = &gSfxBanks[SFX_BANK(sfxId)][entryIndex];
if (entry->sfxId == sfxId) { if (entry->sfxId == sfxId) {
if (entry->state >= SFX_STATE_PLAYING_REFRESH) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) {
Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0);
} }
if (entry->state != SFX_STATE_EMPTY) { if (entry->state != SFX_STATE_EMPTY) {
Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); Audio_RemoveSfxBankEntry(SFX_BANK(sfxId), entryIndex);
} }
} else { } else {
prevEntryIndex = entryIndex; prevEntryIndex = entryIndex;
} }
entryIndex = gSoundBanks[SFX_BANK(sfxId)][prevEntryIndex].next; entryIndex = gSfxBanks[SFX_BANK(sfxId)][prevEntryIndex].next;
} }
cmp.sfxId = sfxId; cmp.sfxId = sfxId;
Audio_RemoveMatchingSoundRequests(5, &cmp); Audio_RemoveMatchingSfxRequests(5, &cmp);
} }
void Audio_ProcessSoundRequests(void) { void Audio_ProcessSfxRequests(void) {
while (gSoundRequestWriteIndex != gSoundRequestReadIndex) { while (gSfxRequestWriteIndex != gSfxRequestReadIndex) {
Audio_ProcessSoundRequest(); Audio_ProcessSfxRequest();
gSoundRequestReadIndex++; gSfxRequestReadIndex++;
} }
} }
@ -663,20 +663,20 @@ void func_800F8F88(void) {
if (IS_SEQUENCE_CHANNEL_VALID(gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[0])) { if (IS_SEQUENCE_CHANNEL_VALID(gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[0])) {
sCurSfxPlayerChannelIdx = 0; sCurSfxPlayerChannelIdx = 0;
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) {
Audio_ChooseActiveSounds(bankId); Audio_ChooseActiveSfx(bankId);
Audio_PlayActiveSounds(bankId); Audio_PlayActiveSfx(bankId);
Audio_StepUnusedBankLerp(bankId); Audio_StepUnusedBankLerp(bankId);
} }
} }
} }
u8 Audio_IsSfxPlaying(u32 sfxId) { u8 Audio_IsSfxPlaying(u32 sfxId) {
SoundBankEntry* entry; SfxBankEntry* entry;
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next; u8 entryIndex = gSfxBanks[SFX_BANK(sfxId)][0].next;
while (entryIndex != 0xFF) { while (entryIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; entry = &gSfxBanks[SFX_BANK(sfxId)][entryIndex];
if (entry->sfxId == sfxId) { if (entry->sfxId == sfxId) {
return true; return true;
} }
@ -685,36 +685,36 @@ u8 Audio_IsSfxPlaying(u32 sfxId) {
return false; return false;
} }
void Audio_ResetSounds(void) { void Audio_ResetSfx(void) {
u8 bankId; u8 bankId;
u8 i; u8 i;
u8 entryIndex; u8 entryIndex;
gSoundRequestWriteIndex = 0; gSfxRequestWriteIndex = 0;
gSoundRequestReadIndex = 0; gSfxRequestReadIndex = 0;
D_801333D0 = 0; D_801333D0 = 0;
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) {
sSoundBankListEnd[bankId] = 0; sSfxBankListEnd[bankId] = 0;
sSoundBankFreeListStart[bankId] = 1; sSfxBankFreeListStart[bankId] = 1;
sSoundBankUnused[bankId] = 0; sSfxBankUnused[bankId] = 0;
gSoundBankMuted[bankId] = false; gSfxBankMuted[bankId] = false;
sUnusedBankLerp[bankId].value = 1.0f; sUnusedBankLerp[bankId].value = 1.0f;
sUnusedBankLerp[bankId].remainingFrames = 0; sUnusedBankLerp[bankId].remainingFrames = 0;
} }
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) {
for (i = 0; i < MAX_CHANNELS_PER_BANK; i++) { for (i = 0; i < MAX_CHANNELS_PER_BANK; i++) {
gActiveSounds[bankId][i].entryIndex = 0xFF; gActiveSfx[bankId][i].entryIndex = 0xFF;
} }
} }
for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) {
gSoundBanks[bankId][0].prev = 0xFF; gSfxBanks[bankId][0].prev = 0xFF;
gSoundBanks[bankId][0].next = 0xFF; gSfxBanks[bankId][0].next = 0xFF;
for (i = 1; i < gSoundBankSizes[bankId] - 1; i++) { for (i = 1; i < gSfxBankSizes[bankId] - 1; i++) {
gSoundBanks[bankId][i].prev = i - 1; gSfxBanks[bankId][i].prev = i - 1;
gSoundBanks[bankId][i].next = i + 1; gSfxBanks[bankId][i].next = i + 1;
} }
gSoundBanks[bankId][i].prev = i - 1; gSfxBanks[bankId][i].prev = i - 1;
gSoundBanks[bankId][i].next = 0xFF; gSfxBanks[bankId][i].next = 0xFF;
} }
if (D_801333F8 == 0) { if (D_801333F8 == 0) {
for (bankId = 0; bankId < 10; bankId++) { for (bankId = 0; bankId < 10; bankId++) {

View file

@ -361,8 +361,8 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
if (dbCamera->sub.nPoints < 6) { if (dbCamera->sub.nPoints < 6) {
if (sDbCamAnim.unk_0A != 0) { if (sDbCamAnim.unk_0A != 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sDbCamAnim.unk_0A = 0; sDbCamAnim.unk_0A = 0;
} }
func_8006376C(0x11, 0x17, 3, D_8012CEE0[0]); func_8006376C(0x11, 0x17, 3, D_8012CEE0[0]);
@ -376,8 +376,8 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
!func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, dbCamera->sub.lookAt, !func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, dbCamera->sub.lookAt,
&sDbCamAnim.keyframe, &sDbCamAnim.curFrame) && &sDbCamAnim.keyframe, &sDbCamAnim.curFrame) &&
sDbCamAnim.unk_0A == 1) { sDbCamAnim.unk_0A == 1) {
Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sDbCamAnim.unk_04++; sDbCamAnim.unk_04++;
if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) { if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) {
@ -605,8 +605,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
dbCamera->unk_40 = -1; dbCamera->unk_40 = -1;
dbCamera->sub.demoCtrlActionIdx = 0; dbCamera->sub.demoCtrlActionIdx = 0;
sDbCamAnim.unk_0A = 0; sDbCamAnim.unk_0A = 0;
Audio_PlaySoundGeneral(NA_SE_SY_LOCK_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_LOCK_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (dbCamera->unk_38 == -1) { } else if (dbCamera->unk_38 == -1) {
dbCamera->unk_38 = 1; dbCamera->unk_38 = 1;
} else { } else {
@ -926,25 +926,25 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
dbCamera->unk_1C.z = 0.0f; dbCamera->unk_1C.z = 0.0f;
dbCamera->unk_1C.y = 1.0f; dbCamera->unk_1C.y = 1.0f;
} else if (dbCamera->sub.unk_08 == 2) { } else if (dbCamera->sub.unk_08 == 2) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.unk_08 = 0; dbCamera->sub.unk_08 = 0;
func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam);
} else { } else {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R) && if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R) &&
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) { CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.nPoints = dbCamera->sub.unkIdx + 1; dbCamera->sub.nPoints = dbCamera->sub.unkIdx + 1;
func_800B4088(dbCamera, cam); func_800B4088(dbCamera, cam);
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) { } else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) {
if (dbCamera->sub.unkIdx == 0x80) { if (dbCamera->sub.unkIdx == 0x80) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
func_800B42C0(dbCamera, cam); func_800B42C0(dbCamera, cam);
if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) { if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) {
dbCamera->sub.unkIdx++; dbCamera->sub.unkIdx++;
@ -997,8 +997,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} else { } else {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT) && if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CRIGHT) &&
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) { CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n"); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n");
DbCamera_PrintPoints("Lookat", dbCamera->sub.nPoints, dbCamera->sub.lookAt); DbCamera_PrintPoints("Lookat", dbCamera->sub.nPoints, dbCamera->sub.lookAt);
DbCamera_PrintPoints("Position", dbCamera->sub.nPoints, dbCamera->sub.position); DbCamera_PrintPoints("Position", dbCamera->sub.nPoints, dbCamera->sub.position);
@ -1007,15 +1007,15 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
osSyncPrintf("@@@static short Mode = %d;\n@@@\n", dbCamera->sub.mode); osSyncPrintf("@@@static short Mode = %d;\n@@@\n", dbCamera->sub.mode);
osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n"); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n");
} else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) { } else if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.unk_08 = (dbCamera->sub.unk_08 + 1) % 3; dbCamera->sub.unk_08 = (dbCamera->sub.unk_08 + 1) % 3;
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP) && if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP) &&
CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) { CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unkIdx > 0) { if (dbCamera->sub.unkIdx > 0) {
dbCamera->sub.unkIdx--; dbCamera->sub.unkIdx--;
} else { } else {
@ -1023,8 +1023,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} else { } else {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CUP)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unkIdx > 0) { if (dbCamera->sub.unkIdx > 0) {
dbCamera->sub.unkIdx--; dbCamera->sub.unkIdx--;
} else { } else {
@ -1045,8 +1045,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) && if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) &&
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) {
dbCamera->sub.unkIdx++; dbCamera->sub.unkIdx++;
} else { } else {
@ -1054,8 +1054,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} else { } else {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CDOWN)) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) {
dbCamera->sub.unkIdx++; dbCamera->sub.unkIdx++;
} else { } else {
@ -1124,8 +1124,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
case 1: case 1:
dbCamera->unk_3C = true; dbCamera->unk_3C = true;
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unk_0A == 0) { if (dbCamera->sub.unk_0A == 0) {
dbCamera->sub.unk_0A = 5; dbCamera->sub.unk_0A = 5;
} else { } else {
@ -1133,8 +1133,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.unk_0A == 5) { if (dbCamera->sub.unk_0A == 5) {
dbCamera->sub.unk_0A = 0; dbCamera->sub.unk_0A = 0;
} else { } else {
@ -1142,8 +1142,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
switch (dbCamera->sub.unk_0A) { switch (dbCamera->sub.unk_0A) {
case 1: case 1:
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) { if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L)) {
@ -1192,9 +1192,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DLEFT)) {
if ((D_8012D10C++ % 5) == 0) { if ((D_8012D10C++ % 5) == 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
} }
switch (dbCamera->sub.unk_0A) { switch (dbCamera->sub.unk_0A) {
@ -1231,8 +1230,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
switch (dbCamera->sub.unk_0A) { switch (dbCamera->sub.unk_0A) {
case 1: case 1:
@ -1281,9 +1280,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DRIGHT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_DRIGHT)) {
if ((D_8012D10C++ % 5) == 0) { if ((D_8012D10C++ % 5) == 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
} }
switch (dbCamera->sub.unk_0A) { switch (dbCamera->sub.unk_0A) {
@ -1435,8 +1433,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
dbCamera->fov = 60.0f; dbCamera->fov = 60.0f;
dbCamera->rollDegrees = dbCamera->roll * 1.40625f; dbCamera->rollDegrees = dbCamera->roll * 1.40625f;
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->unk_78 = (dbCamera->unk_78 + 1) % 3; dbCamera->unk_78 = (dbCamera->unk_78 + 1) % 3;
dbCamera->unk_38 = -1; dbCamera->unk_38 = -1;
} }
@ -1717,8 +1715,8 @@ void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) {
void DbCamera_PrintAllCuts(Camera* cam) { void DbCamera_PrintAllCuts(Camera* cam) {
s32 i; s32 i;
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** start here ***** */\n@@@\n"); osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** start here ***** */\n@@@\n");
for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) {
@ -1865,8 +1863,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if ((1 << sCurFileIdx) & sMempakFiles) { if ((1 << sCurFileIdx) & sMempakFiles) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT) || if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT) ||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlToggleSwitch ^= 1; dbCamera->sub.demoCtrlToggleSwitch ^= 1;
} }
D_8012CEE0[41][9] = sCurFileIdx + 'A'; D_8012CEE0[41][9] = sCurFileIdx + 'A';
@ -1879,12 +1877,12 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
if (dbCamera->sub.demoCtrlToggleSwitch == 0) { if (dbCamera->sub.demoCtrlToggleSwitch == 0) {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu++; dbCamera->sub.demoCtrlMenu++;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu = 0; dbCamera->sub.demoCtrlMenu = 0;
} }
} }
@ -1900,8 +1898,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu = 0; dbCamera->sub.demoCtrlMenu = 0;
return 1; return 1;
} }
@ -1937,8 +1935,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) || if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) ||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (dbCamera->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) { if (dbCamera->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) {
dbCamera->sub.demoCtrlActionIdx = ACTION_E; dbCamera->sub.demoCtrlActionIdx = ACTION_E;
} }
@ -1960,8 +1958,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) || if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A) ||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu -= 9; dbCamera->sub.demoCtrlMenu -= 9;
} }
block_2: block_2:
@ -1995,8 +1993,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
sp74[i * 2 + 1] = '\0'; sp74[i * 2 + 1] = '\0';
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sCurFileIdx >= 4) { if (sCurFileIdx >= 4) {
sCurFileIdx = 0; sCurFileIdx = 0;
} else { } else {
@ -2012,8 +2010,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sCurFileIdx <= 0) { if (sCurFileIdx <= 0) {
sCurFileIdx = 4; sCurFileIdx = 4;
} else { } else {
@ -2055,25 +2053,25 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
func_8006376C(0x14, 0x1A, 5, D_8012CF70); func_8006376C(0x14, 0x1A, 5, D_8012CF70);
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u;
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u;
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlToggleSwitch = 0; dbCamera->sub.demoCtrlToggleSwitch = 0;
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(dbCamera->sub.demoCtrlActionIdx, MENU_INFO); dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(dbCamera->sub.demoCtrlActionIdx, MENU_INFO);
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlActionIdx = ACTION_E; dbCamera->sub.demoCtrlActionIdx = ACTION_E;
return 1; return 1;
} }
@ -2085,8 +2083,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP) || CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP) ||
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlActionIdx = ACTION_E; dbCamera->sub.demoCtrlActionIdx = ACTION_E;
} }
return 2; return 2;
@ -2098,15 +2096,15 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
default: { default: {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DUP)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO);
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u;
sCurFileIdx = 0; sCurFileIdx = 0;
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DDOWN)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO);
dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u;
sCurFileIdx = 0; sCurFileIdx = 0;
@ -2145,8 +2143,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (func_800B91B0(cam, dbCamera) == 0) { if (func_800B91B0(cam, dbCamera) == 0) {
Interface_ChangeAlpha(2); Interface_ChangeAlpha(2);
ShrinkWindow_SetVal(0); ShrinkWindow_SetVal(0);
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
OLib_Vec3fDiffToVecSphGeo(&sp5C, &dbCamera->eye, &dbCamera->at); OLib_Vec3fDiffToVecSphGeo(&sp5C, &dbCamera->eye, &dbCamera->at);
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw, DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw,
@ -2164,8 +2162,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
sDbCamAnim.unk_0A = 1; sDbCamAnim.unk_0A = 1;
sDbCamAnim.unk_0C = 0; sDbCamAnim.unk_0C = 0;
D_8016110C = 0; D_8016110C = 0;
Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_L)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_L)) {
@ -2181,15 +2179,15 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (sLastFileIdx != -1) { if (sLastFileIdx != -1) {
switch (sp74[sCurFileIdx]) { switch (sp74[sCurFileIdx]) {
case '?': case '?':
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sDbCameraCuts[idx1] = sDbCameraCuts[idx2]; sDbCameraCuts[idx1] = sDbCameraCuts[idx2];
sp74[sCurFileIdx] = '?'; // useless sp74[sCurFileIdx] = '?'; // useless
DbCamera_ResetCut(idx2, false); DbCamera_ResetCut(idx2, false);
break; break;
case '-': case '-':
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sp64 = sDbCameraCuts[idx2]; sp64 = sDbCameraCuts[idx2];
if (sLastFileIdx < sCurFileIdx) { if (sLastFileIdx < sCurFileIdx) {
@ -2211,8 +2209,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
break; break;
default: default:
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
break; break;
} }
} }
@ -2221,8 +2219,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_A)) {
if (sp74[sCurFileIdx] == '?') { if (sp74[sCurFileIdx] == '?') {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub); sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub);
if (sp74[sCurFileIdx] == '?') { if (sp74[sCurFileIdx] == '?') {
func_8006376C(0xF, 0x18, 7, D_8012CF48); func_8006376C(0xF, 0x18, 7, D_8012CF48);
@ -2232,8 +2230,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_B)) {
if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sp74[sCurFileIdx] = '?'; sp74[sCurFileIdx] = '?';
DbCamera_ResetCut(idx1, true); DbCamera_ResetCut(idx1, true);
} }
@ -2241,8 +2239,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_R)) {
if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
for (i = 0; i < sDbCameraCuts[idx1].nPoints; i++) { for (i = 0; i < sDbCameraCuts[idx1].nPoints; i++) {
dbCamera->sub.lookAt[i] = sDbCameraCuts[idx1].lookAt[i]; dbCamera->sub.lookAt[i] = sDbCameraCuts[idx1].lookAt[i];
@ -2264,8 +2262,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DRIGHT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sCurFileIdx == 0x1E) { if (sCurFileIdx == 0x1E) {
sCurFileIdx = 0; sCurFileIdx = 0;
} else { } else {
@ -2273,8 +2271,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
} }
if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_DLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1; sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1;
} }
@ -2288,8 +2286,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
DbCamera_PrintAllCuts(cam); DbCamera_PrintAllCuts(cam);
} else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) && } else if (CHECK_BTN_ALL(sPlay->state.input[2].cur.button, BTN_L) &&
CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) { CHECK_BTN_ALL(sPlay->state.input[2].press.button, BTN_CLEFT)) {
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) {
if (sDbCameraCuts[i].nPoints != 0) { if (sDbCameraCuts[i].nPoints != 0) {
osSyncPrintf("\n@@@ /* CUT [%d]\t*/", i); osSyncPrintf("\n@@@ /* CUT [%d]\t*/", i);
@ -2305,8 +2303,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
Interface_ChangeAlpha(50); Interface_ChangeAlpha(50);
ShrinkWindow_SetVal(0x20); ShrinkWindow_SetVal(0x20);
D_8016110C = 0; D_8016110C = 0;
Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
func_8006376C(4, 7, 5, D_8012CF50[0]); func_8006376C(4, 7, 5, D_8012CF50[0]);

View file

@ -1688,11 +1688,11 @@ void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4)
} }
void func_8002F7DC(Actor* actor, u16 sfxId) { void func_8002F7DC(Actor* actor, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
void Audio_PlayActorSound2(Actor* actor, u16 sfxId) { void Audio_PlayActorSfx2(Actor* actor, u16 sfxId) {
func_80078914(&actor->projectedPos, sfxId); func_80078914(&actor->projectedPos, sfxId);
} }
@ -1753,7 +1753,7 @@ s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId,
if (func_80041D4C(&play->colCtx, poly, bgId) == 8) { if (func_80041D4C(&play->colCtx, poly, bgId) == 8) {
play->roomCtx.unk_74[0] = 1; play->roomCtx.unk_74[0] = 1;
CollisionCheck_BlueBlood(play, NULL, pos); CollisionCheck_BlueBlood(play, NULL, pos);
Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO); Audio_PlayActorSfx2(actor, NA_SE_IT_WALL_HIT_BUYO);
return true; return true;
} }
@ -2235,8 +2235,8 @@ void Actor_Draw(PlayState* play, Actor* actor) {
void func_80030ED8(Actor* actor) { void func_80030ED8(Actor* actor) {
if (actor->flags & ACTOR_FLAG_19) { if (actor->flags & ACTOR_FLAG_19) {
Audio_PlaySoundGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (actor->flags & ACTOR_FLAG_20) { } else if (actor->flags & ACTOR_FLAG_20) {
func_80078884(actor->sfx); func_80078884(actor->sfx);
} else if (actor->flags & ACTOR_FLAG_21) { } else if (actor->flags & ACTOR_FLAG_21) {
@ -3033,7 +3033,7 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory) {
*/ */
void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) { void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) {
play->actorCtx.freezeFlashTimer = 5; play->actorCtx.freezeFlashTimer = 5;
SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); SfxSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE);
} }
s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
@ -3617,7 +3617,7 @@ void func_8003424C(PlayState* play, Vec3f* arg1) {
void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 xluFlag, s16 duration) { void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 xluFlag, s16 duration) {
if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) { if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) {
Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT); Audio_PlayActorSfx2(actor, NA_SE_EN_LIGHT_ARROW_HIT);
} }
actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration;
@ -4984,8 +4984,8 @@ void func_80036E50(u16 textId, s16 arg1) {
Flags_SetInfTable(INFTABLE_0C); Flags_SetInfTable(INFTABLE_0C);
return; return;
case 0x1033: case 0x1033:
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Flags_SetEventChkInf(EVENTCHKINF_04); Flags_SetEventChkInf(EVENTCHKINF_04);
Flags_SetInfTable(INFTABLE_0E); Flags_SetInfTable(INFTABLE_0E);
return; return;
@ -5448,8 +5448,8 @@ s32 func_80037CB8(PlayState* play, Actor* actor, s16 arg2) {
case TEXT_STATE_CHOICE: case TEXT_STATE_CHOICE:
case TEXT_STATE_EVENT: case TEXT_STATE_EVENT:
if (Message_ShouldAdvance(play) && func_80037C94(play, actor, arg2)) { if (Message_ShouldAdvance(play) && func_80037C94(play, actor, arg2)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_TEXT_CLOSING; msgCtx->msgMode = MSGMODE_TEXT_CLOSING;
ret = true; ret = true;
} }

View file

@ -1564,36 +1564,36 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll
if (flags == TOUCH_SFX_NORMAL && collider->colType != COLTYPE_METAL) { if (flags == TOUCH_SFX_NORMAL && collider->colType != COLTYPE_METAL) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (collider->actor == NULL) { if (collider->actor == NULL) {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (flags == TOUCH_SFX_NORMAL) { // collider->colType == COLTYPE_METAL } else if (flags == TOUCH_SFX_NORMAL) { // collider->colType == COLTYPE_METAL
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos); EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos);
if (collider->actor == NULL) { if (collider->actor == NULL) {
CollisionCheck_SpawnShieldParticlesMetal(play, hitPos); CollisionCheck_SpawnShieldParticlesMetal(play, hitPos);
} else { } else {
CollisionCheck_SpawnShieldParticlesMetalSound(play, hitPos, &collider->actor->projectedPos); CollisionCheck_SpawnShieldParticlesMetalSfx(play, hitPos, &collider->actor->projectedPos);
} }
} else if (flags == TOUCH_SFX_HARD) { } else if (flags == TOUCH_SFX_HARD) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (collider->actor == NULL) { if (collider->actor == NULL) {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (flags == TOUCH_SFX_WOOD) { } else if (flags == TOUCH_SFX_WOOD) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_DUST, hitPos); EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_DUST, hitPos);
if (collider->actor == NULL) { if (collider->actor == NULL) {
Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
} }
@ -1604,17 +1604,17 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll
s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) { s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) {
if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) { if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) {
if (acInfo->elemType == ELEMTYPE_UNK0) { if (acInfo->elemType == ELEMTYPE_UNK0) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (acInfo->elemType == ELEMTYPE_UNK1) { } else if (acInfo->elemType == ELEMTYPE_UNK1) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (acInfo->elemType == ELEMTYPE_UNK2) { } else if (acInfo->elemType == ELEMTYPE_UNK2) {
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (acInfo->elemType == ELEMTYPE_UNK3) { } else if (acInfo->elemType == ELEMTYPE_UNK3) {
Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
return true; return true;
@ -1651,8 +1651,8 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atIn
} else if (sHitInfo[ac->colType].effect == HIT_WOOD) { } else if (sHitInfo[ac->colType].effect == HIT_WOOD) {
if (at->actor == NULL) { if (at->actor == NULL) {
CollisionCheck_SpawnShieldParticles(play, hitPos); CollisionCheck_SpawnShieldParticles(play, hitPos);
Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &at->actor->projectedPos); CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &at->actor->projectedPos);
} }
@ -1665,11 +1665,11 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atIn
} else { } else {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (ac->actor == NULL) { if (ac->actor == NULL) {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
} }
@ -3391,32 +3391,32 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) {
} }
/** /**
* Spawns streaks of light and makes a metallic sound * Spawns streaks of light and plays a metallic sound effect
*/ */
void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) {
CollisionCheck_SpawnShieldParticles(play, v); CollisionCheck_SpawnShieldParticles(play, v);
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
/** /**
* Spawns streaks of light and makes a metallic sound at the specified position * Spawns streaks of light and plays a metallic sound effect at the specified position
*/ */
void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Vec3f* pos) { void CollisionCheck_SpawnShieldParticlesMetalSfx(PlayState* play, Vec3f* v, Vec3f* pos) {
CollisionCheck_SpawnShieldParticles(play, v); CollisionCheck_SpawnShieldParticles(play, v);
Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
/** /**
* Spawns streaks of light and makes a metallic sound * Spawns streaks of light and plays a metallic sound effect
*/ */
void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v) { void CollisionCheck_SpawnShieldParticlesMetal2(PlayState* play, Vec3f* v) {
CollisionCheck_SpawnShieldParticlesMetal(play, v); CollisionCheck_SpawnShieldParticlesMetal(play, v);
} }
/** /**
* Spawns streaks of light and makes a wooden sound * Spawns streaks of light and plays a wooden sound effect
*/ */
void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* actorPos) { void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* actorPos) {
static EffectShieldParticleInit woodInit = { static EffectShieldParticleInit woodInit = {
@ -3445,8 +3445,8 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* a
woodInit.lightPoint.z = woodInit.position.z; woodInit.lightPoint.z = woodInit.position.z;
Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &woodInit); Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &woodInit);
Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
/** /**

View file

@ -495,8 +495,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) &&
(gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) { (gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
temp = 1; temp = 1;
} }
@ -827,7 +827,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
break; break;
case 54: case 54:
gSaveContext.gameMode = GAMEMODE_END_CREDITS; gSaveContext.gameMode = GAMEMODE_END_CREDITS;
Audio_SetSoundBanksMute(0x6F); Audio_SetSfxBanksMute(0x6F);
play->linkAgeOnLoad = LINK_AGE_CHILD; play->linkAgeOnLoad = LINK_AGE_CHILD;
play->nextEntranceIndex = ENTR_SPOT09_0; play->nextEntranceIndex = ENTR_SPOT09_0;
gSaveContext.cutsceneIndex = 0xFFF2; gSaveContext.cutsceneIndex = 0xFFF2;
@ -1208,7 +1208,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
break; break;
case 117: case 117:
gSaveContext.gameMode = GAMEMODE_END_CREDITS; gSaveContext.gameMode = GAMEMODE_END_CREDITS;
Audio_SetSoundBanksMute(0x6F); Audio_SetSfxBanksMute(0x6F);
play->linkAgeOnLoad = LINK_AGE_ADULT; play->linkAgeOnLoad = LINK_AGE_ADULT;
play->nextEntranceIndex = ENTR_SPOT00_0; play->nextEntranceIndex = ENTR_SPOT00_0;
gSaveContext.cutsceneIndex = 0xFFF7; gSaveContext.cutsceneIndex = 0xFFF7;
@ -1249,13 +1249,13 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm
if (cmd->base == 1) { if (cmd->base == 1) {
play->envCtx.screenFillColor[3] = 255.0f * temp; play->envCtx.screenFillColor[3] = 255.0f * temp;
if ((temp == 0.0f) && (gSaveContext.entranceIndex == ENTR_KENJYANOMA_0)) { if ((temp == 0.0f) && (gSaveContext.entranceIndex == ENTR_KENJYANOMA_0)) {
Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if ((temp == 0.0f) && ((gSaveContext.entranceIndex == ENTR_TOKINOMA_0) || } else if ((temp == 0.0f) && ((gSaveContext.entranceIndex == ENTR_TOKINOMA_0) ||
(gSaveContext.entranceIndex == ENTR_SPOT15_0) || (gSaveContext.entranceIndex == ENTR_SPOT15_0) ||
(gSaveContext.entranceIndex == ENTR_YOUSEI_IZUMI_YOKO_0))) { (gSaveContext.entranceIndex == ENTR_YOUSEI_IZUMI_YOKO_0))) {
Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if ((temp == 0.0f) && (play->sceneNum == SCENE_GANONTIKA)) { } else if ((temp == 0.0f) && (play->sceneNum == SCENE_GANONTIKA)) {
func_800788CC(NA_SE_EV_WHITE_OUT); func_800788CC(NA_SE_EV_WHITE_OUT);
} }

View file

@ -888,7 +888,7 @@ void EffectSsEnIce_SpawnFlyingVec3f(PlayState* play, Actor* actor, Vec3f* pos, s
initParams.scale = scale; initParams.scale = scale;
if (actor != NULL) { if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_PL_FREEZE_S); Audio_PlayActorSfx2(actor, NA_SE_PL_FREEZE_S);
} }
EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams); EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams);
@ -914,7 +914,7 @@ void EffectSsEnIce_SpawnFlyingVec3s(PlayState* play, Actor* actor, Vec3s* pos, s
initParams.scale = scale; initParams.scale = scale;
if (actor != NULL) { if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_PL_FREEZE_S); Audio_PlayActorSfx2(actor, NA_SE_PL_FREEZE_S);
} }
EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams); EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams);
@ -993,7 +993,7 @@ void EffectSsEnFire_SpawnVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 sc
initParams.bodyPart = bodyPart; initParams.bodyPart = bodyPart;
if (actor != NULL) { if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION); Audio_PlayActorSfx2(actor, NA_SE_EV_FLAME_IGNITION);
} }
EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams);
@ -1014,7 +1014,7 @@ void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 sc
initParams.bodyPart = bodyPart; initParams.bodyPart = bodyPart;
if (actor != NULL) { if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION); Audio_PlayActorSfx2(actor, NA_SE_EV_FLAME_IGNITION);
} }
EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams);
@ -1051,7 +1051,7 @@ void EffectSsFCircle_Spawn(PlayState* play, Actor* actor, Vec3f* pos, s16 radius
void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused, s16 primR, s16 primG, s16 primB, s16 primA, s16 envR, s16 envG, s16 envB, s16 unused,
s32 arg14, s16 playSound) { s32 arg14, s16 playSfx) {
EffectSsDeadDbInitParams initParams; EffectSsDeadDbInitParams initParams;
Math_Vec3f_Copy(&initParams.pos, pos); Math_Vec3f_Copy(&initParams.pos, pos);
@ -1068,7 +1068,7 @@ void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* a
initParams.envColor.b = envB; initParams.envColor.b = envB;
initParams.unused = unused; initParams.unused = unused;
initParams.unk_34 = arg14; initParams.unk_34 = arg14;
initParams.playSound = playSound; initParams.playSfx = playSfx;
EffectSs_Spawn(play, EFFECT_SS_DEAD_DB, 120, &initParams); EffectSs_Spawn(play, EFFECT_SS_DEAD_DB, 120, &initParams);
} }

View file

@ -302,7 +302,7 @@ void EnAObj_Block(EnAObj* this, PlayState* play) {
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
if (this->dyna.actor.speedXZ != 0.0f) { if (this->dyna.actor.speedXZ != 0.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
} }
this->dyna.unk_154 = 0.0f; this->dyna.unk_154 = 0.0f;

View file

@ -715,8 +715,8 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
} }
if ((*params <= ITEM00_RUPEE_RED) || (*params == ITEM00_RUPEE_ORANGE)) { if ((*params <= ITEM00_RUPEE_RED) || (*params == ITEM00_RUPEE_ORANGE)) {
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (getItemId != GI_NONE) { } else if (getItemId != GI_NONE) {
if (Actor_HasParent(&this->actor, play)) { if (Actor_HasParent(&this->actor, play)) {
Flags_SetCollectible(play, this->collectibleFlag); Flags_SetCollectible(play, this->collectibleFlag);
@ -724,8 +724,8 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
} }
return; return;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Flags_SetCollectible(play, this->collectibleFlag); Flags_SetCollectible(play, this->collectibleFlag);

View file

@ -81,8 +81,8 @@ void TransitionCircle_Start(void* thisx) {
} else { } else {
this->texY = 0x1F4; this->texY = 0x1F4;
if (this->appearanceType == TCA_RIPPLE) { if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
guPerspective(&this->projection, &this->normal, 60.0f, (4.0f / 3.0f), 10.0f, 12800.0f, 1.0f); guPerspective(&this->projection, &this->normal, 60.0f, (4.0f / 3.0f), 10.0f, 12800.0f, 1.0f);
@ -107,8 +107,8 @@ void TransitionCircle_Update(void* thisx, s32 updateRate) {
if (this->direction != 0) { if (this->direction != 0) {
if (this->texY == 0) { if (this->texY == 0) {
if (this->appearanceType == TCA_RIPPLE) { if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_IN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_IN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
this->texY += this->speed * 3 / updateRate; this->texY += this->speed * 3 / updateRate;

View file

@ -583,16 +583,15 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) {
} }
void func_80078884(u16 sfxId) { void func_80078884(u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
void func_800788CC(u16 sfxId) { void func_800788CC(u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
void func_80078914(Vec3f* arg0, u16 sfxId) { void func_80078914(Vec3f* arg0, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, arg0, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, arg0, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
} }

View file

@ -403,11 +403,11 @@ void Minimap_Draw(PlayState* play) {
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(play)); osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(play));
// clang-format off // clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
@ -489,11 +489,11 @@ void Minimap_Draw(PlayState* play) {
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
// clang-format off // clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }

View file

@ -158,8 +158,8 @@ u8 Message_ShouldAdvance(PlayState* play) {
if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) ||
CHECK_BTN_ALL(input->press.button, BTN_CUP)) { CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
return CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) || return CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_B) ||
CHECK_BTN_ALL(input->press.button, BTN_CUP); CHECK_BTN_ALL(input->press.button, BTN_CUP);
@ -183,8 +183,8 @@ void Message_CloseTextbox(PlayState* play) {
msgCtx->stateTimer = 2; msgCtx->stateTimer = 2;
msgCtx->msgMode = MSGMODE_TEXT_CLOSING; msgCtx->msgMode = MSGMODE_TEXT_CLOSING;
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT;
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} }
@ -199,8 +199,8 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) {
if (msgCtx->choiceIndex > 128) { if (msgCtx->choiceIndex > 128) {
msgCtx->choiceIndex = 0; msgCtx->choiceIndex = 0;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (input->rel.stick_y <= -30 && !sAnalogStickHeld) { } else if (input->rel.stick_y <= -30 && !sAnalogStickHeld) {
sAnalogStickHeld = true; sAnalogStickHeld = true;
@ -208,8 +208,8 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) {
if (msgCtx->choiceIndex > numChoices) { if (msgCtx->choiceIndex > numChoices) {
msgCtx->choiceIndex = numChoices; msgCtx->choiceIndex = numChoices;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (ABS(input->rel.stick_y) < 30) { } else if (ABS(input->rel.stick_y) < 30) {
sAnalogStickHeld = false; sAnalogStickHeld = false;
@ -743,7 +743,7 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) {
MessageContext* msgCtx = &play->msgCtx; MessageContext* msgCtx = &play->msgCtx;
// clang-format off // clang-format off
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
@ -898,8 +898,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
case MESSAGE_BOX_BREAK: case MESSAGE_BOX_BREAK:
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
if (!sTextboxSkipped) { if (!sTextboxSkipped) {
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT;
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
} else { } else {
@ -916,8 +916,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
case MESSAGE_TEXTID: case MESSAGE_TEXTID:
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT;
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->msgMode = MSGMODE_TEXT_DONE;
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
} }
@ -986,9 +986,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
// "Sound (SE)" // "Sound (SE)"
osSyncPrintf("サウンド(SE)\n"); osSyncPrintf("サウンド(SE)\n");
sfxHi = msgCtx->msgBufDecoded[i + 1] << 8; sfxHi = msgCtx->msgBufDecoded[i + 1] << 8;
Audio_PlaySoundGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
} }
i += 2; i += 2;
break; break;
@ -997,7 +996,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break; break;
case MESSAGE_BACKGROUND: case MESSAGE_BACKGROUND:
// clang-format off // clang-format off
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
@ -1083,8 +1082,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->msgMode = MSGMODE_TEXT_DONE;
if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) { if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) {
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE);
if (play->csCtx.state == 0) { if (play->csCtx.state == 0) {
Interface_SetDoAction(play, DO_ACTION_RETURN); Interface_SetDoAction(play, DO_ACTION_RETURN);
@ -1114,8 +1113,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
return; return;
case MESSAGE_PERSISTENT: case MESSAGE_PERSISTENT:
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->msgMode = MSGMODE_TEXT_DONE;
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT;
} }
@ -1126,16 +1125,16 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->msgMode = MSGMODE_TEXT_DONE;
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT;
Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE);
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
*gfxP = gfx; *gfxP = gfx;
return; return;
default: default:
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos && if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos &&
msgCtx->textDelayTimer == msgCtx->textDelay) { msgCtx->textDelayTimer == msgCtx->textDelay) {
Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx); Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx);
charTexIdx += FONT_CHAR_TEX_SIZE; charTexIdx += FONT_CHAR_TEX_SIZE;
@ -1795,8 +1794,8 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) {
osSyncPrintf("ocarina_set 000000000000000000 = %d\n", ocarinaActionId); osSyncPrintf("ocarina_set 000000000000000000 = %d\n", ocarinaActionId);
msgCtx->ocarinaAction = ocarinaActionId; msgCtx->ocarinaAction = ocarinaActionId;
if (ocarinaActionId >= OCARINA_ACTION_CHECK_SARIA && ocarinaActionId <= OCARINA_ACTION_CHECK_STORMS) { if (ocarinaActionId >= OCARINA_ACTION_CHECK_SARIA && ocarinaActionId <= OCARINA_ACTION_CHECK_STORMS) {
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
if (ocarinaActionId == OCARINA_ACTION_SCARECROW_SPAWN_PLAYBACK) { if (ocarinaActionId == OCARINA_ACTION_SCARECROW_SPAWN_PLAYBACK) {
Message_OpenText(play, 0x86F); // Ocarina Message_OpenText(play, 0x86F); // Ocarina
@ -2124,9 +2123,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS || if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS ||
msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW_SPAWN) { msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW_SPAWN) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_OCARINA_STARTING; msgCtx->msgMode = MSGMODE_OCARINA_STARTING;
} else { } else {
// "Ocarina_Flog Correct Example Performance" // "Ocarina_Flog Correct Example Performance"
@ -2135,17 +2134,17 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->msgMode = MSGMODE_SONG_PLAYED;
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
Interface_ChangeAlpha(1); Interface_ChangeAlpha(1);
} }
} else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW_SPAWN) { } else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW_SPAWN) {
if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW_SPAWN) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW_SPAWN) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
msgCtx->msgMode = MSGMODE_OCARINA_FAIL; msgCtx->msgMode = MSGMODE_OCARINA_FAIL;
} else { } else {
@ -2155,9 +2154,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->msgMode = MSGMODE_SONG_PLAYED;
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
Interface_ChangeAlpha(1); Interface_ChangeAlpha(1);
} }
} else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) {
@ -2167,25 +2166,25 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->msgMode = MSGMODE_SONG_PLAYED;
msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA;
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
Interface_ChangeAlpha(1); Interface_ChangeAlpha(1);
} else { } else {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_OCARINA_STARTING; msgCtx->msgMode = MSGMODE_OCARINA_STARTING;
} }
} else if (msgCtx->ocarinaStaff->state == 0xFF) { } else if (msgCtx->ocarinaStaff->state == 0xFF) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
msgCtx->msgMode = MSGMODE_OCARINA_FAIL; msgCtx->msgMode = MSGMODE_OCARINA_FAIL;
} else if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { } else if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) {
@ -2408,7 +2407,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
AudioOcarina_SetPlaybackSong(msgCtx->lastPlayedSong + 1, 1); AudioOcarina_SetPlaybackSong(msgCtx->lastPlayedSong + 1, 1);
if (msgCtx->lastPlayedSong != OCARINA_SONG_SCARECROW_SPAWN) { if (msgCtx->lastPlayedSong != OCARINA_SONG_SCARECROW_SPAWN) {
Audio_PlayFanfare(sOcarinaSongFanfares[msgCtx->lastPlayedSong]); Audio_PlayFanfare(sOcarinaSongFanfares[msgCtx->lastPlayedSong]);
Audio_SetSoundBanksMute(0x20); Audio_SetSfxBanksMute(0x20);
} }
play->msgCtx.ocarinaMode = OCARINA_MODE_01; play->msgCtx.ocarinaMode = OCARINA_MODE_01;
if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) {
@ -2562,11 +2561,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
osSyncPrintf("z_message.c 取得メロディ=%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state); osSyncPrintf("z_message.c 取得メロディ=%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
msgCtx->stateTimer = 20; msgCtx->stateTimer = 20;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (msgCtx->ocarinaStaff->state == 0xFF) { } else if (msgCtx->ocarinaStaff->state == 0xFF) {
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL; msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL;
} }
@ -2620,8 +2619,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->ocarinaStaff->state); msgCtx->ocarinaStaff->state);
gSaveContext.scarecrowLongSongSet = true; gSaveContext.scarecrowLongSongSet = true;
} }
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
osSyncPrintf("aaaaaaaaaaaaaa\n"); osSyncPrintf("aaaaaaaaaaaaaa\n");
AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF); AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF);
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
@ -2691,8 +2690,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->stateTimer = 20; msgCtx->stateTimer = 20;
gSaveContext.scarecrowSpawnSongSet = true; gSaveContext.scarecrowSpawnSongSet = true;
msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_DONE; msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_DONE;
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("\n====================================================================\n"); osSyncPrintf("\n====================================================================\n");
MemCpy(gSaveContext.scarecrowSpawnSong, gScarecrowSpawnSongPtr, MemCpy(gSaveContext.scarecrowSpawnSong, gScarecrowSpawnSongPtr,
@ -2707,8 +2706,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
// "Played an existing song" // "Played an existing song"
osSyncPrintf("すでに存在する曲吹いた!!! \n"); osSyncPrintf("すでに存在する曲吹いた!!! \n");
AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF); AudioOcarina_SetRecordingState(OCARINA_RECORD_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Message_CloseTextbox(play); Message_CloseTextbox(play);
msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_FAILED; msgCtx->msgMode = MSGMODE_SCARECROW_SPAWN_RECORDING_FAILED;
} }
@ -2733,8 +2732,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
break; break;
case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING: case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING:
case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING: case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING:
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) {
sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex;
@ -2744,12 +2743,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
if (msgCtx->stateTimer == 0) { if (msgCtx->stateTimer == 0) {
if (msgCtx->ocarinaStaff->state == 0) { if (msgCtx->ocarinaStaff->state == 0) {
if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING) { if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING) {
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
} }
msgCtx->msgMode++; msgCtx->msgMode++;
} }
@ -2767,8 +2765,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
} }
break; break;
case MSGMODE_MEMORY_GAME_PLAYER_PLAYING: case MSGMODE_MEMORY_GAME_PLAYER_PLAYING:
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) {
sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex;
@ -2779,15 +2777,15 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
// "Musical round failed" // "Musical round failed"
osSyncPrintf("輪唱失敗!!!!!!!!!\n"); osSyncPrintf("輪唱失敗!!!!!!!!!\n");
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->stateTimer = 10; msgCtx->stateTimer = 10;
play->msgCtx.ocarinaMode = OCARINA_MODE_03; play->msgCtx.ocarinaMode = OCARINA_MODE_03;
} else if (msgCtx->ocarinaStaff->state == OCARINA_SONG_MEMORY_GAME) { } else if (msgCtx->ocarinaStaff->state == OCARINA_SONG_MEMORY_GAME) {
// "Musical round succeeded" // "Musical round succeeded"
osSyncPrintf("輪唱成功!!!!!!!!!\n"); osSyncPrintf("輪唱成功!!!!!!!!!\n");
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS; msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS;
msgCtx->stateTimer = 30; msgCtx->stateTimer = 30;
} }
@ -2803,8 +2801,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
msgCtx->stateTimer--; msgCtx->stateTimer--;
if (msgCtx->stateTimer == 0) { if (msgCtx->stateTimer == 0) {
if (AudioOcarina_MemoryGameNextNote() != 1) { if (AudioOcarina_MemoryGameNextNote() != 1) {
Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
msgCtx->ocarinaStaff->pos = sOcarinaButtonIndexBufPos = 0; msgCtx->ocarinaStaff->pos = sOcarinaButtonIndexBufPos = 0;
Message_ResetOcarinaNoteState(); Message_ResetOcarinaNoteState();
@ -3171,7 +3169,7 @@ void Message_Update(PlayState* play) {
} else { } else {
Message_GrowTextbox(msgCtx); Message_GrowTextbox(msgCtx);
// TODO: this may be NA_SE_PL_WALK_GROUND - SFX_FLAG, or not, investigate sfxId=0 // TODO: this may be NA_SE_PL_WALK_GROUND - SFX_FLAG, or not, investigate sfxId=0
Audio_PlaySoundIfNotInCutscene(0); Audio_PlaySfxIfNotInCutscene(0);
msgCtx->stateTimer = 0; msgCtx->stateTimer = 0;
msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING; msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING;
} }
@ -3248,12 +3246,12 @@ void Message_Update(PlayState* play) {
} else if (Message_ShouldAdvanceSilent(play)) { } else if (Message_ShouldAdvanceSilent(play)) {
osSyncPrintf("select=%d\n", msgCtx->textboxEndType); osSyncPrintf("select=%d\n", msgCtx->textboxEndType);
if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) {
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Message_ContinueTextbox(play, sNextTextId); Message_ContinueTextbox(play, sNextTextId);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Message_CloseTextbox(play); Message_CloseTextbox(play);
} }
} }

View file

@ -2115,7 +2115,7 @@ void Interface_SetNaviCall(PlayState* play, u16 naviCallState) {
if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling &&
(play->csCtx.state == CS_STATE_IDLE)) { (play->csCtx.state == CS_STATE_IDLE)) {
// clang-format off // clang-format off
if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &gSfxDefaultPos, 4, if (naviCallState == 0x1E) { Audio_PlaySfxGeneral(NA_SE_VO_NAVY_CALL, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
@ -2167,7 +2167,7 @@ s32 Health_ChangeBy(PlayState* play, s16 amount) {
gSaveContext.healthCapacity); gSaveContext.healthCapacity);
// clang-format off // clang-format off
if (amount > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, if (amount > 0) { Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (gSaveContext.doubleDefense && (amount < 0)) { } else if (gSaveContext.doubleDefense && (amount < 0)) {
amount >>= 1; amount >>= 1;
@ -2302,8 +2302,8 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) {
if ((type != MAGIC_ADD) && (gSaveContext.magic - amount) < 0) { if ((type != MAGIC_ADD) && (gSaveContext.magic - amount) < 0) {
if (gSaveContext.magicCapacity != 0) { if (gSaveContext.magicCapacity != 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
return false; return false;
} }
@ -2321,8 +2321,8 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) {
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
return true; return true;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
return false; return false;
} }
@ -2339,8 +2339,8 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) {
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3; gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3;
return true; return true;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
return false; return false;
} }
@ -2371,8 +2371,8 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) {
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2; gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2;
return true; return true;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
return false; return false;
} }
@ -2440,8 +2440,8 @@ void Magic_Update(PlayState* play) {
gSaveContext.magic += 4; gSaveContext.magic += 4;
if (gSaveContext.gameMode == GAMEMODE_NORMAL && gSaveContext.sceneSetupIndex < 4) { if (gSaveContext.gameMode == GAMEMODE_NORMAL && gSaveContext.sceneSetupIndex < 4) {
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
// "Storage MAGIC_NOW=%d (%d)" // "Storage MAGIC_NOW=%d (%d)"
@ -2528,8 +2528,8 @@ void Magic_Update(PlayState* play) {
!play->actorCtx.lensActive) { !play->actorCtx.lensActive) {
// Force lens off and set magic meter state to idle // Force lens off and set magic meter state to idle
play->actorCtx.lensActive = false; play->actorCtx.lensActive = false;
Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GLASSMODE_OFF, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
gSaveContext.magicState = MAGIC_STATE_IDLE; gSaveContext.magicState = MAGIC_STATE_IDLE;
sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; sMagicBorderR = sMagicBorderG = sMagicBorderB = 255;
break; break;
@ -2581,8 +2581,8 @@ void Magic_Update(PlayState* play) {
case MAGIC_STATE_ADD: case MAGIC_STATE_ADD:
// Add magic until target is reached // Add magic until target is reached
gSaveContext.magic += 4; gSaveContext.magic += 4;
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (gSaveContext.magic >= gSaveContext.magicTarget) { if (gSaveContext.magic >= gSaveContext.magicTarget) {
gSaveContext.magic = gSaveContext.magicTarget; gSaveContext.magic = gSaveContext.magicTarget;
gSaveContext.magicState = gSaveContext.prevMagicState; gSaveContext.magicState = gSaveContext.prevMagicState;
@ -3564,20 +3564,20 @@ void Interface_Draw(PlayState* play) {
D_80125A5C = false; D_80125A5C = false;
} else if (gSaveContext.timer1Value > 60) { } else if (gSaveContext.timer1Value > 60) {
if (timerDigits[4] == 1) { if (timerDigits[4] == 1) {
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} else if (gSaveContext.timer1Value >= 11) { } else if (gSaveContext.timer1Value >= 11) {
if (timerDigits[4] & 1) { if (timerDigits[4] & 1) {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} }
} }
@ -3625,9 +3625,9 @@ void Interface_Draw(PlayState* play) {
D_8015FFE2 = 40; D_8015FFE2 = 40;
gSaveContext.timer1State = 15; gSaveContext.timer1State = 15;
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} }
} }
@ -3745,20 +3745,20 @@ void Interface_Draw(PlayState* play) {
} }
} else if (gSaveContext.timer2Value > 60) { } else if (gSaveContext.timer2Value > 60) {
if (timerDigits[4] == 1) { if (timerDigits[4] == 1) {
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (gSaveContext.timer2Value > 10) { } else if (gSaveContext.timer2Value > 10) {
if (timerDigits[4] & 1) { if (timerDigits[4] & 1) {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else { } else {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else { } else {
gSaveContext.timer2Value++; gSaveContext.timer2Value++;
@ -3772,9 +3772,9 @@ void Interface_Draw(PlayState* play) {
} }
if ((gSaveContext.timer2Value % 60) == 0) { if ((gSaveContext.timer2Value % 60) == 0) {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
} }
} }
@ -4003,8 +4003,8 @@ void Interface_Update(PlayState* play) {
gSaveContext.health += 4; gSaveContext.health += 4;
if ((gSaveContext.health & 0xF) < 4) { if ((gSaveContext.health & 0xF) < 4) {
Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.healthCapacity); osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.healthCapacity);
@ -4042,8 +4042,8 @@ void Interface_Update(PlayState* play) {
if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) {
gSaveContext.rupeeAccumulator--; gSaveContext.rupeeAccumulator--;
gSaveContext.rupees++; gSaveContext.rupees++;
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
// "Rupee Amount MAX = %d" // "Rupee Amount MAX = %d"
osSyncPrintf("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET)); osSyncPrintf("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET));
@ -4059,13 +4059,13 @@ void Interface_Update(PlayState* play) {
gSaveContext.rupees = 0; gSaveContext.rupees = 0;
} }
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
gSaveContext.rupeeAccumulator++; gSaveContext.rupeeAccumulator++;
gSaveContext.rupees--; gSaveContext.rupees--;
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else { } else {
gSaveContext.rupeeAccumulator = 0; gSaveContext.rupeeAccumulator = 0;

View file

@ -36,9 +36,9 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
if ((R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) && (gSaveContext.cutsceneIndex < 0xFFF0)) { if ((R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
// Play a sfx when the player toggles the camera // Play a sfx when the player toggles the camera
Audio_PlaySoundGeneral((viewpoint == VIEWPOINT_LOCKED) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, Audio_PlaySfxGeneral((viewpoint == VIEWPOINT_LOCKED) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP,
&gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
Play_ChangeViewpointBgCamIndex(this); Play_ChangeViewpointBgCamIndex(this);
@ -259,7 +259,7 @@ void Play_Init(GameState* thisx) {
func_80112098(this); func_80112098(this);
Message_Init(this); Message_Init(this);
GameOver_Init(this); GameOver_Init(this);
SoundSource_InitAll(this); SfxSource_InitAll(this);
Effect_InitContext(this); Effect_InitContext(this);
EffectSs_InitInfo(this, 0x55); EffectSs_InitInfo(this, 0x55);
CollisionCheck_InitContext(this, &this->colChkCtx); CollisionCheck_InitContext(this, &this->colChkCtx);
@ -752,9 +752,8 @@ void Play_Update(PlayState* this) {
break; break;
case TRANS_MODE_SANDSTORM: case TRANS_MODE_SANDSTORM:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->transitionTrigger == TRANS_TRIGGER_END) {
if (this->envCtx.sandstormPrimA < 110) { if (this->envCtx.sandstormPrimA < 110) {
@ -788,9 +787,8 @@ void Play_Update(PlayState* this) {
break; break;
case TRANS_MODE_SANDSTORM_END: case TRANS_MODE_SANDSTORM_END:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
&gSfxDefaultReverb);
if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->transitionTrigger == TRANS_TRIGGER_END) {
if (this->envCtx.sandstormPrimA <= 0) { if (this->envCtx.sandstormPrimA <= 0) {
@ -922,8 +920,8 @@ void Play_Update(PlayState* this) {
// "Changing viewpoint is prohibited during the cutscene" // "Changing viewpoint is prohibited during the cutscene"
osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST); osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST);
} else if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) { } else if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
// C-Up toggle for houses, move between pivot camera and fixed camera // C-Up toggle for houses, move between pivot camera and fixed camera
// Toggle viewpoint between VIEWPOINT_LOCKED and VIEWPOINT_PIVOT // Toggle viewpoint between VIEWPOINT_LOCKED and VIEWPOINT_PIVOT
@ -959,7 +957,7 @@ void Play_Update(PlayState* this) {
AnimationContext_Update(this, &this->animationCtx); AnimationContext_Update(this, &this->animationCtx);
PLAY_LOG(3771); PLAY_LOG(3771);
SoundSource_UpdateAll(this); SfxSource_UpdateAll(this);
PLAY_LOG(3777); PLAY_LOG(3777);
ShrinkWindow_Update(R_UPDATE_RATE); ShrinkWindow_Update(R_UPDATE_RATE);

View file

@ -1,19 +1,19 @@
#include "global.h" #include "global.h"
void SoundSource_InitAll(PlayState* play) { void SfxSource_InitAll(PlayState* play) {
SoundSource* sources = &play->soundSources[0]; SfxSource* sources = &play->sfxSources[0];
s32 i; s32 i;
// clang-format off // clang-format off
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { sources[i].countdown = 0; } for (i = 0; i < ARRAY_COUNT(play->sfxSources); i++) { sources[i].countdown = 0; }
// clang-format on // clang-format on
} }
void SoundSource_UpdateAll(PlayState* play) { void SfxSource_UpdateAll(PlayState* play) {
SoundSource* source = &play->soundSources[0]; SfxSource* source = &play->sfxSources[0];
s32 i; s32 i;
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { for (i = 0; i < ARRAY_COUNT(play->sfxSources); i++) {
if (source->countdown != 0) { if (source->countdown != 0) {
if (DECR(source->countdown) == 0) { if (DECR(source->countdown) == 0) {
Audio_StopSfxByPos(&source->projectedPos); Audio_StopSfxByPos(&source->projectedPos);
@ -26,20 +26,20 @@ void SoundSource_UpdateAll(PlayState* play) {
} }
} }
void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId) { void SfxSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId) {
s32 countdown; s32 countdown;
SoundSource* source; SfxSource* source;
s32 smallestCountdown = 0xFFFF; s32 smallestCountdown = 0xFFFF;
SoundSource* backupSource; SfxSource* backupSource;
s32 i; s32 i;
source = &play->soundSources[0]; source = &play->sfxSources[0];
for (i = 0; i < ARRAY_COUNT(play->soundSources); i++) { for (i = 0; i < ARRAY_COUNT(play->sfxSources); i++) {
if (source->countdown == 0) { if (source->countdown == 0) {
break; break;
} }
// Store the sound source with the smallest remaining countdown // Store the sfx source with the smallest remaining countdown
countdown = source->countdown; countdown = source->countdown;
if (countdown < smallestCountdown) { if (countdown < smallestCountdown) {
smallestCountdown = countdown; smallestCountdown = countdown;
@ -48,8 +48,8 @@ void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 du
source++; source++;
} }
// If no sound source is available, replace the sound source with the smallest remaining countdown // If no sfx source is available, replace the sfx source with the smallest remaining countdown
if (i >= ARRAY_COUNT(play->soundSources)) { if (i >= ARRAY_COUNT(play->sfxSources)) {
source = backupSource; source = backupSource;
Audio_StopSfxByPos(&source->projectedPos); Audio_StopSfxByPos(&source->projectedPos);
} }
@ -58,6 +58,6 @@ void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 du
source->countdown = duration; source->countdown = duration;
SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos); SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos);
Audio_PlaySoundGeneral(sfxId, &source->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(sfxId, &source->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }

View file

@ -180,8 +180,8 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
} }
} }
this->timer = 0; this->timer = 0;
Audio_PlaySoundGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else if (DECR(this->timer) == 0) { } else if (DECR(this->timer) == 0) {
grabbed = this->grabbed; grabbed = this->grabbed;
if (grabbed != NULL) { if (grabbed != NULL) {
@ -274,12 +274,12 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
} }
} }
func_80865044(this); func_80865044(this);
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos); CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos);
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} else if (CHECK_BTN_ANY(play->state.input[0].press.button, } else if (CHECK_BTN_ANY(play->state.input[0].press.button,
(BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN))) { (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN))) {

View file

@ -164,7 +164,7 @@ void ArrowFire_Fly(ArrowFire* this, PlayState* play) {
func_80865ECC(&this->unkPos, &this->actor.world.pos, 0.05f); func_80865ECC(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitFlags & 1) { if (arrow->hitFlags & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_FRAME); Audio_PlayActorSfx2(&this->actor, NA_SE_IT_EXPLOSION_FRAME);
ArrowFire_SetupAction(this, ArrowFire_Hit); ArrowFire_SetupAction(this, ArrowFire_Hit);
this->timer = 32; this->timer = 32;
this->alpha = 255; this->alpha = 255;

View file

@ -165,7 +165,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) {
func_80867E8C(&this->unkPos, &this->actor.world.pos, 0.05f); func_80867E8C(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitFlags & 1) { if (arrow->hitFlags & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE); Audio_PlayActorSfx2(&this->actor, NA_SE_IT_EXPLOSION_ICE);
ArrowIce_SetupAction(this, ArrowIce_Hit); ArrowIce_SetupAction(this, ArrowIce_Hit);
this->timer = 32; this->timer = 32;
this->alpha = 255; this->alpha = 255;

View file

@ -163,7 +163,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) {
func_80869E6C(&this->unkPos, &this->actor.world.pos, 0.05f); func_80869E6C(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitFlags & 1) { if (arrow->hitFlags & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT); Audio_PlayActorSfx2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT);
ArrowLight_SetupAction(this, ArrowLight_Hit); ArrowLight_SetupAction(this, ArrowLight_Hit);
this->timer = 32; this->timer = 32;
this->alpha = 255; this->alpha = 255;

View file

@ -203,7 +203,7 @@ void func_8086C054(BgBdanObjects* this, PlayState* play) {
void func_8086C1A0(BgBdanObjects* this, PlayState* play) { void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) < if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) <
0.1f) { 0.1f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = func_8086C29C; this->actionFunc = func_8086C29C;
this->timer = 30; this->timer = 30;
BgBdanObjects_SetContactRu1(this, 2); BgBdanObjects_SetContactRu1(this, 2);
@ -252,7 +252,7 @@ void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
this->dyna.actor.velocity.y)) { this->dyna.actor.velocity.y)) {
this->dyna.actor.world.rot.y = 0; this->dyna.actor.world.rot.y = 0;
this->timer = 60; this->timer = 60;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f; this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f;
this->actionFunc = func_8086C5BC; this->actionFunc = func_8086C5BC;
OnePointCutscene_Init(play, 3080, -99, this->dyna.actor.child, CAM_ID_MAIN); OnePointCutscene_Init(play, 3080, -99, this->dyna.actor.child, CAM_ID_MAIN);
@ -336,7 +336,7 @@ void func_8086C76C(BgBdanObjects* this, PlayState* play) {
void func_8086C7D0(BgBdanObjects* this, PlayState* play) { void func_8086C7D0(BgBdanObjects* this, PlayState* play) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) < if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) <
0.01f) { 0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = BgBdanObjects_DoNothing; this->actionFunc = BgBdanObjects_DoNothing;
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG);
@ -428,7 +428,7 @@ void func_8086CB8C(BgBdanObjects* this, PlayState* play) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->timer * (M_PI / 50.0f)) * 200.0f); this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->timer * (M_PI / 50.0f)) * 200.0f);
if (this->timer == 0) { if (this->timer == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
this->actionFunc = BgBdanObjects_DoNothing; this->actionFunc = BgBdanObjects_DoNothing;
// Using `CAM_ID_NONE` here defaults to the active camera // Using `CAM_ID_NONE` here defaults to the active camera
Play_CopyCamera(play, CAM_ID_MAIN, CAM_ID_NONE); Play_CopyCamera(play, CAM_ID_MAIN, CAM_ID_NONE);

View file

@ -272,7 +272,7 @@ void func_8086D694(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 -= 0.2f; this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) { if (this->unk_1C8 <= 0.1f) {
func_8086D730(this); func_8086D730(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
} }
} }
@ -312,7 +312,7 @@ void func_8086D80C(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 += 0.2f; this->unk_1C8 += 0.2f;
if (this->unk_1C8 >= 1.0f) { if (this->unk_1C8 >= 1.0f) {
func_8086D5C4(this); func_8086D5C4(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
} }
} }
@ -335,7 +335,7 @@ void func_8086D8CC(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 -= 0.2f; this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.6f) { if (this->unk_1C8 <= 0.6f) {
func_8086D9F8(this); func_8086D9F8(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
} }
} }
@ -350,7 +350,7 @@ void func_8086D95C(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 -= 0.2f; this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) { if (this->unk_1C8 <= 0.1f) {
func_8086DB24(this); func_8086DB24(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
} }
} }
@ -389,7 +389,7 @@ void func_8086DAC4(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 += 0.2f; this->unk_1C8 += 0.2f;
if (this->unk_1C8 >= 1.0f) { if (this->unk_1C8 >= 1.0f) {
func_8086D86C(this); func_8086D86C(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
} }
} }
@ -437,7 +437,7 @@ void func_8086DC48(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 -= 0.3f; this->unk_1C8 -= 0.3f;
if (this->unk_1C8 <= 1.0f) { if (this->unk_1C8 <= 1.0f) {
func_8086DCCC(this); func_8086DCCC(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
} }
} }
} }
@ -475,7 +475,7 @@ void func_8086DDC0(BgBdanSwitch* this, PlayState* play) {
this->unk_1C8 += 0.3f; this->unk_1C8 += 0.3f;
if (this->unk_1C8 >= 2.0f) { if (this->unk_1C8 >= 2.0f) {
func_8086DB4C(this); func_8086DB4C(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
} }
} }
} }

View file

@ -149,7 +149,7 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, PlayState* play) {
EffectSsBomb2_SpawnLayered(play, &effectPos, &effectVelocity, &effectAccel, 100, 30); EffectSsBomb2_SpawnLayered(play, &effectPos, &effectVelocity, &effectAccel, 100, 30);
effectPos.y = -50.0f; effectPos.y = -50.0f;
EffectSsHahen_SpawnBurst(play, &effectPos, 10.0f, 0, 50, 15, 3, HAHEN_OBJECT_DEFAULT, 10, NULL); EffectSsHahen_SpawnBurst(play, &effectPos, 10.0f, 0, 50, 15, 3, HAHEN_OBJECT_DEFAULT, 10, NULL);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION);
} }
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1);
Quake_SetSpeed(quakeIndex, 0x7FFF); Quake_SetSpeed(quakeIndex, 0x7FFF);

View file

@ -243,23 +243,23 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) {
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
if (wallType == BWALL_KD_FLOOR) { if (wallType == BWALL_KD_FLOOR) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_EXPLOSION);
} else { } else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
} }
if ((wallType == BWALL_DC_ENTRANCE) && !Flags_GetEventChkInf(EVENTCHKINF_B0)) { if ((wallType == BWALL_DC_ENTRANCE) && !Flags_GetEventChkInf(EVENTCHKINF_B0)) {
Flags_SetEventChkInf(EVENTCHKINF_B0); Flags_SetEventChkInf(EVENTCHKINF_B0);
Cutscene_SetSegment(play, gDcOpeningCs); Cutscene_SetSegment(play, gDcOpeningCs);
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
func_8002DF54(play, NULL, 0x31); func_8002DF54(play, NULL, 0x31);
} }
if (this->dyna.actor.params < 0) { if (this->dyna.actor.params < 0) {
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);

View file

@ -162,7 +162,7 @@ void BgDdanJd_Move(BgDdanJd* this, PlayState* play) {
this->actionFunc = BgDdanJd_Idle; this->actionFunc = BgDdanJd_Idle;
OnePointCutscene_Init(play, 3060, -99, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3060, -99, &this->dyna.actor, CAM_ID_MAIN);
} else if (Math_StepToF(&this->dyna.actor.world.pos.y, this->targetY, this->ySpeed)) { } else if (Math_StepToF(&this->dyna.actor.world.pos.y, this->targetY, this->ySpeed)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_PILLAR_MOVE_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_PILLAR_MOVE_STOP);
this->actionFunc = BgDdanJd_Idle; this->actionFunc = BgDdanJd_Idle;
} }
BgDdanJd_MoveEffects(this, play); BgDdanJd_MoveEffects(this, play);

View file

@ -170,8 +170,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) {
func_8003555C(play, &pos1, &velocity, &accel); func_8003555C(play, &pos1, &velocity, &accel);
} }
Camera_AddQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3); Camera_AddQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3);
Audio_PlaySoundGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }

View file

@ -158,19 +158,19 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) {
((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) {
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
this->state = 0; this->state = 0;
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
BgDodoago_SetupAction(this, BgDodoago_OpenJaw); BgDodoago_SetupAction(this, BgDodoago_OpenJaw);
OnePointCutscene_Init(play, 3380, 160, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3380, 160, &this->dyna.actor, CAM_ID_MAIN);
} else if (play->roomCtx.unk_74[this->state] == 0) { } else if (play->roomCtx.unk_74[this->state] == 0) {
OnePointCutscene_Init(play, 3065, 40, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3065, 40, &this->dyna.actor, CAM_ID_MAIN);
BgDodoago_SetupAction(this, BgDodoago_LightOneEye); BgDodoago_SetupAction(this, BgDodoago_LightOneEye);
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
OnePointCutscene_Init(play, 3065, 20, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3065, 20, &this->dyna.actor, CAM_ID_MAIN);
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
sTimer += 30; sTimer += 30;
return; return;
} }
@ -248,11 +248,11 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) {
if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) { if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) {
BgDodoago_SetupAction(this, BgDodoago_DoNothing); BgDodoago_SetupAction(this, BgDodoago_DoNothing);
Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }

View file

@ -297,7 +297,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
OnePointCutscene_Init(play, 8604, -99, NULL, CAM_ID_MAIN); OnePointCutscene_Init(play, 8604, -99, NULL, CAM_ID_MAIN);
}; };
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GREAT_FAIRY_APPEAR); Audio_PlayActorSfx2(&this->actor, NA_SE_EV_GREAT_FAIRY_APPEAR);
this->actor.draw = BgDyYoseizo_Draw; this->actor.draw = BgDyYoseizo_Draw;
this->actionFunc = BgDyYoseizo_SetupSpinGrow_NoReward; this->actionFunc = BgDyYoseizo_SetupSpinGrow_NoReward;
} }
@ -314,7 +314,7 @@ void BgDyYoseizo_SetupSpinGrow_NoReward(BgDyYoseizo* this, PlayState* play) {
ANIMMODE_ONCE, -10.0f); ANIMMODE_ONCE, -10.0f);
} }
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0); Audio_PlayActorSfx2(&this->actor, NA_SE_VO_FR_LAUGH_0);
func_8002DF54(play, &this->actor, 1); func_8002DF54(play, &this->actor, 1);
this->actionFunc = BgDyYoseizo_SpinGrow_NoReward; this->actionFunc = BgDyYoseizo_SpinGrow_NoReward;
} }
@ -410,7 +410,7 @@ void BgDyYoseizo_SetupHealPlayer_NoReward(BgDyYoseizo* this, PlayState* play) {
-10.0f); -10.0f);
} }
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0); Audio_PlayActorSfx2(&this->actor, NA_SE_VO_FR_SMILE_0);
this->mouthState = 1; this->mouthState = 1;
this->actionFunc = BgDyYoseizo_HealPlayer_NoReward; this->actionFunc = BgDyYoseizo_HealPlayer_NoReward;
} }
@ -521,8 +521,8 @@ void BgDyYoseizo_SetupSpinShrink(BgDyYoseizo* this, PlayState* play) {
this->vanishTimer = 5; this->vanishTimer = 5;
this->scaleFraction = 0.0f; this->scaleFraction = 0.0f;
this->heightFraction = 0.0f; this->heightFraction = 0.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0); Audio_PlayActorSfx2(&this->actor, NA_SE_VO_FR_LAUGH_0);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GREAT_FAIRY_VANISH); Audio_PlayActorSfx2(&this->actor, NA_SE_EV_GREAT_FAIRY_VANISH);
this->actionFunc = BgDyYoseizo_SpinShrink; this->actionFunc = BgDyYoseizo_SpinShrink;
} }
@ -582,7 +582,7 @@ void BgDyYoseizo_SetupSpinGrow_Reward(BgDyYoseizo* this, PlayState* play) {
ANIMMODE_ONCE, -10.0f); ANIMMODE_ONCE, -10.0f);
} }
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GREAT_FAIRY_APPEAR); Audio_PlayActorSfx2(&this->actor, NA_SE_EV_GREAT_FAIRY_APPEAR);
this->actionFunc = BgDyYoseizo_SpinGrowSetupGive_Reward; this->actionFunc = BgDyYoseizo_SpinGrowSetupGive_Reward;
} }
} }
@ -839,10 +839,10 @@ void BgDyYoseizo_Update(Actor* thisx, PlayState* play2) {
} }
if (sfx == 1) { if (sfx == 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0); Audio_PlayActorSfx2(&this->actor, NA_SE_VO_FR_SMILE_0);
} }
if (sfx == 2) { if (sfx == 2) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0); Audio_PlayActorSfx2(&this->actor, NA_SE_VO_FR_LAUGH_0);
} }
} }
@ -958,7 +958,7 @@ void BgDyYoseizo_UpdateEffects(BgDyYoseizo* this, PlayState* play) {
effect->velocity.y += effect->accel.y; effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z; effect->velocity.z += effect->accel.z;
} else { } else {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HEALING - SFX_FLAG); Audio_PlayActorSfx2(&this->actor, NA_SE_EV_HEALING - SFX_FLAG);
sp94 = player->actor.world.pos; sp94 = player->actor.world.pos;
sp94.y = player->actor.world.pos.y - 150.0f; sp94.y = player->actor.world.pos.y - 150.0f;

View file

@ -212,17 +212,17 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) {
} }
func_80033DB8(play, 10, 15); func_80033DB8(play, 10, 15);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_BOX_BREAK); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_BOX_BREAK);
} }
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} }
} else { } else {
if (this->dropTimer == 1) { if (this->dropTimer == 1) {
Audio_PlaySoundGeneral(NA_SE_EV_STONEDOOR_STOP, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_STONEDOOR_STOP, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ);
Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f); Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f);

View file

@ -78,11 +78,11 @@ void func_80878300(BgGateShutter* this, PlayState* play) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (this->unk_178 == 0) { if (this->unk_178 == 0) {
Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); Audio_PlayActorSfx2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
thisx->world.pos.x -= 2.0f; thisx->world.pos.x -= 2.0f;
Math_ApproachF(&thisx->world.pos.z, -1375.0f, 0.8f, 0.3f); Math_ApproachF(&thisx->world.pos.z, -1375.0f, 0.8f, 0.3f);
if (thisx->world.pos.x < -89.0f) { if (thisx->world.pos.x < -89.0f) {
Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP);
this->unk_178 = 0x1E; this->unk_178 = 0x1E;
this->actionFunc = func_808783AC; this->actionFunc = func_808783AC;
} }
@ -100,12 +100,12 @@ void func_808783D4(BgGateShutter* this, PlayState* play) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (this->unk_178 == 0) { if (this->unk_178 == 0) {
Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); Audio_PlayActorSfx2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
thisx->world.pos.x += 2.0f; thisx->world.pos.x += 2.0f;
Math_ApproachF(&thisx->world.pos.z, -1350.0f, 0.8f, 0.3f); Math_ApproachF(&thisx->world.pos.z, -1350.0f, 0.8f, 0.3f);
if (thisx->world.pos.x > 90.0f) { if (thisx->world.pos.x > 90.0f) {
thisx->world.pos.x = 91.0f; thisx->world.pos.x = 91.0f;
Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP);
this->unk_178 = 30; this->unk_178 = 30;
this->actionFunc = func_808783AC; this->actionFunc = func_808783AC;
} }

View file

@ -123,8 +123,8 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) {
} else { } else {
this->actionFlags |= 4; this->actionFlags |= 4;
this->timer1 = 304; this->timer1 = 304;
Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }
@ -139,8 +139,8 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) {
} else { } else {
this->actionFlags |= 8; this->actionFlags |= 8;
this->timer2 = 304; this->timer2 = 304;
Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
} }

View file

@ -97,7 +97,7 @@ void BgGndFiremeiro_Shake(BgGndFiremeiro* this, PlayState* play) {
this->dyna.actor.world.pos.y += Math_CosS(this->timer * 0x7FFF); this->dyna.actor.world.pos.y += Math_CosS(this->timer * 0x7FFF);
if (!(this->timer % 4)) { if (!(this->timer % 4)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
} }
} else { } else {
this->timer = 10; this->timer = 10;

View file

@ -313,7 +313,7 @@ void BgGndIceblock_Slide(BgGndIceblock* this, PlayState* play) {
thisx->speedXZ = 0.0f; thisx->speedXZ = 0.0f;
this->targetPos.x = thisx->world.pos.x; this->targetPos.x = thisx->world.pos.x;
this->targetPos.z = thisx->world.pos.z; this->targetPos.z = thisx->world.pos.z;
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(thisx, NA_SE_EV_BLOCK_BOUND);
switch (BgGndIceblock_NextAction(this)) { switch (BgGndIceblock_NextAction(this)) {
case GNDICE_IDLE: case GNDICE_IDLE:
this->actionFunc = BgGndIceblock_Idle; this->actionFunc = BgGndIceblock_Idle;

View file

@ -162,8 +162,8 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) {
if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) {
this->actor.draw = BgGndSoulmeiro_Draw; this->actor.draw = BgGndSoulmeiro_Draw;
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_198 = 40; this->unk_198 = 40;
this->actionFunc = func_8087AF38; this->actionFunc = func_8087AF38;
} else { } else {

View file

@ -241,7 +241,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, PlayState* play) {
this->actionFunc = BgHakaGate_DoNothing; this->actionFunc = BgHakaGate_DoNothing;
} else { } else {
func_80078884(NA_SE_SY_ERROR); func_80078884(NA_SE_SY_ERROR);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GROUND_GATE_OPEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_GROUND_GATE_OPEN);
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
this->vTimer = 60; this->vTimer = 60;
this->actionFunc = BgHakaGate_FloorOpen; this->actionFunc = BgHakaGate_FloorOpen;
@ -273,7 +273,7 @@ void BgHakaGate_GateWait(BgHakaGate* this, PlayState* play) {
void BgHakaGate_GateOpen(BgHakaGate* this, PlayState* play) { void BgHakaGate_GateOpen(BgHakaGate* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 80.0f, 1.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 80.0f, 1.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
this->dyna.actor.flags &= ~ACTOR_FLAG_4; this->dyna.actor.flags &= ~ACTOR_FLAG_4;
this->actionFunc = BgHakaGate_DoNothing; this->actionFunc = BgHakaGate_DoNothing;
} else { } else {

View file

@ -16,7 +16,7 @@ void BgHakaHuta_Update(Actor* thisx, PlayState* play);
void BgHakaHuta_Draw(Actor* thisx, PlayState* play); void BgHakaHuta_Draw(Actor* thisx, PlayState* play);
void BgHakaHuta_SpawnDust(BgHakaHuta* this, PlayState* play); void BgHakaHuta_SpawnDust(BgHakaHuta* this, PlayState* play);
void BgHakaHuta_PlaySound(BgHakaHuta* this, PlayState* play, u16 sfx); void BgHakaHuta_PlaySfx(BgHakaHuta* this, PlayState* play, u16 sfx);
void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, PlayState* play); void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, PlayState* play);
void BgHakaHuta_Open(BgHakaHuta* this, PlayState* play); void BgHakaHuta_Open(BgHakaHuta* this, PlayState* play);
void BgHakaHuta_SlideOpen(BgHakaHuta* this, PlayState* play); void BgHakaHuta_SlideOpen(BgHakaHuta* this, PlayState* play);
@ -94,14 +94,14 @@ void BgHakaHuta_SpawnDust(BgHakaHuta* this, PlayState* play) {
} }
} }
void BgHakaHuta_PlaySound(BgHakaHuta* this, PlayState* play, u16 sfx) { void BgHakaHuta_PlaySfx(BgHakaHuta* this, PlayState* play, u16 sfx) {
Vec3f pos; Vec3f pos;
pos.z = (this->dyna.actor.shape.rot.y == 0) ? this->dyna.actor.world.pos.z + 120.0f pos.z = (this->dyna.actor.shape.rot.y == 0) ? this->dyna.actor.world.pos.z + 120.0f
: this->dyna.actor.world.pos.z - 120.0f; : this->dyna.actor.world.pos.z - 120.0f;
pos.x = this->dyna.actor.world.pos.x; pos.x = this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y; pos.y = this->dyna.actor.world.pos.y;
SoundSource_PlaySfxAtFixedWorldPos(play, &pos, 30, sfx); SfxSource_PlaySfxAtFixedWorldPos(play, &pos, 30, sfx);
} }
void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, PlayState* play) { void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, PlayState* play) {
@ -148,7 +148,7 @@ void BgHakaHuta_Open(BgHakaHuta* this, PlayState* play) {
Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + posOffset, 2.0f); Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + posOffset, 2.0f);
if (this->counter == 0) { if (this->counter == 0) {
this->counter = 37; this->counter = 37;
BgHakaHuta_PlaySound(this, play, NA_SE_EV_COFFIN_CAP_OPEN); BgHakaHuta_PlaySfx(this, play, NA_SE_EV_COFFIN_CAP_OPEN);
this->actionFunc = BgHakaHuta_SlideOpen; this->actionFunc = BgHakaHuta_SlideOpen;
} }
} }
@ -164,7 +164,7 @@ void BgHakaHuta_SlideOpen(BgHakaHuta* this, PlayState* play) {
BgHakaHuta_SpawnDust(this, play); BgHakaHuta_SpawnDust(this, play);
} }
if (this->counter == 0) { if (this->counter == 0) {
BgHakaHuta_PlaySound(this, play, NA_SE_EV_COFFIN_CAP_BOUND); BgHakaHuta_PlaySfx(this, play, NA_SE_EV_COFFIN_CAP_BOUND);
this->actionFunc = func_8087D720; this->actionFunc = func_8087D720;
} }
} }

View file

@ -70,7 +70,7 @@ void BgHakaShip_Destroy(Actor* thisx, PlayState* play) {
BgHakaShip* this = (BgHakaShip*)thisx; BgHakaShip* this = (BgHakaShip*)thisx;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Audio_StopSfxByPos(&this->bellSoundPos); Audio_StopSfxByPos(&this->bellSfxPos);
} }
void BgHakaShip_ChildUpdatePosition(BgHakaShip* this, PlayState* play) { void BgHakaShip_ChildUpdatePosition(BgHakaShip* this, PlayState* play) {
@ -177,7 +177,7 @@ void BgHakaShip_CrashFall(BgHakaShip* this, PlayState* play) {
Actor_Kill(child); Actor_Kill(child);
} }
} else { } else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG);
if ((this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 500.0f) && if ((this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 500.0f) &&
DynaPolyActor_IsPlayerOnTop(&this->dyna)) { DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
Play_TriggerVoidOut(play); Play_TriggerVoidOut(play);
@ -229,7 +229,7 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) {
sp2C.y = this->dyna.actor.world.pos.y + 62.0f; sp2C.y = this->dyna.actor.world.pos.y + 62.0f;
sp2C.z = this->dyna.actor.world.pos.z; sp2C.z = this->dyna.actor.world.pos.z;
SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->bellSoundPos); SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->bellSfxPos);
func_80078914(&this->bellSoundPos, NA_SE_EV_SHIP_BELL - SFX_FLAG); func_80078914(&this->bellSfxPos, NA_SE_EV_SHIP_BELL - SFX_FLAG);
} }
} }

View file

@ -14,7 +14,7 @@ typedef struct BgHakaShip {
/* 0x0168 */ u8 counter; /* 0x0168 */ u8 counter;
/* 0x0169 */ u8 switchFlag; /* 0x0169 */ u8 switchFlag;
/* 0x016A */ s16 yOffset; /* 0x016A */ s16 yOffset;
/* 0x016C */ Vec3f bellSoundPos; /* 0x016C */ Vec3f bellSfxPos;
} BgHakaShip; // size = 0x0178 } BgHakaShip; // size = 0x0178
#endif #endif

View file

@ -301,13 +301,13 @@ void func_80880484(BgHakaTrap* this, PlayState* play) {
timer = this->timer; timer = this->timer;
if ((timer == 10 && !this->unk_16A) || (timer == 13 && this->unk_16A)) { if ((timer == 10 && !this->unk_16A) || (timer == 13 && this->unk_16A)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_BOUND);
} }
if (this->timer == 0) { if (this->timer == 0) {
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
this->timer = (this->unk_16A) ? 10 : 40; this->timer = (this->unk_16A) ? 10 : 40;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_UP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_UP);
this->actionFunc = func_808805C0; this->actionFunc = func_808805C0;
} }
@ -333,7 +333,7 @@ void func_808805C0(BgHakaTrap* this, PlayState* play) {
} }
if (this->timer == 20) { if (this->timer == 20) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_UP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_GUILLOTINE_UP);
} }
} }
@ -379,7 +379,7 @@ void func_808806BC(BgHakaTrap* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, tempf20, this->dyna.actor.velocity.y)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, tempf20, this->dyna.actor.velocity.y)) {
if (this->dyna.actor.velocity.y > 0.01f) { if (this->dyna.actor.velocity.y > 0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND);
} }
this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.y = 0.0f;
} }

View file

@ -127,7 +127,7 @@ void BgHakaTubo_Idle(BgHakaTubo* this, PlayState* play) {
pos.z = this->dyna.actor.world.pos.z; pos.z = this->dyna.actor.world.pos.z;
pos.y = this->dyna.actor.world.pos.y + 80.0f; pos.y = this->dyna.actor.world.pos.y + 80.0f;
EffectSsBomb2_SpawnLayered(play, &pos, &sZeroVector, &sZeroVector, 100, 45); EffectSsBomb2_SpawnLayered(play, &pos, &sZeroVector, &sZeroVector, 100, 45);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK);
EffectSsHahen_SpawnBurst(play, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, gEffFragments2DL); EffectSsHahen_SpawnBurst(play, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, gEffFragments2DL);
this->dropTimer = 5; this->dropTimer = 5;
this->dyna.actor.draw = NULL; this->dyna.actor.draw = NULL;

View file

@ -278,12 +278,12 @@ void func_80883000(BgHakaZou* this, PlayState* play) {
func_80882E54(this, play); func_80882E54(this, play);
this->dyna.actor.draw = NULL; this->dyna.actor.draw = NULL;
this->timer = 1; this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_EXPLOSION);
this->actionFunc = func_80883104; this->actionFunc = func_80883104;
} else { } else {
func_80882CC4(this, play); func_80882CC4(this, play);
this->timer = 1; this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
this->actionFunc = func_80883104; this->actionFunc = func_80883104;
} }
} else { } else {
@ -314,7 +314,7 @@ void func_80883144(BgHakaZou* this, PlayState* play) {
explosionPos.z = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.z + 56.0f); explosionPos.z = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.z + 56.0f);
EffectSsBomb2_SpawnLayered(play, &explosionPos, &sZeroVec, &sZeroVec, 150, 70); EffectSsBomb2_SpawnLayered(play, &explosionPos, &sZeroVec, &sZeroVec, 150, 70);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION);
} }
if (this->timer == 0) { if (this->timer == 0) {
@ -365,7 +365,7 @@ void func_80883328(BgHakaZou* this, PlayState* play) {
effectPos.x -= 112.0f; effectPos.x -= 112.0f;
} }
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
this->timer = 25; this->timer = 25;
this->actionFunc = func_808834D8; this->actionFunc = func_808834D8;
} }

View file

@ -188,7 +188,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, PlayState* play) {
thisx->velocity.x = Rand_CenteredFloat(8.0f); thisx->velocity.x = Rand_CenteredFloat(8.0f);
thisx->velocity.z = Rand_CenteredFloat(8.0f); thisx->velocity.z = Rand_CenteredFloat(8.0f);
BgHeavyBlock_SetPieceRandRot(this, 1.0f); BgHeavyBlock_SetPieceRandRot(this, 1.0f);
Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN); Audio_PlayActorSfx2(thisx, NA_SE_EV_ROCK_BROKEN);
func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8); func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8);
} }
} }
@ -370,7 +370,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) {
// if parent is NULL, link threw it // if parent is NULL, link threw it
if (Actor_HasNoParent(&this->dyna.actor, play)) { if (Actor_HasNoParent(&this->dyna.actor, play)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HEAVY_THROW); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_HEAVY_THROW);
this->actionFunc = BgHeavyBlock_Fly; this->actionFunc = BgHeavyBlock_Fly;
} }
} }
@ -408,10 +408,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 999); Quake_SetCountdown(quakeIndex, 999);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION);
return; return;
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);
@ -422,7 +422,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
break; break;
case HEAVYBLOCK_UNBREAKABLE: case HEAVYBLOCK_UNBREAKABLE:
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);

View file

@ -146,7 +146,7 @@ void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) {
this->dyna.actor.speedXZ = 10.0f; this->dyna.actor.speedXZ = 10.0f;
Flags_SetSwitch(play, this->switchFlag); Flags_SetSwitch(play, this->switchFlag);
func_8002F7DC(&GET_PLAYER(play)->actor, NA_SE_IT_HAMMER_HIT); func_8002F7DC(&GET_PLAYER(play)->actor, NA_SE_IT_HAMMER_HIT);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH);
} else { } else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
} }

View file

@ -99,7 +99,7 @@ void func_80886FCC(BgHidanFslift* this, PlayState* play) {
void func_8088706C(BgHidanFslift* this, PlayState* play) { void func_8088706C(BgHidanFslift* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this); func_80886FB4(this);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG);
@ -110,7 +110,7 @@ void func_8088706C(BgHidanFslift* this, PlayState* play) {
void func_808870D8(BgHidanFslift* this, PlayState* play) { void func_808870D8(BgHidanFslift* this, PlayState* play) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) { if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 790.0f, 4.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 790.0f, 4.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this); func_80886FB4(this);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG);

View file

@ -279,7 +279,7 @@ void func_80888734(BgHidanHamstep* this) {
void func_808887C4(BgHidanHamstep* this, PlayState* play) { void func_808887C4(BgHidanHamstep* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
OnePointCutscene_Init(play, 3310, 100, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3310, 100, &this->dyna.actor, CAM_ID_MAIN);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH);
this->collider.base.acFlags = AC_NONE; this->collider.base.acFlags = AC_NONE;
BgHidanHamstep_SetupAction(this, 1); BgHidanHamstep_SetupAction(this, 1);
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF);
@ -312,7 +312,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) {
Quake_SetSpeed(quakeIndex, -15536); Quake_SetSpeed(quakeIndex, -15536);
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0); Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetCountdown(quakeIndex, 20);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
func_80888638(this, play); func_80888638(this, play);
osSyncPrintf("A(%d)\n", this->dyna.actor.params); osSyncPrintf("A(%d)\n", this->dyna.actor.params);
@ -372,7 +372,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
Quake_SetQuakeValues(quakeIndex, 20, 1, 0, 0); Quake_SetQuakeValues(quakeIndex, 20, 1, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetCountdown(quakeIndex, 7);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_800AA000(10000.0f, 255, 20, 150); func_800AA000(10000.0f, 255, 20, 150);
func_808884C8(this, play); func_808884C8(this, play);

View file

@ -162,7 +162,7 @@ void func_808894B0(BgHidanHrock* this, PlayState* play) {
if (!(this->unk_168 % 4)) { if (!(this->unk_168 % 4)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
} }
if (this->unk_168 == 0) { if (this->unk_168 == 0) {
@ -185,7 +185,7 @@ void func_8088960C(BgHidanHrock* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
this->dyna.actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_5); this->dyna.actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_5);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
if (this->dyna.actor.params == 0) { if (this->dyna.actor.params == 0) {
if (play->roomCtx.curRoom.num == 10) { if (play->roomCtx.curRoom.num == 10) {

View file

@ -134,7 +134,7 @@ void func_80889C90(BgHidanKousi* this, PlayState* play) {
Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) {
func_80889ACC(this); func_80889ACC(this);
BgHidanKousi_SetupAction(this, func_80889D28); BgHidanKousi_SetupAction(this, func_80889D28);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
} }

View file

@ -307,9 +307,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) {
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
if ((this->dyna.actor.params & 0xFF) == 0) { if ((this->dyna.actor.params & 0xFF) == 0) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION);
} else { } else {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
} }
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);

View file

@ -234,7 +234,7 @@ void func_8088B69C(BgHidanRock* this, PlayState* play) {
if (!(this->timer % 4)) { if (!(this->timer % 4)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x0A, 0x64); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x0A, 0x64);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
} }
} }
@ -250,10 +250,10 @@ void func_8088B79C(BgHidanRock* this, PlayState* play) {
this->dyna.actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_5); this->dyna.actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_5);
} }
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
Audio_PlayActorSound2( Audio_PlayActorSfx2(&this->dyna.actor,
&this->dyna.actor, SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) +
SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) + SFX_FLAG); SFX_FLAG);
} }
this->unk_16C -= 0.5f; this->unk_16C -= 0.5f;
@ -305,7 +305,7 @@ void func_8088B990(BgHidanRock* this, PlayState* play) {
((this->type != 0) && (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 480.0, ((this->type != 0) && (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 480.0,
0.25f, 20.0f, 0.5f) < 0.1f))) { 0.25f, 20.0f, 0.5f) < 0.1f))) {
if (this->type == 0) { if (this->type == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} }
this->timer = 20; this->timer = 20;
this->actionFunc = func_8088B954; this->actionFunc = func_8088B954;

View file

@ -144,7 +144,7 @@ void func_8088E5D0(BgHidanSima* this, PlayState* play) {
} }
if (!(this->timer % 4)) { if (!(this->timer % 4)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
} }
} }

View file

@ -55,7 +55,7 @@ void BgHidanSyoku_Destroy(Actor* thisx, PlayState* play) {
void func_8088F47C(BgHidanSyoku* this) { void func_8088F47C(BgHidanSyoku* this) {
this->timer = 60; this->timer = 60;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
this->actionFunc = func_8088F62C; this->actionFunc = func_8088F62C;
} }

View file

@ -173,7 +173,7 @@ void BgIceObjects_Slide(BgIceObjects* this, PlayState* play) {
} }
thisx->params = 0; thisx->params = 0;
func_8002DF54(play, thisx, 7); func_8002DF54(play, thisx, 7);
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(thisx, NA_SE_EV_BLOCK_BOUND);
if ((fabsf(thisx->world.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->world.pos.z + 260.0f) < 1.0f)) { if ((fabsf(thisx->world.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->world.pos.z + 260.0f) < 1.0f)) {
this->actionFunc = BgIceObjects_Stuck; this->actionFunc = BgIceObjects_Stuck;
} else { } else {

View file

@ -303,7 +303,7 @@ void func_8089107C(BgIceShelter* this, PlayState* play) {
} }
func_808911BC(this); func_808911BC(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_MELT); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ICE_MELT);
} }
} }

View file

@ -97,7 +97,7 @@ void BgIceShutter_Destroy(Actor* thisx, PlayState* play) {
void func_80891CF4(BgIceShutter* this, PlayState* play) { void func_80891CF4(BgIceShutter* this, PlayState* play) {
if (Flags_GetTempClear(play, this->dyna.actor.room)) { if (Flags_GetTempClear(play, this->dyna.actor.room)) {
Flags_SetClear(play, this->dyna.actor.room); Flags_SetClear(play, this->dyna.actor.room);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4; this->actionFunc = func_80891DD4;
if (this->dyna.actor.shape.rot.x == 0) { if (this->dyna.actor.shape.rot.x == 0) {
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
@ -107,7 +107,7 @@ void func_80891CF4(BgIceShutter* this, PlayState* play) {
void func_80891D6C(BgIceShutter* this, PlayState* play) { void func_80891D6C(BgIceShutter* this, PlayState* play) {
if (Flags_GetSwitch(play, this->dyna.actor.params)) { if (Flags_GetSwitch(play, this->dyna.actor.params)) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4; this->actionFunc = func_80891DD4;
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
} }

View file

@ -96,7 +96,7 @@ void BgIceTurara_Break(BgIceTurara* this, PlayState* play, f32 arg2) {
s32 j; s32 j;
s32 i; s32 i;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
for (j = 0; j < 10; j++) { for (j = 0; j < 10; j++) {
pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f); pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f);
@ -137,7 +137,7 @@ void BgIceTurara_Shiver(BgIceTurara* this, PlayState* play) {
this->shiverTimer--; this->shiverTimer--;
} }
if (!(this->shiverTimer % 4)) { if (!(this->shiverTimer % 4)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_SWING); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ICE_SWING);
} }
if (this->shiverTimer == 0) { if (this->shiverTimer == 0) {
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;

View file

@ -160,7 +160,7 @@ void BgJya1flift_Move(BgJya1flift* this, PlayState* play) {
tempVelocity, 1.0f)) < 0.001f) { tempVelocity, 1.0f)) < 0.001f) {
this->dyna.actor.world.pos.y = sFinalPositions[this->isMovingDown]; this->dyna.actor.world.pos.y = sFinalPositions[this->isMovingDown];
BgJya1flift_ResetMoveDelay(this); BgJya1flift_ResetMoveDelay(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE3 - SFX_FLAG);
} }

View file

@ -87,7 +87,7 @@ void func_80893428(BgJyaAmishutter* this) {
void func_80893438(BgJyaAmishutter* this) { void func_80893438(BgJyaAmishutter* this) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 100.0f, 3.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 100.0f, 3.0f)) {
func_808934B0(this); func_808934B0(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
} }
@ -110,7 +110,7 @@ void func_808934FC(BgJyaAmishutter* this) {
void func_8089350C(BgJyaAmishutter* this) { void func_8089350C(BgJyaAmishutter* this) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f)) {
BgJyaAmishutter_SetupWaitForPlayer(this); BgJyaAmishutter_SetupWaitForPlayer(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
} }

View file

@ -149,7 +149,7 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, PlayState* play) {
if (this->timer > 10) { if (this->timer > 10) {
BgJyaBombchuiwa_Break(this, play); BgJyaBombchuiwa_Break(this, play);
BgJyaBombchuiwa_CleanUpAfterExplosion(this, play); BgJyaBombchuiwa_CleanUpAfterExplosion(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
} }
} else { } else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View file

@ -165,7 +165,7 @@ void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
BgJyaBombiwa_Break(this, play); BgJyaBombiwa_Break(this, play);
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} else { } else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View file

@ -177,7 +177,7 @@ void BgJyaGoroiwa_Move(BgJyaGoroiwa* this, PlayState* play) {
thisx->world.rot.y = 0x4000; thisx->world.rot.y = 0x4000;
} }
Audio_PlayActorSound2(thisx, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); Audio_PlayActorSfx2(thisx, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG);
} }
void BgJyaGoroiwa_SetupWait(BgJyaGoroiwa* this) { void BgJyaGoroiwa_SetupWait(BgJyaGoroiwa* this) {

View file

@ -190,7 +190,7 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) {
void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, PlayState* play) { void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, PlayState* play) {
if (this->timer >= 17) { if (this->timer >= 17) {
BgJyaHaheniron_SpawnFragments(play, &this->actor.world.pos, D_808987AC); BgJyaHaheniron_SpawnFragments(play, &this->actor.world.pos, D_808987AC);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
} }

View file

@ -248,7 +248,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) {
this->colCylinder.base.acFlags &= ~AC_HIT; this->colCylinder.base.acFlags &= ~AC_HIT;
if (actor != NULL && actor->id == ACTOR_EN_IK) { if (actor != NULL && actor->id == ACTOR_EN_IK) {
particleFunc[this->dyna.actor.params & 1](this, play, (EnIk*)actor); particleFunc[this->dyna.actor.params & 1](this, play, (EnIk*)actor);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR);
dropPos.x = this->dyna.actor.world.pos.x; dropPos.x = this->dyna.actor.world.pos.x;
dropPos.y = this->dyna.actor.world.pos.y + 20.0f; dropPos.y = this->dyna.actor.world.pos.y + 20.0f;
dropPos.z = this->dyna.actor.world.pos.z; dropPos.z = this->dyna.actor.world.pos.z;

View file

@ -101,7 +101,7 @@ void func_80899950(BgJyaKanaami* this, PlayState* play) {
this->unk_168 += 0x20; this->unk_168 += 0x20;
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) { if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) {
func_80899A08(this); func_80899A08(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND);
quakeId = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeId = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quakeId, 25000); Quake_SetSpeed(quakeId, 25000);
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetQuakeValues(quakeId, 2, 0, 0, 0);

View file

@ -117,7 +117,7 @@ void BgJyaLift_Move(BgJyaLift* this, PlayState* play) {
} }
if (fabsf(distFromBottom) < 0.001f) { if (fabsf(distFromBottom) < 0.001f) {
BgJyaLift_SetFinalPosY(this); BgJyaLift_SetFinalPosY(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG);
} }

View file

@ -197,7 +197,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) {
if (this->lightTimer > 40) { if (this->lightTimer > 40) {
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
BgJyaMegami_SetupExplode(this); BgJyaMegami_SetupExplode(this);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION);
OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN);
} else { } else {
if (this->lightTimer < 8) { if (this->lightTimer < 8) {
@ -236,7 +236,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, PlayState* play) {
this->explosionTimer++; this->explosionTimer++;
if (this->explosionTimer == 30) { if (this->explosionTimer == 30) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN);
} }
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {

View file

@ -101,7 +101,7 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) {
(ABS((s16)(this->collider.base.ac->world.rot.y - this->actor.shape.rot.y)) > 0x5000)) { (ABS((s16)(this->collider.base.ac->world.rot.y - this->actor.shape.rot.y)) > 0x5000)) {
this->collider.base.acFlags &= ~AC_HIT; this->collider.base.acFlags &= ~AC_HIT;
if (this->framesUntilDisable == -1) { if (this->framesUntilDisable == -1) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AMOS_DAMAGE); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_AMOS_DAMAGE);
D_8089C1A0 += 1; D_8089C1A0 += 1;
D_8089C1A0 = CLAMP_MAX(D_8089C1A0, 4); D_8089C1A0 = CLAMP_MAX(D_8089C1A0, 4);
} }

View file

@ -470,9 +470,9 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) {
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
this->dList = NULL; this->dList = NULL;
BgMizuBwall_SpawnDebris(this, play); BgMizuBwall_SpawnDebris(this, play);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->actionFunc = BgMizuBwall_Break; this->actionFunc = BgMizuBwall_Break;
} else if (this->dyna.actor.xzDistToPlayer < 600.0f) { } else if (this->dyna.actor.xzDistToPlayer < 600.0f) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View file

@ -105,7 +105,7 @@ void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, PlayState* play) {
void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, PlayState* play) { void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, PlayState* play) {
if (this->timer-- == 0) { if (this->timer-- == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN);
this->actionFunc = BgMizuShutter_Move; this->actionFunc = BgMizuShutter_Move;
} }
} }
@ -129,7 +129,7 @@ void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) {
(this->dyna.actor.world.pos.y == this->closedPos.y) && (this->dyna.actor.world.pos.y == this->closedPos.y) &&
(this->dyna.actor.world.pos.z == this->closedPos.z)) { (this->dyna.actor.world.pos.z == this->closedPos.z)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
this->actionFunc = BgMizuShutter_WaitForSwitch; this->actionFunc = BgMizuShutter_WaitForSwitch;
} }
} }
@ -140,7 +140,7 @@ void BgMizuShutter_WaitForTimer(BgMizuShutter* this, PlayState* play) {
this->timer--; this->timer--;
func_8002F994(&this->dyna.actor, this->timer); func_8002F994(&this->dyna.actor, this->timer);
if (this->timer == 0) { if (this->timer == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE);
Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor)); Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor));
this->actionFunc = BgMizuShutter_Move; this->actionFunc = BgMizuShutter_Move;
} }

View file

@ -61,7 +61,7 @@ void func_8089F788(BgMizuUzu* this, PlayState* play) {
} else { } else {
DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
} }
Audio_PlayActorSound2(thisx, NA_SE_EV_WATER_CONVECTION - SFX_FLAG); Audio_PlayActorSfx2(thisx, NA_SE_EV_WATER_CONVECTION - SFX_FLAG);
thisx->shape.rot.y += 0x1C0; thisx->shape.rot.y += 0x1C0;
} }

View file

@ -161,7 +161,7 @@ void BgMoriBigst_Fall(BgMoriBigst* this, PlayState* play) {
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
BgMoriBigst_SetupLanding(this, play); BgMoriBigst_SetupLanding(this, play);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
OnePointCutscene_Init(play, 1020, 8, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 1020, 8, &this->dyna.actor, CAM_ID_MAIN);
func_8002DF38(play, NULL, 0x3C); func_8002DF38(play, NULL, 0x3C);
} }

View file

@ -161,7 +161,7 @@ void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, PlayState* play) {
distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
if (fabsf(distToTarget) < 0.001f) { if (fabsf(distToTarget) < 0.001f) {
BgMoriElevator_SetupSetPosition(this); BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
} else { } else {
func_808A18FC(this, distToTarget); func_808A18FC(this, distToTarget);
} }
@ -180,7 +180,7 @@ void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, PlayState* play) {
distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
if (fabsf(distToTarget) < 0.001f) { if (fabsf(distToTarget) < 0.001f) {
BgMoriElevator_SetupSetPosition(this); BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
} else { } else {
func_808A18FC(this, distToTarget); func_808A18FC(this, distToTarget);
} }
@ -233,7 +233,7 @@ void func_808A2008(BgMoriElevator* this, PlayState* play) {
distTo = func_808A1800(&this->dyna.actor.world.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f); distTo = func_808A1800(&this->dyna.actor.world.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f);
if (fabsf(distTo) < 0.001f) { if (fabsf(distTo) < 0.001f) {
BgMoriElevator_SetupSetPosition(this); BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
} else { } else {
func_808A18FC(this, distTo); func_808A18FC(this, distTo);

View file

@ -126,14 +126,14 @@ void BgMoriHashira4_SetupPillarsRotate(BgMoriHashira4* this) {
void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, PlayState* play) { void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, PlayState* play) {
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y += 0x96; this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y += 0x96;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG);
} }
void BgMoriHashira4_GateWait(BgMoriHashira4* this, PlayState* play) { void BgMoriHashira4_GateWait(BgMoriHashira4* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag) || (this->gateTimer != 0)) { if (Flags_GetSwitch(play, this->switchFlag) || (this->gateTimer != 0)) {
this->gateTimer++; this->gateTimer++;
if (this->gateTimer > 30) { if (this->gateTimer > 30) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN);
BgMoriHashira4_SetupAction(this, BgMoriHashira4_GateOpen); BgMoriHashira4_SetupAction(this, BgMoriHashira4_GateOpen);
OnePointCutscene_Init(play, 6010, 20, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 6010, 20, &this->dyna.actor, CAM_ID_MAIN);
sUnkTimer++; sUnkTimer++;

View file

@ -258,7 +258,7 @@ void BgPoEvent_BlockShake(BgPoEvent* this, PlayState* play) {
if (this->timer < 15) { if (this->timer < 15) {
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + 2.0f * ((this->timer % 3) - 1); this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + 2.0f * ((this->timer % 3) - 1);
if (!(this->timer % 4)) { if (!(this->timer % 4)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
} }
} }
if (this->timer == 0) { if (this->timer == 0) {
@ -314,7 +314,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, PlayState* play) {
if (this->type != 1) { if (this->type != 1) {
BgPoEvent_CheckBlock(this); BgPoEvent_CheckBlock(this);
} else { } else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_80033E88(&this->dyna.actor, play, 5, 5); func_80033E88(&this->dyna.actor, play, 5, 5);
func_80088B34(this->timer); func_80088B34(this->timer);
if (firstFall == 0) { if (firstFall == 0) {
@ -355,7 +355,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, PlayState* play) {
this->actionFunc = BgPoEvent_BlockReset; this->actionFunc = BgPoEvent_BlockReset;
if (sPuzzleState == 0x10) { if (sPuzzleState == 0x10) {
sPuzzleState = 0x40; sPuzzleState = 0x40;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_RISING); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_RISING);
func_8002DF54(play, &player->actor, 8); func_8002DF54(play, &player->actor, 8);
} }
} else if (this->dyna.unk_150 != 0.0f) { } else if (this->dyna.unk_150 != 0.0f) {
@ -394,7 +394,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) {
if (blockStop) { if (blockStop) {
player->stateFlags2 &= ~PLAYER_STATE2_4; player->stateFlags2 &= ~PLAYER_STATE2_4;
if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(play, &this->dyna, 0x1E, 0x32, -0x14) == 0)) { if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(play, &this->dyna, 0x1E, 0x32, -0x14) == 0)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} }
this->dyna.unk_150 = 0.0f; this->dyna.unk_150 = 0.0f;
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
@ -450,7 +450,7 @@ void BgPoEvent_AmyWait(BgPoEvent* this, PlayState* play) {
sPuzzleState |= 0x20; sPuzzleState |= 0x20;
this->timer = 5; this->timer = 5;
Actor_SetColorFilter(&this->dyna.actor, 0x4000, 0xFF, 0, 5); Actor_SetColorFilter(&this->dyna.actor, 0x4000, 0xFF, 0, 5);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_PO_LAUGH2); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EN_PO_LAUGH2);
this->actionFunc = BgPoEvent_AmyPuzzle; this->actionFunc = BgPoEvent_AmyPuzzle;
} }
} }
@ -528,7 +528,7 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, PlayState* play) {
under the balcony allows him to be closer. under the balcony allows him to be closer.
4) Link is within 45 degrees of facing the painting. */ 4) Link is within 45 degrees of facing the painting. */
this->timer = 0; this->timer = 0;
Audio_PlayActorSound2(thisx, NA_SE_EN_PO_LAUGH); Audio_PlayActorSfx2(thisx, NA_SE_EN_PO_LAUGH);
this->actionFunc = BgPoEvent_PaintingVanish; this->actionFunc = BgPoEvent_PaintingVanish;
} else if (this->collider.base.acFlags & AC_HIT) { } else if (this->collider.base.acFlags & AC_HIT) {
if (!BgPoEvent_NextPainting(this)) { if (!BgPoEvent_NextPainting(this)) {
@ -538,7 +538,7 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, PlayState* play) {
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
} else { } else {
Audio_PlayActorSound2(thisx, NA_SE_EN_PO_LAUGH2); Audio_PlayActorSfx2(thisx, NA_SE_EN_PO_LAUGH2);
OnePointCutscene_Init(play, 3160, 35, thisx, CAM_ID_MAIN); OnePointCutscene_Init(play, 3160, 35, thisx, CAM_ID_MAIN);
} }
if (thisx->parent != NULL) { if (thisx->parent != NULL) {

View file

@ -116,7 +116,7 @@ void BgRelayObjects_Destroy(Actor* thisx, PlayState* play) {
void func_808A90F4(BgRelayObjects* this, PlayState* play) { void func_808A90F4(BgRelayObjects* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag)) { if (Flags_GetSwitch(play, this->switchFlag)) {
if (this->timer != 0) { if (this->timer != 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
if (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE) { if (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE) {
this->timer = 120; this->timer = 120;
} else { } else {
@ -137,7 +137,7 @@ void func_808A91AC(BgRelayObjects* this, PlayState* play) {
func_8002F994(&this->dyna.actor, this->timer); func_8002F994(&this->dyna.actor, this->timer);
} }
if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) { if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
this->actionFunc = func_808A9234; this->actionFunc = func_808A9234;
} }
} }
@ -146,7 +146,7 @@ void func_808A9234(BgRelayObjects* this, PlayState* play) {
this->dyna.actor.velocity.y += this->dyna.actor.gravity; this->dyna.actor.velocity.y += this->dyna.actor.gravity;
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
if (this->unk_169 != play->roomCtx.curRoom.num) { if (this->unk_169 != play->roomCtx.curRoom.num) {
func_800788CC(NA_SE_EN_PO_LAUGH); func_800788CC(NA_SE_EN_PO_LAUGH);
this->timer = 5; this->timer = 5;

View file

@ -181,13 +181,13 @@ void BgSpot00Hanebasi_DrawbridgeRiseAndFall(BgSpot00Hanebasi* this, PlayState* p
if (this->destAngle < 0) { if (this->destAngle < 0) {
if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) { if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
} }
} else { } else {
if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) { if (this->actionFunc == BgSpot00Hanebasi_DrawbridgeWait) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN - SFX_FLAG);
} }

View file

@ -53,7 +53,7 @@ void BgSpot01Idohashira_PlayBreakSfx1(BgSpot01Idohashira* this) {
} }
void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, PlayState* play) { void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, PlayState* play) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK);
} }
void func_808AAD3C(PlayState* play, Vec3f* vec, u32 arg2) { void func_808AAD3C(PlayState* play, Vec3f* vec, u32 arg2) {

View file

@ -54,8 +54,8 @@ void func_808ABB84(BgSpot01Idomizu* this, PlayState* play) {
} }
play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y;
if (this->waterHeight < this->actor.world.pos.y) { if (this->waterHeight < this->actor.world.pos.y) {
Audio_PlaySoundGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f); Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f);
} }

View file

@ -129,7 +129,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) {
if (play->csCtx.state != 0) { if (play->csCtx.state != 0) {
if (play->csCtx.npcActions[3] != NULL && play->csCtx.npcActions[3]->action == 2) { if (play->csCtx.npcActions[3] != NULL && play->csCtx.npcActions[3]->action == 2) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION);
SET_EVENTCHKINF(EVENTCHKINF_1D); SET_EVENTCHKINF(EVENTCHKINF_1D);
this->timer = 25; this->timer = 25;
pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x; pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x;
@ -175,7 +175,7 @@ void func_808ACAFC(BgSpot02Objects* this, PlayState* play) {
void func_808ACB58(BgSpot02Objects* this, PlayState* play) { void func_808ACB58(BgSpot02Objects* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 255.0f, 1.0f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 255.0f, 1.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
this->actionFunc = func_808AC8FC; this->actionFunc = func_808AC8FC;
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG);
@ -267,7 +267,7 @@ void func_808ACCB8(Actor* thisx, PlayState* play) {
void func_808AD3D4(BgSpot02Objects* this, PlayState* play) { void func_808AD3D4(BgSpot02Objects* this, PlayState* play) {
if (play->csCtx.state != 0 && play->csCtx.npcActions[2] != NULL && play->csCtx.npcActions[2]->action == 2) { if (play->csCtx.state != 0 && play->csCtx.npcActions[2] != NULL && play->csCtx.npcActions[2]->action == 2) {
if (this->timer == 2) { if (this->timer == 2) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_IT_EXPLOSION_ICE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_IT_EXPLOSION_ICE);
} }
if (this->timer < 32) { if (this->timer < 32) {

View file

@ -152,8 +152,8 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) {
this->bufferIndex = this->bufferIndex == 0; this->bufferIndex = this->bufferIndex == 0;
if (this->state >= WATERFALL_OPENING_IDLE && this->state <= WATERFALL_OPENED) { if (this->state >= WATERFALL_OPENING_IDLE && this->state <= WATERFALL_OPENED) {
Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 0.5f); Audio_PlaySfxWaterfall(&this->dyna.actor.projectedPos, 0.5f);
} else { } else {
Audio_PlaySoundWaterfall(&this->dyna.actor.projectedPos, 1.0f); Audio_PlaySfxWaterfall(&this->dyna.actor.projectedPos, 1.0f);
} }
} }

View file

@ -78,7 +78,7 @@ void func_808AE5A8(BgSpot05Soko* this, PlayState* play) {
void func_808AE5B4(BgSpot05Soko* this, PlayState* play) { void func_808AE5B4(BgSpot05Soko* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag)) { if (Flags_GetSwitch(play, this->switchFlag)) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_METALDOOR_CLOSE); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_METALDOOR_CLOSE);
Actor_SetFocus(&this->dyna.actor, 50.0f); Actor_SetFocus(&this->dyna.actor, 50.0f);
OnePointCutscene_Attention(play, &this->dyna.actor); OnePointCutscene_Attention(play, &this->dyna.actor);
this->actionFunc = func_808AE630; this->actionFunc = func_808AE630;

View file

@ -253,7 +253,7 @@ void BgSpot06Objects_GateOpen(BgSpot06Objects* this, PlayState* play) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 0.6f)) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 0.6f)) {
this->actionFunc = BgSpot06Objects_DoNothing; this->actionFunc = BgSpot06Objects_DoNothing;
this->timer = 0; this->timer = 0;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
} }
@ -311,8 +311,8 @@ void BgSpot06Objects_LockWait(BgSpot06Objects* this, PlayState* play) {
EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 700); EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 700);
this->collider.elements->dim.worldSphere.radius = 45; this->collider.elements->dim.worldSphere.radius = 45;
this->actionFunc = BgSpot06Objects_LockPullOutward; this->actionFunc = BgSpot06Objects_LockPullOutward;
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Flags_SetSwitch(play, this->switchFlag); Flags_SetSwitch(play, this->switchFlag);
OnePointCutscene_Init(play, 4120, 170, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 4120, 170, &this->dyna.actor, CAM_ID_MAIN);
} else { } else {

View file

@ -185,7 +185,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
func_808B0324(this, play); func_808B0324(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} else if (this->dyna.actor.xzDistToPlayer < 800.0f) { } else if (this->dyna.actor.xzDistToPlayer < 800.0f) {

View file

@ -137,7 +137,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) { if (this->collider.base.acFlags & AC_HIT) {
func_808B2218(this, play); func_808B2218(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN);
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
return; return;

View file

@ -114,7 +114,7 @@ void func_808B318C(BgSpot12Gate* this, PlayState* play) {
Quake_SetSpeed(var, -0x3CB0); Quake_SetSpeed(var, -0x3CB0);
Quake_SetQuakeValues(var, 3, 0, 0, 0); Quake_SetQuakeValues(var, 3, 0, 0, 0);
Quake_SetCountdown(var, 0xC); Quake_SetCountdown(var, 0xC);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
} }

View file

@ -103,7 +103,7 @@ void func_808B3604(BgSpot12Saku* this, PlayState* play) {
this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18);
if (fabsf(temp_ret) < 0.0001f) { if (fabsf(temp_ret) < 0.0001f) {
func_808B3714(this); func_808B3714(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
} }

View file

@ -282,7 +282,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) {
} else if (approxFResult) { } else if (approxFResult) {
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (func_808B4010(this, play)) { if (func_808B4010(this, play)) {
Audio_PlayActorSound2(actor, NA_SE_EV_WOOD_BOUND); Audio_PlayActorSfx2(actor, NA_SE_EV_WOOD_BOUND);
} }
if (func_808B3A40(this, play)) { if (func_808B3A40(this, play)) {
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
@ -296,7 +296,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) {
this->unk_168 = 10; this->unk_168 = 10;
func_808B4084(this, play); func_808B4084(this, play);
} }
Audio_PlayActorSound2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); Audio_PlayActorSfx2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
} }
void func_808B4380(BgSpot15Rrbox* this, PlayState* play) { void func_808B4380(BgSpot15Rrbox* this, PlayState* play) {
@ -335,7 +335,7 @@ void func_808B43D0(BgSpot15Rrbox* this, PlayState* play) {
if ((floorHeight - actor->world.pos.y) >= -0.001f) { if ((floorHeight - actor->world.pos.y) >= -0.001f) {
actor->world.pos.y = floorHeight; actor->world.pos.y = floorHeight;
func_808B4084(this, play); func_808B4084(this, play);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WOOD_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_WOOD_BOUND);
} }
} }

View file

@ -66,10 +66,10 @@ void func_808B4930(BgSpot15Saku* this, PlayState* play) {
void func_808B4978(BgSpot15Saku* this, PlayState* play) { void func_808B4978(BgSpot15Saku* this, PlayState* play) {
if (this->timer == 0) { if (this->timer == 0) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
this->dyna.actor.world.pos.z -= 2.0f; this->dyna.actor.world.pos.z -= 2.0f;
if (this->dyna.actor.world.pos.z < 2660.0f) { if (this->dyna.actor.world.pos.z < 2660.0f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP);
this->timer = 30; this->timer = 30;
this->actionFunc = func_808B4A04; this->actionFunc = func_808B4A04;
} }

View file

@ -513,7 +513,7 @@ void func_808B5B6C(BgSpot16Bombstone* this, PlayState* play) {
((actor->bgCheckFlags & BGCHECKFLAG_GROUND) && actor->velocity.y < 0.0f)) { ((actor->bgCheckFlags & BGCHECKFLAG_GROUND) && actor->velocity.y < 0.0f)) {
BgSpot16Bombstone_SpawnFragments(this, play); BgSpot16Bombstone_SpawnFragments(this, play);
BgSpot16Bombstone_SpawnDust(this, play); BgSpot16Bombstone_SpawnDust(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN);
Actor_Kill(actor); Actor_Kill(actor);
return; return;
} }

View file

@ -116,7 +116,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) {
if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) { if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) {
func_808B6BC0(this, play); func_808B6BC0(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
} }

View file

@ -259,7 +259,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) {
player->stateFlags2 &= ~PLAYER_STATE2_4; player->stateFlags2 &= ~PLAYER_STATE2_4;
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
func_80078884(NA_SE_SY_CORRECT_CHIME); func_80078884(NA_SE_SY_CORRECT_CHIME);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
} }

Some files were not shown because too many files have changed in this diff Show more