Skip to content

Commit

Permalink
Libretro: Add more audio settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Nov 28, 2024
1 parent 3b6190b commit a110191
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
13 changes: 1 addition & 12 deletions src/core/audio/hle_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,20 +704,9 @@ namespace Audio {
AAC::Message response;

switch (request.command) {
case AAC::Command::EncodeDecode: {
// Dummy response to stop games from hanging
response.resultCode = AAC::ResultCode::Success;
response.decodeResponse.channelCount = 2;
response.decodeResponse.sampleCount = 1024;
response.decodeResponse.size = 0;
response.decodeResponse.sampleRate = AAC::SampleRate::Rate48000;

response.command = request.command;
response.mode = request.mode;

case AAC::Command::EncodeDecode:
aacDecoder->decode(response, request, [this](u32 paddr) { return getPointerPhys<u8>(paddr); }, settings.aacEnabled);
break;
}

case AAC::Command::Init:
case AAC::Command::Shutdown:
Expand Down
9 changes: 7 additions & 2 deletions src/libretro_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,16 @@ static void configInit() {
{"panda3ds_use_vsync", "Enable VSync; enabled|disabled"},
{"panda3ds_dsp_emulation", "DSP emulation; HLE|LLE|Null"},
{"panda3ds_use_audio", "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"},
{"panda3ds_ubershader_lighting_override", "Force shadergen when rendering lights; enabled|disabled"},
{"panda3ds_ubershader_lighting_override_threshold", "Light threshold for forcing shadergen; 1|2|3|4|5|6|7|8"},
{"panda3ds_use_virtual_sd", "Enable virtual SD card; enabled|disabled"},
{"panda3ds_write_protect_virtual_sd", "Write protect virtual SD card; disabled|enabled"},
{"panda3ds_battery_level", "Battery percentage; 5|10|20|30|50|70|90|100"},
{"panda3ds_use_charger", "Charger plugged; enabled|disabled"},
{"panda3ds_ubershader_lighting_override", "Force shadergen when rendering lights; enabled|disabled"},
{"panda3ds_ubershader_lighting_override_threshold", "Light threshold for forcing shadergen; 1|2|3|4|5|6|7|8"},
{nullptr, nullptr},
};

Expand All @@ -196,6 +199,8 @@ static void configUpdate() {
config.dspType = Audio::DSPCore::typeFromString(fetchVariable("panda3ds_dsp_emulation", "null"));
config.audioEnabled = fetchVariableBool("panda3ds_use_audio", false);
config.aacEnabled = fetchVariableBool("panda3ds_enable_aac", true);
config.audioDeviceConfig.muteAudio = fetchVariableBool("panda3ds_mute_audio", false);
config.audioDeviceConfig.volumeRaw = float(fetchVariableRange("panda3ds_audio_volume", 0, 200)) / 100.0f;

config.sdCardInserted = fetchVariableBool("panda3ds_use_virtual_sd", true);
config.sdWriteProtected = fetchVariableBool("panda3ds_write_protect_virtual_sd", false);
Expand Down

0 comments on commit a110191

Please sign in to comment.