From 3292d125c0014a5108d895c9a9f790828d0df9b6 Mon Sep 17 00:00:00 2001 From: DVDo Date: Tue, 19 Dec 2023 06:58:27 -0800 Subject: [PATCH] DSi-based themes: Tweak startup jingle / music conditions (#2336) --- romsel_dsimenutheme/arm9/source/fileBrowse.cpp | 2 +- romsel_dsimenutheme/arm9/source/sound.cpp | 10 ++++++++-- .../nitrofiles/themes/3ds/light/theme.ini | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/romsel_dsimenutheme/arm9/source/fileBrowse.cpp b/romsel_dsimenutheme/arm9/source/fileBrowse.cpp index 885f448fd8..68bd9771d4 100644 --- a/romsel_dsimenutheme/arm9/source/fileBrowse.cpp +++ b/romsel_dsimenutheme/arm9/source/fileBrowse.cpp @@ -2889,7 +2889,7 @@ std::string browseForFile(const std::vector extensionList) { if (!musicplaying && ms().theme != TWLSettings::EThemeSaturn) { if (ms().dsiMusic != 0) { - if ((ms().theme == TWLSettings::ETheme3DS && (ms().dsiMusic == 1 || ms().dsiMusic == 4)) || (ms().dsiMusic == 3 && tc().playStartupJingle())) { + if (ms().dsiMusic == 4 || (ms().dsiMusic == 3 && tc().playStartupJingle())) { //logPrint("snd().playStartup()\n"); snd().playStartup(); //logPrint("snd().setStreamDelay(snd().getStartupSoundLength() - tc().startupJingleDelayAdjust())\n"); diff --git a/romsel_dsimenutheme/arm9/source/sound.cpp b/romsel_dsimenutheme/arm9/source/sound.cpp index 548e32cfd7..749e27e040 100644 --- a/romsel_dsimenutheme/arm9/source/sound.cpp +++ b/romsel_dsimenutheme/arm9/source/sound.cpp @@ -270,9 +270,15 @@ SoundControl::SoundControl() case 4: case 1: default: { - stream.sampling_rate = ms().dsiMusic == 4 ? 32000 : 16000; // 32000Hz or 16000Hz + bool use3DSMusic = ms().dsiMusic == 4 || (ms().dsiMusic == 3 && ms().theme == TWLSettings::ETheme3DS); + bool useHBLMusic = ms().dsiMusic == 3 && ms().theme == TWLSettings::EThemeHBL; + stream.sampling_rate = useHBLMusic ? 44100 : (use3DSMusic ? 32000 : 16000); // 44100Hz, 32000Hz, or 16000Hz stream.format = MM_STREAM_16BIT_MONO; - stream_source = fopen(std::string(ms().dsiMusic == 4 ? TFN_DEFAULT_SOUND_BG_3D : TFN_DEFAULT_SOUND_BG).c_str(), "rb"); + if (useHBLMusic) { + stream_start_source = fopen(std::string(TFN_HBL_START_SOUND_BG).c_str(), "rb"); + loopableMusic = true; + } + stream_source = fopen(std::string(useHBLMusic ? TFN_HBL_LOOP_SOUND_BG : (use3DSMusic ? TFN_DEFAULT_SOUND_BG_3D : TFN_DEFAULT_SOUND_BG)).c_str(), "rb"); seekPos = 0x2C; break; } } diff --git a/romsel_dsimenutheme/nitrofiles/themes/3ds/light/theme.ini b/romsel_dsimenutheme/nitrofiles/themes/3ds/light/theme.ini index be024cada9..a03f7f0138 100644 --- a/romsel_dsimenutheme/nitrofiles/themes/3ds/light/theme.ini +++ b/romsel_dsimenutheme/nitrofiles/themes/3ds/light/theme.ini @@ -34,6 +34,7 @@ FontPalette4 = 0xA108 UsernameUserPalette = 1 PurpleBatteryAvailable = 1 +PlayStartupJingle = 1 RotatingCubesRenderY = 78 RenderPhoto = 0 \ No newline at end of file