From 645d64a73a190f98d5393cb4223be137af48b9ff Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Thu, 11 Jun 2026 13:21:57 -0700 Subject: [PATCH] fix los bgm --- include/Z2AudioLib/Z2SceneMgr.h | 4 ++++ src/Z2AudioLib/SpotName.h | 3 +++ src/Z2AudioLib/Z2SceneMgr.cpp | 24 +++++++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/Z2AudioLib/Z2SceneMgr.h b/include/Z2AudioLib/Z2SceneMgr.h index 1b3ef2cc0b..d988c97f45 100644 --- a/include/Z2AudioLib/Z2SceneMgr.h +++ b/include/Z2AudioLib/Z2SceneMgr.h @@ -158,6 +158,10 @@ enum Z2Scene { /* 0x4E */ Z2SCENE_GROTTO_ROCK_2, /* 0x4F */ Z2SCENE_GROTTO_POND, /* 0x50 */ Z2SCENE_FARON_WOODS_CAVE, + +#if TARGET_PC + /* 0x51 */ Z2SCENE_CAVE_OF_SHADOWS, +#endif }; #endif /* Z2SCENEMGR_H */ diff --git a/src/Z2AudioLib/SpotName.h b/src/Z2AudioLib/SpotName.h index e531fb7524..aa7aaa51f2 100644 --- a/src/Z2AudioLib/SpotName.h +++ b/src/Z2AudioLib/SpotName.h @@ -15,6 +15,9 @@ static const char* sSpotName[] = { "D_MN08A", "D_MN08D", "D_MN09", "D_MN09A", "D_MN09B", "D_MN09C", "D_SB00", "D_SB01", "D_SB02", "D_SB03", "D_SB04", "D_SB05", "D_SB06", "D_SB07", "D_SB08", "D_SB09", "D_SB10", +#if TARGET_PC + "D_SB11", +#endif }; #endif /* SPOTNAME_H */ diff --git a/src/Z2AudioLib/Z2SceneMgr.cpp b/src/Z2AudioLib/Z2SceneMgr.cpp index 1b2152fcb7..e2ce0141e2 100644 --- a/src/Z2AudioLib/Z2SceneMgr.cpp +++ b/src/Z2AudioLib/Z2SceneMgr.cpp @@ -1603,13 +1603,35 @@ void Z2SceneMgr::setSceneName(char* spot, s32 room, s32 layer) { bgm_wave1 = 0x45; } break; +#if TARGET_PC + case Z2SCENE_CAVE_OF_SHADOWS: + if (room == 29) { + se_wave2 = 0x16; + } else if (room == 40) { + se_wave2 = 0x12; + } else { + se_wave2 = 0x36; + } + + bgm_wave1 = 0x45; + se_wave1 = 0x51; + mDoAud_zelAudio_c::onBgmSet(); + bgm_id = Z2BGM_SUB_DUNGEON; + + if (BGM_ID == Z2BGM_SUB_DUNGEON) { + if (sceneNum == Z2SCENE_CAVE_OF_ORDEALS) { + BGM_ID = -1; + } + } + break; +#endif } /*dSv_event_flag_c::M_071 - Cutscene - [cutscene: 20] Zant appears (during Midna's desperate hour) */ if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[104]) /* dSv_event_flag_c::F_0250 - Cutscene - [cutscene: 21] reunion with Zelda / Midna revived (Hyrule Castle barrier appears) */ && !dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[250]) - && demo_wave == 0 && spotNo != Z2SCENE_ELDIN_BRIDGE_BATTLE) + && demo_wave == 0 && spotNo != Z2SCENE_ELDIN_BRIDGE_BATTLE IF_DUSK(&& spotNo != Z2SCENE_CAVE_OF_SHADOWS)) { bgm_wave1 = 0x36; if (spotNo == Z2SCENE_CASTLE_TOWN_SHOPS && room == 5) {