diff options
| author | engineer124 <engineer124engineer124@gmail.com> | 2023-06-22 14:24:08 +1000 |
|---|---|---|
| committer | engineer124 <engineer124engineer124@gmail.com> | 2023-06-22 14:24:08 +1000 |
| commit | c6420cd33cabf50a0fc856240d68c696d087ea0d (patch) | |
| tree | 01c762cc82c4f7750a119454fa6cbf832a42ea25 /src/code | |
| parent | a01ee3c056fbe87822e3df4f264625b272c6cf8e (diff) | |
| parent | 96a1d37084a5eb93540f712e55fcd3cb717c0ea3 (diff) | |
merge master
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/audio_thread_manager.c | 49 | ||||
| -rw-r--r-- | src/code/game.c | 1 | ||||
| -rw-r--r-- | src/code/main.c | 3 | ||||
| -rw-r--r-- | src/code/z_actor.c | 117 | ||||
| -rw-r--r-- | src/code/z_camera.c | 12 | ||||
| -rw-r--r-- | src/code/z_collision_check.c | 32 | ||||
| -rw-r--r-- | src/code/z_demo.c | 20 | ||||
| -rw-r--r-- | src/code/z_effect_soft_sprite_old_init.c | 4 | ||||
| -rw-r--r-- | src/code/z_en_item00.c | 4 | ||||
| -rw-r--r-- | src/code/z_eventmgr.c | 4 | ||||
| -rw-r--r-- | src/code/z_jpeg.c | 2 | ||||
| -rw-r--r-- | src/code/z_kaleido_setup.c | 2 | ||||
| -rw-r--r-- | src/code/z_lib.c | 13 | ||||
| -rw-r--r-- | src/code/z_lifemeter.c | 2 | ||||
| -rw-r--r-- | src/code/z_map_exp.c | 4 | ||||
| -rw-r--r-- | src/code/z_message.c | 12 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 46 | ||||
| -rw-r--r-- | src/code/z_play.c | 6 | ||||
| -rw-r--r-- | src/code/z_play_hireso.c | 22 | ||||
| -rw-r--r-- | src/code/z_player_lib.c | 2 | ||||
| -rw-r--r-- | src/code/z_sound_source.c | 4 | ||||
| -rw-r--r-- | src/code/z_sram_NES.c | 8 |
22 files changed, 202 insertions, 167 deletions
diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index 45fbcb87e..12941eb2d 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -1,6 +1,7 @@ #include "global.h" +#include "audiomgr.h" -void func_80172C30(AudioMgr* audioMgr) { +void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) { AudioTask* task = audioMgr->rspTask; if (audioMgr->rspTask->taskQueue != NULL) { @@ -9,7 +10,7 @@ void func_80172C30(AudioMgr* audioMgr) { } void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { - static s32 retryCount = 10; + static s32 sRetryCount = 10; AudioTask* rspTask; s32 timerMsgVal = 666; OSTimer timer; @@ -19,8 +20,8 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { audioMgr->rspTask = NULL; } - while (audioMgr->cmdQ.validCount != 0) { - osRecvMesg(&audioMgr->cmdQ, NULL, OS_MESG_NOBLOCK); + while (!MQ_IS_EMPTY(&audioMgr->cmdQueue)) { + osRecvMesg(&audioMgr->cmdQueue, NULL, OS_MESG_NOBLOCK); } if (audioMgr->rspTask != NULL) { @@ -29,7 +30,7 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { audioMgr->audioTask.framebuffer = NULL; audioMgr->audioTask.list = audioMgr->rspTask->task; - audioMgr->audioTask.msgQ = &audioMgr->cmdQ; + audioMgr->audioTask.msgQ = &audioMgr->cmdQueue; audioMgr->audioTask.msg = NULL; osSendMesg(&audioMgr->sched->cmdQ, &audioMgr->audioTask, OS_MESG_BLOCK); @@ -44,13 +45,13 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { if (audioMgr->rspTask != NULL) { while (true) { - osSetTimer(&timer, OS_USEC_TO_CYCLES(32000), 0, &audioMgr->cmdQ, (OSMesg)timerMsgVal); - osRecvMesg(&audioMgr->cmdQ, (OSMesg*)&msg, OS_MESG_BLOCK); + osSetTimer(&timer, OS_USEC_TO_CYCLES(32000), 0, &audioMgr->cmdQueue, (OSMesg)timerMsgVal); + osRecvMesg(&audioMgr->cmdQueue, (OSMesg*)&msg, OS_MESG_BLOCK); osStopTimer(&timer); if (msg == timerMsgVal) { osSyncPrintf("AUDIO SP TIMEOUT %08x %08x\n", audioMgr->rspTask, audioMgr->rspTask->task); - if (retryCount >= 0) { - retryCount--; + if (sRetryCount >= 0) { + sRetryCount--; Sched_SendAudioCancelMsg(audioMgr->sched); } else { osSyncPrintf("audioMgr.c:もうダメ!死ぬ!\n"); @@ -62,13 +63,13 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { } } - func_80172C30(audioMgr); + AudioMgr_NotifyTaskDone(audioMgr); } audioMgr->rspTask = rspTask; } -void AudioMgr_HandlePRENMI(AudioMgr* audioMgr) { +void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) { Audio_PreNMI(); } @@ -81,32 +82,36 @@ void AudioMgr_ThreadEntry(void* arg) { Audio_Init(); AudioLoad_SetDmaHandler(DmaMgr_DmaHandler); Audio_InitSound(); - osSendMesg(&audioMgr->lockMsgQ, NULL, OS_MESG_BLOCK); - IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->interruptMsgQ); + osSendMesg(&audioMgr->lockQueue, NULL, OS_MESG_BLOCK); + IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->interruptQueue); exit = false; while (!exit) { - osRecvMesg(&audioMgr->interruptMsgQ, (OSMesg*)&msg, OS_MESG_BLOCK); + osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); switch (*msg) { case OS_SC_RETRACE_MSG: AudioMgr_HandleRetrace(audioMgr); - while (audioMgr->interruptMsgQ.validCount != 0) { - osRecvMesg(&audioMgr->interruptMsgQ, (OSMesg*)&msg, OS_MESG_BLOCK); + while (!MQ_IS_EMPTY(&audioMgr->interruptQueue)) { + osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); switch (*msg) { case OS_SC_RETRACE_MSG: break; + case OS_SC_PRE_NMI_MSG: - AudioMgr_HandlePRENMI(audioMgr); + AudioMgr_HandlePreNMI(audioMgr); break; + case OS_SC_NMI_MSG: exit = true; break; } } break; + case OS_SC_PRE_NMI_MSG: - AudioMgr_HandlePRENMI(audioMgr); + AudioMgr_HandlePreNMI(audioMgr); break; + case OS_SC_NMI_MSG: exit = true; break; @@ -117,7 +122,7 @@ void AudioMgr_ThreadEntry(void* arg) { } void AudioMgr_Unlock(AudioMgr* audioMgr) { - osRecvMesg(&audioMgr->lockMsgQ, NULL, OS_MESG_BLOCK); + osRecvMesg(&audioMgr->lockQueue, NULL, OS_MESG_BLOCK); } void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) { @@ -127,9 +132,9 @@ void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedCon audioMgr->irqMgr = irqMgr; audioMgr->rspTask = NULL; - osCreateMesgQueue(&audioMgr->cmdQ, audioMgr->cmdMsgBuf, ARRAY_COUNT(audioMgr->cmdMsgBuf)); - osCreateMesgQueue(&audioMgr->interruptMsgQ, audioMgr->interruptMsgBuf, ARRAY_COUNT(audioMgr->interruptMsgBuf)); - osCreateMesgQueue(&audioMgr->lockMsgQ, audioMgr->lockMsgBuf, ARRAY_COUNT(audioMgr->lockMsgBuf)); + osCreateMesgQueue(&audioMgr->cmdQueue, audioMgr->cmdMsgBuf, ARRAY_COUNT(audioMgr->cmdMsgBuf)); + osCreateMesgQueue(&audioMgr->interruptQueue, audioMgr->interruptMsgBuf, ARRAY_COUNT(audioMgr->interruptMsgBuf)); + osCreateMesgQueue(&audioMgr->lockQueue, audioMgr->lockMsgBuf, ARRAY_COUNT(audioMgr->lockMsgBuf)); osCreateThread(&audioMgr->thread, id, AudioMgr_ThreadEntry, audioMgr, stack, pri); osStartThread(&audioMgr->thread); diff --git a/src/code/game.c b/src/code/game.c index 8f4e0f44d..685b2f492 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,4 +1,5 @@ #include "global.h" +#include "audiomgr.h" #include "system_malloc.h" #include "z64debug_text.h" #include "z64rumble.h" diff --git a/src/code/main.c b/src/code/main.c index 3da3d25d7..381c42fac 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -5,6 +5,7 @@ */ #include "global.h" +#include "audiomgr.h" #include "buffers.h" #include "stack.h" #include "stackcheck.h" @@ -80,7 +81,7 @@ void Main(void* arg) { while (!exit) { msg = NULL; - osRecvMesg(&irqMgrMsgQ, (OSMesg)&msg, OS_MESG_BLOCK); + osRecvMesg(&irqMgrMsgQ, (OSMesg*)&msg, OS_MESG_BLOCK); if (msg == NULL) { break; } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index e7bc92a26..ac014e5ca 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -32,6 +32,20 @@ extern s16 D_801ED8DC; // 2 funcs extern Mtx D_801ED8E0; // 1 func extern Actor* D_801ED920; // 2 funcs. 1 out of z_actor +#define ACTOR_AUDIO_FLAG_SFX_ACTOR_POS (1 << 0) +#define ACTOR_AUDIO_FLAG_SFX_CENTERED_1 (1 << 1) +#define ACTOR_AUDIO_FLAG_SFX_CENTERED_2 (1 << 2) +#define ACTOR_AUDIO_FLAG_SFX_CENTERED_3 (1 << 3) +#define ACTOR_AUDIO_FLAG_SFX_TIMER (1 << 4) +#define ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE (1 << 5) +#define ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE (1 << 6) + +#define ACTOR_AUDIO_FLAG_SFX_ALL \ + (ACTOR_AUDIO_FLAG_SFX_TIMER | ACTOR_AUDIO_FLAG_SFX_CENTERED_3 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | \ + ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_ACTOR_POS) +#define ACTOR_AUDIO_FLAG_SEQ_ALL (ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE | ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE) +#define ACTOR_AUDIO_FLAG_ALL (ACTOR_AUDIO_FLAG_SFX_ALL | ACTOR_AUDIO_FLAG_SEQ_ALL) + // Internal forward declarations void Actor_KillAllOnHalfDayChange(PlayState* play, ActorContext* actorCtx); Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, PlayState* play); @@ -663,7 +677,7 @@ void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GameS sfxId = CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_4 | ACTOR_FLAG_1) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN; - play_sound(sfxId); + Audio_PlaySfx(sfxId); } targetCtx->targetCenterPos.x = actor->world.pos.x; @@ -2164,7 +2178,7 @@ void func_800B8E1C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) */ void Player_PlaySfx(Player* player, u16 sfxId) { if (player->currentMask == PLAYER_MASK_GIANT) { - func_8019F170(&player->actor.projectedPos, sfxId); + Audio_PlaySfx_AtPosWithPresetLowFreqAndHighReverb(&player->actor.projectedPos, sfxId); } else { AudioSfx_PlaySfx(sfxId, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -2175,10 +2189,10 @@ void Player_PlaySfx(Player* player, u16 sfxId) { * Play a sound effect at the actor's position */ void Actor_PlaySfx(Actor* actor, u16 sfxId) { - Audio_PlaySfxAtPos(&actor->projectedPos, sfxId); + Audio_PlaySfx_AtPos(&actor->projectedPos, sfxId); } -void func_800B8EF4(PlayState* play, Actor* actor) { +void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor) { SurfaceSfxOffset surfaceSfxOffset; if (actor->bgCheckFlags & BGCHECKFLAG_WATER) { @@ -2191,41 +2205,53 @@ void func_800B8EF4(PlayState* play, Actor* actor) { surfaceSfxOffset = SurfaceType_GetSfxOffset(&play->colCtx, actor->floorPoly, actor->floorBgId); } - Audio_PlaySfxAtPos(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); - Audio_PlaySfxAtPos(&actor->projectedPos, NA_SE_PL_WALK_GROUND + surfaceSfxOffset); + Audio_PlaySfx_AtPos(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); + Audio_PlaySfx_AtPos(&actor->projectedPos, NA_SE_PL_WALK_GROUND + surfaceSfxOffset); } -void func_800B8F98(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared audioFlag system + */ +void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId) { actor->sfxId = sfxId; - actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); - actor->audioFlags |= 0x02; + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL; + actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_1; } -void func_800B8FC0(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared audioFlag system + */ +void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) { actor->sfxId = sfxId; - actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); - actor->audioFlags |= 4; + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL; + actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2; } -void func_800B8FE8(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared audioFlag system + */ +void Actor_PlaySfx_FlaggedCentered3(Actor* actor, u16 sfxId) { actor->sfxId = sfxId; - actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); - actor->audioFlags |= 0x08; + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL; + actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_3; } -void func_800B9010(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the actor's position using the shared audioFlag system + */ +void Actor_PlaySfx_Flagged(Actor* actor, u16 sfxId) { actor->sfxId = sfxId; - actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); - actor->audioFlags |= 0x01; + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL; + actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_ACTOR_POS; } -void func_800B9038(Actor* actor, s32 timer) { - actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); - actor->audioFlags |= 0x10; +void Actor_PlaySfx_FlaggedTimer(Actor* actor, s32 timer) { + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL; + actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_TIMER; // The sfxId here are not actually sound effects, but instead this is data that gets sent into - // the io ports of the music macro language (func_801A0810 / Audio_PlaySfxAtPosWithSoundScriptIO is - // the function that it's used for) + // the io ports of the music macro language (Audio_PlaySfx_AtPosWithChannelIO / Audio_PlaySfxAtPosWithSoundScriptIO + // is the function that it's used for) if (timer < 40) { actor->sfxId = 3; } else if (timer < 100) { @@ -2235,12 +2261,12 @@ void func_800B9038(Actor* actor, s32 timer) { } } -void func_800B9084(Actor* actor) { - actor->audioFlags |= 0x20; +void Actor_PlaySeq_FlaggedKamaroDance(Actor* actor) { + actor->audioFlags |= ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE; } -void func_800B9098(Actor* actor) { - actor->audioFlags |= 0x40; +void Actor_PlaySeq_FlaggedMusicBoxHouse(Actor* actor) { + actor->audioFlags |= ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE; } s32 func_800B90AC(PlayState* play, Actor* actor, CollisionPoly* polygon, s32 bgId, Vec3f* arg4) { @@ -2368,7 +2394,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { } actor->sfxId = 0; - actor->audioFlags &= ~0x7F; + actor->audioFlags &= ~ACTOR_AUDIO_FLAG_ALL; if (actor->init != NULL) { if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { @@ -2545,7 +2571,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { actor = NULL; if (actorCtx->targetContext.unk4B != 0) { actorCtx->targetContext.unk4B = 0; - play_sound(NA_SE_SY_LOCK_OFF); + Audio_PlaySfx(NA_SE_SY_LOCK_OFF); } } @@ -2630,31 +2656,32 @@ void Actor_Draw(PlayState* play, Actor* actor) { CLOSE_DISPS(play->state.gfxCtx); } -void func_800B9D1C(Actor* actor) { +void Actor_UpdateFlaggedAudio(Actor* actor) { s32 sfxId = actor->sfxId; - if (sfxId != 0) { - if (actor->audioFlags & 2) { + if (sfxId != NA_SE_NONE) { + if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) { AudioSfx_PlaySfx(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (actor->audioFlags & 4) { - play_sound(sfxId); - } else if (actor->audioFlags & 8) { - func_8019F128(sfxId); - } else if (actor->audioFlags & 0x10) { - func_801A0810(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (sfxId - 1)); - } else if (actor->audioFlags & 1) { - Audio_PlaySfxAtPos(&actor->projectedPos, sfxId); + } else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) { + Audio_PlaySfx(sfxId); + } else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_3) { + Audio_PlaySfx_2(sfxId); + } else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_TIMER) { + Audio_PlaySfx_AtPosWithChannelIO(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (sfxId - 1)); + } else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_ACTOR_POS) { + Audio_PlaySfx_AtPos(&actor->projectedPos, sfxId); } } - if (sfxId) {} + //! FAKE: + if (sfxId != NA_SE_NONE) {} - if (actor->audioFlags & 0x40) { + if (actor->audioFlags & ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE) { func_801A1FB4(SEQ_PLAYER_BGM_SUB, &actor->projectedPos, NA_BGM_MUSIC_BOX_HOUSE, 1500.0f); } - if (actor->audioFlags & 0x20) { + if (actor->audioFlags & ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE) { func_801A1FB4(SEQ_PLAYER_BGM_MAIN, &actor->projectedPos, NA_BGM_KAMARO_DANCE, 900.0f); } } @@ -2866,8 +2893,8 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos, &actor->projectedW); - if (actor->audioFlags & 0x7F) { - func_800B9D1C(actor); + if (actor->audioFlags & ACTOR_AUDIO_FLAG_ALL) { + Actor_UpdateFlaggedAudio(actor); } if (func_800BA2D8(play, actor)) { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index acb4af20a..3703eda0f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -7403,7 +7403,7 @@ void Camera_EarthquakeDay3(Camera* camera) { if (sEarthquakeTimer != 0) { sEarthquakeTimer--; - func_8019F128(NA_SE_SY_EARTHQUAKE_OUTDOOR - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_SY_EARTHQUAKE_OUTDOOR - SFX_FLAG); } } } @@ -7869,24 +7869,24 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 forceChange) { if (camera->status == CAM_STATUS_ACTIVE) { switch (sModeChangeFlags) { case CAM_CHANGE_MODE_0: - play_sound(0); + Audio_PlaySfx(0); break; case CAM_CHANGE_MODE_1: if (camera->play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) { - play_sound(NA_SE_SY_ATTENTION_URGENCY); + Audio_PlaySfx(NA_SE_SY_ATTENTION_URGENCY); } else { - play_sound(NA_SE_SY_ATTENTION_ON); + Audio_PlaySfx(NA_SE_SY_ATTENTION_ON); } break; case CAM_CHANGE_MODE_BATTLE: - play_sound(NA_SE_SY_ATTENTION_URGENCY); + Audio_PlaySfx(NA_SE_SY_ATTENTION_URGENCY); break; case CAM_CHANGE_MODE_FOLLOW_TARGET: - play_sound(NA_SE_SY_ATTENTION_ON); + Audio_PlaySfx(NA_SE_SY_ATTENTION_ON); break; default: diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index f3f4043dd..39b57cbd0 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1534,9 +1534,9 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll if ((flags == TOUCH_SFX_NORMAL) && (collider->colType != COLTYPE_METAL)) { EffectSsHitmark_SpawnFixedScale(play, 0, hitPos); if (collider->actor == NULL) { - play_sound(NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxAtPos(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx_AtPos(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } else if (flags == TOUCH_SFX_NORMAL) { EffectSsHitmark_SpawnFixedScale(play, 3, hitPos); @@ -1548,16 +1548,16 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll } else if (flags == TOUCH_SFX_HARD) { EffectSsHitmark_SpawnFixedScale(play, 0, hitPos); if (collider->actor == NULL) { - play_sound(NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxAtPos(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx_AtPos(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } else if (flags == TOUCH_SFX_WOOD) { EffectSsHitmark_SpawnFixedScale(play, 1, hitPos); if (collider->actor == NULL) { - play_sound(NA_SE_IT_REFLECTION_WOOD); + Audio_PlaySfx(NA_SE_IT_REFLECTION_WOOD); } else { - Audio_PlaySfxAtPos(&collider->actor->projectedPos, NA_SE_IT_REFLECTION_WOOD); + Audio_PlaySfx_AtPos(&collider->actor->projectedPos, NA_SE_IT_REFLECTION_WOOD); } } } @@ -1568,13 +1568,13 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) { if ((at->actor != NULL) && (at->actor->category == ACTORCAT_PLAYER)) { if (acInfo->elemType == ELEMTYPE_UNK0) { - Audio_PlaySfxAtPos(&at->actor->projectedPos, NA_SE_IT_SWORD_STRIKE); + Audio_PlaySfx_AtPos(&at->actor->projectedPos, NA_SE_IT_SWORD_STRIKE); } else if (acInfo->elemType == ELEMTYPE_UNK1) { - Audio_PlaySfxAtPos(&at->actor->projectedPos, NA_SE_IT_SWORD_STRIKE_HARD); + Audio_PlaySfx_AtPos(&at->actor->projectedPos, NA_SE_IT_SWORD_STRIKE_HARD); } else if (acInfo->elemType == ELEMTYPE_UNK2) { - Audio_PlaySfxAtPos(&at->actor->projectedPos, 0); + Audio_PlaySfx_AtPos(&at->actor->projectedPos, 0); } else if (acInfo->elemType == ELEMTYPE_UNK3) { - Audio_PlaySfxAtPos(&at->actor->projectedPos, 0); + Audio_PlaySfx_AtPos(&at->actor->projectedPos, 0); } } return 1; @@ -1614,7 +1614,7 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atIn } else if (sHitInfo[ac->colType].effect == HIT_WOOD) { if (at->actor == NULL) { CollisionCheck_SpawnShieldParticles(play, hitPos); - play_sound(NA_SE_IT_REFLECTION_WOOD); + Audio_PlaySfx(NA_SE_IT_REFLECTION_WOOD); } else { CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &at->actor->projectedPos); } @@ -1627,9 +1627,9 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atIn } else { EffectSsHitmark_SpawnFixedScale(play, 0, hitPos); if (ac->actor == NULL) { - play_sound(NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx(NA_SE_IT_SHIELD_BOUND); } else { - Audio_PlaySfxAtPos(&ac->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); + Audio_PlaySfx_AtPos(&ac->actor->projectedPos, NA_SE_IT_SHIELD_BOUND); } } } @@ -3873,7 +3873,7 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { CollisionCheck_SpawnShieldParticles(play, v); - play_sound(NA_SE_IT_SHIELD_REFLECT_SW); + Audio_PlaySfx(NA_SE_IT_SHIELD_REFLECT_SW); } /** @@ -3881,7 +3881,7 @@ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Vec3f* pos) { CollisionCheck_SpawnShieldParticles(play, v); - Audio_PlaySfxAtPos(pos, NA_SE_IT_SHIELD_REFLECT_SW); + Audio_PlaySfx_AtPos(pos, NA_SE_IT_SHIELD_REFLECT_SW); } /** @@ -3921,7 +3921,7 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* p shieldParticleInitWood.lightPoint.z = shieldParticleInitWood.position.z; Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &shieldParticleInitWood); - Audio_PlaySfxAtPos(pos, NA_SE_IT_REFLECTION_WOOD); + Audio_PlaySfx_AtPos(pos, NA_SE_IT_REFLECTION_WOOD); } /** diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 00ee877e9..aafb26cb6 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -199,7 +199,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_EARTHQUAKE_MEDIUM: - func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 22000); @@ -260,7 +260,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { if (isFirstFrame) { play->envCtx.sandstormState = 1; } - func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_SAND_STORM - SFX_FLAG); break; case CS_MISC_SUNSSONG_START: @@ -307,7 +307,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_EARTHQUAKE_STRONG: - func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 30000); @@ -368,7 +368,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { break; case CS_MISC_EARTHQUAKE_WEAK: - func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 22000); @@ -442,15 +442,13 @@ void CutsceneCmd_StartAmbience(PlayState* play, CutsceneContext* csCtx, CsCmdSta void Cutscene_SetSfxReverbIndexTo2(PlayState* play, CutsceneContext* csCtx, CsCmdSfxReverbIndexTo2* cmd) { if (csCtx->curFrame == cmd->startFrame) { - // Audio_SetSfxReverbIndexExceptOcarinaBank - func_801A4428(2); + Audio_SetSfxReverbIndexExceptOcarinaBank(2); } } void Cutscene_SetSfxReverbIndexTo1(PlayState* play, CutsceneContext* csCtx, CsCmdSfxReverbIndexTo1* cmd) { if (csCtx->curFrame == cmd->startFrame) { - // Audio_SetSfxReverbIndexExceptOcarinaBank - func_801A4428(1); + Audio_SetSfxReverbIndexExceptOcarinaBank(1); } } @@ -840,7 +838,7 @@ void CutsceneCmd_Transition(PlayState* play, CutsceneContext* csCtx, CsCmdTransi if (cmd->type == CS_TRANS_GRAY_FILL_IN) { play->envCtx.screenFillColor[3] = 255.0f * lerp; if (lerp == 0.0f) { - func_8019F128(NA_SE_EV_S_STONE_FLASH); + Audio_PlaySfx_2(NA_SE_EV_S_STONE_FLASH); } } else { play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; @@ -1064,7 +1062,7 @@ void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) { if (play->msgCtx.choiceIndex == 0) { if (cmd->textId == 0x33BD) { // Gorman Track: do you understand? - func_8019F230(); + Audio_PlaySfx_MessageCancel(); } if (cmd->altTextId1 != 0xFFFF) { @@ -1082,7 +1080,7 @@ void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) { } else { if (cmd->textId == 0x33BD) { // Gorman Track: do you understand? - func_8019F208(); + Audio_PlaySfx_MessageDecide(); } if (cmd->altTextId2 != 0xFFFF) { diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 17852c4c1..63b6861a7 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -925,14 +925,14 @@ void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 sc // EffectSsExtra Spawn Functions -void EffectSsExtra_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scoreIdx) { +void EffectSsExtra_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scoreIndex) { EffectSsExtraInitParams initParams; Math_Vec3f_Copy(&initParams.pos, pos); Math_Vec3f_Copy(&initParams.velocity, velocity); Math_Vec3f_Copy(&initParams.accel, accel); initParams.scale = scale; - initParams.scoreIdx = scoreIdx; + initParams.scoreIndex = scoreIndex; EffectSs_Spawn(play, EFFECT_SS_EXTRA, 100, &initParams); } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 886c3c942..69fe16fdc 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -670,7 +670,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } if ((this->actor.params <= ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_RUPEE_HUGE)) { - play_sound(NA_SE_SY_GET_RUPY); + Audio_PlaySfx(NA_SE_SY_GET_RUPY); } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); @@ -678,7 +678,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } return; } else { - play_sound(NA_SE_SY_GET_ITEM); + Audio_PlaySfx(NA_SE_SY_GET_ITEM); } Flags_SetCollectible(play, this->collectibleFlag); diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c index 121957396..fce034e65 100644 --- a/src/code/z_eventmgr.c +++ b/src/code/z_eventmgr.c @@ -216,11 +216,11 @@ void CutsceneManager_End(void) { switch (csEntry->endSfx) { case CS_END_SFX_TRE_BOX_APPEAR: - play_sound(NA_SE_SY_TRE_BOX_APPEAR); + Audio_PlaySfx(NA_SE_SY_TRE_BOX_APPEAR); break; case CS_END_SFX_CORRECT_CHIME: - play_sound(NA_SE_SY_CORRECT_CHIME); + Audio_PlaySfx(NA_SE_SY_CORRECT_CHIME); break; default: // CS_END_SFX_NONE diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index ad592a40e..5ccc5987d 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -65,7 +65,7 @@ void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) { jpegCtx->scTask.framebuffer = NULL; jpegCtx->scTask.list.t = sJpegTask; - osSendMesg(&gSchedContext.cmdQ, (OSMesg)&jpegCtx->scTask, OS_MESG_BLOCK); + osSendMesg(&gSchedContext.cmdQ, (OSMesg*)&jpegCtx->scTask, OS_MESG_BLOCK); Sched_SendEntryMsg(&gSchedContext); // osScKickEntryMsg osRecvMesg(&jpegCtx->mq, NULL, OS_MESG_BLOCK); } diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 130fa88db..91c0b4a7c 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -114,7 +114,7 @@ void KaleidoSetup_Update(PlayState* play) { if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) { ShrinkWindow_Letterbox_SetSizeTarget(0); } - func_801A3AEC(1); + Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_OPEN); } } } diff --git a/src/code/z_lib.c b/src/code/z_lib.c index f3e67e5f3..553c5d133 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -639,16 +639,17 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) { dst->a = src->a; } -void func_801000A4(u16 sfxId) { - play_sound(sfxId); +void Lib_PlaySfx(u16 sfxId) { + Audio_PlaySfx(sfxId); } -void func_801000CC(u16 sfxId) { - func_8019F128(sfxId); +void Lib_PlaySfx_2(u16 sfxId) { + Audio_PlaySfx_2(sfxId); } -void Lib_PlaySfxAtPos(Vec3f* pos, u16 sfxId) { - Audio_PlaySfxAtPos(pos, sfxId); +// Unused +void Lib_PlaySfx_AtPos(Vec3f* pos, u16 sfxId) { + Audio_PlaySfx_AtPos(pos, sfxId); } void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src, Vec3f* dst) { diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index 7226a6719..5d1299bbf 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -407,7 +407,7 @@ void LifeMeter_UpdateSizeAndBeep(PlayState* play) { interfaceCtx->lifeSizeChangeDirection = 0; if (!Player_InCsMode(play) && (play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && LifeMeter_IsCritical() && !Play_InCsMode(play)) { - play_sound(NA_SE_SY_HITPOINT_ALARM); + Audio_PlaySfx(NA_SE_SY_HITPOINT_ALARM); } } } else { diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 912926cbb..c087fe059 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -230,9 +230,9 @@ void Map_Update(PlayState* play) { if ((play->pauseCtx.state <= PAUSE_STATE_OPENING_2) && (CHECK_BTN_ALL(controller->press.button, BTN_L)) && !Play_InCsMode(play) && !func_80106530(play)) { if (!R_MINIMAP_DISABLED) { - play_sound(NA_SE_SY_CAMERA_ZOOM_UP); + Audio_PlaySfx(NA_SE_SY_CAMERA_ZOOM_UP); } else { - play_sound(NA_SE_SY_CAMERA_ZOOM_DOWN); + Audio_PlaySfx(NA_SE_SY_CAMERA_ZOOM_DOWN); } R_MINIMAP_DISABLED ^= 1; diff --git a/src/code/z_message.c b/src/code/z_message.c index 03fadc9c9..cf88c60df 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -93,13 +93,13 @@ s32 Message_ShouldAdvance(PlayState* play) { if ((msgCtx->unk12020 == 0x10) || (msgCtx->unk12020 == 0x11)) { if (CHECK_BTN_ALL(controller->press.button, BTN_A)) { - play_sound(NA_SE_SY_MESSAGE_PASS); + Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS); } return CHECK_BTN_ALL(controller->press.button, BTN_A); } else { if (CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) || CHECK_BTN_ALL(controller->press.button, BTN_CUP)) { - play_sound(NA_SE_SY_MESSAGE_PASS); + Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS); } return CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) || CHECK_BTN_ALL(controller->press.button, BTN_CUP); @@ -125,7 +125,7 @@ void Message_CloseTextbox(PlayState* play) { msgCtx->stateTimer = 2; msgCtx->msgMode = 0x43; msgCtx->unk12020 = 0; - play_sound(NA_SE_NONE); + Audio_PlaySfx(NA_SE_NONE); } } @@ -147,7 +147,7 @@ void func_80148B98(PlayState* play, u8 arg1) { if (msgCtx->choiceIndex > 128) { msgCtx->choiceIndex = 0; } else { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); } return; } else if ((curInput->rel.stick_y < -29) && held == 0) { @@ -156,7 +156,7 @@ void func_80148B98(PlayState* play, u8 arg1) { if (msgCtx->choiceIndex > arg1) { msgCtx->choiceIndex = arg1; } else { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); } return; } else { @@ -422,7 +422,7 @@ u32 func_80151C9C(PlayState* play) { Message_ContinueTextbox( play, sBombersNotebookEventMessages [msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]]); - play_sound(NA_SE_SY_SCHEDULE_WRITE); + Audio_PlaySfx(NA_SE_SY_SCHEDULE_WRITE); return true; } } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 1d0faf5c6..e41e823be 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2332,7 +2332,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { (AudioVoice_GetWord() == VOICE_WORD_ID_CHEESE)) { if (!CHECK_EVENTINF(EVENTINF_41) || (CHECK_EVENTINF(EVENTINF_41) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) { - play_sound(NA_SE_SY_CAMERA_SHUTTER); + Audio_PlaySfx(NA_SE_SY_CAMERA_SHUTTER); SREG(89) = 1; play->haltAllActors = true; sPictoState = PICTO_BOX_STATE_SETUP_PHOTO; @@ -2345,13 +2345,13 @@ void Interface_UpdateButtonsPart1(PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_200; Message_CloseTextbox(play); if (play->msgCtx.choiceIndex != 0) { - func_8019F230(); + Audio_PlaySfx_MessageCancel(); func_80115844(play, DO_ACTION_STOP); Interface_SetHudVisibility(HUD_VISIBILITY_A_B); sPictoState = PICTO_BOX_STATE_LENS; REMOVE_QUEST_ITEM(QUEST_PICTOGRAPH); } else { - func_8019F208(); + Audio_PlaySfx_MessageDecide(); interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; restoreHudVisibility = true; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); @@ -3251,7 +3251,7 @@ void func_80115428(InterfaceContext* interfaceCtx, u16 doAction, s16 loadOffset) */ s32 Health_ChangeBy(PlayState* play, s16 healthChange) { if (healthChange > 0) { - play_sound(NA_SE_SY_HP_RECOVER); + Audio_PlaySfx(NA_SE_SY_HP_RECOVER); } else if (gSaveContext.save.saveInfo.playerData.doubleDefense && (healthChange < 0)) { healthChange >>= 1; } @@ -3370,7 +3370,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { // Not enough magic available to consume if ((gSaveContext.save.saveInfo.playerData.magic - magicToConsume) < 0) { if (gSaveContext.magicCapacity != 0) { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); } return false; } @@ -3391,7 +3391,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; return true; } else { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); return false; } @@ -3410,7 +3410,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3; return true; } else { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); return false; } @@ -3441,7 +3441,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2; return true; } else { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); return false; } @@ -3485,7 +3485,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { gSaveContext.save.saveInfo.playerData.magic -= magicToConsume; return true; } else { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); return false; } } @@ -3496,7 +3496,7 @@ s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) { void Magic_UpdateAddRequest(void) { if (gSaveContext.isMagicRequested) { gSaveContext.save.saveInfo.playerData.magic += 4; - play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG); + Audio_PlaySfx(NA_SE_SY_GAUGE_UP - SFX_FLAG); if (((void)0, gSaveContext.save.saveInfo.playerData.magic) >= ((void)0, gSaveContext.magicCapacity)) { gSaveContext.save.saveInfo.playerData.magic = gSaveContext.magicCapacity; @@ -3600,7 +3600,7 @@ void Magic_Update(PlayState* play) { gSaveContext.save.saveInfo.playerData.magic += 0x10; if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.sceneLayer < 4)) { - play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG); + Audio_PlaySfx(NA_SE_SY_GAUGE_UP - SFX_FLAG); } if (((void)0, gSaveContext.save.saveInfo.playerData.magic) >= ((void)0, gSaveContext.magicFillTarget)) { @@ -3656,7 +3656,7 @@ void Magic_Update(PlayState* play) { !play->actorCtx.lensActive) { // Deactivate Lens of Truth and set magic state to idle play->actorCtx.lensActive = false; - play_sound(NA_SE_SY_GLASSMODE_OFF); + Audio_PlaySfx(NA_SE_SY_GLASSMODE_OFF); gSaveContext.magicState = MAGIC_STATE_IDLE; sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255; break; @@ -5762,16 +5762,16 @@ void Interface_DrawTimers(PlayState* play) { // Use seconds to determine when to beep if (gSaveContext.timerCurTimes[sTimerId] > SECONDS_TO_TIMER(60)) { if ((sTimerBeepSfxSeconds != sTimerDigits[4]) && (sTimerDigits[4] == 1)) { - play_sound(NA_SE_SY_MESSAGE_WOMAN); + Audio_PlaySfx(NA_SE_SY_MESSAGE_WOMAN); sTimerBeepSfxSeconds = sTimerDigits[4]; } } else if (gSaveContext.timerCurTimes[sTimerId] > SECONDS_TO_TIMER(10)) { if ((sTimerBeepSfxSeconds != sTimerDigits[4]) && ((sTimerDigits[4] % 2) != 0)) { - play_sound(NA_SE_SY_WARNING_COUNT_N); + Audio_PlaySfx(NA_SE_SY_WARNING_COUNT_N); sTimerBeepSfxSeconds = sTimerDigits[4]; } } else if (sTimerBeepSfxSeconds != sTimerDigits[4]) { - play_sound(NA_SE_SY_WARNING_COUNT_E); + Audio_PlaySfx(NA_SE_SY_WARNING_COUNT_E); sTimerBeepSfxSeconds = sTimerDigits[4]; } } else { // TIMER_COUNT_UP @@ -5815,7 +5815,7 @@ void Interface_DrawTimers(PlayState* play) { (gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 0))) { if ((gSaveContext.timerCurTimes[sTimerId] > SECONDS_TO_TIMER(110)) && (sTimerBeepSfxSeconds != sTimerDigits[4])) { - play_sound(NA_SE_SY_WARNING_COUNT_E); + Audio_PlaySfx(NA_SE_SY_WARNING_COUNT_E); sTimerBeepSfxSeconds = sTimerDigits[4]; } } else if (CHECK_EVENTINF(EVENTINF_34) && (play->sceneId == SCENE_DEKUTES)) { @@ -5823,7 +5823,7 @@ void Interface_DrawTimers(PlayState* play) { (gSaveContext.save.saveInfo.dekuPlaygroundHighScores[CURRENT_DAY - 1] - SECONDS_TO_TIMER(9))) && (sTimerBeepSfxSeconds != sTimerDigits[4])) { - play_sound(NA_SE_SY_WARNING_COUNT_E); + Audio_PlaySfx(NA_SE_SY_WARNING_COUNT_E); sTimerBeepSfxSeconds = sTimerDigits[4]; } } @@ -6717,7 +6717,7 @@ void Interface_Update(PlayState* play) { gSaveContext.save.saveInfo.playerData.health += 4; if ((gSaveContext.save.saveInfo.playerData.health & 0xF) < 4) { - play_sound(NA_SE_SY_HP_RECOVER); + Audio_PlaySfx(NA_SE_SY_HP_RECOVER); } if (((void)0, gSaveContext.save.saveInfo.playerData.health) >= @@ -6750,7 +6750,7 @@ void Interface_Update(PlayState* play) { if (gSaveContext.save.saveInfo.playerData.rupees < CUR_CAPACITY(UPG_WALLET)) { gSaveContext.rupeeAccumulator--; gSaveContext.save.saveInfo.playerData.rupees++; - play_sound(NA_SE_SY_RUPY_COUNT); + Audio_PlaySfx(NA_SE_SY_RUPY_COUNT); } else { // Max rupees gSaveContext.save.saveInfo.playerData.rupees = CUR_CAPACITY(UPG_WALLET); @@ -6763,11 +6763,11 @@ void Interface_Update(PlayState* play) { if (gSaveContext.save.saveInfo.playerData.rupees < 0) { gSaveContext.save.saveInfo.playerData.rupees = 0; } - play_sound(NA_SE_SY_RUPY_COUNT); + Audio_PlaySfx(NA_SE_SY_RUPY_COUNT); } else { gSaveContext.rupeeAccumulator++; gSaveContext.save.saveInfo.playerData.rupees--; - play_sound(NA_SE_SY_RUPY_COUNT); + Audio_PlaySfx(NA_SE_SY_RUPY_COUNT); } } else { gSaveContext.rupeeAccumulator = 0; @@ -6800,9 +6800,9 @@ void Interface_Update(PlayState* play) { interfaceCtx->minigameState++; if (interfaceCtx->minigameState == MINIGAME_STATE_COUNTDOWN_GO) { interfaceCtx->minigameCountdownScale = 160; - play_sound(NA_SE_SY_START_SHOT); + Audio_PlaySfx(NA_SE_SY_START_SHOT); } else { - play_sound(NA_SE_SY_WARNING_COUNT_E); + Audio_PlaySfx(NA_SE_SY_WARNING_COUNT_E); } break; diff --git a/src/code/z_play.c b/src/code/z_play.c index c2552be01..f39260524 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -825,7 +825,7 @@ void Play_UpdateTransition(PlayState* this) { break; case TRANS_MODE_SANDSTORM: - func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_SAND_STORM - SFX_FLAG); if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA < 110) { gTransitionTileState = TRANS_TILE_OFF; @@ -860,7 +860,7 @@ void Play_UpdateTransition(PlayState* this) { break; case TRANS_MODE_SANDSTORM_END: - func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG); + Audio_PlaySfx_2(NA_SE_EV_SAND_STORM - SFX_FLAG); if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA <= 0) { @@ -1065,7 +1065,7 @@ void Play_Update(PlayState* this) { this->msgCtx.msgMode = 0; this->msgCtx.currentTextId = 0; this->msgCtx.stateTimer = 0; - play_sound(NA_SE_SY_CANCEL); + Audio_PlaySfx(NA_SE_SY_CANCEL); } if (sBombersNotebookOpen) { BombersNotebook_Update(this, &sBombersNotebook, this->state.input); diff --git a/src/code/z_play_hireso.c b/src/code/z_play_hireso.c index 24dcaca55..2a182411b 100644 --- a/src/code/z_play_hireso.c +++ b/src/code/z_play_hireso.c @@ -371,8 +371,8 @@ void BombersNotebook_DrawColumns(Gfx** gfxP) { TexturePtr sBombersNotebookEventIconTextures[] = { gBombersNotebookEntryIconExclamationPointTex, - schedule_dma_static_yar_Blob_00AC00, - schedule_dma_static_yar_Blob_00AEA0, + gBombersNotebookEntryIconMaskTex, + gBombersNotebookEntryIconRibbonTex, }; s16 sBombersNotebookEntryIconColors[][3] = { { 255, 255, 0 }, @@ -550,7 +550,7 @@ void BombersNotebook_DrawEntries(Gfx** gfxP, s32 row, u32 rectTop) { *gfxP = gfx; } -#define DEFINE_PERSON(_enum, photo, _description, _metEnum, _metMessage, _metFlag) &photo, +#define DEFINE_PERSON(_enum, photo, _description, _metEnum, _metMessage, _metFlag) photo, TexturePtr sBombersNotebookPhotoTextures[] = { #include "tables/bombers_notebook/person_table.h" @@ -1223,13 +1223,13 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input while (true) { cursorEntryScan -= BOMBERS_NOTEBOOK_ENTRY_SIZE; if (cursorEntryScan == 0) { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); break; } if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( this->cursorPageRow + this->cursorPage, cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); break; } } @@ -1238,7 +1238,7 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( this->cursorPageRow + this->cursorPage, cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); break; } } @@ -1250,7 +1250,7 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input if (CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_ENTRY_GET_EVENT( this->cursorPageRow + this->cursorPage, cursorEntryScan - BOMBERS_NOTEBOOK_ENTRY_SIZE)])) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); break; } } while (cursorEntryScan != 0); @@ -1276,7 +1276,7 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input if (stickAdjY < -30) { if (this->cursorPageRow < 3) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); this->cursorEntry = 0; this->cursorPageRow++; } else if (this->cursorPage < (BOMBERS_NOTEBOOK_PERSON_MAX - 4)) { @@ -1290,11 +1290,11 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input } } else if (stickAdjY > 30) { if (this->cursorPageRow > 0) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); this->cursorEntry = 0; this->cursorPageRow--; } else if (this->cursorPage != 0) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); this->cursorPage--; if (sStickYRepeatState == 1) { this->scrollAmount = 24; @@ -1308,7 +1308,7 @@ void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input } else if (this->scrollAmount < 0) { this->scrollOffset += this->scrollAmount; if (ABS_ALT(this->scrollOffset) >= 48) { - play_sound(NA_SE_SY_CURSOR); + Audio_PlaySfx(NA_SE_SY_CURSOR); this->scrollOffset = 0; this->scrollAmount = 0; this->cursorPage++; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 2e2d2222d..4654158f9 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -637,7 +637,7 @@ PlayerItemAction func_80123810(PlayState* play) { Interface_SetHudVisibility(play->msgCtx.unk_120BC); if ((itemId >= ITEM_FD) || ((itemAction = play->unk_18794(play, player, itemId)) <= PLAYER_IA_MINUS1)) { - play_sound(NA_SE_SY_ERROR); + Audio_PlaySfx(NA_SE_SY_ERROR); return PLAYER_IA_MINUS1; } else { s32 pad; diff --git a/src/code/z_sound_source.c b/src/code/z_sound_source.c index 4962f7072..3a5a31c59 100644 --- a/src/code/z_sound_source.c +++ b/src/code/z_sound_source.c @@ -21,7 +21,7 @@ void SoundSource_UpdateAll(PlayState* play) { } else { SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos); if (source->playSfxEachFrame) { - Audio_PlaySfxAtPos(&source->projectedPos, source->sfxId); + Audio_PlaySfx_AtPos(&source->projectedPos, source->sfxId); } } } @@ -64,7 +64,7 @@ void SoundSource_Add(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId, source->sfxId = sfxId; SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos); - Audio_PlaySfxAtPos(&source->projectedPos, sfxId); + Audio_PlaySfx_AtPos(&source->projectedPos, sfxId); } void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId) { diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index f03d38e45..79f2d7043 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -112,8 +112,9 @@ u16 sPersistentCycleWeekEventRegs[ARRAY_COUNT(gSaveContext.save.saveInfo.weekEve PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_31_01) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_31_02) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_31_04) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_31_20), /* 32 */ - PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_32_01) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_32_02) | - PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_32_04), + PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_32_01) | + PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWAMP_SHOOTING_GALLERY_HEART_PIECE) | + PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_TOWN_SHOOTING_GALLERY_HEART_PIECE), /* 33 */ 0, /* 34 */ 0, /* 35 */ @@ -146,7 +147,8 @@ u16 sPersistentCycleWeekEventRegs[ARRAY_COUNT(gSaveContext.save.saveInfo.weekEve /* 58 */ 0, /* 59 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_59_04) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_59_08) | - PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_59_10) | PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_59_20), + PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_SWAMP_SHOOTING_GALLERY_QUIVER_UPGRADE) | + PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_TOWN_SHOOTING_GALLERY_QUIVER_UPGRADE), /* 60 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_60_10), /* 61 */ 0, /* 62 */ 0, |
