Skip to content

Commit

Permalink
Merge pull request #686 from wheremyfoodat/libretro-audio
Browse files Browse the repository at this point in the history
Enable audio by default on LR and add system language selection
  • Loading branch information
wheremyfoodat authored Dec 25, 2024
2 parents 3787358 + 5a2a332 commit 36c716d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion include/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ struct EmulatorConfig {
#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;
bool accelerateShaders = accelerateShadersDefault;
Expand All @@ -66,7 +72,7 @@ struct EmulatorConfig {
bool sdWriteProtected = false;
bool usePortableBuild = false;

bool audioEnabled = false;
bool audioEnabled = audioEnabledDefault;
bool vsyncEnabled = true;
bool aacEnabled = true; // Enable AAC audio?

Expand Down
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void EmulatorConfig::load() {
auto dspCoreName = toml::find_or<std::string>(audio, "DSPEmulation", "HLE");
dspType = Audio::DSPCore::typeFromString(dspCoreName);

audioEnabled = toml::find_or<toml::boolean>(audio, "EnableAudio", false);
audioEnabled = toml::find_or<toml::boolean>(audio, "EnableAudio", audioEnabledDefault);
aacEnabled = toml::find_or<toml::boolean>(audio, "EnableAACAudio", true);
printDSPFirmware = toml::find_or<toml::boolean>(audio, "PrintDSPFirmware", false);

Expand Down
5 changes: 4 additions & 1 deletion src/libretro_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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);
Expand Down

0 comments on commit 36c716d

Please sign in to comment.