Skip to content

Commit

Permalink
DSi-based themes: Tweak startup jingle / music conditions (#2336)
Browse files Browse the repository at this point in the history
  • Loading branch information
DieGo367 authored Dec 19, 2023
1 parent fdc27c4 commit 3292d12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion romsel_dsimenutheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ std::string browseForFile(const std::vector<std::string_view> 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");
Expand Down
10 changes: 8 additions & 2 deletions romsel_dsimenutheme/arm9/source/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
Expand Down
1 change: 1 addition & 0 deletions romsel_dsimenutheme/nitrofiles/themes/3ds/light/theme.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ FontPalette4 = 0xA108

UsernameUserPalette = 1
PurpleBatteryAvailable = 1
PlayStartupJingle = 1

RotatingCubesRenderY = 78
RenderPhoto = 0

0 comments on commit 3292d12

Please sign in to comment.