diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 387db1cc..03649039 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -78,7 +78,7 @@ TextureFilter=1 GPUBlt=0 ;Set to 1 to allow using 32-bit textures for talking heads -;The texture files should be placed in art\heads\\ (w/o extension) +;The texture files should be placed in art\heads\\ (without extension) ;The files in the folder should be numbered according to the number of frames in the talking head FRM file (0.png, 1.png, etc.) ;See the text file in the modders pack for a detailed description ;Requires DX9 graphics mode and v2.0 pixel shader support (see GPUBlt option) @@ -131,6 +131,15 @@ OverrideMusicDir=1 ;This will slightly increase the startup time of the game on older computers AutoSearchSFX=1 +;Uncomment these lines to override the names of sound files for game modes +;Filenames are limited to 8 characters (without extension) +;MainMenuMusic=07desert +;WorldMapMusic=23world +;WorldMapCarMusic=20car +;EndGameMovieMusic0=akiss +;EndGameMovieMusic1=10labone +;MapLoadingSound=wind2 + ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [Input] ;Set to 1 to enable the mouse scroll wheel to scroll through the inventory, barter, and loot screens @@ -232,7 +241,6 @@ DebugEditorKey=0 ;- disables playing the final movie/credits after the endgame slideshow ;- disables halving the weight for power armor items ;- endgame_movie script function plays movie 10 or 11 based on the player's gender before the credits -;- changes the world map music to '03wrldmp.acm' and the credits music to 'maybe.acm' Fallout1Behavior=0 ;Time limit in years. Must be between -3 and 13 @@ -296,15 +304,15 @@ FemaleDialogMsgs=0 DialogGenderWords=0 ;To change the default and starting player models, uncomment the next four lines. -;The default models can also be changed ingame via script +;The default models can also be changed in-game via script ;MaleStartModel=hmwarr ;MaleDefaultModel=hmjmps ;FemaleStartModel=hfprim ;FemaleDefaultModel=hfjmps -;To change the various ingame movies, modify the next 17 lines +;To change the various in-game movies, modify the next 17 lines ;You can also define additional movies by adding Movie18 - Movie32 lines -;Most of these can also be changed ingame via script +;Most of these can also be changed in-game via script Movie1=iplogo.mve Movie2=intro.mve Movie3=elder.mve @@ -754,7 +762,7 @@ AIBestWeaponFix=1 ;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as a preference list when using drugs in their inventory ;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder) -;Note: chem_primary_desire w/o fixes prevents the specified item PID from being consumed if all three values in the list are the same PID +;Note: chem_primary_desire without fixes prevents the specified item from being consumed if all three values in the list are the same PID ;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground AIDrugUsePerfFix=0 diff --git a/sfall/Modules/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp index e83e88b0..0fce192b 100644 --- a/sfall/Modules/MiscPatches.cpp +++ b/sfall/Modules/MiscPatches.cpp @@ -774,8 +774,6 @@ static void F1EngineBehaviorPatch() { BlockCall(0x4A4343); // disable playing the final movie/credits after the endgame slideshow SafeWrite8(0x477C71, CodeType::JumpShort); // disable halving the weight for power armor items HookCall(0x43F872, endgame_movie_hook); // play movie 10 or 11 based on the player's gender before the credits - SafeWrite32(0x4C2361, (DWORD)&"03wrldmp"); // change the world map music to 03wrldmp.acm - SafeWriteStr(0x501A40, "maybe"); // change the credits music to maybe.acm } } diff --git a/sfall/Modules/Sound.cpp b/sfall/Modules/Sound.cpp index 964763d6..fbed04fa 100644 --- a/sfall/Modules/Sound.cpp +++ b/sfall/Modules/Sound.cpp @@ -979,6 +979,13 @@ static void __declspec(naked) sfxl_init_hook() { static const int SampleRate = 44100; // 44.1kHz +static char mainMenuMusic[12] = {}; +static char worldMapMusic[12] = {}; +static char worldMapCarMusic[12] = {}; +static char endGameMovieMusic0[12] = {}; +static char endGameMovieMusic1[12] = {}; +static char mapLoadingSound[12] = {}; + void Sound::OnAfterGameInit() { *fo::ptr::sampleRate = SampleRate / 2; // Revert to 22kHz for secondary sound buffers } @@ -1065,6 +1072,25 @@ void Sound::init() { const DWORD sfxlInitAddr[] = {0x4A9999, 0x4A9B34}; HookCalls(sfxl_init_hook, sfxlInitAddr); } + + if (IniReader::GetConfigString("Sound", "MainMenuMusic", "", mainMenuMusic, 9)) { + SafeWrite32(0x480A04, (DWORD)&mainMenuMusic); + } + if (IniReader::GetConfigString("Sound", "WorldMapMusic", "", worldMapMusic, 9)) { + SafeWrite32(0x4C2361, (DWORD)&worldMapMusic); + } + if (IniReader::GetConfigString("Sound", "WorldMapCarMusic", "", worldMapCarMusic, 9)) { + SafeWrite32(0x4C236D, (DWORD)&worldMapCarMusic); + } + if (IniReader::GetConfigString("Sound", "EndGameMovieMusic0", "", endGameMovieMusic0, 9)) { + SafeWrite32(0x43F853, (DWORD)&endGameMovieMusic0); + } + if (IniReader::GetConfigString("Sound", "EndGameMovieMusic1", "", endGameMovieMusic1, 9)) { + SafeWrite32(0x440750, (DWORD)&endGameMovieMusic1); + } + if (IniReader::GetConfigString("Sound", "MapLoadingSound", "", mapLoadingSound, 9)) { + SafeWrite32(0x482B9C, (DWORD)&mapLoadingSound); + } } void Sound::exit() {