android: config: Update to reflect latest settings.

This commit is contained in:
bunnei 2019-07-07 23:20:06 -04:00
parent df9ac5fac2
commit 4925d371b3
3 changed files with 56 additions and 37 deletions

View File

@ -65,7 +65,7 @@ void Config::ReadValues() {
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
std::string default_param = InputManager::GenerateButtonParamPackage(default_buttons[i]); std::string default_param = InputManager::GenerateButtonParamPackage(default_buttons[i]);
Settings::values.current_input_profile.buttons[i] = Settings::values.current_input_profile.buttons[i] =
sdl2_config->Get("Controls", Settings::NativeButton::mapping[i], default_param); sdl2_config->GetString("Controls", Settings::NativeButton::mapping[i], default_param);
if (Settings::values.current_input_profile.buttons[i].empty()) if (Settings::values.current_input_profile.buttons[i].empty())
Settings::values.current_input_profile.buttons[i] = default_param; Settings::values.current_input_profile.buttons[i] = default_param;
} }
@ -73,20 +73,21 @@ void Config::ReadValues() {
for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
std::string default_param = InputManager::GenerateAnalogParamPackage(default_analogs[i]); std::string default_param = InputManager::GenerateAnalogParamPackage(default_analogs[i]);
Settings::values.current_input_profile.analogs[i] = Settings::values.current_input_profile.analogs[i] =
sdl2_config->Get("Controls", Settings::NativeAnalog::mapping[i], default_param); sdl2_config->GetString("Controls", Settings::NativeAnalog::mapping[i], default_param);
if (Settings::values.current_input_profile.analogs[i].empty()) if (Settings::values.current_input_profile.analogs[i].empty())
Settings::values.current_input_profile.analogs[i] = default_param; Settings::values.current_input_profile.analogs[i] = default_param;
} }
Settings::values.current_input_profile.motion_device = Settings::values.current_input_profile.motion_device = sdl2_config->GetString(
sdl2_config->Get("Controls", "motion_device", "Controls", "motion_device",
"engine:motion_emu,update_period:100,sensitivity:0.01,tilt_clamp:90.0"); "engine:motion_emu,update_period:100,sensitivity:0.01,tilt_clamp:90.0");
Settings::values.current_input_profile.touch_device = Settings::values.current_input_profile.touch_device =
sdl2_config->Get("Controls", "touch_device", "engine:emu_window"); sdl2_config->GetString("Controls", "touch_device", "engine:emu_window");
Settings::values.current_input_profile.udp_input_address = Settings::values.current_input_profile.udp_input_address = sdl2_config->GetString(
sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_ADDR); "Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_ADDR);
Settings::values.current_input_profile.udp_input_port = static_cast<u16>(sdl2_config->GetInteger( Settings::values.current_input_profile.udp_input_port =
"Controls", "udp_input_port", InputCommon::CemuhookUDP::DEFAULT_PORT)); static_cast<u16>(sdl2_config->GetInteger("Controls", "udp_input_port",
InputCommon::CemuhookUDP::DEFAULT_PORT));
// Core // Core
Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);
@ -102,6 +103,7 @@ void Config::ReadValues() {
Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true);
Settings::values.resolution_factor = Settings::values.resolution_factor =
static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1)); static_cast<u16>(sdl2_config->GetInteger("Renderer", "resolution_factor", 1));
Settings::values.vsync_enabled = sdl2_config->GetBoolean("Renderer", "vsync_enabled", false);
Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true);
Settings::values.frame_limit = Settings::values.frame_limit =
static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100));
@ -110,9 +112,10 @@ void Config::ReadValues() {
Settings::values.factor_3d = Settings::values.factor_3d =
static_cast<u8>(sdl2_config->GetInteger("Renderer", "factor_3d", 0)); static_cast<u8>(sdl2_config->GetInteger("Renderer", "factor_3d", 0));
Settings::values.bg_red = (float)sdl2_config->GetReal("Renderer", "bg_red", 0.0); Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0));
Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 0.0); Settings::values.bg_green =
Settings::values.bg_blue = (float)sdl2_config->GetReal("Renderer", "bg_blue", 0.0); static_cast<float>(sdl2_config->GetReal("Renderer", "bg_green", 0.0));
Settings::values.bg_blue = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_blue", 0.0));
// Layout // Layout
Settings::values.layout_option = Settings::values.layout_option =
@ -137,11 +140,18 @@ void Config::ReadValues() {
static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_bottom", 480)); static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_bottom", 480));
// Audio // Audio
Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); Settings::values.enable_dsp_lle = sdl2_config->GetBoolean("Audio", "enable_dsp_lle", false);
Settings::values.enable_dsp_lle_multithread =
sdl2_config->GetBoolean("Audio", "enable_dsp_lle_multithread", false);
Settings::values.sink_id = sdl2_config->GetString("Audio", "output_engine", "auto");
Settings::values.enable_audio_stretching = Settings::values.enable_audio_stretching =
sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true); sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true);
Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto"); Settings::values.audio_device_id = sdl2_config->GetString("Audio", "output_device", "auto");
Settings::values.volume = sdl2_config->GetReal("Audio", "volume", 1); Settings::values.volume = static_cast<float>(sdl2_config->GetReal("Audio", "volume", 1));
Settings::values.mic_input_device =
sdl2_config->GetString("Audio", "mic_input_device", "Default");
Settings::values.mic_input_type =
static_cast<Settings::MicInputType>(sdl2_config->GetInteger("Audio", "mic_input_type", 0));
// Data Storage // Data Storage
Settings::values.use_virtual_sd = Settings::values.use_virtual_sd =
@ -152,7 +162,7 @@ void Config::ReadValues() {
Settings::values.region_value = Settings::values.region_value =
sdl2_config->GetInteger("System", "region_value", Settings::REGION_VALUE_AUTO_SELECT); sdl2_config->GetInteger("System", "region_value", Settings::REGION_VALUE_AUTO_SELECT);
Settings::values.init_clock = Settings::values.init_clock =
static_cast<Settings::InitClock>(sdl2_config->GetInteger("System", "init_clock", 0)); static_cast<Settings::InitClock>(sdl2_config->GetInteger("System", "init_clock", 1));
{ {
std::tm t; std::tm t;
t.tm_sec = 1; t.tm_sec = 1;
@ -163,7 +173,7 @@ void Config::ReadValues() {
t.tm_year = 100; t.tm_year = 100;
t.tm_isdst = 0; t.tm_isdst = 0;
std::istringstream string_stream( std::istringstream string_stream(
sdl2_config->Get("System", "init_time", "2000-01-01 00:00:01")); sdl2_config->GetString("System", "init_time", "2000-01-01 00:00:01"));
string_stream >> std::get_time(&t, "%Y-%m-%d %H:%M:%S"); string_stream >> std::get_time(&t, "%Y-%m-%d %H:%M:%S");
if (string_stream.fail()) { if (string_stream.fail()) {
LOG_ERROR(Config, "Failed To parse init_time. Using 2000-01-01 00:00:01"); LOG_ERROR(Config, "Failed To parse init_time. Using 2000-01-01 00:00:01");
@ -177,26 +187,26 @@ void Config::ReadValues() {
// Camera // Camera
using namespace Service::CAM; using namespace Service::CAM;
Settings::values.camera_name[OuterRightCamera] = Settings::values.camera_name[OuterRightCamera] =
sdl2_config->Get("Camera", "camera_outer_right_name", "blank"); sdl2_config->GetString("Camera", "camera_outer_right_name", "blank");
Settings::values.camera_config[OuterRightCamera] = Settings::values.camera_config[OuterRightCamera] =
sdl2_config->Get("Camera", "camera_outer_right_config", ""); sdl2_config->GetString("Camera", "camera_outer_right_config", "");
Settings::values.camera_flip[OuterRightCamera] = Settings::values.camera_flip[OuterRightCamera] =
sdl2_config->GetInteger("Camera", "camera_outer_right_flip", 0); sdl2_config->GetInteger("Camera", "camera_outer_right_flip", 0);
Settings::values.camera_name[InnerCamera] = Settings::values.camera_name[InnerCamera] =
sdl2_config->Get("Camera", "camera_inner_name", "blank"); sdl2_config->GetString("Camera", "camera_inner_name", "blank");
Settings::values.camera_config[InnerCamera] = Settings::values.camera_config[InnerCamera] =
sdl2_config->Get("Camera", "camera_inner_config", ""); sdl2_config->GetString("Camera", "camera_inner_config", "");
Settings::values.camera_flip[InnerCamera] = Settings::values.camera_flip[InnerCamera] =
sdl2_config->GetInteger("Camera", "camera_inner_flip", 0); sdl2_config->GetInteger("Camera", "camera_inner_flip", 0);
Settings::values.camera_name[OuterLeftCamera] = Settings::values.camera_name[OuterLeftCamera] =
sdl2_config->Get("Camera", "camera_outer_left_name", "blank"); sdl2_config->GetString("Camera", "camera_outer_left_name", "blank");
Settings::values.camera_config[OuterLeftCamera] = Settings::values.camera_config[OuterLeftCamera] =
sdl2_config->Get("Camera", "camera_outer_left_config", ""); sdl2_config->GetString("Camera", "camera_outer_left_config", "");
Settings::values.camera_flip[OuterLeftCamera] = Settings::values.camera_flip[OuterLeftCamera] =
sdl2_config->GetInteger("Camera", "camera_outer_left_flip", 0); sdl2_config->GetInteger("Camera", "camera_outer_left_flip", 0);
// Miscellaneous // Miscellaneous
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Info"); Settings::values.log_filter = sdl2_config->GetString("Miscellaneous", "log_filter", "*:Info");
// Debugging // Debugging
Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false);

View File

@ -14,12 +14,10 @@ class Config {
std::string sdl2_config_loc; std::string sdl2_config_loc;
bool LoadINI(const std::string& default_contents = "", bool retry = true); bool LoadINI(const std::string& default_contents = "", bool retry = true);
void ReadValues(); void ReadValues();
public: public:
Config(); Config();
~Config(); ~Config();
void Reload(); void Reload();

View File

@ -38,6 +38,8 @@ button_l=
button_r= button_r=
button_start= button_start=
button_select= button_select=
button_debug=
button_gpio14=
button_zl= button_zl=
button_zr= button_zr=
button_home= button_home=
@ -90,6 +92,10 @@ udp_pad_index=
use_cpu_jit = use_cpu_jit =
[Renderer] [Renderer]
# Whether to render using GLES or OpenGL
# 0: OpenGL, 1 (default): GLES
use_gles =
# Whether to use software or hardware rendering. # Whether to use software or hardware rendering.
# 0: Software, 1 (default): Hardware # 0: Software, 1 (default): Hardware
use_hw_renderer = use_hw_renderer =
@ -117,7 +123,7 @@ resolution_factor =
# Whether to enable V-Sync (caps the framerate at 60FPS) or not. # Whether to enable V-Sync (caps the framerate at 60FPS) or not.
# 0 (default): Off, 1: On # 0 (default): Off, 1: On
use_vsync = vsync_enabled =
# Turns on the frame limiter, which will limit frames output to the target game speed # Turns on the frame limiter, which will limit frames output to the target game speed
# 0: Off, 1: On (default) # 0: Off, 1: On (default)
@ -167,6 +173,15 @@ custom_bottom_bottom =
swap_screen = swap_screen =
[Audio] [Audio]
# Whether or not to enable DSP LLE
# 0 (default): No, 1: Yes
enable_dsp_lle =
# Whether or not to run DSP LLE on a different thread
# 0 (default): No, 1: Yes
enable_dsp_lle_thread =
# Which audio output engine to use. # Which audio output engine to use.
# auto (default): Auto-select, null: No audio output, sdl2: SDL2 (if available) # auto (default): Auto-select, null: No audio output, sdl2: SDL2 (if available)
output_engine = output_engine =
@ -245,14 +260,10 @@ gdbstub_port=24689
# Whether or not to enable telemetry # Whether or not to enable telemetry
# 0: No, 1 (default): Yes # 0: No, 1 (default): Yes
enable_telemetry = enable_telemetry =
# Endpoint URL for submitting telemetry data # URL for Web API
telemetry_endpoint_url = https://services.citra-emu.org/api/telemetry web_api_url = https://api.citra-emu.org
# Endpoint URL to verify the username and token
verify_endpoint_url = https://services.citra-emu.org/api/profile
# Endpoint URL for announcing public rooms
announce_multiplayer_room_endpoint_url = https://services.citra-emu.org/api/multiplayer/rooms
# Username and token for Citra Web Service # Username and token for Citra Web Service
# See https://services.citra-emu.org/ for more info # See https://profile.citra-emu.org/ for more info
citra_username = citra_username =
citra_token = citra_token =
)"; )";