From d8f8b6e6b93af484f015b29ae5304afdaa6e28a1 Mon Sep 17 00:00:00 2001 From: Archez Date: Mon, 4 Nov 2024 22:07:21 -0500 Subject: [PATCH 01/11] Fix Bluewarp handling with entrance rando (#4517) * force bluewarp skips on when entrance rando is enabled * Fix second visits and other issues with lingering bluewarp state --- .../SkipCutscene/Story/SkipBlueWarp.cpp | 51 +++++++++++++------ .../randomizer/randomizer_entrance.c | 32 ++++++------ .../randomizer/randomizer_grotto.c | 4 ++ 3 files changed, 54 insertions(+), 33 deletions(-) diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index e94556aac..0bb65a8de 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -3,35 +3,43 @@ #include "soh/OTRGlobals.h" extern "C" { - #include "macros.h" - #include "src/overlays/actors/ovl_En_Ko/z_en_ko.h" - #include "z64save.h" - #include "functions.h" - #include "variables.h" +#include "macros.h" +#include "src/overlays/actors/ovl_En_Ko/z_en_ko.h" +#include "z64save.h" +#include "functions.h" +#include "variables.h" } #define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).GetSelectedOptionIndex() +static bool sEnteredBlueWarp = false; + /** * This will override the transitions into the blue warp cutscenes, set any appropriate flags, and * set the entrance index to where you would normally end up after the blue warp cutscene. This * should also account for the difference between your first and following visits to the blue warp. */ void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - uint8_t isBlueWarpCutscene = 0; + bool overrideBlueWarpDestinations = + IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || + RAND_GET_OPTION(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF); + + // Force blue warp skip on when ER needs to place Link somewhere else. + // This is preferred over having story cutscenes play in the overworld and then reloading Link somewhere else after. + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO) || overrideBlueWarpDestinations) { + bool isBlueWarpCutscene = false; // Deku Tree Blue warp if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.cutsceneIndex == 0xFFF1) { gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Dodongo's Cavern Blue warp } else if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_BOTTOM_EXIT && gSaveContext.cutsceneIndex == 0xFFF1) { gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_TRAIL_DODONGO_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Jabu Jabu's Blue warp } else if (gSaveContext.entranceIndex == ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP && gSaveContext.cutsceneIndex == 0xFFF0) { gSaveContext.entranceIndex = ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Forest Temple Blue warp } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && gSaveContext.chamberCutsceneNum == CHAMBER_CS_FOREST) { // Normally set in the blue warp cutscene @@ -43,14 +51,14 @@ void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_l gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_12; } - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Fire Temple Blue warp } else if (gSaveContext.entranceIndex == ENTR_KAKARIKO_VILLAGE_FRONT_GATE && gSaveContext.cutsceneIndex == 0xFFF3) { // Normally set in the blue warp cutscene Flags_SetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED); gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_CRATER_FIRE_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Water Temple Blue warp } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && gSaveContext.chamberCutsceneNum == CHAMBER_CS_WATER) { // Normally set in the blue warp cutscene @@ -58,15 +66,15 @@ void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_l Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); gSaveContext.entranceIndex = ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Spirit Temple Blue warp } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && gSaveContext.chamberCutsceneNum == CHAMBER_CS_SPIRIT) { gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_SPIRIT_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; // Shadow Temple Blue warp } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && gSaveContext.chamberCutsceneNum == CHAMBER_CS_SHADOW) { gSaveContext.entranceIndex = ENTR_GRAVEYARD_SHADOW_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = 1; + isBlueWarpCutscene = true; } if (isBlueWarpCutscene) { @@ -80,10 +88,20 @@ void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_l } // This is outside the above condition because we want to handle both first and following visits to the blue warp - if (IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || RAND_GET_OPTION(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) { + if (sEnteredBlueWarp && overrideBlueWarpDestinations) { Entrance_OverrideBlueWarp(); } } + + sEnteredBlueWarp = false; +} + +/** + * Using this hook to simply observe that Link has entered a bluewarp + * This way we know to allow entrance rando overrides to be processed on the next tranisition hook + */ +void SkipBlueWarp_ShouldPlayBlueWarpCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { + sEnteredBlueWarp = true; } /** @@ -143,6 +161,7 @@ void SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished(GIVanillaBehavior _, void SkipBlueWarp_Register() { GameInteractor::Instance->RegisterGameHookForID(ACTOR_EN_KO, SkipBlueWarp_OnActorUpdate); GameInteractor::Instance->RegisterGameHookForID(VB_PLAY_TRANSITION_CS, SkipBlueWarp_ShouldPlayTransitionCS); + GameInteractor::Instance->RegisterGameHookForID(VB_PLAY_BLUE_WARP_CS, SkipBlueWarp_ShouldPlayBlueWarpCS); GameInteractor::Instance->RegisterGameHookForID(VB_DEKU_JR_CONSIDER_FOREST_TEMPLE_FINISHED, SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished); GameInteractor::Instance->RegisterGameHookForID(VB_GIVE_ITEM_FROM_BLUE_WARP, SkipBlueWarp_ShouldGiveItem); } diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index e441f3aa5..5c0f8971f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -198,7 +198,7 @@ void Entrance_Init(void) { bossSceneSaveDeathWarps[bossScene - SCENE_DEKU_TREE_BOSS] = saveWarpEntrance; } - //Overwrite grotto related indices + // Overwrite grotto related indices if (originalIndex >= ENTRANCE_GROTTO_EXIT_START) { Grotto_SetExitOverride(originalIndex, overrideIndex); continue; @@ -226,7 +226,7 @@ void Entrance_Init(void) { s16 indicesToSilenceBackgroundMusic[2] = { // The lost woods music playing near the GC Woods Warp keeps playing - // in the next area if the bvackground music is allowed to keep playing + // in the next area if the background music is allowed to keep playing entranceOverrideTable[ENTR_LOST_WOODS_TUNNEL_SHORTCUT], // Goron City -> Lost Woods override // If Malon is singing at night, then her singing will be transferred @@ -452,7 +452,19 @@ void Entrance_SetWarpSongEntrance(void) { } void Entrance_OverrideBlueWarp(void) { - // Handles first time entering bluewarp (with item give) + // Remap child 2nd visits in adult dungeons for warp pad -> bluewarp + if (gSaveContext.entranceIndex == ENTR_SACRED_FOREST_MEADOW_WARP_PAD) { + gSaveContext.entranceIndex = ENTR_SACRED_FOREST_MEADOW_FOREST_TEMPLE_BLUE_WARP; + } else if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_CRATER_WARP_PAD) { + gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_CRATER_FIRE_TEMPLE_BLUE_WARP; + } else if (gSaveContext.entranceIndex == ENTR_LAKE_HYLIA_WARP_PAD) { + gSaveContext.entranceIndex = ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP; + } else if (gSaveContext.entranceIndex == ENTR_DESERT_COLOSSUS_WARP_PAD) { + gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_SPIRIT_TEMPLE_BLUE_WARP; + } else if (gSaveContext.entranceIndex == ENTR_GRAVEYARD_WARP_PAD) { + gSaveContext.entranceIndex = ENTR_GRAVEYARD_SHADOW_TEMPLE_BLUE_WARP; + } + switch (gSaveContext.entranceIndex) { case ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP: // Gohma blue warp case ENTR_DEATH_MOUNTAIN_TRAIL_DODONGO_BLUE_WARP: // KD blue warp @@ -465,20 +477,6 @@ void Entrance_OverrideBlueWarp(void) { gSaveContext.entranceIndex = Entrance_OverrideNextIndex(gSaveContext.entranceIndex); return; } - - // Handles second+ times entering bluewarp - switch (gPlayState->nextEntranceIndex) { - case ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP: // Gohma blue warp - case ENTR_DEATH_MOUNTAIN_TRAIL_DODONGO_BLUE_WARP: // KD blue warp - case ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP: // Barinade blue warp - case ENTR_SACRED_FOREST_MEADOW_FOREST_TEMPLE_BLUE_WARP: // Phantom Ganon blue warp - case ENTR_DEATH_MOUNTAIN_CRATER_FIRE_TEMPLE_BLUE_WARP: // Volvagia blue warp - case ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP: // Morpha blue warp - case ENTR_DESERT_COLOSSUS_SPIRIT_TEMPLE_BLUE_WARP: // Bongo-Bongo blue warp - case ENTR_GRAVEYARD_SHADOW_TEMPLE_BLUE_WARP: // Twinrova blue warp - gPlayState->nextEntranceIndex = Entrance_OverrideNextIndex(gPlayState->nextEntranceIndex); - return; - } } void Entrance_EnableFW(void) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index be10e5ec4..cb8eacb1a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -99,6 +99,10 @@ void Grotto_InitExitAndLoadLists(void) { grottoLoadList[i] = ENTRANCE_GROTTO_LOAD_START + i; grottoExitList[i] = ENTRANCE_GROTTO_EXIT_START + i; } + + grottoId = 0xFF; + lastEntranceType = NOT_GROTTO; + overridingNextEntrance = false; } void Grotto_SetExitOverride(s16 originalIndex, s16 overrideIndex) { From 894d3c00d394afbfeabce581afe435d86840885c Mon Sep 17 00:00:00 2001 From: Malkierian Date: Mon, 4 Nov 2024 20:16:27 -0700 Subject: [PATCH 02/11] Change `ENTR_BOMBCHU_SHOP_0` to `ENTR_BOMBCHU_SHOP_1` in entrance.cpp to fix interior shuffle crash. (#4521) --- soh/soh/Enhancements/randomizer/entrance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/entrance.cpp b/soh/soh/Enhancements/randomizer/entrance.cpp index 4866c4f4a..bc9cb5513 100644 --- a/soh/soh/Enhancements/randomizer/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/entrance.cpp @@ -923,7 +923,7 @@ int EntranceShuffler::ShuffleAllEntrances() { { EntranceType::Interior, RR_MARKET_POTION_SHOP, RR_THE_MARKET, ENTR_MARKET_DAY_OUTSIDE_POTION_SHOP } }, { { EntranceType::Interior, RR_THE_MARKET, RR_MARKET_TREASURE_CHEST_GAME, ENTR_TREASURE_BOX_SHOP_0 }, { EntranceType::Interior, RR_MARKET_TREASURE_CHEST_GAME, RR_THE_MARKET, ENTR_MARKET_DAY_OUTSIDE_TREASURE_BOX_SHOP } }, - { { EntranceType::Interior, RR_MARKET_BACK_ALLEY, RR_MARKET_BOMBCHU_SHOP, ENTR_BOMBCHU_SHOP_0 }, + { { EntranceType::Interior, RR_MARKET_BACK_ALLEY, RR_MARKET_BOMBCHU_SHOP, ENTR_BOMBCHU_SHOP_1 }, { EntranceType::Interior, RR_MARKET_BOMBCHU_SHOP, RR_MARKET_BACK_ALLEY, ENTR_BACK_ALLEY_DAY_OUTSIDE_BOMBCHU_SHOP } }, { { EntranceType::Interior, RR_MARKET_BACK_ALLEY, RR_MARKET_MAN_IN_GREEN_HOUSE, ENTR_BACK_ALLEY_MAN_IN_GREEN_HOUSE }, { EntranceType::Interior, RR_MARKET_MAN_IN_GREEN_HOUSE, RR_MARKET_BACK_ALLEY, ENTR_BACK_ALLEY_DAY_OUTSIDE_MAN_IN_GREEN_HOUSE } }, From dabd0c25bd716a2ec37ec0137881a61045b03c02 Mon Sep 17 00:00:00 2001 From: Archez Date: Tue, 5 Nov 2024 21:50:59 -0500 Subject: [PATCH 03/11] Move collision viewer draw to hook and fix empty nametags (#4523) --- soh/soh/Enhancements/debugger/colViewer.cpp | 13 ++++++++----- soh/soh/Enhancements/nametag.cpp | 2 +- soh/src/code/graph.c | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 8ce5f8b50..5139576ce 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -8,6 +8,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { #include @@ -276,11 +277,6 @@ void CreateSphereData() { sphereGfx.push_back(gsSPEndDisplayList()); } -void ColViewerWindow::InitElement() { - CreateCylinderData(); - CreateSphereData(); -} - // Initializes the display list for a ColRenderSetting void InitGfx(std::vector& gfx, ColRenderSetting setting) { uint32_t rm; @@ -689,3 +685,10 @@ extern "C" void DrawColViewer() { CLOSE_DISPS(gPlayState->state.gfxCtx); } + +void ColViewerWindow::InitElement() { + CreateCylinderData(); + CreateSphereData(); + + GameInteractor::Instance->RegisterGameHook(DrawColViewer); +} diff --git a/soh/soh/Enhancements/nametag.cpp b/soh/soh/Enhancements/nametag.cpp index 8435b6b26..fa88c9aeb 100644 --- a/soh/soh/Enhancements/nametag.cpp +++ b/soh/soh/Enhancements/nametag.cpp @@ -201,7 +201,7 @@ extern "C" void NameTag_RegisterForActorWithOptions(Actor* actor, const char* te processedText.erase(std::remove_if(processedText.begin(), processedText.end(), [](const char& c) { // 172 is max supported texture for the in-game font system, // and filter anything less than a space but not the newline or nul characters - return c > (s8)172 || (c < ' ' && c != '\n' && c != '\0'); + return (unsigned char)c > 172 || (c < ' ' && c != '\n' && c != '\0'); }), processedText.end()); int16_t numChar = processedText.length(); diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c index 6a49117dd..f691c2619 100644 --- a/soh/src/code/graph.c +++ b/soh/src/code/graph.c @@ -300,7 +300,6 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { GameState_ReqPadData(gameState); GameState_Update(gameState); - DrawColViewer(); OPEN_DISPS(gfxCtx); From a919b6a5a0f938fac5cff4c55eb5412a60569ec4 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Wed, 6 Nov 2024 21:38:44 -0500 Subject: [PATCH 04/11] Fix skipping Adult Ruto one-point cutscene (#4519) * Fix skipping Adult Ruto one-point cutscene * Kill Ruto's actor instead of leaving her to swim up * Change to Story cutscene * Change to extern function --- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 3e1bc9de1..4907edaa2 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -14,6 +14,7 @@ extern "C" { #include "src/overlays/actors/ovl_En_Owl/z_en_owl.h" #include "src/overlays/actors/ovl_En_Ko/z_en_ko.h" #include "src/overlays/actors/ovl_En_Ma1/z_en_ma1.h" +#include "src/overlays/actors/ovl_En_Ru2/z_en_ru2.h" #include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h" #include "src/overlays/actors/ovl_En_Box/z_en_box.h" #include "src/overlays/actors/ovl_Demo_Im/z_demo_im.h" @@ -33,6 +34,8 @@ extern "C" { extern SaveContext gSaveContext; extern PlayState* gPlayState; extern int32_t D_8011D3AC; + +extern void func_80AF36EC(EnRu2* enRu2, PlayState* play); } #define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).GetSelectedOptionIndex() @@ -813,6 +816,15 @@ void TimeSaverOnActorInitHandler(void* actorRef) { Actor_Kill(actor); } } + + // Water Temple Ruto cutscene + if (actor->id == ACTOR_EN_RU2 && gPlayState->sceneNum == SCENE_WATER_TEMPLE) { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { + EnRu2* enRu2 = (EnRu2*)actor; + func_80AF36EC(enRu2, gPlayState); + Actor_Kill(actor); + } + } } void TimeSaverOnSceneInitHandler(int16_t sceneNum) { From d07cbe839584b2111edf47fd2e759b1fd5cd6fb5 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Wed, 6 Nov 2024 20:38:57 -0600 Subject: [PATCH 05/11] Adjustments to change age cheat and time travel enhancement (#4512) --- .../game-interactor/GameInteractor.h | 1 + soh/soh/Enhancements/mods.cpp | 100 +++++++----------- soh/soh/Enhancements/mods.h | 1 + soh/soh/Enhancements/presets.h | 2 - soh/soh/SohMenuBar.cpp | 2 +- soh/src/code/z_parameter.c | 4 +- .../actors/ovl_player_actor/z_player.c | 2 +- 7 files changed, 46 insertions(+), 66 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 15a74b181..61cfbe72e 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -342,6 +342,7 @@ typedef enum { VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE, VB_GIVE_RANDO_FISHING_PRIZE, VB_PLAY_THROW_ANIMATION, + VB_INFLICT_VOID_DAMAGE, /*** Give Items ***/ diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 9a0e80a51..9ecc0e163 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -64,15 +64,6 @@ static const ALIGN_ASSET(2) char tokinoma_room_0DL_007A70[] = dtokinoma_room_0DL #define dtokinoma_room_0DL_007FD0 "__OTR__scenes/shared/tokinoma_scene/tokinoma_room_0DL_007FD0" static const ALIGN_ASSET(2) char tokinoma_room_0DL_007FD0[] = dtokinoma_room_0DL_007FD0; -// TODO: When there's more uses of something like this, create a new GI::RawAction? -void ReloadSceneTogglingLinkAge() { - gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; - gPlayState->transitionTrigger = TRANS_TRIGGER_START; - gPlayState->transitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST); // Fade Out - gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST); - gPlayState->linkAgeOnLoad ^= 1; // toggle linkAgeOnLoad -} - void RegisterInfiniteMoney() { GameInteractor::Instance->RegisterGameHook([]() { if (!GameInteractor::IsSaveLoaded(true)) return; @@ -219,42 +210,43 @@ void RegisterFreezeTime() { } /// Switches Link's age and respawns him at the last entrance he entered. -void RegisterSwitchAge() { - GameInteractor::Instance->RegisterGameHook([]() { - static bool warped = false; +void SwitchAge() { + if (gPlayState == NULL) return; - if (!GameInteractor::IsSaveLoaded(true)) { - CVarClear(CVAR_GENERAL("SwitchAge")); - warped = false; - return; + Player* player = GET_PLAYER(gPlayState); + + // Hyrule Castle: Very likely to fall through floor, so we force a specific entrance + if (gPlayState->sceneNum == SCENE_HYRULE_CASTLE || gPlayState->sceneNum == SCENE_OUTSIDE_GANONS_CASTLE) { + gPlayState->nextEntranceIndex = ENTR_CASTLE_GROUNDS_SOUTH_EXIT; + } else { + gSaveContext.respawnFlag = 1; + gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; + + // Preserve the player's position and orientation + gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = gPlayState->nextEntranceIndex; + gSaveContext.respawn[RESPAWN_MODE_DOWN].roomIndex = gPlayState->roomCtx.curRoom.num; + gSaveContext.respawn[RESPAWN_MODE_DOWN].pos = player->actor.world.pos; + gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw = player->actor.shape.rot.y; + + if (gPlayState->roomCtx.curRoom.behaviorType2 < 4) { + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = 0x0DFF; + } else { + // Scenes with static backgrounds use a special camera we need to preserve + Camera* camera = GET_ACTIVE_CAM(gPlayState); + s16 camId = camera->camDataIdx; + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = 0x0D00 | camId; } + } - static Vec3f playerPos; - static int16_t playerYaw; - static RoomContext* roomCtx; - static s32 roomNum; + gPlayState->transitionTrigger = TRANS_TRIGGER_START; + gPlayState->transitionType = TRANS_TYPE_INSTANT; + gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK_FAST; + gPlayState->linkAgeOnLoad ^= 1; - if (CVarGetInteger(CVAR_GENERAL("SwitchAge"), 0) && !warped) { - playerPos = GET_PLAYER(gPlayState)->actor.world.pos; - playerYaw = GET_PLAYER(gPlayState)->actor.shape.rot.y; - roomCtx = &gPlayState->roomCtx; - roomNum = roomCtx->curRoom.num; - ReloadSceneTogglingLinkAge(); - warped = true; - } - - if (warped && gPlayState->transitionTrigger != TRANS_TRIGGER_START && - gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) { - GET_PLAYER(gPlayState)->actor.shape.rot.y = playerYaw; - GET_PLAYER(gPlayState)->actor.world.pos = playerPos; - if (roomNum != roomCtx->curRoom.num) { - func_8009728C(gPlayState, roomCtx, roomNum); //load original room - //func_800973FC(gPlayState, &gPlayState->roomCtx); // commit to room load? - func_80097534(gPlayState, roomCtx); // load map for new room (unloading the previous room) - } - warped = false; - CVarClear(CVAR_GENERAL("SwitchAge")); - } + static HOOK_ID hookId = 0; + hookId = REGISTER_VB_SHOULD(VB_INFLICT_VOID_DAMAGE, { + *should = false; + GameInteractor::Instance->UnregisterGameHookForID(hookId); }); } @@ -262,8 +254,7 @@ void RegisterSwitchAge() { void RegisterOcarinaTimeTravel() { GameInteractor::Instance->RegisterGameHook([]() { - if (!GameInteractor::IsSaveLoaded(true)) { - CVarClear(CVAR_ENHANCEMENT("TimeTravel")); + if (!GameInteractor::IsSaveLoaded(true) || !CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0)) { return; } @@ -273,22 +264,14 @@ void RegisterOcarinaTimeTravel() { Actor* nearbyOcarinaSpot = Actor_FindNearby(gPlayState, player, ACTOR_EN_OKARINA_TAG, ACTORCAT_PROP, 120.0f); Actor* nearbyDoorOfTime = Actor_FindNearby(gPlayState, player, ACTOR_DOOR_TOKI, ACTORCAT_BG, 500.0f); Actor* nearbyFrogs = Actor_FindNearby(gPlayState, player, ACTOR_EN_FR, ACTORCAT_NPC, 300.0f); - uint8_t hasMasterSword = CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER); - uint8_t hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME); - // If TimeTravel + Player have the Ocarina of Time + Have Master Sword + is in proper range + bool justPlayedSoT = gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME; + bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime && !nearbyFrogs; + bool hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME); + bool doesntNeedOcarinaOfTime = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 2; + bool hasMasterSword = CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER); // TODO: Once Swordless Adult is fixed: Remove the Master Sword check - if (((CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 1 && hasOcarinaOfTime) || CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 2) && hasMasterSword && - gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME && !nearbyTimeBlockEmpty && !nearbyTimeBlock && - !nearbyOcarinaSpot && !nearbyFrogs) { - - if (IS_RANDO) { - CVarSetInteger(CVAR_GENERAL("SwitchTimeline"), 1); - } else if (!IS_RANDO && !nearbyDoorOfTime) { - // This check is made for when Link is learning the Song Of Time in a vanilla save file that load a - // Temple of Time scene where the only object present is the Door of Time - CVarSetInteger(CVAR_GENERAL("SwitchTimeline"), 1); - } - ReloadSceneTogglingLinkAge(); + if (justPlayedSoT && notNearAnySource && (hasOcarinaOfTime || doesntNeedOcarinaOfTime) && hasMasterSword) { + SwitchAge(); } }); } @@ -1429,7 +1412,6 @@ void InitMods() { RegisterEzQPA(); RegisterUnrestrictedItems(); RegisterFreezeTime(); - RegisterSwitchAge(); RegisterOcarinaTimeTravel(); RegisterAutoSave(); RegisterDaytimeGoldSkultullas(); diff --git a/soh/soh/Enhancements/mods.h b/soh/soh/Enhancements/mods.h index b70cda286..930522250 100644 --- a/soh/soh/Enhancements/mods.h +++ b/soh/soh/Enhancements/mods.h @@ -17,6 +17,7 @@ void UpdateHyperEnemiesState(); void UpdateHyperBossesState(); void InitMods(); void UpdatePatchHand(); +void SwitchAge(); #ifdef __cplusplus } diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index d39e5cc7e..6543e1a7c 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -353,8 +353,6 @@ const std::vector cheatCvars = { CVAR_DEVELOPER_TOOLS("SaveFileID"), CVAR_CHEAT("EnableBetaQuest"), CVAR_DEVELOPER_TOOLS("BetterDebugWarpScreen"), - CVAR_GENERAL("SwitchAge"), - CVAR_GENERAL("SwitchTimeline"), CVAR_CHEAT("NoRedeadFreeze"), CVAR_CHEAT("NoKeeseGuayTarget"), CVAR_CHEAT("BombTimerMultiplier"), diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index bec69cceb..71336671b 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1743,7 +1743,7 @@ void DrawCheatsMenu() { UIWidgets::EnhancementSliderFloat("Hookshot Reach Multiplier: %.2fx", "##gCheatHookshotReachMultiplier", CVAR_CHEAT("HookshotReachMultiplier"), 1.0f, 5.0f, "", 1.0f, false); UIWidgets::Spacer(2.0f); if (ImGui::Button("Change Age")) { - CVarSetInteger(CVAR_GENERAL("SwitchAge"), 1); + SwitchAge(); } UIWidgets::Tooltip("Switches Link's age and reloads the area."); UIWidgets::Spacer(2.0f); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index b519c84a3..6227a8b4b 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1607,10 +1607,8 @@ void Inventory_SwapAgeEquipment(void) { s16 i; u16 shieldEquipValue; - // Mod Enhancments can utilise the rando flow path - if (IS_RANDO || CVarGetInteger(CVAR_GENERAL("SwitchAge"), 0) || CVarGetInteger(CVAR_GENERAL("SwitchTimeline"), 0)) { + if (IS_RANDO) { Rando_Inventory_SwapAgeEquipment(); - CVarSetInteger(CVAR_GENERAL("SwitchTimeline"), 0); return; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 4d4e9480d..c11609c5d 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -10811,7 +10811,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { if (respawnFlag == -3) { thisx->params = gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams; } else { - if ((respawnFlag == 1) || (respawnFlag == -1)) { + if (GameInteractor_Should(VB_INFLICT_VOID_DAMAGE, (respawnFlag == 1) || (respawnFlag == -1), respawnFlag)) { this->unk_A86 = -2; } From 1d9d273a575730d56e592674836c70656660486c Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:51:29 +0000 Subject: [PATCH 06/11] Rewrite MQ Water Temple Logic (#4520) * Rewrite Storage Temple Logic * fix a boss room oversight * Fix some random errors * cleanups --- .../location_access/locacc_water_temple.cpp | 468 +++++++++++++++--- soh/soh/Enhancements/randomizer/logic.cpp | 75 ++- soh/soh/Enhancements/randomizer/logic.h | 16 +- .../Enhancements/randomizer/randomizerTypes.h | 56 ++- soh/soh/Enhancements/randomizer/settings.cpp | 1 + 5 files changed, 546 insertions(+), 70 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp index a02e51e83..3a2559474 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp @@ -10,9 +10,9 @@ void RegionTable_Init_WaterTemple() { ---------------------------*/ areaTable[RR_WATER_TEMPLE_ENTRYWAY] = Region("Water Temple Entryway", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { //Exits - Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->HasItem(RG_BRONZE_SCALE) && ctx->GetDungeon(WATER_TEMPLE)->IsVanilla();}}), - Entrance(RR_WATER_TEMPLE_MQ_LOBBY, {[]{return logic->HasItem(RG_BRONZE_SCALE) && ctx->GetDungeon(WATER_TEMPLE)->IsMQ();}}), - Entrance(RR_LAKE_HYLIA, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->HasItem(RG_BRONZE_SCALE) && ctx->GetDungeon(WATER_TEMPLE)->IsVanilla();}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->HasItem(RG_BRONZE_SCALE) && ctx->GetDungeon(WATER_TEMPLE)->IsMQ();}}), + Entrance(RR_LAKE_HYLIA, {[]{return true;}}), }); /*-------------------------- @@ -23,29 +23,29 @@ void RegionTable_Init_WaterTemple() { areaTable[RR_WATER_TEMPLE_LOBBY] = Region("Water Temple Lobby", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { //Exits Entrance(RR_WATER_TEMPLE_ENTRYWAY, {[]{return true;}}), - Entrance(RR_WATER_TEMPLE_EAST_LOWER, {[]{return logic->WaterTempleLow || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && (logic->CanUse(RG_IRON_BOOTS) || (logic->CanUse(RG_LONGSHOT) && ctx->GetTrickOption(RT_WATER_LONGSHOT_TORCH))));}}), - Entrance(RR_WATER_TEMPLE_NORTH_LOWER, {[]{return logic->WaterTempleLow || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && logic->CanUse(RG_IRON_BOOTS));}}), - Entrance(RR_WATER_TEMPLE_SOUTH_LOWER, {[]{return logic->WaterTempleLow && logic->HasExplosives() && (logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS)) && (ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC));}}), - Entrance(RR_WATER_TEMPLE_WEST_LOWER, {[]{return logic->WaterTempleLow && logic->HasItem(RG_GORONS_BRACELET) && (logic->IsChild || logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS)) && (ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC));}}), - Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_LOWER, {[]{return logic->WaterTempleLow && logic->SmallKeys(RR_WATER_TEMPLE, 5);}}), - Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_UPPER, {[]{return (logic->WaterTempleLow || logic->WaterTempleMiddle) && (logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW));}}), - Entrance(RR_WATER_TEMPLE_EAST_MIDDLE, {[]{return (logic->WaterTempleLow || logic->WaterTempleMiddle || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16)) && logic->CanUse(RG_HOOKSHOT);}}), - Entrance(RR_WATER_TEMPLE_WEST_MIDDLE, {[]{return logic->WaterTempleMiddle;}}), + Entrance(RR_WATER_TEMPLE_EAST_LOWER, {[]{return logic->CanWaterTempleLowFromHigh || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && (logic->CanUse(RG_IRON_BOOTS) || (logic->CanUse(RG_LONGSHOT) && ctx->GetTrickOption(RT_WATER_LONGSHOT_TORCH))));}}), + Entrance(RR_WATER_TEMPLE_NORTH_LOWER, {[]{return logic->CanWaterTempleLowFromHigh || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && logic->CanUse(RG_IRON_BOOTS));}}), + Entrance(RR_WATER_TEMPLE_SOUTH_LOWER, {[]{return logic->CanWaterTempleLowFromHigh && logic->HasExplosives() && (logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS)) && (ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC));}}), + Entrance(RR_WATER_TEMPLE_WEST_LOWER, {[]{return logic->CanWaterTempleLowFromHigh && logic->HasItem(RG_GORONS_BRACELET) && (logic->IsChild || logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS)) && (ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC));}}), + Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_LOWER, {[]{return logic->CanWaterTempleLowFromHigh && logic->SmallKeys(RR_WATER_TEMPLE, 5);}}), + Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_UPPER, {[]{return (logic->CanWaterTempleLowFromHigh || logic->CanWaterTempleMiddle) && (logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW));}}), + Entrance(RR_WATER_TEMPLE_EAST_MIDDLE, {[]{return (logic->CanWaterTempleLowFromHigh || logic->CanWaterTempleMiddle || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16)) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_WEST_MIDDLE, {[]{return logic->CanWaterTempleMiddle;}}), Entrance(RR_WATER_TEMPLE_HIGH_WATER, {[]{return logic->IsAdult && (logic->CanUse(RG_HOVER_BOOTS) || (ctx->GetTrickOption(RT_DAMAGE_BOOST) && logic->CanUse(RG_BOMB_BAG) && logic->TakeDamage()));}}), - Entrance(RR_WATER_TEMPLE_BLOCK_CORRIDOR, {[]{return (logic->WaterTempleLow || logic->WaterTempleMiddle) && (logic->CanUse(RG_FAIRY_SLINGSHOT) || logic->CanUse(RG_FAIRY_BOW)) && (logic->CanUse(RG_LONGSHOT) || logic->CanUse(RG_HOVER_BOOTS) || (ctx->GetTrickOption(RT_WATER_CENTRAL_BOW) && (logic->IsAdult || logic->WaterTempleMiddle)));}}), - Entrance(RR_WATER_TEMPLE_FALLING_PLATFORM_ROOM, {[]{return logic->WaterTempleHigh && logic->SmallKeys(RR_WATER_TEMPLE, 4);}}), - Entrance(RR_WATER_TEMPLE_PRE_BOSS_ROOM, {[]{return logic->WaterTempleHigh && logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_BLOCK_CORRIDOR, {[]{return (logic->CanWaterTempleLowFromHigh || logic->CanWaterTempleMiddle) && (logic->CanUse(RG_FAIRY_SLINGSHOT) || logic->CanUse(RG_FAIRY_BOW)) && (logic->CanUse(RG_LONGSHOT) || logic->CanUse(RG_HOVER_BOOTS) || (ctx->GetTrickOption(RT_WATER_CENTRAL_BOW) && (logic->IsAdult || logic->CanWaterTempleMiddle)));}}), + Entrance(RR_WATER_TEMPLE_FALLING_PLATFORM_ROOM, {[]{return logic->CanWaterTempleHigh && logic->SmallKeys(RR_WATER_TEMPLE, 4);}}), + Entrance(RR_WATER_TEMPLE_PRE_BOSS_ROOM, {[]{return logic->CanWaterTempleHigh && logic->CanUse(RG_LONGSHOT);}}), }); areaTable[RR_WATER_TEMPLE_EAST_LOWER] = Region("Water Temple East Lower", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events - EventAccess(&logic->WaterTempleLow, {[]{return logic->WaterTempleLow || logic->CanUse(RG_ZELDAS_LULLABY);}}), + EventAccess(&logic->CanWaterTempleLowFromHigh, {[]{return logic->CanWaterTempleLowFromHigh || logic->CanUse(RG_ZELDAS_LULLABY);}}), }, {}, { //Exits - Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->WaterTempleLow || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && logic->CanUse(RG_IRON_BOOTS));}}), - Entrance(RR_WATER_TEMPLE_MAP_ROOM, {[]{return logic->WaterTempleHigh;}}), - Entrance(RR_WATER_TEMPLE_CRACKED_WALL, {[]{return logic->WaterTempleMiddle || (logic->WaterTempleHigh && logic->WaterTempleLow && ((logic->CanUse(RG_HOVER_BOOTS) && ctx->GetTrickOption(RT_WATER_CRACKED_WALL_HOVERS)) || ctx->GetTrickOption(RT_WATER_CRACKED_WALL)));}}), - Entrance(RR_WATER_TEMPLE_TORCH_ROOM, {[]{return logic->WaterTempleLow && (logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW));}}), + Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->CanWaterTempleLowFromHigh || ((ctx->GetTrickOption(RT_FEWER_TUNIC_REQUIREMENTS) || logic->CanUse(RG_ZORA_TUNIC)) && logic->CanUse(RG_IRON_BOOTS));}}), + Entrance(RR_WATER_TEMPLE_MAP_ROOM, {[]{return logic->CanWaterTempleHigh;}}), + Entrance(RR_WATER_TEMPLE_CRACKED_WALL, {[]{return logic->CanWaterTempleMiddle || (logic->CanWaterTempleHigh && logic->CanWaterTempleLowFromHigh && ((logic->CanUse(RG_HOVER_BOOTS) && ctx->GetTrickOption(RT_WATER_CRACKED_WALL_HOVERS)) || ctx->GetTrickOption(RT_WATER_CRACKED_WALL)));}}), + Entrance(RR_WATER_TEMPLE_TORCH_ROOM, {[]{return logic->CanWaterTempleLowFromHigh && (logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW));}}), }); areaTable[RR_WATER_TEMPLE_MAP_ROOM] = Region("Water Temple Map Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { @@ -145,15 +145,15 @@ void RegionTable_Init_WaterTemple() { //Exits Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->SmallKeys(RR_WATER_TEMPLE, 5);}}), Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_UPPER, {[]{return logic->CanUse(RG_HOOKSHOT);}}), - Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_BASEMENT, {[]{return logic->WaterTempleMiddle && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 40;}}), + Entrance(RR_WATER_TEMPLE_CENTRAL_PILLAR_BASEMENT, {[]{return logic->CanWaterTempleMiddle && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 40;}}), }); areaTable[RR_WATER_TEMPLE_CENTRAL_PILLAR_UPPER] = Region("Water Temple Central Pillar Upper", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events - EventAccess(&logic->WaterTempleMiddle, {[]{return logic->WaterTempleMiddle || logic->CanUse(RG_ZELDAS_LULLABY);}}), + EventAccess(&logic->CanWaterTempleMiddle, {[]{return logic->CanWaterTempleMiddle || logic->CanUse(RG_ZELDAS_LULLABY);}}), }, { //Locations - LOCATION(RC_WATER_TEMPLE_GS_CENTRAL_PILLAR, logic->CanUse(RG_LONGSHOT) || (((ctx->GetTrickOption(RT_WATER_FW_CENTRAL_GS) && logic->CanUse(RG_FARORES_WIND) && (logic->CanUse(RG_FAIRY_BOW) || logic->CanUse(RG_DINS_FIRE) || logic->SmallKeys(RR_WATER_TEMPLE, 5))) || (ctx->GetTrickOption(RT_WATER_IRONS_CENTRAL_GS) && logic->CanUse(RG_IRON_BOOTS) && ((logic->CanUse(RG_HOOKSHOT) && logic->CanUse(RG_FAIRY_BOW)) || (logic->CanUse(RG_DINS_FIRE))))) && logic->WaterTempleHigh && logic->HookshotOrBoomerang())), + LOCATION(RC_WATER_TEMPLE_GS_CENTRAL_PILLAR, logic->CanUse(RG_LONGSHOT) || (((ctx->GetTrickOption(RT_WATER_FW_CENTRAL_GS) && logic->CanUse(RG_FARORES_WIND) && (logic->CanUse(RG_FAIRY_BOW) || logic->CanUse(RG_DINS_FIRE) || logic->SmallKeys(RR_WATER_TEMPLE, 5))) || (ctx->GetTrickOption(RT_WATER_IRONS_CENTRAL_GS) && logic->CanUse(RG_IRON_BOOTS) && ((logic->CanUse(RG_HOOKSHOT) && logic->CanUse(RG_FAIRY_BOW)) || (logic->CanUse(RG_DINS_FIRE))))) && logic->CanWaterTempleHigh && logic->HookshotOrBoomerang())), }, { //Exits Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return true;}}), @@ -184,7 +184,7 @@ void RegionTable_Init_WaterTemple() { areaTable[RR_WATER_TEMPLE_HIGH_WATER] = Region("Water Temple High Water", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events - EventAccess(&logic->WaterTempleHigh, {[]{return logic->WaterTempleHigh || logic->CanUse(RG_ZELDAS_LULLABY);}}), + EventAccess(&logic->CanWaterTempleHigh, {[]{return logic->CanWaterTempleHigh || logic->CanUse(RG_ZELDAS_LULLABY);}}), }, {}, { //Exits Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return true;}}), @@ -192,7 +192,7 @@ void RegionTable_Init_WaterTemple() { areaTable[RR_WATER_TEMPLE_BLOCK_CORRIDOR] = Region("Water Temple Block Corridor", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_WATER_TEMPLE_CENTRAL_BOW_TARGET_CHEST, logic->HasItem(RG_GORONS_BRACELET) && (logic->WaterTempleLow || logic->WaterTempleMiddle)), + LOCATION(RC_WATER_TEMPLE_CENTRAL_BOW_TARGET_CHEST, logic->HasItem(RG_GORONS_BRACELET) && (logic->CanWaterTempleLowFromHigh || logic->CanWaterTempleMiddle)), }, { //Exits Entrance(RR_WATER_TEMPLE_LOBBY, {[]{return logic->CanUse(RG_HOOKSHOT);}}), @@ -251,53 +251,407 @@ void RegionTable_Init_WaterTemple() { | MASTER QUEST DUNGEON | ---------------------------*/ if (ctx->GetDungeon(WATER_TEMPLE)->IsMQ()) { - areaTable[RR_WATER_TEMPLE_MQ_LOBBY] = Region("Water Temple MQ Lobby", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + areaTable[RR_WATER_TEMPLE_MQ_3F_SOUTH_LEDGE] = Region("Water Temple MQ 3F South Ledge", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { //Exits - Entrance(RR_WATER_TEMPLE_ENTRYWAY, {[]{return true;}}), - Entrance(RR_WATER_TEMPLE_MQ_DIVE, {[]{return logic->IsAdult && logic->WaterTimer() >= 24 && logic->CanUse(RG_IRON_BOOTS);}}), - Entrance(RR_WATER_TEMPLE_MQ_DARK_LINK_REGION, {[]{return logic->SmallKeys(RR_WATER_TEMPLE, 1) && logic->IsAdult && logic->CanUse(RG_LONGSHOT) && logic->CanJumpslashExceptHammer();}}), - Entrance(RR_WATER_TEMPLE_BOSS_ENTRYWAY, {[]{return logic->HasItem(RG_WATER_TEMPLE_BOSS_KEY) && logic->IsAdult && logic->CanJumpslashExceptHammer() && logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_ENTRYWAY, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_IRON_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + //If we are not on WL_HIGH, we reach RR_WATER_TEMPLE_MQ_3F_MAIN with hookshot via 2F, otherwise we can reach the platform + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_HOVER_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_2F_CENTRAL, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID);}}), }); - areaTable[RR_WATER_TEMPLE_MQ_DIVE] = Region("Water Temple MQ Dive", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { - //Locations - LOCATION(RC_WATER_TEMPLE_MQ_MAP_CHEST, logic->HasFireSource() && logic->IsAdult && logic->CanUse(RG_HOOKSHOT)), - LOCATION(RC_WATER_TEMPLE_MQ_CENTRAL_PILLAR_CHEST, logic->IsAdult && logic->CanUse(RG_ZORA_TUNIC) && logic->CanUse(RG_HOOKSHOT) && ((ctx->GetTrickOption(RT_WATER_MQ_CENTRAL_PILLAR) && logic->CanUse(RG_FIRE_ARROWS)) || (logic->CanUse(RG_DINS_FIRE) && logic->CanUse(RG_SONG_OF_TIME)))), - //Trick: logic->IsAdult && logic->CanUse(RG_ZORA_TUNIC) && logic->CanUse(RG_HOOKSHOT) && ((LogicWaterMQCentralPillar && logic->CanUse(RG_FIRE_ARROWS)) || (logic->CanUse(RG_DINS_FIRE) && logic->CanUse(RG_SONG_OF_TIME))) +//This region covers simply existing in the area around the central pillar without being on a specific platform, either swimming or walking on the lakebed +//Entry should only include being in the correct area, taking any possible fall damage, and floating up to the surface of WL_HIGH if coming from below +//This area then leads to others based on level and worst-case water timers for follow-up exits from the water's surface +//remember that any solution that works for any level doesn't need to be given a level, even if that solution is overkill for a lower level + areaTable[RR_WATER_TEMPLE_MQ_MAIN] = Region("Water Temple MQ Main", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_3F_SOUTH_LEDGE, {[]{return logic->HasItem(RG_BRONZE_SCALE) && logic->MQWaterLevel(WL_HIGH);}}), + //Jumping across is possible but a trick due to the janky ledge + Entrance(RR_WATER_TEMPLE_MQ_EAST_TOWER, {[]{return (logic->WaterTimer() >= 24 && logic->CanUse(RG_IRON_BOOTS)) || + (logic->MQWaterLevel(WL_MID) && logic->HasItem(RG_GOLDEN_SCALE) && logic->WaterTimer() >= 16) || + logic->MQWaterLevel(WL_LOW);}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->MQWaterLevel(WL_HIGH) && logic->HasItem(RG_BRONZE_SCALE);}}), + //First water timer uses the hook to go from the top of center to storage room/central pillar as coming from the bottom + //Second water timer is simply diving down and entering the door as fast as possible from the surface + Entrance(RR_WATER_TEMPLE_MQ_2F_CENTRAL, {[]{return ((logic->MQWaterLevel(WL_LOW) || (logic->CanUse(RG_IRON_BOOTS) && (logic->MQWaterLevel(WL_MID) || logic->WaterTimer() >= 16))) && logic->CanUse(RG_LONGSHOT)) || + ((logic->MQWaterLevel(WL_MID) || (logic->MQWaterLevel(WL_HIGH_OR_MID) && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8)) && logic->HasItem(RG_BRONZE_SCALE));}}), + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_1F, {[]{return logic->MQWaterLevel(WL_LOW);}}), + //A special entry as we can't set it to high after entering at a lower height + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH, {[]{return logic->MQWaterLevel(WL_HIGH) && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16 && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT));}}), + Entrance(RR_WATER_TEMPLE_MQ_2F_SOUTH, {[]{return (logic->MQWaterLevel(WL_MID) || (logic->MQWaterLevel(WL_HIGH_OR_MID) && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16)) && logic->HasItem(RG_BRONZE_SCALE);}}), + Entrance(RR_WATER_TEMPLE_MQ_B1_GATE_SWITCH, {[]{return logic->MQWaterB1Switch && (logic->MQWaterLevel(WL_LOW) || ((logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 24) && logic->HasItem(RG_BRONZE_SCALE)));}}), + Entrance(RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_ROOM, {[]{return logic->MQWaterB1Switch && + ((logic->MQWaterLevel(WL_LOW) && logic->HasItem(RG_SILVER_SCALE)) || + (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16 && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT))));}}), + //Adult needs to jump in instead of dive for swim access, but you just hold forward. RT_WATER_BK_REGION Isn't relevant unless the Dark Link loop can be done without longshot with other tricks + Entrance(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, {[]{return logic->MQWaterB1Switch && + ((logic->MQWaterLevel(WL_LOW) && logic->HasItem(RG_BRONZE_SCALE)) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16 && logic->CanUse(RG_HOOKSHOT))) && + (logic->CanUse(RG_LONGSHOT) || (ctx->GetTrickOption(RT_WATER_BK_REGION) && logic->CanUse(RG_HOVER_BOOTS)));}}), + }); + +//This region specifically covers the topmost platform around central pillar + areaTable[RR_WATER_TEMPLE_MQ_3F_CENTRAL] = Region("Water Temple MQ 3F Central", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_SOUTH_LEDGE, {[]{return logic->CanUse(RG_LONGSHOT) || logic->CanUse(RG_HOVER_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_2F_CENTRAL, {[]{return (logic->MQWaterLevel(WL_LOW_OR_MID) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16)) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH, {[]{return logic->MQWaterLevel(WL_HIGH) && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16 && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_NORTH_LEDGE, {[]{return logic->MQWaterLevel(WL_HIGH) && logic->CanUse(RG_LONGSHOT);}}), + //Jumping across is possible but a trick due to the janky ledge + Entrance(RR_WATER_TEMPLE_MQ_HIGH_EMBLEM, {[]{return logic->CanUse(RG_HOOKSHOT) || (logic->IsAdult && logic->CanUse(RG_HOVER_BOOTS));}}), + //room access is (logic->IsAdult || (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_HOOKSHOT))) + Entrance(RR_WATER_TEMPLE_MQ_WATERFALL, {[]{return logic->SmallKeys(RR_WATER_TEMPLE, 1) && logic->MQWaterLevel(WL_HIGH) && logic->CanUse(RG_LONGSHOT);}}), + //this swimless jump with irons may be a trick as you have to put irons on quite late. + Entrance(RR_WATER_TEMPLE_MQ_2F_SOUTH, {[]{return (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16) || logic->MQWaterLevel(WL_LOW_OR_MID);}}), + }); + +//This region specifically covers walking on the lower platform around central pillar. This is underwater when WL_HIGH +//RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH should be accessed directly to use the central pillar door while at WL_HIGH + areaTable[RR_WATER_TEMPLE_MQ_2F_CENTRAL] = Region("Water Temple MQ 2F Central", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_2F, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID);}}), + Entrance(RR_WATER_TEMPLE_MQ_STORAGE_ROOM, {[]{return logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_2F, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID) && (logic->IsAdult || logic->CanUse(RG_HOVER_BOOTS)) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_2F_SOUTH, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID) && logic->CanUse(RG_HOVER_BOOTS);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_HIGH_EMBLEM] = Region("Water Temple MQ High Emblem", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->ReachedWaterHighEmblem, {[]{return true;}}), + EventAccess(&logic->CanWaterTempleHigh, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_3F_NORTH_LEDGE] = Region("Water Temple MQ 3F North Ledge", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + //what we need if WL_LOW, we can't guarantee repeated access otherwise. + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->TakeDamage();}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_DOOR, {[]{return logic->CanUse(RG_LONGSHOT) || logic->CanUse(RG_ICE_ARROWS) || logic->CanUse(RG_NAYRUS_LOVE);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_BOSS_DOOR] = Region("Water Temple MQ Main", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_3F_NORTH_LEDGE, {[]{return logic->CanUse(RG_ICE_ARROWS) || logic->TakeDamage();}}), + Entrance(RR_WATER_TEMPLE_BOSS_ENTRYWAY, {[]{return logic->HasItem(RG_WATER_TEMPLE_BOSS_KEY);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_EAST_TOWER] = Region("Water Temple MQ East Tower", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //if we can't reach these, we can't move the water at all, so no need to specify level or account for WL_LOW access here + //review is some way to play ocarina underwater exists + EventAccess(&logic->CouldWaterTempleLow, {[]{return true;}}), + EventAccess(&logic->CanWaterTempleLowFromHigh, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + //Reserved for glitches/tricks that could do this + //EventAccess(&logic->CanWaterTempleLowFromMid, {[]{return false;}}), }, { - //Exits - Entrance(RR_WATER_TEMPLE_MQ_LOWERED_WATER_LEVELS, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_MAP_CHEST, logic->MQWaterLevel(WL_HIGH) && logic->HasFireSource() && logic->CanUse(RG_HOOKSHOT)), + //easy to get at WL_HIGH with the hook-the-underwater-chest glitch + LOCATION(RC_WATER_TEMPLE_MQ_LONGSHOT_CHEST, logic->MQWaterLevel(WL_MID) && logic->CanUse(RG_HOOKSHOT)), + }, { + Entrance(RR_WATER_TEMPLE_MQ_EAST_TOWER_1F_ROOM, {[]{return logic->MQWaterLevel(WL_LOW) && (logic->CanUse(RG_FAIRY_BOW) || logic->CanUse(RG_DINS_FIRE) || logic->CanUse(RG_STICKS));}}), }); - areaTable[RR_WATER_TEMPLE_MQ_LOWERED_WATER_LEVELS] = Region("Water Temple MQ Lowered Water Levels", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Raising the targets by clearing this room achieves nothing logically because it requires WL_LOW to do and hookshot to use, which implies access to WL_MID and WL_HIGH already + areaTable[RR_WATER_TEMPLE_MQ_EAST_TOWER_1F_ROOM] = Region("Water Temple MQ East Tower 1F Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_WATER_TEMPLE_MQ_COMPASS_CHEST, ((logic->IsAdult && logic->CanUse(RG_FAIRY_BOW)) || logic->CanUse(RG_DINS_FIRE) || Here(RR_WATER_TEMPLE_MQ_LOBBY, []{return logic->IsChild && logic->CanUse(RG_STICKS) && logic->HasExplosives();})) && - (logic->CanJumpslashExceptHammer() || logic->CanUseProjectile())), - LOCATION(RC_WATER_TEMPLE_MQ_LONGSHOT_CHEST, logic->IsAdult && logic->CanUse(RG_HOOKSHOT)), - LOCATION(RC_WATER_TEMPLE_MQ_GS_LIZALFOS_HALLWAY, logic->CanUse(RG_DINS_FIRE)), - LOCATION(RC_WATER_TEMPLE_MQ_GS_BEFORE_UPPER_WATER_SWITCH, logic->IsAdult && logic->CanUse(RG_LONGSHOT)), + LOCATION(RC_WATER_TEMPLE_MQ_COMPASS_CHEST, logic->CanKillEnemy(RE_LIZALFOS) && logic->CanKillEnemy(RE_SPIKE)), + }, { + Entrance(RR_WATER_TEMPLE_MQ_EAST_TOWER, {[]{return true;}}), + }); + +//This area assumes we entered through the lower door, so water is low and cannot be changed without leaving. + areaTable[RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_1F] = Region("Water Temple MQ Central Pillar 1F", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //This is harder than the other possibilities as you have to move between shots on top of the extra range, but there's basically no universe this should matter. + EventAccess(&logic->MQWaterB1Switch, {[]{return ctx->GetTrickOption(RT_WATER_MQ_CENTRAL_PILLAR) && logic->CanUse(RG_FIRE_ARROWS);}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH, {[]{return logic->MQWaterLevel(WL_HIGH) && ctx->GetTrickOption(RT_WATER_FW_CENTRAL_GS) && logic->CanUse(RG_FARORES_WIND) && logic->HasItem(RG_BRONZE_SCALE);}}), + //I don't know if this FW trick can ever matter but maybe it's needed to get child to CENTRAL_2F or something + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_2F, {[]{return logic->CanUse(RG_HOOKSHOT) || + (logic->MQWaterLevel(WL_MID) && ctx->GetTrickOption(RT_WATER_FW_CENTRAL_GS) && logic->CanUse(RG_FARORES_WIND) && logic->HasItem(RG_BRONZE_SCALE));}}), + //if the gate is open, you sink straight in, so you can't climb up this way in logic without swimming + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1, {[]{return logic->MQWaterOpenedPillarB1 && logic->MQWaterLevel(WL_HIGH_OR_MID) && + ctx->GetTrickOption(RT_WATER_FW_CENTRAL_GS) && logic->CanUse(RG_FARORES_WIND) && + logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_ZORA_TUNIC);}}), + }); + +//If we enter here in WL_HIGH, go to RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH instead, Assumes WL_MID_OR_LOW + areaTable[RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_2F] = Region("Water Temple MQ Central Pillar 2F", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->CouldWaterTempleMiddle, {[]{return true;}}), + EventAccess(&logic->CanWaterTempleMiddle, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + //It's possible to do this even on low water, but more awkward. I'm not sure if it's even possible for it to be relevant though. + EventAccess(&logic->MQWaterOpenedPillarB1, {[]{return ctx->GetTrickOption(RT_WATER_MQ_CENTRAL_PILLAR) && logic->CanUse(RG_FIRE_ARROWS);}}), + //this could theoretically matter once OI and equip swap is in logic, as one age may be able to get here dry and not wet, and the other may not be able to OI, but as you can OI with hookshot it probably never happens + //EventAccess(&logic->MQWaterPillarSoTBlock, {[]{return logic->CanUse(RG_HOOKSHOT) && logic->CanUse(RG_SONG_OF_TIME);}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH, {[]{return logic->MQWaterLevel(WL_HIGH) && logic->CanUse(RG_FARORES_WIND) && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_IRON_BOOTS));}}), + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1, {[]{return logic->MQWaterOpenedPillarB1 && logic->MQWaterLevel(WL_MID) && logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_ZORA_TUNIC);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH] = Region("Water Temple MQ Central Pillar High", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->MQWaterOpenedPillarB1, {[]{return ((logic->CanUse(RG_SONG_OF_TIME) && logic->CanUse(RG_DINS_FIRE)) || (ctx->GetTrickOption(RT_WATER_MQ_CENTRAL_PILLAR) && logic->CanUse(RG_FIRE_ARROWS))) && + (logic->HasItem(RG_BRONZE_SCALE) || (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_LONGSHOT) && logic->CanJumpslash()));}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1, {[]{return logic->MQWaterB1Switch && logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_ZORA_TUNIC);}}), + }); + +//Assuming tunic and irons was checked on entry + areaTable[RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1] = Region("Water Temple MQ Central Pillar B1", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + //Can't know water level, so we'll just assume any possibility and skip to MAIN + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->MQWaterOpenedPillarB1 && logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_BRONZE_SCALE);}}), + //Child needs to release irons for height to push down the larger "peg", however they can push the lower one down by climbing and then hit the switch through the larger peg, but it's a trick + Entrance(RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1_FINAL, {[]{return ((logic->IsAdult && logic->CanUse(RG_LONGSHOT)) || (logic->CanUse(RG_HOOKSHOT) && logic->HasItem(RG_BRONZE_SCALE)));}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1_FINAL] = Region("Water Temple MQ Central Pillar B1 Final", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_CENTRAL_PILLAR_CHEST, logic->CanUse(RG_HOOKSHOT)), }, {}); - areaTable[RR_WATER_TEMPLE_MQ_DARK_LINK_REGION] = Region("Water Temple MQ Dark Link Region", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { +//Region exists to add crate/pot/box locations + areaTable[RR_WATER_TEMPLE_MQ_STORAGE_ROOM] = Region("Water Temple MQ Storage Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_2F] = Region("Water Temple MQ Behind Blue Switch 2F", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_3F, {[]{return logic->CanUse(RG_LONGSHOT);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_3F] = Region("Water Temple MQ Behind Blue Switch 2F", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_GS_BEFORE_UPPER_WATER_SWITCH, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA)), + }, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_2F, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_HIGH_EMBLEM, {[]{return true;}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_2F_SOUTH] = Region("Water Temple MQ Lowered Water Levels", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_2F_SOUTH_CAGE, {[]{return logic->MQWaterLevel(WL_LOW_OR_MID) && logic->CanUse(RG_DINS_FIRE);}}), + //this technically exists, but only complicates things, uncomment if some edge case/glitch can use RR_WATER_TEMPLE_MQ_2F_SOUTH to reach RR_WATER_TEMPLE_MQ_3F_CENTRAL, or if a void warp goes here + /*Entrance(RR_WATER_TEMPLE_MQ_3F_EAST_LEDGE, {[]{return (logic->CanUse(RG_HOOKSHOT) && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_IRON_BOOTS))) || + (logic->MQWaterLevel(WL_LOW_OR_MID) && logic->CanUse(RG_HOOKSHOT)) || + logic->MQWaterLevel(WL_HIGH) && (logic->HasItem(RG_BRONZE_SCALE));}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_3F_EAST_LEDGE] = Region("Water Temple MQ 3F East Ledge", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_HOVER_BOOTS);}}),*/ + }); + + areaTable[RR_WATER_TEMPLE_MQ_2F_SOUTH_CAGE] = Region("Water Temple MQ Lowered Water Levels", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_GS_LIZALFOS_HALLWAY, logic->CanKillEnemy(RE_GOLD_SKULLTULA)), + }, {}); + +//This room exists to hold the wonderitems that drop from the emblems here. Specifically this assumes you are standing on the final ledge + areaTable[RR_WATER_TEMPLE_MQ_WATERFALL] = Region("Water Temple Waterfall", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_3F_CENTRAL, {[]{return logic->SmallKeys(RR_WATER_TEMPLE, 1) && logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_POTS, {[]{return (logic->MQWaterStalfosPit && logic->IsAdult && logic->CanUse(RG_HOOKSHOT)) || logic->CanUse(RG_HOVER_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER, {[]{return logic->MQWaterStalfosPit && logic->CanUse(RG_LONGSHOT);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_STALFOS_PIT] = Region("Water Temple MQ Stalfos Pit", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->MQWaterStalfosPit, {[]{return ((logic->IsAdult && logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 3, false, true)) || + (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_HOOKSHOT) && logic->CanKillEnemy(RE_STALFOS, ED_BOOMERANG, true, 3, false, true)));}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_WATERFALL, {[]{return logic->MQWaterStalfosPit && logic->CanUse(RG_HOOKSHOT) && (logic->IsAdult || logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8);}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_POTS, {[]{return (logic->IsAdult && logic->CanUse(RG_HOOKSHOT)) || + (logic->CanUse(RG_HOOKSHOT) && (logic->IsAdult || logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8) && (logic->CanUse(RG_HOVER_BOOTS) || logic->MQWaterStalfosPit));}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER, {[]{return logic->MQWaterStalfosPit && (logic->IsAdult || logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8) && logic->CanUse(RG_HOOKSHOT);}}), + }); + + //also includes the suns fairy in the middle + areaTable[RR_WATER_TEMPLE_MQ_STALFOS_PIT_POTS] = Region("Water Temple MQ Stalfos Pit Pots", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events EventAccess(&logic->FairyPot, {[]{return true;}}), EventAccess(&logic->NutPot, {[]{return true;}}), - }, { - //Locations - LOCATION(RC_WATER_TEMPLE_MQ_BOSS_KEY_CHEST, logic->IsAdult && logic->WaterTimer() >= 24 && logic->CanUse(RG_DINS_FIRE) && (ctx->GetTrickOption(RT_WATER_DRAGON_JUMP_DIVE) || logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS))), - LOCATION(RC_WATER_TEMPLE_MQ_GS_RIVER, true), - }, { + }, {}, { //Exits - Entrance(RR_WATER_TEMPLE_MQ_BASEMENT_GATED_AREAS, {[]{return logic->IsAdult && logic->WaterTimer() >= 24 && logic->CanUse(RG_DINS_FIRE) && logic->CanUse(RG_IRON_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_WATERFALL, {[]{return logic->MQWaterStalfosPit && (logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_LONGSHOT));}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER, {[]{return logic->MQWaterStalfosPit && logic->CanUse(RG_HOOKSHOT);}}), }); - areaTable[RR_WATER_TEMPLE_MQ_BASEMENT_GATED_AREAS] = Region("Water Temple MQ Basement Gated Areas", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { +//specifically the area past the spikes + areaTable[RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER] = Region("Water Temple MQ Stalfos Pit Upper", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT, {[]{return logic->IsAdult || logic->TakeDamage();}}), + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_POTS, {[]{return logic->IsAdult || logic->TakeDamage();}}), + Entrance(RR_WATER_TEMPLE_MQ_AFTER_DARK_LINK, {[]{return logic->CanKillEnemy(RE_DARK_LINK);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_AFTER_DARK_LINK] = Region("Water Temple MQ After Dark Link", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->FairyPot, {[]{return true;}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER, {[]{return logic->CanKillEnemy(RE_DARK_LINK);}}), + Entrance(RR_WATER_TEMPLE_MQ_RIVER_SKULL, {[]{return logic->CanUse(RG_HOOKSHOT) && (logic->HasItem(RG_BRONZE_SCALE) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8) || logic->CanUse(RG_LONGSHOT));}}), + }); + +//if we can use hookshot, we are standing on the targets, otherwise assume we're in the water + areaTable[RR_WATER_TEMPLE_MQ_RIVER_SKULL] = Region("Water Temple MQ River Skull", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_WATER_TEMPLE_MQ_FREESTANDING_KEY, logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_SCARECROW) || ctx->GetTrickOption(RT_WATER_NORTH_BASEMENT_LEDGE_JUMP)), - LOCATION(RC_WATER_TEMPLE_MQ_GS_TRIPLE_WALL_TORCH, logic->CanUse(RG_FIRE_ARROWS) && (logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_SCARECROW))), - LOCATION(RC_WATER_TEMPLE_MQ_GS_FREESTANDING_KEY_AREA, ctx->GetTrickOption(RT_WATER_MQ_LOCKED_GS) || (logic->SmallKeys(RR_WATER_TEMPLE, 2) && (logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_SCARECROW) || ctx->GetTrickOption(RT_WATER_NORTH_BASEMENT_LEDGE_JUMP)) && logic->CanJumpslashExceptHammer())), - //Trick: LogicWaterMQLockedGS || (logic->SmallKeys(RR_WATER_TEMPLE, 2) && (logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_SCARECROW) || LogicWaterNorthBasementLedgeJump)) + LOCATION(RC_WATER_TEMPLE_MQ_GS_RIVER, logic->CanUse(RG_LONGSHOT) || (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_HOOKSHOT))), + }, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_RIVER_POTS, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_RIVER_POTS] = Region("Water Temple MQ River Pots", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->FairyPot, {[]{return true;}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_RIVER_SKULL, {[]{return logic->CanUse(RG_LONGSHOT) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8 && logic->CanUse(RG_HOOKSHOT));}}), + //You don't need to swim for this if you put irons on in midair and hold forward while aiming for the tunnel with a tight angle, but if you miss you have to void unless you have a hook. It's only relevant with glitches anyway + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_TUNNEL, {[]{return logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16;}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE, {[]{return logic->HasItem(RG_SILVER_SCALE) || (logic->IsAdult && logic->HasItem(RG_BRONZE_SCALE) && ctx->GetTrickOption(RT_WATER_DRAGON_JUMP_DIVE));}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT) || (logic->CanUse(RG_HOVER_BOOTS) && logic->CanJumpslash());}}), + }); + +//This region assumes Iron boots to access + areaTable[RR_WATER_TEMPLE_MQ_DRAGON_ROOM_TUNNEL] = Region("Water Temple MQ Dragon Room Tunnel", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_RIVER_POTS, {[]{return logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR, {[]{return logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE] = Region("Water Temple MQ Dragon Room Alcove", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->MQWaterDragonTorches, {[]{return true;}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_TUNNEL, {[]{return logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16;}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR, {[]{return logic->HasItem(RG_SILVER_SCALE);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR] = Region("Water Temple MQ Dragon Room Door", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_RIVER_POTS, {[]{return logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_TUNNEL, {[]{return logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16 && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE, {[]{return logic->HasItem(RG_SILVER_SCALE);}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, {[]{return logic->MQWaterDragonTorches;}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH] = Region("Water Temple MQ Boss Key Room Switch", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_PIT, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_CHEST, {[]{return logic->CanHitSwitch() && Here(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, []{return logic->CanUse(RG_DINS_FIRE);});}}), + }); + +//this exists for the crates in preparation for clips through the grate + areaTable[RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_PIT] = Region("Water Temple MQ Boss Key Room Pit", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, {[]{return logic->CanHitSwitch(ED_BOOMERANG);}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_CHEST] = Region("Water Temple MQ Boss Key Room Chest", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_BOSS_KEY_CHEST, true), + }, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, {[]{return logic->CanHitSwitch(ED_BOOMERANG) || logic->CanUse(RG_HOVER_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_PIT, {[]{return true;}}), + Entrance(RR_WATER_TEMPLE_MQ_B1_GATE_SWITCH, {[]{return logic->HasItem(RG_SILVER_SCALE) || (logic->CanUse(RG_IRON_BOOTS) && (logic->HasItem(RG_BRONZE_SCALE) || (logic->WaterTimer() >= 24 && logic->CanUse(RG_LONGSHOT))));}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_B1_GATE_SWITCH] = Region("Water Temple MQ B1 Gate Switch", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //If the water is low, the switch is underwater and needs irons to press, otherwise, the water is too low to climb up and you need irons to hookshot a target + //If a glitch clips through the gate on low, have it logically press the switch and let entrance logic enter + EventAccess(&logic->MQWaterB1Switch, {[]{return logic->CanUse(RG_IRON_BOOTS);}}), + }, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->MQWaterB1Switch && (logic->MQWaterLevel(WL_LOW) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 16));}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_CHEST, {[]{return logic->CanUse(RG_IRON_BOOTS) && logic->HasItem(RG_BRONZE_SCALE) && (logic->MQWaterLevel(WL_LOW) || logic->WaterTimer() >= 24);}}) + }); + + areaTable[RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_ROOM] = Region("Water Temple MQ Triangle Torch Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->MQWaterB1Switch && + ((logic->MQWaterLevel(WL_LOW) && logic->HasItem(RG_GOLDEN_SCALE)) || + (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 40 && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_LONGSHOT))));}}), + Entrance(RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_CAGE, {[]{return logic->CanUse(RG_FIRE_ARROWS) && + ((logic->IsAdult && logic->CanUse(RG_HOVER_BOOTS)) || (logic->CanUse(RG_LONGSHOT) && Here(RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_CAGE, []{return logic->ScarecrowsSong();})));}}) + }); + + areaTable[RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_CAGE] = Region("Water Temple MQ Triangle Torch Cage", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_GS_TRIPLE_WALL_TORCH, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA, ED_BOOMERANG)), }, {}); + + areaTable[RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM] = Region("Water Temple MQ Crates Whirlpools Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + //we can backflip over the spikes, but land in water. + Entrance(RR_WATER_TEMPLE_MQ_MAIN, {[]{return logic->MQWaterB1Switch && logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 24 && (logic->CanUse(RG_LONGSHOT) || logic->HasItem(RG_BRONZE_SCALE));}}), + //Child can use the crate to get the height to make it with hovers, but it's annoyingly tight so would be a trick + Entrance(RR_WATER_TEMPLE_MQ_SINGLE_STALFOS_ROOM, {[]{return logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8 && + //We're putting the requirement to get out of the water here as the scarecrow method in includes hook which satisfies it + ((logic->IsAdult && (logic->CanUse(RG_HOVER_BOOTS) || ctx->GetTrickOption(RT_WATER_NORTH_BASEMENT_LEDGE_JUMP)) && (logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_BRONZE_SCALE))) || + (Here(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, []{return logic->ScarecrowsSong();}) && logic->CanUse(RG_HOOKSHOT)));}}), + Entrance(RR_WATER_TEMPLE_MQ_4_TORCH_ROOM, {[]{return logic->IsAdult && + (logic->CanUse(RG_HOVER_BOOTS) || ctx->GetTrickOption(RT_WATER_NORTH_BASEMENT_LEDGE_JUMP) || + (Here(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, []{return logic->ScarecrowsSong();}) && logic->CanUse(RG_HOOKSHOT)));}}), + Entrance(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_CAGE, {[]{return ctx->GetTrickOption(RT_WATER_MQ_LOCKED_GS) && (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_HOOKSHOT));}}), + }); + + areaTable[RR_WATER_TEMPLE_MQ_SINGLE_STALFOS_ROOM] = Region("Water Temple MQ Single Stalfos Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_FREESTANDING_KEY, true), + }, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, {[]{return logic->HasItem(RG_SILVER_SCALE) || (logic->IsChild && logic->HasItem(RG_BRONZE_SCALE)) || + (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8 && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_HOOKSHOT)));}}) + }); + + areaTable[RR_WATER_TEMPLE_MQ_4_TORCH_ROOM] = Region("Water Temple MQ 4 Torch Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, {[]{return (logic->IsAdult && (logic->CanUse(RG_HOVER_BOOTS) || logic->CanJumpslash())) || + (logic->HasItem(RG_BRONZE_SCALE) || (logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8 && logic->CanUse(RG_HOOKSHOT) ));}}), + Entrance(RR_WATER_TEMPLE_MQ_DODONGO_ROOM, {[]{return logic->CanHitSwitch() && logic->HasFireSource();}}) + }); + + areaTable[RR_WATER_TEMPLE_MQ_DODONGO_ROOM] = Region("Water Temple MQ Dodongo Room", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_WATER_TEMPLE_MQ_4_TORCH_ROOM, {[]{return (logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_HOVER_BOOTS)) && + Here(RR_WATER_TEMPLE_MQ_DODONGO_ROOM, []{return logic->CanKillEnemy(RE_DODONGO, ED_CLOSE, true, 5);});}}), + Entrance(RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_CAGE, {[]{return (logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_HOVER_BOOTS)) && + Here(RR_WATER_TEMPLE_MQ_DODONGO_ROOM, []{return logic->CanKillEnemy(RE_DODONGO, ED_CLOSE, true, 5);});}}) + }); + + areaTable[RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_CAGE] = Region("Water Temple MQ Basement Gated Areas", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_WATER_TEMPLE_MQ_GS_FREESTANDING_KEY_AREA, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA)), + }, { + Entrance(RR_WATER_TEMPLE_MQ_DODONGO_ROOM, {[]{return true;}}) + }); } /*--------------------------- @@ -307,9 +661,9 @@ void RegionTable_Init_WaterTemple() { Region("Water Temple Boss Entryway", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { // Exits - Entrance(RR_WATER_TEMPLE_PRE_BOSS_ROOM, { [] { return ctx->GetDungeon(WATER_TEMPLE)->IsVanilla() && false; } }), - Entrance(RR_WATER_TEMPLE_MQ_LOBBY, { [] { return ctx->GetDungeon(WATER_TEMPLE)->IsMQ() && false; } }), - Entrance(RR_WATER_TEMPLE_BOSS_ROOM, { [] { return true; } }), + Entrance(RR_WATER_TEMPLE_PRE_BOSS_ROOM, {[]{return ctx->GetDungeon(WATER_TEMPLE)->IsVanilla() && false;}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_DOOR, {[]{return ctx->GetDungeon(WATER_TEMPLE)->IsMQ() && false;}}), + Entrance(RR_WATER_TEMPLE_BOSS_ROOM, {[]{return true;}}), }); areaTable[RR_WATER_TEMPLE_BOSS_ROOM] = Region("Water Temple Boss Room", "Water Temple", {}, NO_DAY_NIGHT_CYCLE, diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 11ffd0766..4b159b941 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -59,6 +59,7 @@ namespace Rando { case RG_PROGRESSIVE_NUT_UPGRADE: case RG_NUTS: return CurrentUpgrade(UPG_NUTS); + //RANDOTODO handle cases where the scarecrow is persistent between age better when OI is added case RG_SCARECROW: return ScarecrowsSong() && CanUse(RG_HOOKSHOT); case RG_DISTANT_SCARECROW: @@ -450,6 +451,7 @@ namespace Rando { } return killed; case RE_DODONGO: + return CanUse(RG_KOKIRI_SWORD) || CanUse(RG_MASTER_SWORD) || CanUse(RG_BIGGORON_SWORD) || (quantity <= 5 && CanUse(RG_STICKS)) || HasExplosives() || CanUse(RG_FAIRY_SLINGSHOT) || CanUse(RG_FAIRY_BOW); case RE_LIZALFOS: return CanJumpslash() || HasExplosives() || CanUse(RG_FAIRY_SLINGSHOT) || CanUse(RG_FAIRY_BOW); case RE_KEESE: @@ -495,8 +497,31 @@ namespace Rando { return CanDamage(); case RE_STALFOS: //RANDOTODO Add trick to kill stalfos with sticks, and a second one for bombs without stunning. Higher ammo logic for bombs is also plausible - return CanUse(RG_KOKIRI_SWORD) || CanUse(RG_MASTER_SWORD) || CanUse(RG_BIGGORON_SWORD) || CanUse(RG_MEGATON_HAMMER) || CanUse(RG_FAIRY_BOW) || CanUse(RG_BOMBCHU_5) || - (quantity <= 2 && !timer && (CanUse(RG_NUTS) || HookshotOrBoomerang()) && CanUse(RG_BOMB_BAG)) || (quantity <= 1 && CanUse(RG_STICKS)); + switch (distance){ + case ED_CLOSE: + case ED_SHORT_JUMPSLASH: + killed = CanUse(RG_MEGATON_HAMMER) || CanUse(RG_KOKIRI_SWORD); + [[fallthrough]]; + case ED_MASTER_SWORD_JUMPSLASH: + killed = killed || CanUse(RG_MASTER_SWORD); + [[fallthrough]]; + case ED_LONG_JUMPSLASH: + killed = killed || CanUse(RG_BIGGORON_SWORD) || (quantity <= 1 && CanUse(RG_STICKS)); + [[fallthrough]]; + case ED_BOOMERANG: + //RANDOTODO test dins, bomb and chu range in a practical example + killed = killed || (quantity <= 2 && !timer && !inWater && (CanUse(RG_NUTS) || HookshotOrBoomerang()) && CanUse(RG_BOMB_BAG)); + [[fallthrough]]; + case ED_HOOKSHOT: + //RANDOTODO test dins, bomb and chu range in a practical example + killed = killed || (wallOrFloor && CanUse(RG_BOMBCHU_5)); + [[fallthrough]]; + case ED_LONGSHOT: + case ED_FAR: + killed = killed || CanUse(RG_FAIRY_BOW); + break; + } + return killed; //Needs 16 bombs, but is in default logic in N64, probably because getting the hits is quite easy. //bow and sling can wake them and damage after they shed their armour, so could reduce ammo requirements for explosives to 10. //requires 8 sticks to kill so would be a trick unless we apply higher stick bag logic @@ -562,6 +587,9 @@ namespace Rando { case RE_BIG_OCTO: //If chasing octo is annoying but with rolls you can catch him, and you need rang to get into this room without shenanigains anyway. Bunny makes it free return CanUse(RG_KOKIRI_SWORD) || CanUse(RG_STICKS) || CanUse(RG_MASTER_SWORD); + case RE_DARK_LINK: + //RNADOTODO Dark link is buggy right now, retest when he is not + return CanJumpslash() || CanUse(RG_FAIRY_BOW); default: SPDLOG_ERROR("CanKillEnemy reached `default`."); assert(false); @@ -597,6 +625,7 @@ namespace Rando { case RE_ARMOS: case RE_FREEZARD: case RE_SPIKE: + case RE_DARK_LINK: return true; case RE_BIG_SKULLTULA: //hammer jumpslash can pass, but only on flat land where you can kill with hammer swing @@ -648,6 +677,7 @@ namespace Rando { case RE_SPIKE: case RE_BIG_OCTO: case RE_GIBDO: + case RE_DARK_LINK: return true; case RE_MAD_SCRUB: case RE_KEESE: @@ -725,6 +755,35 @@ namespace Rando { return CanDetonateBombFlowers() || HasItem(RG_GORONS_BRACELET); } + bool Logic::MQWaterLevel(RandoWaterLevel level) { + //For ease of reading, I will call the triforce emblem that sets the water to WL_LOW the "Low Emblem", the one that sets it to WL_MID the "Mid Emblem", and the one that sets it to WL_HIGH the "High Emblem" + switch(level){ + //While you have to go through WL_LOW to get to Mid, the requirements for WL_LOW are stricter than WL_MID because you can always go up to WL_MID and then could need to go back to WL_HIGH to reach the Low Emblem again + //Thanks to this caveat you need to be able to reach and play ZL to both the High and Low Emblems to have WL_LOW in logic. + //Alternativly a way to reach WL_LOW from WL_MID could exist, but all glitchless methods need you to do a Low-locked action + case WL_LOW: + return (CanWaterTempleHigh && CanWaterTempleLowFromHigh) || (CanWaterTempleLowFromMid && CanWaterTempleLowFromHigh); + case WL_LOW_OR_MID: + return (CanWaterTempleHigh && CanWaterTempleLowFromHigh) || (CanWaterTempleLowFromHigh && CanWaterTempleMiddle) || (CanWaterTempleLowFromMid && CanWaterTempleLowFromHigh); + //If we can set it to High out of logic we can just repeat what we did to lower the water in the first place as High is the default. + //Because of this you only need to be able to use the Low and Mid Emblems, WL_LOW could be skipped if it was ever possible to play ZL underwater. + case WL_MID: + return CanWaterTempleLowFromHigh && CanWaterTempleMiddle; + //Despite being the initial state of water temple, WL_HIGH has the extra requirement of making sure that, if we were to lower the water out of logic, we could put it back to WL_HIGH + //However because it is the default state, we do not need to check if we can actually change the water level, only to make sure we can return to WL_HIGH if we found the means to play ZL out of logic. + //There are 2 methods to lock yourself out after playing ZL already: Not being able to reach the High Emblem and being unable to replay ZL. (I will be ignoring other-age-access shenanigains) + //The former check would simply be a check to see if we can reach High Emblem, but we assume the water is WL_MID (as if we can set it to WL_LOW, we can set it to WL_MID, as Mid Emblem has no requirements) + //The latter check can be assumed for now but will want a revisit once OI tricks are added. + case WL_HIGH: + return ReachedWaterHighEmblem; + case WL_HIGH_OR_MID: + return ReachedWaterHighEmblem || (CanWaterTempleLowFromHigh && CanWaterTempleMiddle); + } + SPDLOG_ERROR("MQWaterLevel reached `return false;`. Missing case for a Water Level"); + assert(false); + return false; + } + Logic::Logic() { } @@ -2007,9 +2066,10 @@ namespace Rando { GCWoodsWarpOpen = false; GCDaruniasDoorOpenChild = false; StopGCRollingGoronAsAdult = false; - WaterTempleLow = false; - WaterTempleMiddle = false; - WaterTempleHigh = false; + CanWaterTempleLowFromHigh = false; + CanWaterTempleLowFromMid = false; + CanWaterTempleMiddle = false; + CanWaterTempleHigh = false; KakarikoVillageGateOpen = false; KingZoraThawed = false; ForestTempleJoelle = false; @@ -2045,6 +2105,11 @@ namespace Rando { MQJabuLiftRoomCow = false; MQShadowFloorSpikeRupees = false; ShadowShortcutBlock = false; + MQWaterStalfosPit = false; + MQWaterDragonTorches = false; + MQWaterB1Switch = false; + //MQWaterPillarSoTBlock = false; + MQWaterOpenedPillarB1 = false; StopPerformanceTimer(PT_LOGIC_RESET); } diff --git a/soh/soh/Enhancements/randomizer/logic.h b/soh/soh/Enhancements/randomizer/logic.h index 4b57835e0..141cc4139 100644 --- a/soh/soh/Enhancements/randomizer/logic.h +++ b/soh/soh/Enhancements/randomizer/logic.h @@ -118,9 +118,13 @@ class Logic { bool GCWoodsWarpOpen = false; bool GCDaruniasDoorOpenChild = false; bool StopGCRollingGoronAsAdult = false; - bool WaterTempleLow = false; - bool WaterTempleMiddle = false; - bool WaterTempleHigh = false; + bool CanWaterTempleLowFromHigh = false; + bool CanWaterTempleMiddle = false; + bool CanWaterTempleHigh = false; + bool CanWaterTempleLowFromMid = false; + bool CouldWaterTempleLow = false; + bool CouldWaterTempleMiddle = false; + bool ReachedWaterHighEmblem = false; bool KakarikoVillageGateOpen = false; bool KingZoraThawed = false; bool ForestTempleJoelle = false; @@ -157,6 +161,11 @@ class Logic { bool MQJabuLiftRoomCow = false; bool MQShadowFloorSpikeRupees = false; bool ShadowShortcutBlock = false; + bool MQWaterStalfosPit = false; + bool MQWaterDragonTorches = false; + bool MQWaterB1Switch = false; + //bool MQWaterPillarSoTBlock = false; should be irrelevant. SHOULD. + bool MQWaterOpenedPillarB1 = false; /* --- END OF HELPERS AND LOCATION ACCESS --- */ @@ -180,6 +189,7 @@ class Logic { bool CanHitEyeTargets(); bool CanDetonateBombFlowers(); bool CanDetonateUprightBombFlower(); + bool MQWaterLevel(RandoWaterLevel level); uint8_t BottleCount(); uint8_t OcarinaButtons(); bool HasBottle(); diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index d49cc7bae..00fb4e05a 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -751,11 +751,48 @@ typedef enum { RR_WATER_TEMPLE_RIVER, RR_WATER_TEMPLE_PRE_BOSS_ROOM, - RR_WATER_TEMPLE_MQ_LOBBY, - RR_WATER_TEMPLE_MQ_DIVE, - RR_WATER_TEMPLE_MQ_LOWERED_WATER_LEVELS, - RR_WATER_TEMPLE_MQ_DARK_LINK_REGION, - RR_WATER_TEMPLE_MQ_BASEMENT_GATED_AREAS, + RR_WATER_TEMPLE_MQ_3F_SOUTH_LEDGE, + RR_WATER_TEMPLE_MQ_MAIN, + RR_WATER_TEMPLE_MQ_3F_CENTRAL, + RR_WATER_TEMPLE_MQ_2F_CENTRAL, + RR_WATER_TEMPLE_MQ_2F_CENTRAL_HIGH, + RR_WATER_TEMPLE_MQ_HIGH_EMBLEM, + RR_WATER_TEMPLE_MQ_3F_NORTH_LEDGE, + RR_WATER_TEMPLE_MQ_BOSS_DOOR, + RR_WATER_TEMPLE_MQ_EAST_TOWER, + RR_WATER_TEMPLE_MQ_EAST_TOWER_1F_ROOM, + RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_1F, + RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_2F, + RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_HIGH, + RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1, + RR_WATER_TEMPLE_MQ_CENTRAL_PILLAR_B1_FINAL, + RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_2F, + RR_WATER_TEMPLE_MQ_BEHIND_BLUE_SWITCH_3F, + RR_WATER_TEMPLE_MQ_STORAGE_ROOM, + RR_WATER_TEMPLE_MQ_2F_SOUTH, + RR_WATER_TEMPLE_MQ_2F_SOUTH_CAGE, + RR_WATER_TEMPLE_MQ_3F_EAST_LEDGE, + RR_WATER_TEMPLE_MQ_WATERFALL, + RR_WATER_TEMPLE_MQ_STALFOS_PIT, + RR_WATER_TEMPLE_MQ_STALFOS_PIT_POTS, + RR_WATER_TEMPLE_MQ_STALFOS_PIT_UPPER, + RR_WATER_TEMPLE_MQ_AFTER_DARK_LINK, + RR_WATER_TEMPLE_MQ_RIVER_SKULL, + RR_WATER_TEMPLE_MQ_RIVER_POTS, + RR_WATER_TEMPLE_MQ_DRAGON_ROOM_DOOR, + RR_WATER_TEMPLE_MQ_DRAGON_ROOM_TUNNEL, + RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE, + RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, + RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_PIT, + RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_CHEST, + RR_WATER_TEMPLE_MQ_B1_GATE_SWITCH, + RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_ROOM, + RR_WATER_TEMPLE_MQ_TRIANGLE_TORCH_CAGE, + RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_ROOM, + RR_WATER_TEMPLE_MQ_SINGLE_STALFOS_ROOM, + RR_WATER_TEMPLE_MQ_4_TORCH_ROOM, + RR_WATER_TEMPLE_MQ_DODONGO_ROOM, + RR_WATER_TEMPLE_MQ_CRATES_WHIRLPOOLS_CAGE, RR_WATER_TEMPLE_BOSS_ENTRYWAY, RR_WATER_TEMPLE_BOSS_ROOM, @@ -4525,6 +4562,7 @@ typedef enum { RE_STINGER, RE_BIG_OCTO, RE_GIBDO, + RE_DARK_LINK, } RandomizerEnemy; //RANDOTODO compare child long jumpslash range with adult short @@ -4541,6 +4579,14 @@ typedef enum { ED_FAR, } EnemyDistance; +typedef enum { + WL_LOW, + WL_MID, + WL_HIGH, + WL_LOW_OR_MID, + WL_HIGH_OR_MID +} RandoWaterLevel; + #define ENTRANCE_GROTTO_LOAD_START 0x0700 #define ENTRANCE_GROTTO_EXIT_START 0x0800 diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index df263241f..f82d1d2ab 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -445,6 +445,7 @@ void Settings::CreateOptions() { mTrickOptions[RT_WATER_BK_REGION] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::INTERMEDIATE}, false, "Water Temple Boss Key Region with Hover Boots", "With precise Hover Boots movement it is possible to reach the boss key chest's region without needing the Longshot. It is not necessary to take damage from the spikes. The Gold Skulltula Token in the following room can also be obtained with just the Hover Boots."); mTrickOptions[RT_WATER_NORTH_BASEMENT_LEDGE_JUMP] = TrickOption::LogicTrick(RCQUEST_BOTH, RA_WATER_TEMPLE, {Tricks::Tag::INTERMEDIATE}, false, "Water Temple North Basement Ledge with Precise Jump", "In the northern basement there's a ledge from where, in vanilla Water Temple, boulders roll out into the room. Normally to jump directly to this ledge logically requires the Hover Boots, but with precise jump, it can be done without them. This trick applies to both Vanilla and Master Quest."); mTrickOptions[RT_WATER_BK_JUMP_DIVE] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Boss Key Jump Dive", "Stand on the very edge of the raised corridor leading from the push block room to the rolling boulder corridor. Face the gold skulltula on the waterfall and jump over the boulder corridor floor into the pool of water, swimming right once underwater. This allows access to the boss key room without Iron boots."); + //Also used in MQ logic, but won't be relevent unl;ess a way to enter tower without irons exists (likely a clip + swim) mTrickOptions[RT_WATER_FW_CENTRAL_GS] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Central Pillar GS with Farore\'s Wind", "If you set Farore's Wind inside the central pillar and then return to that warp point after raising the water to the highest level, you can obtain this Skulltula Token with Hookshot or Boomerang."); mTrickOptions[RT_WATER_IRONS_CENTRAL_GS] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Central Pillar GS with Iron Boots", "After opening the middle water level door into the central pillar, the door will stay unbarred so long as you do not leave the room -- even if you were to raise the water up to the highest level. With the Iron Boots to go through the door after the water has been raised, you can obtain the Skulltula Token with the Hookshot."); mTrickOptions[RT_WATER_CENTRAL_BOW] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::ADVANCED}, false, "Water Temple Central Bow Target without Longshot or Hover Boots", "A very precise Bow shot can hit the eye switch from the floor above. Then, you can jump down into the hallway and make through it before the gate closes. It can also be done as child, using the Slingshot instead of the Bow."); From 4eeb01905dbab89149bd11decfa6bc9cc5e2ceb8 Mon Sep 17 00:00:00 2001 From: Archez Date: Thu, 7 Nov 2024 11:52:21 -0500 Subject: [PATCH 07/11] pull in decomp updates for z_play (#4522) --- soh/include/attributes.h | 12 + soh/include/functions.h | 8 +- soh/include/variables.h | 2 +- soh/include/z64.h | 1 + soh/include/z64save.h | 2 +- soh/soh/z_play_otr.cpp | 10 +- soh/src/code/z_demo.c | 4 +- soh/src/code/z_play.c | 937 +++++++++--------- soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 +- .../overlays/actors/ovl_En_Ossan/z_en_ossan.c | 10 +- 10 files changed, 492 insertions(+), 496 deletions(-) create mode 100644 soh/include/attributes.h diff --git a/soh/include/attributes.h b/soh/include/attributes.h new file mode 100644 index 000000000..f58cc8122 --- /dev/null +++ b/soh/include/attributes.h @@ -0,0 +1,12 @@ +#ifndef ATTRIBUTES_H +#define ATTRIBUTES_H + +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(x) +#endif + +#define UNUSED __attribute__((unused)) +#define FALLTHROUGH __attribute__((fallthrough)) +#define NORETURN __attribute__((noreturn)) + +#endif diff --git a/soh/include/functions.h b/soh/include/functions.h index 41b325236..8a1f6572c 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -1536,9 +1536,9 @@ void KaleidoScopeCall_Init(PlayState* play); void KaleidoScopeCall_Destroy(PlayState* play); void KaleidoScopeCall_Update(PlayState* play); void KaleidoScopeCall_Draw(PlayState* play); -void func_800BC490(PlayState* play, s16 point); -s32 func_800BC56C(PlayState* play, s16 arg1); -void func_800BC590(PlayState* play); +void Play_SetViewpoint(PlayState* play, s16 viewpoint); +s32 Play_CheckViewpoint(PlayState* play, s16 viewpoint); +void Play_SetShopBrowsingViewpoint(PlayState* play); void Gameplay_SetupTransition(PlayState* play, s32 arg1); Gfx* Play_SetFog(PlayState* play, Gfx* gfx); void Play_Destroy(GameState* thisx); @@ -1552,7 +1552,7 @@ u8 CheckLACSRewardCount(); s32 Play_InCsMode(PlayState* play); f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec); void* Play_LoadFile(PlayState* play, RomFile* file); -void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn); +void Play_SpawnScene(PlayState* play, s32 sceneId, s32 spawn); void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest); s16 Play_CreateSubCamera(PlayState* play); s16 Play_GetActiveCamId(PlayState* play); diff --git a/soh/include/variables.h b/soh/include/variables.h index 5c97b26b8..25fb304d3 100644 --- a/soh/include/variables.h +++ b/soh/include/variables.h @@ -120,7 +120,7 @@ extern "C" extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[KALEIDO_OVL_MAX]; extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; extern u8 gBossMarkState; - extern void* D_8012D1F0; + extern void* gDebugCutsceneScript; extern s32 gScreenWidth; extern s32 gScreenHeight; extern Mtx gMtxClear; diff --git a/soh/include/z64.h b/soh/include/z64.h index f4cec6e82..00a67c844 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -3,6 +3,7 @@ #include #include "unk.h" // this used to get pulled in via ultra64.h +#include "attributes.h" #include "z64save.h" #include "z64light.h" #include "z64bgcheck.h" diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 0233819ce..bf0d20697 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -361,7 +361,7 @@ typedef enum { /* 4 */ SCENE_LAYER_CUTSCENE_FIRST } SceneLayer; -#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) +#define IS_CUTSCENE_LAYER (gSaveContext.sceneSetupIndex >= SCENE_LAYER_CUTSCENE_FIRST) typedef enum { /* 0 */ LINK_AGE_ADULT, diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 729e3badb..22345af88 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -19,19 +19,19 @@ Ship::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName) return res.get(); } -extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) { - SceneTableEntry* scene = &gSceneTable[sceneNum]; +extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { + SceneTableEntry* scene = &gSceneTable[sceneId]; scene->unk_13 = 0; play->loadedScene = scene; - play->sceneNum = sceneNum; + play->sceneNum = sceneId; play->sceneConfig = scene->config; //osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); // Scenes considered "dungeon" with a MQ variant - int16_t inNonSharedScene = (sceneNum >= SCENE_DEKU_TREE && sceneNum <= SCENE_ICE_CAVERN) || - sceneNum == SCENE_GERUDO_TRAINING_GROUND || sceneNum == SCENE_INSIDE_GANONS_CASTLE; + int16_t inNonSharedScene = (sceneId >= SCENE_DEKU_TREE && sceneId <= SCENE_ICE_CAVERN) || + sceneId == SCENE_GERUDO_TRAINING_GROUND || sceneId == SCENE_INSIDE_GANONS_CASTLE; std::string sceneVersion = "shared"; if (inNonSharedScene) { diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 5d44a14af..decc18f39 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -307,7 +307,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { break; case 14: if (sp3F != 0) { - func_800BC490(play, 1); + Play_SetViewpoint(play, 1); } break; case 15: @@ -2052,7 +2052,7 @@ void func_80068C3C(PlayState* play, CutsceneContext* csCtx) { csCtx->frames++; if (dREG(95) != 0) { - Cutscene_ProcessCommands(play, csCtx, D_8012D1F0); + Cutscene_ProcessCommands(play, csCtx, gDebugCutsceneScript); } else { Cutscene_ProcessCommands(play, csCtx, play->csCtx.segment); } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index ae6d987a9..0ba9d8759 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -18,53 +18,70 @@ #include #include -void* D_8012D1F0 = NULL; -//UNK_TYPE D_8012D1F4 = 0; // unused -Input* D_8012D1F8 = NULL; - TransitionUnk sTrnsnUnk; s32 gTrnsnUnkState; -VisMono D_80161498; +VisMono gPlayVisMono; Color_RGBA8_u32 D_801614B0; + FaultClient D_801614B8; -s16 D_801614C8; -#if 0 -u64 D_801614D0[0xA00]; -#endif + +s16 sTransitionFillTimer; + +void* gDebugCutsceneScript = NULL; +UNK_TYPE D_8012D1F4 = 0; // unused + +Input* D_8012D1F8 = NULL; PlayState* gPlayState; s16 firstInit = 0; - s16 gEnPartnerId; -void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn); +void Play_SpawnScene(PlayState* play, s32 sceneId, s32 spawn); + +// This macro prints the number "1" with a file and line number if R_ENABLE_PLAY_LOGS is enabled. +// For example, it can be used to trace the play state execution at a high level. +// SOHTODO: Revert log statements everywhere back to authentic, and deal with dynamic line/file names via macro +#define PLAY_LOG(line) \ + do { \ + if (1 & HREG(63)) { \ + LOG_NUM("1", 1 /*, "../z_play.c", line */); \ + } \ + } while (0) void enableBetaQuest(); void disableBetaQuest(); -void func_800BC450(PlayState* play) { +void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn); + +void Play_RequestViewpointBgCam(PlayState* play) { Camera_ChangeDataIdx(GET_ACTIVE_CAM(play), play->unk_1242B - 1); } -void func_800BC490(PlayState* play, s16 point) { - assert(point == 1 || point == 2); +void Play_SetViewpoint(PlayState* play, s16 viewpoint) { + assert(viewpoint == 1 || viewpoint == 2); - play->unk_1242B = point; + play->unk_1242B = viewpoint; if ((YREG(15) != 0x10) && (gSaveContext.cutsceneIndex < 0xFFF0)) { - Audio_PlaySoundGeneral((point == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, + Audio_PlaySoundGeneral((viewpoint == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - func_800BC450(play); + Play_RequestViewpointBgCam(play); } -s32 func_800BC56C(PlayState* play, s16 arg1) { - return (arg1 == play->unk_1242B); +/** + * @return true if the currently set viewpoint is the same as the one provided in the argument + */ +s32 Play_CheckViewpoint(PlayState* play, s16 viewpoint) { + return (viewpoint == play->unk_1242B); } -// original name: "Game_play_shop_pr_vr_switch_set" -void func_800BC590(PlayState* play) { +/** + * If the scene is a shop, set the viewpoint that will set the bgCamIndex + * to toggle the camera into a "browsing item selection" setting. + */ +void Play_SetShopBrowsingViewpoint(PlayState* play) { osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n"); if (YREG(15) == 0x10) { @@ -75,7 +92,7 @@ void func_800BC590(PlayState* play) { void Gameplay_SetupTransition(PlayState* play, s32 transitionType) { TransitionContext* transitionCtx = &play->transitionCtx; - memset(transitionCtx,0, sizeof(TransitionContext)); + memset(transitionCtx, 0, sizeof(TransitionContext)); transitionCtx->transitionType = transitionType; @@ -103,6 +120,7 @@ void Gameplay_SetupTransition(PlayState* play, s32 transitionType) { transitionCtx->setColor = TransitionTriforce_SetColor; transitionCtx->setEnvColor = NULL; break; + case TRANS_TYPE_WIPE: case TRANS_TYPE_WIPE_FAST: transitionCtx->init = TransitionWipe_Init; @@ -115,6 +133,7 @@ void Gameplay_SetupTransition(PlayState* play, s32 transitionType) { transitionCtx->setColor = TransitionWipe_SetColor; transitionCtx->setEnvColor = NULL; break; + case TRANS_TYPE_FADE_BLACK: case TRANS_TYPE_FADE_WHITE: case TRANS_TYPE_FADE_BLACK_FAST: @@ -135,25 +154,32 @@ void Gameplay_SetupTransition(PlayState* play, s32 transitionType) { transitionCtx->setColor = TransitionFade_SetColor; transitionCtx->setEnvColor = NULL; break; + case TRANS_TYPE_FILL_WHITE2: case TRANS_TYPE_FILL_WHITE: play->transitionMode = TRANS_MODE_FILL_WHITE_INIT; break; + case TRANS_TYPE_INSTANT: play->transitionMode = TRANS_MODE_INSTANT; break; + case TRANS_TYPE_FILL_BROWN: play->transitionMode = TRANS_MODE_FILL_BROWN_INIT; break; + case TRANS_TYPE_SANDSTORM_PERSIST: play->transitionMode = TRANS_MODE_SANDSTORM_INIT; break; + case TRANS_TYPE_SANDSTORM_END: play->transitionMode = TRANS_MODE_SANDSTORM_END_INIT; break; + case TRANS_TYPE_CS_BLACK_FILL: play->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT; break; + default: Fault_AddHungupAndCrash(__FILE__, __LINE__); break; @@ -166,8 +192,8 @@ void func_800BC88C(PlayState* play) { } Gfx* Play_SetFog(PlayState* play, Gfx* gfx) { - return Gfx_SetFog2(gfx, play->lightCtx.fogColor[0], play->lightCtx.fogColor[1], - play->lightCtx.fogColor[2], 0, play->lightCtx.fogNear, 1000); + return Gfx_SetFog2(gfx, play->lightCtx.fogColor[0], play->lightCtx.fogColor[1], play->lightCtx.fogColor[2], 0, + play->lightCtx.fogNear, 1000); } void Play_Destroy(GameState* thisx) { @@ -183,6 +209,7 @@ void Play_Destroy(GameState* thisx) { play->state.gfxCtx->callback = NULL; play->state.gfxCtx->callbackParam = 0; + SREG(91) = 0; R_PAUSE_MENU_MODE = 0; @@ -204,7 +231,7 @@ void Play_Destroy(GameState* thisx) { ShrinkWindow_Destroy(); TransitionFade_Destroy(&play->transitionFade); - VisMono_Destroy(&D_80161498); + VisMono_Destroy(&gPlayVisMono); if (gSaveContext.linkAge != play->linkAgeOnLoad) { Inventory_SwapAgeEquipment(); @@ -216,8 +243,11 @@ void Play_Destroy(GameState* thisx) { KaleidoScopeCall_Destroy(play); KaleidoManager_Destroy(); ZeldaArena_Cleanup(); + Fault_RemoveClient(&D_801614B8); + disableBetaQuest(); + gPlayState = NULL; } @@ -346,18 +376,17 @@ u8 CheckLACSRewardCount() { void Play_Init(GameState* thisx) { PlayState* play = (PlayState*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; - enableBetaQuest(); - gPlayState = play; - //play->state.gfxCtx = NULL; uintptr_t zAlloc; uintptr_t zAllocAligned; size_t zAllocSize; Player* player; - s32 playerStartCamId; + s32 playerStartBgCamIndex; s32 i; - u8 tempSetupIndex; + u8 baseSceneLayer; s32 pad[2]; + enableBetaQuest(); + // Properly initialize the frame counter so it doesn't use garbage data if (!firstInit) { play->gameplayFrames = 0; @@ -373,7 +402,10 @@ void Play_Init(GameState* thisx) { return; } + gPlayState = play; + SystemArena_Display(); + // OTRTODO allocate double the normal amount of memory // This is to avoid some parts of the game, like loading actors, causing OoM // This is potionally unavoidable due to struct size differences, but is x2 the right amount? @@ -399,6 +431,7 @@ void Play_Init(GameState* thisx) { play->cameraPtrs[MAIN_CAM]->uid = 0; play->activeCamera = MAIN_CAM; func_8005AC48(&play->mainCamera, 0xFF); + // Sram_Init(this, &this->sramCtx); Regs_InitData(play); Message_Init(play); GameOver_Init(play); @@ -431,41 +464,53 @@ void Play_Init(GameState* thisx) { Cutscene_HandleConditionalTriggers(play); - if (gSaveContext.gameMode != 0 || gSaveContext.cutsceneIndex >= 0xFFF0) { + if (gSaveContext.gameMode != GAMEMODE_NORMAL || gSaveContext.cutsceneIndex >= 0xFFF0) { gSaveContext.nayrusLoveTimer = 0; Magic_Reset(play); - gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4; + gSaveContext.sceneSetupIndex = SCENE_LAYER_CUTSCENE_FIRST + (gSaveContext.cutsceneIndex & 0xF); } else if (!LINK_IS_ADULT && IS_DAY) { - gSaveContext.sceneSetupIndex = 0; + gSaveContext.sceneSetupIndex = SCENE_LAYER_CHILD_DAY; } else if (!LINK_IS_ADULT && !IS_DAY) { - gSaveContext.sceneSetupIndex = 1; + gSaveContext.sceneSetupIndex = SCENE_LAYER_CHILD_NIGHT; } else if (LINK_IS_ADULT && IS_DAY) { - gSaveContext.sceneSetupIndex = 2; + gSaveContext.sceneSetupIndex = SCENE_LAYER_ADULT_DAY; } else { - gSaveContext.sceneSetupIndex = 3; + gSaveContext.sceneSetupIndex = SCENE_LAYER_ADULT_NIGHT; } - tempSetupIndex = gSaveContext.sceneSetupIndex; + // save the base scene layer (before accounting for the special cases below) to use later for the transition type + baseSceneLayer = gSaveContext.sceneSetupIndex; + if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_HYRULE_FIELD) && !LINK_IS_ADULT && - gSaveContext.sceneSetupIndex < 4) { + !IS_CUTSCENE_LAYER) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { gSaveContext.sceneSetupIndex = 1; } else { gSaveContext.sceneSetupIndex = 0; } - } else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_KOKIRI_FOREST) && LINK_IS_ADULT && - gSaveContext.sceneSetupIndex < 4) { + } else if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_KOKIRI_FOREST) && + LINK_IS_ADULT && !IS_CUTSCENE_LAYER) { gSaveContext.sceneSetupIndex = (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) ? 3 : 2; } Play_SpawnScene( - play, - gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene, + play, gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].scene, gEntranceTable[((void)0, gSaveContext.sceneSetupIndex) + ((void)0, gSaveContext.entranceIndex)].spawn); osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneSetupIndex); +#if 0 + // When entering Gerudo Valley in the credits, trigger the GC emulator to play the ending movie. + // The emulator constantly checks whether PC is 0x81000000, so this works even though it's not a valid address. + if ((gEntranceTable[((void)0, gSaveContext.save.entranceIndex)].sceneId == SCENE_GERUDO_VALLEY) && + gSaveContext.sceneLayer == 6) { + PRINTF("ใ‚จใƒณใƒ‡ใ‚ฃใƒณใ‚ฐใฏใ˜ใพใ‚‹ใ‚ˆใƒผ\n"); // "The ending starts" + ((void (*)(void))0x81000000)(); + PRINTF("ๅ‡บๆˆปใ‚Š๏ผŸ\n"); // "Return?" + } +#endif + Cutscene_HandleEntranceTriggers(play); KaleidoScopeCall_Init(play); func_801109B0(play); @@ -475,10 +520,12 @@ void Play_Init(GameState* thisx) { gSaveContext.totalDays++; gSaveContext.bgsDayCount++; gSaveContext.dogIsLost = true; + if (Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) { Message_StartTextbox(play, 0x3066, NULL); } + gSaveContext.nextDayTime = 0xFFFE; } else { gSaveContext.nextDayTime = 0xFFFD; @@ -488,11 +535,10 @@ void Play_Init(GameState* thisx) { SREG(91) = -1; R_PAUSE_MENU_MODE = 0; PreRender_Init(&play->pauseBgPreRender); - PreRender_SetValuesSave(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0); - PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); + PreRender_SetValuesSave(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, NULL); + PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL); gTrnsnUnkState = 0; play->transitionMode = TRANS_MODE_OFF; - FrameAdvance_Init(&play->frameAdvCtx); Rand_Seed((u32)osGetTime()); Matrix_Init(&play->state); @@ -501,12 +547,12 @@ void Play_Init(GameState* thisx) { play->transitionTrigger = TRANS_TRIGGER_END; play->unk_11E16 = 0xFF; play->unk_11E18 = 0; - play->unk_11DE9 = 0; + play->unk_11DE9 = false; - if (gSaveContext.gameMode != 1) { + if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) { play->transitionType = ENTRANCE_INFO_END_TRANS_TYPE( - gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field); // Fade In + gEntranceTable[((void)0, gSaveContext.entranceIndex) + baseSceneLayer].field); // Fade In } else { play->transitionType = gSaveContext.nextTransitionType; gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; @@ -520,20 +566,21 @@ void Play_Init(GameState* thisx) { TransitionFade_SetType(&play->transitionFade, 3); TransitionFade_SetColor(&play->transitionFade, RGBA8(160, 160, 160, 255)); TransitionFade_Start(&play->transitionFade); - VisMono_Init(&D_80161498); + VisMono_Init(&gPlayVisMono); D_801614B0.a = 0; Flags_UnsetAllEnv(play); osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&play->state.tha)); zAllocSize = THA_GetSize(&play->state.tha); - zAlloc = GAMESTATE_ALLOC_MC(&play->state, zAllocSize); + zAlloc = (uintptr_t)GAMESTATE_ALLOC_MC(&play->state, zAllocSize); zAllocAligned = (zAlloc + 8) & ~0xF; - ZeldaArena_Init(zAllocAligned, zAllocSize - zAllocAligned + zAlloc); + ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc)); // "Zelda Heap" osSyncPrintf("ใ‚ผใƒซใƒ€ใƒ’ใƒผใƒ— %08x-%08x\n", zAllocAligned, - (s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc)); + (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc)); Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); + // In order to keep masks equipped on first load, we need to pre-set the age reqs for the item and slot if (CVarGetInteger(CVAR_ENHANCEMENT("AdultMasks"), 0) || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) { for (int i = ITEM_MASK_KEATON; i <= ITEM_MASK_TRUTH; i += 1) { @@ -548,6 +595,7 @@ void Play_Init(GameState* thisx) { } gSlotAgeReqs[SLOT_TRADE_CHILD] = AGE_REQ_CHILD; } + func_800304DC(play, &play->actorCtx, play->linkActorEntry); while (!func_800973FC(play, &play->roomCtx)) { @@ -565,16 +613,17 @@ void Play_Init(GameState* thisx) { { CollisionHeader* colHeader = BgCheck_GetCollisionHeader(&play->colCtx, BGCHECK_SCENE); + u8 camId = player->actor.params & 0xFF; // If the player's start cam is out of bounds, set it to 0xFF so it isn't used. - if (colHeader != NULL && ((player->actor.params & 0xFF) >= colHeader->cameraDataListLen)) { + if (colHeader != NULL && (camId != 0xFF) && (camId >= colHeader->cameraDataListLen)) { player->actor.params |= 0xFF; } } - playerStartCamId = player->actor.params & 0xFF; - if (playerStartCamId != 0xFF) { - osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartCamId); - Camera_ChangeDataIdx(&play->mainCamera, playerStartCamId); + playerStartBgCamIndex = player->actor.params & 0xFF; + if (playerStartBgCamIndex != 0xFF) { + osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); + Camera_ChangeDataIdx(&play->mainCamera, playerStartBgCamIndex); } if (YREG(15) == 32) { @@ -591,7 +640,9 @@ void Play_Init(GameState* thisx) { gSaveContext.natureAmbienceId = play->sequenceCtx.natureAmbienceId; func_8002DF18(play, GET_PLAYER(play)); AnimationContext_Update(play, &play->animationCtx); + gSaveContext.respawnFlag = 0; + // #region SOH [Stats] if (gSaveContext.sohStats.sceneNum != gPlayState->sceneNum) { u16 idx = gSaveContext.sohStats.tsIdx; gSaveContext.sohStats.sceneTimestamps[idx].sceneTime = gSaveContext.sohStats.sceneTimer / 2; @@ -618,14 +669,20 @@ void Play_Init(GameState* thisx) { gSaveContext.sohStats.sceneNum = gPlayState->sceneNum; gSaveContext.sohStats.roomNum = gPlayState->roomCtx.curRoom.num; - gSaveContext.respawnFlag = 0; - #if 0 - if (dREG(95) != 0) { - D_8012D1F0 = D_801614D0; - osSyncPrintf("\nkawauso_data=[%x]", D_8012D1F0); - DmaMgr_DmaRomToRam(0x03FEB000, D_8012D1F0, sizeof(D_801614D0)); + // #endregion + +#if 0 + if (R_USE_DEBUG_CUTSCENE) { + static u64 sDebugCutsceneScriptBuf[0xA00]; + + gDebugCutsceneScript = sDebugCutsceneScriptBuf; + PRINTF("\nkawauso_data=[%x]", gDebugCutsceneScript); + + // This hardcoded ROM address extends past the end of the ROM file. + // Presumably the ROM was larger at a previous point in development when this debug feature was used. + DmaMgr_DmaRomToRam(0x03FEB000, gDebugCutsceneScript, sizeof(sDebugCutsceneScriptBuf)); } - #endif +#endif if (CVarGetInteger(CVAR_ENHANCEMENT("IvanCoopModeEnabled"), 0)) { Actor_Spawn(&play->actorCtx, play, gEnPartnerId, GET_PLAYER(play)->actor.world.pos.x, @@ -635,13 +692,9 @@ void Play_Init(GameState* thisx) { } void Play_Update(PlayState* play) { + Input* input = play->state.input; + s32 isPaused; s32 pad1; - s32 sp80; - Input* input; - u32 i; - s32 pad2; - - input = play->state.input; if ((SREG(1) < 0) || (DREG(0) != 0)) { SREG(1) = 0; @@ -649,20 +702,26 @@ void Play_Update(PlayState* play) { } if ((HREG(80) == 18) && (HREG(81) < 0)) { + u32 i; + s32 pad2; + HREG(81) = 0; osSyncPrintf("object_exchange_rom_address %u\n", gObjectTableSize); osSyncPrintf("RomStart RomEnd Size\n"); + for (i = 0; i < gObjectTableSize; i++) { ptrdiff_t size = gObjectTable[i].vromEnd - gObjectTable[i].vromStart; osSyncPrintf("%08x-%08x %08x(%8.3fKB)\n", gObjectTable[i].vromStart, gObjectTable[i].vromEnd, size, size / 1024.0f); } + osSyncPrintf("\n"); } if ((HREG(81) == 18) && (HREG(82) < 0)) { HREG(82) = 0; + // ActorOverlayTable_LogPrint(); } if (CVarGetInteger(CVAR_SETTING("FreeLook.Enabled"), 0) && Player_InCsMode(play)) { @@ -678,7 +737,7 @@ void Play_Update(PlayState* play) { play->transitionMode = TRANS_MODE_SETUP; } - // Gameplay stats: Count button presses + // #region SOH [Stats] Gameplay stats: Count button presses if (!gSaveContext.sohStats.gameComplete) { if (CHECK_BTN_ALL(input[0].press.button, BTN_A)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_A]++;} if (CHECK_BTN_ALL(input[0].press.button, BTN_B)) {gSaveContext.sohStats.count[COUNT_BUTTON_PRESSES_B]++;} @@ -703,6 +762,7 @@ void Play_Update(PlayState* play) { gSaveContext.sohStats.fileCreatedAt = GetUnixTimestamp(); } } + // #endregion if (gTrnsnUnkState != 0) { switch (gTrnsnUnkState) { @@ -722,18 +782,20 @@ void Play_Update(PlayState* play) { } } - if (play->transitionMode) { + if ((u32)play->transitionMode != TRANS_MODE_OFF) { switch (play->transitionMode) { case TRANS_MODE_SETUP: if (play->transitionTrigger != TRANS_TRIGGER_END) { - s16 sp6E = 0; + s16 sceneLayer = 0; Interface_ChangeAlpha(1); if (gSaveContext.cutsceneIndex >= 0xFFF0) { - sp6E = (gSaveContext.cutsceneIndex & 0xF) + 4; + sceneLayer = SCENE_LAYER_CUTSCENE_FIRST + (gSaveContext.cutsceneIndex & 0xF); } - if (!(gEntranceTable[play->nextEntranceIndex + sp6E].field & ENTRANCE_INFO_CONTINUE_BGM_FLAG)) { // Continue BGM Off + // fade out bgm if "continue bgm" flag is not set + if (!(gEntranceTable[play->nextEntranceIndex + sceneLayer].field & + ENTRANCE_INFO_CONTINUE_BGM_FLAG)) { // "Sound initalized. 111" osSyncPrintf("\n\n\nใ‚ตใ‚ฆใƒณใƒ‰ใ‚คใƒ‹ใ‚ทใƒฃใƒซๆฅใพใ—ใŸใ€‚111"); if ((play->transitionType < TRANS_TYPE_MAX) && !Environment_IsForcedSequenceDisabled()) { @@ -753,25 +815,30 @@ void Play_Update(PlayState* play) { } if (play->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) { + // non-instance modes break out of this switch break; } - + FALLTHROUGH; case TRANS_MODE_INSTANCE_INIT: play->transitionCtx.init(&play->transitionCtx.data); // Circle Transition Types if ((play->transitionCtx.transitionType >> 5) == 1) { play->transitionCtx.setType(&play->transitionCtx.data, - play->transitionCtx.transitionType | TC_SET_PARAMS); + play->transitionCtx.transitionType | TC_SET_PARAMS); } gSaveContext.transWipeSpeed = 14; + if ((play->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) || (play->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) { + //! @bug TRANS_TYPE_FILL_WHITE2 will never reach this code. + //! It is a non-instance type transition which doesn't run this case. gSaveContext.transWipeSpeed = 28; } gSaveContext.transFadeDuration = 60; + if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) || (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) { gSaveContext.transFadeDuration = 20; @@ -788,24 +855,28 @@ void Play_Update(PlayState* play) { (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) || (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) { play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(160, 160, 160, 255)); + if (play->transitionCtx.setEnvColor != NULL) { play->transitionCtx.setEnvColor(&play->transitionCtx.data, - RGBA8(160, 160, 160, 255)); + RGBA8(160, 160, 160, 255)); } } else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) { play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(140, 140, 100, 255)); + if (play->transitionCtx.setEnvColor != NULL) { play->transitionCtx.setEnvColor(&play->transitionCtx.data, - RGBA8(140, 140, 100, 255)); + RGBA8(140, 140, 100, 255)); } } else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) { play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(70, 100, 110, 255)); + if (play->transitionCtx.setEnvColor != NULL) { play->transitionCtx.setEnvColor(&play->transitionCtx.data, - RGBA8(70, 100, 110, 255)); + RGBA8(70, 100, 110, 255)); } } else { play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(0, 0, 0, 0)); + if (play->transitionCtx.setEnvColor != NULL) { play->transitionCtx.setEnvColor(&play->transitionCtx.data, RGBA8(0, 0, 0, 0)); } @@ -827,18 +898,20 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_INSTANCE_RUNNING: - if (play->transitionCtx.isDone(&play->transitionCtx) != 0) { + if (play->transitionCtx.isDone(&play->transitionCtx.data)) { if (play->transitionCtx.transitionType >= TRANS_TYPE_MAX) { if (play->transitionTrigger == TRANS_TRIGGER_END) { - play->transitionCtx.destroy(&play->transitionCtx); + play->transitionCtx.destroy(&play->transitionCtx.data); func_800BC88C(play); play->transitionMode = TRANS_MODE_OFF; } } else if (play->transitionTrigger != TRANS_TRIGGER_END) { - play->state.running = 0; - if (gSaveContext.gameMode != 2) { + play->state.running = false; + + if (gSaveContext.gameMode != GAMEMODE_FILE_SELECT) { SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState); gSaveContext.entranceIndex = play->nextEntranceIndex; + if (gSaveContext.minigameState == 1) { gSaveContext.minigameState = 3; } @@ -846,18 +919,20 @@ void Play_Update(PlayState* play) { SET_NEXT_GAMESTATE(&play->state, FileChoose_Init, FileChooseContext); } } else { - play->transitionCtx.destroy(&play->transitionCtx); + play->transitionCtx.destroy(&play->transitionCtx.data); func_800BC88C(play); play->transitionMode = TRANS_MODE_OFF; + if (gTrnsnUnkState == 3) { TransitionUnk_Destroy(&sTrnsnUnk); gTrnsnUnkState = 0; R_UPDATE_RATE = 3; } - + // Transition end for standard transitions GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum); } + play->transitionTrigger = TRANS_TRIGGER_OFF; } else { play->transitionCtx.update(&play->transitionCtx.data, R_UPDATE_RATE); @@ -865,13 +940,15 @@ void Play_Update(PlayState* play) { break; } + // update non-instance transitions switch (play->transitionMode) { case TRANS_MODE_FILL_WHITE_INIT: - D_801614C8 = 0; + sTransitionFillTimer = 0; play->envCtx.fillScreen = true; play->envCtx.screenFillColor[0] = 160; play->envCtx.screenFillColor[1] = 160; play->envCtx.screenFillColor[2] = 160; + if (play->transitionTrigger != TRANS_TRIGGER_END) { play->envCtx.screenFillColor[3] = 0; play->transitionMode = TRANS_MODE_FILL_IN; @@ -882,37 +959,40 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_FILL_IN: - play->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f; - if (D_801614C8 >= 20 && 1) { - play->state.running = 0; + play->envCtx.screenFillColor[3] = (sTransitionFillTimer / 20.0f) * 255.0f; + + if (sTransitionFillTimer >= 20) { + play->state.running = false; SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState); gSaveContext.entranceIndex = play->nextEntranceIndex; play->transitionTrigger = TRANS_TRIGGER_OFF; play->transitionMode = TRANS_MODE_OFF; } else { - D_801614C8++; + sTransitionFillTimer++; } break; case TRANS_MODE_FILL_OUT: - play->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f; - if (D_801614C8 >= 20 && 1) { + play->envCtx.screenFillColor[3] = (1 - sTransitionFillTimer / 20.0f) * 255.0f; + + if (sTransitionFillTimer >= 20) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; play->transitionTrigger = TRANS_TRIGGER_OFF; play->transitionMode = TRANS_MODE_OFF; play->envCtx.fillScreen = false; } else { - D_801614C8++; + sTransitionFillTimer++; } break; case TRANS_MODE_FILL_BROWN_INIT: - D_801614C8 = 0; + sTransitionFillTimer = 0; play->envCtx.fillScreen = true; play->envCtx.screenFillColor[0] = 170; play->envCtx.screenFillColor[1] = 160; play->envCtx.screenFillColor[2] = 150; + if (play->transitionTrigger != TRANS_TRIGGER_END) { play->envCtx.screenFillColor[3] = 0; play->transitionMode = TRANS_MODE_FILL_IN; @@ -956,8 +1036,9 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_SANDSTORM: - Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + if (play->transitionTrigger == TRANS_TRIGGER_END) { if (play->envCtx.sandstormPrimA < 110) { gTrnsnUnkState = 0; @@ -970,7 +1051,7 @@ void Play_Update(PlayState* play) { } } else { if (play->envCtx.sandstormEnvA == 255) { - play->state.running = 0; + play->state.running = false; SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState); gSaveContext.entranceIndex = play->nextEntranceIndex; play->transitionTrigger = TRANS_TRIGGER_OFF; @@ -993,8 +1074,9 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_SANDSTORM_END: - Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + if (play->transitionTrigger == TRANS_TRIGGER_END) { if (play->envCtx.sandstormPrimA <= 0) { gTrnsnUnkState = 0; @@ -1009,7 +1091,7 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_CS_BLACK_FILL_INIT: - D_801614C8 = 0; + sTransitionFillTimer = 0; play->envCtx.fillScreen = true; play->envCtx.screenFillColor[0] = 0; play->envCtx.screenFillColor[1] = 0; @@ -1021,7 +1103,8 @@ void Play_Update(PlayState* play) { case TRANS_MODE_CS_BLACK_FILL: if (gSaveContext.cutsceneTransitionControl != 0) { play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl; - if (gSaveContext.cutsceneTransitionControl < 0x65) { + + if (gSaveContext.cutsceneTransitionControl <= 100) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; play->transitionTrigger = TRANS_TRIGGER_OFF; @@ -1032,48 +1115,33 @@ void Play_Update(PlayState* play) { } } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3533); if (1 && (gTrnsnUnkState != 3)) { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3542); - if ((gSaveContext.gameMode == 0) && (play->msgCtx.msgMode == MSGMODE_NONE) && + if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (play->msgCtx.msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { KaleidoSetup_Update(play); } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - - sp80 = (play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0); - - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3551); + isPaused = (play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0); + PLAY_LOG(3555); AnimationContext_Reset(&play->animationCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3561); Object_UpdateBank(&play->objectCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3577); - if ((sp80 == 0) && (IREG(72) == 0)) { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + if (!isPaused && (IREG(72) == 0)) { + PLAY_LOG(3580); play->gameplayFrames++; + func_800AA178(true); + // Gameplay stat tracking if (!gSaveContext.sohStats.gameComplete && (!IS_BOSS_RUSH || !gSaveContext.isBossRushPaused)) { @@ -1086,12 +1154,10 @@ void Play_Update(PlayState* play) { } } - func_800AA178(1); - if (play->actorCtx.freezeFlashTimer && (play->actorCtx.freezeFlashTimer-- < 5)) { osSyncPrintf("FINISH=%d\n", play->actorCtx.freezeFlashTimer); - if ((play->actorCtx.freezeFlashTimer > 0) && - ((play->actorCtx.freezeFlashTimer % 2) != 0)) { + + if ((play->actorCtx.freezeFlashTimer > 0) && ((play->actorCtx.freezeFlashTimer % 2) != 0)) { play->envCtx.fillScreen = true; play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] = play->envCtx.screenFillColor[2] = 150; @@ -1100,91 +1166,52 @@ void Play_Update(PlayState* play) { play->envCtx.fillScreen = false; } } else { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3606); func_800973FC(play, &play->roomCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3612); CollisionCheck_AT(play, &play->colChkCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3618); CollisionCheck_OC(play, &play->colChkCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3624); CollisionCheck_Damage(play, &play->colChkCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3631); CollisionCheck_ClearContext(play, &play->colChkCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3637); - if (play->unk_11DE9 == 0) { + if (!play->unk_11DE9) { Actor_UpdateAll(play, &play->actorCtx); } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3643); func_80064558(play, &play->csCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3648); func_800645A0(play, &play->csCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3651); Effect_UpdateAll(play); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3657); EffectSs_UpdateAll(play); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3662); } } else { - func_800AA178(0); - } - - if (1 && HREG(63)) { - LOG_NUM("1", 1); + func_800AA178(false); } + PLAY_LOG(3672); func_80095AA0(play, &play->roomCtx.curRoom, &input[1], 0); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3675); func_80095AA0(play, &play->roomCtx.prevRoom, &input[1], 1); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3677); if (play->unk_1242B != 0) { if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) { @@ -1195,124 +1222,82 @@ void Play_Update(PlayState* play) { // "Changing viewpoint is prohibited during the cutscene" osSyncPrintf(VT_FGCOL(CYAN) "ใƒ‡ใƒขไธญใซใคใ่ฆ–็‚นๅค‰ๆ›ดใ‚’็ฆๆญขใ—ใฆใŠใ‚Šใพใ™\n" VT_RST); } else if (YREG(15) == 0x10) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } else { - func_800BC490(play, play->unk_1242B ^ 3); + // C-Up toggle for houses, move between pivot camera and fixed camera + // Toggle viewpoint between VIEWPOINT_LOCKED and VIEWPOINT_PIVOT + Play_SetViewpoint(play, play->unk_1242B ^ 3); } } - func_800BC450(play); - } - - if (1 && HREG(63)) { - LOG_NUM("1", 1); + + Play_RequestViewpointBgCam(play); } + PLAY_LOG(3708); SkyboxDraw_Update(&play->skyboxCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3716); if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3721); KaleidoScopeCall_Update(play); } else if (play->gameOverCtx.state != GAMEOVER_INACTIVE) { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3727); GameOver_Update(play); } else { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3733); Message_Update(play); } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3737); + PLAY_LOG(3742); Interface_Update(play); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3765); AnimationContext_Update(play, &play->animationCtx); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3771); SoundSource_UpdateAll(play); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3777); ShrinkWindow_Update(R_UPDATE_RATE); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3783); TransitionFade_Update(&play->transitionFade, R_UPDATE_RATE); } else { goto skip; } } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3799); skip: - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3801); - if ((sp80 == 0) || (gDbgCamEnabled)) { - s32 pad3[5]; + if (!isPaused || gDbgCamEnabled) { s32 i; play->nextCamera = play->activeCamera; - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3806); for (i = 0; i < NUM_CAMS; i++) { if ((i != play->nextCamera) && (play->cameraPtrs[i] != NULL)) { - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(3809); Camera_Update(play->cameraPtrs[i]); } } Camera_Update(play->cameraPtrs[play->nextCamera]); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(3814); } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - - Environment_Update(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx, - &play->gameOverCtx, play->state.gfxCtx); + PLAY_LOG(3816); + Environment_Update(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx, &play->gameOverCtx, + play->state.gfxCtx); } void Play_DrawOverlayElements(PlayState* play) { @@ -1320,7 +1305,7 @@ void Play_DrawOverlayElements(PlayState* play) { KaleidoScopeCall_Draw(play); } - if (gSaveContext.gameMode == 0) { + if (gSaveContext.gameMode == GAMEMODE_NORMAL) { Interface_Draw(play); } @@ -1405,12 +1390,11 @@ void Play_Draw(PlayState* play) { Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); Matrix_Get(&play->viewProjectionMtxF); play->billboardMtxF.mf[0][3] = play->billboardMtxF.mf[1][3] = play->billboardMtxF.mf[2][3] = - play->billboardMtxF.mf[3][0] = play->billboardMtxF.mf[3][1] = play->billboardMtxF.mf[3][2] = - 0.0f; + play->billboardMtxF.mf[3][0] = play->billboardMtxF.mf[3][1] = play->billboardMtxF.mf[3][2] = 0.0f; // This transpose is where the viewing matrix is properly converted into a billboard matrix Matrix_Transpose(&play->billboardMtxF); play->billboardMtx = Matrix_MtxFToMtx(MATRIX_CHECKFLOATS(&play->billboardMtxF), - Graph_Alloc(gfxCtx, sizeof(Mtx))); + Graph_Alloc(gfxCtx, sizeof(Mtx))); gSPSegment(POLY_OPA_DISP++, 0x01, play->billboardMtx); @@ -1422,7 +1406,8 @@ void Play_Draw(PlayState* play) { gSPDisplayList(OVERLAY_DISP++, gfxP); gSPGrayscale(gfxP++, false); - if ((play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || (play->transitionMode == TRANS_MODE_INSTANCE_WAIT) || + if ((play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || + (play->transitionMode == TRANS_MODE_INSTANCE_WAIT) || (play->transitionCtx.transitionType >= TRANS_TYPE_MAX)) { View view; @@ -1438,6 +1423,8 @@ void Play_Draw(PlayState* play) { TransitionFade_Draw(&play->transitionFade, &gfxP); if (D_801614B0.a > 0) { + // gPlayVisMono.vis.primColor.rgba = D_801614B0.rgba; + // VisMono_Draw(&gPlayVisMono, &gfxP); gDPSetGrayscaleColor(gfxP++, D_801614B0.r, D_801614B0.g, D_801614B0.b, D_801614B0.a); gSPGrayscale(gfxP++, true); } @@ -1453,189 +1440,191 @@ void Play_Draw(PlayState* play) { TransitionUnk_Draw(&sTrnsnUnk, &sp88); POLY_OPA_DISP = sp88; goto Play_Draw_DrawOverlayElements; - } else { - PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, gfxCtx->curFrameBuffer, - gZBuffer); + } - if (R_PAUSE_MENU_MODE == 2) { - MsgEvent_SendNullTask(); - PreRender_Calc(&play->pauseBgPreRender); - R_PAUSE_MENU_MODE = 3; - } else if (R_PAUSE_MENU_MODE >= 4) { - R_PAUSE_MENU_MODE = 0; - } + PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, gfxCtx->curFrameBuffer, gZBuffer); - if (R_PAUSE_MENU_MODE == 3) { - Gfx* sp84 = POLY_OPA_DISP; + if (R_PAUSE_MENU_MODE == 2) { + // Wait for the previous frame's display list to be processed, + // so that `pauseBgPreRender.fbufSave` and `pauseBgPreRender.cvgSave` are filled with the appropriate + // content and can be used by `PreRender_ApplyFilters` below. + MsgEvent_SendNullTask(); - // SOH [Port] Draw game framebuffer using our custom handling - //func_800C24BC(&play->pauseBgPreRender, &sp84); - FB_DrawFromFramebuffer(&sp84, gPauseFrameBuffer, 255); - POLY_OPA_DISP = sp84; + PreRender_Calc(&play->pauseBgPreRender); - goto Play_Draw_DrawOverlayElements; - } else { - s32 sp80; + R_PAUSE_MENU_MODE = 3; + } else if (R_PAUSE_MENU_MODE >= 4) { + R_PAUSE_MENU_MODE = 0; + } - if ((HREG(80) != 10) || (HREG(83) != 0)) { - if (play->skyboxId && (play->skyboxId != SKYBOX_UNSET_1D) && - !play->envCtx.skyboxDisabled) { - if ((play->skyboxId == SKYBOX_NORMAL_SKY) || - (play->skyboxId == SKYBOX_CUTSCENE_MAP)) { - Environment_UpdateSkybox(play, play->skyboxId, &play->envCtx, &play->skyboxCtx); + if (R_PAUSE_MENU_MODE == 3) { + Gfx* gfxP = POLY_OPA_DISP; - SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, - play->envCtx.skyboxBlend, play->view.eye.x, play->view.eye.y, - play->view.eye.z); - } else if (play->skyboxCtx.unk_140 == 0) { - SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0, - play->view.eye.x, play->view.eye.y, play->view.eye.z); - } - } - } + // SOH [Port] Draw game framebuffer using our custom handling + //func_800C24BC(&play->pauseBgPreRender, &gfxP); + FB_DrawFromFramebuffer(&gfxP, gPauseFrameBuffer, 255); + POLY_OPA_DISP = gfxP; - if ((HREG(80) != 10) || (HREG(90) & 2)) { - if (!play->envCtx.sunMoonDisabled) { - Environment_DrawSunAndMoon(play); - } - } + goto Play_Draw_DrawOverlayElements; + } - if ((HREG(80) != 10) || (HREG(90) & 1)) { - Environment_DrawSkyboxFilters(play); - } - - if ((HREG(80) != 10) || (HREG(90) & 4)) { - Environment_UpdateLightningStrike(play); - Environment_DrawLightning(play, 0); - } - - if ((HREG(80) != 10) || (HREG(90) & 8)) { - sp228 = LightContext_NewLights(&play->lightCtx, gfxCtx); - Lights_BindAll(sp228, play->lightCtx.listHead, NULL); - Lights_Draw(sp228, gfxCtx); - } - - if ((HREG(80) != 10) || (HREG(84) != 0)) { - if (VREG(94) == 0) { - if (HREG(80) != 10) { - sp80 = 3; - } else { - sp80 = HREG(84); - } - Scene_Draw(play); - Room_Draw(play, &play->roomCtx.curRoom, sp80 & 3); - Room_Draw(play, &play->roomCtx.prevRoom, sp80 & 3); - } - } - - if ((HREG(80) != 10) || (HREG(83) != 0)) { - if ((play->skyboxCtx.unk_140 != 0) && - (GET_ACTIVE_CAM(play)->setting != CAM_SET_PREREND_FIXED)) { - Vec3f sp74; - - Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(play)); - SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0, - play->view.eye.x + sp74.x, play->view.eye.y + sp74.y, - play->view.eye.z + sp74.z); - } - } - - if (play->envCtx.unk_EE[1] != 0) { - Environment_DrawRain(play, &play->view, gfxCtx); - } - - if ((HREG(80) != 10) || (HREG(84) != 0)) { - Environment_FillScreen(gfxCtx, 0, 0, 0, play->unk_11E18, FILL_SCREEN_OPA); - } - - if ((HREG(80) != 10) || (HREG(85) != 0)) { - func_800315AC(play, &play->actorCtx); - } - - if ((HREG(80) != 10) || (HREG(86) != 0)) { - if (!play->envCtx.sunMoonDisabled) { - sp21C.x = play->view.eye.x + play->envCtx.sunPos.x; - sp21C.y = play->view.eye.y + play->envCtx.sunPos.y; - sp21C.z = play->view.eye.z + play->envCtx.sunPos.z; - Environment_DrawSunLensFlare(play, &play->envCtx, &play->view, gfxCtx, sp21C, 0); - } - Environment_DrawCustomLensFlare(play); - } - - if ((HREG(80) != 10) || (HREG(87) != 0)) { - if (MREG(64) != 0) { - Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), - FILL_SCREEN_OPA | FILL_SCREEN_XLU); - } - - switch (play->envCtx.fillScreen) { - case 1: - Environment_FillScreen( - gfxCtx, play->envCtx.screenFillColor[0], play->envCtx.screenFillColor[1], - play->envCtx.screenFillColor[2], play->envCtx.screenFillColor[3], - FILL_SCREEN_OPA | FILL_SCREEN_XLU); - break; - default: - break; - } - } - - if ((HREG(80) != 10) || (HREG(88) != 0)) { - if (play->envCtx.sandstormState != SANDSTORM_OFF) { - Environment_DrawSandstorm(play, play->envCtx.sandstormState); - } - } - - if ((HREG(80) != 10) || (HREG(93) != 0)) { - DebugDisplay_DrawObjects(play); - } - - if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) { - Gfx* sp70 = OVERLAY_DISP; - - play->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer; - play->pauseBgPreRender.fbufSave = (u16*)gZBuffer; - // SOH [Port] Use our custom copy method instead of the prerender system - // func_800C1F20(&play->pauseBgPreRender, &sp70); - if (R_PAUSE_MENU_MODE == 1) { - play->pauseBgPreRender.cvgSave = (u8*)gfxCtx->curFrameBuffer; - // func_800C20B4(&play->pauseBgPreRender, &sp70); - R_PAUSE_MENU_MODE = 2; - - // #region SOH [Port] Custom handling for pause prerender background capture - lastPauseWidth = OTRGetGameRenderWidth(); - lastPauseHeight = OTRGetGameRenderHeight(); - hasCapturedPauseBuffer = false; - - FB_CopyToFramebuffer(&sp70, 0, gPauseFrameBuffer, false, &hasCapturedPauseBuffer); - - // Set the state back to ready after the recapture is done - if (recapturePauseBuffer) { - R_PAUSE_MENU_MODE = 3; - } - // #endregion - } else { - gTrnsnUnkState = 2; - } - OVERLAY_DISP = sp70; - play->unk_121C7 = 2; - SREG(33) |= 1; - - // 2S2H [Port] Continue to render the post world for pausing to avoid flashing the HUD - if (!(gTrnsnUnkState == 1)) { - goto Play_Draw_DrawOverlayElements; - } - } else if (R_PAUSE_MENU_MODE != 3) { - Play_Draw_DrawOverlayElements: - if ((HREG(80) != 10) || (HREG(89) != 0)) { - Play_DrawOverlayElements(play); - } + if ((HREG(80) != 10) || (HREG(83) != 0)) { + if (play->skyboxId && (play->skyboxId != SKYBOX_UNSET_1D) && !play->envCtx.skyboxDisabled) { + if ((play->skyboxId == SKYBOX_NORMAL_SKY) || (play->skyboxId == SKYBOX_CUTSCENE_MAP)) { + Environment_UpdateSkybox(play, play->skyboxId, &play->envCtx, &play->skyboxCtx); + SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, play->envCtx.skyboxBlend, + play->view.eye.x, play->view.eye.y, play->view.eye.z); + } else if (play->skyboxCtx.unk_140 == 0) { + SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0, play->view.eye.x, play->view.eye.y, + play->view.eye.z); } } } + if ((HREG(80) != 10) || (HREG(90) & 2)) { + if (!play->envCtx.sunMoonDisabled) { + Environment_DrawSunAndMoon(play); + } + } + + if ((HREG(80) != 10) || (HREG(90) & 1)) { + Environment_DrawSkyboxFilters(play); + } + + if ((HREG(80) != 10) || (HREG(90) & 4)) { + Environment_UpdateLightningStrike(play); + Environment_DrawLightning(play, 0); + } + + if ((HREG(80) != 10) || (HREG(90) & 8)) { + sp228 = LightContext_NewLights(&play->lightCtx, gfxCtx); + Lights_BindAll(sp228, play->lightCtx.listHead, NULL); + Lights_Draw(sp228, gfxCtx); + } + + if ((HREG(80) != 10) || (HREG(84) != 0)) { + if (VREG(94) == 0) { + s32 roomDrawFlags; + + if (HREG(80) != 10) { + roomDrawFlags = 3; + } else { + roomDrawFlags = HREG(84); + } + Scene_Draw(play); + Room_Draw(play, &play->roomCtx.curRoom, roomDrawFlags & 3); + Room_Draw(play, &play->roomCtx.prevRoom, roomDrawFlags & 3); + } + } + + if ((HREG(80) != 10) || (HREG(83) != 0)) { + if ((play->skyboxCtx.unk_140 != 0) && + (GET_ACTIVE_CAM(play)->setting != CAM_SET_PREREND_FIXED)) { + Vec3f quakeOffset; + + Camera_GetSkyboxOffset(&quakeOffset, GET_ACTIVE_CAM(play)); + SkyboxDraw_Draw(&play->skyboxCtx, gfxCtx, play->skyboxId, 0, play->view.eye.x + quakeOffset.x, + play->view.eye.y + quakeOffset.y, play->view.eye.z + quakeOffset.z); + } + } + + if (play->envCtx.unk_EE[1] != 0) { + Environment_DrawRain(play, &play->view, gfxCtx); + } + + if ((HREG(80) != 10) || (HREG(84) != 0)) { + Environment_FillScreen(gfxCtx, 0, 0, 0, play->unk_11E18, FILL_SCREEN_OPA); + } + + if ((HREG(80) != 10) || (HREG(85) != 0)) { + func_800315AC(play, &play->actorCtx); + } + + if ((HREG(80) != 10) || (HREG(86) != 0)) { + if (!play->envCtx.sunMoonDisabled) { + sp21C.x = play->view.eye.x + play->envCtx.sunPos.x; + sp21C.y = play->view.eye.y + play->envCtx.sunPos.y; + sp21C.z = play->view.eye.z + play->envCtx.sunPos.z; + Environment_DrawSunLensFlare(play, &play->envCtx, &play->view, gfxCtx, sp21C, 0); + } + Environment_DrawCustomLensFlare(play); + } + + if ((HREG(80) != 10) || (HREG(87) != 0)) { + if (MREG(64) != 0) { + Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), + FILL_SCREEN_OPA | FILL_SCREEN_XLU); + } + + switch (play->envCtx.fillScreen) { + case 1: + Environment_FillScreen(gfxCtx, play->envCtx.screenFillColor[0], play->envCtx.screenFillColor[1], + play->envCtx.screenFillColor[2], play->envCtx.screenFillColor[3], + FILL_SCREEN_OPA | FILL_SCREEN_XLU); + break; + default: + break; + } + } + + if ((HREG(80) != 10) || (HREG(88) != 0)) { + if (play->envCtx.sandstormState != SANDSTORM_OFF) { + Environment_DrawSandstorm(play, play->envCtx.sandstormState); + } + } + + if ((HREG(80) != 10) || (HREG(93) != 0)) { + DebugDisplay_DrawObjects(play); + } + + if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) { + Gfx* gfxP = OVERLAY_DISP; + + // Copy the frame buffer contents at this point in the display list to the zbuffer + // The zbuffer must then stay untouched until unpausing + play->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer; + play->pauseBgPreRender.fbufSave = (u16*)gZBuffer; + // SOH [Port] Use our custom copy method instead of the prerender system + // func_800C1F20(&play->pauseBgPreRender, &gfxP); + if (R_PAUSE_MENU_MODE == 1) { + play->pauseBgPreRender.cvgSave = (u8*)gfxCtx->curFrameBuffer; + // func_800C20B4(&play->pauseBgPreRender, &gfxP); + R_PAUSE_MENU_MODE = 2; + + // #region SOH [Port] Custom handling for pause prerender background capture + lastPauseWidth = OTRGetGameRenderWidth(); + lastPauseHeight = OTRGetGameRenderHeight(); + hasCapturedPauseBuffer = false; + + FB_CopyToFramebuffer(&gfxP, 0, gPauseFrameBuffer, false, &hasCapturedPauseBuffer); + + // Set the state back to ready after the recapture is done + if (recapturePauseBuffer) { + R_PAUSE_MENU_MODE = 3; + } + // #endregion + } else { + gTrnsnUnkState = 2; + } + OVERLAY_DISP = gfxP; + play->unk_121C7 = 2; + SREG(33) |= 1; + + // 2S2H [Port] Continue to render the post world for pausing to avoid flashing the HUD + if (gTrnsnUnkState == 2) { + goto Play_Draw_skip; + } + } + + // Draw Enhancements that need to be placed in the world. This happens before the PostWorldDraw + // so that they aren't drawn when the pause menu is up (e.g. collision viewer, actor name tags) GameInteractor_ExecuteOnPlayDrawEnd(); + Play_Draw_DrawOverlayElements: + if ((HREG(80) != 10) || (HREG(89) != 0)) { + Play_DrawOverlayElements(play); + } + // Reset the inverted culling if (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) { gSPClearExtraGeometryMode(POLY_OPA_DISP++, G_EX_INVERT_CULLING); @@ -1643,13 +1632,14 @@ void Play_Draw(PlayState* play) { } } +Play_Draw_skip: + if (play->view.unk_124 != 0) { Camera_Update(GET_ACTIVE_CAM(play)); func_800AB944(&play->view); play->view.unk_124 = 0; if (play->skyboxId && (play->skyboxId != SKYBOX_UNSET_1D) && !play->envCtx.skyboxDisabled) { - SkyboxDraw_UpdateMatrix(&play->skyboxCtx, play->view.eye.x, play->view.eye.y, - play->view.eye.z); + SkyboxDraw_UpdateMatrix(&play->skyboxCtx, play->view.eye.x, play->view.eye.y, play->view.eye.z); } } @@ -1689,9 +1679,7 @@ void Play_Main(GameState* thisx) { DebugDisplay_Init(); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(4556); if ((HREG(80) == 10) && (HREG(94) != 10)) { HREG(81) = 1; @@ -1714,18 +1702,14 @@ void Play_Main(GameState* thisx) { Play_Update(play); } - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } + PLAY_LOG(4583); FrameInterpolation_StartRecord(); Play_Draw(play); FrameInterpolation_StopRecord(); - if (1 && HREG(63)) { - LOG_NUM("1", 1); - } - + PLAY_LOG(4587); + if (CVarGetInteger(CVAR_CHEAT("TimeSync"), 0)) { const int maxRealDaySeconds = 86400; const int maxInGameDayTicks = 65536; @@ -1750,23 +1734,18 @@ s32 Play_InCsMode(PlayState* play) { return (play->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(play); } -f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec) { +f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* pos) { CollisionPoly poly; f32 temp1; f32 temp2; f32 temp3; - f32 floorY; - f32 nx; - f32 ny; - f32 nz; - s32 pad[5]; - - floorY = BgCheck_AnyRaycastFloor1(&play->colCtx, &poly, vec); + f32 floorY = BgCheck_AnyRaycastFloor1(&play->colCtx, &poly, pos); if (floorY > BGCHECK_Y_MIN) { - nx = COLPOLY_GET_NORMAL(poly.normal.x); - ny = COLPOLY_GET_NORMAL(poly.normal.y); - nz = COLPOLY_GET_NORMAL(poly.normal.z); + f32 nx = COLPOLY_GET_NORMAL(poly.normal.x); + f32 ny = COLPOLY_GET_NORMAL(poly.normal.y); + f32 nz = COLPOLY_GET_NORMAL(poly.normal.z); + s32 pad[5]; temp1 = sqrtf(1.0f - SQ(nx)); @@ -1790,9 +1769,9 @@ f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec) { mf->wy = 0.0f; mf->xz = 0.0f; mf->wz = 0.0f; - mf->xw = vec->x; + mf->xw = pos->x; mf->yw = floorY; - mf->zw = vec->z; + mf->zw = pos->z; mf->ww = 1.0f; } else { mf->xy = 0.0f; @@ -1807,9 +1786,9 @@ f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec) { mf->yz = 0.0f; mf->zy = 0.0f; mf->yy = 1.0f; - mf->xw = vec->x; - mf->yw = vec->y; - mf->zw = vec->z; + mf->xw = pos->x; + mf->yw = pos->y; + mf->zw = pos->z; mf->ww = 1.0f; } @@ -1832,16 +1811,18 @@ void Play_InitEnvironment(PlayState* play, s16 skyboxId) { Environment_Init(play, &play->envCtx, 0); } -void Play_InitScene(PlayState* play, s32 spawn) -{ +void Play_InitScene(PlayState* play, s32 spawn) { play->curSpawn = spawn; + play->linkActorEntry = NULL; play->unk_11DFC = NULL; play->setupEntranceList = NULL; play->setupExitList = NULL; play->cUpElfMsgs = NULL; play->setupPathList = NULL; + play->numSetupActors = 0; + Object_InitBank(play, &play->objectCtx); LightContext_Init(play, &play->lightCtx); TransitionActor_InitContext(&play->state, &play->transiActorCtx); @@ -1852,29 +1833,28 @@ void Play_InitScene(PlayState* play, s32 spawn) Play_InitEnvironment(play, play->skyboxId); } -void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) { +void Play_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { uint8_t mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF); int16_t mqModeScene = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQModeScene"), -1); - if (mqMode != WARP_MODE_OVERRIDE_OFF && sceneNum != mqModeScene) { + if (mqMode != WARP_MODE_OVERRIDE_OFF && sceneId != mqModeScene) { CVarClear(CVAR_GENERAL("BetterDebugWarpScreenMQMode")); CVarClear(CVAR_GENERAL("BetterDebugWarpScreenMQModeScene")); } - OTRPlay_SpawnScene(play, sceneNum, spawn); + OTRPlay_SpawnScene(play, sceneId, spawn); } void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest) { - f32 temp; + f32 w; Matrix_Mult(&play->viewProjectionMtxF, MTXMODE_NEW); Matrix_MultVec3f(src, dest); - temp = play->viewProjectionMtxF.ww + - (play->viewProjectionMtxF.wx * src->x + play->viewProjectionMtxF.wy * src->y + - play->viewProjectionMtxF.wz * src->z); + w = play->viewProjectionMtxF.ww + (play->viewProjectionMtxF.wx * src->x + play->viewProjectionMtxF.wy * src->y + + play->viewProjectionMtxF.wz * src->z); - dest->x = 160.0f + ((dest->x / temp) * 160.0f); - dest->y = 120.0f + ((dest->y / temp) * 120.0f); + dest->x = (SCREEN_WIDTH / 2) + ((dest->x / w) * (SCREEN_WIDTH / 2)); + dest->y = (SCREEN_HEIGHT / 2) - ((dest->y / w) * (SCREEN_HEIGHT / 2)); } s16 Play_CreateSubCamera(PlayState* play) { @@ -2097,8 +2077,8 @@ void Play_SaveSceneFlags(PlayState* play) { savedSceneFlags->collect = play->actorCtx.flags.collect; } -void Play_SetRespawnData(PlayState* play, s32 respawnMode, s16 entranceIndex, s32 roomIndex, - s32 playerParams, Vec3f* pos, s16 yaw) { +void Play_SetRespawnData(PlayState* play, s32 respawnMode, s16 entranceIndex, s32 roomIndex, s32 playerParams, + Vec3f* pos, s16 yaw) { RespawnData* respawnData = &gSaveContext.respawn[respawnMode]; respawnData->entranceIndex = entranceIndex; @@ -2118,8 +2098,8 @@ void Play_SetupRespawnPoint(PlayState* play, s32 respawnMode, s32 playerParams) if ((play->sceneNum != SCENE_FAIRYS_FOUNTAIN) && (play->sceneNum != SCENE_GROTTOS)) { roomIndex = play->roomCtx.curRoom.num; entranceIndex = gSaveContext.entranceIndex; - Play_SetRespawnData(play, respawnMode, entranceIndex, roomIndex, playerParams, - &player->actor.world.pos, player->actor.shape.rot.y); + Play_SetRespawnData(play, respawnMode, entranceIndex, roomIndex, playerParams, &player->actor.world.pos, + player->actor.shape.rot.y); } } @@ -2136,12 +2116,15 @@ void Play_LoadToLastEntrance(PlayState* play) { gSaveContext.respawnFlag = -1; play->transitionTrigger = TRANS_TRIGGER_START; - if ((play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_INTERIOR) || (play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) || + if ((play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_INTERIOR) || + (play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) || (play->sceneNum == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (play->sceneNum == SCENE_GANON_BOSS)) { play->nextEntranceIndex = ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0; Item_Give(play, ITEM_SWORD_MASTER); - } else if ((gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_11) || (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_12) || - (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_13) || (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_15)) { + } else if ((gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_11) || + (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_12) || + (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_13) || + (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_15)) { play->nextEntranceIndex = ENTR_HYRULE_FIELD_CENTER_EXIT; } else { play->nextEntranceIndex = gSaveContext.entranceIndex; diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 477d60d64..9d8a3b2e0 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1097,7 +1097,7 @@ void func_80A0461C(EnElf* this, PlayState* play) { } else { arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor; - if ((player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) || ((YREG(15) & 0x10) && func_800BC56C(play, 2))) { + if ((player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) || ((YREG(15) & 0x10) && Play_CheckViewpoint(play, 2))) { temp = 12; this->unk_2C0 = 100; } else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) { diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 5049a05d6..171a6405d 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -679,7 +679,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; - func_800BC490(play, 1); + Play_SetViewpoint(play, 1); Interface_ChangeAlpha(50); this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; @@ -763,7 +763,7 @@ void EnOssan_State_Idle(EnOssan* this, PlayState* play, Player* player) { // "Start conversation!!" osSyncPrintf(VT_FGCOL(YELLOW) "โ˜…โ˜…โ˜… ไผš่ฉฑ้–‹ๅง‹๏ผ๏ผ โ˜…โ˜…โ˜…" VT_RST "\n"); player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; - func_800BC590(play); + Play_SetShopBrowsingViewpoint(play); EnOssan_SetStateStartShopping(play, this, false); } else if (this->actor.xzDistToPlayer < 100.0f) { func_8002F2CC(&this->actor, play, 100); @@ -1392,7 +1392,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; - func_800BC490(play, 1); + Play_SetViewpoint(play, 1); Interface_ChangeAlpha(50); this->drawCursor = 0; EnOssan_UpdateCameraDirection(this, play, 0.0f); @@ -1770,7 +1770,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player osSyncPrintf(VT_FGCOL(YELLOW) "โ˜…โ˜…โ˜… ็ถšใ‘ใ‚‹ใ‚ˆ๏ผ๏ผ โ˜…โ˜…โ˜…" VT_RST "\n"); player->actor.shape.rot.y += 0x8000; player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; - func_800BC490(play, 2); + Play_SetViewpoint(play, 2); Message_StartTextbox(play, this->actor.textId, &this->actor); EnOssan_SetStateStartShopping(play, this, true); func_8002F298(&this->actor, play, 100.0f, -1); @@ -1789,7 +1789,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player selectedItem->updateStockedItemFunc(play, selectedItem); player->actor.shape.rot.y += 0x8000; player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; - func_800BC490(play, 2); + Play_SetViewpoint(play, 2); Message_StartTextbox(play, this->actor.textId, &this->actor); EnOssan_SetStateStartShopping(play, this, true); func_8002F298(&this->actor, play, 100.0f, -1); From 068cceff3617d5f52c0ac670027f336e093b0152 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Fri, 8 Nov 2024 22:36:57 -0500 Subject: [PATCH 08/11] Update SFX symbols from decomp (#4531) --- soh/include/functions.h | 6 +- soh/include/variables.h | 6 +- .../SkipCutscene/Story/SkipDekuTreeIntro.cpp | 2 +- soh/soh/Enhancements/debugger/actorViewer.cpp | 4 +- .../GameInteractor_RawAction.cpp | 2 +- soh/soh/Enhancements/kaleido.cpp | 6 +- soh/soh/Enhancements/mods.cpp | 6 +- .../Enhancements/randomizer/hook_handlers.cpp | 2 +- .../Enhancements/timesaver_hook_handlers.cpp | 8 +- soh/soh/Enhancements/tts/tts.cpp | 2 +- soh/soh/Notification/Notification.cpp | 2 +- soh/src/code/code_800EC960.c | 62 ++++---- soh/src/code/code_800F7260.c | 8 +- soh/src/code/db_camera.c | 140 +++++++++--------- soh/src/code/z_actor.c | 30 ++-- soh/src/code/z_camera.c | 18 +-- soh/src/code/z_collision_check.c | 48 +++--- soh/src/code/z_demo.c | 18 +-- soh/src/code/z_en_item00.c | 4 +- soh/src/code/z_fbdemo_circle.c | 4 +- soh/src/code/z_kankyo.c | 8 +- soh/src/code/z_lib.c | 15 +- soh/src/code/z_lifemeter.c | 2 +- soh/src/code/z_map_exp.c | 16 +- soh/src/code/z_message_PAL.c | 116 +++++++-------- soh/src/code/z_onepointdemo.c | 2 +- soh/src/code/z_parameter.c | 68 ++++----- soh/src/code/z_play.c | 16 +- soh/src/code/z_sound_source.c | 2 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 12 +- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 2 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 4 +- .../actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c | 4 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 14 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 8 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 4 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 2 +- .../overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 4 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 2 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 10 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 2 +- .../z_bg_hidan_kowarerukabe.c | 2 +- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 2 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 2 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 2 +- .../ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c | 2 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 2 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 2 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 4 +- .../z_bg_mori_kaitenkabe.c | 4 +- .../z_bg_mori_rakkatenjo.c | 4 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 4 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 4 +- .../z_bg_spot01_idohashira.c | 2 +- .../z_bg_spot01_idomizu.c | 4 +- .../z_bg_spot02_objects.c | 2 +- .../z_bg_spot06_objects.c | 2 +- .../z_bg_spot08_bakudankabe.c | 2 +- .../z_bg_spot11_bakudankabe.c | 2 +- .../ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c | 2 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../z_bg_spot16_bombstone.c | 2 +- .../z_bg_spot17_bakudankabe.c | 2 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 4 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 2 +- .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 4 +- .../actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c | 4 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 2 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 4 +- soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 4 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 +- .../overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 48 +++--- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 44 +++--- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 54 +++---- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 2 +- .../overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 36 ++--- .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 2 +- .../overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 56 +++---- .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 2 +- .../overlays/actors/ovl_Demo_6K/z_demo_6k.c | 2 +- .../overlays/actors/ovl_Demo_Du/z_demo_du.c | 22 +-- .../actors/ovl_Demo_Effect/z_demo_effect.c | 12 +- .../overlays/actors/ovl_Demo_Ext/z_demo_ext.c | 4 +- .../overlays/actors/ovl_Demo_Go/z_demo_go.c | 4 +- .../overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 12 +- .../overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 16 +- .../overlays/actors/ovl_Demo_Im/z_demo_im.c | 4 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 6 +- .../actors/ovl_Demo_Kekkai/z_demo_kekkai.c | 2 +- .../overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 2 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 4 +- .../overlays/actors/ovl_Door_Ana/z_door_ana.c | 2 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 8 +- .../actors/ovl_Efc_Erupc/z_efc_erupc.c | 2 +- soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- .../actors/ovl_En_Bdfire/z_en_bdfire.c | 4 +- .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 2 +- soh/src/overlays/actors/ovl_En_Box/z_en_box.c | 10 +- soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c | 2 +- .../ovl_En_Diving_Game/z_en_diving_game.c | 2 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 4 +- .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 6 +- soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c | 2 +- soh/src/overlays/actors/ovl_En_Du/z_en_du.c | 2 +- soh/src/overlays/actors/ovl_En_Eg/z_en_eg.c | 2 +- soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 2 +- .../actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c | 10 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 14 +- soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c | 8 +- soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 12 +- soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 +- soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 +- .../overlays/actors/ovl_En_GeldB/z_en_geldb.c | 4 +- soh/src/overlays/actors/ovl_En_Go/z_en_go.c | 16 +- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 18 +-- .../overlays/actors/ovl_En_Goma/z_en_goma.c | 2 +- soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c | 8 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 4 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 4 +- .../actors/ovl_En_Heishi3/z_en_heishi3.c | 4 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- .../overlays/actors/ovl_En_Horse/z_en_horse.c | 126 ++++++++-------- .../z_en_horse_game_check.c | 10 +- .../ovl_En_Horse_Ganon/z_en_horse_ganon.c | 8 +- .../z_en_horse_link_child.c | 24 +-- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 40 ++--- .../ovl_En_Horse_Zelda/z_en_horse_zelda.c | 2 +- soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c | 2 +- soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 +- soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 34 ++--- soh/src/overlays/actors/ovl_En_In/z_en_in.c | 10 +- .../actors/ovl_En_Insect/z_en_insect.c | 2 +- soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c | 2 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 4 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 4 +- soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c | 4 +- soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 6 +- .../actors/ovl_En_Lightbox/z_en_lightbox.c | 8 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 32 ++-- soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c | 2 +- soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c | 12 +- soh/src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c | 4 +- soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c | 18 +-- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 10 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 8 +- .../overlays/actors/ovl_En_Ossan/z_en_ossan.c | 44 +++--- soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- .../actors/ovl_En_Partner/z_en_partner.c | 18 +-- .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- .../actors/ovl_En_Pu_box/z_en_pu_box.c | 4 +- .../ovl_En_River_Sound/z_en_river_sound.c | 2 +- soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 44 +++--- soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 2 +- soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c | 4 +- soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c | 8 +- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.c | 2 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 4 +- soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c | 2 +- soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 2 +- .../overlays/actors/ovl_En_Toryo/z_en_toryo.c | 2 +- soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c | 20 +-- soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c | 4 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 6 +- .../actors/ovl_En_Viewer/z_en_viewer.c | 14 +- .../actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 2 +- soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c | 34 ++--- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.c | 4 +- soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 16 +- soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 16 +- soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c | 8 +- .../overlays/actors/ovl_Fishing/z_fishing.c | 32 ++-- .../overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 2 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 2 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 2 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 4 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 8 +- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 4 +- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 2 +- .../ovl_Object_Kankyo/z_object_kankyo.c | 8 +- .../overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 4 +- .../actors/ovl_player_actor/z_player.c | 44 +++--- .../ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c | 2 +- .../z_eff_ss_dead_sound.c | 2 +- .../ovl_file_choose/z_file_choose.c | 40 ++--- .../ovl_file_choose/z_file_copy_erase.c | 44 +++--- .../ovl_file_choose/z_file_nameset_PAL.c | 58 ++++---- .../overlays/gamestates/ovl_select/z_select.c | 36 ++--- .../ovl_kaleido_scope/z_kaleido_collect.c | 6 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 18 +-- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 24 +-- .../ovl_kaleido_scope/z_kaleido_map_PAL.c | 12 +- .../misc/ovl_kaleido_scope/z_kaleido_prompt.c | 4 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 38 ++--- 204 files changed, 1167 insertions(+), 1164 deletions(-) diff --git a/soh/include/functions.h b/soh/include/functions.h index 8a1f6572c..15fb5ba9d 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -980,9 +980,9 @@ f32 Math_SmoothStepToDegF(f32* pValue, f32 target, f32 fraction, f32 step, f32 m s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, s16 step, s16 minStep); void Math_ApproachS(s16* pValue, s16 target, s16 scale, s16 step); void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src); -void func_80078884(u16 sfxId); -void func_800788CC(u16 sfxId); -void func_80078914(Vec3f* arg0, u16 sfxId); +void Sfx_PlaySfxCentered(u16 sfxId); +void Sfx_PlaySfxCentered2(u16 sfxId); +void Sfx_PlaySfxAtPos(Vec3f* arg0, u16 sfxId); s16 getHealthMeterXOffset(); s16 getHealthMeterYOffset(); void HealthMeter_Init(PlayState* play); diff --git a/soh/include/variables.h b/soh/include/variables.h index 25fb304d3..6b8451f5f 100644 --- a/soh/include/variables.h +++ b/soh/include/variables.h @@ -158,9 +158,9 @@ extern "C" extern char D_80133398[]; extern SoundBankEntry* gSoundBanks[7]; extern u8 gSfxChannelLayout; - extern Vec3f D_801333D4; - extern f32 D_801333E0; - extern s8 D_801333E8; + extern Vec3f gSfxDefaultPos; + extern f32 gSfxDefaultFreqAndVolScale; + extern s8 gSfxDefaultReverb; extern u8 D_801333F0; extern u8 gAudioSfxSwapOff; extern u8 D_80133408; diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp index 7000aa391..e1cc1db21 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp @@ -14,7 +14,7 @@ void SkipDekuTreeIntro_Register() { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { BgTreemouth* treeMouth = va_arg(args, BgTreemouth*); Flags_SetEventChkInf(EVENTCHKINF_DEKU_TREE_OPENED_MOUTH); - Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); BgTreemouth_SetupAction(treeMouth, func_808BC6F8); *should = false; } diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index bea2d5b87..9992f1ecd 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -1174,7 +1174,7 @@ void ActorViewerWindow::DrawElement() { Actor_Spawn(&gPlayState->actorCtx, gPlayState, newActor.id, newActor.pos.x, newActor.pos.y, newActor.pos.z, newActor.rot.x, newActor.rot.y, newActor.rot.z, newActor.params, 0); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } @@ -1187,7 +1187,7 @@ void ActorViewerWindow::DrawElement() { newActor.pos.y, newActor.pos.z, newActor.rot.x, newActor.rot.y, newActor.rot.z, newActor.params); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index fb428d1ae..9f7a73ad3 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -341,7 +341,7 @@ void GameInteractor::RawAction::UpdateActor(void* refActor) { } void GameInteractor::RawAction::TeleportPlayer(int32_t nextEntrance) { - Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gPlayState->nextEntranceIndex = nextEntrance; gPlayState->transitionTrigger = TRANS_TRIGGER_START; gPlayState->transitionType = TRANS_TYPE_FADE_BLACK; diff --git a/soh/soh/Enhancements/kaleido.cpp b/soh/soh/Enhancements/kaleido.cpp index 6d66a0578..9822b1956 100644 --- a/soh/soh/Enhancements/kaleido.cpp +++ b/soh/soh/Enhancements/kaleido.cpp @@ -215,12 +215,12 @@ namespace Rando { } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -230,7 +230,7 @@ namespace Rando { if (shouldScroll) { entry->SetYOffset(yOffset); yOffset += 18; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Matrix_Push(); entry->Draw(play, &mEntryDl); diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 9ecc0e163..0dacbef42 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -1068,7 +1068,7 @@ void RegisterAltTrapTypes() { eventTimer = 3; break; case ADD_SPEED_TRAP: - Audio_PlaySoundGeneral(NA_SE_VO_KZ_MOVE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_KZ_MOVE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); GameInteractor::State::RunSpeedModifier = -2; statusTimer = 200; Overlay_DisplayText(10, "Speed Decreased!"); @@ -1077,7 +1077,7 @@ void RegisterAltTrapTypes() { eventTimer = 3; break; case ADD_VOID_TRAP: - Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); eventTimer = 3; break; case ADD_AMMO_TRAP: @@ -1117,7 +1117,7 @@ void RegisterAltTrapTypes() { AMMO(ITEM_BOW) = AMMO(ITEM_BOW) * 0.5; AMMO(ITEM_BOMB) = AMMO(ITEM_BOMB) * 0.5; AMMO(ITEM_BOMBCHU) = AMMO(ITEM_BOMBCHU) * 0.5; - Audio_PlaySoundGeneral(NA_SE_VO_FR_SMILE_0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_FR_SMILE_0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); break; case ADD_TELEPORT_TRAP: { int entrance; diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 6b474cde1..27813cffe 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -829,7 +829,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Actor_Kill(&item00->actor); *should = false; } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (item00->itemEntry.modIndex == MOD_NONE) { if (item00->itemEntry.getItemId == GI_SWORD_BGS) { gSaveContext.bgsFlag = true; diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 4907edaa2..06ed22eaa 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -43,7 +43,7 @@ extern void func_80AF36EC(EnRu2* enRu2, PlayState* play); void EnMa1_EndTeachSong(EnMa1* enMa1, PlayState* play) { if (Message_GetState(&gPlayState->msgCtx) == TEXT_STATE_CLOSING) { Flags_SetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); enMa1->actor.flags &= ~ACTOR_FLAG_WILL_TALK; play->msgCtx.ocarinaMode = OCARINA_MODE_04; enMa1->actionFunc = func_80AA0D88; @@ -55,7 +55,7 @@ void EnMa1_EndTeachSong(EnMa1* enMa1, PlayState* play) { void EnFu_EndTeachSong(EnFu* enFu, PlayState* play) { if (Message_GetState(&gPlayState->msgCtx) == TEXT_STATE_CLOSING) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); enFu->actionFunc = EnFu_WaitAdult; enFu->actor.flags &= ~ACTOR_FLAG_WILL_TALK; @@ -430,7 +430,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM; if (Animation_OnFrame(&demoIm->skelAnime, 25.0f)) { - Audio_PlaySoundGeneral(NA_SE_IT_DEKU, &demoIm->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_DEKU, &demoIm->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); GameInteractor::Instance->UnregisterGameHook(demoImUpdateHook); GameInteractor::Instance->UnregisterGameHook(demoImKillHook); demoImUpdateHook = 0; @@ -509,7 +509,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { *should = false; Flags_SetEnv(gPlayState, 2); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } break; } diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 593706dd6..9d58e2d62 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -181,7 +181,7 @@ void RegisterOnInterfaceUpdateHook() { if (gPlayState->state.frames % 7 == 0) { if (lostHealth >= 16) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); lostHealth -= 16; } } diff --git a/soh/soh/Notification/Notification.cpp b/soh/soh/Notification/Notification.cpp index b743fae82..ebc4e168b 100644 --- a/soh/soh/Notification/Notification.cpp +++ b/soh/soh/Notification/Notification.cpp @@ -133,7 +133,7 @@ void Emit(Options notification) { notification.remainingTime = CVarGetFloat(CVAR_SETTING("Notifications.Duration"), 10.0f); } notifications.push_back(notification); - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } // namespace Notification diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 7a64a2b54..90e49bbd3 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1648,7 +1648,7 @@ void func_800ED458(s32 arg0) { if ((sCurOcarinaBtnVal != 0xFF) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) { Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | 0xD07, D_80130F10 - 1); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | 0xD05, sCurOcarinaBtnVal); - Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &D_801333D4, 4, &D_80130F24, &D_80130F28, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &D_80130F24, &D_80130F28, &gSfxDefaultReverb); } else if ((sPrevOcarinaNoteVal != 0xFF) && (sCurOcarinaBtnVal == 0xFF)) { Audio_StopSfxById(NA_SE_OC_OCARINA); } @@ -1791,8 +1791,8 @@ void Audio_OcaPlayback(void) { sStaffPlaybackPos++; Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | 0xD07, D_80130F10 - 1); Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | 0xD05, sDisplayedNoteValue & 0x3F); - Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &D_801333D4, 4, &sNormalizedNotePlaybackTone, - &sNormalizedNotePlaybackVolume, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_OCARINA, &gSfxDefaultPos, 4, &sNormalizedNotePlaybackTone, + &sNormalizedNotePlaybackVolume, &gSfxDefaultReverb); } else { Audio_StopSfxById(NA_SE_OC_OCARINA); } @@ -3044,7 +3044,7 @@ void AudioDebug_ProcessInput_SndCont(void) { case 2: case 3: Audio_PlaySoundGeneral(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG, - &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); break; case 4: func_800F6700(sAudioSndContWork[sAudioSndContSel]); @@ -3443,7 +3443,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) { if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) { sfx = (u16)(sAudioSfxParamChgWork[0] << 12) + sAudioSfxParamChgWork[1] + SFX_FLAG; - Audio_PlaySoundGeneral(sfx, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfx, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) { @@ -3974,7 +3974,7 @@ void Audio_PlayFanfare_Rando(GetItemEntry getItem) { if (getItem.modIndex == MOD_NONE) { if (((itemId >= ITEM_RUPEE_GREEN) && (itemId <= ITEM_RUPEE_GOLD)) || (itemId == ITEM_HEART)) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { if (itemId == ITEM_HEART_CONTAINER || ((itemId == ITEM_HEART_PIECE_2) && ((gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000))) { @@ -4046,7 +4046,7 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) { D_80131C8C = arg2; sp24 = func_800F3F84(arg2); - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb); if ((sfxId & 0xF0) == 0xB0) { phi_f0 = 0.3f; @@ -4064,22 +4064,22 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) { sfxId2 = NA_SE_PL_METALEFFECT_KID; } D_8016B7AC = (sp24 * 0.7) + 0.3; - Audio_PlaySoundGeneral(sfxId2, pos, 4, &D_8016B7B0, &D_8016B7AC, &D_801333E8); + Audio_PlaySoundGeneral(sfxId2, pos, 4, &D_8016B7B0, &D_8016B7AC, &gSfxDefaultReverb); } } void func_800F4138(Vec3f* pos, u16 sfxId, f32 arg2) { func_800F3F84(arg2); - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7B0, &D_8016B7A8, &gSfxDefaultReverb); } void func_800F4190(Vec3f* pos, u16 sfxId) { - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801305B0, &D_801333E0, &D_801305B4); + Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801305B0, &gSfxDefaultFreqAndVolScale, &D_801305B4); } void Audio_PlaySoundRandom(Vec3f* pos, u16 baseSfxId, u8 randLim) { u8 offset = Audio_NextRandom() % randLim; - Audio_PlaySoundGeneral(baseSfxId + offset, pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(baseSfxId + offset, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void func_800F4254(Vec3f* pos, u8 level) { @@ -4088,10 +4088,10 @@ void func_800F4254(Vec3f* pos, u8 level) { D_801305F4 = D_801305E4[level]; switch (level) { case 1: - Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); break; case 2: - Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_SWORD_CHARGE, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); break; } @@ -4099,7 +4099,7 @@ void func_800F4254(Vec3f* pos, u8 level) { } if (level != 0) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_CHARGE - SFX_FLAG, pos, 4, &D_801305F4, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_CHARGE - SFX_FLAG, pos, 4, &D_801305F4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -4111,14 +4111,14 @@ void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2) { } if (D_8016B7D8 > 0.5f) { - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } void func_800F4414(Vec3f* pos, u16 sfxId, f32 arg2) { D_801305B8--; if (D_801305B8 == 0) { - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &D_8016B7D8, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (arg2 > 2.0f) { arg2 = 2.0f; @@ -4135,17 +4135,17 @@ void func_800F44EC(s8 arg0, s8 arg1) { void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2) { D_8016B7DC = arg2; - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801333E0, &D_801333E0, &D_8016B7DC); + Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &D_8016B7DC); } void func_800F4578(Vec3f* pos, u16 sfxId, f32 arg2) { D_8016B7E0 = arg2; - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801333E0, &D_8016B7E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &D_8016B7E0, &gSfxDefaultReverb); } void func_800F45D0(f32 arg0) { - func_800F4414(&D_801333D4, NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG, arg0); - func_800F436C(&D_801333D4, 0, (0.15f * arg0) + 1.4f); + func_800F4414(&gSfxDefaultPos, NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG, arg0); + func_800F436C(&gSfxDefaultPos, 0, (0.15f * arg0) + 1.4f); } void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale) { @@ -4156,8 +4156,8 @@ void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale) { sRiverFreqScaleLerp.remainingFrames = 40; sRiverFreqScaleLerp.step = (sRiverFreqScaleLerp.target - sRiverFreqScaleLerp.value) / 40; } - Audio_PlaySoundGeneral(NA_SE_EV_RIVER_STREAM - SFX_FLAG, pos, 4, &sRiverFreqScaleLerp.value, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_RIVER_STREAM - SFX_FLAG, pos, 4, &sRiverFreqScaleLerp.value, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale) { @@ -4169,7 +4169,7 @@ void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale) { sWaterfallFreqScaleLerp.step = (sWaterfallFreqScaleLerp.target - sWaterfallFreqScaleLerp.value) / 40; } Audio_PlaySoundGeneral(NA_SE_EV_WATER_WALL_BIG - SFX_FLAG, pos, 4, &sWaterfallFreqScaleLerp.value, - &sWaterfallFreqScaleLerp.value, &D_801333E8); + &sWaterfallFreqScaleLerp.value, &gSfxDefaultReverb); } void Audio_StepFreqLerp(FreqLerp* lerp) { @@ -4285,8 +4285,8 @@ void func_800F4A70(void) { } void Audio_PlaySoundIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones) { - Audio_PlaySoundGeneral(sfxId, pos, 4, &gNoteFrequencies[semitones[sAudioIncreasingTranspose] + 39], &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &gNoteFrequencies[semitones[sAudioIncreasingTranspose] + 39], &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (sAudioIncreasingTranspose < 15) { sAudioIncreasingTranspose++; @@ -4298,7 +4298,7 @@ void Audio_ResetIncreasingTranspose(void) { } void Audio_PlaySoundTransposed(Vec3f* pos, u16 sfxId, s8 semitone) { - Audio_PlaySoundGeneral(sfxId, pos, 4, &gNoteFrequencies[semitone + 39], &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &gNoteFrequencies[semitone + 39], &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) { @@ -4319,7 +4319,7 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 arg2) { } phi_s1++; } - Audio_PlaySoundGeneral(sfxId, pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void func_800F4E30(Vec3f* pos, f32 arg1) { @@ -4880,10 +4880,10 @@ void func_800F6268(f32 dist, u16 arg1) { void func_800F64E0(u8 arg0) { D_80130608 = arg0; if (arg0 != 0) { - Audio_PlaySoundGeneral(NA_SE_SY_WIN_OPEN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_QueueCmdS32(0xF1000000, 0); } else { - Audio_PlaySoundGeneral(NA_SE_SY_WIN_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WIN_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_QueueCmdS32(0xF2000000, 0); } } @@ -4961,7 +4961,7 @@ void Audio_SetBaseFilter(u8 filter) { if (filter == 0) { Audio_StopSfxById(NA_SE_PL_IN_BUBBLE); } else if (sAudioBaseFilter == 0) { - Audio_PlaySoundGeneral(NA_SE_PL_IN_BUBBLE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_IN_BUBBLE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } sAudioBaseFilter = filter; @@ -4994,7 +4994,7 @@ void Audio_PlaySoundGeneralIfNotInCutscene(u16 sfxId, Vec3f* pos, u8 arg2, f32* } void Audio_PlaySoundIfNotInCutscene(u16 sfxId) { - Audio_PlaySoundGeneralIfNotInCutscene(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneralIfNotInCutscene(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void func_800F6964(u16 arg0) { diff --git a/soh/src/code/code_800F7260.c b/soh/src/code/code_800F7260.c index e62291c0d..a22679957 100644 --- a/soh/src/code/code_800F7260.c +++ b/soh/src/code/code_800F7260.c @@ -81,13 +81,13 @@ u8 gSfxChannelLayout = 0; u16 D_801333D0 = 0; -Vec3f D_801333D4 = { 0.0f, 0.0f, 0.0f }; // default pos +Vec3f gSfxDefaultPos = { 0.0f, 0.0f, 0.0f }; // default pos -f32 D_801333E0 = 1.0f; // default freqScale +f32 gSfxDefaultFreqAndVolScale = 1.0f; // default freqScale s32 D_801333E4 = 0; // unused -s8 D_801333E8 = 0; // default reverbAdd +s8 gSfxDefaultReverb = 0; // default reverbAdd s32 D_801333EC = 0; // unused @@ -381,7 +381,7 @@ void Audio_ChooseActiveSounds(u8 bankId) } else if (gSoundBanks[bankId][entryIndex].state != SFX_STATE_EMPTY) { entry = &gSoundBanks[bankId][entryIndex]; - if (&D_801333D4.x == entry[0].posX) { + if (&gSfxDefaultPos.x == entry[0].posX) { entry->dist = 0.0f; } else { tempf1 = *entry->posY * 1; diff --git a/soh/src/code/db_camera.c b/soh/src/code/db_camera.c index 628b9d406..b3e26be7d 100644 --- a/soh/src/code/db_camera.c +++ b/soh/src/code/db_camera.c @@ -294,7 +294,7 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) { if (dbCamera->sub.nPoints < 6) { if (sDbCamAnim.unk_0A != 0) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sDbCamAnim.unk_0A = 0; } func_8006376C(0x0D, 0x17, 3, cameraStrings[0]); @@ -308,7 +308,7 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) { !func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, dbCamera->sub.lookAt, &sDbCamAnim.keyframe, &sDbCamAnim.curFrame) && sDbCamAnim.unk_0A == 1) { - Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sDbCamAnim.unk_04++; if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) { @@ -536,7 +536,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { dbCamera->unk_40 = -1; dbCamera->sub.demoCtrlActionIdx = 0; sDbCamAnim.unk_0A = 0; - Audio_PlaySoundGeneral(NA_SE_SY_LOCK_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_LOCK_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (dbCamera->unk_38 == -1) { dbCamera->unk_38 = 1; } else { @@ -856,22 +856,22 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { dbCamera->unk_1C.z = 0.0f; dbCamera->unk_1C.y = 1.0f; } else if (dbCamera->sub.unk_08 == 2) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.unk_08 = 0; func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); } else { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_R) && CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.nPoints = dbCamera->sub.unkIdx + 1; func_800B4088(dbCamera, cam); } else if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_R)) { if (dbCamera->sub.unkIdx == 0x80) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PUTAWAY, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800B42C0(dbCamera, cam); if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) { dbCamera->sub.unkIdx++; @@ -923,7 +923,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } else { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CRIGHT) && CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n"); DbCamera_PrintPoints("Lookat", dbCamera->sub.nPoints, dbCamera->sub.lookAt); DbCamera_PrintPoints("Position", dbCamera->sub.nPoints, dbCamera->sub.position); @@ -932,13 +932,13 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { osSyncPrintf("@@@static short Mode = %d;\n@@@\n", dbCamera->sub.mode); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n"); } else if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.unk_08 = (dbCamera->sub.unk_08 + 1) % 3; } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CUP) && CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (dbCamera->sub.unkIdx > 0) { dbCamera->sub.unkIdx--; } else { @@ -946,8 +946,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } } else { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CUP)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (dbCamera->sub.unkIdx > 0) { dbCamera->sub.unkIdx--; } else { @@ -968,7 +968,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L) && CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CDOWN)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { dbCamera->sub.unkIdx++; } else { @@ -976,8 +976,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } } else { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CDOWN)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { dbCamera->sub.unkIdx++; } else { @@ -1046,8 +1046,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { case 1: dbCamera->unk_3C = true; if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP)) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (dbCamera->sub.unk_0A == 0) { dbCamera->sub.unk_0A = 5; } else { @@ -1055,8 +1055,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (dbCamera->sub.unk_0A == 5) { dbCamera->sub.unk_0A = 0; } else { @@ -1064,8 +1064,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); switch (dbCamera->sub.unk_0A) { case 1: if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) { @@ -1114,8 +1114,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_DLEFT)) { if ((D_8012D10C++ % 5) == 0) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } switch (dbCamera->sub.unk_0A) { @@ -1152,8 +1152,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); switch (dbCamera->sub.unk_0A) { case 1: @@ -1201,8 +1201,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_DRIGHT)) { if ((D_8012D10C++ % 5) == 0) { - Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } switch (dbCamera->sub.unk_0A) { @@ -1353,7 +1353,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { dbCamera->fov = 60.0f; dbCamera->rollDegrees = dbCamera->roll * 1.40625f; if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->unk_78 = (dbCamera->unk_78 + 1) % 3; dbCamera->unk_38 = -1; } @@ -1634,7 +1634,7 @@ void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorId) { void DbCamera_PrintAllCuts(Camera* cam) { s32 i; - Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** start here ***** */\n@@@\n"); for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { @@ -1777,8 +1777,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if ((1 << sCurFileIdx) & sMempakFiles) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DLEFT) || CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlToggleSwitch ^= 1; } cameraStrings[41][9] = sCurFileIdx + 'A'; @@ -1791,12 +1791,12 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A)) { if (dbCamera->sub.demoCtrlToggleSwitch == 0) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu++; } else { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu = 0; } } @@ -1812,7 +1812,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu = 0; return 1; } @@ -1848,7 +1848,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) || CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (dbCamera->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) { dbCamera->sub.demoCtrlActionIdx = ACTION_E; } @@ -1870,7 +1870,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) || CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu -= 9; } block_2: @@ -1904,8 +1904,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sp74[i * 2 + 1] = '\0'; if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (sCurFileIdx >= 4) { sCurFileIdx = 0; } else { @@ -1921,8 +1921,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (sCurFileIdx <= 0) { sCurFileIdx = 4; } else { @@ -1964,25 +1964,25 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { func_8006376C(0x14, 0x1A, 5, cameraStrings[36]); if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A)) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlToggleSwitch = 0; dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(dbCamera->sub.demoCtrlActionIdx, MENU_INFO); } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlActionIdx = ACTION_E; return 1; } @@ -1994,8 +1994,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP) || CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); dbCamera->sub.demoCtrlActionIdx = ACTION_E; } return 2; @@ -2007,13 +2007,13 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { default: { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; sCurFileIdx = 0; } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; sCurFileIdx = 0; @@ -2052,7 +2052,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (func_800B91B0(cam, dbCamera) == 0) { Interface_ChangeAlpha(2); ShrinkWindow_SetVal(0); - Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } OLib_Vec3fDiffToVecSphGeo(&sp5C, &dbCamera->eye, &dbCamera->at); DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw, @@ -2070,7 +2070,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sDbCamAnim.unk_0A = 1; sDbCamAnim.unk_0C = 0; D_8016110C = 0; - Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_L)) { @@ -2085,15 +2085,15 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (sLastFileIdx != -1) { switch (sp74[sCurFileIdx]) { case '?': - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); sDbCameraCuts[idx1] = sDbCameraCuts[idx2]; sp74[sCurFileIdx] = '?'; // useless DbCamera_ResetCut(idx2, false); break; case '-': - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); sp64 = sDbCameraCuts[idx2]; if (sLastFileIdx < sCurFileIdx) { @@ -2115,8 +2115,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } break; default: - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); break; } } @@ -2125,7 +2125,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A)) { if (sp74[sCurFileIdx] == '?') { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub); if (sp74[sCurFileIdx] == '?') { func_8006376C(0xF, 0x18, 7, cameraStrings[26]); @@ -2135,7 +2135,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sp74[sCurFileIdx] = '?'; DbCamera_ResetCut(idx1, true); } @@ -2143,7 +2143,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_R)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); for (i = 0; i < sDbCameraCuts[idx1].nPoints; i++) { dbCamera->sub.lookAt[i] = sDbCameraCuts[idx1].lookAt[i]; @@ -2165,7 +2165,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sCurFileIdx == 0x1E) { sCurFileIdx = 0; } else { @@ -2173,7 +2173,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } } if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1; } @@ -2187,7 +2187,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { DbCamera_PrintAllCuts(cam); } else if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L) && CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { if (sDbCameraCuts[i].nPoints != 0) { osSyncPrintf("\n@@@ /* CUT [%d]\t*/", i); @@ -2203,7 +2203,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { Interface_ChangeAlpha(50); ShrinkWindow_SetVal(0x20); D_8016110C = 0; - Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } func_8006376C(4, 7, 5, cameraStrings[28]); diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index dccb4d9bf..f69e18f1c 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -624,7 +624,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Pl lockOnSfxId = CHECK_FLAG_ALL(actorArg->flags, ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN; - func_80078884(lockOnSfxId); + Sfx_PlaySfxCentered(lockOnSfxId); } targetCtx->targetCenterPos.x = actorArg->world.pos.x; @@ -2202,7 +2202,7 @@ void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) void Player_PlaySfx(Actor* actor, u16 sfxId) { if (actor->id != ACTOR_PLAYER || sfxId < NA_SE_VO_LI_SWORD_N || sfxId > NA_SE_VO_LI_ELECTRIC_SHOCK_LV_KID) { - Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0 , &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale , &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { freqMultiplier = CVarGetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0); if (freqMultiplier <= 0) { @@ -2210,12 +2210,12 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) { } // Authentic behavior uses D_801333E0 for both freqScale and a4 // Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0 , &D_801333E0, &D_801333E8); - Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &freqMultiplier, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &freqMultiplier, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } void Audio_PlayActorSound2(Actor* actor, u16 sfxId) { - func_80078914(&actor->projectedPos, sfxId); + Sfx_PlaySfxAtPos(&actor->projectedPos, sfxId); } void func_8002F850(PlayState* play, Actor* actor) { @@ -2231,8 +2231,8 @@ void func_8002F850(PlayState* play, Actor* actor) { sfxId = SurfaceType_GetSfx(&play->colCtx, actor->floorPoly, actor->floorBgId); } - func_80078914(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); - func_80078914(&actor->projectedPos, sfxId + SFX_FLAG); + Sfx_PlaySfxAtPos(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); + Sfx_PlaySfxAtPos(&actor->projectedPos, sfxId + SFX_FLAG); } void func_8002F8F0(Actor* actor, u16 sfxId) { @@ -2654,7 +2654,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { actor = NULL; if (actorCtx->targetCtx.unk_4B != 0) { actorCtx->targetCtx.unk_4B = 0; - func_80078884(NA_SE_SY_LOCK_OFF); + Sfx_PlaySfxCentered(NA_SE_SY_LOCK_OFF); } } @@ -2755,15 +2755,15 @@ void Actor_Draw(PlayState* play, Actor* actor) { void func_80030ED8(Actor* actor) { if (actor->flags & ACTOR_FLAG_SFX_AT_POS) { - Audio_PlaySoundGeneral(actor->sfx, &actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (actor->flags & ACTOR_FLAG_SFX_AT_CENTER) { - func_80078884(actor->sfx); + Sfx_PlaySfxCentered(actor->sfx); } else if (actor->flags & ACTOR_FLAG_SFX_AT_CENTER2) { - func_800788CC(actor->sfx); + Sfx_PlaySfxCentered2(actor->sfx); } else if (actor->flags & ACTOR_FLAG_SFX_AS_TIMER) { - func_800F4C58(&D_801333D4, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1)); + func_800F4C58(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1)); } else { - func_80078914(&actor->projectedPos, actor->sfx); + Sfx_PlaySfxAtPos(&actor->projectedPos, actor->sfx); } } @@ -5737,8 +5737,8 @@ void func_80036E50(u16 textId, s16 arg1) { Flags_SetInfTable(INFTABLE_0C); return; case 0x1033: - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Flags_SetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD); Flags_SetInfTable(INFTABLE_0E); return; @@ -6201,7 +6201,7 @@ s32 func_80037CB8(PlayState* play, Actor* actor, s16 arg2) { case TEXT_STATE_CHOICE: case TEXT_STATE_EVENT: if (Message_ShouldAdvance(play) && func_80037C94(play, actor, arg2)) { - Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_CLOSING; ret = true; } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 986606045..6551d6347 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -6168,7 +6168,7 @@ s32 Camera_Demo5(Camera* camera) { pad = sDemo5PrevSfxFrame - camera->play->state.frames; if ((pad >= 0x33) || (pad < -0x32)) { - func_80078884(camera->data1); + Sfx_PlaySfxCentered(camera->data1); } sDemo5PrevSfxFrame = camera->play->state.frames; @@ -7362,11 +7362,11 @@ s32 Camera_DbgChangeMode(Camera* camera) { if (!gDbgCamEnabled && camera->play->activeCamera == MAIN_CAM) { if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) { osSyncPrintf("attention sound URGENCY\n"); - func_80078884(NA_SE_SY_ATTENTION_URGENCY); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); } if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CDOWN)) { osSyncPrintf("attention sound NORMAL\n"); - func_80078884(NA_SE_SY_ATTENTION_ON); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); } if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CRIGHT)) { @@ -7783,7 +7783,7 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) { if (!((sCameraSettings[camera->setting].unk_00 & 0x3FFFFFFF) & (1 << mode))) { if (mode == CAM_MODE_FIRSTPERSON) { osSyncPrintf("camera: error sound\n"); - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } if (camera->mode != CAM_MODE_NORMAL) { @@ -7871,20 +7871,20 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) { if (camera->status == CAM_STAT_ACTIVE) { switch (modeChangeFlags) { case 1: - func_80078884(0); + Sfx_PlaySfxCentered(0); break; case 2: if (camera->play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) { - func_80078884(NA_SE_SY_ATTENTION_URGENCY); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); } else { - func_80078884(NA_SE_SY_ATTENTION_ON); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); } break; case 4: - func_80078884(NA_SE_SY_ATTENTION_URGENCY); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY); break; case 8: - func_80078884(NA_SE_SY_ATTENTION_ON); + Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON); break; } } diff --git a/soh/src/code/z_collision_check.c b/soh/src/code/z_collision_check.c index 5376ae41c..312675f7f 100644 --- a/soh/src/code/z_collision_check.c +++ b/soh/src/code/z_collision_check.c @@ -1607,10 +1607,10 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll if (flags == TOUCH_SFX_NORMAL && collider->colType != COLTYPE_METAL) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } else if (flags == TOUCH_SFX_NORMAL) { // collider->colType == COLTYPE_METAL EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos); @@ -1622,18 +1622,18 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderInfo* info, Collider* coll } else if (flags == TOUCH_SFX_HARD) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } else if (flags == TOUCH_SFX_WOOD) { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_DUST, hitPos); if (collider->actor == NULL) { - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -1644,17 +1644,17 @@ 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_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (acInfo->elemType == ELEMTYPE_UNK1) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (acInfo->elemType == ELEMTYPE_UNK2) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (acInfo->elemType == ELEMTYPE_UNK3) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } return 1; @@ -1691,7 +1691,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); - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &at->actor->projectedPos); } @@ -1704,10 +1704,10 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* at, ColliderInfo* atIn } else { EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos); if (ac->actor == NULL) { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } @@ -3460,7 +3460,7 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { CollisionCheck_SpawnShieldParticles(play, v); - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } /** @@ -3468,7 +3468,7 @@ void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) { */ void CollisionCheck_SpawnShieldParticlesMetalSound(PlayState* play, Vec3f* v, Vec3f* pos) { CollisionCheck_SpawnShieldParticles(play, v); - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } /** @@ -3508,7 +3508,7 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* a initWood.lightPoint.z = initWood.position.z; Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &initWood); - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } /** diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index decc18f39..91d9271ff 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -285,7 +285,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { play->roomCtx.unk_74[0] += 0x14; } if (csCtx->frames == 0x30F) { - func_80078884(NA_SE_EV_DEKU_DEATH); + Sfx_PlaySfxCentered(NA_SE_EV_DEKU_DEATH); } else if (csCtx->frames == 0x2CD) { play->roomCtx.unk_74[0] = 0; } @@ -299,7 +299,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { break; case 13: if (play->roomCtx.unk_74[1] == 0) { - func_80078884(NA_SE_EV_TRIFORCE_FLASH); + Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_FLASH); } if (play->roomCtx.unk_74[1] < 0xFF) { play->roomCtx.unk_74[1] += 5; @@ -412,7 +412,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { if (sp3F != 0) { play->envCtx.sandstormState = SANDSTORM_FILL; } - func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_SAND_STORM - SFX_FLAG); break; case 33: gSaveContext.sunsSongState = SUNSSONG_START; @@ -514,7 +514,7 @@ 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_START)) && (gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); temp = 1; } @@ -1328,15 +1328,15 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm if (cmd->base == 1) { play->envCtx.screenFillColor[3] = 255.0f * temp; if ((temp == 0.0f) && (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0)) { - Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if ((temp == 0.0f) && ((gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_ENTRANCE) || (gSaveContext.entranceIndex == ENTR_CASTLE_GROUNDS_SOUTH_EXIT) || (gSaveContext.entranceIndex == ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_FARORES_ZF))) { - Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if ((temp == 0.0f) && (play->sceneNum == SCENE_INSIDE_GANONS_CASTLE)) { - func_800788CC(NA_SE_EV_WHITE_OUT); + Sfx_PlaySfxCentered2(NA_SE_EV_WHITE_OUT); } } else { play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 90b535966..9e2ec53cf 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -974,7 +974,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } if ((*params <= ITEM00_RUPEE_RED) || (*params == ITEM00_RUPEE_ORANGE)) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); @@ -982,7 +982,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } return; } else { - Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Flags_SetCollectible(play, this->collectibleFlag); diff --git a/soh/src/code/z_fbdemo_circle.c b/soh/src/code/z_fbdemo_circle.c index 98183023a..8d92b03f9 100644 --- a/soh/src/code/z_fbdemo_circle.c +++ b/soh/src/code/z_fbdemo_circle.c @@ -84,7 +84,7 @@ void TransitionCircle_Start(void* thisx) { } else { this->texY = 0x1F4; if (this->appearanceType == TCA_RIPPLE) { - Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } guPerspective(&this->projection, &this->normal, 60.0f, (4.0f / 3.0f), 10.0f, 12800.0f, 1.0f); @@ -109,7 +109,7 @@ void TransitionCircle_Update(void* thisx, s32 updateRate) { if (this->direction != 0) { if (this->texY == 0) { if (this->appearanceType == TCA_RIPPLE) { - Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_IN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_IN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } this->texY += this->speed * 3 / updateRate; diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 37481ccd8..e573b0f57 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -914,10 +914,10 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex osSyncPrintf("\nnext_zelda_time=[%x]", ((void)0, gSaveContext.nextDayTime)); if (((void)0, gSaveContext.nextDayTime) == 0xFF0E) { - func_80078884(NA_SE_EV_CHICKEN_CRY_M); + Sfx_PlaySfxCentered(NA_SE_EV_CHICKEN_CRY_M); gSaveContext.nextDayTime = 0xFFFF; } else if (((void)0, gSaveContext.nextDayTime) == 0xFF0D) { - func_800788CC(NA_SE_EV_DOG_CRY_EVENING); + Sfx_PlaySfxCentered2(NA_SE_EV_DOG_CRY_EVENING); gSaveContext.nextDayTime = 0xFFFF; } } @@ -2076,7 +2076,7 @@ void func_80075B44(PlayState* play) { break; case 2: if (gSaveContext.dayTime > 0xC000) { - func_800788CC(NA_SE_EV_DOG_CRY_EVENING); + Sfx_PlaySfxCentered2(NA_SE_EV_DOG_CRY_EVENING); play->envCtx.unk_E0++; } break; @@ -2105,7 +2105,7 @@ void func_80075B44(PlayState* play) { gSaveContext.totalDays++; gSaveContext.bgsDayCount++; gSaveContext.dogIsLost = true; - func_80078884(NA_SE_EV_CHICKEN_CRY_M); + Sfx_PlaySfxCentered(NA_SE_EV_CHICKEN_CRY_M); if ((Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) && play->csCtx.state == 0 && !Player_InCsMode(play)) { diff --git a/soh/src/code/z_lib.c b/soh/src/code/z_lib.c index 57f1312dd..6b691df44 100644 --- a/soh/src/code/z_lib.c +++ b/soh/src/code/z_lib.c @@ -572,14 +572,17 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) { dst->a = src->a; } -void func_80078884(u16 sfxId) { - Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); +void Sfx_PlaySfxCentered(u16 sfxId) { + Audio_PlaySoundGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } -void func_800788CC(u16 sfxId) { - Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); +void Sfx_PlaySfxCentered2(u16 sfxId) { + Audio_PlaySoundGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } -void func_80078914(Vec3f* arg0, u16 sfxId) { - Audio_PlaySoundGeneral(sfxId, arg0, 4, &D_801333E0, &D_801333E0, &D_801333E8); +void Sfx_PlaySfxAtPos(Vec3f* arg0, u16 sfxId) { + Audio_PlaySoundGeneral(sfxId, arg0, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 3cb9d4715..15d136eab 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -648,7 +648,7 @@ void HealthMeter_HandleCriticalAlarm(PlayState* play) { interfaceCtx->unk_22C = 0; if (CVarGetInteger(CVAR_ENHANCEMENT("LowHpAlarm"), 0) == 0 && !Player_InCsMode(play) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && HealthMeter_IsCritical() && !Play_InCsMode(play)) { - func_80078884(NA_SE_SY_HITPOINT_ALARM); + Sfx_PlaySfxCentered(NA_SE_SY_HITPOINT_ALARM); } } } else { diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index e05c2a6b2..637823b57 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -810,10 +810,10 @@ void Minimap_Draw(PlayState* play) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play) && enableMapToggle) { osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(play)); // clang-format off - if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); } - else { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); } + if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } + else { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on R_MINIMAP_DISABLED ^= 1; } @@ -965,10 +965,10 @@ void Minimap_Draw(PlayState* play) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play) && enableMapToggle) { // clang-format off - if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); } - else { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); } + if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } + else { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on R_MINIMAP_DISABLED ^= 1; } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 53b2bb943..08be75112 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -154,7 +154,7 @@ u8 Message_ShouldAdvance(PlayState* play) { : CHECK_BTN_ALL(input->press.button, BTN_B); if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP); } @@ -179,7 +179,7 @@ void Message_CloseTextbox(PlayState* play) { msgCtx->stateTimer = 2; msgCtx->msgMode = MSGMODE_TEXT_CLOSING; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; - Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -195,7 +195,7 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) { if (msgCtx->choiceIndex > 128) { msgCtx->choiceIndex = 0; } else { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if ((input->rel.stick_y <= -30 && !sAnalogStickHeld) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { sAnalogStickHeld = true; @@ -203,7 +203,7 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) { if (msgCtx->choiceIndex > numChoices) { msgCtx->choiceIndex = numChoices; } else { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (ABS(input->rel.stick_y) < 30) { sAnalogStickHeld = false; @@ -724,7 +724,7 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) { MessageContext* msgCtx = &play->msgCtx; // clang-format off - if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on gDPPipeSync(gfx++); @@ -882,7 +882,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_BOX_BREAK: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (!sTextboxSkipped) { - Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); } else { @@ -899,7 +899,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_TEXTID: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_DONE; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); } @@ -970,8 +970,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { // "Sound (SE)" osSyncPrintf("ใ‚ตใ‚ฆใƒณใƒ‰๏ผˆ๏ผณ๏ผฅ๏ผ‰\n"); sfxHi = msgCtx->msgBufDecoded[i + 1] << 8; - Audio_PlaySoundGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } i += 2; break; @@ -980,7 +980,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { break; case MESSAGE_BACKGROUND: // clang-format off - if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on gDPPipeSync(gfx++); gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); @@ -1062,8 +1062,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { msgCtx->msgMode = MSGMODE_TEXT_DONE; if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_DEFAULT) { - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_SQUARE); if (play->csCtx.state == 0) { Interface_SetDoAction(play, DO_ACTION_RETURN); @@ -1094,7 +1094,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { return; case MESSAGE_PERSISTENT: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; } @@ -1105,14 +1105,14 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_EVENT; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_END, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } *gfxP = gfx; return; default: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos && msgCtx->textDelayTimer == msgCtx->textDelay) { - Audio_PlaySoundGeneral(0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx); charTexIdx += FONT_CHAR_TEX_SIZE; @@ -1812,7 +1812,7 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) { osSyncPrintf("ocarina_set 000000000000000000 = %d\n", ocarinaActionId); msgCtx->ocarinaAction = ocarinaActionId; if (ocarinaActionId >= OCARINA_ACTION_CHECK_SARIA && ocarinaActionId <= OCARINA_ACTION_CHECK_STORMS) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (ocarinaActionId == OCARINA_ACTION_SCARECROW_PLAYBACK) { Message_OpenText(play, 0x86F); // Ocarina @@ -2259,8 +2259,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS || msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW) { Audio_OcaSetInstrument(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } else { // "Ocarina_Flog Correct Example Performance" @@ -2269,15 +2269,15 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Interface_ChangeAlpha(1); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW) { Audio_OcaSetInstrument(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else { @@ -2287,8 +2287,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Interface_ChangeAlpha(1); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { @@ -2298,23 +2298,23 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->msgMode = MSGMODE_SONG_PLAYED; msgCtx->textBoxType = TEXTBOX_TYPE_OCARINA; msgCtx->stateTimer = 10; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } Interface_ChangeAlpha(1); } else { Audio_OcaSetInstrument(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } } else if (msgCtx->ocarinaStaff->state == 0xFF) { Audio_OcaSetInstrument(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else if (isB_Held) { @@ -2641,11 +2641,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf("z_message.c ๅ–ๅพ—ใƒกใƒญใƒ‡ใ‚ฃ๏ผ%d\n", ITEM_SONG_MINUET + msgCtx->ocarinaStaff->state); osSyncPrintf(VT_RST); msgCtx->stateTimer = 20; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (msgCtx->ocarinaStaff->state == 0xFF) { - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_FAIL; } @@ -2696,8 +2696,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->ocarinaStaff->state); gSaveContext.scarecrowLongSongSet = true; } - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); osSyncPrintf("aaaaaaaaaaaaaa\n"); Audio_OcaSetRecordingState(0); msgCtx->stateTimer = 10; @@ -2766,8 +2766,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 20; gSaveContext.scarecrowSpawnSongSet = true; msgCtx->msgMode = MSGMODE_SCARECROW_RECORDING_DONE; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("\n====================================================================\n"); memcpy(gSaveContext.scarecrowSpawnSong, gScarecrowSpawnSongPtr, @@ -2781,8 +2781,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { // "Played an existing song๏ผ๏ผ๏ผ" osSyncPrintf("ใ™ใงใซๅญ˜ๅœจใ™ใ‚‹ๆ›ฒๅนใ„ใŸ๏ผ๏ผ๏ผ \n"); Audio_OcaSetRecordingState(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Message_CloseTextbox(play); msgCtx->msgMode = MSGMODE_SCARECROW_RECORDING_FAILED; } @@ -2807,8 +2807,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING: case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING: - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); if (msgCtx->ocarinaStaff->pos && sOcarinaNoteBufPos == msgCtx->ocarinaStaff->pos - 1) { sOcarinaNoteBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->noteIdx; @@ -2818,11 +2818,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->stateTimer == 0) { if (msgCtx->ocarinaStaff->state == 0) { if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING) { - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_2, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_2, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } msgCtx->msgMode++; } @@ -2840,8 +2840,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_MEMORY_GAME_PLAYER_PLAYING: - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); if (msgCtx->ocarinaStaff->pos && sOcarinaNoteBufPos == msgCtx->ocarinaStaff->pos - 1) { sOcarinaNoteBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->noteIdx; @@ -2852,14 +2852,14 @@ void Message_DrawMain(PlayState* play, Gfx** p) { // "Musical round failed๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ" osSyncPrintf("่ผชๅ”ฑๅคฑๆ•—๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ\n"); Audio_OcaSetInstrument(0); - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->stateTimer = 10; play->msgCtx.ocarinaMode = OCARINA_MODE_03; } else if (msgCtx->ocarinaStaff->state == 0xD) { // "Musical round succeeded๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ" osSyncPrintf("่ผชๅ”ฑๆˆๅŠŸ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ\n"); - Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_MEMORY_GAME_ROUND_SUCCESS; msgCtx->stateTimer = 30; } @@ -2875,8 +2875,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { if (Audio_OcaMemoryGameGenNote() != 1) { - Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_METRONOME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); msgCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; Message_ResetOcarinaNoteState(); @@ -3337,11 +3337,11 @@ void Message_Update(PlayState* play) { } else if (Message_ShouldAdvanceSilent(play)) { osSyncPrintf("select=%d\n", msgCtx->textboxEndType); if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Message_ContinueTextbox(play, sNextTextId); } else { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Message_CloseTextbox(play); } } diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 0bc6728f5..6440acbee 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -471,7 +471,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor Play_CameraChangeSetting(play, camIdx, CAM_SET_CS_3); Player_SetCsActionWithHaltedActors(play, &player->actor, 5); OnePointCutscene_SetCsCamPoints(csCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); OnePointCutscene_Vec3sToVec3f(&mainCam->at, &D_8012013C[D_801202FC - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_8012021C[D_801202FC - 2].pos); D_8012013C[D_801202FC - 3].pos.x += diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 6227a8b4b..a9fa846d2 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2827,12 +2827,12 @@ void Interface_SetNaviCall(PlayState* play, u16 naviCallState) { (play->csCtx.state == CS_STATE_IDLE)) { if (!CVarGetInteger(CVAR_ENHANCEMENT("DisableNaviCallAudio"), 0)) { // clang-format off - if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); } + if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on if (naviCallState == 0x1D) { - func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); + func_800F4524(&gSfxDefaultPos, NA_SE_VO_NA_HELLO_2, 32); } } @@ -2896,8 +2896,8 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) { } // clang-format off - if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if ((gSaveContext.isDoubleDefenseAcquired != 0) && (healthChange < 0)) { healthChange >>= 1; osSyncPrintf("ใƒใƒผใƒˆๆธ›ๅฐ‘ๅŠๅˆ†๏ผ๏ผ๏ผ%d\n", healthChange); // "Heart decrease halved!!๏ผ%d" @@ -3077,7 +3077,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { if ((type != 5) && (gSaveContext.magic - amount) < 0) { if (gSaveContext.magicCapacity != 0) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } return false; } @@ -3093,7 +3093,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; return 1; } else { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); return false; } case MAGIC_CONSUME_WAIT_NO_PREVIEW: @@ -3105,7 +3105,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3; return true; } else { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); return false; } case MAGIC_CONSUME_LENS: @@ -3133,7 +3133,7 @@ s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2; return true; } else { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); return false; } case MAGIC_ADD: @@ -3217,8 +3217,8 @@ void Interface_UpdateMagicBar(PlayState* play) { gSaveContext.magic += 4; if (gSaveContext.gameMode == 0 && gSaveContext.sceneSetupIndex < 4) { - Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } // "Storage MAGIC_NOW=%d (%d)" @@ -3319,8 +3319,8 @@ void Interface_UpdateMagicBar(PlayState* play) { !hasLens || !play->actorCtx.lensActive) { play->actorCtx.lensActive = false; - Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); gSaveContext.magicState = MAGIC_STATE_IDLE; if (CVarGetInteger(CVAR_COSMETIC("Consumable.MagicBorder.Changed"), 0)) { sMagicBorder = CVarGetColor24(CVAR_COSMETIC("Consumable.MagicBorder.Value"), sMagicBorder_ori); @@ -3375,7 +3375,7 @@ void Interface_UpdateMagicBar(PlayState* play) { case MAGIC_STATE_ADD: gSaveContext.magic += 4; - Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (gSaveContext.magic >= gSaveContext.magicTarget) { gSaveContext.magic = gSaveContext.magicTarget; gSaveContext.magicState = gSaveContext.prevMagicState; @@ -5796,17 +5796,17 @@ void Interface_Draw(PlayState* play) { D_80125A5C = 0; } else if (gSaveContext.timer1Value > 60) { if (timerDigits[4] == 1) { - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (gSaveContext.timer1Value >= 11) { if (timerDigits[4] & 1) { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -5853,8 +5853,8 @@ void Interface_Draw(PlayState* play) { D_8015FFE2 = 40; gSaveContext.timer1State = 15; } else { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -5971,17 +5971,17 @@ void Interface_Draw(PlayState* play) { } } else if (gSaveContext.timer2Value > 60) { if (timerDigits[4] == 1) { - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (gSaveContext.timer2Value > 10) { if ((timerDigits[4] & 1)) { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { gSaveContext.timer2Value++; @@ -5995,8 +5995,8 @@ void Interface_Draw(PlayState* play) { } if ((gSaveContext.timer2Value % 60) == 0) { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -6361,7 +6361,7 @@ void Interface_Update(PlayState* play) { gSaveContext.health += 4; if ((gSaveContext.health & 0xF) < 4) { - Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.healthCapacity); @@ -6398,7 +6398,7 @@ void Interface_Update(PlayState* play) { if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { gSaveContext.rupeeAccumulator--; gSaveContext.rupees++; - Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { // "Rupee Amount MAX = %d" osSyncPrintf("ใƒซใƒ”ใƒผๆ•ฐ๏ผญ๏ผก๏ผธ = %d\n", CUR_CAPACITY(UPG_WALLET)); @@ -6414,11 +6414,11 @@ void Interface_Update(PlayState* play) { gSaveContext.rupees = 0; } - Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { gSaveContext.rupeeAccumulator++; gSaveContext.rupees--; - Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { gSaveContext.rupeeAccumulator = 0; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 0ba9d8759..e7603040d 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -63,8 +63,8 @@ void Play_SetViewpoint(PlayState* play, s16 viewpoint) { play->unk_1242B = viewpoint; if ((YREG(15) != 0x10) && (gSaveContext.cutsceneIndex < 0xFFF0)) { - Audio_PlaySoundGeneral((viewpoint == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral((viewpoint == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Play_RequestViewpointBgCam(play); @@ -1036,8 +1036,8 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_SANDSTORM: - Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (play->transitionTrigger == TRANS_TRIGGER_END) { if (play->envCtx.sandstormPrimA < 110) { @@ -1074,8 +1074,8 @@ void Play_Update(PlayState* play) { break; case TRANS_MODE_SANDSTORM_END: - Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (play->transitionTrigger == TRANS_TRIGGER_END) { if (play->envCtx.sandstormPrimA <= 0) { @@ -1222,8 +1222,8 @@ void Play_Update(PlayState* play) { // "Changing viewpoint is prohibited during the cutscene" osSyncPrintf(VT_FGCOL(CYAN) "ใƒ‡ใƒขไธญใซใคใ่ฆ–็‚นๅค‰ๆ›ดใ‚’็ฆๆญขใ—ใฆใŠใ‚Šใพใ™\n" VT_RST); } else if (YREG(15) == 0x10) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { // C-Up toggle for houses, move between pivot camera and fixed camera // Toggle viewpoint between VIEWPOINT_LOCKED and VIEWPOINT_PIVOT diff --git a/soh/src/code/z_sound_source.c b/soh/src/code/z_sound_source.c index 16e3fee5b..055afec39 100644 --- a/soh/src/code/z_sound_source.c +++ b/soh/src/code/z_sound_source.c @@ -58,5 +58,5 @@ void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 du source->countdown = duration; SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &source->worldPos, &source->projectedPos); - Audio_PlaySoundGeneral(sfxId, &source->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, &source->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } diff --git a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 5c0b8bcb9..3adfba222 100644 --- a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -181,8 +181,8 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } this->timer = 0; - Audio_PlaySoundGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (DECR(this->timer) == 0) { grabbed = this->grabbed; if (grabbed != NULL) { @@ -278,12 +278,12 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } func_80865044(this); - Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_STICK_OBJ, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos); - Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (CHECK_BTN_ANY(play->state.input[0].press.button, (buttonsToCheck))) { this->timer = 0; diff --git a/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index a2f2d241c..160dc15f9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -234,7 +234,7 @@ void func_8086EE40(BgBombwall* this, PlayState* play) { func_8086EE94(this, play); if (((this->dyna.actor.params >> 0xF) & 1) != 0) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } } diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 981f25cd2..ba75c10e8 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -307,11 +307,11 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; Player_SetCsActionWithHaltedActors(play, NULL, 0x31); } - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (this->dyna.actor.params < 0) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Actor_Kill(&this->dyna.actor); diff --git a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 701249e79..20334c893 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -173,8 +173,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) { func_8003555C(play, &pos1, &sBgDdanKdVelocity, &sBgDdanKdAccel); } Camera_AddQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3); - Audio_PlaySoundGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index d9408a83c..8bd9ec874 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -160,16 +160,16 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); this->state = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); BgDodoago_SetupAction(this, BgDodoago_OpenJaw); OnePointCutscene_Init(play, 3380, 160, &this->dyna.actor, MAIN_CAM); } else if (play->roomCtx.unk_74[this->state] == 0) { OnePointCutscene_Init(play, 3065, 40, &this->dyna.actor, MAIN_CAM); BgDodoago_SetupAction(this, BgDodoago_LightOneEye); - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { OnePointCutscene_Init(play, 3065, 20, &this->dyna.actor, MAIN_CAM); - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sBgDodoagoTimer += 30; return; } @@ -247,11 +247,11 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) { if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); - Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index a3e9ec999..48362c49d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -221,11 +221,11 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) { } } else { if (this->dropTimer == 1) { - Audio_PlaySoundGeneral(NA_SE_EV_STONEDOOR_STOP, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_STONEDOOR_STOP, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } 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); diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 02271a89c..9c14562e2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -123,7 +123,7 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } else { this->actionFlags |= 4; this->timer1 = 304; - Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -138,7 +138,7 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } else { this->actionFlags |= 8; this->timer2 = 304; - Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_RED_EYE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index ec4dff4e3..54bea8742 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -163,7 +163,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->unk_198 = 40; this->actionFunc = func_8087AF38; } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 7b5519e43..dba3e9210 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -115,7 +115,7 @@ void func_8087B938(BgHaka* this, PlayState* play) { player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY; if (this->dyna.actor.params == 1) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else if (!IS_DAY && play->sceneNum == SCENE_GRAVEYARD) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_POH, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0, @@ -124,7 +124,7 @@ void func_8087B938(BgHaka* this, PlayState* play) { // un tss un tss if (play->sceneNum == SCENE_GRAVEYARD && allPulled) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); func_800F5ACC(NA_BGM_STAFF_2); Actor* actor2 = play->actorCtx.actorLists[ACTORCAT_BG].head; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 98c5138c3..fb6e77efc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -242,7 +242,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, PlayState* play) { sBgPoEventPuzzleState = SKULL_OF_TRUTH_FOUND; this->actionFunc = BgHakaGate_DoNothing; } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GROUND_GATE_OPEN); func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId); this->vTimer = 60; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 923d8c721..25964162a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -230,6 +230,6 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) { sp2C.z = this->dyna.actor.world.pos.z; SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->bellSoundPos); - func_80078914(&this->bellSoundPos, NA_SE_EV_SHIP_BELL - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->bellSoundPos, NA_SE_EV_SHIP_BELL - SFX_FLAG); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 9bfce3603..938be0f86 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -546,7 +546,7 @@ void BgHakaTrap_Draw(Actor* thisx, PlayState* play) { sp2C.y = this->dyna.actor.world.pos.y + 110.0f; SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &sp2C, &this->unk_16C); - func_80078914(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index e031c07cc..080d50814 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -163,7 +163,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { if (sPotsDestroyed == 3) { // All 3 pots destroyed collectibleParams = -1; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); // Drop rupees for (i = 0; i < 9; i++) { collectible = Item_DropCollectible(play, &spawnPos, i % 3); @@ -178,7 +178,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_FIREFLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 80.0f, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, 2, true); - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } else { // Random rewards if (CVarGetInteger(CVAR_ENHANCEMENT("NoRandomDrops"), 0)) { @@ -192,7 +192,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { } else { collectibleParams = ITEM00_ARROWS_SMALL; } - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } else if (Flags_GetCollectible(play, this->dyna.actor.params) != 0) { // If small key already collected, drop recovery heart instead @@ -202,11 +202,11 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { else { collectibleParams = ITEM00_HEART; } - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { // Drops a small key and sets a collect flag collectibleParams = ((this->dyna.actor.params & 0x3F) << 8) | ITEM00_SMALL_KEY; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } if (collectibleParams != -1) { collectible = Item_DropCollectible(play, &spawnPos, collectibleParams); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index c0ffd1c8b..8f327a1af 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -376,7 +376,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { func_808884C8(this, play); if ((this->dyna.actor.params & 0xFF) == 5) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } osSyncPrintf("B(%d)\n", this->dyna.actor.params); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index ee303a178..c9cbb039f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -313,7 +313,7 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); return; } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index c5b90a4c9..6b09ebad7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -396,7 +396,7 @@ void BgHidanRock_Draw(Actor* thisx, PlayState* play) { SkinMatrix_Vec3fMtxFMultXYZ(&play->viewProjectionMtxF, &this->dyna.actor.home.pos, &this->unk_170); } - func_80078914(&this->unk_170, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->unk_170, NA_SE_EV_FIRE_PILLAR - SFX_FLAG); func_8088BC40(play, this); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 4d0353fcf..ab832198e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -428,7 +428,7 @@ void func_808911D4(BgIceShelter* this, PlayState* play) { } if (type == 4) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->dyna.actor); diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 12eb0a34a..ecbcf5913 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -275,7 +275,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, PlayState* play) { func_80033480(play, &sp8C, 100.0f, 1, 150, 100, 1); } if (this->explosionTimer == 60) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } if (this->explosionTimer >= 100) { Actor_Kill(&this->dyna.actor); diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 9db156041..a2610fac6 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -110,7 +110,7 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) { this->framesUntilDisable = 416; if (D_8089C1A0 == 4) { Flags_SetSwitch(play, this->actor.params); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } if (this->framesUntilDisable == -1) { diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 06c2381e9..89db58c0e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -475,7 +475,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { this->dList = NULL; BgMizuBwall_SpawnDebris(this, play); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->actionFunc = BgMizuBwall_Break; } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 37402f22a..61bec679b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -218,7 +218,7 @@ void func_808A3E54(BgMoriHineri* this, PlayState* play) { this->moriHineriObjIdx = objBankIndex; this->dyna.actor.params ^= 1; sBgMoriHineriNextCamIdx = MAIN_CAM; - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { this->dyna.actor.draw = NULL; this->actionFunc = func_808A3D58; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 88ff91935..0324c43cb 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -134,9 +134,9 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { BgMoriIdomizu_SetWaterLevel(play, thisx->world.pos.y); if (this->drainTimer > 0) { if (switchFlagSet) { - func_800788CC(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - func_800788CC(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } } } diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index f8c02704f..a57d9439a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -137,11 +137,11 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play) { thisx->home.rot.y -= 0x2000; } thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y; - func_800788CC(NA_SE_EV_STONEDOOR_STOP); + Sfx_PlaySfxCentered2(NA_SE_EV_STONEDOOR_STOP); } else { rotY = this->rotYdeg * (0x10000 / 360.0f); thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y + rotY; - func_800788CC(NA_SE_EV_WALL_SLIDE - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_WALL_SLIDE - SFX_FLAG); } if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index bc420d399..6035945bd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -133,7 +133,7 @@ void BgMoriRakkatenjo_Wait(BgMoriRakkatenjo* this, PlayState* play) { } } if (this->timer < 20) { - func_800788CC(NA_SE_EV_BLOCKSINK - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_BLOCKSINK - SFX_FLAG); } } @@ -156,7 +156,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) { } else { if (this->bounceCount == 0) { this->fallCount++; - func_800788CC(NA_SE_EV_STONE_BOUND); + Sfx_PlaySfxCentered2(NA_SE_EV_STONE_BOUND); func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96); } thisx->world.pos.y = diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 716868f39..c706b68a7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -343,7 +343,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, PlayState* play) { if (amy != NULL) { OnePointCutscene_Init(play, 3170, 30, amy, MAIN_CAM); } - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); gSaveContext.timer1State = 0xA; } } else { @@ -538,7 +538,7 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, PlayState* play) { thisx->world.pos.y - 40.0f, thisx->world.pos.z, 0, thisx->shape.rot.y, 0, thisx->params + ((this->type - 1) << 8), true); OnePointCutscene_Init(play, 3160, 80, thisx, MAIN_CAM); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else { Audio_PlayActorSound2(thisx, NA_SE_EN_PO_LAUGH2); diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 4f9207abe..58458fd1c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -150,7 +150,7 @@ void func_808A9234(BgRelayObjects* this, PlayState* play) { func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); if (this->unk_169 != play->roomCtx.curRoom.num) { - func_800788CC(NA_SE_EN_PO_LAUGH); + Sfx_PlaySfxCentered2(NA_SE_EN_PO_LAUGH); this->timer = 5; this->actionFunc = func_808A932C; return; @@ -173,7 +173,7 @@ void func_808A932C(BgRelayObjects* this, PlayState* play) { } if (this->timer == 0) { if (!Player_InCsMode(play)) { - func_80078884(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); Play_TriggerRespawn(play); this->actionFunc = BgRelayObjects_DoNothing; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index d49830357..59ef31c4f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -50,7 +50,7 @@ const ActorInit Bg_Spot01_Idohashira_InitVars = { }; void BgSpot01Idohashira_PlayBreakSfx1(BgSpot01Idohashira* this) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_BOX_BREAK); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_BOX_BREAK); } void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index 5f035763e..1a4e21e4a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -55,8 +55,8 @@ void func_808ABB84(BgSpot01Idomizu* this, PlayState* play) { } play->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; if (this->waterHeight < this->actor.world.pos.y) { - Audio_PlaySoundGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f); } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index c2e8e1123..cebaa088c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -214,7 +214,7 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) { } if (play->csCtx.frames == 245 || play->csCtx.frames == 351) { - func_800788CC(NA_SE_EV_LIGHTNING); + Sfx_PlaySfxCentered2(NA_SE_EV_LIGHTNING); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 6e5bcf8dd..823a65040 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -343,7 +343,7 @@ void BgSpot06Objects_LockWait(BgSpot06Objects* this, PlayState* play) { EffectSsGSplash_Spawn(play, &this->dyna.actor.world.pos, NULL, NULL, 1, 700); this->collider.elements->dim.worldSphere.radius = 45; this->actionFunc = BgSpot06Objects_LockPullOutward; - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Flags_SetSwitch(play, this->switchFlag); OnePointCutscene_Init(play, 4120, 170, &this->dyna.actor, MAIN_CAM); } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index af09141fd..e40302b66 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -187,7 +187,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) { func_808B0324(this, play); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } else if (this->dyna.actor.xzDistToPlayer < 800.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 11241004a..3b7f7c7e4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -139,7 +139,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { func_808B2218(this, play); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); return; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index e98369169..65e70a4b6 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -110,7 +110,7 @@ void func_808B29F0(BgSpot11Oasis* this, PlayState* play) { func_808B2AA8(this); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_SPAWNER, true); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } func_808B27F0(play, this->actor.world.pos.y); } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index d1fdca048..6235d5256 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -286,7 +286,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { Audio_PlayActorSound2(actor, NA_SE_EV_WOOD_BOUND); } if (func_808B3A40(this, play)) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } actor->home.pos.x = actor->world.pos.x; actor->home.pos.z = actor->world.pos.z; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 34a0c5091..2ba99a0a4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -472,7 +472,7 @@ void func_808B5A94(BgSpot16Bombstone* this, PlayState* play) { func_808B5240(this, play); if (this->unk_154 == 56) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } if (this->unk_154 > 60) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 08f8e36b5..6537a1690 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -118,7 +118,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { func_808B6BC0(this, play); Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 2d81c8610..9e31efbdd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -418,9 +418,9 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } else if (this->unk_216 == 2) { if (this->unk_218 == 2) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } else if (this->unk_216 == 200) { func_808B7BB0(this); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index bcff47d6b..8453bed74 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -258,7 +258,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY; Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 69ecc4251..b6bd559d2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -100,7 +100,7 @@ void func_808BC65C(BgTreemouth* this, PlayState* play) { if (npcAction->action == 2) { BgTreemouth_SetupAction(this, func_808BC80C); } else if (npcAction->action == 3) { - Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); BgTreemouth_SetupAction(this, func_808BC6F8); } } @@ -206,7 +206,7 @@ void func_808BCAF0(BgTreemouth* this, PlayState* play) { if (npcAction->action == 2) { BgTreemouth_SetupAction(this, func_808BC80C); } else if (npcAction->action == 3) { - Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_WOODDOOR_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); BgTreemouth_SetupAction(this, func_808BC6F8); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index dcbb6c126..bf2987c91 100644 --- a/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -84,8 +84,8 @@ void BgVbSima_Update(Actor* thisx, PlayState* play) { this->dyna.actor.world.pos.z += 2.0f * Math_CosS(this->shakeTimer * 0x8000); this->dyna.actor.shape.rot.x = (s16)Math_SinS(this->shakeTimer * 0x7000) * 0x37; this->dyna.actor.shape.rot.z = (s16)Math_SinS(this->shakeTimer * 0x5000) * 0x37; - Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (signal == VBSIMA_KILL) { Actor_Kill(&this->dyna.actor); } diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 9a38cfa5e..23d7fac96 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -149,7 +149,7 @@ void func_808BF078(BgYdanMaruta* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->unk_16A = 20; Flags_SetSwitch(play, this->switchFlag); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_808BF108; OnePointCutscene_Init(play, 3010, 50, &this->dyna.actor, MAIN_CAM); } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index b7c988cda..f197bff4d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -172,7 +172,7 @@ void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) { void BgYdanSp_BurnWeb(BgYdanSp* this, PlayState* play) { this->timer = 30; this = this; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Flags_SetSwitch(play, this->isDestroyedSwitchFlag); if (this->dyna.actor.params == WEB_FLOOR) { this->actionFunc = BgYdanSp_BurnFloorWeb; @@ -255,7 +255,7 @@ void BgYdanSp_FloorWebBreaking(BgYdanSp* this, PlayState* play) { if (this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 190.0f) { func_8003EBF8(play, &play->colCtx.dyna, this->dyna.bgId); this->timer = 40; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Flags_SetSwitch(play, this->isDestroyedSwitchFlag); this->actionFunc = BgYdanSp_FloorWebBroken; pos.y = this->dyna.actor.world.pos.y - 60.0f; diff --git a/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index bc91d519b..b0e6779cc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -55,8 +55,8 @@ void BgZg_Destroy(Actor* thisx, PlayState* play) { } void func_808C0C50(BgZg* this) { - Audio_PlaySoundGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_METALDOOR_OPEN, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } s32 func_808C0C98(BgZg* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 59c83fc82..484b8d4bd 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -844,7 +844,7 @@ void BossDodongo_Walk(BossDodongo* this, PlayState* play) { } if (this->unk_1BC != 0) { - func_80078884(NA_SE_EN_DODO_K_WALK); + Sfx_PlaySfxCentered(NA_SE_EN_DODO_K_WALK); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_WALK); } diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index e004cc627..9ef884c61 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -397,8 +397,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->fogMode = 1; } if (this->timers[0] < 50) { - Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->camData.yMod = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->camData.shake; Math_ApproachF(&this->camData.shake, 2.0f, 1.0f, 0.8 * 0.01f); } @@ -418,8 +418,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { case BFD_CS_LOOK_GROUND: this->camData.yMod = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->camData.shake; Math_ApproachF(&this->camData.shake, 2.0f, 1.0f, 0.8 * 0.01f); - Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (this->timers[0] == 0) { this->introState = BFD_CS_COLLAPSE; this->camData.nextEye.x = player2->actor.world.pos.x + 100.0f + 300.0f; @@ -439,8 +439,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->camData.accel = 0.005f; this->camData.yMod = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->camData.shake; Math_ApproachF(&this->camData.shake, 2.0f, 1.0f, 0.8 * 0.01f); - Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (this->timers[0] == 100) { this->platformSignal = VBSIMA_COLLAPSE; } @@ -476,8 +476,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { osSyncPrintf("WAY_SPD Y = %f\n", this->camData.atVel.y); osSyncPrintf("WAY_SPD Z = %f\n", this->camData.atVel.z); if ((this->timers[3] > 190) && !Flags_GetEventChkInf(EVENTCHKINF_BEGAN_VOLVAGIA_BATTLE)) { - Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_ROLL - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (this->timers[3] == 190) { this->camData.atMaxVel.x = this->camData.atMaxVel.y = this->camData.atMaxVel.z = 0.05f; @@ -683,8 +683,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { if (this->actor.bgCheckFlags & 0x10) { this->fwork[BFD_CEILING_BOUNCE] = -18384.0f; this->timers[1] = 10; - Audio_PlaySoundGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_80033E1C(play, 3, 0xA, 0x7530); this->work[BFD_ROCK_TIMER] = 300; } @@ -783,8 +783,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { sp150 = 1; if (this->work[BFD_MOVE_TIMER] & 0x1C) { - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_BURN - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_BURN - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } for (i1 = 0; i1 < sp150; i1++) { if (sp150) { // Needed for matching @@ -856,8 +856,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->work[BFD_CEILING_TARGET]++; this->timers[1] = 60; this->work[BFD_CAM_SHAKE_TIMER] = 20; - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND2, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Player_SetCsActionWithHaltedActors(play, &this->actor, 5); for (i1 = 0; i1 < 15; i1++) { Vec3f sp144 = { 0.0f, 0.0f, 0.0f }; @@ -898,8 +898,8 @@ void BossFd_Fly(BossFd* this, PlayState* play) { Vec3f sp114 = { 0.0f, 0.0f, 0.0f }; Vec3f sp108 = { 0.0f, 0.03f, 0.0f }; - Audio_PlaySoundGeneral(NA_SE_EN_GOMA_LAST - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GOMA_LAST - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sp120.x = Rand_CenteredFloat(40.0f) + this->actor.world.pos.x; sp120.y = (Rand_CenteredFloat(10.0f) + this->actor.world.pos.y) - 10.0f; @@ -1139,8 +1139,8 @@ void BossFd_Effects(BossFd* this, PlayState* play) { if (this->work[BFD_ROAR_TIMER] != 0) { if (this->work[BFD_ROAR_TIMER] == 37) { - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_ROAR, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_ROAR, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } jawAngle = 6000.0f; jawSpeed = 1300.0f; @@ -1160,8 +1160,8 @@ void BossFd_Effects(BossFd* this, PlayState* play) { Vec3f spawnPos1; s32 pad; - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_APPEAR - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_APPEAR - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (this->work[BFD_SPLASH_TIMER] != 0) { this->work[BFD_SPLASH_TIMER]--; if ((this->actor.colChkInfo.health == 0) || @@ -1238,8 +1238,8 @@ void BossFd_Effects(BossFd* this, PlayState* play) { this->fogMode = 2; spawnSpeed2.z = 30.0f; - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_FIRE - SFX_FLAG, &sFireAudioVec, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_FIRE - SFX_FLAG, &sFireAudioVec, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); spawnPos2 = this->headPos; spawnAngleY = (this->actor.world.rot.y / (f32)0x8000) * M_PI; @@ -1301,8 +1301,8 @@ void BossFd_CollisionCheck(BossFd* this, PlayState* play) { } this->work[BFD_DAMAGE_FLASH_TIMER] = 10; this->work[BFD_INVINC_TIMER] = 20; - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_DAMAGE1, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_DAMAGE1, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 8e2fffe36..e3543315c 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -700,7 +700,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->fwork[GDF_TRIFORCE_PRIM_A] = 0.0f; this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f; this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f; - func_80078884(NA_SE_EV_TRIFORCE_MARK); + Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_MARK); play->envCtx.unk_D8 = 0.0f; // fallthrough case 7: @@ -747,7 +747,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->fwork[GDF_TRIFORCE_PRIM_A] = 0.0f; this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f; this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f; - func_80078884(NA_SE_EV_TRIFORCE_MARK); + Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_MARK); play->envCtx.unk_D8 = 0.0f; // fallthrough case 9: @@ -956,7 +956,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { if (this->csTimer >= 30) { if (this->csTimer == 30) { - func_80078884(NA_SE_EV_TRIFORCE_MARK); + Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_MARK); } // fade in ganondorf's triforce @@ -1476,7 +1476,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.2f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); skip_cam_and_quake: this->envLightMode = 15; @@ -1523,7 +1523,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { } this->unk_70C = Math_SinS(this->csTimer * 0x6300) * this->unk_710; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); if (this->csTimer < 100) { this->windowShatterState = GDF_WINDOW_SHATTER_PARTIAL; @@ -1744,7 +1744,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { case 1055: this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.3f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); if (this->csTimer == 20) { sBossGanonZelda->unk_3C8 = 5; @@ -1759,7 +1759,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { case 1056: this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.3f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); this->csCamEye.x = -503.0f; this->csCamEye.y = 4128.0f; @@ -1777,7 +1777,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { case 1057: this->unk_70C = Math_SinS(this->csTimer * 0x6300) * (50.0f * this->csCamMovementScale); - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); Math_ApproachF(&this->csCamEye.x, -1200.0f, 0.1f, this->csCamMovementScale * 697.0f); Math_ApproachF(&this->csCamEye.y, 4241.0f, 0.1f, this->csCamMovementScale * 113.0f); @@ -1801,7 +1801,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { this->csCamAt.z = sBossGanonZelda->actor.world.pos.z - 25.0f; this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.3f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); if (this->csTimer == 70) { sBossGanonZelda->unk_3C8 = 6; @@ -1821,7 +1821,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { case 107: this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.8f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); this->csCamEye.x = -380.0f; this->csCamEye.y = 4154.0f; @@ -1840,7 +1840,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { case 108: this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.8f; - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); this->csCamAt.x = (sBossGanonZelda->actor.world.pos.x - 5.0f) - 30.0f; this->csCamAt.y = (sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f) - 20.0f; @@ -1863,7 +1863,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { break; case 109: - func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_EARTHQUAKE - SFX_FLAG); break; } @@ -2306,7 +2306,7 @@ void BossGanon_Wait(BossGanon* this, PlayState* play) { this->actor.world.pos.y += this->actor.velocity.y; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0xBB8); - func_80078914(&this->actor.projectedPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); } void BossGanon_SetupChargeLightBall(BossGanon* this, PlayState* play) { @@ -2803,7 +2803,7 @@ void BossGanon_UpdateDamage(BossGanon* this, PlayState* play) { BossGanon_SetupDeathCutscene(this, play); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_DD_THUNDER); - func_80078914(&sZeroVec, NA_SE_EN_LAST_DAMAGE); + Sfx_PlaySfxAtPos(&sZeroVec, NA_SE_EN_LAST_DAMAGE); Audio_QueueSeqCmd(0x100100FF); this->screenFlashTimer = 4; GameInteractor_ExecuteOnBossDefeat(&this->actor); @@ -2985,7 +2985,7 @@ void BossGanon_Update(Actor* thisx, PlayState* play2) { // player hit, spawn shock and play sound if (this->unk_2E8 != 0) { - func_80078914(&player->actor.projectedPos, NA_SE_PL_SPARK - SFX_FLAG); + Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_PL_SPARK - SFX_FLAG); BossGanonEff_SpawnShock(play, 700.0f, GDF_SHOCK_PLAYER_YELLOW); } } @@ -4028,8 +4028,8 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { if ((hitWithBottle == false) && (acHitInfo->toucher.dmgFlags & 0x100000)) { spBA = 2; - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } else { spBA = 1; @@ -4038,8 +4038,8 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { Math_Atan2S(sqrtf(SQ(xDistFromGanondorf) + SQ(zDistFromGanondorf)), yDistFromGanondorf); this->unk_1A4++; this->timers[1] = 2; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64); if (hitWithBottle == false) { @@ -4319,8 +4319,8 @@ void func_808E1EB4(Actor* thisx, PlayState* play2) { this->actor.speedXZ = 0.0f; if (this->actor.params == 0xC8) { - func_80078884(NA_SE_EN_GANON_DAMAGE2); - func_80078884(NA_SE_EN_GANON_DD_THUNDER); + Sfx_PlaySfxCentered(NA_SE_EN_GANON_DAMAGE2); + Sfx_PlaySfxCentered(NA_SE_EN_GANON_DD_THUNDER); for (i = 0; i < 150; i++) { @@ -4824,7 +4824,7 @@ void BossGanon_UpdateEffects(PlayState* play) { Math_ApproachF(&eff->unk_40, 4.0f, 1.0f, 0.15f); } else if (eff->type == GDF_EFF_IMPACT_DUST_LIGHT) { if (i == 0) { - func_80078884(NA_SE_EN_GANON_WAVE_GND - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EN_GANON_WAVE_GND - SFX_FLAG); } eff->unk_30++; // unused diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 97cc537b4..1323afe32 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -334,7 +334,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { Math_ApproachF(&this->unk_3B0.y, player->actor.world.pos.y + 47.0f + 7.0f, 0.1f, 2.0f); this->unk_339 = 4; if (this->csTimer == 10) { - func_80078914(&D_80906D6C, NA_SE_EV_STONE_BOUND); + Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); } if (this->csTimer == 20) { @@ -397,7 +397,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_3B0.y = (player->actor.world.pos.y + 200.0f) - 160.0f; this->unk_3B0.z = player->actor.world.pos.z; if (this->csTimer >= 20) { - func_80078884(NA_SE_EN_GOMA_LAST - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EN_GOMA_LAST - SFX_FLAG); Math_ApproachF(&this->unk_324, 255.0f, 1.0f, 10.0f); this->unk_339 = 5; if (this->csTimer == 20) { @@ -418,7 +418,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { break; case 11: this->unk_339 = 5; - func_80078884(NA_SE_EN_GOMA_LAST - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EN_GOMA_LAST - SFX_FLAG); player->actor.world.pos.x = 490.0f; player->actor.world.pos.y = 1086.0f; player->actor.world.pos.z = -166.0f; @@ -434,10 +434,10 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_3B0.y = ((player->actor.world.pos.y + 200.0f) - 151.0f) - 2.0f; this->unk_3B0.z = player->actor.world.pos.z + 2.0f; if (this->csTimer == 10) { - func_80078914(&D_80906D6C, NA_SE_EV_STONE_BOUND); + Sfx_PlaySfxAtPos(&D_80906D6C, NA_SE_EV_STONE_BOUND); } if (this->csTimer == 20) { - func_80078884(NA_SE_EV_STONE_BOUND); + Sfx_PlaySfxCentered(NA_SE_EV_STONE_BOUND); } if (this->csTimer == 30) { Player_SetCsActionWithHaltedActors(play, &this->actor, 0x52); @@ -471,7 +471,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { func_800A9F6C(0.0f, 0xC8, 0x14, 0x14); } if (this->csTimer == 30) { - func_80078884(NA_SE_EV_GRAVE_EXPLOSION); + Sfx_PlaySfxCentered(NA_SE_EV_GRAVE_EXPLOSION); } if (this->csTimer >= 30) { Math_ApproachF(&this->actor.world.pos.y, 1289.0f, 0.1f, 10.0f); @@ -736,8 +736,8 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_312 = 2; } if ((this->csTimer == 166) || (this->csTimer == 185) || (this->csTimer == 200)) { - func_80078884(NA_SE_EN_MGANON_SWORD); - func_80078884(NA_SE_EN_MGANON_ROAR); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_SWORD); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_ROAR); } if (this->csTimer == 215) { this->csState = 23; @@ -751,8 +751,8 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_312 = 2; } if (this->csTimer == 222) { - func_80078884(NA_SE_EN_MGANON_SWORD); - func_80078884(NA_SE_EN_MGANON_ROAR); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_SWORD); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_ROAR); } this->unk_3A4.x = (player->actor.world.pos.x - 40.0f) + 6.0f; this->unk_3A4.y = player->actor.world.pos.y + 40.0f; @@ -761,7 +761,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_3B0.y = ((player->actor.world.pos.y + 10.0f + 60.0f) - 20.0f) - 2.0f; this->unk_3B0.z = player->actor.world.pos.z; if (this->csTimer == 228) { - func_80078884(NA_SE_IT_SHIELD_REFLECT_SW); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW); Player_SetCsActionWithHaltedActors(play, &this->actor, 0x56); func_800A9F6C(0.0f, 0xFF, 0xA, 0x32); } @@ -796,7 +796,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { this->unk_3A4.z = effect->position.z + 70.0f; } if ((this->csTimer & 3) == 0) { - func_80078884(NA_SE_IT_SWORD_SWING); + Sfx_PlaySfxCentered(NA_SE_IT_SWORD_SWING); } if (this->csTimer == 25) { Player_SetCsActionWithHaltedActors(play, &this->actor, 0x57); @@ -976,11 +976,11 @@ void func_808FF898(BossGanon2* this, PlayState* play) { } if (this->unk_392 == 4) { - func_80078884(NA_SE_EV_GRAVE_EXPLOSION); + Sfx_PlaySfxCentered(NA_SE_EV_GRAVE_EXPLOSION); } if (this->unk_392 == 3) { - func_80078884(NA_SE_EN_MGANON_SWDIMP); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_SWDIMP); } } } @@ -1349,7 +1349,7 @@ void func_80900890(BossGanon2* this, PlayState* play) { play->envCtx.unk_D8 = 0.0f; case 1: if (this->unk_1A2[1] == 50) { - func_80078884(NA_SE_EN_MGANON_WALK); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_WALK); } Matrix_RotateY(((this->actor.shape.rot.y / (f32)0x8000) * M_PI) + 0.3f, MTXMODE_NEW); sp5C.x = 0.0f; @@ -1556,12 +1556,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) { Math_ApproachZeroF(&play->envCtx.unk_D8, 1.0f, 0.08f); } if (this->csTimer == 50) { - func_80078884(NA_SE_EN_MGANON_WALK); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_WALK); } if (this->csTimer > 90) { Math_ApproachF(&this->unk_380, 0.25f, 1.0f, 0.0125f); this->unk_37C = 200.0f; - func_80078884(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); } if (this->csTimer >= 110) { if (this->csTimer == 110) { @@ -1596,7 +1596,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { case 2: this->unk_339 = 22; Math_ApproachF(&play->envCtx.unk_D8, 1.0f, 1.0f, 0.1f); - func_80078884(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); this->unk_3A4.x = 250; this->unk_3A4.y = 1150.0f; this->unk_3A4.z = 0.0f; @@ -1610,7 +1610,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { break; case 3: this->unk_339 = 22; - func_80078884(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); this->unk_3A4.x = 330.0f; this->unk_3A4.y = 1120.0f; this->unk_3A4.z = -150.0f; @@ -1647,7 +1647,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { this->unk_339 = 23; if ((this->csTimer >= 60) && (this->csTimer <= 90)) { if (this->csTimer == 62) { - func_80078884(NA_SE_EV_TRIFORCE_FLASH); + Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_FLASH); } Math_ApproachF(&this->unk_38C, 200.0f, 1.0f, 8.0f); } else { @@ -1707,12 +1707,12 @@ void func_8090120C(BossGanon2* this, PlayState* play) { player->actor.shape.rot.y = -0x4000; player->actor.world.pos.z = 30.0f; if ((this->csTimer == 20) || (this->csTimer == 30) || (this->csTimer == 65) || (this->csTimer == 40)) { - func_80078884(NA_SE_VO_LI_SWORD_N); - func_80078884(NA_SE_IT_SWORD_SWING_HARD); + Sfx_PlaySfxCentered(NA_SE_VO_LI_SWORD_N); + Sfx_PlaySfxCentered(NA_SE_IT_SWORD_SWING_HARD); } if ((this->csTimer == 22) || (this->csTimer == 35) || (this->csTimer == 72) || (this->csTimer == 45)) { - func_80078884(NA_SE_EN_MGANON_DAMAGE); - func_80078884(NA_SE_IT_SHIELD_BOUND); + Sfx_PlaySfxCentered(NA_SE_EN_MGANON_DAMAGE); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_BOUND); play->envCtx.unk_D8 = 1.0f; } if ((this->csTimer == 22) || (this->csTimer == 35) || (this->csTimer == 72) || (this->csTimer == 45)) { @@ -2052,7 +2052,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) { if (this->actor.bgCheckFlags & 1) { if (this->actor.velocity.y < -5.0f) { func_80033E88(&this->actor, play, 5, 20); - func_80078884(NA_SE_IT_BOMB_EXPLOSION); + Sfx_PlaySfxCentered(NA_SE_IT_BOMB_EXPLOSION); } this->actor.velocity.y = 0.0f; } @@ -2138,7 +2138,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) { if (Rand_ZeroOne() < 0.5f) { D_8090EB20.z = Rand_ZeroFloat(1000.0f); } - func_80078914(&D_8090EB20, NA_SE_EV_LIGHTNING); + Sfx_PlaySfxAtPos(&D_8090EB20, NA_SE_EV_LIGHTNING); this->unk_328 = 0xFF; this->unk_330 = 5; this->unk_32C = 0.0f; @@ -2916,7 +2916,7 @@ void func_80905DA8(BossGanon2* this, PlayState* play) { if (effect->velocity.y < -10.0f) { sp78 = effect->position; sp78.y = 1086.0f; - func_80078884(NA_SE_IT_SHIELD_REFLECT_SW); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_SW); CollisionCheck_SpawnShieldParticlesMetal(play, &sp78); } effect->velocity.y = 0.0f; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 5f800a056..45b8302dc 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -316,7 +316,7 @@ void BossGanondrof_Intro(BossGanondrof* this, PlayState* play) { } if (this->timers[1] == 30) { - func_80078914(&sAudioVec, NA_SE_EN_FANTOM_TRANSFORM); + Sfx_PlaySfxAtPos(&sAudioVec, NA_SE_EN_FANTOM_TRANSFORM); } if (horse->bossGndSignal == FHG_LIGHTNING) { diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 12dfd415a..1f613bf08 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -619,7 +619,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { case MO_TENT_READY: case MO_TENT_SWING: if (sMorphaCore->csState == MO_BATTLE) { - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); } Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f); for (indS1 = 0; indS1 < 41; indS1++) { @@ -672,7 +672,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { break; case MO_TENT_ATTACK: this->actor.flags |= ACTOR_FLAG_PLAY_HIT_SFX; - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_ATTACK - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_ATTACK - SFX_FLAG); Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f); for (indS1 = 0; indS1 < 41; indS1++) { Math_ApproachF(&this->tentStretch[indS1].y, @@ -754,9 +754,9 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { if (play->grabPlayer(play, player)) { player->actor.parent = &this->actor; this->work[MO_TENT_ACTION_STATE] = MO_TENT_GRAB; - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_CATCH); - Audio_PlaySoundGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CATCH); + Audio_PlaySoundGeneral(NA_SE_VO_LI_DAMAGE_S, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { this->work[MO_TENT_ACTION_STATE] = MO_TENT_READY; this->tentMaxAngle = .001f; @@ -885,7 +885,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { } break; case MO_TENT_CUT: - func_80078914(&this->tentTipPos, NA_SE_EV_WATER_WALL - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EV_WATER_WALL - SFX_FLAG); if (&this->actor == player->actor.parent) { player->av2.actionVar2 = 0x65; player->actor.parent = NULL; @@ -1103,7 +1103,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { this->drawActor = false; this->work[MO_TENT_ACTION_STATE] = MO_TENT_DEATH_6; this->timers[0] = 60; - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_CORE_JUMP); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CORE_JUMP); for (indS1 = 0; indS1 < 300; indS1++) { spC8.x = 0.0; spC8.y = 0.0; @@ -1181,7 +1181,7 @@ void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) { hurtbox = this->tentCollider.elements[i1].info.acHitInfo; this->work[MO_TENT_INVINC_TIMER] = 5; if (hurtbox->toucher.dmgFlags & 0x00020000) { - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_CUT); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CUT); this->cutIndex = 15; this->meltIndex = this->cutIndex + 1; this->work[MO_TENT_ACTION_STATE] = MO_TENT_CUT; @@ -1292,7 +1292,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { EffectSsBubble_Spawn(play, &bubblePos, 0.0f, 10.0f, 50.0f, Rand_ZeroFloat(0.05f) + 0.13f); } if (this->timers[2] == 40) { - func_80078914(&sAudioZeroVec, NA_SE_EN_MOFER_BUBLE_DEMO); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EN_MOFER_BUBLE_DEMO); } break; case MO_INTRO_SWIM: @@ -1325,7 +1325,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { Math_ApproachF(&this->cameraSpeedMod, 0.02f, 1.0f, 0.001f); } if (this->work[MO_TENT_MOVE_TIMER] == 190) { - func_80078914(&sAudioZeroVec, NA_SE_EN_MOFER_BUBLE_DEMO); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EN_MOFER_BUBLE_DEMO); } if ((this->work[MO_TENT_MOVE_TIMER] > 150) && (this->work[MO_TENT_MOVE_TIMER] < 180)) { bubblePos2.x = (this->cameraEye.x + 20.0f) + 10.0f; @@ -1517,9 +1517,9 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { } if ((this->csState > MO_INTRO_START) && (this->work[MO_TENT_MOVE_TIMER] > 540)) { - func_80078914(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); + Sfx_PlaySfxAtPos(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); } else if (this->csState >= MO_INTRO_START) { - func_80078914(&sAudioZeroVec, NA_SE_EN_MOFER_MOVE_DEMO - SFX_FLAG); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EN_MOFER_MOVE_DEMO - SFX_FLAG); } } @@ -1718,13 +1718,13 @@ void BossMo_DeathCs(BossMo* this, PlayState* play) { } if ((this->csState > MO_DEATH_START) && (this->csState < MO_DEATH_FINISH)) { if (this->work[MO_TENT_MOVE_TIMER] < 500) { - func_80078914(&sAudioZeroVec, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EN_MOFER_APPEAR - SFX_FLAG); } if ((this->work[MO_TENT_MOVE_TIMER] < 490) && (this->work[MO_TENT_MOVE_TIMER] > 230)) { - func_80078914(&sAudioZeroVec, NA_SE_EV_DROP_FALL - SFX_FLAG); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EV_DROP_FALL - SFX_FLAG); } if (this->work[MO_TENT_MOVE_TIMER] < 220) { - func_80078914(&sAudioZeroVec, NA_SE_EV_SCOOPUP_WATER - SFX_FLAG); + Sfx_PlaySfxAtPos(&sAudioZeroVec, NA_SE_EV_SCOOPUP_WATER - SFX_FLAG); } } if (sMorphaCore->waterLevel < -200.0f) { @@ -1820,7 +1820,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) { this->work[MO_TENT_INVINC_TIMER] = 10; } else if (!(hurtbox->toucher.dmgFlags & 0x00100000) && (hurtbox->toucher.dmgFlags & 0x80)) { if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) { - func_80078914(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_CUT); + Sfx_PlaySfxAtPos(&sMorphaTent1->tentTipPos, NA_SE_EN_MOFER_CUT); sMorphaTent1->cutIndex = this->work[MO_CORE_POS_IN_TENT]; sMorphaTent1->meltIndex = sMorphaTent1->cutIndex + 1; sMorphaTent1->cutScale = 1.0f; @@ -2386,7 +2386,7 @@ void BossMo_UpdateTent(Actor* thisx, PlayState* play) { } else { i = 0; if (this->work[MO_TENT_ACTION_STATE] < MO_TENT_CUT) { - func_80078914(&this->tentTipPos, NA_SE_EN_MOFER_CORE_ROLL - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CORE_ROLL - SFX_FLAG); } } bubblePos.x = this->tentPos[i].x + sp7C.x; @@ -3614,7 +3614,7 @@ void BossMo_Unknown(void) { if (BREG(32) != 0) { BREG(32)--; Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); - func_80078914(&zeroVec, unkSfx[BREG(33)]); + Sfx_PlaySfxAtPos(&zeroVec, unkSfx[BREG(33)]); } if (BREG(34) != 0) { BREG(34) = 0; diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index ad1c87d1c..7eede228b 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -2526,7 +2526,7 @@ void BossSst_HandSetInvulnerable(BossSst* this, s32 isInv) { } void BossSst_HeadSfx(BossSst* this, u16 sfxId) { - func_80078914(&this->center, sfxId); + Sfx_PlaySfxAtPos(&this->center, sfxId); } void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index f92526337..0e3c3ba08 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -853,7 +853,7 @@ s32 BossTw_CheckBeamReflection(BossTw* this, PlayState* play) { BossTw_AddShieldDeflectEffect(play, 10.0f, this->actor.params); play->envCtx.unk_D8 = 1.0f; this->timers[0] = 10; - func_80078884(NA_SE_IT_SHIELD_REFLECT_MG2); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_MG2); } sBeamDivertTimer++; @@ -1080,7 +1080,7 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) { } this->beamShootState = 1; - func_80078914(&player->actor.projectedPos, NA_SE_IT_SHIELD_REFLECT_MG); + Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_IT_SHIELD_REFLECT_MG); Matrix_MtxFToYXZRotS(&player->shieldMf, &sp128, 0); sp128.y += 0x8000; sp128.x = -sp128.x; @@ -1105,11 +1105,11 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) { &this->unk_54C, &this->actor.projectedW); if (this->actor.params == 1) { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_54C, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_54C, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_54C, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_54C, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; @@ -1135,15 +1135,15 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) { &this->actor.projectedW); if (this->actor.params == 1) { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_558, 4U, &D_801333E0, - &D_801333E0, &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG, &this->unk_558, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_558, 4U, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG, &this->unk_558, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_558, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_REFL_FREEZE - SFX_FLAG, &this->unk_558, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG, &this->unk_558, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_REFL_FREEZE - SFX_FLAG, &this->unk_558, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; } @@ -1671,7 +1671,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) { if (this->timers[1] == 8) { this->work[TW_BLINK_IDX] = 8; - func_80078884(NA_SE_EN_TWINROBA_YOUNG_WINK); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_YOUNG_WINK); } if (this->timers[2] == 4) { sEnvType = 0; @@ -1749,12 +1749,12 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->csSfxTimer > 220 && this->csSfxTimer < 630) { - func_80078884(NA_SE_EN_TWINROBA_UNARI - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_UNARI - SFX_FLAG); } if (this->csSfxTimer == 180) { - func_80078914(&D_8094A7D0, NA_SE_EN_TWINROBA_LAUGH); - func_80078914(&D_8094A7D0, NA_SE_EN_TWINROBA_LAUGH2); + Sfx_PlaySfxAtPos(&D_8094A7D0, NA_SE_EN_TWINROBA_LAUGH); + Sfx_PlaySfxAtPos(&D_8094A7D0, NA_SE_EN_TWINROBA_LAUGH2); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_KOTAKE_KOUME); } @@ -1815,7 +1815,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) { } if (this->work[CS_TIMER_1] == 180) { - func_80078884(NA_SE_EN_TWINROBA_APPEAR_MS); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_APPEAR_MS); } if (this->work[CS_TIMER_1] > 180) { @@ -2433,7 +2433,7 @@ void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) { } if (this->work[CS_TIMER_2] > 440 && this->work[CS_TIMER_2] < 860) { - func_80078884(NA_SE_EN_TWINROBA_FIGHT - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_FIGHT - SFX_FLAG); } if (this->work[CS_TIMER_2] == 430) { @@ -2638,7 +2638,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { Vec3f spBC; Vec3f spB0; Vec3f spA4 = { 0.0f, 0.0f, 0.0f }; - func_80078884(NA_SE_EN_TWINROBA_TRANSFORM); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_TRANSFORM); for (i = 0; i < 100; i++) { spB0.x = Rand_CenteredFloat(5.0f); spB0.y = Rand_CenteredFloat(5.0f); @@ -2751,7 +2751,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { Actor_SetScale(&sKotakePtr->actor, 0.0f); sKoumePtr->visible = 1; sKotakePtr->visible = 1; - func_80078884(NA_SE_EN_TWINROBA_TRANSFORM); + Sfx_PlaySfxCentered(NA_SE_EN_TWINROBA_TRANSFORM); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_KOTAKE_KOUME); this->csState2 = 3; this->work[CS_TIMER_2] = 0; @@ -3153,8 +3153,8 @@ void BossTw_TwinrovaUpdate(Actor* thisx, PlayState* play2) { if (sFreezeState == 1) { sFreezeState = 2; BossTw_AddPlayerFreezeEffect(play, NULL); - func_80078914(&player->actor.projectedPos, NA_SE_VO_LI_FREEZE); - func_80078914(&player->actor.projectedPos, NA_SE_PL_FREEZE); + Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_VO_LI_FREEZE); + Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_PL_FREEZE); if (sShieldFireCharge != 0) { sShieldFireCharge = 4; @@ -3680,11 +3680,11 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) { temp_t0 = sShieldFireCharge | sShieldIceCharge; if (temp_t0 == 1) { - func_80078884(NA_SE_IT_SHIELD_CHARGE_LV1 & ~SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_CHARGE_LV1 & ~SFX_FLAG); } else if (temp_t0 == 2) { - func_80078884(NA_SE_IT_SHIELD_CHARGE_LV2 & ~SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_CHARGE_LV2 & ~SFX_FLAG); } else if (temp_t0 == 3) { - func_80078884(NA_SE_IT_SHIELD_CHARGE_LV3 & ~SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_CHARGE_LV3 & ~SFX_FLAG); } if (temp_t0 != 0 && temp_t0 < 4) { @@ -4367,7 +4367,7 @@ s32 BossTw_BlastShieldCheck(BossTw* this, PlayState* play) { sEnvType = 0; sShieldIceCharge = 0; sShieldFireCharge = 0; - func_80078884(NA_SE_IT_SHIELD_REFLECT_MG2); + Sfx_PlaySfxCentered(NA_SE_IT_SHIELD_REFLECT_MG2); } ret = true; diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index fc00e641b..1d21a0372 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -3937,7 +3937,7 @@ void BossVa_SpawnTumor(PlayState* play, BossVaEffect* effect, BossVa* this, Vec3 effect->scale = 0.0f; if (((i % 4) == 0) || (mode == 2)) { - Audio_PlaySoundGeneral(NA_SE_EN_BALINADE_BREAK, &effect->pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_BALINADE_BREAK, &effect->pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; } diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 3207e4e87..c7f74ed39 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -236,7 +236,7 @@ void func_80966E98(Demo6K* this, PlayState* play) { } if (this->timer1 == 39) { - func_800788CC(NA_SE_EV_CONSENTRATION); + Sfx_PlaySfxCentered2(NA_SE_EV_CONSENTRATION); Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_6K, this->actor.world.pos.x, this->actor.world.pos.y + 10.0f, this->actor.world.pos.z, 0, 0, 0, 2, true); } diff --git a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index d05e3aa2b..dd1e97e05 100644 --- a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -309,14 +309,14 @@ void DemoDu_InitCs_GoronsRuby(DemoDu* this, PlayState* play) { // Cutscene: Darunia gives Link the Goron's Ruby. // Sfx played when Darunia lands at the floor at the start of the cutscene. void DemoDu_CsPlaySfx_GoronLanding(DemoDu* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EN_GOLON_LAND_BIG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_GOLON_LAND_BIG); } // Cutscene: Darunia gives Link the Goron's Ruby. // Sfx played when Darunia is falling at the start of the cutscene. void DemoDu_CsPlaySfx_DaruniaFalling(PlayState* play) { if (play->csCtx.frames == 160) { - func_800788CC(NA_SE_EV_OBJECT_FALL); + Sfx_PlaySfxCentered2(NA_SE_EV_OBJECT_FALL); } } @@ -325,14 +325,14 @@ void DemoDu_CsPlaySfx_DaruniaHitsLink(PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - func_80078914(&player->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_LINK); - Audio_PlaySoundGeneral(NA_SE_VO_LI_DAMAGE_S_KID, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Sfx_PlaySfxAtPos(&player->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_LINK); + Audio_PlaySoundGeneral(NA_SE_VO_LI_DAMAGE_S_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } // Cutscene: Darunia gives Link the Goron's Ruby. void DemoDu_CsPlaySfx_HitBreast(DemoDu* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_BREAST - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_BREAST - SFX_FLAG); } // Cutscene: Darunia gives Link the Goron's Ruby. @@ -341,8 +341,8 @@ void DemoDu_CsPlaySfx_LinkEscapeFromGorons(PlayState* play) { if (play->csCtx.frames == 1400) { Player* player = GET_PLAYER(play); - Audio_PlaySoundGeneral(NA_SE_VO_LI_FALL_L_KID, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_LI_FALL_L_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -352,8 +352,8 @@ void DemoDu_CsPlaySfx_LinkSurprised(PlayState* play) { if (play->csCtx.frames == 174) { Player* player = GET_PLAYER(play); - Audio_PlaySoundGeneral(NA_SE_VO_LI_SURPRISE_KID, &player->actor.projectedPos, 4U, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_LI_SURPRISE_KID, &player->actor.projectedPos, 4U, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -715,7 +715,7 @@ void DemoDu_InitCs_AfterGanon(DemoDu* this, PlayState* play) { } void DemoDu_CsPlaySfx_WhiteOut() { - func_800788CC(NA_SE_SY_WHITE_OUT_T); + Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } void DemoDu_CsAfterGanon_SpawnDemo6K(DemoDu* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index edf360487..79fcad873 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -651,7 +651,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { (IS_RANDO && gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_WARP_PAD)) { Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG); } else { - func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); } if (this->getItem.drawId != GID_ARROW_LIGHT) { this->actor.shape.rot.y += 0x3E80; @@ -667,7 +667,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { (IS_RANDO && gSaveContext.entranceIndex == ENTR_TEMPLE_OF_TIME_WARP_PAD)) { Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG); } else { - func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); } break; case 4: @@ -973,7 +973,7 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, PlayState* play) { Actor_SetScale(&effect->actor, 0.2f); } - func_800788CC(NA_SE_IT_DM_RING_EXPLOSION); + Sfx_PlaySfxCentered2(NA_SE_IT_DM_RING_EXPLOSION); Actor_Kill(&this->actor); } @@ -1862,13 +1862,13 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { if (gSaveContext.entranceIndex == ENTR_CUTSCENE_MAP_0) { if (gSaveContext.sceneSetupIndex == 4) { if (play->csCtx.frames <= 680) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); } } else { - func_80078914(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); } } else { - func_80078914(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_GOD_FLYING - SFX_FLAG); } gSPSegment(POLY_XLU_DISP++, 8, diff --git a/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index 15d042ff9..175785126 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -45,8 +45,8 @@ void DemoExt_Init(Actor* thisx, PlayState* play) { void DemoExt_PlayVortexSFX(DemoExt* this) { if (this->alphaTimer <= (kREG(35) + 40.0f) - 15.0f) { - Audio_PlaySoundGeneral(NA_SE_EV_FANTOM_WARP_L - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_FANTOM_WARP_L - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 274de1a8b..635da2c04 100644 --- a/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -101,14 +101,14 @@ void func_8097C930(DemoGo* this) { } void func_8097C9B8(DemoGo* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EN_DODO_M_GND); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_DODO_M_GND); } void func_8097C9DC(DemoGo* this) { s32 pad[2]; if (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_EN_MORIBLIN_WALK); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_MORIBLIN_WALK); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index fcc989f19..083d74b88 100644 --- a/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -20,7 +20,7 @@ void DemoGt_Destroy(Actor* thisx, PlayState* play) { } void DemoGt_PlayEarthquakeSfx() { - func_800788CC(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_EARTHQUAKE - SFX_FLAG); } void DemoGt_PlayExplosion1Sfx(PlayState* play, Vec3f* pos) { @@ -1189,7 +1189,7 @@ void func_80980F58(DemoGt* this, PlayState* play) { u16 frames = play->csCtx.frames; if (frames == 244) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); } } @@ -1312,7 +1312,7 @@ void func_80981424(DemoGt* this, PlayState* play) { u16 frames = play->csCtx.frames; if (frames == 789) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); } } @@ -1430,7 +1430,7 @@ void func_809818FC(DemoGt* this, PlayState* play) { u16 frames = play->csCtx.frames; if (frames == 845) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); } } void func_80981930(DemoGt* this, PlayState* play) { @@ -1521,7 +1521,7 @@ void func_80981CEC(DemoGt* this, PlayState* play) { u16 frames = play->csCtx.frames; if (frames == 183) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); } } @@ -1612,7 +1612,7 @@ void func_809820AC(DemoGt* this, PlayState* play) { u16 frames = play->csCtx.frames; if (frames == 154) { - func_80078914(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->dyna.actor.projectedPos, NA_SE_EV_TOWER_PARTS_BROKEN - SFX_FLAG); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index c5515a6c1..9e7bad0e1 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -93,20 +93,20 @@ void DemoIk_Type1PlaySound(DemoIk* this) { switch (this->actor.params) { case 0: if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND1_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; case 1: if (Animation_OnFrame(&this->skelAnime, 10.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND3_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; case 2: if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_LAND2_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; } @@ -327,8 +327,8 @@ void DemoIk_Type2Init(DemoIk* this, PlayState* play) { void DemoIk_Type2PlaySoundOnFrame(DemoIk* this, f32 frame) { if (Animation_OnFrame(&this->skelAnime, frame)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index a9cf029c4..d67e1cb9f 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -438,7 +438,7 @@ void func_80985860(DemoIm* this, PlayState* play) { } void func_809858A8(void) { - func_800788CC(NA_SE_SY_WHITE_OUT_T); + Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } void DemoIm_SpawnLightBall(DemoIm* this, PlayState* play) { @@ -728,7 +728,7 @@ void func_80986570(DemoIm* this, PlayState* play) { u32 sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 19c603f16..c90ec3237 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -257,7 +257,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { this->sparkleCounter = 0; this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 1.0f; if (this->actor.params == DEMOKANKYO_WARP_OUT) { - Audio_PlaySoundGeneral(NA_SE_EV_SARIA_MELODY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SARIA_MELODY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } break; case DEMOKANKYO_SPARKLES: @@ -818,8 +818,8 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_22++; } } else { - Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP_OUT - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpInCameraPoints, &this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) { this->unk_150[i].unk_22++; diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 09a45856b..40164012d 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -259,7 +259,7 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); if (this->collider2.base.acFlags & AC_HIT) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); // "I got it" LOG_STRING("ๅฝ“ใฃใŸใ‚ˆ"); this->actor.update = DemoKekkai_TrialBarrierDispel; diff --git a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 06efb9768..c78c3a897 100644 --- a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -378,7 +378,7 @@ void func_8098EDB0(DemoSa* this) { } void func_8098EE08(void) { - func_800788CC(NA_SE_SY_WHITE_OUT_T); + Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } void func_8098EE28(DemoSa* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index b09048e47..fa7cb0123 100644 --- a/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -119,8 +119,8 @@ void func_80993848(DemoTreLgt* this, PlayState* play) { } if ((currentFrame > 30.0f) && !(this->status & 1)) { this->status |= 1; - Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_FLASH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_FLASH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } if (SkelCurve_Update(play, &this->skelCurve)) { Actor_Kill(&this->actor); diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index ef2134f6e..431734de2 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -119,7 +119,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { if (openGrotto) { this->actor.params &= ~0x0300; DoorAna_SetupAction(this, DoorAna_WaitOpen); - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } func_8002F5F0(&this->actor, play); } diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index e840a5bbb..61e97a560 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -496,8 +496,8 @@ void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) { if (DoorWarp1_PlayerInRange(this, play)) { player = GET_PLAYER(play); - Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); OnePointCutscene_Init(play, 0x25E7, 999, &this->actor, MAIN_CAM); Player_SetCsActionWithHaltedActors(play, &this->actor, 10); @@ -615,7 +615,7 @@ void func_80999EE0(DoorWarp1* this, PlayState* play) { void func_80999FE4(DoorWarp1* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { - Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); OnePointCutscene_Init(play, 0x25E9, 999, &this->actor, MAIN_CAM); Play_CopyCamera(play, -1, sRutoWarpSubCamId); Play_ChangeCameraStatus(play, sRutoWarpSubCamId, CAM_STAT_WAIT); @@ -711,7 +711,7 @@ void func_8099A508(DoorWarp1* this, PlayState* play) { this->unk_1B2--; return; } - Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, Animation_GetLastFrame(&gWarpCrystalAnim), Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, 1); diff --git a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index 82a710c35..77821cd33 100644 --- a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -56,7 +56,7 @@ void EfcErupc_UpdateAction(EfcErupc* this, PlayState* play) { if (play->csCtx.npcActions[1] != NULL) { if (play->csCtx.npcActions[1]->action == 2) { if (this->unk_150 == 30) { - func_800788CC(NA_SE_IT_EARTHQUAKE); + Sfx_PlaySfxCentered2(NA_SE_IT_EARTHQUAKE); } if (this->unk_150 <= 64) { if (this->unk_154 < 200) { diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 4b0e93f52..c6184e2df 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -269,7 +269,7 @@ void EnAni_Update(Actor* thisx, PlayState* play) { } if (play->csCtx.frames == 100) { - func_800788CC(NA_SE_IT_EARTHQUAKE); + Sfx_PlaySfxCentered2(NA_SE_IT_EARTHQUAKE); } } else { if (SkelAnime_Update(&this->skelAnime) != 0) { diff --git a/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index ab0b82d65..0840f076a 100644 --- a/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -132,8 +132,8 @@ void func_809BC598(EnBdfire* this, PlayState* play) { this->unk_158 = bossDodongo->unk_1A2; phi_v1_2 = 0; if (this->actor.params == 0) { - Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_FIRE - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_K_FIRE - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } Math_SmoothStepToF(&this->actor.scale.x, this->unk_188, 0.3f, 0.5f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 1a1ed01a6..5e94f3fa8 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -107,7 +107,7 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, PlayState* play) { this->actor.textId = 0xF; Message_StartTextbox(play, this->actor.textId, NULL); this->unk_154 = TEXT_STATE_EVENT; - func_80078884(NA_SE_EV_HIT_SOUND); + Sfx_PlaySfxCentered(NA_SE_EV_HIT_SOUND); Player_SetCsActionWithHaltedActors(play, NULL, 8); this->status = 1; this->actionFunc = EnBomBowlPit_CameraDollyIn; diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index ef7a6330b..6b822363d 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -277,8 +277,8 @@ void EnBox_Fall(EnBox* this, PlayState* play) { OnePointCutscene_EndCutscene(play, this->unk_1AC); } } - Audio_PlaySoundGeneral(NA_SE_EV_COFFIN_CAP_BOUND, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_COFFIN_CAP_BOUND, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); EnBox_SpawnDust(this, play); } yDiff = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight; @@ -387,8 +387,8 @@ void EnBox_AppearInit(EnBox* this, PlayState* play) { this->unk_1A8 = 0; Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, 0, 0, 0x0011, true); - Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -491,7 +491,7 @@ void EnBox_Open(EnBox* this, PlayState* play) { } if (sfxId != 0) { - Audio_PlaySoundGeneral(sfxId, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(sfxId, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (this->skelanime.jointTable[3].z > 0) { diff --git a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c index d1659d21c..4c2f8dc14 100644 --- a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -248,7 +248,7 @@ void EnCs_HandleTalking(EnCs* this, PlayState* play) { } if (this->actor.textId == 0x2023) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } this->talkState = 1; diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 0a2d4c6fe..a0ba0ad66 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -134,7 +134,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { // Failed. gSaveContext.timer1State = 0; func_800F5B58(); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); this->actor.textId = 0x71AD; Message_StartTextbox(play, this->actor.textId, NULL); this->unk_292 = TEXT_STATE_EVENT; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index d63cb14c8..40a34073b 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -165,8 +165,8 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { } case PLAYER_MASK_TRUTH: if (!Flags_GetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->prize = DNT_PRIZE_NUTS; this->leader->stageSignal = DNT_LEADER_SIGNAL_UP; reaction = DNT_SIGNAL_LOOK; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index eaee07ae7..76dd0af70 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -247,7 +247,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { scorePos.z = this->actor.world.pos.z; EffectSsExtra_Spawn(play, &scorePos, &scoreVel, &scoreAccel, 4, 2); Audio_StopSfxById(NA_SE_SY_TRE_BOX_APPEAR); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); // "Big hit" osSyncPrintf(VT_FGCOL(CYAN) "โ˜†โ˜†โ˜†โ˜†โ˜† ๅคงๅฝ“ใ‚Š โ˜†โ˜†โ˜†โ˜†โ˜† %d\n" VT_RST, this->hitCounter); if (!LINK_IS_ADULT && !Flags_GetItemGetInf(ITEMGETINF_1D)) { @@ -594,7 +594,7 @@ void EnDntNomal_StageDance(EnDntNomal* this, PlayState* play) { void EnDntNomal_SetupStageHide(EnDntNomal* this, PlayState* play) { if (this->timer3 != 0) { if ((this->timer3 == 1) && (this->ignore == 1)) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } else { this->endFrame = (f32)Animation_GetLastFrame(&gDntStageHideAnim); @@ -636,7 +636,7 @@ void EnDntNomal_StageHide(EnDntNomal* this, PlayState* play) { if (rupee->colorIdx == 2) { rupee->actor.velocity.y = 7.0f; } - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } this->action = DNT_ACTION_NONE; this->actionFunc = EnDntNomal_SetupStageWait; diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 874b62cea..97cfac5f7 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -224,7 +224,7 @@ void EnDs_Wait(EnDs* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, play)) { if (func_8002F368(play) == EXCH_ITEM_ODD_MUSHROOM) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); player->actor.textId = 0x504A; this->actionFunc = EnDs_OfferOddPotion; } else if (GameInteractor_Should(VB_OFFER_BLUE_POTION, Flags_GetItemGetInf(ITEMGETINF_30), this)) { // Traded odd mushroom diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 20acdec4c..beb86ee95 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -385,7 +385,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FE890); play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (GameInteractor_Should(VB_PLAY_DARUNIAS_JOY_CS, true)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs); gSaveContext.cutsceneTrigger = 1; diff --git a/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 69121bb3e..f204e146e 100644 --- a/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -36,7 +36,7 @@ const ActorInit En_Eg_InitVars = { }; void EnEg_PlayVoidOutSFX() { - func_800788CC(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered2(NA_SE_OC_ABYSS); } void EnEg_Destroy(Actor* thisx, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 9d8a3b2e0..e5ac4f81f 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1399,7 +1399,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { } if (Actor_ProcessTalkRequest(thisx, play)) { - func_800F4524(&D_801333D4, NA_SE_VO_SK_LAUGH, 0x20); + func_800F4524(&gSfxDefaultPos, NA_SE_VO_SK_LAUGH, 0x20); thisx->focus.pos = thisx->world.pos; if (thisx->textId == ElfMessage_GetCUpText(play)) { diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 3101988a8..65a030485 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -157,7 +157,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { this->prizeRotateTimer = 35; this->scale = 0.5f; if (!onCounter) { - func_80078884(NA_SE_SY_PIECE_OF_HEART); + Sfx_PlaySfxCentered(NA_SE_SY_PIECE_OF_HEART); this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; diff --git a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 120461f8f..37eb8959a 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -211,7 +211,7 @@ void EnExRuppy_DropIntoWater(EnExRuppy* this, PlayState* play) { this->actor.shape.rot.y += 0x7A8; Math_ApproachF(&this->actor.gravity, -2.0f, 0.3f, 1.0f); EnExRuppy_SpawnSparkles(this, play, 2, 0); - func_80078884(NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG); divingGame = (EnDivingGame*)this->actor.parent; if ((divingGame != NULL) && (divingGame->actor.update != NULL) && ((divingGame->unk_296 == 0) || (this->actor.bgCheckFlags & 0x20) || (this->timer == 0))) { @@ -219,7 +219,7 @@ void EnExRuppy_DropIntoWater(EnExRuppy* this, PlayState* play) { this->actor.speedXZ = 0.0f; this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; this->actor.gravity = 0.0f; - func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); this->actionFunc = EnExRuppy_EnterWater; } } @@ -256,7 +256,7 @@ void EnExRuppy_Sink(EnExRuppy* this, PlayState* play) { this->actor.velocity.y = -1.0f; this->actor.gravity = -0.2f; EffectSsGSplash_Spawn(play, &pos, 0, 0, 0, 800); - func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); this->actionFunc = EnExRuppy_WaitInGame; } divingGame = (EnDivingGame*)this->actor.parent; @@ -284,7 +284,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, PlayState* play) { this->actionFunc = EnExRuppy_Kill; } else if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { Rupees_ChangeBy(this->rupeeValue); - func_80078884(NA_SE_SY_GET_RUPY); + Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); divingGame->grabbedRupeesCounter++; Actor_Kill(&this->actor); } @@ -348,7 +348,7 @@ void EnExRuppy_WaitAsCollectible(EnExRuppy* this, PlayState* play) { f32 localConst = 30.0f; if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { - func_80078884(NA_SE_SY_GET_RUPY); + Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); Item_DropCollectible(play, &this->actor.world.pos, (sEnExRuppyCollectibleTypes[this->colorIdx] | 0x8000)); Actor_Kill(&this->actor); } diff --git a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 31f1aebbb..aaf8d843b 100644 --- a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -494,8 +494,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { canBottleReflect2 = canBottleReflect1; if (!canBottleReflect2 && (hurtbox->toucher.dmgFlags & 0x00100000)) { killMode = BALL_IMPACT; - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } else { if (bossGnd->flyMode == GND_FLY_NEUTRAL) { @@ -523,8 +523,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { angleModX; this->work[FHGFIRE_FIRE_MODE] = FHGFIRE_LIGHT_BLUE; this->work[FHGFIRE_FX_TIMER] = 2; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64); } } else if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) { @@ -556,9 +556,9 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { killMode = BALL_IMPACT; bossGnd->returnCount = this->work[FHGFIRE_RETURN_COUNT] + 1; Audio_PlaySoundGeneral(NA_SE_EN_FANTOM_HIT_THUNDER, &bossGnd->actor.projectedPos, 4, - &D_801333E0, &D_801333E0, &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_EN_FANTOM_DAMAGE, &bossGnd->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_EN_FANTOM_DAMAGE, &bossGnd->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } break; diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index ab8abbbec..f1b299807 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -734,7 +734,7 @@ void EnFr_ChildSong(EnFr* this, PlayState* play) { EnFr_SetupReward(this, play, false); } else if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { frog = sEnFrPointers.frogs[sSongToFrog[songIndex]]; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (frog->actionFunc == EnFr_ChooseJumpFromLogSpot) { frog->isJumpingUp = true; frog->isActive = true; @@ -874,7 +874,7 @@ s32 EnFr_IsFrogSongComplete(EnFr* this, PlayState* play) { void EnFr_OcarinaMistake(EnFr* this, PlayState* play) { Message_CloseTextbox(play); this->reward = GI_NONE; - func_80078884(NA_SE_SY_OCARINA_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); Audio_OcaSetInstrument(0); sEnFrPointers.flags = 12; EnFr_DeactivateButterfly(); @@ -940,9 +940,9 @@ void EnFr_ContinueFrogSong(EnFr* this, PlayState* play) { void EnFr_SetupReward(EnFr* this, PlayState* play, u8 unkCondition) { EnFr_DeactivateButterfly(); if (unkCondition) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } Audio_OcaSetInstrument(0); diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 98b8a4dda..619ea0d2e 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -183,7 +183,7 @@ void func_80A1DBD4(EnFu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_80A1DB60; this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; diff --git a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index eaaa7c800..8e74fa85d 100644 --- a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -215,7 +215,7 @@ void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, PlayState* play) { if (sCollectedCount < (CVarGetInteger(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 0) ? 10 : 5)) { // "sound?" osSyncPrintf(VT_FGCOL(GREEN) "โ˜†โ˜†โ˜†โ˜†โ˜† ้Ÿณ๏ผŸ โ˜†โ˜†โ˜†โ˜†โ˜† %d\n" VT_RST, this->noteIndex); - Audio_PlaySoundTransposed(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]); + Audio_PlaySoundTransposed(&gSfxDefaultPos, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]); this->noteIndex = sCollectedCount; } } @@ -228,10 +228,10 @@ void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, PlayState* play) { if ((play->sceneNum == SCENE_GERUDO_TRAINING_GROUND) && (this->actor.room == 2)) { Flags_SetTempClear(play, this->actor.room); } else { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Flags_SetSwitch(play, this->switchFlag); } - func_80078884(NA_SE_SY_GET_RUPY); + Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); Actor_Kill(&this->actor); } } @@ -243,7 +243,7 @@ void EnGSwitch_SilverRupeeIdle(EnGSwitch* this, PlayState* play) { if (this->actor.xyzDistToPlayerSq < 900.0f) { Rupees_ChangeBy(5); sCollectedCount++; - func_80078884(NA_SE_SY_GET_RUPY); + Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); this->actor.world.pos = player->actor.world.pos; this->actor.world.pos.y += 40.0f; if (LINK_IS_ADULT) { @@ -345,8 +345,8 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, PlayState* play) { if (gallery->actor.update != NULL) { gallery->hitCount++; gallery->targetState[this->index] = ENSYATEKIHIT_HIT; - func_80078884(NA_SE_EV_HIT_SOUND); - func_80078884(NA_SE_SY_GET_RUPY); + Sfx_PlaySfxCentered(NA_SE_EV_HIT_SOUND); + Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); // "Yeah !" osSyncPrintf(VT_FGCOL(YELLOW) "โ˜†โ˜†โ˜†โ˜†โ˜† ใ„ใ‡ใ‡ใƒผใ™๏ผ๏ผจ๏ผฉ๏ผด๏ผ๏ผ โ˜†โ˜†โ˜†โ˜†โ˜† %d\n" VT_RST, gallery->hitCount); EnGSwitch_Break(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index a720acdd6..1038a7014 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -270,7 +270,7 @@ void EnGe1_SpotPlayer(EnGe1* this, PlayState* play) { this->cutsceneTimer = 30; this->actionFunc = EnGe1_KickPlayer; Player_SetCsActionWithHaltedActors(play, &this->actor, 0x5F); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); Message_StartTextbox(play, 0x6000, &this->actor); } diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 0e26fca52..3abbf7533 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -496,7 +496,7 @@ void EnGe2_SetupCapturePlayer(EnGe2* this, PlayState* play) { this->actor.speedXZ = 0.0f; EnGe2_ChangeAction(this, GE2_ACTION_CAPTURETURN); Player_SetCsActionWithHaltedActors(play, &this->actor, 95); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); Message_StartTextbox(play, 0x6000, &this->actor); } diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 293f19669..47b045e53 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1383,8 +1383,8 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { if (key != NULL) { key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos); key->actor.speedXZ = 6.0f; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } EnGeldB_SetupDefeated(this); diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index 20d1c5326..c3d74e1c3 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -769,8 +769,8 @@ void EnGo_FireGenericActionFunc(EnGo* this, PlayState* play) { void EnGo_CurledUp(EnGo* this, PlayState* play) { if ((DECR(this->unk_210) == 0) && EnGo_IsCameraModified(this, play)) { - Audio_PlaySoundGeneral(NA_SE_EN_GOLON_WAKE_UP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GOLON_WAKE_UP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.1f; this->skelAnime.playSpeed *= (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f; @@ -804,8 +804,8 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } if (DECR(this->unk_212) == 0) { - Audio_PlaySoundGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); EnGo_SetupAction(this, func_80A405CC); } else if (!EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); @@ -823,8 +823,8 @@ void func_80A40494(EnGo* this, PlayState* play) { frame += this->skelAnime.playSpeed; if (!(frame >= 0.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_DODO_M_GND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_DODO_M_GND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); EnGo_SpawnDust(this, 10, 0.4f, 0.1f, 16, 26.0f, 2.0f); EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = 0.0f; @@ -915,8 +915,8 @@ void func_80A408D8(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40494); } else if (EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); - Audio_PlaySoundGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GOLON_SIT_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.0f; EnGo_SetupAction(this, func_80A405CC); } diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index f4ef8703f..3edec1ebe 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -609,12 +609,12 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } case 0x3059: if (dialogState == TEXT_STATE_NONE) { - func_800F4524(&D_801333D4, NA_SE_EN_GOLON_WAKE_UP, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } case 0x3054: if (dialogState == TEXT_STATE_NONE) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } return 1; @@ -885,7 +885,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { return false; } else { if (this->collider.base.acFlags & 2) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->actor.flags &= ~ACTOR_FLAG_PLAY_HIT_SFX; this->collider.base.acFlags &= ~0x2; EnGo2_StopRolling(this, play); @@ -1277,7 +1277,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) { if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_SIT_DOWN); } else { - func_800F4524(&D_801333D4, NA_SE_EN_GOLON_SIT_DOWN, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60); } } if (this->skelAnime.playSpeed < 0.0f) { @@ -1325,7 +1325,7 @@ void EnGo2_WakeUp(EnGo2* this, PlayState* play) { if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP); } else { - func_800F4524(&D_801333D4, NA_SE_EN_GOLON_WAKE_UP, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } } if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { @@ -1510,7 +1510,7 @@ void EnGo2_BiggoronAnimation(EnGo2* this) { (this->actor.params & 0x1F) == GORON_DMT_BIGGORON && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (DECR(this->animTimer) == 0) { this->animTimer = Rand_S16Offset(30, 30); - func_800F4524(&D_801333D4, NA_SE_EN_GOLON_EYE_BIG, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_EYE_BIG, 60); } } } @@ -1850,10 +1850,10 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { if (DECR(this->animTimer)) { if (this->animTimer == 60 || this->animTimer == 120) { func_8005B1A4(GET_ACTIVE_CAM(play)); - func_800F4524(&D_801333D4, NA_SE_EV_GORON_WATER_DROP, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EV_GORON_WATER_DROP, 60); } } else { - func_800F4524(&D_801333D4, NA_SE_EN_GOLON_GOOD_BIG, 60); + func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_GOOD_BIG, 60); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_6); Message_ContinueTextbox(play, 0x305A); this->eyeMouthTexState = 3; diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index efaaed84c..8ba162f77 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -424,7 +424,7 @@ void EnGoma_Dead(EnGoma* this, PlayState* play) { parent->childrenGohmaState[this->actor.params] = -1; } - Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Actor_Kill(&this->actor); Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x30); } diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 64329bb04..b55eabb2c 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -326,14 +326,14 @@ void func_80A4ED34(EnGs* this, PlayState* play) { if (this->unk_200 < 20) { Color_RGBA8_Copy(&this->flashColor, &flashRed); if ((this->unk_200 % 20) == 7) { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } else { Color_RGBA8_Copy(&this->flashColor, &flashBlue); if ((this->unk_200 % 20) == 7) { - Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 5b5a97a08..837c0ec0f 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -389,7 +389,7 @@ void EnHeishi1_WaitNight(EnHeishi1* this, PlayState* play) { if (this->actor.xzDistToPlayer < 100.0f) { Message_StartTextbox(play, 0x702D, &this->actor); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); osSyncPrintf(VT_FGCOL(GREEN) "โ˜†โ˜†โ˜†โ˜†โ˜† ็™บ่ฆ‹๏ผ โ˜†โ˜†โ˜†โ˜†โ˜† \n" VT_RST); // "Discovered!" Player_SetCsActionWithHaltedActors(play, &this->actor, 1); this->actionFunc = EnHeishi1_SetupKick; @@ -472,7 +472,7 @@ void EnHeishi1_Update(Actor* thisx, PlayState* play) { this->linkDetected = false; // this 60 unit height check is so the player doesnt get caught when on the upper path if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) { - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "โ˜†โ˜†โ˜†โ˜†โ˜† ็™บ่ฆ‹๏ผ โ˜†โ˜†โ˜†โ˜†โ˜† \n" VT_RST); Player_SetCsActionWithHaltedActors(play, &this->actor, 1); diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 89dcc6808..9c37164a6 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -407,7 +407,7 @@ void func_80A53AD4(EnHeishi2* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, play)) { exchangeItemId = func_8002F368(play); if (exchangeItemId == EXCH_ITEM_LETTER_ZELDA) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); player->actor.textId = 0x2010; this->unk_300 = TEXT_STATE_EVENT; this->actionFunc = func_80A53C0C; @@ -728,7 +728,7 @@ void func_80A5475C(EnHeishi2* this, PlayState* play) { if (this->unk_300 == TEXT_STATE_CHOICE) { this->unk_309 = 1; - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); this->actionFunc = func_80A540C0; } return; diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 665a06470..1ac928e81 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -135,7 +135,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, PlayState* play) { (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && (sPlayerCaught == 0)) { sPlayerCaught = 1; Message_StartTextbox(play, 0x702D, &this->actor); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); osSyncPrintf(VT_FGCOL(GREEN) "โ˜†โ˜†โ˜†โ˜†โ˜† ็™บ่ฆ‹๏ผ โ˜†โ˜†โ˜†โ˜†โ˜† \n" VT_RST); // "Discovered!" Player_SetCsActionWithHaltedActors(play, &this->actor, 1); this->actionFunc = EnHeishi3_CatchStart; @@ -163,7 +163,7 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, PlayState* play) { } sPlayerCaught = 1; Message_StartTextbox(play, 0x702D, &this->actor); - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); osSyncPrintf(VT_FGCOL(GREEN) "โ˜†โ˜†โ˜†โ˜†โ˜† ็™บ่ฆ‹๏ผ โ˜†โ˜†โ˜†โ˜†โ˜† \n" VT_RST); // "Discovered!" Player_SetCsActionWithHaltedActors(play, &this->actor, 1); this->actionFunc = EnHeishi3_CatchStart; diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 93df97cd3..e956457da 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -214,7 +214,7 @@ void EnHintnuts_SetupFreeze(EnHintnuts* this) { this->animFlagAndTimer = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT); if (sPuzzleCounter == -3) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); sPuzzleCounter = -4; } this->actionFunc = EnHintnuts_Freeze; diff --git a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c index ad490eccd..0940511ac 100644 --- a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -611,8 +611,8 @@ void EnHorse_PlayWalkingSound(EnHorse* this) { return; } - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (++this->soundTimer > 1) { this->soundTimer = 0; } @@ -620,11 +620,11 @@ void EnHorse_PlayWalkingSound(EnHorse* this) { } void EnHorse_PlayTrottingSound(EnHorse* this) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void EnHorse_PlayGallopingSound(EnHorse* this) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } f32 EnHorse_SlopeSpeedMultiplier(EnHorse* this, PlayState* play) { @@ -659,13 +659,13 @@ void EnHorse_IdleAnimSounds(EnHorse* this, PlayState* play) { (this->curFrame > 28.0f && this->type == HORSE_HNI)) && !(this->stateFlags & ENHORSE_SANDDUST_SOUND)) { this->stateFlags |= ENHORSE_SANDDUST_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (this->animationIdx == ENHORSE_ANIM_REARING && this->curFrame > 25.0f && !(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -1076,8 +1076,8 @@ void EnHorse_StartMountedIdle(EnHorse* this) { if ((this->curFrame > 35.0f && this->type == HORSE_EPONA) || (this->curFrame > 28.0f && this->type == HORSE_HNI)) { if (!(this->stateFlags & ENHORSE_SANDDUST_SOUND)) { this->stateFlags |= ENHORSE_SANDDUST_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } curFrame = this->skin.skelAnime.curFrame; @@ -1129,7 +1129,7 @@ void EnHorse_MountedIdleWhinney(EnHorse* this) { Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -1401,7 +1401,7 @@ void EnHorse_StartRearing(EnHorse* this) { this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } func_800AA000(0.0f, 180, 20, 100); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, @@ -1416,8 +1416,8 @@ void EnHorse_MountedRearing(EnHorse* this, PlayState* play) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800AA000(0, 180, 20, 100); } } @@ -1450,7 +1450,7 @@ void EnHorse_StartBraking(EnHorse* this, PlayState* play) { this->action = ENHORSE_ACT_STOPPING; this->animationIdx = ENHORSE_ANIM_STOPPING; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SLIP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SLIP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.5f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); @@ -1471,7 +1471,7 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) { if (Rand_ZeroOne() > 0.5) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } func_800AA000(0.0f, 180, 20, 100); this->stateFlags &= ~ENHORSE_STOPPING_NEIGH_SOUND; @@ -1602,7 +1602,7 @@ void EnHorse_StartLowJump(EnHorse* this, PlayState* play) { y = jointTable->y; this->riderPos.y -= y * 0.01f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 170, 10, 10); } @@ -1636,8 +1636,8 @@ void EnHorse_LowJump(EnHorse* this, PlayState* play) { if (SkelAnime_Update(&this->skin.skelAnime) || (curFrame > 17.0f && this->actor.world.pos.y < this->actor.floorHeight - this->actor.velocity.y + 80.0f)) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800AA000(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -1676,7 +1676,7 @@ void EnHorse_StartHighJump(EnHorse* this, PlayState* play) { this->riderPos.y -= y * 0.01f; this->stateFlags |= ENHORSE_CALC_RIDER_POS; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 170, 10, 10); } @@ -1711,8 +1711,8 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) { if (SkelAnime_Update(&this->skin.skelAnime) || (curFrame > 23.0f && this->actor.world.pos.y < this->actor.floorHeight - this->actor.velocity.y + 80.0f)) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800AA000(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -1740,8 +1740,8 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) { if (DREG(53) != 0 && this->type == HORSE_EPONA) { DREG(53) = 0; if (EnHorse_Spawn(this, play) != 0) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->stateFlags &= ~ENHORSE_INACTIVE; gSaveContext.horseData.scene = play->sceneNum; @@ -1774,12 +1774,12 @@ void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 sta } else if (this->animationIdx == ENHORSE_ANIM_WHINNEY) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if (this->animationIdx == ENHORSE_ANIM_REARING) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } this->stateFlags &= ~ENHORSE_LAND2_SOUND; } @@ -1814,8 +1814,8 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { DREG(53) = 0; if (!func_80A5BBBC(play, this, &this->actor.world.pos)) { if (EnHorse_Spawn(this, play)) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->followTimer = 0; EnHorse_SetFollowAnimation(this, play); Camera_SetParam(play->cameraPtrs[0], 8, this); @@ -1823,8 +1823,8 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { Camera_SetCameraData(play->cameraPtrs[0], 4, NULL, NULL, 0x51, 0, 0); } } else { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->followTimer = 0; EnHorse_StartMovingAnimation(this, 6, -3.0f, 0.0f); } @@ -1933,8 +1933,8 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } else { @@ -1961,7 +1961,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -1989,7 +1989,7 @@ void EnHorse_InitIngoHorse(EnHorse* this) { EnHorse_UpdateIngoHorseAnim(this); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -2042,10 +2042,10 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { animSpeed = this->actor.speedXZ * 0.5f; } else if (this->animationIdx == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { animSpeed = 1.0f; } @@ -2161,7 +2161,7 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) { this->riderPos.y -= y * 0.01f; this->stateFlags |= ENHORSE_CALC_RIDER_POS; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 170, 10, 10); } @@ -2205,8 +2205,8 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* action) { f32 y; this->cutsceneFlags |= 1; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800AA000(0.0f, 255, 10, 80); this->stateFlags &= ~ENHORSE_JUMPING; this->actor.gravity = -3.5f; @@ -2230,7 +2230,7 @@ void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* action this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); @@ -2241,8 +2241,8 @@ void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorCue* action) { if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -2309,7 +2309,7 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* ac this->stateFlags &= ~ENHORSE_LAND2_SOUND; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); @@ -2320,8 +2320,8 @@ void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorCue* action if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -2471,11 +2471,11 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { animSpeed = this->actor.speedXZ * 0.5f; } else if (this->animationIdx == ENHORSE_ANIM_TROT) { animSpeed = this->actor.speedXZ * 0.25f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 60, 8, 255); } else if (this->animationIdx == ENHORSE_ANIM_GALLOP) { animSpeed = this->actor.speedXZ * 0.2f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 120, 8, 255); } else { animSpeed = 1.0f; @@ -2577,8 +2577,8 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { if (DREG(53) || this->type == HORSE_HNI) { EnHorse_StartIdleRidable(this); - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } distToHome = Math3D_Vec3f_DistXYZ(&this->actor.home.pos, &this->actor.world.pos); @@ -2688,8 +2688,8 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { this->animationIdx = ENHORSE_ANIM_WHINNEY; this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animationIdx], 1.0f, 0.0f, @@ -2745,9 +2745,9 @@ void EnHorse_BridgeJumpInit(EnHorse* this, PlayState* play) { Animation_GetLastFrame(sAnimationHeaders[this->type][this->animationIdx]), ANIMMODE_ONCE, -3.0f); this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_JUMP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_800AA000(0.0f, 170, 10, 10); this->postDrawFunc = NULL; } @@ -2796,8 +2796,8 @@ void EnHorse_CheckBridgeJumpLanding(EnHorse* this, PlayState* play) { this->actor.world.pos.y = sBridgeJumps[this->bridgeJumpIdx].pos.y; func_80028A54(play, 25.0f, &this->actor.world.pos); EnHorse_JumpLanding(this, play); - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_800AA000(0.0f, 255, 10, 80); } } @@ -3127,8 +3127,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { if (this->actor.bgCheckFlags & 8 && Math_CosS(this->actor.wallYaw - ((void)0, this->actor.world).rot.y) < -0.3f) { if (this->actor.speedXZ > 4.0f) { this->actor.speedXZ -= 1.0f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -3333,8 +3333,8 @@ void EnHorse_CheckBoost(EnHorse* thisx, PlayState* play2) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { if (Rand_ZeroOne() < 0.1f) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } @@ -3351,7 +3351,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { this->numBoosts = this->numBoosts + 1; if (!EN_HORSE_CHECK_4(this)) { - Audio_PlaySoundGeneral(NA_SE_SY_CARROT_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CARROT_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (this->numBoosts < 6) { @@ -3367,7 +3367,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { this->numBoosts = 6; if (!EN_HORSE_CHECK_4(this)) { - Audio_PlaySoundGeneral(NA_SE_SY_CARROT_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CARROT_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -3375,7 +3375,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { if (this->boostTimer == 8 && Rand_ZeroOne() < 0.25f) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } play->interfaceCtx.numHorseBoosts = this->numBoosts; @@ -3516,7 +3516,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { if (this->jntSph.base.acFlags & 2) { this->unk_21C = this->unk_228; if (this->stateFlags & ENHORSE_DRAW) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } if (this->action != ENHORSE_ACT_INGO_RACE) { diff --git a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index cb7256d40..5ed12cf45 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -152,7 +152,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) ingoHorse->inRace = 1; this->startFlags |= INGORACE_INGO_MOVE; - Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } this->startTimer++; @@ -184,7 +184,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) this->result = INGORACE_PLAYER_WIN; this->finishTimer = 55; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_HORSE_GOAL); - Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } for (i = 0; i < 3; i++) { this->playerCheck[i] = 0; @@ -199,7 +199,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) this->finishTimer = 70; ingoHorse->stateFlags |= ENHORSE_INGO_WON; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_HORSE_GOAL); - Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } for (i = 0; i < 3; i++) { this->ingoCheck[i] = 0; @@ -335,7 +335,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play horse->inRace = 1; } else if ((this->startTimer > 81) && !(this->raceFlags & MALONRACE_START_SFX)) { this->raceFlags |= MALONRACE_START_SFX; - Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } this->startTimer++; @@ -377,7 +377,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play } else if (this->fenceCheck[15] == 1) { this->lapCount = 2; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_HORSE_GOAL); - Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->result = MALONRACE_SUCCESS; this->finishTimer = 70; gSaveContext.timer1State = 0xF; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index d36c1c690..106b36457 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -155,8 +155,8 @@ void func_80A686A8(EnHorseGanon* this, PlayState* play) { void func_80A68870(EnHorseGanon* this) { if ((this->skin.skelAnime.curFrame > D_80A692B8[this->soundCount]) && (this->soundCount != 0 || !(this->skin.skelAnime.curFrame > D_80A692B8[1]))) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->soundCount++; if (this->soundCount >= 2) { @@ -236,10 +236,10 @@ void func_80A68B20(EnHorseGanon* this) { sp30 = this->actor.speedXZ / 3.0f; } else if (this->currentAnimation == 3) { sp30 = this->actor.speedXZ / 5.0f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->currentAnimation == 4) { sp30 = this->actor.speedXZ / 7.0f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { sp30 = 1.0f; } diff --git a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index b502a11e4..7a68e90b6 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -90,8 +90,8 @@ void func_80A693D0(EnHorseLinkChild* this) { if ((this->skin.skelAnime.curFrame > D_80A6AF5C[this->unk_1F0]) && !((this->unk_1F0 == 0) && (this->skin.skelAnime.curFrame > D_80A6AF5C[1]))) { - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_WALK, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_1F0++; if (this->unk_1F0 >= ARRAY_COUNT(D_80A6AF5C)) { this->unk_1F0 = 0; @@ -104,15 +104,15 @@ void func_80A6948C(EnHorseLinkChild* this) { func_80A693D0(this); } else if (this->skin.skelAnime.curFrame == 0.0f) { if ((this->animationIdx == 3) || (this->animationIdx == 4)) { - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (this->animationIdx == 1) { if (Rand_ZeroOne() > 0.5f) { - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_GROAN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_GROAN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } @@ -353,8 +353,8 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) { distFromLink = Actor_WorldDistXZToActor(&this->actor, &player->actor); if (gSaveContext.entranceIndex == ENTR_LON_LON_RANCH_1) { - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_80A6A724(this); return; } @@ -445,8 +445,8 @@ void func_80A6A5A4(EnHorseLinkChild* this, PlayState* play) { if (DREG(53) != 0) { DREG(53) = 0; - Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); func_80A6A724(this); } else { this->actor.speedXZ = 0.0f; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 0aa46f9c2..ad13d05ba 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -151,8 +151,8 @@ void func_80A6B250(EnHorseNormal* this) { if (D_80A6D4C0[this->unk_200] < this->skin.skelAnime.curFrame && ((this->unk_200 != 0) || !(D_80A6D4C0[1] < this->skin.skelAnime.curFrame))) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_200++; if (this->unk_200 >= ARRAY_COUNT(D_80A6D4C0)) { this->unk_200 = 0; @@ -344,9 +344,9 @@ void func_80A6BC48(EnHorseNormal* this) { void func_80A6BCEC(EnHorseNormal* this) { if (this->animationIdx == 5) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->animationIdx == 6) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -355,12 +355,12 @@ void func_80A6BD7C(EnHorseNormal* this) { if (this->animationIdx == 0 && frame > 28.0f && !(this->unk_1E4 & 1)) { this->unk_1E4 |= 1; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (this->animationIdx == 3 && frame > 25.0f && !(this->unk_1E4 & 2)) { this->unk_1E4 |= 2; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -429,9 +429,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { this->unk_1E4 &= ~1; this->unk_1E4 &= ~2; if (phi_t0 == 1) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (phi_t0 == 3) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { func_80A6BCEC(this); } @@ -458,9 +458,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { this->unk_1E4 &= ~1; this->unk_1E4 &= ~2; if (phi_t0 == 1) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (phi_t0 == 3) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { func_80A6BCEC(this); } @@ -495,10 +495,10 @@ void EnHorseNormal_Wait(EnHorseNormal* this, PlayState* play) { this->animationIdx = 0; } else if (rand < 0.8f) { this->animationIdx = 1; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { this->animationIdx = 3; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, @@ -529,11 +529,11 @@ void EnHorseNormal_WaitClone(EnHorseNormal* this, PlayState* play) { } else if (rand < 0.8f) { this->animationIdx = 1; this->unk_1E4 |= 0x20; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { this->animationIdx = 3; this->unk_1E4 |= 0x20; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_204, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, @@ -620,16 +620,16 @@ void func_80A6CC88(PlayState* play, EnHorseNormal* this, Vec3f* arg2) { if (this->animationIdx == 0 && curFrame > 28.0f && !(this->unk_1E4 & 8)) { this->unk_1E4 |= 8; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->unk_1E8, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->unk_1E8, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->animationIdx == 3 && curFrame > 25.0f && !(this->unk_1E4 & 0x10)) { this->unk_1E4 |= 0x10; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->unk_1E8, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_LAND2, &this->unk_1E8, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->animationIdx == 3 && this->unk_1E4 & 0x20) { this->unk_1E4 &= ~0x20; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_1F4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_1F4, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->animationIdx == 1 && this->unk_1E4 & 0x20) { this->unk_1E4 &= ~0x20; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_1F4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->unk_1F4, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 869f03e84..0ce67018e 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -200,7 +200,7 @@ void func_80A6DD14(EnHorseZelda* this) { this->action = 1; this->animationIndex = 0; sp34 = this->actor.speedXZ / 6.0f; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_RUN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->animationIndex], splaySpeeds[this->animationIndex] * sp34 * 1.5f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->animationIndex]), ANIMMODE_ONCE, 0.0f); diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index af9f83fc2..f816870a5 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -221,7 +221,7 @@ void func_80A6E9AC(EnHs* this, PlayState* play) { Animation_Change(&this->skelAnime, &object_hs_Anim_000304, 1.0f, 0.0f, Animation_GetLastFrame(&object_hs_Anim_000304), ANIMMODE_LOOP, 8.0f); this->unk_2AA = 40; - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { player->actor.textId = 0x10B1; func_80A6E3A0(this, func_80A6E6D8); diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 76ca5049e..4f4f30591 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -574,7 +574,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { case 0x709F: if (!this->unk_215) { Audio_PlaySoundGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR, - &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->unk_215 = true; } break; diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 9ab8735dd..aebcc4daf 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -983,29 +983,29 @@ void EnIk_StartMusic(void) { void func_80A76C14(EnIk* this) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WAKEUP, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WAKEUP, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (Animation_OnFrame(&this->skelAnime, 33.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WALK, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WALK, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (Animation_OnFrame(&this->skelAnime, 68.0f) || Animation_OnFrame(&this->skelAnime, 80.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (Animation_OnFrame(&this->skelAnime, 107.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_FINGER_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_FINGER_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (Animation_OnFrame(&this->skelAnime, 156.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_ARMOR_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else if (Animation_OnFrame(&this->skelAnime, 188.0f)) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WAVE_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_WAVE_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } void func_80A76DDC(EnIk* this, PlayState* play, Vec3f* pos) { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_TRANSFORM, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_TRANSFORM, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } void func_80A76E2C(EnIk* this, PlayState* play, Vec3f* pos) { @@ -1112,8 +1112,8 @@ void func_80A77264(EnIk* this, PlayState* play, s32 arg2) { } void func_80A772A4(EnIk* this) { - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_STAGGER_DEMO, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_STAGGER_DEMO, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } void func_80A772EC(EnIk* this, PlayState* play) { @@ -1122,7 +1122,7 @@ void func_80A772EC(EnIk* this, PlayState* play) { f32 wDest; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &D_80A78FA0, &wDest); - Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_DEAD, &D_80A78FA0, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_DEAD, &D_80A78FA0, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void func_80A7735C(EnIk* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.c b/soh/src/overlays/actors/ovl_En_In/z_en_in.c index 9f8c065f0..0426d127b 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.c @@ -625,10 +625,10 @@ void func_80A7A304(EnIn* this, PlayState* play) { this->animationIdx %= 8; this->unk_1E8 = this->animationIdx; if (this->animationIdx == 3 || this->animationIdx == 4) { - Audio_PlaySoundGeneral(NA_SE_IT_LASH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_LASH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (Rand_ZeroOne() < 0.3f) { - Audio_PlaySoundGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_INGO_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } Animation_Change(&this->skelAnime, D_80A7B918[this->animationIdx], 1.0f, 0.0f, @@ -661,7 +661,7 @@ void func_80A7A568(EnIn* this, PlayState* play) { Flags_SetInfTable(INFTABLE_AB); } if (gSaveContext.timer1State == 10) { - Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); func_80A79C78(this, play); this->actionFunc = func_80A7B024; gSaveContext.timer1State = 0; @@ -679,7 +679,7 @@ void func_80A7A568(EnIn* this, PlayState* play) { phi_a2 = 2; transitionType = TRANS_TYPE_FADE_BLACK; } else { - Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO)) { if (Flags_GetInfTable(INFTABLE_AB)) { Flags_SetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO); diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 71891328f..c207a6310 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -683,7 +683,7 @@ void func_80A7D460(EnInsect* this, PlayState* play) { if (this->soilActor != NULL) { if (!(GET_GS_FLAGS(((this->soilActor->actor.params >> 8) & 0x1F) - 1) & (this->soilActor->actor.params & 0xFF))) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } this->unk_314 |= 0x80; diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 28d8967c2..ba748df63 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -223,7 +223,7 @@ void EnJj_BeginCutscene(EnJj* this, PlayState* play) { func_8003EBF8(play, &play->colCtx.dyna, bodyCollisionActor->bgId); func_8005B1A4(GET_ACTIVE_CAM(play)); Flags_SetEventChkInf(EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 38331e50b..e8ce00c6a 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -128,7 +128,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { OnePointCutscene_Attention(play, &this->actor); this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_NO_LOCKON; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } @@ -152,7 +152,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, NULL, NULL, 0); OnePointCutscene_Attention(play, &this->actor); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_NO_LOCKON; this->actionFunc = func_80A904D8; diff --git a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 4250404ec..1823f0300 100644 --- a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -716,8 +716,8 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { (play->msgCtx.unk_E3F2 == OCARINA_SONG_LULLABY)) { this->actionState = ENKANBAN_REPAIR; this->bounceX = 1; - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } break; } diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 466f7271d..58fc06350 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -541,8 +541,8 @@ s16 func_80A97738(PlayState* play, Actor* thisx) { case 0x10B7: case 0x10B8: if (this->unk_210 == 0) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_210 = 1; } } diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 69b2d5a11..882bc3f5d 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -168,12 +168,12 @@ s16 func_80A9C6C0(PlayState* play, Actor* thisx) { case TEXT_STATE_DONE_FADING: if (this->actor.textId != 0x4014) { if (this->actor.textId == 0x401B && !this->sfxPlayed) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->sfxPlayed = true; } } else if (!this->sfxPlayed) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->sfxPlayed = true; } break; diff --git a/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index c6246b6c9..315d1ee10 100644 --- a/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -80,8 +80,8 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { if (thisx->speedXZ) { if (thisx->bgCheckFlags & 8) { thisx->world.rot.y = (thisx->world.rot.y + thisx->wallYaw) - thisx->world.rot.y; - Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); thisx->speedXZ *= 0.7f; thisx->bgCheckFlags &= ~0x8; } @@ -92,8 +92,8 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { } else { Math_StepToF(&thisx->speedXZ, 0, IREG(58) / 100.0f); if ((thisx->bgCheckFlags & 2) && (thisx->velocity.y < IREG(59) / 100.0f)) { - Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); thisx->velocity.y *= IREG(60) / 100.0f; thisx->bgCheckFlags &= ~0x1; } else { diff --git a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 2143aa6e6..0031ab766 100644 --- a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -88,10 +88,10 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || (((this->actor.params & 0xFF00) >> 8) && !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) { - Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Actor_Kill(&this->actor); return; } @@ -103,8 +103,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); func_80A9EFE0(this, func_80A9F9B4); this->unk_1C4 = 8; - Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_1AC = 1.0f; } else { func_80A9EFE0(this, func_80A9F408); @@ -133,10 +133,10 @@ void func_80A9F350(EnMThunder* this, PlayState* play) { if (player->stateFlags2 & PLAYER_STATE2_SPIN_ATTACKING) { if (player->meleeWeaponAnimation >= 0x18) { - Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } Actor_Kill(&this->actor); @@ -183,10 +183,10 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (player->unk_858 <= 0.15f) { if ((player->unk_858 >= 0.1f) && (player->meleeWeaponAnimation >= 0x18)) { - Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Actor_Kill(&this->actor); return; @@ -207,8 +207,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { func_80A9EFE0(this, func_80A9F9B4); this->unk_1C4 = 8; - Audio_PlaySoundGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_1AC = 1.0f; return; } diff --git a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 1519e57c7..248d5a8c4 100644 --- a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -282,7 +282,7 @@ void func_80AA20E4(EnMa2* this, PlayState* play) { this->actionFunc = func_80AA204C; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->unk_208 = 0x1E; Flags_SetInfTable(INFTABLE_8E); this->actionFunc = func_80AA21C8; diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 44b3399b0..21b4c5f94 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -217,7 +217,7 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) { CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->mainAlpha = 210; this->subAlpha = 255; @@ -247,8 +247,8 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) { if (play->transitionTrigger != TRANS_TRIGGER_START) { Audio_SetCutsceneFlag(0); - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); gSaveContext.gameMode = 2; play->transitionTrigger = TRANS_TRIGGER_START; @@ -377,7 +377,7 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) { CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) || CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->mainAlpha = 210; this->subAlpha = 255; @@ -407,8 +407,8 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) { if (play->transitionTrigger != TRANS_TRIGGER_START) { Audio_SetCutsceneFlag(0); - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); gSaveContext.gameMode = 2; play->transitionTrigger = TRANS_TRIGGER_START; diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index 5567f3e29..d6264ee80 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -773,7 +773,7 @@ void func_80AABC10(EnMd* this, PlayState* play) { this->actionFunc = func_80AAB948; play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->actor.textId = 0x1067; func_8002F2CC(&this->actor, play, this->collider.dim.radius + 30.0f); diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 36a8b34c5..81d62df50 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -267,7 +267,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) { Animation_GetLastFrame(&object_mk_Anim_000368), ANIMMODE_ONCE, -4.0f); this->flags &= ~2; gSaveContext.timer2State = 0; - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); break; default: player->actor.textId = 0x4018; @@ -347,7 +347,7 @@ void EnMk_Update(Actor* thisx, PlayState* play) { if ((!(this->flags & 4)) && (this->swimFlag >= 8)) { this->flags |= 4; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } } diff --git a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c index f76c61674..d1d495093 100644 --- a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -297,7 +297,7 @@ void func_80AADCD0(EnMm* this, PlayState* play) { if (this->curAnimIndex != 5) { if ((this->actor.textId == 0x202A) || (this->actor.textId == 0x202B)) { EnMm_ChangeAnim(this, RM_ANIM_EXCITED, &this->curAnimIndex); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } } else { diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index c3ee312cc..f5f66dbf6 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -461,7 +461,7 @@ void EnNb_SetupLightArrowOrSealingCs(EnNb* this, PlayState* play) { } void EnNb_PlaySealingSound(void) { - func_800788CC(NA_SE_SY_WHITE_OUT_T); + Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } void EnNb_InitializeDemo6K(EnNb* this, PlayState* play) { @@ -576,13 +576,13 @@ void EnNb_InitKidnap(EnNb* this, PlayState* play) { void EnNb_PlayCrySFX(EnNb* this, PlayState* play) { if (play->csCtx.frames == 3) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_NB_CRY_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_NB_CRY_0); } } void EnNb_PlayAgonySFX(EnNb* this, PlayState* play) { if (play->csCtx.frames == 420) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_NB_AGONY); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_NB_AGONY); } } @@ -708,8 +708,8 @@ void EnNb_PlayKnuckleDefeatSFX(EnNb* this, PlayState* play) { s32 pad[2]; if (play->csCtx.frames == 548) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_NB_CRY_0); - func_80078914(&this->actor.projectedPos, NA_SE_EN_FANTOM_HIT_THUNDER); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_NB_CRY_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_FANTOM_HIT_THUNDER); } } @@ -718,7 +718,7 @@ void EnNb_PlayKneelingOnGroundSFX(EnNb* this) { if ((this->skelAnime.mode == 2) && (Animation_OnFrame(&this->skelAnime, 18.0f) || Animation_OnFrame(&this->skelAnime, 25.0f))) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_HUMAN_BOUND); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HUMAN_BOUND); } } @@ -726,7 +726,7 @@ void EnNb_PlayLookRightSFX(EnNb* this) { s32 pad[2]; if ((this->skelAnime.mode == 2) && Animation_OnFrame(&this->skelAnime, 9.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); } } @@ -734,7 +734,7 @@ void EnNb_PlayLookLeftSFX(EnNb* this) { s32 pad[2]; if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); } } @@ -1148,7 +1148,7 @@ void func_80AB359C(EnNb* this) { } void EnNb_SetNoticeSFX(EnNb* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_NB_NOTICE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_NB_NOTICE); } s32 EnNb_GetNoticedStatus(EnNb* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index a03319dfc..cbbce167e 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -266,7 +266,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { osSyncPrintf("\n\n"); if (Text_GetFaceReaction(play, 8) == 0) { if (this->actor.textId == 0x503C) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); this->unk_26C = 2; this->unk_262 = TEXT_STATE_EVENT; this->actionFunc = func_80ABA654; @@ -274,7 +274,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } this->unk_26E = phi_s1 + 1; if (phi_s1 == 7) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); this->unk_26C = 1; this->unk_262 = TEXT_STATE_EVENT; this->unk_26A = this->cuccosInPen; @@ -287,9 +287,9 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } if (this->unk_26A != this->cuccosInPen) { if (this->cuccosInPen < this->unk_26A) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } else if (phi_s1 + 1 < 9) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } if (this->unk_26A < this->cuccosInPen) { @@ -379,7 +379,7 @@ void func_80ABA878(EnNiwLady* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, play)) { playerExchangeItemId = func_8002F368(play); if ((playerExchangeItemId == 6) && (Flags_GetEventChkInf(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO))) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); player->actor.textId = sTradeItemTextIds[5]; this->unk_26E = this->unk_27A + 21; this->unk_262 = TEXT_STATE_CHOICE; diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 017c3fac1..b205e61c5 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -156,7 +156,7 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { if ((play->sceneNum != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) && (play->sceneNum != SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_80ABEF2C; return; } @@ -172,7 +172,7 @@ void func_80ABF0CC(EnOkarinaTag* this, PlayState* play) { Flags_SetSwitch(play, this->switchFlag); } play->msgCtx.ocarinaMode = OCARINA_MODE_04; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_80ABEF2C; return; } @@ -235,7 +235,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { this->actionFunc = func_80ABF28C; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } @@ -264,7 +264,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; } Flags_SetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); break; default: break; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 171a6405d..272245cbf 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -751,7 +751,7 @@ void EnOssan_ChooseTalkToOwner(PlayState* play, EnOssan* this) { } void EnOssan_SetLookToShopkeeperFromShelf(PlayState* play, EnOssan* this) { - func_80078884(NA_SE_SY_CURSOR); + Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_LOOK_SHOPKEEPER; } @@ -929,7 +929,7 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla } } } else if (dialogState == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { - func_80078884(NA_SE_SY_MESSAGE_PASS); + Sfx_PlaySfxCentered(NA_SE_SY_MESSAGE_PASS); switch (this->happyMaskShopState) { case OSSAN_HAPPY_STATE_ALL_MASKS_SOLD: @@ -986,7 +986,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && !EnOssan_TestEndInteraction(this, play, &play->state.input[0])) { if (Message_ShouldAdvance(play) && EnOssan_FacingShopkeeperDialogResult(this, play)) { - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); return; } @@ -1005,7 +1005,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play this->stateFlag = OSSAN_STATE_LOOK_SHELF_LEFT; Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; - func_80078884(NA_SE_SY_CURSOR); + Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, dRight))) { @@ -1015,7 +1015,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play this->stateFlag = OSSAN_STATE_LOOK_SHELF_RIGHT; Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; - func_80078884(NA_SE_SY_CURSOR); + Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } @@ -1174,23 +1174,23 @@ s32 EnOssan_HasPlayerSelectedItem(PlayState* play, EnOssan* this, Input* input) case SI_ZORA_MASK: case SI_GORON_MASK: case SI_GERUDO_MASK: - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM_MASK; return true; case SI_MILK_BOTTLE: - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM_MILK_BOTTLE; return true; case SI_WEIRD_EGG: - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM_WEIRD_EGG; return true; case SI_19: case SI_20: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM_UNIMPLEMENTED; return true; @@ -1199,18 +1199,18 @@ s32 EnOssan_HasPlayerSelectedItem(PlayState* play, EnOssan* this, Input* input) case SI_BOMBS_20: case SI_BOMBS_30: case SI_BOMBS_5_R35: - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM_BOMBS; return true; default: - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); this->drawCursor = 0; this->stateFlag = OSSAN_STATE_SELECT_ITEM; return true; } } - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); return true; } return false; @@ -1282,7 +1282,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe if (this->cursorIndex != prevIndex) { GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); - func_80078884(NA_SE_SY_CURSOR); + Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); } } } @@ -1352,7 +1352,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play if (this->cursorIndex != prevIndex) { GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); - func_80078884(NA_SE_SY_CURSOR); + Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); } } } @@ -1432,19 +1432,19 @@ void EnOssan_HandleCanBuyItem(PlayState* play, EnOssan* this) { selectedItem->setOutOfStockFunc(play, selectedItem); break; case CANBUY_RESULT_CANT_GET_NOW: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x86); break; case CANBUY_RESULT_NEED_BOTTLE: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x96); break; case CANBUY_RESULT_NEED_RUPEES: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x85); break; case CANBUY_RESULT_CANT_GET_NOW_5: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x86); break; } @@ -1493,11 +1493,11 @@ void EnOssan_HandleCanBuyWeirdEgg(PlayState* play, EnOssan* this) { item->setOutOfStockFunc(play, item); break; case CANBUY_RESULT_CANT_GET_NOW: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x9D); break; case CANBUY_RESULT_NEED_RUPEES: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x85); break; } @@ -1516,11 +1516,11 @@ void EnOssan_HandleCanBuyBombs(PlayState* play, EnOssan* this) { item->setOutOfStockFunc(play, item); break; case CANBUY_RESULT_CANT_GET_NOW: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x86); break; case CANBUY_RESULT_NEED_RUPEES: - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); EnOssan_SetStateCantGetItem(play, this, 0x85); break; } diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 35b2fe1b8..fb03af25c 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -994,7 +994,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { break; } - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); gSaveContext.cutsceneTrigger = 1; func_800F44EC(0x14, 0xA); this->actionFunc = EnOwl_WaitDefault; diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c index f0097b5bd..a1dd91e6f 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c @@ -196,7 +196,7 @@ void UseBow(Actor* thisx, PlayState* play, u8 started, u8 arrowType) { if (this->itemTimer <= 0) { if (AMMO(ITEM_BOW) > 0) { if (arrowType >= 1 && !Magic_RequestChange(play, magicArrowCosts[arrowType], MAGIC_CONSUME_NOW)) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); this->canMove = 1; return; } @@ -244,7 +244,7 @@ void UseSlingshot(Actor* thisx, PlayState* play, u8 started) { newarrow->parent = NULL; Inventory_ChangeAmmo(ITEM_SLINGSHOT, -1); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } @@ -261,7 +261,7 @@ void UseBombs(Actor* thisx, PlayState* play, u8 started) { this->actor.world.pos.z, 0, 0, 0, 0, false); Inventory_ChangeAmmo(ITEM_BOMB, -1); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } @@ -302,7 +302,7 @@ void UseBombchus(Actor* thisx, PlayState* play, u8 started) { bomb->timer = 0; Inventory_ChangeAmmo(ITEM_BOMBCHU, -1); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } @@ -322,7 +322,7 @@ void UseDekuStick(Actor* thisx, PlayState* play, u8 started) { if (AMMO(ITEM_STICK) > 0) { func_808328EC(this, NA_SE_EV_FLAME_IGNITION); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } @@ -358,7 +358,7 @@ void UseNuts(Actor* thisx, PlayState* play, u8 started) { this->actor.world.pos.z, 0x1000, this->actor.world.rot.y, 0, ARROW_NUT, false); Inventory_ChangeAmmo(ITEM_NUT, -1); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } @@ -415,12 +415,12 @@ void UseLens(Actor* thisx, PlayState* play, u8 started) { if (this->itemTimer <= 0) { if (started == 1) { - func_80078884(NA_SE_SY_GLASSMODE_ON); + Sfx_PlaySfxCentered(NA_SE_SY_GLASSMODE_ON); this->shouldDraw = 0; } if (started == 0) { - func_80078884(NA_SE_SY_GLASSMODE_OFF); + Sfx_PlaySfxCentered(NA_SE_SY_GLASSMODE_OFF); this->shouldDraw = 1; } } @@ -436,7 +436,7 @@ void UseBeans(Actor* thisx, PlayState* play, u8 started) { if (gSaveContext.rupees >= 100 && GiveItemEntryWithoutActor(play, this->entry)) { Rupees_ChangeBy(-100); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } } diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index d391840ba..33add9d1b 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -332,7 +332,7 @@ void func_80AD42B0(EnPoField* this) { this->actor.scale.y = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); if (this->actor.params == EN_PO_FIELD_BIG) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } this->actionFunc = func_80AD587C; } diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index e1a1d1f31..13ace8899 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -823,7 +823,7 @@ void func_80ADB17C(EnPoSisters* this, PlayState* play) { Flags_UnsetSwitch(play, 0x1B); } play->envCtx.unk_BF = 0xFF; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); } else if (this->unk_19A < 32) { func_80AD9240(this, this->unk_19A, &this->actor.world.pos); diff --git a/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index 3a76aefc4..cb968260d 100644 --- a/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -74,8 +74,8 @@ void EnPubox_Update(Actor* thisx, PlayState* play) { thisx->speedXZ = (thisx->speedXZ < -2.5f) ? -2.5f : ((thisx->speedXZ > 2.5f) ? 2.5f : thisx->speedXZ); Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); if (thisx->speedXZ != 0.0f) { - Audio_PlaySoundGeneral(NA_SE_EV_ROCK_SLIDE - SFX_FLAG, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_ROCK_SLIDE - SFX_FLAG, &thisx->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = 0.0f; diff --git a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 5012dff2b..1ef609b23 100644 --- a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -250,7 +250,7 @@ void EnRiverSound_Draw(Actor* thisx, PlayState* play) { Audio_PlaySariaBgm(&this->actor.home.pos, NA_BGM_GREAT_FAIRY, 800); } else if ((this->actor.params == RS_SANDSTORM) || (this->actor.params == RS_CHAMBER_OF_SAGES_1) || (this->actor.params == RS_CHAMBER_OF_SAGES_2) || (this->actor.params == RS_RUMBLING)) { - func_800788CC(soundEffects[this->actor.params]); + Sfx_PlaySfxCentered2(soundEffects[this->actor.params]); } else { Audio_PlayActorSound2(&this->actor, soundEffects[this->actor.params]); } diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index afc51e291..8257df479 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -563,14 +563,14 @@ void func_80AEBA2C(EnRu1* this, PlayState* play) { void func_80AEBAFC(EnRu1* this) { if (this->unk_298 == 0) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_DIVE_INTO_WATER); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_DIVE_INTO_WATER); this->unk_298 = 1; } } void func_80AEBB3C(EnRu1* this) { if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_FACE_UP); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_FACE_UP); } } @@ -579,13 +579,13 @@ void func_80AEBB78(EnRu1* this) { if (Animation_OnFrame(skelAnime, 4.0f) || Animation_OnFrame(skelAnime, 13.0f) || Animation_OnFrame(skelAnime, 22.0f) || Animation_OnFrame(skelAnime, 31.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_SWIM); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_SWIM); } } void func_80AEBBF4(EnRu1* this) { if (Animation_OnFrame(&this->skelAnime, 8.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_SUBMERGE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_SUBMERGE); } } @@ -594,14 +594,14 @@ void func_80AEBC30(PlayState* play) { if (play->csCtx.frames == 0xCD) { player = GET_PLAYER(play); - Audio_PlaySoundGeneral(NA_SE_EV_DIVE_INTO_WATER, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_DIVE_INTO_WATER, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } void func_80AEBC84(EnRu1* this, PlayState* play) { if (play->csCtx.frames == 0x82) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_LAUGH_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_LAUGH_0); } } @@ -843,14 +843,14 @@ void func_80AEC650(EnRu1* this) { if (this->unk_280 == 0) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); } } } void func_80AEC6B0(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_FALL_DOWN_DIRT); - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_FALL); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_FALL_DOWN_DIRT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_FALL); } void func_80AEC6E4(EnRu1* this, PlayState* play) { @@ -1201,33 +1201,33 @@ void func_80AED44C(EnRu1* this, PlayState* play) { } void func_80AED4FC(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT); } void func_80AED520(EnRu1* this, PlayState* play) { Player* player = GET_PLAYER(play); - Audio_PlaySoundGeneral(NA_SE_PL_PULL_UP_RUTO, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_LIFT); + Audio_PlaySoundGeneral(NA_SE_PL_PULL_UP_RUTO, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_LIFT); } void func_80AED57C(EnRu1* this) { if (this->actor.speedXZ != 0.0f) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_THROW); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_THROW); } } void func_80AED5B8(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_CRASH); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_CRASH); } void func_80AED5DC(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_UNBALLANCE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_UNBALLANCE); } void func_80AED600(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_DISCOVER); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_DISCOVER); } s32 func_80AED624(EnRu1* this, PlayState* play) { @@ -1815,7 +1815,7 @@ void func_80AEEFEC(EnRu1* this, PlayState* play) { void func_80AEF080(EnRu1* this) { if (Animation_OnFrame(&this->skelAnime, 11.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT); } } @@ -1908,7 +1908,7 @@ void func_80AEF40C(EnRu1* this) { if (Animation_OnFrame(skelAnime, 2.0f) || Animation_OnFrame(skelAnime, 7.0f) || Animation_OnFrame(skelAnime, 12.0f) || Animation_OnFrame(skelAnime, 18.0f) || Animation_OnFrame(skelAnime, 25.0f) || Animation_OnFrame(skelAnime, 33.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); } } @@ -1918,12 +1918,12 @@ void func_80AEF4A8(EnRu1* this, PlayState* play) { void func_80AEF4E0(EnRu1* this) { if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_LAUGH_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_LAUGH_0); } } void func_80AEF51C(EnRu1* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_RT_THROW); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_RT_THROW); } void func_80AEF540(EnRu1* this) { diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index dee36edfa..ac777f7de 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -389,7 +389,7 @@ void func_80AF2E1C(EnRu2* this, PlayState* play) { } void func_80AF2E64() { - func_800788CC(NA_SE_SY_WHITE_OUT_T); + Sfx_PlaySfxCentered2(NA_SE_SY_WHITE_OUT_T); } void func_80AF2E84(EnRu2* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index ca1da32cc..664e29d1d 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -679,8 +679,8 @@ void func_80AF68E4(EnSa* this, PlayState* play) { phi_v0 = this->unk_20C; } if (phi_v0 == 0) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_20C = 8; } } diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index b903adc55..c21465736 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -920,7 +920,7 @@ void EnSkj_WaitInRange(EnSkj* this, PlayState* play) { player->actor.world.pos.y = sSmallStumpSkullKid.skullkid->actor.world.pos.y; player->actor.world.pos.z = sSmallStumpSkullKid.skullkid->actor.world.pos.z; if ((Player_GetMask(play) == PLAYER_MASK_SKULL) && !Flags_GetItemGetInf(ITEMGETINF_39)) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); EnSkj_SetupMaskTrade(this); } else { EnSkj_SetupTalk(this); @@ -980,7 +980,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { if (!Flags_GetItemGetInf(ITEMGETINF_16)) { // Saria's song has been played for the first titme play->msgCtx.ocarinaMode = OCARINA_MODE_04; - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); player->unk_6A8 = &this->actor; func_8002F2CC(&this->actor, play, EnSkj_GetItemXzRange(this)); this->textId = 0x10BB; @@ -1436,7 +1436,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { this->textId = 0x102D; this->actionFunc = EnSkj_FailedMiniGame; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_0F) { // completed the game - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Message_CloseTextbox(play); play->msgCtx.ocarinaMode = OCARINA_MODE_04; player->unk_6A8 = &this->actor; @@ -1477,7 +1477,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { this->songFailTimer--; } } else { // took too long, game failed - func_80078884(NA_SE_SY_OCARINA_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); Message_CloseTextbox(play); play->msgCtx.ocarinaMode = OCARINA_MODE_04; player->unk_6A8 = &this->actor; diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 00f859e70..caa07d1d6 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -277,7 +277,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { } if (((thisx->params & 0xE000) >> 0xD) >= 3) { - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } switch ((thisx->params & 0xE000) >> 0xD) { @@ -635,7 +635,7 @@ void func_80B0D878(EnSw* this, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; if ((this->unk_394 == 0) && (this->unk_392 == 0)) { - Audio_PlaySoundGeneral(NA_SE_SY_KINSTA_MARK_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_KINSTA_MARK_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); x = (this->unk_364.x * 10.0f); y = (this->unk_364.y * 10.0f); z = (this->unk_364.z * 10.0f); diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index dbd6007a2..4122cef6b 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -162,7 +162,7 @@ void EnSyatekiItm_StartRound(EnSyatekiItm* this, PlayState* play) { this->timer = (this->roundNum == 1) ? 50 : 30; - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); this->actionFunc = EnSyatekiItm_SpawnTargets; } } diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 7ab2d6f7b..afe9ce537 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -458,8 +458,8 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) { } if ((this->unk_25A == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) { - Audio_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); this->unk_25E = 0x14; this->unk_29A = 6; this->actor.speedXZ = 0.0f; diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 6a4676fdd..821ec3f9b 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -747,7 +747,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) { if (gSaveContext.timer1Value == 0 && !Play_InCsMode(play)) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); this->unk_2E0 &= ~0x200; - func_80078884(NA_SE_SY_FOUND); + Sfx_PlaySfxCentered(NA_SE_SY_FOUND); gSaveContext.timer1State = 0; Player_SetCsActionWithHaltedActors(play, &this->actor, 1); Message_StartTextbox(play, 0x2081, &this->actor); diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 68979daca..261e4892c 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -637,7 +637,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } else if (this->currentReward == 4) { /* Heart piece */ - Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { /* Rupee */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 594d72bca..ef53f4727 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -243,7 +243,7 @@ u32 func_80B20634(EnToryo* this, PlayState* play) { if (this->unk_1E0 != 0) { if (this->unk_1E0 == 10) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); if (Flags_GetInfTable(INFTABLE_171)) { ret = 0x606E; } else { diff --git a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 30ff3c37f..7af032fa5 100644 --- a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -243,8 +243,8 @@ void EnTp_Head_ApproachPlayer(EnTp* this, PlayState* play) { Player* player = GET_PLAYER(play); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 30.0f, 1.0f, 0.5f, 0.0f); - Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -381,8 +381,8 @@ void EnTp_Head_TakeOff(EnTp* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speedXZ, 2.5f, 0.1f, 0.2f, 0.0f); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 85.0f + this->horizontalVariation, 1.0f, this->actor.speedXZ * 0.25f, 0.0f); - Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -479,8 +479,8 @@ void EnTp_Head_Wait(EnTp* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.world.pos.y != this->actor.home.pos.y) { - Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } @@ -549,8 +549,8 @@ void EnTp_Head_BurrowReturnHome(EnTp* this, PlayState* play) { } if (this->actor.world.pos.y != this->actor.home.pos.y) { - Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TAIL_FLY - SFX_FLAG, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } if (closeToFloor && ((play->gameplayFrames & 1) != 0)) { @@ -692,8 +692,8 @@ void EnTp_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.z += 0x800; if (this->actor.shape.rot.z == 0) { - Audio_PlaySoundGeneral(NA_SE_EN_TAIL_CRY, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TAIL_CRY, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } if (this->actionIndex >= TAILPASARAN_ACTION_TAIL_FOLLOWHEAD) { diff --git a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c index adf6c3ddc..6790f8b74 100644 --- a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -130,8 +130,8 @@ void EnTr_CrySpellcast(EnTr* this, PlayState* play) { if (this->timer == 11) { // Both cry in the title screen cutscene, but only Kotake in the in-game cutscene if ((this->actor.params != TR_KOUME) || (gSaveContext.sceneSetupIndex == 6)) { - Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_VOICE, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_TWINROBA_SHOOT_VOICE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 756f46cb5..cef259f74 100644 --- a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -136,8 +136,8 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { this->actor.velocity.z = cosf(angle) * 10.0f; this->actor.velocity.y *= -0.5f; if (this->actor.params & 1) { - Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } for (i = 0; i < 10; i++) { Vec3f dustVel = { 0.0f, 0.0f, 0.0f }; @@ -222,7 +222,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { if (newActor != NULL) { if ((i == 0) && (this->actor.params == 100)) { Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_ROCK, &newActor->actor.projectedPos, 4, - &D_801333E0, &D_801333E0, &D_801333E8); + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } newActor->actor.parent = this->actor.parent; newActor->actor.velocity = spawnOffset; diff --git a/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 56d126a2c..2d77bf09d 100644 --- a/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -228,7 +228,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { case 380: case 409: case 438: - Audio_PlaySoundGeneral(NA_SE_SY_DEMO_CUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DEMO_CUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); break; } } @@ -245,8 +245,8 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { Audio_QueueSeqCmd(SEQ_PLAYER_FANFARE << 24 | NA_BGM_OPENING_GANON); } if (play->csCtx.frames == 960) { - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_GROAN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } else if (type == ENVIEWER_TYPE_6_HORSE_GANONDORF) { if (gSaveContext.sceneSetupIndex == 5 || gSaveContext.sceneSetupIndex == 10) { @@ -432,7 +432,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { case 0: if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[1] != NULL && play->csCtx.npcActions[1]->action == 7) { - Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_MorphToPlayOnce(&this->skin.skelAnime, &gYoungGanondorfLaughStartAnim, -5.0f); this->state++; } @@ -723,8 +723,8 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { if (type == ENVIEWER_TYPE_0_HORSE_ZELDA) { if (!sHorseSfxPlayed) { sHorseSfxPlayed = true; - Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } Audio_PlayActorSound2(&this->actor, NA_SE_EV_HORSE_RUN_LEVEL - SFX_FLAG); } @@ -773,7 +773,7 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { } } if (type == ENVIEWER_TYPE_5_GANONDORF) { - Audio_PlaySoundGeneral(NA_SE_EV_BURNING - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_BURNING - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); EnViewer_DrawFireEffects(this, play); } } diff --git a/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index e9ab11371..f3e602981 100644 --- a/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -89,7 +89,7 @@ void EnWallTubo_DetectChu(EnWallTubo* this, PlayState* play) { (fabsf(chuPosDiff.z) < 40.0f || (BREG(2)))) { this->chuGirl->wallStatus[this->actor.params] = 1; chu->timer = 2; - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); this->timer = 60; EffectSsBomb2_SpawnLayered(play, &this->explosionCenter, &effVelocity, &effAccel, 200, 40); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 1a711b644..56950809d 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -497,7 +497,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) { Math_StepToF(&this->actor.world.pos.z, player->actor.world.pos.z, 3.0f); if (this->timer == 0x1E) { - func_80078884(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); Play_TriggerRespawn(play); } } diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 3d09c811d..a18adafcf 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -75,7 +75,7 @@ void EnWonderItem_DropCollectible(EnWonderItem* this, PlayState* play, s32 autoC s32 i; s32 randomDrop; - func_80078884(NA_SE_SY_GET_ITEM); + Sfx_PlaySfxCentered(NA_SE_SY_GET_ITEM); if (this->dropCount == 0) { this->dropCount++; diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 512c11766..9a9c94e21 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -415,7 +415,7 @@ void EnXc_SetWalkingSFX(EnXc* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - func_80078914(&this->actor.projectedPos, sfxId); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); } } } @@ -429,11 +429,11 @@ void EnXc_SetNutThrowSFX(EnXc* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - func_80078914(&this->actor.projectedPos, sfxId); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); } } if (Animation_OnFrame(&this->skelAnime, 20.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_SK_SHOUT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_SK_SHOUT); } } @@ -445,7 +445,7 @@ void EnXc_SetLandingSFX(EnXc* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 11.0f)) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - func_80078914(&this->actor.projectedPos, sfxId); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); } } } @@ -465,13 +465,13 @@ void EnXc_SetColossusAppearSFX(EnXc* this, PlayState* play) { Vec3f pos = { -611.0f, 728.0f, -2.0f }; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sXyzDist, wDest); - func_80078914(&sXyzDist, NA_SE_EV_JUMP_CONC); + Sfx_PlaySfxAtPos(&sXyzDist, NA_SE_EV_JUMP_CONC); } else if (frameCount == 164) { Vec3f pos = { -1069.0f, 38.0f, 0.0f }; s32 pad; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sXyzDist, wDest); - func_80078914(&sXyzDist, NA_SE_PL_WALK_CONCRETE); + Sfx_PlaySfxAtPos(&sXyzDist, NA_SE_PL_WALK_CONCRETE); } } } @@ -481,7 +481,7 @@ void func_80B3D118(PlayState* play) { s16 sceneNum; if ((gSaveContext.sceneSetupIndex != 4) || (sceneNum = play->sceneNum, sceneNum != SCENE_DESERT_COLOSSUS)) { - func_800788CC(NA_SE_PL_SKIP); + Sfx_PlaySfxCentered2(NA_SE_PL_SKIP); } } @@ -1402,14 +1402,14 @@ void func_80B3F3C8(EnXc* this, PlayState* play) { } void func_80B3F3D8() { - func_800788CC(NA_SE_PL_SKIP); + Sfx_PlaySfxCentered2(NA_SE_PL_SKIP); } void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) { f32 wDest[2]; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, src, &D_80B42DA0, wDest); - func_80078914(&D_80B42DA0, NA_SE_EV_DIVE_INTO_WATER); + Sfx_PlaySfxAtPos(&D_80B42DA0, NA_SE_EV_DIVE_INTO_WATER); } void EnXc_LakeHyliaDive(PlayState* play) { @@ -1586,7 +1586,7 @@ void EnXc_PlayTriforceSFX(Actor* thisx, PlayState* play) { void func_80B3FAE0(EnXc* this) { if (Animation_OnFrame(&this->skelAnime, 38.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_SK_SHOUT); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_SK_SHOUT); func_80B3FA2C(); } } @@ -1788,14 +1788,14 @@ void EnXc_SetThrownAroundSFX(EnXc* this) { SkelAnime* skelAnime = &this->skelAnime; if (Animation_OnFrame(skelAnime, 9.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_BOUND_GRASS); - func_80078914(&this->actor.projectedPos, NA_SE_VO_SK_CRASH); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_BOUND_GRASS); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_SK_CRASH); } else if (Animation_OnFrame(skelAnime, 26.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_BOUND_GRASS); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_BOUND_GRASS); } else if (Animation_OnFrame(skelAnime, 28.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_GRASS); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_GRASS); } else if (Animation_OnFrame(skelAnime, 34.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_GRASS); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_GRASS); } } @@ -1809,9 +1809,9 @@ void EnXc_SetCrySFX(EnXc* this, PlayState* play) { CutsceneContext* csCtx = &play->csCtx; if (csCtx->frames == 869) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_SK_CRY_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_SK_CRY_0); } else if (csCtx->frames == 939) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_SK_CRY_1); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_SK_CRY_1); } } diff --git a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 20880b496..be77887db 100644 --- a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -177,10 +177,10 @@ void func_80B42F74(EnYabusameMark* this, PlayState* play) { } if (scoreIndex == 1) { Audio_StopSfxById(NA_SE_SY_TRE_BOX_APPEAR); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } if (scoreIndex == 0) { - func_80078884(NA_SE_SY_DECIDE); + Sfx_PlaySfxCentered(NA_SE_SY_DECIDE); } EffectSsExtra_Spawn(play, &arrowHitPos, &effectVelocity, &effectAccel, 5, scoreIndex); } diff --git a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 1b0b39aa5..672f8a63b 100644 --- a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -592,34 +592,34 @@ void func_80B4FD90(EnZl2* this, PlayState* play) { void func_80B4FDD4(EnZl2* this) { if (Animation_OnFrame(&this->skelAnime, 14.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WALK_CONCRETE); } } void func_80B4FE10(PlayState* play) { if ((play->csCtx.frames >= 830) && (play->csCtx.frames < 1081)) { - func_800788CC(NA_SE_EV_EARTHQUAKE - SFX_FLAG); + Sfx_PlaySfxCentered2(NA_SE_EV_EARTHQUAKE - SFX_FLAG); } } void func_80B4FE48(EnZl2* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EV_GOTO_HEAVEN - SFX_FLAG); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_GOTO_HEAVEN - SFX_FLAG); } void func_80B4FE6C(EnZl2* this) { - func_80078914(&this->actor.projectedPos, NA_SE_EN_GANON_LAUGH); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EN_GANON_LAUGH); } void func_80B4FE90(EnZl2* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_SURPRISE); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_SURPRISE); } void func_80B4FEB4(EnZl2* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } void func_80B4FED8(EnZl2* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_CRY_0); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_CRY_0); } void EnZl2_GiveLightArrows(EnZl2* this, PlayState* play) { @@ -1444,7 +1444,7 @@ void func_80B51D24(EnZl2* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - func_80078914(&this->actor.projectedPos, sfxId); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); } } } diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index d07f2de50..af1d0dc75 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -776,7 +776,7 @@ void func_80B54EA4(EnZl3* this, PlayState* play) { } void func_80B54EF4(EnZl3* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } void func_80B54F18(EnZl3* this, PlayState* play) { @@ -1012,7 +1012,7 @@ void func_80B55780(EnZl3* this, PlayState* play) { } void func_80B55808(EnZl3* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } void func_80B5582C(EnZl3* this) { @@ -1023,7 +1023,7 @@ void func_80B5585C(EnZl3* this) { SkelAnime* skelAnime = &this->skelAnime; if ((skelAnime->mode == 2) && Animation_OnFrame(skelAnime, 4.0f)) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } } @@ -1534,18 +1534,18 @@ void func_80B56D44(EnZl3* this, PlayState* play) { } void func_80B56DA4(EnZl3* this) { - func_800788CC(NA_SE_EV_ZELDA_POWER); + Sfx_PlaySfxCentered2(NA_SE_EV_ZELDA_POWER); } void func_80B56DC8(EnZl3* this) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } void func_80B56DEC(EnZl3* this) { SkelAnime* skelAnime = &this->skelAnime; if ((skelAnime->mode == 2) && Animation_OnFrame(skelAnime, 9.0f) != 0) { - func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_OPENDOOR); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_VO_Z1_OPENDOOR); } } @@ -1557,7 +1557,7 @@ void func_80B56E38(EnZl3* this, PlayState* play) { if ((Animation_OnFrame(sp20, 6.0f) || Animation_OnFrame(sp20, 0.0f)) && (this->actor.bgCheckFlags & 1)) { sfxId = 0x800; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - func_80078914(&this->actor.projectedPos, sfxId); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); } } @@ -2568,7 +2568,7 @@ void func_80B59828(EnZl3* this, PlayState* play) { void func_80B59A80(EnZl3* this, PlayState* play) { if (func_80B59768(this, play)) { - Audio_PlaySoundGeneral(NA_SE_OC_REVENGE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_REVENGE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 0601a7f5b..986f60c02 100644 --- a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -290,11 +290,11 @@ void EnfHG_Intro(EnfHG* this, PlayState* play) { bossGnd->work[GND_EYE_STATE] = GND_EYESTATE_BRIGHTEN; } if (this->timers[0] == 35) { - func_80078914(&audioVec, NA_SE_EN_FANTOM_EYE); + Sfx_PlaySfxAtPos(&audioVec, NA_SE_EN_FANTOM_EYE); } if (this->timers[0] == 130) { bossGnd->work[GND_EYE_STATE] = GND_EYESTATE_FADE; - func_80078914(&audioVec, NA_SE_EN_FANTOM_ST_LAUGH); + Sfx_PlaySfxAtPos(&audioVec, NA_SE_EN_FANTOM_ST_LAUGH); } if (this->timers[0] == 20) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); @@ -468,7 +468,7 @@ void EnfHG_Approach(EnfHG* this, PlayState* play) { this->hoofSfxPos.y = this->actor.projectedPos.y / (this->actor.scale.x * 100.0f); this->hoofSfxPos.z = this->actor.projectedPos.z / (this->actor.scale.x * 100.0f); if ((this->gallopTimer % 8) == 0) { - func_80078914(&this->hoofSfxPos, NA_SE_EV_HORSE_RUN); + Sfx_PlaySfxAtPos(&this->hoofSfxPos, NA_SE_EV_HORSE_RUN); } } SkelAnime_Update(&this->skin.skelAnime); @@ -637,7 +637,7 @@ void EnfHG_Retreat(EnfHG* this, PlayState* play) { this->hoofSfxPos.y = this->actor.projectedPos.y / (this->actor.scale.x * 100.0f); this->hoofSfxPos.z = this->actor.projectedPos.z / (this->actor.scale.x * 100.0f); if ((this->gallopTimer % 8) == 0) { - func_80078914(&this->hoofSfxPos, NA_SE_EV_HORSE_RUN); + Sfx_PlaySfxAtPos(&this->hoofSfxPos, NA_SE_EV_HORSE_RUN); } } SkelAnime_Update(&this->skin.skelAnime); diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 6e003af21..5f185b02d 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2284,7 +2284,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { sRodReelingSpeed = 0.5f; D_80B7E118 = Rand_ZeroFloat(1.9f); sFishMouthOffset.y = 500.0f; - func_80078914(&sSoundPos, NA_SE_IT_SWORD_SWING_HARD); + Sfx_PlaySfxAtPos(&sSoundPos, NA_SE_IT_SWORD_SWING_HARD); } } break; @@ -2304,7 +2304,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { sLurePosDelta.x *= 0.9f; sLurePosDelta.z *= 0.9f; if (!sIsOwnersHatHooked) { - func_80078884(NA_SE_IT_FISHING_REEL_HIGH - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_FISHING_REEL_HIGH - SFX_FLAG); } } @@ -2359,7 +2359,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { sReelLinePosStep = 0.0; } else { Math_ApproachF(&D_80B7E148, 0.0f, 1.0f, 0.05f); - func_80078914(&sSoundPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); + Sfx_PlaySfxAtPos(&sSoundPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); } } else { spE4 = WATER_SURFACE_Y(play); @@ -2377,7 +2377,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { if ((sLurePos.y <= spE4) && (spE4 < spE0) && (spE4 == WATER_SURFACE_Y(play))) { D_80B7E114 = 10; - func_80078914(&sSoundPos, NA_SE_EV_BOMB_DROP_WATER); + Sfx_PlaySfxAtPos(&sSoundPos, NA_SE_EV_BOMB_DROP_WATER); sLureCastDelta.y = 0.0f; sLurePosDelta.y *= 0.2f; @@ -2403,7 +2403,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { } } else { Math_ApproachZeroF(&D_80B7E148, 1.0f, 0.05f); - func_80078914(&sSoundPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); + Sfx_PlaySfxAtPos(&sSoundPos, NA_SE_EN_FANTOM_FLOAT - SFX_FLAG); } } @@ -2536,7 +2536,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { sLureRot.x = 0.0f; if (CHECK_BTN_ALL(input->press.button, BTN_B)) { sRodLineSpooled += 6.0f; - func_80078914(&sSoundPos, NA_SE_PL_WALK_SAND); + Sfx_PlaySfxAtPos(&sSoundPos, NA_SE_PL_WALK_SAND); } } else { if (sRodLineSpooled > 150.0f) { @@ -2617,11 +2617,11 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { if (CHECK_BTN_ALL(input->cur.button, BTN_A)) { if (CHECK_BTN_ALL(input->cur.button, BTN_R)) { sRodLineSpooled += 1.5f; - func_80078884(NA_SE_IT_FISHING_REEL_HIGH - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_FISHING_REEL_HIGH - SFX_FLAG); Math_ApproachF(&sReelLinePosStep, 1000.0f, 1.0f, 2.0f); } else { sRodLineSpooled += sRodReelingSpeed; - func_80078884(NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG); Math_ApproachF(&sReelLinePosStep, 1000.0f, 1.0f, 0.2f); } @@ -2679,7 +2679,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { } else { sRodLineSpooled += sRodReelingSpeed; } - func_80078884(NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG); } if ((sLureTimer & 0x1F) == 0) { @@ -3608,7 +3608,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { } else if (distToTarget < 10.0f) { if (sLurePos.y > (WATER_SURFACE_Y(play) - 10.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_JUMP_OUT_WATER); - func_80078884(NA_SE_PL_CATCH_BOOMERANG); + Sfx_PlaySfxCentered(NA_SE_PL_CATCH_BOOMERANG); } Fishing_SplashBySize(this, play, false); @@ -3685,7 +3685,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { func_800A9F6C(0.0f, rumbleStrength, 120, 5); sRumbleDelay = 40; sRodHitTimer = 10; - func_80078884(NA_SE_IT_FISHING_HIT); + Sfx_PlaySfxCentered(NA_SE_IT_FISHING_HIT); } } @@ -5360,7 +5360,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { sSinkingLureLocation = 0; sFishingPlayerCinematicState = 20; func_800A9F6C(0.0f, 150, 10, 10); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF); } @@ -5369,7 +5369,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { sLureEquipped = FS_LURE_STOCK; sFishingPlayerCinematicState = 20; func_800A9F6C(0.0f, 150, 10, 10); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x1400FF); } @@ -5447,9 +5447,9 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { } if ((sLureCameraZoomLevel == 0) || (sLureCameraZoomLevel == 3)) { - func_80078884(NA_SE_SY_CAMERA_ZOOM_DOWN); + Sfx_PlaySfxCentered(NA_SE_SY_CAMERA_ZOOM_DOWN); } else { - func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); + Sfx_PlaySfxCentered(NA_SE_SY_CAMERA_ZOOM_UP); } } } @@ -5831,7 +5831,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &sStreamSoundPos, &sStreamSoundProjectedPos, &sProjectedW); - func_80078914(&sStreamSoundProjectedPos, NA_SE_EV_WATER_WALL - SFX_FLAG); + Sfx_PlaySfxAtPos(&sStreamSoundProjectedPos, NA_SE_EV_WATER_WALL - SFX_FLAG); gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f; diff --git a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index c57eb7b1d..e1dd79b39 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -706,7 +706,7 @@ void ObjBean_GrowWaterPhase3(ObjBean* this, PlayState* play) { } this->stateFlags |= BEAN_STATE_BEEN_WATERED; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } else if (this->timer <= 0) { ObjBean_SetupGrowWaterPhase4(this); diff --git a/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index dda22c292..cd50df4ba 100644 --- a/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -53,9 +53,9 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_OBJ_OSHIHIKI) { if ((dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_ON || (dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_OFF) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } Flags_SetSwitch(play, this->actor.params); diff --git a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index b300b6853..602236816 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -131,7 +131,7 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) { Flags_SetSwitch(play, this->actor.params & 0x3F); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); if (((this->actor.params >> 0xF) & 1) != 0) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); } else { diff --git a/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index f0b6c4c33..133abc310 100644 --- a/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -114,7 +114,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { } if (sfxCond1 || sfxCond2) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } diff --git a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 4da1c3eba..21ec649f9 100644 --- a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -77,11 +77,11 @@ void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) { } Flags_SetClear(play, this->actor.room); Flags_SetSwitch(play, this->switchFlag); - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); } else { if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) { - Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Play_TriggerVoidOut(play); Actor_Kill(&this->actor); } diff --git a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 1bfb45ed2..bf9300798 100644 --- a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -188,8 +188,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { if (interactionType < 0) { if (player->unk_860 == 0) { player->unk_860 = 210; - Audio_PlaySoundGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (player->unk_860 < 200) { player->unk_860 = 200; } @@ -225,8 +225,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { this->litTimer = (litTimeScale * 50) + 110; } } - Audio_PlaySoundGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_FLAME_IGNITION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } diff --git a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index cf8c28165..076aeeea3 100644 --- a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -249,7 +249,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { this->isVisible = newIsVisible; if (this->demoEffectTimer == 50) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } @@ -284,7 +284,7 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) { func_80BA06AC(this, play); if (this->demoEffectTimer == 50) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } if (!this->isVisible && this->demoEffectTimer <= 0) { diff --git a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index b67660963..f13d500bb 100644 --- a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -290,7 +290,7 @@ void func_80BA2610(ObjWarp2block* this, PlayState* play) { } } if (this->unk_16C == 0x32) { - func_80078884(NA_SE_SY_TRE_BOX_APPEAR); + Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 2600acd6b..a318cf759 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -208,19 +208,19 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, PlayState* play) { func_800F436C(&sSoundPos, NA_SE_EV_NAVY_FLY - SFX_FLAG, (0.4f * dist) + 0.6f); switch (play->csCtx.frames) { case 473: - func_800788CC(NA_SE_VO_NA_HELLO_3); + Sfx_PlaySfxCentered2(NA_SE_VO_NA_HELLO_3); break; case 583: - func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); + func_800F4524(&gSfxDefaultPos, NA_SE_VO_NA_HELLO_2, 32); break; case 763: - func_80078884(NA_SE_EV_NAVY_CRASH - SFX_FLAG); + Sfx_PlaySfxCentered(NA_SE_EV_NAVY_CRASH - SFX_FLAG); break; case 771: - func_80078884(NA_SE_VO_RT_THROW); + Sfx_PlaySfxCentered(NA_SE_VO_RT_THROW); break; } } diff --git a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index a0552a027..b09a4912f 100644 --- a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -115,7 +115,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, 0, 0, 0x11, true); - func_80078914(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); + Sfx_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); } } @@ -160,7 +160,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { Vec3f spawnPos; if (this->collider.base.acFlags & AC_HIT) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); osSyncPrintf(VT_FGCOL(CYAN) "SHOT_SUN HIT!!!!!!!\n" VT_RST); if ((INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE && !IS_RANDO) || (!Flags_GetTreasure(play, 0x1F) && IS_RANDO)) { diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index c11609c5d..28ef6e29d 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2678,7 +2678,7 @@ s32 func_8083442C(Player* this, PlayState* play) { if ((this->heldItemAction >= PLAYER_IA_BOW_FIRE) && (this->heldItemAction <= PLAYER_IA_BOW_0E) && (gSaveContext.magicState != MAGIC_STATE_IDLE)) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } else { Player_SetUpperActionFunc(this, func_808351D4); @@ -3441,7 +3441,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { (play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3 && !CVarGetInteger(CVAR_ENHANCEMENT("RemoveExplosiveLimit"), 0))))))) { // Prevent some items from being used if player is out of ammo. // Also prevent explosives from being used if there are 3 or more active (outside of bombchu bowling) - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } else if (itemAction == PLAYER_IA_LENS_OF_TRUTH) { // Handle Lens of Truth if (Magic_RequestChange(play, 0, MAGIC_CONSUME_LENS)) { @@ -3450,16 +3450,16 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { } else { play->actorCtx.lensActive = true; } - func_80078884((play->actorCtx.lensActive) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF); + Sfx_PlaySfxCentered((play->actorCtx.lensActive) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } else if (itemAction == PLAYER_IA_DEKU_NUT) { // Handle Deku Nuts if (AMMO(ITEM_NUT) != 0) { func_8083C61C(play, this); } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } else if ((temp = Player_ActionToMagicSpell(this, itemAction)) >= 0) { // Handle magic spells @@ -3469,7 +3469,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { this->itemAction = itemAction; this->unk_6AD = 4; } else { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } else if (itemAction >= PLAYER_IA_MASK_KEATON) { // Handle wearable masks @@ -4757,7 +4757,7 @@ s32 func_808382DC(Player* this, PlayState* play) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY); play->unk_11DE9 = 1; - func_80078884(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); } else if ((this->knockbackType != PLAYER_KNOCKBACK_NONE) && ((this->knockbackType >= PLAYER_KNOCKBACK_LARGE) || (this->invincibilityTimer == 0))) { u8 knockbackResponse[] = { @@ -5031,7 +5031,7 @@ s32 func_80838FB8(PlayState* play, Player* this) { func_80838F5C(play, this); Player_AnimPlayLoop(play, this, &gPlayerAnim_link_normal_landing_wait); Player_PlayVoiceSfx(this, NA_SE_VO_LI_FALL_S); - func_800788CC(NA_SE_OC_SECRET_WARP_IN); + Sfx_PlaySfxCentered2(NA_SE_OC_SECRET_WARP_IN); return 1; } @@ -5159,7 +5159,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol ((sp34 < 100) || (this->actor.bgCheckFlags & 1))) { if (temp == 11) { - func_800788CC(NA_SE_OC_SECRET_HOLE_OUT); + Sfx_PlaySfxCentered2(NA_SE_OC_SECRET_HOLE_OUT); func_800F6964(5); gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; @@ -5211,7 +5211,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol Play_TriggerVoidOut(play); } play->transitionType = TRANS_TYPE_FADE_BLACK_FAST; - func_80078884(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); } else { func_80838F5C(play, this); this->av2.actionVar2 = 9999; @@ -6076,12 +6076,12 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { func_8083B010(this); } this->stateFlags1 |= PLAYER_STATE1_FIRST_PERSON; - func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); + Sfx_PlaySfxCentered(NA_SE_SY_CAMERA_ZOOM_UP); Player_ZeroSpeedXZ(this); return 1; } else { this->unk_6AD = 0; - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); return 0; } @@ -6208,7 +6208,7 @@ s32 Player_ActionHandler_0(Player* this, PlayState* play) { } else if ((this->naviTextId == 0 || CVarGetInteger(CVAR_ENHANCEMENT("NaviOnL"), 0)) && !Player_CheckHostileLockOn(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, play)) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } return 0; @@ -6545,7 +6545,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { ? 0 : !(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) { - func_80078884(NA_SE_SY_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); return 0; } @@ -7237,7 +7237,7 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) { } else { Item_Give(play, giEntry->itemId); } - func_80078884((this->getItemId < 0 || this->getItemEntry.getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM); + Sfx_PlaySfxCentered((this->getItemId < 0 || this->getItemEntry.getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM); } s32 Player_ActionHandler_2(Player* this, PlayState* play) { @@ -11776,7 +11776,7 @@ void Player_DetectRumbleSecrets(Player* this) { this->unk_6A0 = 0.0f; if (CVarGetInteger(CVAR_ENHANCEMENT("VisualAgony"), 0) && !this->stateFlags1 && !GameInteractor_NoUIActive()) { // This audio is placed here and not in previous CVar check to prevent ears ra.. :) - Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0); + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale); } Player_RequestRumble(this, 120, 20, 10, 0); } @@ -11917,7 +11917,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->unk_A86++; if (this->unk_A86 == 0) { this->unk_A86 = 1; - func_80078884(NA_SE_OC_REVENGE); + Sfx_PlaySfxCentered(NA_SE_OC_REVENGE); } } @@ -12968,7 +12968,7 @@ void Player_Action_8084B1D8(Player* this, PlayState* play) { Player_FriendlyLockOnOrParallel(this) || (!func_8002DD78(this) && !func_808334B4(this)))) || ((this->unk_6AD == 1) && CHECK_BTN_ANY(sControlInput->press.button, buttonsToCheck)))) { func_8083C148(this, play); - func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); + Sfx_PlaySfxCentered(NA_SE_SY_CAMERA_ZOOM_UP); } else if ((DECR(this->av2.actionVar2) == 0) || (this->unk_6AD != 2)) { if (func_8008F128(this)) { this->unk_6AE_rotFlags |= UNK6AE_ROT_FOCUS_X | UNK6AE_ROT_FOCUS_Y | UNK6AE_ROT_UPPER_X; @@ -14188,7 +14188,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { } else if (((giEntry.itemId >= ITEM_RUPEE_GREEN) && (giEntry.itemId <= ITEM_RUPEE_RED)) || ((giEntry.itemId >= ITEM_RUPEE_PURPLE) && (giEntry.itemId <= ITEM_RUPEE_GOLD)) || (giEntry.itemId == ITEM_HEART)) { - Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GET_BOXITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { if ((giEntry.itemId == ITEM_HEART_CONTAINER) || ((giEntry.itemId == ITEM_HEART_PIECE_2) && @@ -15008,7 +15008,7 @@ void Player_Action_8084F88C(Player* this, PlayState* play) { } play->transitionType = TRANS_TYPE_FADE_BLACK_FAST; - func_80078884(NA_SE_OC_ABYSS); + Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); } else { play->transitionType = TRANS_TYPE_FADE_BLACK; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; @@ -15369,7 +15369,7 @@ void Player_Action_8085063C(Player* this, PlayState* play) { if (play->msgCtx.choiceIndex == 1) { //Unsets FW gSaveContext.respawn[RESPAWN_MODE_TOP].data = -respawnData; gSaveContext.fw.set = 0; - func_80078914(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, NA_SE_PL_MAGIC_WIND_VANISH); + Sfx_PlaySfxAtPos(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, NA_SE_PL_MAGIC_WIND_VANISH); } func_80853080(this, play); @@ -15389,7 +15389,7 @@ void Player_Action_8085076C(Player* this, PlayState* play) { if (this->av2.actionVar2++ == 20) { gSaveContext.respawn[RESPAWN_MODE_TOP].data = respawnData + 1; - func_80078914(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, NA_SE_PL_MAGIC_WIND_WARP); + Sfx_PlaySfxAtPos(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, NA_SE_PL_MAGIC_WIND_WARP); } } diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c index c39779f86..78502b25c 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c @@ -132,6 +132,6 @@ void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this) { if (this->rPlaySound && (this->rTextIdx == 1)) { SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->pos, &this->vec, &w); - Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->vec, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->vec, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c index b58f22fdf..96b346693 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c @@ -45,5 +45,5 @@ void EffectSsDeadSound_Update(PlayState* play, u32 index, EffectSs* this) { return; } - Audio_PlaySoundGeneral(this->rSfxId, &this->pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(this->rSfxId, &this->pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 50f846ddc..18c57d6ff 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1016,7 +1016,7 @@ void FileChoose_UpdateRandomizer() { if (Randomizer_IsSeedGenerated()) { Audio_PlayFanfare(NA_BGM_HORSE_GOAL); } else { - func_80078884(NA_SE_SY_OCARINA_ERROR); + Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); } func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1); generating = 0; @@ -1068,25 +1068,25 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A)) { if (this->buttonIndex <= FS_BTN_MAIN_FILE_3) { if (!Save_GetSaveMetaInfo(this->buttonIndex)->valid) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_QUEST_MENU; this->logoAlpha = 0; } else if(!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(this->buttonIndex))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (this->n64ddFlags[this->buttonIndex] == this->n64ddFlag) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->actionTimer = 8; this->selectMode = SM_FADE_MAIN_TO_SELECT; this->selectedFileIndex = this->buttonIndex; this->menuMode = FS_MENU_MODE_SELECT; this->nextTitleLabel = FS_TITLE_OPEN_FILE; } else if (!this->n64ddFlags[this->buttonIndex]) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { if (this->warningLabel == FS_WARNING_NONE) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prevConfigMode = this->configMode; if (this->buttonIndex == FS_BTN_MAIN_COPY) { @@ -1109,12 +1109,12 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { this->actionTimer = 8; } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } else { if ((ABS(this->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if ((this->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; @@ -1277,7 +1277,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { this->questType[this->buttonIndex] = MAX_QUEST; } - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); GameInteractor_ExecuteOnUpdateFileQuestSelection(this->questType[this->buttonIndex]); } @@ -1294,16 +1294,16 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { gSaveContext.questId = this->questType[this->buttonIndex]; if (this->questType[this->buttonIndex] == QUEST_BOSSRUSH) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_BOSS_RUSH_MENU; return; } else if (this->questType[this->buttonIndex] == QUEST_RANDOMIZER) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prevConfigMode = this->configMode; this->configMode = CM_GENERATE_SEED; } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); osSyncPrintf("Selected Dungeon Quest: %d\n", IS_MASTER_QUEST); this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_NAME_ENTRY; @@ -1412,7 +1412,7 @@ void FileChoose_UpdateBossRushMenu(GameState* thisx) { } } - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // Cycle through choices for currently selected option. @@ -1433,7 +1433,7 @@ void FileChoose_UpdateBossRushMenu(GameState* thisx) { } } - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (sLastBossRushOptionIndex != this->bossRushIndex || @@ -1450,7 +1450,7 @@ void FileChoose_UpdateBossRushMenu(GameState* thisx) { // Load into the game. if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->buttonIndex = 0xFE; this->menuMode = FS_MENU_MODE_SELECT; this->selectMode = SM_FADE_OUT; @@ -2855,18 +2855,18 @@ void FileChoose_ConfirmFile(GameState* thisx) { if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) { if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) { func_800AA000(300.0f, 180, 20, 100); - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->selectMode = SM_FADE_OUT; func_800F6964(0xF); } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->selectMode++; } } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->selectMode++; } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->confirmButtonIndex ^= 1; } @@ -2975,7 +2975,7 @@ void FileChoose_LoadGame(GameState* thisx) { u16 swordEquipValue; s32 pad; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gSaveContext.fileNum = this->buttonIndex; gSaveContext.gameMode = 0; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 3080eb14f..1ca66eb12 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -73,20 +73,20 @@ void FileChoose_SelectCopySource(GameState* thisx) { this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode = CM_COPY_RETURN_MAIN; this->warningLabel = FS_WARNING_NONE; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (Save_GetSaveMetaInfo(this->buttonIndex)->valid) { this->actionTimer = 8; this->selectedFileIndex = this->buttonIndex; this->configMode = CM_SETUP_COPY_DEST_1; this->nextTitleLabel = FS_TITLE_COPY_TO; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; @@ -189,21 +189,21 @@ void FileChoose_SelectCopyDest(GameState* thisx) { this->nextTitleLabel = FS_TITLE_COPY_FROM; this->actionTimer = 8; this->configMode = CM_EXIT_TO_COPY_SOURCE_1; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (!Save_GetSaveMetaInfo(this->buttonIndex)->valid) { this->copyDestFileIndex = this->buttonIndex; this->nextTitleLabel = FS_TITLE_COPY_CONFIRM; this->actionTimer = 8; this->configMode = CM_SETUP_COPY_CONFIRM_1; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; @@ -377,7 +377,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_COPY_TO; this->configMode = CM_RETURN_TO_COPY_DEST; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { dayTime = gSaveContext.dayTime; Save_CopyFile(this->selectedFileIndex, this->copyDestFileIndex); @@ -387,9 +387,9 @@ void FileChoose_CopyConfirm(GameState* thisx) { this->actionTimer = 8; this->configMode = CM_COPY_ANIM_1; func_800AA000(300.0f, 0xB4, 0x14, 0x64); - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->buttonIndex ^= 1; } @@ -504,7 +504,7 @@ void FileChoose_CopyAnim3(GameState* thisx) { if (this->actionTimer == 75) { this->connectorAlpha[this->copyDestFileIndex] = 255; - Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } this->actionTimer--; @@ -514,7 +514,7 @@ void FileChoose_CopyAnim3(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode++; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -704,20 +704,20 @@ void FileChoose_EraseSelect(GameState* thisx) { this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode = CM_EXIT_ERASE_TO_MAIN; this->warningLabel = FS_WARNING_NONE; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { if (Save_GetSaveMetaInfo(this->buttonIndex)->valid) { this->actionTimer = 8; this->selectedFileIndex = this->buttonIndex; this->configMode = CM_SETUP_ERASE_CONFIRM_1; this->nextTitleLabel = FS_TITLE_ERASE_CONFIRM; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; @@ -845,17 +845,17 @@ void FileChoose_EraseConfirm(GameState* thisx) { this->nextTitleLabel = FS_TITLE_ERASE_FILE; this->configMode = CM_EXIT_TO_ERASE_SELECT_1; this->actionTimer = 8; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) { this->connectorAlpha[this->selectedFileIndex] = 0; - Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->actionTimer = 8; this->configMode = CM_ERASE_ANIM_1; this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE; func_800AA000(200.0f, 0xFF, 0x14, 0x96); sEraseDelayTimer = 15; } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->buttonIndex ^= 1; } @@ -971,7 +971,7 @@ void FileChoose_EraseAnim1(GameState* thisx) { sEraseDelayTimer--; if (sEraseDelayTimer == 0) { - Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } @@ -989,7 +989,7 @@ void FileChoose_EraseAnim2(GameState* thisx) { this->actionTimer = 8; this->nextTitleLabel = FS_TITLE_SELECT_FILE; this->configMode++; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 6463bdbab..6d73b0014 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -356,7 +356,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) { if (this->configMode == CM_NAME_ENTRY) { if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); // place cursor on END button this->kbdY = 5; this->kbdX = 4; @@ -367,7 +367,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) { } filename[i] = 0x3E; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { this->newFileNameCharCount--; @@ -388,8 +388,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { } filename[i] = 0x3E; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } else { @@ -403,8 +403,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { font->fontBuf + D_808123F0[this->charIndex] * FONT_CHAR_TEX_SIZE, 0); if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); filename[this->newFileNameCharCount] = D_808123F0[this->charIndex]; this->newFileNameCharCount++; @@ -420,8 +420,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { } filename[i] = 0x3E; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } else { this->newFileNameCharCount--; @@ -434,8 +434,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { } filename[i] = 0x3E; - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } else if (this->kbdButton == FS_KBD_BTN_END) { validName = false; @@ -448,8 +448,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { } if (validName) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); gSaveContext.fileNum = this->buttonIndex; dayTime = ((void)0, gSaveContext.dayTime); Sram_InitSave(this); @@ -462,21 +462,21 @@ void FileChoose_DrawNameEntry(GameState* thisx) { this->connectorAlpha[this->buttonIndex] = 255; func_800AA000(300.0f, 0xB4, 0x14, 0x64); } else { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->newFileNameCharCount++; if (this->newFileNameCharCount > 7) { this->newFileNameCharCount = 7; } } else if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->newFileNameCharCount--; if (this->newFileNameCharCount < 0) { @@ -535,7 +535,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { if (this->kbdY != 5) { if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->charIndex--; this->kbdX--; if (this->kbdX < 0) { @@ -543,7 +543,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->charIndex = (this->kbdY * 13) + this->kbdX; } } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->charIndex++; this->kbdX++; if (this->kbdX > 12) { @@ -553,13 +553,13 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } else { if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdX--; if (this->kbdX < 3) { this->kbdX = 4; } } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdX++; if (this->kbdX > 4) { this->kbdX = 3; @@ -568,7 +568,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } if ((this->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdY--; if (this->kbdY < 0) { @@ -599,7 +599,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } } else if ((this->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->kbdY++; if (this->kbdY > 5) { @@ -688,7 +688,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { bool dpad = CVarGetInteger(CVAR_SETTING("DpadInText"), 0); if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prevConfigMode = this->configMode; this->configMode = CM_OPTIONS_TO_MAIN; sLastOptionButtonIndex = -1; @@ -711,7 +711,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { ResourceMgr_GetGamePlatform(versionIndex) == GAME_PLATFORM_N64; if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sSelectedSetting == FS_SETTING_AUDIO) { gSaveContext.audioSetting--; @@ -732,7 +732,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { gSaveContext.zTargetSetting ^= 1; } } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sSelectedSetting == FS_SETTING_AUDIO) { gSaveContext.audioSetting++; @@ -762,24 +762,24 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { // NTSC and GC only has two rows and can just flip the setting bit // Otherwise for PAL 64, handle the additional change language setting if (!isPalN64 && ((ABS(this->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sSelectedSetting ^= 1; } else if (isPalN64 && ((this->stickRelY > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP)))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sSelectedSetting--; if (sSelectedSetting > 0xF0) { sSelectedSetting = FS_SETTING_LANGUAGE; } } else if (isPalN64 && ((this->stickRelY < -30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN)))) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sSelectedSetting++; if (sSelectedSetting > FS_SETTING_LANGUAGE) { sSelectedSetting = FS_SETTING_AUDIO; } } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (isPalN64) { sSelectedSetting++; diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index f2253152e..051aa3c00 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -790,13 +790,13 @@ void Select_UpdateMenu(SelectContext* this) { if (this->timerUp == 0) { this->timerUp = 20; this->lockUp = true; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = R_UPDATE_RATE; } } if (CHECK_BTN_ALL(input->cur.button, BTN_DUP) && this->timerUp == 0) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = R_UPDATE_RATE * 3; } @@ -807,23 +807,23 @@ void Select_UpdateMenu(SelectContext* this) { if (this->timerDown == 0) { this->timerDown = 20; this->lockDown = true; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = -R_UPDATE_RATE; } } if (CHECK_BTN_ALL(input->cur.button, BTN_DDOWN) && (this->timerDown == 0)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = -R_UPDATE_RATE * 3; } if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT) || CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = R_UPDATE_RATE; } if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT) || CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = -R_UPDATE_RATE; } } @@ -909,10 +909,10 @@ void Better_Select_UpdateMenu(SelectContext* this) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { gSaveContext.linkAge = 1; - Audio_PlaySoundGeneral(NA_SE_VO_LI_SWORD_N_KID, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_LI_SWORD_N_KID, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { gSaveContext.linkAge = 0; - Audio_PlaySoundGeneral(NA_SE_VO_LI_SWORD_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_VO_LI_SWORD_N, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -920,11 +920,11 @@ void Better_Select_UpdateMenu(SelectContext* this) { if (gSaveContext.dayTime > 0xC000 || gSaveContext.dayTime < 0x4555) { gSaveContext.nightFlag = 0; gSaveContext.dayTime = 0x8000; - Audio_PlaySoundGeneral(NA_SE_EV_CHICKEN_CRY_M, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_CHICKEN_CRY_M, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { gSaveContext.nightFlag = 1; gSaveContext.dayTime = 0x0000; - Audio_PlaySoundGeneral(NA_SE_EV_DOG_CRY_EVENING, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_DOG_CRY_EVENING, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -934,23 +934,23 @@ void Better_Select_UpdateMenu(SelectContext* this) { this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex].canBeMQ) { this->opt = this->opt ? 0 : 1; if (this->opt) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PICKOUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PICKOUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PUTAWAY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { this->pageDownIndex--; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (this->pageDownIndex < 0) { this->pageDownIndex = this->betterScenes[this->currentScene].entranceCount - 1; } } if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { this->pageDownIndex++; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (this->pageDownIndex > this->betterScenes[this->currentScene].entranceCount - 1) { this->pageDownIndex = 0; } @@ -963,13 +963,13 @@ void Better_Select_UpdateMenu(SelectContext* this) { if (this->timerUp == 0) { this->timerUp = 20; this->lockUp = true; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = R_UPDATE_RATE; } } if ((CHECK_BTN_ALL(input->cur.button, BTN_DUP) || CHECK_BTN_ALL(input->cur.button, BTN_CUP)) && this->timerUp == 0) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = R_UPDATE_RATE * 3; } @@ -980,13 +980,13 @@ void Better_Select_UpdateMenu(SelectContext* this) { if (this->timerDown == 0) { this->timerDown = 20; this->lockDown = true; - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = -R_UPDATE_RATE; } } if ((CHECK_BTN_ALL(input->cur.button, BTN_DDOWN) || CHECK_BTN_ALL(input->cur.button, BTN_CDOWN)) && (this->timerDown == 0)) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->verticalInput = -R_UPDATE_RATE * 3; } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index b91696fad..880725f40 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -184,7 +184,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { pauseCtx->unk_1E4 = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { @@ -267,7 +267,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSpecialPos = 0; sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A; } else { @@ -284,7 +284,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorSpecialPos = 0; sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 73c965176..bef08b08a 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -385,7 +385,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); cursorPoint = cursorX = cursorY = 0; while (true) { @@ -431,7 +431,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); cursorPoint = cursorX = 3; cursorY = 0; @@ -545,7 +545,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { (pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 2) && CVarGetInteger(CVAR_ENHANCEMENT("ToggleStrength"), 0)) { CVarSetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), !CVarGetInteger(CVAR_ENHANCEMENT("StrengthDisabled"), 0)); // Equip success sound - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); // Wait 10 frames before accepting input again pauseCtx->unk_1E4 = 7; sEquipTimer = 10; @@ -637,7 +637,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Interface_LoadItemIcon1(play, 0); } - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->unk_1E4 = 7; sEquipTimer = 10; } else if (CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) { @@ -671,23 +671,23 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->equipVtx[cursorSlot * 4].v.ob[0] * 10, pauseCtx->equipVtx[cursorSlot * 4].v.ob[1] * 10); } else { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } } else { EQUIP_FAIL: if (CHECK_BTN_ALL(input->press.button, BTN_A)) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else if ((CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_EQUIP]) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if ((pauseCtx->unk_1E4 == 7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 6023282c7..105b59e03 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -270,14 +270,14 @@ void KaleidoScope_HandleItemCycleExtras(PlayState* play, u8 slot, bool canCycle, CHECK_BTN_ALL(input->press.button, BTN_A) && (hasLeftItem || hasRightItem) ) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gCurrentItemCyclingSlot = gCurrentItemCyclingSlot == slot ? -1 : slot; } if (gCurrentItemCyclingSlot == slot) { pauseCtx->cursorColorSet = 8; if ((pauseCtx->stickRelX > 30 || pauseCtx->stickRelY > 30) || dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT | BTN_DUP)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (replaceCButtons) { for (int i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { if (gSaveContext.equips.buttonItems[i] == gSaveContext.inventory.items[slot]) { @@ -294,7 +294,7 @@ void KaleidoScope_HandleItemCycleExtras(PlayState* play, u8 slot, bool canCycle, gSaveContext.inventory.items[slot] = rightItem; } else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelY < -30) || dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DDOWN)) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (replaceCButtons) { for (int i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { if (gSaveContext.equips.buttonItems[i] == gSaveContext.inventory.items[slot]) { @@ -541,7 +541,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); cursorPoint = cursorX = cursorY = 0; while (true) { @@ -575,7 +575,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); cursorPoint = cursorX = 5; cursorY = 0; @@ -687,8 +687,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->itemVtx[index].v.ob[0] * 10, pauseCtx->itemVtx[index].v.ob[1] * 10); } else { - Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } } } @@ -704,7 +704,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_ITEM]) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else if ((pauseCtx->unk_1E4 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->itemVtx); @@ -835,7 +835,7 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX, if ((pauseCtx->equipTargetItem == ITEM_ARROW_FIRE) || (pauseCtx->equipTargetItem == ITEM_ARROW_ICE) || (pauseCtx->equipTargetItem == ITEM_ARROW_LIGHT)) { if (CVarGetInteger(CVAR_ENHANCEMENT("SkipArrowAnimation"), 0)) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { u16 index = 0; if (pauseCtx->equipTargetItem == ITEM_ARROW_ICE) { @@ -844,14 +844,14 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX, if (pauseCtx->equipTargetItem == ITEM_ARROW_LIGHT) { index = 2; } - Audio_PlaySoundGeneral(NA_SE_SY_SET_FIRE_ARROW + index, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_SET_FIRE_ARROW + index, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->equipTargetItem = 0xBF + index; sEquipState = 0; pauseCtx->equipAnimAlpha = 0; sEquipMoveTimer = 6; } } else { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -1052,7 +1052,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { WREG(90) = 320; WREG(87) = WREG(91); sEquipState++; - Audio_PlaySoundGeneral(NA_SE_SY_SYNTH_MAGIC_ARROW, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_SYNTH_MAGIC_ARROW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } return; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index 8aba85040..0730f6b12 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -157,7 +157,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorX[PAUSE_MAP] = 0; j = 72 + (pauseCtx->cursorSlot[PAUSE_MAP] * 4); KaleidoScope_SetCursorVtx(pauseCtx, j, pauseCtx->mapPageVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } else { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { @@ -187,12 +187,12 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { osSyncPrintf("kscope->cursor_point====%d\n", pauseCtx->cursorPoint[PAUSE_MAP]); j = 72 + (pauseCtx->cursorSlot[PAUSE_MAP] * 4); KaleidoScope_SetCursorVtx(pauseCtx, j, pauseCtx->mapPageVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_MAP]) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -506,7 +506,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorItem[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP] + 0x1F; KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); D_8082A6D4 = 0; } } else { @@ -528,7 +528,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorItem[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_WORLD_MAP] + 0x1F; KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); D_8082A6D4 = 0; } } @@ -539,7 +539,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { } if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index 80ab3da9e..902519667 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -11,10 +11,10 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) { if ((pauseCtx->promptChoice == 0) && ((relStickX >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)))) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->promptChoice = 4; } else if ((pauseCtx->promptChoice != 0) && ((relStickX <= -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT)))) { - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->promptChoice = 0; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 46555fa0e..903d78173 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -988,7 +988,7 @@ void KaleidoScope_MoveCursorToSpecialPos(PlayState* play, u16 specialPos) { pauseCtx->cursorSpecialPos = specialPos; pauseCtx->pageSwitchTimer = 0; - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point) { @@ -1043,11 +1043,11 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { if (!pt) { pauseCtx->mode = pauseCtx->pageIndex * 2 + 1; - Audio_PlaySoundGeneral(NA_SE_SY_WIN_SCROLL_LEFT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WIN_SCROLL_LEFT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT; } else { pauseCtx->mode = pauseCtx->pageIndex * 2; - Audio_PlaySoundGeneral(NA_SE_SY_WIN_SCROLL_RIGHT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_WIN_SCROLL_RIGHT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT; } @@ -4000,7 +4000,7 @@ void KaleidoScope_Update(PlayState* play) } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { pauseCtx->mode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4011,7 +4011,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->unk_1EC = 0; pauseCtx->state = 7; } else if (CHECK_BTN_ALL(input->press.button, BTN_CUP) && pauseCtx->pageIndex == PAUSE_QUEST) { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->randoQuestMode ^= 1; } break; @@ -4051,7 +4051,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->unk_1E4 = 0; pauseCtx->mode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4062,14 +4062,14 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->unk_1EC = 0; pauseCtx->state = 7; } else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIdx) { - Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); D_8082B258 = 0; D_8082B25C = 30; pauseCtx->unk_1E4 = 6; } else if (pauseCtx->ocarinaStaff->state == 0xFF) { - Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); D_8082B258 = 4; D_8082B25C = 20; pauseCtx->unk_1E4 = 6; @@ -4102,7 +4102,7 @@ void KaleidoScope_Update(PlayState* play) pauseCtx->unk_1E4 = 0; pauseCtx->mode = 0; pauseCtx->promptChoice = 0; - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[4] = BTN_ENABLED; @@ -4151,8 +4151,8 @@ void KaleidoScope_Update(PlayState* play) YREG(8) = pauseCtx->unk_204; func_800F64E0(0); } else { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Play_PerformSave(play); pauseCtx->unk_1EC = 4; D_8082B25C = CVarGetInteger(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; @@ -4390,12 +4390,12 @@ void KaleidoScope_Update(PlayState* play) if (CHECK_BTN_ALL(input->press.button, BTN_A)) { if (pauseCtx->promptChoice != 0) { pauseCtx->promptChoice = 0; - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); pauseCtx->state = 0x10; gameOverCtx->state++; } else { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); pauseCtx->promptChoice = 0; Play_SaveSceneFlags(play); gSaveContext.savedSceneNum = play->sceneNum; @@ -4422,8 +4422,8 @@ void KaleidoScope_Update(PlayState* play) case 0x10: if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { if (pauseCtx->promptChoice == 0 && GameInteractor_Should(VB_BE_ABLE_TO_SAVE, true)) { - Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); Play_SaveSceneFlags(play); switch (gSaveContext.entranceIndex) { @@ -4472,7 +4472,7 @@ void KaleidoScope_Update(PlayState* play) break; } } else { - Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } pauseCtx->state = 0x11; From c8815a26f741b0204ebddd9ca02cc485675ea3af Mon Sep 17 00:00:00 2001 From: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:34:05 +0100 Subject: [PATCH 09/11] Improve ganon tower logic (#4526) * Improve ganon tower logic * Fix build and address review * Update locacc_ganons_castle.cpp * Update locacc_ganons_castle.cpp * Update locacc_ganons_castle.cpp * Update logic.cpp * Update randomizerTypes.h --------- Co-authored-by: Malkierian Co-authored-by: Malkierian --- .../location_access/locacc_ganons_castle.cpp | 60 ++++++++++++++++--- soh/soh/Enhancements/randomizer/logic.cpp | 13 +++- .../Enhancements/randomizer/randomizerTypes.h | 10 +++- 3 files changed, 72 insertions(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp index fc13129c1..5bb45ae78 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_ganons_castle.cpp @@ -32,7 +32,7 @@ void RegionTable_Init_GanonsCastle() { Entrance(RR_GANONS_CASTLE_SHADOW_TRIAL, {[]{return true;}}), Entrance(RR_GANONS_CASTLE_SPIRIT_TRIAL, {[]{return true;}}), Entrance(RR_GANONS_CASTLE_LIGHT_TRIAL, {[]{return logic->CanUse(RG_GOLDEN_GAUNTLETS);}}), - Entrance(RR_GANONS_CASTLE_TOWER, {[]{return (logic->ForestTrialClear || ctx->GetTrial(TK_FOREST_TRIAL)->IsSkipped()) && + Entrance(RR_GANONS_TOWER_FLOOR_1, {[]{return (logic->ForestTrialClear || ctx->GetTrial(TK_FOREST_TRIAL)->IsSkipped()) && (logic->FireTrialClear || ctx->GetTrial(TK_FIRE_TRIAL)->IsSkipped()) && (logic->WaterTrialClear || ctx->GetTrial(TK_WATER_TRIAL)->IsSkipped()) && (logic->ShadowTrialClear || ctx->GetTrial(TK_SHADOW_TRIAL)->IsSkipped()) && @@ -111,13 +111,6 @@ void RegionTable_Init_GanonsCastle() { }, {}); } - areaTable[RR_GANONS_CASTLE_TOWER] = Region("Ganon's Castle Tower", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, { - //Locations - LOCATION(RC_GANONS_TOWER_BOSS_KEY_CHEST, logic->CanUse(RG_KOKIRI_SWORD) || logic->CanUse(RG_MASTER_SWORD) || logic->CanUse(RG_BIGGORON_SWORD)), - LOCATION(RC_GANONDORF_HINT, logic->HasItem(RG_GANONS_CASTLE_BOSS_KEY) && (logic->CanUse(RG_KOKIRI_SWORD) || logic->CanUse(RG_MASTER_SWORD) || logic->CanUse(RG_BIGGORON_SWORD))), - LOCATION(RC_GANON, logic->HasBossSoul(RG_GANON_SOUL) && logic->HasItem(RG_GANONS_CASTLE_BOSS_KEY) && logic->CanUse(RG_LIGHT_ARROWS) && logic->CanUse(RG_MASTER_SWORD)), - }, {}); - /*--------------------------- | MASTER QUEST DUNGEON | ---------------------------*/ @@ -142,7 +135,7 @@ void RegionTable_Init_GanonsCastle() { Entrance(RR_GANONS_CASTLE_MQ_SPIRIT_TRIAL_CHAIRS_ROOM, {[]{return true;}}), Entrance(RR_GANONS_CASTLE_MQ_LIGHT_TRIAL_DINOLFOS_ROOM, {[]{return Here(RR_GANONS_CASTLE_MQ_MAIN, []{return logic->CanUse(RG_GOLDEN_GAUNTLETS);});}}), //RANDOTODO could we just set these events automatically based on the setting? - Entrance(RR_GANONS_CASTLE_TOWER, {[]{return (logic->ForestTrialClear || ctx->GetTrial(TK_FOREST_TRIAL)->IsSkipped()) && + Entrance(RR_GANONS_TOWER_FLOOR_1, {[]{return (logic->ForestTrialClear || ctx->GetTrial(TK_FOREST_TRIAL)->IsSkipped()) && (logic->FireTrialClear || ctx->GetTrial(TK_FIRE_TRIAL)->IsSkipped()) && (logic->WaterTrialClear || ctx->GetTrial(TK_WATER_TRIAL)->IsSkipped()) && (logic->ShadowTrialClear || ctx->GetTrial(TK_SHADOW_TRIAL)->IsSkipped()) && @@ -376,4 +369,53 @@ void RegionTable_Init_GanonsCastle() { EventAccess(&logic->LightTrialClear, {[]{return logic->CanUse(RG_LIGHT_ARROWS);}}), }, {}, {}); } + + /*-------------------------- + | TOWER AND ESCAPE | + ---------------------------*/ + areaTable[RR_GANONS_TOWER_FLOOR_1] = Region("Ganon's Tower Floor 1", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_GANONS_CASTLE_LOBBY, {[]{return Here(RR_GANONS_TOWER_FLOOR_1, []{return logic->CanKillEnemy(RE_DINOLFOS, ED_CLOSE, true, 2);});}}), + Entrance(RR_GANONS_TOWER_FLOOR_2, {[]{return Here(RR_GANONS_TOWER_FLOOR_1, []{return logic->CanKillEnemy(RE_DINOLFOS, ED_CLOSE, true, 2);});}}), + }); + + areaTable[RR_GANONS_TOWER_FLOOR_2] = Region("Ganon's Tower Floor 2", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_GANONS_TOWER_BOSS_KEY_CHEST, logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 2)), + }, { + //Exits + Entrance(RR_GANONS_TOWER_FLOOR_1, {[]{return Here(RR_GANONS_TOWER_FLOOR_2, []{return logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 2);});}}), + Entrance(RR_GANONS_TOWER_FLOOR_3, {[]{return Here(RR_GANONS_TOWER_FLOOR_2, []{return logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 2);});}}), + }); + + areaTable[RR_GANONS_TOWER_FLOOR_3] = Region("Ganon's Tower Floor 3", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_GANONS_TOWER_FLOOR_2, {[]{return Here(RR_GANONS_TOWER_FLOOR_3, []{return logic->CanKillEnemy(RE_IRON_KNUCKLE, ED_CLOSE, true, 2);});}}), + Entrance(RR_GANONS_TOWER_GANONDORF_LAIR, {[]{return Here(RR_GANONS_TOWER_FLOOR_3, []{return logic->CanKillEnemy(RE_IRON_KNUCKLE, ED_CLOSE, true, 2);}) && logic->HasItem(RG_GANONS_CASTLE_BOSS_KEY);}}), + }); + + areaTable[RR_GANONS_TOWER_GANONDORF_LAIR] = Region("Ganondorf's Lair", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_GANONDORF_HINT, logic->HasBossSoul(RG_GANON_SOUL)), + //18 pots + }, { + //Exits + Entrance(RR_GANONS_CASTLE_ESCAPE, {[]{return logic->CanKillEnemy(RE_GANONDORF);}}), + }); + + areaTable[RR_GANONS_CASTLE_ESCAPE] = Region("Ganon's Castle Escape", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + //10 pots + }, { + //Exits + //temporary + Entrance(RR_GANONS_CASTLE_GANON_ARENA, {[]{return true;}}), + //real logic once we figure out how to deal with castle escape skip + //Entrance(RR_GANONS_CASTLE_GANON_ARENA, {[]{return logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 2, true);}}), + }); + + areaTable[RR_GANONS_CASTLE_GANON_ARENA] = Region("Ganon's Arena", "Ganons Castle", {RA_GANONS_CASTLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_GANON, logic->CanKillEnemy(RE_GANON)), + }, {}); } diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 4b159b941..62a0c3995 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -587,8 +587,19 @@ namespace Rando { case RE_BIG_OCTO: //If chasing octo is annoying but with rolls you can catch him, and you need rang to get into this room without shenanigains anyway. Bunny makes it free return CanUse(RG_KOKIRI_SWORD) || CanUse(RG_STICKS) || CanUse(RG_MASTER_SWORD); + case RE_GANONDORF: + // RANDOTODO: Trick to use hammer (no jumpslash) or stick (only jumpslash) instead of a sword to reflect the energy ball + // and either of them regardless of jumpslashing to damage and kill ganondorf + + // Bottle is not taken into account since a sword, hammer or stick are required + // for killing ganondorf and all of those can reflect the energy ball + // This will not be the case once ammo logic in taken into account as + // sticks are limited and using a bottle might become a requirement in that case + return HasBossSoul(RG_GANON_SOUL) && CanUse(RG_LIGHT_ARROWS) && (CanUse(RG_KOKIRI_SWORD) || CanUse(RG_MASTER_SWORD) || CanUse(RG_BIGGORON_SWORD)); + case RE_GANON: + return HasBossSoul(RG_GANON_SOUL) && CanUse(RG_MASTER_SWORD); case RE_DARK_LINK: - //RNADOTODO Dark link is buggy right now, retest when he is not + //RANDOTODO Dark link is buggy right now, retest when he is not return CanJumpslash() || CanUse(RG_FAIRY_BOW); default: SPDLOG_ERROR("CanKillEnemy reached `default`."); diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 00fb4e05a..ffaf8e965 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -925,7 +925,6 @@ typedef enum { RR_GANONS_CASTLE_SHADOW_TRIAL, RR_GANONS_CASTLE_SPIRIT_TRIAL, RR_GANONS_CASTLE_LIGHT_TRIAL, - RR_GANONS_CASTLE_TOWER, RR_GANONS_CASTLE_MQ_LOBBY, RR_GANONS_CASTLE_MQ_MAIN, @@ -954,6 +953,13 @@ typedef enum { RR_GANONS_CASTLE_MQ_LIGHT_TRIAL_BOULDER_ROOM_BACK, RR_GANONS_CASTLE_MQ_LIGHT_TRIAL_FINAL_ROOM, + RR_GANONS_TOWER_FLOOR_1, + RR_GANONS_TOWER_FLOOR_2, + RR_GANONS_TOWER_FLOOR_3, + RR_GANONS_TOWER_GANONDORF_LAIR, + RR_GANONS_CASTLE_ESCAPE, + RR_GANONS_CASTLE_GANON_ARENA, + RR_MARKER_AREAS_END, // Used for area key count // DUNGEONS @@ -4562,6 +4568,8 @@ typedef enum { RE_STINGER, RE_BIG_OCTO, RE_GIBDO, + RE_GANONDORF, + RE_GANON, RE_DARK_LINK, } RandomizerEnemy; From 2603b9736632541fcf86d64af17a461f4447fc7a Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Sat, 9 Nov 2024 16:40:00 +0000 Subject: [PATCH 10/11] Rewrite MQ spirit logic (#4534) * rewrite MQ spirit logic * fix oversights --- .../randomizer/3drando/location_access.cpp | 10 +- .../randomizer/3drando/location_access.hpp | 380 +++++++++++------- .../locacc_gerudo_training_grounds.cpp | 4 +- .../location_access/locacc_spirit_temple.cpp | 380 ++++++++++++++---- .../location_access/locacc_water_temple.cpp | 4 +- soh/soh/Enhancements/randomizer/logic.cpp | 149 ++++--- soh/soh/Enhancements/randomizer/logic.h | 7 +- .../Enhancements/randomizer/randomizerTypes.h | 43 +- soh/soh/Enhancements/randomizer/settings.cpp | 2 +- 9 files changed, 685 insertions(+), 294 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access.cpp index c1c3391e2..efb15780e 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access.cpp @@ -211,6 +211,14 @@ bool Here(const RandomizerRegion region, ConditionFn condition) { return areaTable[region].Here(condition); } +bool MQSpiritSharedStatueRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge) { + return areaTable[region].MQSpiritShared(condition, false, anyAge); +} + +bool MQSpiritSharedBrokenWallRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge) { + return areaTable[region].MQSpiritShared(condition, true, anyAge); +} + bool CanPlantBean(const RandomizerRegion region) { return areaTable[region].CanPlantBeanCheck(); } @@ -256,7 +264,7 @@ void RegionTable_Init() { LOCATION(RC_SARIA_SONG_HINT, logic->CanUse(RG_SARIAS_SONG)), }, { //Exits - Entrance(RR_ROOT_EXITS, {[]{return true;}}) + Entrance(RR_ROOT_EXITS, {[]{return true;}}), }); areaTable[RR_ROOT_EXITS] = Region("Root Exits", "", {RA_LINKS_POCKET}, NO_DAY_NIGHT_CYCLE, {}, {}, { diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access.hpp b/soh/soh/Enhancements/randomizer/3drando/location_access.hpp index d3423a3ba..316280274 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access.hpp @@ -18,54 +18,54 @@ extern std::shared_ptr logic; class EventAccess { public: - explicit EventAccess(bool* event_, std::vector conditions_met_) - : event(event_) { - conditions_met.resize(2); - for (size_t i = 0; i < conditions_met_.size(); i++) { - conditions_met[i] = conditions_met_[i]; - } + explicit EventAccess(bool* event_, std::vector conditions_met_) + : event(event_) { + conditions_met.resize(2); + for (size_t i = 0; i < conditions_met_.size(); i++) { + conditions_met[i] = conditions_met_[i]; } + } - bool ConditionsMet() const { - auto ctx = Rando::Context::GetInstance(); - if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_NO_LOGIC) || ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA)) { - return true; - } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHLESS)) { - return conditions_met[0](); - } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHED)) { - if (conditions_met[0]()) { - return true; - } else if (conditions_met[1] != NULL) { - return conditions_met[1](); - } - } - return false; + bool ConditionsMet() const { + auto ctx = Rando::Context::GetInstance(); + if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_NO_LOGIC) || ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA)) { + return true; + } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHLESS)) { + return conditions_met[0](); + } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHED)) { + if (conditions_met[0]()) { + return true; + } else if (conditions_met[1] != NULL) { + return conditions_met[1](); + } } + return false; + } - bool CheckConditionAtAgeTime(bool& age, bool& time) { + bool CheckConditionAtAgeTime(bool& age, bool& time) { - logic->IsChild = false; - logic->IsAdult = false; - logic->AtDay = false; - logic->AtNight = false; + logic->IsChild = false; + logic->IsAdult = false; + logic->AtDay = false; + logic->AtNight = false; - time = true; - age = true; + time = true; + age = true; - return ConditionsMet(); - } + return ConditionsMet(); + } - void EventOccurred() { - *event = true; - } + void EventOccurred() { + *event = true; + } - bool GetEvent() const { - return *event; - } + bool GetEvent() const { + return *event; + } private: - bool* event; - std::vector conditions_met; + bool* event; + std::vector conditions_met; }; std::string CleanCheckConditionString(std::string condition); @@ -76,49 +76,49 @@ std::string CleanCheckConditionString(std::string condition); class LocationAccess { public: - explicit LocationAccess(RandomizerCheck location_, std::vector conditions_met_) - : location(location_), condition_str("") { - conditions_met.resize(2); - for (size_t i = 0; i < conditions_met_.size(); i++) { - conditions_met[i] = conditions_met_[i]; - } + explicit LocationAccess(RandomizerCheck location_, std::vector conditions_met_) + : location(location_), condition_str("") { + conditions_met.resize(2); + for (size_t i = 0; i < conditions_met_.size(); i++) { + conditions_met[i] = conditions_met_[i]; } + } - explicit LocationAccess(RandomizerCheck location_, std::vector conditions_met_, std::string condition_str_) - : location(location_), condition_str(condition_str_) { - conditions_met.resize(2); - for (size_t i = 0; i < conditions_met_.size(); i++) { - conditions_met[i] = conditions_met_[i]; - } + explicit LocationAccess(RandomizerCheck location_, std::vector conditions_met_, std::string condition_str_) + : location(location_), condition_str(condition_str_) { + conditions_met.resize(2); + for (size_t i = 0; i < conditions_met_.size(); i++) { + conditions_met[i] = conditions_met_[i]; } + } - bool GetConditionsMet() const { - auto ctx = Rando::Context::GetInstance(); - if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_NO_LOGIC) || ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA)) { - return true; - } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHLESS)) { - return conditions_met[0](); - } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHED)) { - if (conditions_met[0]()) { - return true; - } else if (conditions_met[1] != NULL) { - return conditions_met[1](); - } - } - return false; + bool GetConditionsMet() const { + auto ctx = Rando::Context::GetInstance(); + if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_NO_LOGIC) || ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_VANILLA)) { + return true; + } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHLESS)) { + return conditions_met[0](); + } else if (ctx->GetOption(RSK_LOGIC_RULES).Is(RO_LOGIC_GLITCHED)) { + if (conditions_met[0]()) { + return true; + } else if (conditions_met[1] != NULL) { + return conditions_met[1](); + } } + return false; + } - bool CheckConditionAtAgeTime(bool& age, bool& time) const; + bool CheckConditionAtAgeTime(bool& age, bool& time) const; - bool ConditionsMet() const; + bool ConditionsMet() const; - RandomizerCheck GetLocation() const { - return location; - } + RandomizerCheck GetLocation() const { + return location; + } - std::string GetConditionStr() const { - return condition_str; - } + std::string GetConditionStr() const { + return condition_str; + } protected: RandomizerCheck location; @@ -138,127 +138,199 @@ namespace Rando { class Region { public: - Region(); - Region(std::string regionName_, std::string scene_, std::set areas, + Region(); + Region(std::string regionName_, std::string scene_, std::set areas, bool timePass_, std::vector events_, std::vector locations_, std::list exits_); - ~Region(); + ~Region(); - std::string regionName; - std::string scene; - std::set areas; - bool timePass; - std::vector events; - std::vector locations; - std::list exits; - std::list entrances; - //^ The above exits are now stored in a list instead of a vector because - //the entrance randomization algorithm plays around with pointers to these - //entrances a lot. By putting the entrances in a list, we don't have to - //worry about a vector potentially reallocating itself and invalidating all our - //entrance pointers. + std::string regionName; + std::string scene; + std::set areas; + bool timePass; + std::vector events; + std::vector locations; + std::list exits; + std::list entrances; + //^ The above exits are now stored in a list instead of a vector because + //the entrance randomization algorithm plays around with pointers to these + //entrances a lot. By putting the entrances in a list, we don't have to + //worry about a vector potentially reallocating itself and invalidating all our + //entrance pointers. - bool childDay = false; - bool childNight = false; - bool adultDay = false; - bool adultNight = false; - bool addedToPool = false;; + bool childDay = false; + bool childNight = false; + bool adultDay = false; + bool adultNight = false; + bool addedToPool = false;; - void ApplyTimePass(); + void ApplyTimePass(); - bool UpdateEvents(); + bool UpdateEvents(); - void AddExit(RandomizerRegion parentKey, RandomizerRegion newExitKey, ConditionFn condition); + void AddExit(RandomizerRegion parentKey, RandomizerRegion newExitKey, ConditionFn condition); - void RemoveExit(Rando::Entrance* exitToRemove); + void RemoveExit(Rando::Entrance* exitToRemove); - void SetAsPrimary(RandomizerRegion exitToBePrimary); + void SetAsPrimary(RandomizerRegion exitToBePrimary); - Rando::Entrance* GetExit(RandomizerRegion exit); + Rando::Entrance* GetExit(RandomizerRegion exit); - bool Child() const { - return childDay || childNight; + bool Child() const { + return childDay || childNight; + } + + bool Adult() const { + return adultDay || adultNight; + } + + bool BothAgesCheck() const { + return Child() && Adult(); + } + + bool HasAccess() const { + return Child() || Adult(); + } + + bool AllAccess() const { + return childDay && childNight && adultDay && adultNight; + } + + //Check to see if an exit can be access as both ages at both times of day + bool CheckAllAccess(RandomizerRegion exitKey); + + std::set GetAllAreas() const{ + return areas; + } + +RandomizerArea GetFirstArea() const{ + if (areas.empty()){ + assert(false); + return RA_NONE; + } else { + return *areas.begin(); } + } - bool Adult() const { - return adultDay || adultNight; - } + void ReplaceAreas(std::set newAreas) { + areas = newAreas; + } - bool BothAgesCheck() const { - return Child() && Adult(); - } + //Here checks conditional access based on whether or not both ages have + //access to this area. For example: if there are rocks that block a path + //which both child and adult can access, adult having hammer can give + //both child and adult access to the path. + bool Here(ConditionFn condition) { - bool HasAccess() const { - return Child() || Adult(); - } + //store current age variables + bool pastAdult = logic->IsAdult; + bool pastChild = logic->IsChild; - bool AllAccess() const { - return childDay && childNight && adultDay && adultNight; - } + //set age access as this areas ages + logic->IsChild = Child(); + logic->IsAdult = Adult(); - //Check to see if an exit can be access as both ages at both times of day - bool CheckAllAccess(RandomizerRegion exitKey); + //heck condition as well as having at least child or adult access + bool hereVal = condition() && (logic->IsAdult || logic->IsChild); - std::set GetAllAreas() const{ - return areas; - } + //set back age variables + logic->IsChild = pastChild; + logic->IsAdult = pastAdult; - RandomizerArea GetFirstArea() const{ - if (areas.empty()){ - assert(false); - return RA_NONE; - } else { - return *areas.begin(); - } - } + return hereVal; + } - void ReplaceAreas(std::set newAreas) { - areas = newAreas; - } + bool CanPlantBeanCheck() const; + bool AllAccountedFor() const; - //Here checks conditional access based on whether or not both ages have - //access to this area. For example: if there are rocks that block a path - //which both child and adult can access, adult having hammer can give - //both child and adult access to the path. - bool Here(ConditionFn condition) { + void ResetVariables(); + void printAgeTimeAccess() const { + auto message = "Child Day: " + std::to_string(childDay) + "\t" + "Child Night: " + std::to_string(childNight) + "\t" + "Adult Day: " + std::to_string(adultDay) + "\t" + "Adult Night: " + std::to_string(adultNight); + } + +/*This logic covers checks that exist in the shared areas of MQ spirit from a glitchless standpoint. + This room has Quantum logic that I am currently handling with this function, however this is NOT suitable for glitch logic as it relies on specific ages + In this chunk there are 3 possibilities for passing a check, but first I have to talk about parallel universes. + + In MQ Spirit key logic, we mostly care about 2 possibilities for how the player can spend keys, creating 2 Parralel universes + In the first universe, the player did not enter spirit as adult until after climbing as child, thus child spends keys linearly, only needing 2 to reach statue room. + In the second universe, the player went in as adult, possibly out of logic, and started wasting the keys to lock child out. + These Universes converge when the player has 7 keys (meaning adult can no longer lock child out) and adult is known to be able to reach Statue room. This creates "Certain Access", which is tracked seperatly for each age. + Child Certain Access is simple, if we have 7 keys and child access, it's Certain Access. + Adult Certain Access is also simple, adult is not key locked, so if they make it to a location, it's Certain Access. + Things get complicated when we handle the overlap of the 2 universes, + though an important detail is that if we have Certain Access as either age, we don't need to checked the overlap because overlap logic is strictly stricter than either Certain Access. + + In order to track the first universe, the logic allows technical child access with the minimum number of keys, and then checks in this function for if we have 7 keys to determine if that is Certain or not. + This is for technical reasons, as areas with no access at all will simply not be checked. + Normally we would need to do similar shenanigans to track the second universe, however adult must have go through statue room to waste keys, + so can go back there and get new keys for Child to use if they do, and the navigation logic for shared MQ spirit from Statue Room is very simple for Adult. + Additionally, we don't need to know if adult can actually reach spirit temple or climb to statue room, because if the player can't do that, then universe 2 can't happen anyway, + and if the player does so out of logic, they can do it again, as the only consumable used sets a permanent flag. + + The Adult Navigation logic is as such: + - Broken Wall room is 6 key locked, because if the player tries to spend 6 keys in a way that would block adults access, they would have to give child access instead. + - The child side hammer switch for the time travelling chest is 7 key locked for adult + - Reaching gauntlets hand is 7 key locked + - Going back into big block room is complex, but the only check there is child only so not a concern + - Everything else is possible with basic adult movement, or is impossible for child to reach glitchlessly + Anything 7 key locked does not need to be checked as shared, as all child access is Certain and because of this workaround we don't need to fake Adult access, meaning that is also Certain. + All of this combined means that when checking if adult can reach a location in universe 2, we only have to ask if it is a 6 key locked location or not. + + Knowing all of this this, we can confirm things are logical in 3 different ways: + - If we have Adult Access, we know it is Certain Access, so they can get checks alone. + - If we have 7 keys, child has Certain Access as we know they cannot be locked out, so can get checks alone, otherwise we check the logical overlap + - If Child and Adult can get the check (ignoring actual adult access to the location), and the location is either not 6 key locked or we have 6 keys, we can get the check with the overlap*/ + bool MQSpiritShared(ConditionFn condition, bool IsBrokenWall, bool anyAge = false) { + //if we have Certain Access as child, we can check anyAge and if true, resolve a condition with Here as if adult is here it's also Certain Access + if (logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)){ + if (anyAge){ + return Here(condition); + } + return condition(); + //else, if we are here as adult, we have Certain Access from that and don't need special handling for checking adult + } else if (Adult() && logic->IsAdult){ + return condition(); + //if we do not have Certain Access, we need to check the overlap by seeing if we are both here as child and meet the adult universe's access condition + //We only need to do it as child, as only child access matters for this check, as adult access is assumed based on keys + } else if (Child() && logic->IsChild && (!IsBrokenWall || logic->SmallKeys(RR_SPIRIT_TEMPLE, 6))) { + bool result = false; //store current age variables bool pastAdult = logic->IsAdult; bool pastChild = logic->IsChild; - //set age access as this areas ages - logic->IsChild = Child(); - logic->IsAdult = Adult(); - - //heck condition as well as having at least child or adult access - bool hereVal = condition() && (logic->IsAdult || logic->IsChild); - + //First check if the check is possible as child + logic->IsChild = true; + logic->IsAdult = false; + result = condition(); + //If so, check again as adult. both have to be true for result to be true + if (result) { + logic->IsChild = false; + logic->IsAdult = true; + result = condition(); + } + //set back age variables logic->IsChild = pastChild; logic->IsAdult = pastAdult; - - return hereVal; - } - - bool CanPlantBeanCheck() const; - bool AllAccountedFor() const; - - void ResetVariables(); - - void printAgeTimeAccess() const { - auto message = "Child Day: " + std::to_string(childDay) + "\t" - "Child Night: " + std::to_string(childNight) + "\t" - "Adult Day: " + std::to_string(adultDay) + "\t" - "Adult Night: " + std::to_string(adultNight); + return result; } + return false; + } }; extern std::array areaTable; extern std::vector grottoEvents; bool Here(const RandomizerRegion region, ConditionFn condition); //RANDOTODO make a less stupid way to check own at either age than self referncing with this +bool MQSpiritSharedStatueRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge = false); +bool MQSpiritSharedBrokenWallRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge = false); bool CanPlantBean(const RandomizerRegion region); bool BothAges(const RandomizerRegion region); bool ChildCanAccess(const RandomizerRegion region); diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_gerudo_training_grounds.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_gerudo_training_grounds.cpp index f74e78a0e..93bb934f5 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_gerudo_training_grounds.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_gerudo_training_grounds.cpp @@ -209,7 +209,7 @@ void RegionTable_Init_GerudoTrainingGrounds() { areaTable[RR_GERUDO_TRAINING_GROUNDS_MQ_STATUE_ROOM] = Region("Gerudo Training Grounds MQ Statue ROom", "Gerudo Training Grounds", {RA_GERUDO_TRAINING_GROUND}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_GERUDO_TRAINING_GROUND_MQ_EYE_STATUE_CHEST, logic->CanUse(RG_FAIRY_BOW)), + LOCATION(RC_GERUDO_TRAINING_GROUND_MQ_EYE_STATUE_CHEST, logic->CanUse(RG_FAIRY_BOW)), }, { //Exits Entrance(RR_GERUDO_TRAINING_GROUNDS_MQ_STATUE_ROOM_LEDGE, {[]{return logic->CanUse(RG_LONGSHOT);}}), @@ -220,7 +220,7 @@ void RegionTable_Init_GerudoTrainingGrounds() { //Locations //implies logic->CanKillEnemy(RE_TORCH_SLUG) LOCATION(RC_GERUDO_TRAINING_GROUND_MQ_SECOND_IRON_KNUCKLE_CHEST, logic->CanKillEnemy(RE_IRON_KNUCKLE)), - LOCATION(RC_GERUDO_TRAINING_GROUND_MQ_FLAME_CIRCLE_CHEST, logic->CanHitSwitch(ED_BOOMERANG)), + LOCATION(RC_GERUDO_TRAINING_GROUND_MQ_FLAME_CIRCLE_CHEST, logic->CanHitSwitch(ED_BOMB_THROW)), }, { //Exits Entrance(RR_GERUDO_TRAINING_GROUNDS_MQ_STATUE_ROOM, {[]{return Here(RR_GERUDO_TRAINING_GROUNDS_MQ_TORCH_SLUG_ROOM, []{return logic->CanKillEnemy(RE_IRON_KNUCKLE);});}}), diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_spirit_temple.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_spirit_temple.cpp index 42be13698..cdca0eef2 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_spirit_temple.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_spirit_temple.cpp @@ -10,8 +10,8 @@ void RegionTable_Init_SpiritTemple() { ---------------------------*/ areaTable[RR_SPIRIT_TEMPLE_ENTRYWAY] = Region("Spirit Temple Entryway", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { //Exits - Entrance(RR_SPIRIT_TEMPLE_LOBBY, {[]{return ctx->GetDungeon(SPIRIT_TEMPLE)->IsVanilla();}}), - Entrance(RR_SPIRIT_TEMPLE_MQ_LOBBY, {[]{return ctx->GetDungeon(SPIRIT_TEMPLE)->IsMQ();}}), + Entrance(RR_SPIRIT_TEMPLE_LOBBY, {[]{return ctx->GetDungeon(SPIRIT_TEMPLE)->IsVanilla();}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_LOBBY, {[]{return ctx->GetDungeon(SPIRIT_TEMPLE)->IsMQ();}}), Entrance(RR_DESERT_COLOSSUS_OUTSIDE_TEMPLE, {[]{return true;}}), }); @@ -137,102 +137,340 @@ void RegionTable_Init_SpiritTemple() { if (ctx->GetDungeon(SPIRIT_TEMPLE)->IsMQ()) { areaTable[RR_SPIRIT_TEMPLE_MQ_LOBBY] = Region("Spirit Temple MQ Lobby", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_FRONT_LEFT_CHEST, true), - LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BACK_LEFT_CHEST, Here(RR_SPIRIT_TEMPLE_MQ_LOBBY, []{return logic->BlastOrSmash();}) && ((logic->IsChild && logic->CanUse(RG_FAIRY_SLINGSHOT)) || (logic->IsAdult && logic->CanUse(RG_FAIRY_BOW)))), - LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BACK_RIGHT_CHEST, logic->CanUse(RG_BOMBCHU_5) || (logic->IsAdult && (logic->CanUse(RG_FAIRY_BOW) || logic->CanUse(RG_HOOKSHOT))) || (logic->IsChild && (logic->CanUse(RG_FAIRY_SLINGSHOT) || logic->CanUse(RG_BOOMERANG)))), + LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_FRONT_LEFT_CHEST, true), + LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BACK_LEFT_CHEST, Here(RR_SPIRIT_TEMPLE_MQ_LOBBY, []{return logic->BlastOrSmash();}) && logic->CanHitEyeTargets()), + LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BACK_RIGHT_CHEST, logic->CanHitSwitch(ED_BOOMERANG)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_FRONT_RIGHT_CHEST, logic->Spirit1FSilverRupees), }, { //Exits - Entrance(RR_SPIRIT_TEMPLE_ENTRYWAY, {[]{return true;}}), - Entrance(RR_SPIRIT_TEMPLE_MQ_CHILD, {[]{return logic->IsChild;}}), - Entrance(RR_SPIRIT_TEMPLE_MQ_ADULT, {[]{return logic->CanUse(RG_BOMBCHU_5) && logic->IsAdult && logic->CanUse(RG_LONGSHOT) && logic->CanUse(RG_SILVER_GAUNTLETS);}}), + Entrance(RR_SPIRIT_TEMPLE_ENTRYWAY, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_WEST, {[]{return logic->IsChild;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_SOUTH, {[]{return logic->CanUse(RG_LONGSHOT) && logic->CanUse(RG_BOMBCHU_5);}}), }); - areaTable[RR_SPIRIT_TEMPLE_MQ_CHILD] = Region("Spirit Temple MQ Child", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + areaTable[RR_SPIRIT_TEMPLE_MQ_1F_WEST] = Region("Spirit Temple MQ 1F West", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events - EventAccess(&logic->FairyPot, {[]{return logic->FairyPot || (logic->CanUse(RG_KOKIRI_SWORD) && logic->CanUse(RG_BOMBCHU_5) && logic->CanUse(RG_FAIRY_SLINGSHOT));}}), + //not technically a rusted switch, but a boulder through a wall, but is part of the same trick on N64 + EventAccess(&logic->MQSpiritCrawlBoulder, {[]{return logic->CanUse(RG_BOMBCHU_5) || (ctx->GetTrickOption(RT_RUSTED_SWITCHES) && logic->CanUse(RG_MEGATON_HAMMER));}}), }, { //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_HAMMER_SWITCH_CHEST, Here(RR_SPIRIT_TEMPLE_MQ_ADULT, []{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanUse(RG_MEGATON_HAMMER);})), - LOCATION(RC_SPIRIT_TEMPLE_MQ_MAP_ROOM_ENEMY_CHEST, logic->CanUse(RG_KOKIRI_SWORD) && logic->CanUse(RG_BOMBCHU_5) && logic->CanUse(RG_FAIRY_SLINGSHOT) && logic->CanUse(RG_DINS_FIRE)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_MAP_CHEST, logic->CanUse(RG_KOKIRI_SWORD) || logic->CanUse(RG_BOMB_BAG)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_SILVER_BLOCK_HALLWAY_CHEST, logic->CanUse(RG_BOMBCHU_5) && logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanUse(RG_FAIRY_SLINGSHOT) && (logic->CanUse(RG_DINS_FIRE) || (Here(RR_SPIRIT_TEMPLE_MQ_ADULT, []{return logic->IsAdult && (logic->CanUse(RG_FIRE_ARROWS) || (ctx->GetTrickOption(RT_SPIRIT_MQ_FROZEN_EYE) && logic->CanUse(RG_FAIRY_BOW) && logic->CanUse(RG_SONG_OF_TIME)));})))), - //Trick: logic->CanUse(RG_BOMBCHU_5) && logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanUse(RG_FAIRY_SLINGSHOT) && (logic->CanUse(RG_DINS_FIRE) || (SPIRIT_TEMPLE_MQ_ADULT.Adult() && logic->IsAdult && (logic->CanUse(RG_FIRE_ARROWS) || (LogicSpiritMQFrozenEye && logic->CanUse(RG_FAIRY_BOW) && logic->CanUse(RG_SONG_OF_TIME))))) + LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_HAMMER_SWITCH_CHEST, logic->MQSpiritTimeTravelChest), }, { //Exits - Entrance(RR_SPIRIT_TEMPLE_MQ_SHARED, {[]{return logic->CanUse(RG_BOMBCHU_5) && logic->SmallKeys(RR_SPIRIT_TEMPLE, 2);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_SOUTH, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_1F_WEST, []{return logic->CanKillEnemy(RE_TORCH_SLUG);});}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_SOUTH, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_1F_WEST, []{return logic->CanKillEnemy(RE_TORCH_SLUG);});}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_WEST_1F_RUSTED_SWITCH, {[]{return logic->IsChild && logic->MQSpiritCrawlBoulder;}}), }); - areaTable[RR_SPIRIT_TEMPLE_MQ_ADULT] = Region("Spirit Temple MQ Adult", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + areaTable[RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_SOUTH] = Region("Spirit Temple MQ 1F Gibdo Room South", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_WEST, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_NORTH, {[]{return logic->CanUse(RG_BOMBCHU_5) && logic->CanHitEyeTargets();}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_TURNTABLE_ROOM, {[]{return logic->CanUse(RG_BOMBCHU_5) && logic->CanHitEyeTargets() && logic->CanKillEnemy(RE_GIBDO);}}), + }); + +// Room to store the 2 pots in to handle glitch logic going backwards around the loop later + areaTable[RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_NORTH] = Region("Spirit Temple MQ Gibdo Room North", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, {}); + + areaTable[RR_SPIRIT_TEMPLE_MQ_TURNTABLE_ROOM] = Region("Spirit Temple Turntable Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //For non-fairy pot items, you can also get them with rang without killing the stalfos + EventAccess(&logic->FairyPot, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_TURNTABLE_ROOM, []{return logic->CanKillEnemy(RE_STALFOS);});}}), + }, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_NORTH, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_NORTH, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_TURNTABLE_ROOM, []{return logic->CanKillEnemy(RE_STALFOS);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_NORTH] = Region("Spirit Temple MQ Map Room North", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->MQSpiritMapRoomEnemies, {[]{return logic->CanKillEnemy(RE_ANUBIS) && logic->CanKillEnemy(RE_KEESE);}}), + }, { //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_CLIMB_SOUTH_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_STATUE_ROOM_LULLABY_CHEST, logic->CanUse(RG_ZELDAS_LULLABY) && (logic->CanJumpslashExceptHammer() || logic->CanUse(RG_HOVER_BOOTS))), - LOCATION(RC_SPIRIT_TEMPLE_MQ_STATUE_ROOM_INVISIBLE_CHEST, (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH))), - LOCATION(RC_SPIRIT_TEMPLE_MQ_BEAMOS_ROOM_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 5)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_CHEST_SWITCH_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 5) && logic->CanUse(RG_SONG_OF_TIME)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_BOSS_KEY_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 5) && logic->CanUse(RG_SONG_OF_TIME) && (logic->CanUse(RG_MIRROR_SHIELD) || (ctx->GetOption(RSK_SUNLIGHT_ARROWS) && logic->CanUse(RG_LIGHT_ARROWS)))), - LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_NINE_THRONES_ROOM_WEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_NINE_THRONES_ROOM_NORTH, logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_MAP_ROOM_ENEMY_CHEST, logic->MQSpiritMapRoomEnemies), }, { //Exits - Entrance(RR_SPIRIT_TEMPLE_MQ_LOWER_ADULT, {[]{return logic->CanUse(RG_MIRROR_SHIELD) && logic->IsAdult && (logic->CanUse(RG_FIRE_ARROWS) || (ctx->GetTrickOption(RT_SPIRIT_MQ_LOWER_ADULT) && logic->CanUse(RG_DINS_FIRE) && logic->CanUse(RG_FAIRY_BOW)));}}), - //Trick: logic->CanUse(RG_MIRROR_SHIELD) && logic->IsAdult && (logic->CanUse(RG_FIRE_ARROWS) || (LogicSpiritMQLowerAdult && logic->CanUse(RG_DINS_FIRE) && logic->CanUse(RG_FAIRY_BOW))) - Entrance(RR_SPIRIT_TEMPLE_MQ_SHARED, {[]{return true;}}), - Entrance(RR_SPIRIT_TEMPLE_MQ_BOSS_AREA, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 6) && logic->CanUse(RG_ZELDAS_LULLABY) && logic->CanUse(RG_MEGATON_HAMMER);}}), - Entrance(RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 5) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanJumpslashExceptHammer() && (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH));}}), + //Stalfos room blocks you in with fire until you kill the stalfos, which won't spawn from behind the fire + Entrance(RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_SOUTH, {[]{return true;}}), }); - areaTable[RR_SPIRIT_TEMPLE_MQ_SHARED] = Region("Spirit Temple MQ Shared", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + areaTable[RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_SOUTH] = Region("Spirit Temple MQ Map Room South", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //You can lure the keese over by aggroing them with dins if you use it as close to the torch keese as possible, but it's a trick as it's not intuitive and basically never comes up + EventAccess(&logic->MQSpiritMapRoomEnemies, {[]{return logic->CanKillEnemy(RE_ANUBIS) && logic->CanKillEnemy(RE_KEESE, ED_BOOMERANG);}}), + }, { //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_CLIMB_NORTH_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 6)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_COMPASS_CHEST, (logic->IsChild && logic->CanUse(RG_FAIRY_SLINGSHOT) && logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)) || (logic->IsAdult && logic->CanUse(RG_FAIRY_BOW)) || (logic->CanUse(RG_FAIRY_BOW) && logic->CanUse(RG_FAIRY_SLINGSHOT))), - LOCATION(RC_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM_CHEST, logic->CanUse(RG_SONG_OF_TIME) || ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_SOT) || logic->IsAdult), - //Trick: logic->CanUse(RG_SONG_OF_TIME) || LogicSpiritMQSunBlockSoT || logic->IsAdult - LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_SUN_BLOCK_ROOM, (ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_GS) && logic->CanUse(RG_BOOMERANG) && (logic->CanUse(RG_SONG_OF_TIME) || ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_SOT))) || logic->IsAdult), - //Trick: (LogicSpiritMQSunBlockGS && logic->CanUse(RG_BOOMERANG) && (logic->CanUse(RG_SONG_OF_TIME) || LogicSpiritMQSunBlockSoT)) || logic->IsAdult - }, { - //Exits - Entrance(RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND, {[]{return (logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && (logic->CanUse(RG_SONG_OF_TIME) || ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_SOT) || logic->IsAdult)) || (logic->SmallKeys(RR_SPIRIT_TEMPLE, 4) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanJumpslashExceptHammer() && (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)));}}), - //Trick: (logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && (logic->CanUse(RG_SONG_OF_TIME) || LogicSpiritMQSunBlockSoT || logic->IsAdult)) || (logic->SmallKeys(RR_SPIRIT_TEMPLE, 4) && logic->CanUse(RG_SONG_OF_TIME) && (LogicLensSpiritMQ || logic->CanUse(RG_LENS_OF_TRUTH))) - Entrance(RR_DESERT_COLOSSUS, {[]{return (logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && (logic->CanUse(RG_SONG_OF_TIME) || ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_SOT) || logic->IsAdult)) || (logic->SmallKeys(RR_SPIRIT_TEMPLE, 4) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanJumpslashExceptHammer() && (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)) && logic->IsAdult);}}), - //Trick: (logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && (logic->CanUse(RG_SONG_OF_TIME) || LogicSpiritMQSunBlockSoT || logic->IsAdult)) || (logic->SmallKeys(RR_SPIRIT_TEMPLE, 4) && logic->CanUse(RG_SONG_OF_TIME) && (LogicLensSpiritMQ || logic->CanUse(RG_LENS_OF_TRUTH)) && logic->IsAdult) - }); - - areaTable[RR_SPIRIT_TEMPLE_MQ_LOWER_ADULT] = Region("Spirit Temple MQ Lower Adult", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { - //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_LEEVER_ROOM_CHEST, true), - LOCATION(RC_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM_CHEST, logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanUse(RG_MEGATON_HAMMER) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanUse(RG_EPONAS_SONG) && logic->CanUse(RG_SUNS_SONG) - && logic->CanUse(RG_SONG_OF_STORMS) && logic->CanUse(RG_ZELDAS_LULLABY)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_FRONT_RIGHT_CHEST, logic->CanUse(RG_MEGATON_HAMMER)), - LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_LEEVER_ROOM, true), - LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_SYMPHONY_ROOM, logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanUse(RG_MEGATON_HAMMER) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanUse(RG_EPONAS_SONG) && logic->CanUse(RG_SUNS_SONG) - && logic->CanUse(RG_SONG_OF_STORMS) && logic->CanUse(RG_ZELDAS_LULLABY)), - }, {}); - - areaTable[RR_SPIRIT_TEMPLE_MQ_BOSS_AREA] = Region("Spirit Temple MQ Boss Region", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { - //Locations - LOCATION(RC_SPIRIT_TEMPLE_MQ_MIRROR_PUZZLE_INVISIBLE_CHEST, ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_MAP_CHEST, true), }, { //Exits - Entrance(RR_SPIRIT_TEMPLE_MQ_INSIDE_STATUE_HEAD, {[]{return logic->CanUse(RG_MIRROR_SHIELD) && logic->CanUse(RG_HOOKSHOT);}}), + //The bridge is a temp flag, so not a way to cross south to north in logic + Entrance(RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_NORTH, {[]{return logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_WEST, {[]{return true;}}), }); - areaTable[RR_SPIRIT_TEMPLE_MQ_INSIDE_STATUE_HEAD] = - Region("Spirit Temple MQ Inside Statue Head", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, - { - // Exits - Entrance(RR_SPIRIT_TEMPLE_MQ_SHARED, { [] { return true; } }), - Entrance(RR_SPIRIT_TEMPLE_BOSS_ENTRYWAY, { [] { return logic->HasItem(RG_SPIRIT_TEMPLE_BOSS_KEY); } }), - }); + areaTable[RR_SPIRIT_TEMPLE_MQ_WEST_1F_RUSTED_SWITCH] = Region("Spirit Temple MQ West 1F Rusted Switch", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + EventAccess(&logic->MQSpiritTimeTravelChest, {[]{return logic->CanUse(RG_MEGATON_HAMMER);}}), + EventAccess(&logic->MQSpiritCrawlBoulder, {[]{return logic->CanUse(RG_BOMBCHU_5) || (ctx->GetTrickOption(RT_RUSTED_SWITCHES) && logic->CanUse(RG_MEGATON_HAMMER));}}), + }, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_WEST, {[]{return logic->IsChild && logic->MQSpiritCrawlBoulder;}}), + //This tracks possible child access, if adult has not entered STATUE_ROOM. Certain Child Access is checked for separately as 7 Keys + Entrance(RR_SPIRIT_TEMPLE_MQ_UNDER_LIKE_LIKE, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 1);}}), + }); - areaTable[RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND] = Region("Spirit Temple MQ Mirror Shield Hand", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { +//THIS REGION NEEDS MQSpiritSharedBrokenWallRoom WHEN ADDING THE POT + areaTable[RR_SPIRIT_TEMPLE_MQ_UNDER_LIKE_LIKE] = Region("Spirit Temple MQ Under Like Like", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + //This covers adult access only, as child arrives here from the other side of this door + Entrance(RR_SPIRIT_TEMPLE_MQ_WEST_1F_RUSTED_SWITCH, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_BROKEN_WALL_ROOM, {[]{return logic->CanHitSwitch();}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BROKEN_WALL_ROOM] = Region("Spirit Temple MQ Broken Wall Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations - LOCATION(RC_SPIRIT_TEMPLE_MIRROR_SHIELD_CHEST, true), - }, {}); + //Implies CanKillEnemy(RE_LIKE_LIKE) + LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_CLIMB_NORTH_CHEST, MQSpiritSharedBrokenWallRoom(RR_SPIRIT_TEMPLE_MQ_BROKEN_WALL_ROOM, []{return logic->CanKillEnemy(RE_BEAMOS);})), + //Sunlights only temp spawn this chest, which is unintuitive/a bug. + //chest is only reachable as adult glitchlessly, so we can skip the shared in favour of IsAdult as adult access is always Certain + LOCATION(RC_SPIRIT_TEMPLE_MQ_CHILD_CLIMB_SOUTH_CHEST, logic->IsAdult && logic->HasExplosives() && (ctx->GetOption(RSK_SUNLIGHT_ARROWS) && logic->CanUse(RG_LIGHT_ARROWS)) && logic->CanUse(RG_HOOKSHOT)), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_UNDER_LIKE_LIKE, {[]{return logic->CanHitSwitch();}}), + //This exit only governs child possible access, adult access starts on the other side so never checks this + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 2);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM] = Region("Spirit Temple MQ Statue Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_COMPASS_CHEST, MQSpiritSharedStatueRoom(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, []{return logic->CanHitEyeTargets();})), + }, { + //Exits + //we check possible adult access directly in MQSpiritSharedBrokenWallRoom, so this exit only covers Certain Access + Entrance(RR_SPIRIT_TEMPLE_MQ_BROKEN_WALL_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + //We can use Here instead of Shared here because adult will never need to rely on child access to reach this room, and adult access is Certain + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_NORTH, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, []{return logic->HasFireSource() || (ctx->GetTrickOption(RT_SPIRIT_MQ_FROZEN_EYE) && logic->CanUse(RG_FAIRY_BOW) && logic->CanUse(RG_SONG_OF_TIME));});}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM, {[]{return logic->IsAdult || ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_SOT) || logic->CanUse(RG_SONG_OF_TIME);}}), + //explicit adult check here is a precaution against possible child logic leaking, child with a hookshot can do this + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM_EAST, {[]{return logic->IsAdult && logic->CanUse(RG_HOOKSHOT);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM] = Region("Spirit Temple MQ Sun Block Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + //We don't need Shared here because If we are checking as child, universe 2 adult access needs nothing so it always passes, and if we are checking as adult, it is Certain Access + LOCATION(RC_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM_CHEST, true), + LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_SUN_BLOCK_ROOM, MQSpiritSharedStatueRoom(RR_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM, []{return logic->CanUse(RG_HOOKSHOT) || (ctx->GetTrickOption(RT_SPIRIT_MQ_SUN_BLOCK_GS) && logic->CanUse(RG_BOOMERANG));})), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, {[]{return true;}}), + //This door causes the Universes to merge as it requires 7 keys for both ages + Entrance(RR_SPIRIT_TEMPLE_MQ_WEST_IRON_KNUCKLE, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_WEST_IRON_KNUCKLE] = Region("Spirit Temple MQ East Iron Knuckle", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND, {[]{return logic->CanKillEnemy(RE_IRON_KNUCKLE);}}), + }); areaTable[RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND] = Region("Spirit Temple MQ Silver Gauntlets Hand", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { //Locations LOCATION(RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST, true), - }, {}); + }, { + //Exits + //If it is ever relevent for 1 age to spawn the mirror shield chest for the other can longshot across, it needs an eventAccess + Entrance(RR_SPIRIT_TEMPLE_MQ_WEST_IRON_KNUCKLE, {[]{return true;}}), + Entrance(RR_DESERT_COLOSSUS, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_SOUTH] = Region("Spirit Temple MQ Block Room South", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_LOBBY, {[]{return true;}}), + //The block here is unusual in that it is a permanent flag, but reset anyway as child. This is because there's a check that would be blocked off by pushing them otherwise + //It may be worth considering making this always temp in future so adult doesn't have the same issue + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_NORTH, {[]{return logic->IsChild ? logic->CanUse(RG_SILVER_GAUNTLETS) : Here(RR_SPIRIT_TEMPLE_MQ_LOBBY, []{return logic->CanUse(RG_SILVER_GAUNTLETS);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_NORTH] = Region("Spirit Temple MQ Block Room North", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + //Does not need to be shared as it's hard child locked, because adult pushing the block is a permanent flag that blocks the eye target and cannot be undone + LOCATION(RC_SPIRIT_TEMPLE_MQ_SILVER_BLOCK_HALLWAY_CHEST, logic->IsChild && logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) && logic->CanHitEyeTargets()), + }, { + //Exits + //if going to RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_SOUTH from here is ever relevant, there needs to be an event to handle the block + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM_EAST] = Region("Spirit Temple MQ Statue Room East", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_STATUE_ROOM_LULLABY_CHEST, logic->CanUse(RG_HOOKSHOT) & logic->CanUse(RG_ZELDAS_LULLABY) && (logic->CanJumpslash() || logic->CanUse(RG_HOVER_BOOTS))), + LOCATION(RC_SPIRIT_TEMPLE_MQ_STATUE_ROOM_INVISIBLE_CHEST, (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)) && (logic->CanUse(RG_HOOKSHOT) || logic->CanUse(RG_HOVER_BOOTS))), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, {[]{return true;}}), + //!QUANTUM LOGIC! + //We only need 4 keys, access to Shield hand and longshot to reach Gauntlets hand, as if we waste the 5th key we have given ourselves Gauntlets hand access through child climb + //This exit handles that possibility as cleanly as possible without quantum logic, but will not survive glitch logic + //logic->CanKillEnemy(RE_FLOORMASTER) is implied + Entrance(RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 4) && + logic->CanAvoidEnemy(RE_BEAMOS, true, 4) && logic->CanUse(RG_SONG_OF_TIME) && + logic->CanJumpslash() && + (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)) && + logic->CanKillEnemy(RE_IRON_KNUCKLE) && + logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_FOUR_BEAMOS_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 5) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_2F, {[]{return logic->CanUse(RG_FIRE_ARROWS) || (ctx->GetTrickOption(RT_SPIRIT_MQ_LOWER_ADULT) && logic->CanUse(RG_DINS_FIRE));}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_2F] = Region("Spirit Temple MQ Three Suns Room 2F", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //implies logic->CanKillEnemy(RE_WALLMASTER). If we have lights, we can kill stalfos and wallmasters with bow + EventAccess(&logic->MQSpirit3SunsEnemies, {[]{return (logic->CanUse(RG_MIRROR_SHIELD) && logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 2)) || + (ctx->GetOption(RSK_SUNLIGHT_ARROWS) && logic->CanUse(RG_LIGHT_ARROWS));}}), + }, {}, { + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM_EAST, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_1F, {[]{return logic->MQSpirit3SunsEnemies;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_1F] = Region("Spirit Temple MQ Three Suns Room 1F", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + Entrance(RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_2F, {[]{return logic->MQSpirit3SunsEnemies;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_EAST, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_1F_EAST] = Region("Spirit Temple MQ 1F East", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, { + //Events + //Assumes RR_SPIRIT_TEMPLE_MQ_LOBBY access + EventAccess(&logic->Spirit1FSilverRupees, {[]{return logic->CanUse(RG_MEGATON_HAMMER);}}), + }, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_LOBBY, {[]{return logic->CanUse(RG_MEGATON_HAMMER);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_1F, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_LEEVER_ROOM, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_LEEVER_ROOM] = Region("Spirit Temple MQ Leever Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_LEEVER_ROOM_CHEST, logic->CanKillEnemy(RE_PURPLE_LEEVER) && logic->CanUse(RG_HOOKSHOT)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_LEEVER_ROOM, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA, ED_BOOMERANG)), + }, { + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_EAST, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM] = Region("Spirit Temple MQ Symphony Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_1F_EAST, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + //Implies CanPassEnemy(RE_MOBLIN_CHIEF) + Entrance(RR_SPIRIT_TEMPLE_MQ_AFTER_SYMPHONY_ROOM, {[]{return logic->CanUse(RG_MEGATON_HAMMER) && logic->CanUse(RG_SONG_OF_TIME) && logic->CanUse(RG_EPONAS_SONG) && + logic->CanUse(RG_SUNS_SONG) && logic->CanUse(RG_SONG_OF_STORMS) && logic->CanUse(RG_ZELDAS_LULLABY);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_AFTER_SYMPHONY_ROOM] = Region("Spirit Temple MQ After Symphony Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM_CHEST, logic->CanPassEnemy(RE_BIG_SKULLTULA)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_SYMPHONY_ROOM, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA, ED_BOOMERANG)), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_FOUR_BEAMOS_ROOM] = Region("Spirit Temple MQ Four Beamos Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_BEAMOS_ROOM_CHEST, logic->CanKillEnemy(RE_BEAMOS)), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM_EAST, {[]{return logic->CanAvoidEnemy(RE_BEAMOS, true, 4) && logic->CanUse(RG_SONG_OF_TIME) && logic->SmallKeys(RR_SPIRIT_TEMPLE, 5) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM, {[]{return logic->CanAvoidEnemy(RE_BEAMOS, true, 4) && logic->CanUse(RG_SONG_OF_TIME);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_WALL, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 6);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM] = Region("Spirit Temple MQ SoT Sun Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_CHEST_SWITCH_CHEST, true), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_FOUR_BEAMOS_ROOM, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND, {[]{return logic->CanJumpslash();}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_3F_GIBDO_ROOM, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM, []{return (logic->IsAdult || logic->CanUse(RG_SONG_OF_TIME)) && logic->CanUse(RG_MIRROR_SHIELD);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND] = Region("Spirit Temple MQ East Stairs to Hand", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_EAST_IRON_KNUCKLE, {[]{return (ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)) && + Here(RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND, []{return logic->CanKillEnemy(RE_FLOORMASTER);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_EAST_IRON_KNUCKLE] = Region("Spirit Temple MQ East Iron Knuckle", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND, []{return logic->CanKillEnemy(RE_IRON_KNUCKLE);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND] = Region("Spirit Temple MQ Mirror Shield Hand", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MIRROR_SHIELD_CHEST, true), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND, {[]{return logic->CanUse(RG_LONGSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_EAST_IRON_KNUCKLE, {[]{return true;}}), + Entrance(RR_DESERT_COLOSSUS, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_3F_GIBDO_ROOM] = Region("Spirit Temple MQ 3F Gibdo Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_BOSS_KEY_CHEST, true), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BIG_WALL] = Region("Spirit Temple MQ Big Wall", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_FOUR_BEAMOS_ROOM, {[]{return true;}}), + //technically we only need to avoid them, but the sheer height and the moving walls makes getting to the top after only stunning them very difficult/impossible + //The silver rupees are irrelevant without silver shuffle + Entrance(RR_SPIRIT_TEMPLE_MQ_4F_CENTRAL, {[]{return logic->CanKillEnemy(RE_KEESE);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_4F_CENTRAL] = Region("Spirit Temple MQ 4F Central", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_WALL, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_NINE_CHAIRS_ROOM, {[]{return logic->SmallKeys(RR_SPIRIT_TEMPLE, 7);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_ROOM, {[]{return logic->CanUse(RG_ZELDAS_LULLABY);}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_NINE_CHAIRS_ROOM] = Region("Spirit Temple MQ Nine Chairs Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + //These skulls rely on the iron knuckle existing without a trick to shoot through the chairs + LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_NINE_THRONES_ROOM_WEST, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA, ED_BOOMERANG)), + LOCATION(RC_SPIRIT_TEMPLE_MQ_GS_NINE_THRONES_ROOM_NORTH, logic->CanGetEnemyDrop(RE_GOLD_SKULLTULA)), + }, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_4F_CENTRAL, {[]{return true;}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_ROOM] = Region("Spirit Temple MQ Big Mirror Room", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + //Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_4F_CENTRAL, {[]{return true;}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_CAVE, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_ROOM, []{return logic->CanUse(RG_MEGATON_HAMMER);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_CAVE] = Region("Spirit Temple MQ Big Mirror Cave", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, { + //Locations + LOCATION(RC_SPIRIT_TEMPLE_MQ_MIRROR_PUZZLE_INVISIBLE_CHEST, ctx->GetTrickOption(RT_LENS_SPIRIT_MQ) || logic->CanUse(RG_LENS_OF_TRUTH)), + }, { + //Exits + //If it's ever relevant to longshot into head from lobby, this needs to be an event access + Entrance(RR_SPIRIT_TEMPLE_MQ_INSIDE_STATUE_HEAD, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_CAVE, []{return logic->CanUse(RG_MIRROR_SHIELD);}) && logic->CanUse(RG_HOOKSHOT);}}), + Entrance(RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, {[]{return Here(RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_CAVE, []{return logic->CanUse(RG_MIRROR_SHIELD);});}}), + }); + + areaTable[RR_SPIRIT_TEMPLE_MQ_INSIDE_STATUE_HEAD] = Region("Spirit Temple MQ Inside Statue Head", "Spirit Temple", {RA_SPIRIT_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, { + // Exits + Entrance(RR_SPIRIT_TEMPLE_MQ_LOBBY, {[]{return true;} }), + Entrance(RR_SPIRIT_TEMPLE_BOSS_ENTRYWAY, {[]{return logic->HasItem(RG_SPIRIT_TEMPLE_BOSS_KEY);}}), + }); } /*--------------------------- diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp index 3a2559474..48052e81d 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_water_temple.cpp @@ -475,7 +475,7 @@ void RegionTable_Init_WaterTemple() { areaTable[RR_WATER_TEMPLE_MQ_STALFOS_PIT] = Region("Water Temple MQ Stalfos Pit", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, { //Events EventAccess(&logic->MQWaterStalfosPit, {[]{return ((logic->IsAdult && logic->CanKillEnemy(RE_STALFOS, ED_CLOSE, true, 3, false, true)) || - (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_HOOKSHOT) && logic->CanKillEnemy(RE_STALFOS, ED_BOOMERANG, true, 3, false, true)));}}), + (logic->CanUse(RG_IRON_BOOTS) && logic->CanUse(RG_HOOKSHOT) && logic->CanKillEnemy(RE_STALFOS, ED_BOMB_THROW, true, 3, false, true)));}}), }, {}, { //Exits Entrance(RR_WATER_TEMPLE_MQ_WATERFALL, {[]{return logic->MQWaterStalfosPit && logic->CanUse(RG_HOOKSHOT) && (logic->IsAdult || logic->CanUse(RG_IRON_BOOTS) && logic->WaterTimer() >= 8);}}), @@ -577,7 +577,7 @@ void RegionTable_Init_WaterTemple() { LOCATION(RC_WATER_TEMPLE_MQ_BOSS_KEY_CHEST, true), }, { //Exits - Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, {[]{return logic->CanHitSwitch(ED_BOOMERANG) || logic->CanUse(RG_HOVER_BOOTS);}}), + Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_SWITCH, {[]{return logic->CanHitSwitch(ED_BOMB_THROW) || logic->CanUse(RG_HOVER_BOOTS);}}), Entrance(RR_WATER_TEMPLE_MQ_BOSS_KEY_ROOM_PIT, {[]{return true;}}), Entrance(RR_WATER_TEMPLE_MQ_B1_GATE_SWITCH, {[]{return logic->HasItem(RG_SILVER_SCALE) || (logic->CanUse(RG_IRON_BOOTS) && (logic->HasItem(RG_BRONZE_SCALE) || (logic->WaterTimer() >= 24 && logic->CanUse(RG_LONGSHOT))));}}), }); diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 62a0c3995..15aaa4487 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -434,12 +434,15 @@ namespace Rando { case ED_LONG_JUMPSLASH: killed = killed || CanUse(RG_BIGGORON_SWORD) || CanUse(RG_STICKS); [[fallthrough]]; + case ED_BOMB_THROW: + killed = killed || CanUse(RG_BOMB_BAG); + [[fallthrough]]; case ED_BOOMERANG: - //RANDOTODO test dins, bomb and chu range in a practical example - killed = killed || CanUse(RG_BOMB_BAG) || CanUse(RG_DINS_FIRE); + //RANDOTODO test dins and chu range in a practical example + killed = killed || CanUse(RG_DINS_FIRE); [[fallthrough]]; case ED_HOOKSHOT: - //RANDOTODO test dins, bomb and chu range in a practical example + //RANDOTODO test dins and chu range in a practical example killed = killed || CanUse(RG_HOOKSHOT) || (wallOrFloor && CanUse(RG_BOMBCHU_5)); [[fallthrough]]; case ED_LONGSHOT: @@ -467,9 +470,13 @@ namespace Rando { case ED_LONG_JUMPSLASH: killed = killed || CanUse(RG_BIGGORON_SWORD) || CanUse(RG_STICKS); [[fallthrough]]; + case ED_BOMB_THROW: + //RANDOTODO test dins and chu range in a practical example + killed = killed || (!inWater && CanUse(RG_BOMB_BAG)); + [[fallthrough]]; case ED_BOOMERANG: - //RANDOTODO test dins, bomb and chu range in a practical example - killed = killed || CanUse(RG_BOOMERANG) || (!inWater && CanUse(RG_BOMB_BAG)); + //RANDOTODO test dins and chu range in a practical example + killed = killed || CanUse(RG_BOOMERANG); [[fallthrough]]; case ED_HOOKSHOT: //RANDOTODO test dins, bomb and chu range in a practical example @@ -508,12 +515,12 @@ namespace Rando { case ED_LONG_JUMPSLASH: killed = killed || CanUse(RG_BIGGORON_SWORD) || (quantity <= 1 && CanUse(RG_STICKS)); [[fallthrough]]; - case ED_BOOMERANG: - //RANDOTODO test dins, bomb and chu range in a practical example + case ED_BOMB_THROW: killed = killed || (quantity <= 2 && !timer && !inWater && (CanUse(RG_NUTS) || HookshotOrBoomerang()) && CanUse(RG_BOMB_BAG)); [[fallthrough]]; + case ED_BOOMERANG: case ED_HOOKSHOT: - //RANDOTODO test dins, bomb and chu range in a practical example + //RANDOTODO test dins and chu range in a practical example killed = killed || (wallOrFloor && CanUse(RG_BOMBCHU_5)); [[fallthrough]]; case ED_LONGSHOT: @@ -535,6 +542,7 @@ namespace Rando { return CanUse(RG_MEGATON_HAMMER) || CanUse(RG_HOOKSHOT) || (HasExplosives() && (CanJumpslashExceptHammer() || CanUse(RG_FAIRY_BOW) || CanUse(RG_FAIRY_SLINGSHOT) || CanUse(RG_BOOMERANG))); case RE_WOLFOS: case RE_WHITE_WOLFOS: + case RE_WALLMASTER: return CanJumpslash() || CanUse(RG_FAIRY_BOW) || CanUse(RG_FAIRY_SLINGSHOT) || CanUse(RG_BOMBCHU_5) || CanUse(RG_DINS_FIRE) || (CanUse(RG_BOMB_BAG) && (CanUse(RG_NUTS) || CanUse(RG_HOOKSHOT) || CanUse(RG_BOOMERANG))); case RE_GIBDO: case RE_REDEAD: @@ -568,10 +576,11 @@ namespace Rando { case ED_LONG_JUMPSLASH: killed = killed || CanUse(RG_BIGGORON_SWORD) || CanUse(RG_STICKS); [[fallthrough]]; - case ED_BOOMERANG: - //RANDOTODO test dins, bomb and chu range in a practical example + case ED_BOMB_THROW: + //RANDOTODO test dins and chu range in a practical example killed = killed || (!inWater && CanUse(RG_BOMB_BAG)); [[fallthrough]]; + case ED_BOOMERANG: case ED_HOOKSHOT: //RANDOTODO test dins, bomb and chu range in a practical example killed = killed || CanUse(RG_HOOKSHOT) || (wallOrFloor && CanUse(RG_BOMBCHU_5)); @@ -601,6 +610,16 @@ namespace Rando { case RE_DARK_LINK: //RANDOTODO Dark link is buggy right now, retest when he is not return CanJumpslash() || CanUse(RG_FAIRY_BOW); + case RE_ANUBIS: + //there's a restoration that allows beating them with mirror shield + some way to trigger thier attack + return HasFireSource(); + case RE_BEAMOS: + return HasExplosives(); + case RE_PURPLE_LEEVER: + //dies on it's own, so this is the conditions to spawn it (killing 10 normal leevers) + //Sticks and Ice arrows work but will need ammo capacity logic + //other mothods can damage them but not kill them, and they run when hit, making them impractical + return CanUse(RG_MASTER_SWORD) || CanUse(RG_BIGGORON_SWORD); default: SPDLOG_ERROR("CanKillEnemy reached `default`."); assert(false); @@ -637,6 +656,9 @@ namespace Rando { case RE_FREEZARD: case RE_SPIKE: case RE_DARK_LINK: + case RE_ANUBIS: + case RE_WALLMASTER: + case RE_PURPLE_LEEVER: return true; case RE_BIG_SKULLTULA: //hammer jumpslash can pass, but only on flat land where you can kill with hammer swing @@ -660,48 +682,56 @@ namespace Rando { } //Can we avoid this enemy while climbing up a wall, or doing a difficult platforming challenge? - bool Logic::CanAvoidEnemy(RandomizerEnemy enemy) { - if (CanKillEnemy(enemy)){ - return true; - } - switch(enemy) { - case RE_GOLD_SKULLTULA: - case RE_GOHMA_LARVA: - case RE_LIZALFOS: - case RE_DODONGO: //RANDOTODO do dodongos block the way in tight corridors? - case RE_BIG_SKULLTULA: - case RE_DEAD_HAND: - case RE_DEKU_BABA: - case RE_WITHERED_DEKU_BABA: - case RE_LIKE_LIKE: - case RE_STALFOS: - case RE_IRON_KNUCKLE: - case RE_FLARE_DANCER: - case RE_WOLFOS: - case RE_WHITE_WOLFOS: - case RE_FLOORMASTER: - case RE_REDEAD: - case RE_MEG: - case RE_ARMOS: - case RE_GREEN_BUBBLE: - case RE_FREEZARD: - case RE_SPIKE: - case RE_BIG_OCTO: - case RE_GIBDO: - case RE_DARK_LINK: - return true; - case RE_MAD_SCRUB: - case RE_KEESE: - case RE_FIRE_KEESE: - return CanUse(RG_NUTS); - case RE_BLUE_BUBBLE: - //RANDOTODO Trick to use shield hylian shield as child to stun these guys - return CanUse(RG_NUTS) || HookshotOrBoomerang() || CanStandingShield(); - default: - SPDLOG_ERROR("CanPassEnemy reached `default`."); - assert(false); - return false; - } +//use grounded if the challenge is such that the enemy interfears even if it cannot hit link out of the air + bool Logic::CanAvoidEnemy(RandomizerEnemy enemy, bool grounded, uint8_t quantity) { + //DISTANCE AND WALL ASSUMED, add more arguments later if needed + if (CanKillEnemy(enemy, ED_CLOSE, true, quantity)){ + return true; + } + switch(enemy) { + case RE_GOLD_SKULLTULA: + case RE_GOHMA_LARVA: + case RE_LIZALFOS: + case RE_DODONGO: + case RE_BIG_SKULLTULA: + case RE_DEAD_HAND: + case RE_DEKU_BABA: + case RE_WITHERED_DEKU_BABA: + case RE_LIKE_LIKE: + case RE_STALFOS: + case RE_IRON_KNUCKLE: + case RE_FLARE_DANCER: + case RE_WOLFOS: + case RE_WHITE_WOLFOS: + case RE_FLOORMASTER: + case RE_REDEAD: + case RE_MEG: + case RE_ARMOS: + case RE_GREEN_BUBBLE: + case RE_FREEZARD: + case RE_SPIKE: + case RE_BIG_OCTO: + case RE_GIBDO: + case RE_DARK_LINK: + case RE_WALLMASTER: + case RE_ANUBIS: + case RE_PURPLE_LEEVER: + return true; + case RE_BEAMOS: + return !grounded || CanUse(RG_NUTS) || (quantity == 1 && (CanUse(RG_FAIRY_BOW) || CanUse(RG_FAIRY_SLINGSHOT))); + case RE_MAD_SCRUB: + return !grounded || CanUse(RG_NUTS); + case RE_KEESE: + case RE_FIRE_KEESE: + return CanUse(RG_NUTS); + case RE_BLUE_BUBBLE: + //RANDOTODO Trick to use shield hylian shield as child to stun these guys + return !grounded || CanUse(RG_NUTS) || HookshotOrBoomerang() || CanStandingShield(); + default: + SPDLOG_ERROR("CanPassEnemy reached `default`."); + assert(false); + return false; + } } bool Logic::CanGetEnemyDrop(RandomizerEnemy enemy, EnemyDistance distance, bool aboveLink) { @@ -719,6 +749,7 @@ namespace Rando { case ED_SHORT_JUMPSLASH: case ED_MASTER_SWORD_JUMPSLASH: case ED_LONG_JUMPSLASH: + case ED_BOMB_THROW: case ED_BOOMERANG: drop = drop || CanUse(RG_BOOMERANG); [[fallthrough]]; @@ -729,9 +760,10 @@ namespace Rando { drop = drop || CanUse(RG_LONGSHOT); [[fallthrough]]; case ED_FAR: - return drop; + break; //RANDOTODO double check all jumpslash kills that might be out of jump/backflip range } + return drop; break; case RE_KEESE: case RE_FIRE_KEESE: @@ -843,12 +875,14 @@ namespace Rando { case ED_LONG_JUMPSLASH: hit = hit || CanUse(RG_BIGGORON_SWORD) || CanUse(RG_STICKS); [[fallthrough]]; + case ED_BOMB_THROW: + hit = hit || (!inWater && CanUse(RG_BOMB_BAG)); + [[fallthrough]]; case ED_BOOMERANG: - //RANDOTODO test bomb and chu range in a practical example - hit = hit || CanUse(RG_BOOMERANG) || (!inWater && CanUse(RG_BOMB_BAG)) ; + hit = hit || CanUse(RG_BOOMERANG); [[fallthrough]]; case ED_HOOKSHOT: - //RANDOTODO test bomb and chu range in a practical example + //RANDOTODO test chu range in a practical example hit = hit || CanUse(RG_HOOKSHOT) || CanUse(RG_BOMBCHU_5) ; [[fallthrough]]; case ED_LONGSHOT: @@ -2121,6 +2155,9 @@ namespace Rando { MQWaterB1Switch = false; //MQWaterPillarSoTBlock = false; MQWaterOpenedPillarB1 = false; + MQSpiritCrawlBoulder = false; + MQSpiritMapRoomEnemies = false; + MQSpirit3SunsEnemies = false; StopPerformanceTimer(PT_LOGIC_RESET); } diff --git a/soh/soh/Enhancements/randomizer/logic.h b/soh/soh/Enhancements/randomizer/logic.h index 141cc4139..de800c3bb 100644 --- a/soh/soh/Enhancements/randomizer/logic.h +++ b/soh/soh/Enhancements/randomizer/logic.h @@ -166,6 +166,11 @@ class Logic { bool MQWaterB1Switch = false; //bool MQWaterPillarSoTBlock = false; should be irrelevant. SHOULD. bool MQWaterOpenedPillarB1 = false; + bool MQSpiritCrawlBoulder = false; + bool MQSpiritMapRoomEnemies = false; + bool MQSpiritTimeTravelChest = false; + bool MQSpirit3SunsEnemies = false; + bool Spirit1FSilverRupees = false; /* --- END OF HELPERS AND LOCATION ACCESS --- */ @@ -181,7 +186,7 @@ class Logic { bool CanEquipSwap(RandomizerGet itemName); bool CanKillEnemy(RandomizerEnemy enemy, EnemyDistance distance = ED_CLOSE, bool wallOrFloor = true, uint8_t quantity = 1, bool timer = false, bool inWater = false); bool CanPassEnemy(RandomizerEnemy enemy, EnemyDistance distance = ED_CLOSE, bool wallOrFloor = true); - bool CanAvoidEnemy(RandomizerEnemy enemy); + bool CanAvoidEnemy(RandomizerEnemy enemy, bool grounded = false, uint8_t quantity = 1); bool CanGetEnemyDrop(RandomizerEnemy enemy, EnemyDistance distance = ED_CLOSE, bool aboveLink = false); bool CanBreakMudWalls(); bool CanGetDekuBabaSticks(); diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index ffaf8e965..4cda80c37 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -808,13 +808,39 @@ typedef enum { RR_SPIRIT_TEMPLE_INSIDE_STATUE_HEAD, RR_SPIRIT_TEMPLE_MQ_LOBBY, - RR_SPIRIT_TEMPLE_MQ_CHILD, - RR_SPIRIT_TEMPLE_MQ_ADULT, - RR_SPIRIT_TEMPLE_MQ_SHARED, - RR_SPIRIT_TEMPLE_MQ_LOWER_ADULT, - RR_SPIRIT_TEMPLE_MQ_BOSS_AREA, - RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND, + RR_SPIRIT_TEMPLE_MQ_1F_WEST, + RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_NORTH, + RR_SPIRIT_TEMPLE_MQ_1F_GIBDO_ROOM_SOUTH, + RR_SPIRIT_TEMPLE_MQ_TURNTABLE_ROOM, + RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_NORTH, + RR_SPIRIT_TEMPLE_MQ_MAP_ROOM_SOUTH, + RR_SPIRIT_TEMPLE_MQ_WEST_1F_RUSTED_SWITCH, + RR_SPIRIT_TEMPLE_MQ_UNDER_LIKE_LIKE, + RR_SPIRIT_TEMPLE_MQ_BROKEN_WALL_ROOM, + RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM, + RR_SPIRIT_TEMPLE_MQ_SUN_BLOCK_ROOM, + RR_SPIRIT_TEMPLE_MQ_WEST_IRON_KNUCKLE, RR_SPIRIT_TEMPLE_MQ_SILVER_GAUNTLETS_HAND, + RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_SOUTH, + RR_SPIRIT_TEMPLE_MQ_BIG_BLOCK_ROOM_NORTH, + RR_SPIRIT_TEMPLE_MQ_STATUE_ROOM_EAST, + RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_2F, + RR_SPIRIT_TEMPLE_MQ_THREE_SUNS_ROOM_1F, + RR_SPIRIT_TEMPLE_MQ_1F_EAST, + RR_SPIRIT_TEMPLE_MQ_LEEVER_ROOM, + RR_SPIRIT_TEMPLE_MQ_SYMPHONY_ROOM, + RR_SPIRIT_TEMPLE_MQ_AFTER_SYMPHONY_ROOM, + RR_SPIRIT_TEMPLE_MQ_FOUR_BEAMOS_ROOM, + RR_SPIRIT_TEMPLE_MQ_SOT_SUN_ROOM, + RR_SPIRIT_TEMPLE_MQ_EAST_STAIRS_TO_HAND, + RR_SPIRIT_TEMPLE_MQ_EAST_IRON_KNUCKLE, + RR_SPIRIT_TEMPLE_MQ_MIRROR_SHIELD_HAND, + RR_SPIRIT_TEMPLE_MQ_3F_GIBDO_ROOM, + RR_SPIRIT_TEMPLE_MQ_BIG_WALL, + RR_SPIRIT_TEMPLE_MQ_4F_CENTRAL, + RR_SPIRIT_TEMPLE_MQ_NINE_CHAIRS_ROOM, + RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_ROOM, + RR_SPIRIT_TEMPLE_MQ_BIG_MIRROR_CAVE, RR_SPIRIT_TEMPLE_MQ_INSIDE_STATUE_HEAD, RR_SPIRIT_TEMPLE_BOSS_ENTRYWAY, @@ -4571,6 +4597,10 @@ typedef enum { RE_GANONDORF, RE_GANON, RE_DARK_LINK, + RE_ANUBIS, + RE_BEAMOS, + RE_WALLMASTER, + RE_PURPLE_LEEVER, } RandomizerEnemy; //RANDOTODO compare child long jumpslash range with adult short @@ -4581,6 +4611,7 @@ typedef enum { ED_MASTER_SWORD_JUMPSLASH, //sticks or BGS ED_LONG_JUMPSLASH, + ED_BOMB_THROW, ED_BOOMERANG, ED_HOOKSHOT, ED_LONGSHOT, diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index f82d1d2ab..56c1a8111 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -445,7 +445,7 @@ void Settings::CreateOptions() { mTrickOptions[RT_WATER_BK_REGION] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::INTERMEDIATE}, false, "Water Temple Boss Key Region with Hover Boots", "With precise Hover Boots movement it is possible to reach the boss key chest's region without needing the Longshot. It is not necessary to take damage from the spikes. The Gold Skulltula Token in the following room can also be obtained with just the Hover Boots."); mTrickOptions[RT_WATER_NORTH_BASEMENT_LEDGE_JUMP] = TrickOption::LogicTrick(RCQUEST_BOTH, RA_WATER_TEMPLE, {Tricks::Tag::INTERMEDIATE}, false, "Water Temple North Basement Ledge with Precise Jump", "In the northern basement there's a ledge from where, in vanilla Water Temple, boulders roll out into the room. Normally to jump directly to this ledge logically requires the Hover Boots, but with precise jump, it can be done without them. This trick applies to both Vanilla and Master Quest."); mTrickOptions[RT_WATER_BK_JUMP_DIVE] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Boss Key Jump Dive", "Stand on the very edge of the raised corridor leading from the push block room to the rolling boulder corridor. Face the gold skulltula on the waterfall and jump over the boulder corridor floor into the pool of water, swimming right once underwater. This allows access to the boss key room without Iron boots."); - //Also used in MQ logic, but won't be relevent unl;ess a way to enter tower without irons exists (likely a clip + swim) + //Also used in MQ logic, but won't be relevent unless a way to enter tower without irons exists (likely a clip + swim) mTrickOptions[RT_WATER_FW_CENTRAL_GS] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Central Pillar GS with Farore\'s Wind", "If you set Farore's Wind inside the central pillar and then return to that warp point after raising the water to the highest level, you can obtain this Skulltula Token with Hookshot or Boomerang."); mTrickOptions[RT_WATER_IRONS_CENTRAL_GS] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::NOVICE}, false, "Water Temple Central Pillar GS with Iron Boots", "After opening the middle water level door into the central pillar, the door will stay unbarred so long as you do not leave the room -- even if you were to raise the water up to the highest level. With the Iron Boots to go through the door after the water has been raised, you can obtain the Skulltula Token with the Hookshot."); mTrickOptions[RT_WATER_CENTRAL_BOW] = TrickOption::LogicTrick(RCQUEST_VANILLA, RA_WATER_TEMPLE, {Tricks::Tag::ADVANCED}, false, "Water Temple Central Bow Target without Longshot or Hover Boots", "A very precise Bow shot can hit the eye switch from the floor above. Then, you can jump down into the hallway and make through it before the gate closes. It can also be done as child, using the Slingshot instead of the Bow."); From f12a2bbbb7f6201a0bc8787d23cd446a1a2b4d48 Mon Sep 17 00:00:00 2001 From: Archez Date: Sat, 9 Nov 2024 12:51:31 -0500 Subject: [PATCH 11/11] Port over decomp updates for vis* and reimplement vismono fb (#4533) * Port over decomp updates for vis* * move vismono framebuffer handling to file --- soh/include/functions.h | 12 - soh/include/gfx.h | 9 + soh/include/macros.h | 4 + soh/include/variables.h | 2 +- soh/include/z64.h | 27 +-- soh/include/z64vis.h | 101 ++++++++ soh/soh/stubs.c | 4 + soh/src/code/code_800ACE70.c | 97 -------- soh/src/code/code_800AD920.c | 64 ------ soh/src/code/game.c | 86 +++---- soh/src/code/z_demo.c | 16 +- soh/src/code/z_play.c | 14 +- soh/src/code/z_viscvg.c | 145 ++++++++++++ soh/src/code/z_vismono.c | 217 ++++++++++++------ soh/src/code/z_viszbuf.c | 116 ++++++++++ .../overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 8 +- .../actors/ovl_End_Title/z_end_title.c | 4 - .../overlays/gamestates/ovl_title/z_title.c | 2 - 18 files changed, 593 insertions(+), 335 deletions(-) create mode 100644 soh/include/gfx.h create mode 100644 soh/include/z64vis.h delete mode 100644 soh/src/code/code_800ACE70.c delete mode 100644 soh/src/code/code_800AD920.c create mode 100644 soh/src/code/z_viscvg.c create mode 100644 soh/src/code/z_viszbuf.c diff --git a/soh/include/functions.h b/soh/include/functions.h index 15fb5ba9d..b3e597791 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -1419,18 +1419,6 @@ void ViMode_Init(ViMode* viMode); void ViMode_Destroy(ViMode* viMode); void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures); void ViMode_Update(ViMode* viMode, Input* input); -void func_800ACE70(struct_801664F0* this); -void func_800ACE90(struct_801664F0* this); -void func_800ACE98(struct_801664F0* this, Gfx** gfxp); -void VisMono_Init(VisMono* this); -void VisMono_Destroy(VisMono* this); -void VisMono_UpdateTexture(VisMono* this, u16* tex); -Gfx* VisMono_DrawTexture(VisMono* this, Gfx* gfx); -void VisMono_Draw(VisMono* this, Gfx** gfxp); -void VisMono_DrawOld(VisMono* this); -void func_800AD920(struct_80166500* this); -void func_800AD950(struct_80166500* this); -void func_800AD958(struct_80166500* this, Gfx** gfxp); void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId); Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z); void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z); diff --git a/soh/include/gfx.h b/soh/include/gfx.h new file mode 100644 index 000000000..d8aa9945f --- /dev/null +++ b/soh/include/gfx.h @@ -0,0 +1,9 @@ +#ifndef GFX_H +#define GFX_H + +// Texture memory size, 4 KiB +#define TMEM_SIZE 0x1000 + +// Upstream TODO: Rest of this file + +#endif diff --git a/soh/include/macros.h b/soh/include/macros.h index 9c7c43d80..c10f40599 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -299,6 +299,10 @@ extern GraphicsContext* __gfxCtx; #define BGCHECK_POS_ERROR_CHECK(vec3f) BgCheck_PosErrorCheck(vec3f, __FILE__, __LINE__) #define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1) + +// Upstream TODO: Bring back decomp file/line macro use in src (but ignore the args for our needs) +#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_MallocDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_FREE(ptr, file, line) SystemArena_FreeDebug(ptr, __FILE__, __LINE__) // #endregion #define DPAD_ITEM(button) ((gSaveContext.buttonStatus[(button) + 5] != BTN_DISABLED) \ diff --git a/soh/include/variables.h b/soh/include/variables.h index 6b8451f5f..f5486f761 100644 --- a/soh/include/variables.h +++ b/soh/include/variables.h @@ -203,7 +203,7 @@ extern "C" extern f32 gBossMarkScale; extern PauseMapMarksData* gLoadedPauseMarkDataTable; extern s32 gTrnsnUnkState; - extern Color_RGBA8_u32 D_801614B0; + extern Color_RGBA8_u32 gVisMonoColor; extern PreNmiBuff* gAppNmiBufferPtr; extern SchedContext gSchedContext; extern PadMgr gPadMgr; diff --git a/soh/include/z64.h b/soh/include/z64.h index 00a67c844..903805f8c 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -25,12 +25,14 @@ #include "z64skin.h" #include "z64transition.h" #include "z64interface.h" +#include "z64vis.h" #include "alignment.h" #include "sequence.h" #include "sfx.h" #include #include "ichain.h" #include "regs.h" +#include "gfx.h" #if defined(__LP64__) #define _SOH64 @@ -2225,31 +2227,6 @@ typedef struct { /* 0x0084 */ u32 unk_84; } ViMode; -// Vis... -typedef struct { - /* 0x00 */ u32 type; - /* 0x04 */ u32 setScissor; - /* 0x08 */ Color_RGBA8_u32 color; - /* 0x0C */ Color_RGBA8_u32 envColor; -} struct_801664F0; // size = 0x10 - -typedef struct { - /* 0x00 */ u32 unk_00; - /* 0x04 */ u32 setScissor; - /* 0x08 */ Color_RGBA8_u32 primColor; - /* 0x0C */ Color_RGBA8_u32 envColor; - /* 0x10 */ u16* tlut; - /* 0x14 */ Gfx* monoDl; -} VisMono; // size = 0x18 - -// Vis... -typedef struct { - /* 0x00 */ u32 useRgba; - /* 0x04 */ u32 setScissor; - /* 0x08 */ Color_RGBA8_u32 primColor; - /* 0x08 */ Color_RGBA8_u32 envColor; -} struct_80166500; // size = 0x10 - typedef struct { /* 0x000 */ u8 rumbleEnable[4]; /* 0x004 */ u8 unk_04[0x40]; diff --git a/soh/include/z64vis.h b/soh/include/z64vis.h new file mode 100644 index 000000000..1798baa1f --- /dev/null +++ b/soh/include/z64vis.h @@ -0,0 +1,101 @@ +#ifndef Z64_VIS_H +#define Z64_VIS_H + +// #include "ultra64.h" +// #include "color.h" +#include + + +#ifdef __cplusplus +#define this thisx +extern "C" +{ +#endif + +typedef enum FramebufferFilterType { + /* 0 */ FB_FILTER_NONE, + /* 1 */ FB_FILTER_CVG_RGB, + /* 2 */ FB_FILTER_CVG_RGB_UNIFORM, + /* 3 */ FB_FILTER_CVG_ONLY, + /* 4 */ FB_FILTER_CVG_RGB_FOG, // Not recommended, easily overflows blender + /* 5 */ FB_FILTER_ZBUF_IA, + /* 6 */ FB_FILTER_ZBUF_RGBA, + /* 7 */ FB_FILTER_MONO +} FramebufferFilterType; + +typedef enum VisScissorType { + /* 0 */ VIS_NO_SETSCISSOR, + /* 1 */ VIS_SETSCISSOR +} VisScissorType; + +typedef struct Vis { + /* 0x00 */ u32 type; + /* 0x04 */ u32 scissorType; + /* 0x08 */ Color_RGBA8_u32 primColor; + /* 0x0C */ Color_RGBA8_u32 envColor; +} Vis; // size = 0x10 + + + +/* Cvg: Coverage */ + +#define FB_FILTER_TO_CVG_TYPE(filter) (filter) + +typedef enum VisCvgType { + /* 0 */ VIS_CVG_TYPE_NONE = FB_FILTER_TO_CVG_TYPE(FB_FILTER_NONE), + /* 1 */ VIS_CVG_TYPE_CVG_RGB = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB), + /* 2 */ VIS_CVG_TYPE_CVG_RGB_UNIFORM = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_UNIFORM), + /* 3 */ VIS_CVG_TYPE_CVG_ONLY = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_ONLY), + /* 4 */ VIS_CVG_TYPE_CVG_RGB_FOG = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_FOG) +} VisCvgType; + +typedef struct VisCvg { + /* 0x00 */ Vis vis; +} VisCvg; // size = 0x10 + +void VisCvg_Init(VisCvg* this); +void VisCvg_Destroy(VisCvg* this); +void VisCvg_Draw(VisCvg* this, Gfx** gfxP); + + + +/* Mono: Desaturation */ + +// Only one type + +typedef struct VisMono { + /* 0x00 */ Vis vis; + /* 0x10 */ u16* tlut; + /* 0x14 */ Gfx* dList; +} VisMono; // size = 0x18 + +void VisMono_Init(VisMono* this); +void VisMono_Destroy(VisMono* this); +void VisMono_Draw(VisMono* this, Gfx** gfxP); + + + +/* ZBuf: Z-Buffer */ + +#define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA) + +typedef enum VisZBufType { + /* 0 */ VIS_ZBUF_TYPE_IA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_IA), + /* 1 */ VIS_ZBUF_TYPE_RGBA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_RGBA) +} VisZBufType; + +typedef struct VisZBuf { + /* 0x00 */ Vis vis; +} VisZBuf; // size = 0x10 + +void VisZBuf_Init(VisZBuf* this); +void VisZBuf_Destroy(VisZBuf* this); +void VisZBuf_Draw(VisZBuf* this, Gfx** gfxP); + + +#ifdef __cplusplus +#undef this +} +#endif + +#endif diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 63340734e..99105d9f0 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -23,6 +23,10 @@ u16 gAudioSEFlagSwapSource[64]; u16 gAudioSEFlagSwapTarget[64]; u8 gAudioSEFlagSwapMode[64]; +// Zbuffer and Color framebuffer +u16 D_0E000000[SCREEN_WIDTH * SCREEN_HEIGHT]; +u16 D_0F000000[SCREEN_WIDTH * SCREEN_HEIGHT]; + u8 osAppNmiBuffer[2048]; f32 qNaN0x10000 = 0x7F810000; diff --git a/soh/src/code/code_800ACE70.c b/soh/src/code/code_800ACE70.c deleted file mode 100644 index e22162777..000000000 --- a/soh/src/code/code_800ACE70.c +++ /dev/null @@ -1,97 +0,0 @@ -#include "global.h" - -// Note : This file is related to z_vismono, the original name was probably z_vis - -Gfx D_8012AC00[] = { - gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2), - gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), - gsDPPipeSync(), - gsDPSetBlendColor(0, 0, 0, 8), - gsSPEndDisplayList(), -}; - -Gfx D_8012AC28[] = { - gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), - gsSPEndDisplayList(), -}; - -Gfx D_8012AC40[] = { - gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), - - gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), - gsSPEndDisplayList(), -}; - -Gfx D_8012AC58[] = { - gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), - gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2), - gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), - gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), - gsSPEndDisplayList(), -}; - -// Init -void func_800ACE70(struct_801664F0* this) { - this->type = 0; - this->setScissor = false; - this->color.r = 255; - this->color.g = 255; - this->color.b = 255; - this->color.a = 255; -} - -// Destroy -void func_800ACE90(struct_801664F0* this) { -} - -// Draw -void func_800ACE98(struct_801664F0* this, Gfx** gfxp) { - Gfx* gfx = *gfxp; - - gDPPipeSync(gfx++); - gDPSetPrimDepth(gfx++, -1, -1); - - if (this->setScissor == true) { - gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - } - - switch (this->type) { - case 1: - gSPDisplayList(gfx++, D_8012AC40); - break; - case 2: - gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba); - gSPDisplayList(gfx++, D_8012AC58); - break; - case 3: - gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba); - gSPDisplayList(gfx++, D_8012AC00); - break; - case 4: - gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba); - gSPDisplayList(gfx++, D_8012AC28); - break; - } - - gDPPipeSync(gfx++); - *gfxp = gfx; -} diff --git a/soh/src/code/code_800AD920.c b/soh/src/code/code_800AD920.c deleted file mode 100644 index 2ef7cf0bb..000000000 --- a/soh/src/code/code_800AD920.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "global.h" - -// Note : This file is related to z_vismono, the original name was probably z_vis - -// z-buffer -extern u16 D_0E000000[]; - -// Init -void func_800AD920(struct_80166500* this) { - this->useRgba = false; - this->setScissor = false; - this->primColor.r = 255; - this->primColor.g = 255; - this->primColor.b = 255; - this->primColor.a = 255; - this->envColor.a = 255; - this->envColor.r = 0; - this->envColor.g = 0; - this->envColor.b = 0; -} - -// Destroy -void func_800AD950(struct_80166500* this) { -} - -// Draw -void func_800AD958(struct_80166500* this, Gfx** gfxp) { - Gfx* gfx = *gfxp; - - // OTRTODO -#if 0 - u16* tex = D_0E000000; - s32 fmt = this->useRgba == false ? G_IM_FMT_IA : G_IM_FMT_RGBA; - s32 y; - s32 height = 6; - - gDPPipeSync(gfx++); - if (this->setScissor == true) { - gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - } - - gDPSetOtherMode(gfx++, - G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2); - gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT); - - gDPSetColor(gfx++, G_SETPRIMCOLOR, this->primColor.rgba); - gDPSetColor(gfx++, G_SETENVCOLOR, this->envColor.rgba); - - for (y = 0; y <= SCREEN_HEIGHT - height; y += height) { - gDPLoadTextureBlock(gfx++, tex, fmt, G_IM_SIZ_16b, SCREEN_WIDTH, height, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - gSPTextureRectangle(gfx++, 0, (y) << 2, (SCREEN_WIDTH << 2), (y + height) << 2, G_TX_RENDERTILE, 0, 0, - (1 << 10), (1 << 10)); - tex += SCREEN_WIDTH * height; - } - - gDPPipeSync(gfx++); - *gfxp = gfx; -#endif -} diff --git a/soh/src/code/game.c b/soh/src/code/game.c index e1974ed98..90438b5db 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -6,9 +6,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" SpeedMeter D_801664D0; -struct_801664F0 D_801664F0; -struct_80166500 D_80166500; -VisMono sMonoColors; +VisCvg sVisCvg; +VisZBuf sVisZBuf; +VisMono sVisMono; ViMode sViMode; FaultClient sGameFaultClient; u16 sLastButtonPressed; @@ -31,41 +31,43 @@ void GameState_FaultPrint(void) { } } -void GameState_SetFBFilter(Gfx** gfx) { - Gfx* gfxP; - gfxP = *gfx; +void GameState_SetFBFilter(Gfx** gfxP) { + Gfx* gfx = *gfxP; - if ((R_FB_FILTER_TYPE > 0) && (R_FB_FILTER_TYPE < 5)) { - D_801664F0.type = R_FB_FILTER_TYPE; - D_801664F0.color.r = R_FB_FILTER_PRIM_COLOR(0); - D_801664F0.color.g = R_FB_FILTER_PRIM_COLOR(1); - D_801664F0.color.b = R_FB_FILTER_PRIM_COLOR(2); - D_801664F0.color.a = R_FB_FILTER_A; - func_800ACE98(&D_801664F0, &gfxP); - } else if ((R_FB_FILTER_TYPE == 5) || (R_FB_FILTER_TYPE == 6)) { - D_80166500.useRgba = (R_FB_FILTER_TYPE == 6); - D_80166500.primColor.r = R_FB_FILTER_PRIM_COLOR(0); - D_80166500.primColor.g = R_FB_FILTER_PRIM_COLOR(1); - D_80166500.primColor.b = R_FB_FILTER_PRIM_COLOR(2); - D_80166500.primColor.a = R_FB_FILTER_A; - D_80166500.envColor.r = R_FB_FILTER_ENV_COLOR(0); - D_80166500.envColor.g = R_FB_FILTER_ENV_COLOR(1); - D_80166500.envColor.b = R_FB_FILTER_ENV_COLOR(2); - D_80166500.envColor.a = R_FB_FILTER_A; - func_800AD958(&D_80166500, &gfxP); - } else if (R_FB_FILTER_TYPE == 7) { - sMonoColors.unk_00 = 0; - sMonoColors.primColor.r = R_FB_FILTER_PRIM_COLOR(0); - sMonoColors.primColor.g = R_FB_FILTER_PRIM_COLOR(1); - sMonoColors.primColor.b = R_FB_FILTER_PRIM_COLOR(2); - sMonoColors.primColor.a = R_FB_FILTER_A; - sMonoColors.envColor.r = R_FB_FILTER_ENV_COLOR(0); - sMonoColors.envColor.g = R_FB_FILTER_ENV_COLOR(1); - sMonoColors.envColor.b = R_FB_FILTER_ENV_COLOR(2); - sMonoColors.envColor.a = R_FB_FILTER_A; - VisMono_Draw(&sMonoColors, &gfxP); + if ((R_FB_FILTER_TYPE >= FB_FILTER_CVG_RGB) && (R_FB_FILTER_TYPE <= FB_FILTER_CVG_RGB_FOG)) { + // Visualize coverage + sVisCvg.vis.type = FB_FILTER_TO_CVG_TYPE(R_FB_FILTER_TYPE); + sVisCvg.vis.primColor.r = R_FB_FILTER_PRIM_COLOR(0); + sVisCvg.vis.primColor.g = R_FB_FILTER_PRIM_COLOR(1); + sVisCvg.vis.primColor.b = R_FB_FILTER_PRIM_COLOR(2); + sVisCvg.vis.primColor.a = R_FB_FILTER_A; + VisCvg_Draw(&sVisCvg, &gfx); + } else if ((R_FB_FILTER_TYPE == FB_FILTER_ZBUF_IA) || (R_FB_FILTER_TYPE == FB_FILTER_ZBUF_RGBA)) { + // Visualize z-buffer + sVisZBuf.vis.type = (R_FB_FILTER_TYPE == FB_FILTER_ZBUF_RGBA); + sVisZBuf.vis.primColor.r = R_FB_FILTER_PRIM_COLOR(0); + sVisZBuf.vis.primColor.g = R_FB_FILTER_PRIM_COLOR(1); + sVisZBuf.vis.primColor.b = R_FB_FILTER_PRIM_COLOR(2); + sVisZBuf.vis.primColor.a = R_FB_FILTER_A; + sVisZBuf.vis.envColor.r = R_FB_FILTER_ENV_COLOR(0); + sVisZBuf.vis.envColor.g = R_FB_FILTER_ENV_COLOR(1); + sVisZBuf.vis.envColor.b = R_FB_FILTER_ENV_COLOR(2); + sVisZBuf.vis.envColor.a = R_FB_FILTER_A; + VisZBuf_Draw(&sVisZBuf, &gfx); + } else if (R_FB_FILTER_TYPE == FB_FILTER_MONO) { + // Monochrome filter + sVisMono.vis.type = 0; + sVisMono.vis.primColor.r = R_FB_FILTER_PRIM_COLOR(0); + sVisMono.vis.primColor.g = R_FB_FILTER_PRIM_COLOR(1); + sVisMono.vis.primColor.b = R_FB_FILTER_PRIM_COLOR(2); + sVisMono.vis.primColor.a = R_FB_FILTER_A; + sVisMono.vis.envColor.r = R_FB_FILTER_ENV_COLOR(0); + sVisMono.vis.envColor.g = R_FB_FILTER_ENV_COLOR(1); + sVisMono.vis.envColor.b = R_FB_FILTER_ENV_COLOR(2); + sVisMono.vis.envColor.a = R_FB_FILTER_A; + VisMono_Draw(&sVisMono, &gfx); } - *gfx = gfxP; + *gfxP = gfx; } void func_800C4344(GameState* gameState) { @@ -420,9 +422,9 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g startTime = endTime; LOG_CHECK_NULL_POINTER("this->cleanup", gameState->destroy); - func_800ACE70(&D_801664F0); - func_800AD920(&D_80166500); - VisMono_Init(&sMonoColors); + VisCvg_Init(&sVisCvg); + VisZBuf_Init(&sVisZBuf); + VisMono_Init(&sVisMono); if (SREG(48) == 0) { ViMode_Init(&sViMode); } @@ -450,9 +452,9 @@ void GameState_Destroy(GameState* gameState) { } func_800AA0F0(); SpeedMeter_Destroy(&D_801664D0); - func_800ACE90(&D_801664F0); - func_800AD950(&D_80166500); - VisMono_Destroy(&sMonoColors); + VisCvg_Destroy(&sVisCvg); + VisZBuf_Destroy(&sVisZBuf); + VisMono_Destroy(&sVisMono); if (SREG(48) == 0) { ViMode_Destroy(&sViMode); } diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 91d9271ff..5c2348829 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -350,16 +350,16 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); break; case 22: - D_801614B0.r = 255; - D_801614B0.g = 255; - D_801614B0.b = 255; - D_801614B0.a = 255; + gVisMonoColor.r = 255; + gVisMonoColor.g = 255; + gVisMonoColor.b = 255; + gVisMonoColor.a = 255; break; case 23: - D_801614B0.r = 255; - D_801614B0.g = 180; - D_801614B0.b = 100; - D_801614B0.a = 255.0f * temp; + gVisMonoColor.r = 255; + gVisMonoColor.g = 180; + gVisMonoColor.b = 100; + gVisMonoColor.a = 255.0f * temp; break; case 24: play->roomCtx.curRoom.segment = NULL; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index e7603040d..83bffcd27 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -21,7 +21,7 @@ TransitionUnk sTrnsnUnk; s32 gTrnsnUnkState; VisMono gPlayVisMono; -Color_RGBA8_u32 D_801614B0; +Color_RGBA8_u32 gVisMonoColor; FaultClient D_801614B8; @@ -567,7 +567,7 @@ void Play_Init(GameState* thisx) { TransitionFade_SetColor(&play->transitionFade, RGBA8(160, 160, 160, 255)); TransitionFade_Start(&play->transitionFade); VisMono_Init(&gPlayVisMono); - D_801614B0.a = 0; + gVisMonoColor.a = 0; Flags_UnsetAllEnv(play); osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&play->state.tha)); @@ -1422,11 +1422,9 @@ void Play_Draw(PlayState* play) { TransitionFade_Draw(&play->transitionFade, &gfxP); - if (D_801614B0.a > 0) { - // gPlayVisMono.vis.primColor.rgba = D_801614B0.rgba; - // VisMono_Draw(&gPlayVisMono, &gfxP); - gDPSetGrayscaleColor(gfxP++, D_801614B0.r, D_801614B0.g, D_801614B0.b, D_801614B0.a); - gSPGrayscale(gfxP++, true); + if (gVisMonoColor.a > 0) { + gPlayVisMono.vis.primColor.rgba = gVisMonoColor.rgba; + VisMono_Draw(&gPlayVisMono, &gfxP); } gSPEndDisplayList(gfxP++); @@ -1610,7 +1608,7 @@ void Play_Draw(PlayState* play) { play->unk_121C7 = 2; SREG(33) |= 1; - // 2S2H [Port] Continue to render the post world for pausing to avoid flashing the HUD + // SOH [Port] Continue to render the post world for pausing to avoid flashing the HUD if (gTrnsnUnkState == 2) { goto Play_Draw_skip; } diff --git a/soh/src/code/z_viscvg.c b/soh/src/code/z_viscvg.c new file mode 100644 index 000000000..9caf39a3f --- /dev/null +++ b/soh/src/code/z_viscvg.c @@ -0,0 +1,145 @@ +/** + * @file z_viscvg.c + * + * This file implements full-screen frame buffer effects involving the visualization of Coverage in various ways. + * + * Coverage is roughly how much of a pixel is covered by a primitive; the final coverage for a frame is stored in the + * color image alpha component where it is used for antialiasing, see PreRender.c and ยง15 of the programming manual for + * details. + * + * To understand this file, it is helpful to remember that A_MEM is essentially synonymous with coverage, and that + * `GBL_c1/2(p, a, m, b)` usually represents the RDP blender calculation `(p * a + m * b)`. + * Note the division step that is often included in the blender calculation is omitted; the division is skipped if + * force blending (FORCE_BL) is set, which is the case for all render modes used in this file. + * + * Coverage is full when not on an edge, while on an edge it is usually lower. Since coverage is treated as an alpha + * value, edges of primitives where coverage is lower will show up darker than primitive interiors in all of the + * available modes. + * + * Coverage is abbreviated to "cvg"; "FB RGB" ("framebuffer red/green/blue") is the color the pixel originally had + * before the filter is applied. + */ + +#include "global.h" + +/** + * Draws only coverage: does not retain any of the original pixel RGB, primColor is used as background color. + */ +Gfx sCoverageOnlyDL[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2), + // (blendColor RGB) * (cvg) + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + gsDPPipeSync(), + gsDPSetBlendColor(0, 0, 0, 8), + gsSPEndDisplayList(), +}; + +/** + * Draws fog + coverage * RGB of pixels + * + * @bug This easily overflows the blender because the fog value is added to the coverage value. + */ +Gfx sCoverageRGBFogDL[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)), + // (fog RGB) * (fog alpha) + (FB RGB) * (cvg) + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + gsSPEndDisplayList(), +}; + +/** + * Draws coverage and RGB of pixels + */ +Gfx sCoverageRGBDL[] = { + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), + // (FB RGB) * (cvg) + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + gsSPEndDisplayList(), +}; + +/** + * Two stage filtering: + * + * 1. Apply a uniform color filter by transparently blending primColor with original frame. The "cloud surface" + * RenderMode is used to preserve the coverage for the second stage. + * 2. Second half is the same as `sCoverageRGBDL`'s, i.e. (RGB from stage 1) * cvg + */ +Gfx sCoverageRGBUniformDL[] = { + gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), + gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2), + // stage 1 color = (primColor RGB) * (primColor Alpha) + (FB RGB) * (1 - primColor Alpha) + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + + gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)), + // final color = (stage 1 RGB) * (cvg) + gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1), + gsSPEndDisplayList(), +}; + +void VisCvg_Init(VisCvg* this) { + this->vis.type = FB_FILTER_NONE; + this->vis.scissorType = VIS_NO_SETSCISSOR; + this->vis.primColor.r = 255; + this->vis.primColor.g = 255; + this->vis.primColor.b = 255; + this->vis.primColor.a = 255; +} + +void VisCvg_Destroy(VisCvg* this) { +} + +void VisCvg_Draw(VisCvg* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; + + gDPPipeSync(gfx++); + gDPSetPrimDepth(gfx++, 0xFFFF, 0xFFFF); + + if (this->vis.scissorType == VIS_SETSCISSOR) { + gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + } + + switch (this->vis.type) { + case FB_FILTER_CVG_RGB: + gSPDisplayList(gfx++, sCoverageRGBDL); + break; + + case FB_FILTER_CVG_RGB_UNIFORM: + // Set primitive color for uniform color filter in custom RenderMode + gDPSetColor(gfx++, G_SETPRIMCOLOR, this->vis.primColor.rgba); + gSPDisplayList(gfx++, sCoverageRGBUniformDL); + break; + + case FB_FILTER_CVG_ONLY: + // Set background color for G_RM_VISCVG + gDPSetColor(gfx++, G_SETBLENDCOLOR, this->vis.primColor.rgba); + gSPDisplayList(gfx++, sCoverageOnlyDL); + break; + + case FB_FILTER_CVG_RGB_FOG: + // Set fog color for custom RenderMode, needs to be close to 0 to not overflow + gDPSetColor(gfx++, G_SETFOGCOLOR, this->vis.primColor.rgba); + gSPDisplayList(gfx++, sCoverageRGBFogDL); + break; + + default: + break; + } + + gDPPipeSync(gfx++); + *gfxP = gfx; +} diff --git a/soh/src/code/z_vismono.c b/soh/src/code/z_vismono.c index c277eb971..a4e77d70d 100644 --- a/soh/src/code/z_vismono.c +++ b/soh/src/code/z_vismono.c @@ -1,137 +1,218 @@ +/** + * @file z_vismono.c + * + * This file implements a full-screen framebuffer effect for desaturating the contents of the framebuffer image. + * + * Broadly, this effect is achieved by reinterpreting the contents of the RGBA16 color image as indices into an IA16 + * color palette that converts each color into the desaturated equivalent. More precise details can be found in inline + * comments. + */ + #include "global.h" -#include + +#include // memset #include +#include "soh/framebuffer_effects.h" -// (Note: 80 = SCREEN_HEIGHT/3, see VisMono_DrawTexture) -// This may not have been kept up-to-date with the code, 1+1+1+80*(7+2+2+3)+1+1 makes more sense -#define DLSIZE (1 + 3 + 1 + 1 + 80 * (7 + 2 + 2 + 3) + 1) +// Upstream TODO: Replace these ones they are served from other headers +#define ASSERT(cond, msg, file, line) assert(cond) +#define GPACK_IA16(i, a) (((i) << 8) | (a)) -// framebuffer +// Height of the fragments the color frame buffer (CFB) is split into. +// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into +// the half of TMEM dedicated to color-indexed data. +#define VISMONO_CFBFRAG_HEIGHT ((TMEM_SIZE / 2) / (SCREEN_WIDTH * G_IM_SIZ_16b_BYTES)) + +// Maximum size of the dlist written by `VisMono_DesaturateDList`. +// `VisMono_DesaturateDList` consistently uses `VISMONO_DLSIZE - 2` double words, so this can be 2 less. +#define VISMONO_DLSIZE (3 + SCREEN_HEIGHT / VISMONO_CFBFRAG_HEIGHT * (7 + 2 + 2 + 3) + 2 + 2) + +// How much each color component contributes to the desaturated result. +// These coefficients are close to what the YUV color space defines Y (luminance) as: +// https://en.wikipedia.org/wiki/YUV#Conversion_to/from_RGB +#define VISMONO_FAC_RED 2 +#define VISMONO_FAC_GREEN 4 +#define VISMONO_FAC_BLUE 1 +#define VISMONO_FAC_NORM (0x1F * VISMONO_FAC_RED + 0x1F * VISMONO_FAC_GREEN + 0x1F * VISMONO_FAC_BLUE) + +// color framebuffer extern u16 D_0F000000[]; void VisMono_Init(VisMono* this) { memset(this, 0, sizeof(VisMono)); - this->unk_00 = 0; - this->setScissor = false; - this->primColor.r = 255; - this->primColor.g = 255; - this->primColor.b = 255; - this->primColor.a = 255; - this->envColor.r = 0; - this->envColor.g = 0; - this->envColor.b = 0; - this->envColor.a = 0; + this->vis.type = 0; + this->vis.scissorType = VIS_NO_SETSCISSOR; + this->vis.primColor.r = 255; + this->vis.primColor.g = 255; + this->vis.primColor.b = 255; + this->vis.primColor.a = 255; + this->vis.envColor.r = 0; + this->vis.envColor.g = 0; + this->vis.envColor.b = 0; + this->vis.envColor.a = 0; } void VisMono_Destroy(VisMono* this) { - SYSTEM_ARENA_FREE_DEBUG(this->monoDl); + SYSTEM_ARENA_FREE(this->dList, "../z_vismono.c", 137); } -void VisMono_UpdateTexture(VisMono* this, u16* tex) { +void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) { s32 i; for (i = 0; i < 256; i++) { - tex[i] = ((((i >> 3 & 0x1F) * 2 + (i << 2 & 0x1F) * 4) * 0xFF / 0xD9) << 8) | - (((i >> 6 & 0x1F) * 4 + (i >> 1 & 0x1F)) * 0xFF / 0xD9); + // `tlut[i]` is a IA16 color + // `i` corresponds to either byte of a RGBA16 color RRRR_RGGG GGBB_BBBA from the color frame buffer + + // The high byte I (intensity) corresponds to `i` being interpreted as the high byte RRRR_RGGG + // I = (RRRRR * FAC_RED + GGG00 * FAC_GREEN) * (255 / FAC_NORM) + + // The low byte A (alpha) corresponds to `i` being interpreted as the low byte GGBB_BBBA + // A = (000GG * FAC_GREEN + BBBBB * FAC_BLUE) * (255 / FAC_NORM) + + // Note: I + A = (RRRRR * FAC_RED + GGGGG * FAC_GREEN + BBBBB * FAC_BLUE) * (255 / FAC_NORM) + + tlut[i] = GPACK_IA16( + ((i >> 3 & 0x1F) * VISMONO_FAC_RED + (i << 2 & 0x1F) * VISMONO_FAC_GREEN) * 255 / VISMONO_FAC_NORM, + ((i >> 6 & 0x1F) * VISMONO_FAC_GREEN + (i >> 1 & 0x1F) * VISMONO_FAC_BLUE) * 255 / VISMONO_FAC_NORM); } } -Gfx* VisMono_DrawTexture(VisMono* this, Gfx* gfx) -{ -// OTRTODO -#if 1 +Gfx* VisMono_DesaturateDList(VisMono* this, Gfx* gfx) { s32 y; - s32 height = 3; - //u16* tex = D_0F000000; - u16* tex = SEG_ADDR(0xF, 0); + s32 height = VISMONO_CFBFRAG_HEIGHT; + u16* cfbFrag = D_0F000000; gDPPipeSync(gfx++); + // `G_TT_IA16`: use color-indexed images, and IA16 palettes gDPSetOtherMode(gfx++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_2CYCLE | G_PM_1PRIMITIVE, - G_AC_NONE | G_ZS_PRIM | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) | G_RM_CLD_SURF2); + G_AC_NONE | G_ZS_PRIM | G_RM_PASS | G_RM_CLD_SURF2); + // First color cycle sums texel 1 alpha and texel 0 color + // By using IA16 palettes, this means summing A (from the IA16 color texel 1 maps to) + // with I (from the IA16 color texel 0 maps to) gDPSetCombineLERP(gfx++, 1, 0, TEXEL1_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, PRIMITIVE); for (y = 0; y <= SCREEN_HEIGHT - height; y += height) { - gDPLoadTextureBlock(gfx++, tex, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2, height, 0, + // Load a few lines of the color frame buffer + gDPLoadTextureBlock(gfx++, cfbFrag, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2, height, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, 80, 0x0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, - G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); - gDPSetTileSize(gfx++, G_TX_RENDERTILE, (2 << 2), 0, ((SCREEN_WIDTH * 2 + 1) << 2), (2 << 2)); + // Set texel 0 to be a CI8 image with width `SCREEN_WIDTH * 2` and height `VISMONO_CFBFRAG_HEIGHT` + // Its position in texture image space is shifted along +S by 2 + gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2 * G_IM_SIZ_8b_LINE_BYTES / 8, 0x0, G_TX_RENDERTILE, + 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); + gDPSetTileSize(gfx++, G_TX_RENDERTILE, 2 << 2, 0, (SCREEN_WIDTH * 2 + 1) << 2, + (VISMONO_CFBFRAG_HEIGHT - 1) << 2); - gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, 80, 0x0, 1, 1, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, - G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); - gDPSetTileSize(gfx++, 1, (1 << 2), 0, ((SCREEN_WIDTH * 2) << 2), (2 << 2)); + // Set texel 1 to be a CI8 image with width `SCREEN_WIDTH * 2` and height `VISMONO_CFBFRAG_HEIGHT` + // Its position in texture image space is shifted along +S by 1 + // Note the palette index for this tile has also been incremented from 0 to 1, however the palette index is + // ignored for CI8 texture sampling. + gDPSetTile(gfx++, G_IM_FMT_CI, G_IM_SIZ_8b, SCREEN_WIDTH * 2 * G_IM_SIZ_8b_LINE_BYTES / 8, 0x0, 1, 1, + G_TX_NOMIRROR | G_TX_CLAMP, 0, 0, G_TX_NOMIRROR | G_TX_CLAMP, 0, 0); + gDPSetTileSize(gfx++, 1, 1 << 2, 0, (SCREEN_WIDTH * 2) << 2, (VISMONO_CFBFRAG_HEIGHT - 1) << 2); - gSPTextureRectangle(gfx++, 0, y << 2, (SCREEN_WIDTH << 2), (y + height) << 2, G_TX_RENDERTILE, 2 << 5, 0, - 2 << 10, 1 << 10); - tex += SCREEN_WIDTH * height; + // Draw a `SCREEN_WIDTH` wide, `height` high rectangle. + // Texture coordinate T (vertical) starts at 0 and changes by one each line (dtdy = 1) + // Texture coordinate S (horizontal) starts at 2 and changes by two each column (dsdx = 2) + + // Because texel 0 is shifted by 2 and texel 1 only by 1 along +S, + // a pixel at S coordinates s = 2+2*n will look at the 2*n-th byte of texel 0 and the 2*n+1-th byte of texel 1. + // (in "s = 2+2*n" the first "2" is the starting S coordinate and the second "2" is the dsdx value) + + // The 2*n-th byte of texel 0 is the high byte of the n-th RGBA16 color of the color frame buffer. + // The 2*n+1-th byte of texel 1 is the low byte of the n-th RGBA16 color of the color frame buffer. + + // With the TLUT computed by `VisMono_DesaturateTLUT`: + // The 2*n-th byte of texel 0 maps to a IA16 color where the high byte I (intensity) corresponds to + // the high byte of the n-th RGBA16 color of the color frame buffer. + // The 2*n+1-th byte of texel 1 maps to a IA16 color where the low byte A (alpha) corresponds to + // the low byte of the n-th RGBA16 color of the color frame buffer. + + // Since the combiner is in part set up to sum texel 0 color (I, intensity) with texel 1 alpha (A, alpha), + // the resulting color in the drawn rectangle is a desaturated color as defined by the `VISMONO_FAC_*` values. + + gSPTextureRectangle(gfx++, 0, y << 2, SCREEN_WIDTH << 2, (y + height) << 2, G_TX_RENDERTILE, 2 << 5, 0, 2 << 10, + 1 << 10); + cfbFrag += SCREEN_WIDTH * height; } gDPPipeSync(gfx++); gSPEndDisplayList(gfx++); -#endif return gfx; } -void VisMono_Draw(VisMono* this, Gfx** gfxp) { - Gfx* gfx = *gfxp; +void VisMono_Draw(VisMono* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; u16* tlut; - Gfx* monoDL; - Gfx* glistpEnd; + Gfx* dList; + Gfx* dListEnd; + // SOH [Port] Implement VisMono by performing a framebuffer copy and redraw with an active + // grayscale command to set the mono color + FB_CopyToFramebuffer(&gfx, 0, gReusableFrameBuffer, false, NULL); + gDPSetGrayscaleColor(gfx++, this->vis.primColor.r, this->vis.primColor.g, this->vis.primColor.b, + this->vis.primColor.a); + gSPGrayscale(gfx++, true); + FB_DrawFromFramebuffer(&gfx, gReusableFrameBuffer, 255); + gSPGrayscale(gfx++, false); + +#if 0 if (this->tlut) { tlut = this->tlut; } else { - tlut = Graph_DlistAlloc(&gfx, 256 * sizeof(u16)); - VisMono_UpdateTexture(this, tlut); + tlut = Graph_DlistAlloc(&gfx, 256 * G_IM_SIZ_16b_BYTES); + VisMono_DesaturateTLUT(this, tlut); } - if (this->monoDl) { - monoDL = this->monoDl; + if (this->dList) { + dList = this->dList; } else { - monoDL = Graph_DlistAlloc(&gfx, DLSIZE * sizeof(Gfx)); - glistpEnd = VisMono_DrawTexture(this, monoDL); + dList = Graph_DlistAlloc(&gfx, VISMONO_DLSIZE * sizeof(Gfx)); + dListEnd = VisMono_DesaturateDList(this, dList); - if (!(glistpEnd <= monoDL + DLSIZE)) { - LOG_ADDRESS("glistp_end", glistpEnd); - LOG_ADDRESS("mono_dl", monoDL); - LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", monoDL + DLSIZE); - LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", DLSIZE); + if (!(dListEnd <= dList + VISMONO_DLSIZE)) { + LOG_ADDRESS("glistp_end", dListEnd); + LOG_ADDRESS("mono_dl", dList); + LOG_ADDRESS("mono_dl + (1+3+1+1+80*(7+2+2+3)+1)", dList + VISMONO_DLSIZE); + LOG_ADDRESS("(1+3+1+1+80*(7+2+2+3)+1)", VISMONO_DLSIZE); } - assert(glistpEnd <= monoDL + DLSIZE); + ASSERT(dListEnd <= dList + VISMONO_DLSIZE, "glistp_end <= mono_dl + DLSIZE", "../z_vismono.c", 262); } gDPPipeSync(gfx++); - if (this->setScissor == true) { + + if (this->vis.scissorType == VIS_SETSCISSOR) { gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); } - gDPSetColor(gfx++, G_SETPRIMCOLOR, this->primColor.rgba); - gDPSetColor(gfx++, G_SETENVCOLOR, this->envColor.rgba); + gDPSetColor(gfx++, G_SETPRIMCOLOR, this->vis.primColor.rgba); + gDPSetColor(gfx++, G_SETENVCOLOR, this->vis.envColor.rgba); gDPLoadTLUT_pal256(gfx++, tlut); - gSPDisplayList(gfx++, monoDL); - gDPPipeSync(gfx++); + gSPDisplayList(gfx++, dList); - *gfxp = gfx; + gDPPipeSync(gfx++); +#endif + + *gfxP = gfx; } void VisMono_DrawOld(VisMono* this) { - Gfx* glistpEnd; + Gfx* dListEnd; - if (!this->tlut) { - this->tlut = SYSTEM_ARENA_MALLOC_DEBUG(256 * sizeof(u16)); - VisMono_UpdateTexture(this, this->tlut); + if (this->tlut == NULL) { + this->tlut = SYSTEM_ARENA_MALLOC(256 * G_IM_SIZ_16b_BYTES, "../z_vismono.c", 283); + VisMono_DesaturateTLUT(this, this->tlut); } - if (!this->monoDl) { - this->monoDl = SYSTEM_ARENA_MALLOC_DEBUG(DLSIZE * sizeof(Gfx)); - glistpEnd = VisMono_DrawTexture(this, this->monoDl); - assert(glistpEnd <= this->monoDl + DLSIZE); + if (this->dList == NULL) { + this->dList = SYSTEM_ARENA_MALLOC(VISMONO_DLSIZE * sizeof(Gfx), "../z_vismono.c", 289); + dListEnd = VisMono_DesaturateDList(this, this->dList); + ASSERT(dListEnd <= this->dList + VISMONO_DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292); } } diff --git a/soh/src/code/z_viszbuf.c b/soh/src/code/z_viszbuf.c new file mode 100644 index 000000000..5a542bc12 --- /dev/null +++ b/soh/src/code/z_viszbuf.c @@ -0,0 +1,116 @@ +/** + * @file z_viszbuf.c + * + * This file implements a full-screen framebuffer effect for visualizing the z-buffer (AKA depth buffer), using either + * cycling RGBA or a single fading color. + * + * This is done by reading the z-buffer as if it were a color image, the format of which is specified by the selected + * vis type: + * - VIS_ZBUF_TYPE_IA : Produces a monotonic fade from primColor to envColor as depth increases. + * - VIS_ZBUF_TYPE_RGBA : Produces vibrant almost-periodic-looking bands. + * + * In both cases this occurs because of the format the depth information takes: it is 18-bit, and is a nonnegative + * floating-point number with + * bbb mmmmmmmmmmm dd|dd + * exponent mantissa dz value (only first 16 bits visible to CPU, the least significant 2 bits of dz are ignored) + * + * Reading z-buffer as IA16: + * bbbmmmmm mmmmmmdd + * iiiiiiii aaaaaaaa + * + * Since floating-point numbers of this format have the same ordering as their binary/hex representation, increasing + * the depth also increases the intensity in the IA16 representation and hence the interpolation parameter used to + * combine primColor and envColor. The alpha is ignored by the RenderMode. + * + * Reading z-buffer as RGBA16: + * bbbmm mmmmm mmmmd d + * rrrrr ggggg bbbbb a + * + * The red increases monotonically with the depth. The significant visible oscillation is the green component, because + * it rolls over every time the second-most-significant bit of the mantissa increments. The blue component oscillates + * too rapidly to be particularly visible (it rolls over when the 7th-most-significant bit increments). The alpha is + * again ignored by the RenderMode. + */ + +#include "global.h" + +// Height of the fragments the z-buffer is split into. +// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into TMEM. +#define VISZBUF_ZBUFFRAG_HEIGHT (TMEM_SIZE / (SCREEN_WIDTH * G_IM_SIZ_16b_BYTES)) + +// z-buffer +extern u16 D_0E000000[]; + +/** + * Initialise to IA type with white and black as default colors. + */ +void VisZBuf_Init(VisZBuf* this) { + this->vis.type = VIS_ZBUF_TYPE_IA; + this->vis.scissorType = VIS_NO_SETSCISSOR; + + this->vis.primColor.r = 255; + this->vis.primColor.g = 255; + this->vis.primColor.b = 255; + this->vis.primColor.a = 255; + + // clang-format off + this->vis.envColor.r = 0; \ + this->vis.envColor.g = 0; \ + this->vis.envColor.b = 0; \ + this->vis.envColor.a = 255; + // clang-format on +} + +void VisZBuf_Destroy(VisZBuf* this) { +} + +void VisZBuf_Draw(VisZBuf* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; + s32 pad; + u16* zbufFrag = D_0E000000; + s32 fmt; + s32 y; + s32 height; + + if (this->vis.type == VIS_ZBUF_TYPE_IA) { + fmt = G_IM_FMT_IA; + } else { // VIS_ZBUF_TYPE_RGBA + fmt = G_IM_FMT_RGBA; + } + + height = VISZBUF_ZBUFFRAG_HEIGHT; + + gDPPipeSync(gfx++); + // Scissoring is only required if the scissor has not been set prior. + if (this->vis.scissorType == VIS_SETSCISSOR) { + gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + } + + // No palette so can use all of TMEM. + // G_RM_OPA_SURF discards all information previously in the pixel, and the current alpha, leaving only the color + // from this filter. + gDPSetOtherMode(gfx++, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2); + + // LERP between primColor and envColor in 1-cycle mode using the z-buffer value. + gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT); + gDPSetColor(gfx++, G_SETPRIMCOLOR, this->vis.primColor.rgba); + gDPSetColor(gfx++, G_SETENVCOLOR, this->vis.envColor.rgba); + + for (y = 0; y <= SCREEN_HEIGHT - height; y += height) { + // Load a few lines of the z-buffer, as many as can fit in TMEM at once. + gDPLoadTextureBlock(gfx++, zbufFrag, fmt, G_IM_SIZ_16b, SCREEN_WIDTH, height, 0, G_TX_NOMIRROR | G_TX_CLAMP, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + // Overwrite them with the calculated colors. + gSPTextureRectangle(gfx++, 0, y << 2, SCREEN_WIDTH << 2, (y + height) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); + zbufFrag += SCREEN_WIDTH * height; + } + + gDPPipeSync(gfx++); + *gfxP = gfx; +} diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index dba3e9210..b139b2b56 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -196,10 +196,10 @@ void BgHaka_Draw(Actor* thisx, PlayState* play) { play->envCtx.adjLight1Color[0] = newColor.r; play->envCtx.adjLight1Color[1] = newColor.g; play->envCtx.adjLight1Color[2] = newColor.b; - D_801614B0.r = newColor.r; - D_801614B0.g = newColor.g; - D_801614B0.b = newColor.b; - D_801614B0.a = 255; + gVisMonoColor.r = newColor.r; + gVisMonoColor.g = newColor.g; + gVisMonoColor.b = newColor.b; + gVisMonoColor.a = 255; gDPSetGrayscaleColor(POLY_OPA_DISP++, newColor.r, newColor.g, newColor.b, 255); gSPGrayscale(POLY_OPA_DISP++, true); } diff --git a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c index af13255a8..3e83e5ae3 100644 --- a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -84,8 +84,6 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { } OVERLAY_DISP = Gfx_SetupDL_64(OVERLAY_DISP); - if (D_801614B0.a > 0) - gSPGrayscale(OVERLAY_DISP++, false); gDPSetTextureLUT(OVERLAY_DISP++, G_TT_NONE); gDPSetEnvColor(OVERLAY_DISP++, 255, 120, 30, 0); gDPSetRenderMode(OVERLAY_DISP++, G_RM_PASS, G_RM_XLU_SURF2); @@ -110,8 +108,6 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - if (D_801614B0.a > 0) - gSPGrayscale(OVERLAY_DISP++, true); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 8893d9d5f..5a3181a36 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -293,8 +293,6 @@ void Title_Init(GameState* thisx) { //ResourceMgr_LoadDirectory("nintendo_rogo_static*"); - // Disable vismono - D_801614B0.a = 0; R_UPDATE_RATE = 1; Matrix_Init(&this->state); View_Init(&this->view, this->state.gfxCtx);