Skip to content

Commit

Permalink
Remove ADPCM compression from DSi Shop music
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Jun 24, 2023
1 parent 1029714 commit 6503f0d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
2 changes: 0 additions & 2 deletions romsel_dsimenutheme/arm9/source/graphics/themefilenames.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@

#define TFN_SHOP_START_SOUND_BG TFN_SYSTEM_SOUND_DIRECTORY"/shopbg.start.wav"
#define TFN_SHOP_LOOP_SOUND_BG TFN_SYSTEM_SOUND_DIRECTORY"/shopbg.loop.wav"
#define TFN_SHOP_START_SOUND_BG_CACHE TFN_SYSTEM_SOUND_CACHE_DIRECTORY"/shopbg.start.raw"
#define TFN_SHOP_LOOP_SOUND_BG_CACHE TFN_SYSTEM_SOUND_CACHE_DIRECTORY"/shopbg.loop.raw"

#define TFN_HBL_START_SOUND_BG TFN_SYSTEM_SOUND_DIRECTORY"/hbl.start.wav"
#define TFN_HBL_LOOP_SOUND_BG TFN_SYSTEM_SOUND_DIRECTORY"/hbl.loop.wav"
Expand Down
20 changes: 4 additions & 16 deletions romsel_dsimenutheme/arm9/source/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,11 @@ SoundControl::SoundControl()
loopableMusic = true;
break; }
case 2: { // DSi Shop
std::string startPath = (devicePath+TFN_SHOP_START_SOUND_BG_CACHE);
if (access(startPath.c_str(), F_OK) != 0 || getFileSize(startPath.c_str()) == 0) {
if (adpcm_main(std::string(TFN_SHOP_START_SOUND_BG).c_str(), startPath.c_str(), true) == -1) {
remove(startPath.c_str());
}
}
std::string loopPath = (devicePath+TFN_SHOP_LOOP_SOUND_BG_CACHE);
if (access(loopPath.c_str(), F_OK) != 0 || getFileSize(loopPath.c_str()) == 0) {
if (adpcm_main(std::string(TFN_SHOP_LOOP_SOUND_BG).c_str(), loopPath.c_str(), true) == -1) {
remove(startPath.c_str());
remove(loopPath.c_str());
}
}
stream.sampling_rate = 44100; // 44100Hz
stream.format = MM_STREAM_8BIT_STEREO;
stream_start_source = fopen(startPath.c_str(), "rb");
stream_source = fopen(loopPath.c_str(), "rb");
stream.format = MM_STREAM_16BIT_MONO;
stream_start_source = fopen(std::string(TFN_SHOP_START_SOUND_BG).c_str(), "rb");
stream_source = fopen(std::string(TFN_SHOP_LOOP_SOUND_BG).c_str(), "rb");
seekPos = 0x2C;
loopableMusic = true;
break; }
case 3: { // Theme
Expand Down
Binary file modified romsel_dsimenutheme/nitrofiles/sound/shopbg.loop.wav
Binary file not shown.
Binary file modified romsel_dsimenutheme/nitrofiles/sound/shopbg.start.wav
Binary file not shown.

0 comments on commit 6503f0d

Please sign in to comment.