diff options
Diffstat (limited to 'src/yuzu_cmd/config.cpp')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 23448e747..41ef6f6b8 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -228,24 +228,24 @@ static const std::array<int, 8> keyboard_mods{ | |||
| 228 | 228 | ||
| 229 | void Config::ReadValues() { | 229 | void Config::ReadValues() { |
| 230 | // Controls | 230 | // Controls |
| 231 | for (std::size_t p = 0; p < Settings::values.players.size(); ++p) { | 231 | for (std::size_t p = 0; p < Settings::values.players.GetValue().size(); ++p) { |
| 232 | const auto group = fmt::format("ControlsP{}", p); | 232 | const auto group = fmt::format("ControlsP{}", p); |
| 233 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { | 233 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { |
| 234 | std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); | 234 | std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); |
| 235 | Settings::values.players[p].buttons[i] = | 235 | Settings::values.players.GetValue()[p].buttons[i] = |
| 236 | sdl2_config->Get(group, Settings::NativeButton::mapping[i], default_param); | 236 | sdl2_config->Get(group, Settings::NativeButton::mapping[i], default_param); |
| 237 | if (Settings::values.players[p].buttons[i].empty()) | 237 | if (Settings::values.players.GetValue()[p].buttons[i].empty()) |
| 238 | Settings::values.players[p].buttons[i] = default_param; | 238 | Settings::values.players.GetValue()[p].buttons[i] = default_param; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 241 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 242 | std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 242 | std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 243 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 243 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 244 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 244 | default_analogs[i][3], default_analogs[i][4], 0.5f); |
| 245 | Settings::values.players[p].analogs[i] = | 245 | Settings::values.players.GetValue()[p].analogs[i] = |
| 246 | sdl2_config->Get(group, Settings::NativeAnalog::mapping[i], default_param); | 246 | sdl2_config->Get(group, Settings::NativeAnalog::mapping[i], default_param); |
| 247 | if (Settings::values.players[p].analogs[i].empty()) | 247 | if (Settings::values.players.GetValue()[p].analogs[i].empty()) |
| 248 | Settings::values.players[p].analogs[i] = default_param; | 248 | Settings::values.players.GetValue()[p].analogs[i] = default_param; |
| 249 | } | 249 | } |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -288,10 +288,12 @@ void Config::ReadValues() { | |||
| 288 | Settings::values.debug_pad_analogs[i] = default_param; | 288 | Settings::values.debug_pad_analogs[i] = default_param; |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | Settings::values.vibration_enabled = | 291 | Settings::values.vibration_enabled.SetValue( |
| 292 | sdl2_config->GetBoolean("ControlsGeneral", "vibration_enabled", true); | 292 | sdl2_config->GetBoolean("ControlsGeneral", "vibration_enabled", true)); |
| 293 | Settings::values.motion_enabled = | 293 | Settings::values.enable_accurate_vibrations.SetValue( |
| 294 | sdl2_config->GetBoolean("ControlsGeneral", "motion_enabled", true); | 294 | sdl2_config->GetBoolean("ControlsGeneral", "enable_accurate_vibrations", false)); |
| 295 | Settings::values.motion_enabled.SetValue( | ||
| 296 | sdl2_config->GetBoolean("ControlsGeneral", "motion_enabled", true)); | ||
| 295 | Settings::values.touchscreen.enabled = | 297 | Settings::values.touchscreen.enabled = |
| 296 | sdl2_config->GetBoolean("ControlsGeneral", "touch_enabled", true); | 298 | sdl2_config->GetBoolean("ControlsGeneral", "touch_enabled", true); |
| 297 | Settings::values.touchscreen.device = | 299 | Settings::values.touchscreen.device = |
| @@ -304,10 +306,8 @@ void Config::ReadValues() { | |||
| 304 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_x", 15); | 306 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_x", 15); |
| 305 | Settings::values.touchscreen.diameter_y = | 307 | Settings::values.touchscreen.diameter_y = |
| 306 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_y", 15); | 308 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_y", 15); |
| 307 | Settings::values.udp_input_address = | 309 | Settings::values.udp_input_servers = |
| 308 | sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_ADDR); | 310 | sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_SRV); |
| 309 | Settings::values.udp_input_port = static_cast<u16>(sdl2_config->GetInteger( | ||
| 310 | "Controls", "udp_input_port", InputCommon::CemuhookUDP::DEFAULT_PORT)); | ||
| 311 | 311 | ||
| 312 | std::transform(keyboard_keys.begin(), keyboard_keys.end(), | 312 | std::transform(keyboard_keys.begin(), keyboard_keys.end(), |
| 313 | Settings::values.keyboard_keys.begin(), InputCommon::GenerateKeyboardParam); | 313 | Settings::values.keyboard_keys.begin(), InputCommon::GenerateKeyboardParam); |
| @@ -343,8 +343,8 @@ void Config::ReadValues() { | |||
| 343 | Settings::values.gamecard_path = sdl2_config->Get("Data Storage", "gamecard_path", ""); | 343 | Settings::values.gamecard_path = sdl2_config->Get("Data Storage", "gamecard_path", ""); |
| 344 | 344 | ||
| 345 | // System | 345 | // System |
| 346 | Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); | 346 | Settings::values.use_docked_mode.SetValue( |
| 347 | const auto size = sdl2_config->GetInteger("System", "users_size", 0); | 347 | sdl2_config->GetBoolean("System", "use_docked_mode", true)); |
| 348 | 348 | ||
| 349 | Settings::values.current_user = std::clamp<int>( | 349 | Settings::values.current_user = std::clamp<int>( |
| 350 | sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1); | 350 | sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1); |
| @@ -371,7 +371,7 @@ void Config::ReadValues() { | |||
| 371 | 371 | ||
| 372 | // Core | 372 | // Core |
| 373 | Settings::values.use_multi_core.SetValue( | 373 | Settings::values.use_multi_core.SetValue( |
| 374 | sdl2_config->GetBoolean("Core", "use_multi_core", false)); | 374 | sdl2_config->GetBoolean("Core", "use_multi_core", true)); |
| 375 | 375 | ||
| 376 | // Renderer | 376 | // Renderer |
| 377 | const int renderer_backend = sdl2_config->GetInteger( | 377 | const int renderer_backend = sdl2_config->GetInteger( |
| @@ -395,11 +395,11 @@ void Config::ReadValues() { | |||
| 395 | const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0); | 395 | const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0); |
| 396 | Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level)); | 396 | Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level)); |
| 397 | Settings::values.use_asynchronous_gpu_emulation.SetValue( | 397 | Settings::values.use_asynchronous_gpu_emulation.SetValue( |
| 398 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false)); | 398 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", true)); |
| 399 | Settings::values.use_vsync.SetValue( | 399 | Settings::values.use_vsync.SetValue( |
| 400 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1))); | 400 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1))); |
| 401 | Settings::values.use_assembly_shaders.SetValue( | 401 | Settings::values.use_assembly_shaders.SetValue( |
| 402 | sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", false)); | 402 | sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", true)); |
| 403 | Settings::values.use_asynchronous_shaders.SetValue( | 403 | Settings::values.use_asynchronous_shaders.SetValue( |
| 404 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_shaders", false)); | 404 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_shaders", false)); |
| 405 | Settings::values.use_asynchronous_shaders.SetValue( | 405 | Settings::values.use_asynchronous_shaders.SetValue( |
| @@ -429,9 +429,6 @@ void Config::ReadValues() { | |||
| 429 | // Debugging | 429 | // Debugging |
| 430 | Settings::values.record_frame_times = | 430 | Settings::values.record_frame_times = |
| 431 | sdl2_config->GetBoolean("Debugging", "record_frame_times", false); | 431 | sdl2_config->GetBoolean("Debugging", "record_frame_times", false); |
| 432 | Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); | ||
| 433 | Settings::values.gdbstub_port = | ||
| 434 | static_cast<u16>(sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689)); | ||
| 435 | Settings::values.program_args = sdl2_config->Get("Debugging", "program_args", ""); | 432 | Settings::values.program_args = sdl2_config->Get("Debugging", "program_args", ""); |
| 436 | Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false); | 433 | Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false); |
| 437 | Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false); | 434 | Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false); |