From 7c5f7954e591612a5bd6683329a479a9df6ca9de Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:41:55 +0200 Subject: [PATCH 1/2] Libretro: Add system language option --- include/config.hpp | 3 ++- src/config.cpp | 2 +- src/libretro_core.cpp | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/config.hpp b/include/config.hpp index 5301ae94e..749ba3af5 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -48,6 +48,7 @@ struct EmulatorConfig { static constexpr bool ubershaderDefault = true; #endif static constexpr bool accelerateShadersDefault = true; + static constexpr bool audioEnabledDefault = true; bool shaderJitEnabled = shaderJitDefault; bool useUbershaders = ubershaderDefault; @@ -66,7 +67,7 @@ struct EmulatorConfig { bool sdWriteProtected = false; bool usePortableBuild = false; - bool audioEnabled = false; + bool audioEnabled = audioEnabledDefault; bool vsyncEnabled = true; bool aacEnabled = true; // Enable AAC audio? diff --git a/src/config.cpp b/src/config.cpp index 5d9791c60..bfe84193e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -101,7 +101,7 @@ void EmulatorConfig::load() { auto dspCoreName = toml::find_or(audio, "DSPEmulation", "HLE"); dspType = Audio::DSPCore::typeFromString(dspCoreName); - audioEnabled = toml::find_or(audio, "EnableAudio", false); + audioEnabled = toml::find_or(audio, "EnableAudio", audioEnabledDefault); aacEnabled = toml::find_or(audio, "EnableAACAudio", true); printDSPFirmware = toml::find_or(audio, "PrintDSPFirmware", false); diff --git a/src/libretro_core.cpp b/src/libretro_core.cpp index 1e5b532df..fe3cb6c48 100644 --- a/src/libretro_core.cpp +++ b/src/libretro_core.cpp @@ -170,8 +170,9 @@ static void configInit() { {"panda3ds_use_ubershader", EmulatorConfig::ubershaderDefault ? "Use ubershaders (No stutter, maybe slower); enabled|disabled" : "Use ubershaders (No stutter, maybe slower); disabled|enabled"}, {"panda3ds_use_vsync", "Enable VSync; enabled|disabled"}, + {"panda3ds_system_language", "System language; En|Fr|Es|De|It|Pt|Nl|Ru|Ja|Zh|Ko|Tw"}, {"panda3ds_dsp_emulation", "DSP emulation; HLE|LLE|Null"}, - {"panda3ds_use_audio", "Enable audio; disabled|enabled"}, + {"panda3ds_use_audio", EmulatorConfig::audioEnabledDefault ? "Enable audio; enabled|disabled" : "Enable audio; disabled|enabled"}, {"panda3ds_audio_volume", "Audio volume; 100|0|10|20|40|60|80|90|100|120|140|150|180|200"}, {"panda3ds_mute_audio", "Mute audio; disabled|enabled"}, {"panda3ds_enable_aac", "Enable AAC audio; enabled|disabled"}, @@ -196,6 +197,8 @@ static void configUpdate() { config.shaderJitEnabled = fetchVariableBool("panda3ds_use_shader_jit", EmulatorConfig::shaderJitDefault); config.chargerPlugged = fetchVariableBool("panda3ds_use_charger", true); config.batteryPercentage = fetchVariableRange("panda3ds_battery_level", 5, 100); + config.systemLanguage = EmulatorConfig::languageCodeFromString(fetchVariable("panda3ds_system_language", "en")); + config.dspType = Audio::DSPCore::typeFromString(fetchVariable("panda3ds_dsp_emulation", "null")); config.audioEnabled = fetchVariableBool("panda3ds_use_audio", false); config.aacEnabled = fetchVariableBool("panda3ds_enable_aac", true); From 5a2a33224ca54ca0334d5184d4e1e928fea954eb Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:42:33 +0200 Subject: [PATCH 2/2] Only enable audio by default on libretro for now --- include/config.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/config.hpp b/include/config.hpp index 749ba3af5..d45aa05ce 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -48,7 +48,12 @@ struct EmulatorConfig { static constexpr bool ubershaderDefault = true; #endif static constexpr bool accelerateShadersDefault = true; + +#if defined(__LIBRETRO__) static constexpr bool audioEnabledDefault = true; +#else + static constexpr bool audioEnabledDefault = false; +#endif bool shaderJitEnabled = shaderJitDefault; bool useUbershaders = ubershaderDefault;