Skip to content

Commit

Permalink
add config option to enable/disable boot sound, don't play during OSS…
Browse files Browse the repository at this point in the history
…creen section
  • Loading branch information
goeiecool9999 committed Dec 17, 2023
1 parent dc127e5 commit 99aef27
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Cafe/HW/Latte/Core/LatteThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,16 @@ int Latte_ThreadEntry()
// before doing anything with game specific shaders, we need to wait for graphic packs to finish loading
GraphicPack2::WaitUntilReady();

LatteThread_InitBootSound();
// initialise resources for playing bootup sound
if(GetConfig().play_boot_sound)
LatteThread_InitBootSound();

// load disk shader cache
LatteShaderCache_Load();

// free resources for playing boot sound
LatteThread_ShutdownBootSound();

// init registers
Latte_LoadInitialRegisters();
// let CPU thread know the GPU is done initializing
Expand All @@ -198,11 +205,9 @@ int Latte_ThreadEntry()
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::milliseconds(1));
LatteThread_HandleOSScreen();
LatteThread_StreamBootSound();
if (Latte_GetStopSignal())
LatteThread_Exit();
}
LatteThread_ShutdownBootSound();
gxRingBufferReadPtr = gx2WriteGatherPipe.gxRingBuffer;
LatteCP_ProcessRingbuffer();
cemu_assert_debug(false); // should never reach
Expand Down
2 changes: 2 additions & 0 deletions src/config/CemuConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
fullscreen = parser.get("fullscreen", fullscreen);
proxy_server = parser.get("proxy_server", "");
disable_screensaver = parser.get("disable_screensaver", disable_screensaver);
play_boot_sound = parser.get("play_boot_sound", play_boot_sound);
console_language = parser.get("console_language", console_language.GetInitValue());

window_position.x = parser.get("window_position").get("x", -1);
Expand Down Expand Up @@ -364,6 +365,7 @@ void CemuConfig::Save(XMLConfigParser& parser)
config.set<bool>("fullscreen", fullscreen);
config.set("proxy_server", proxy_server.GetValue().c_str());
config.set<bool>("disable_screensaver", disable_screensaver);
config.set<bool>("play_boot_sound", play_boot_sound);

// config.set("cpu_mode", cpu_mode.GetValue());
//config.set("console_region", console_region.GetValue());
Expand Down
1 change: 1 addition & 0 deletions src/config/CemuConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ struct CemuConfig
#endif
ConfigValue<bool> disable_screensaver{DISABLE_SCREENSAVER_DEFAULT};
#undef DISABLE_SCREENSAVER_DEFAULT
ConfigValue<bool> play_boot_sound{true};

std::vector<std::string> game_paths;
std::mutex game_cache_entries_mutex;
Expand Down
8 changes: 8 additions & 0 deletions src/gui/GeneralSettings2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,13 @@ wxPanel* GeneralSettings2::AddGeneralPage(wxNotebook* notebook)
m_disable_screensaver->SetToolTip(_("Prevents the system from activating the screen saver or going to sleep while running a game."));
second_row->Add(m_disable_screensaver, 0, botflag, 5);

m_play_boot_sound = new wxCheckBox(box, wxID_ANY, _("Enable intro sound"));
m_play_boot_sound->SetToolTip(_("Play bootSound file while compiling shaders/pipelines."));
second_row->Add(m_play_boot_sound, 0, botflag, 5);

// Enable/disable feral interactive gamemode
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
second_row->AddSpacer(10);
m_feral_gamemode = new wxCheckBox(box, wxID_ANY, _("Enable Feral GameMode"));
m_feral_gamemode->SetToolTip(_("Use FeralInteractive GameMode if installed."));
second_row->Add(m_feral_gamemode, 0, botflag, 5);
Expand Down Expand Up @@ -912,6 +917,8 @@ void GeneralSettings2::StoreConfig()
ScreenSaver::SetInhibit(config.disable_screensaver);
}

config.play_boot_sound = m_play_boot_sound->IsChecked();

if (!LaunchSettings::GetMLCPath().has_value())
config.SetMLCPath(wxHelper::MakeFSPath(m_mlc_path->GetValue()), false);

Expand Down Expand Up @@ -1518,6 +1525,7 @@ void GeneralSettings2::ApplyConfig()

m_permanent_storage->SetValue(config.permanent_storage);
m_disable_screensaver->SetValue(config.disable_screensaver);
m_play_boot_sound->SetValue(config.play_boot_sound);
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
m_feral_gamemode->SetValue(config.feral_gamemode);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/gui/GeneralSettings2.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GeneralSettings2 : public wxDialog
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
wxCheckBox* m_feral_gamemode;
#endif
wxCheckBox* m_play_boot_sound;
wxListBox* m_game_paths;
wxTextCtrl* m_mlc_path;

Expand Down

0 comments on commit 99aef27

Please sign in to comment.