diff options
Diffstat (limited to 'src/yuzu_cmd')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 29 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 2 |
3 files changed, 34 insertions, 4 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 66dd0dc15..59f9c8e09 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -90,7 +90,11 @@ static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> | |||
| 90 | 90 | ||
| 91 | template <> | 91 | template <> |
| 92 | void Config::ReadSetting(const std::string& group, Settings::Setting<std::string>& setting) { | 92 | void Config::ReadSetting(const std::string& group, Settings::Setting<std::string>& setting) { |
| 93 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); | 93 | std::string setting_value = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); |
| 94 | if (setting_value.empty()) { | ||
| 95 | setting_value = setting.GetDefault(); | ||
| 96 | } | ||
| 97 | setting = std::move(setting_value); | ||
| 94 | } | 98 | } |
| 95 | 99 | ||
| 96 | template <> | 100 | template <> |
| @@ -299,6 +303,7 @@ void Config::ReadValues() { | |||
| 299 | 303 | ||
| 300 | ReadSetting("Renderer", Settings::values.resolution_setup); | 304 | ReadSetting("Renderer", Settings::values.resolution_setup); |
| 301 | ReadSetting("Renderer", Settings::values.scaling_filter); | 305 | ReadSetting("Renderer", Settings::values.scaling_filter); |
| 306 | ReadSetting("Renderer", Settings::values.fsr_sharpening_slider); | ||
| 302 | ReadSetting("Renderer", Settings::values.anti_aliasing); | 307 | ReadSetting("Renderer", Settings::values.anti_aliasing); |
| 303 | ReadSetting("Renderer", Settings::values.fullscreen_mode); | 308 | ReadSetting("Renderer", Settings::values.fullscreen_mode); |
| 304 | ReadSetting("Renderer", Settings::values.aspect_ratio); | 309 | ReadSetting("Renderer", Settings::values.aspect_ratio); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index d214771b0..5bbc3f532 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -6,16 +6,22 @@ | |||
| 6 | namespace DefaultINI { | 6 | namespace DefaultINI { |
| 7 | 7 | ||
| 8 | const char* sdl2_config_file = R"( | 8 | const char* sdl2_config_file = R"( |
| 9 | [ControlsGeneral] | 9 | |
| 10 | [ControlsP0] | ||
| 10 | # The input devices and parameters for each Switch native input | 11 | # The input devices and parameters for each Switch native input |
| 12 | # The config section determines the player number where the config will be applied on. For example "ControlsP0", "ControlsP1", ... | ||
| 11 | # It should be in the format of "engine:[engine_name],[param1]:[value1],[param2]:[value2]..." | 13 | # It should be in the format of "engine:[engine_name],[param1]:[value1],[param2]:[value2]..." |
| 12 | # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values | 14 | # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values |
| 13 | 15 | ||
| 16 | # Indicates if this player should be connected at boot | ||
| 17 | connected= | ||
| 18 | |||
| 14 | # for button input, the following devices are available: | 19 | # for button input, the following devices are available: |
| 15 | # - "keyboard" (default) for keyboard input. Required parameters: | 20 | # - "keyboard" (default) for keyboard input. Required parameters: |
| 16 | # - "code": the code of the key to bind | 21 | # - "code": the code of the key to bind |
| 17 | # - "sdl" for joystick input using SDL. Required parameters: | 22 | # - "sdl" for joystick input using SDL. Required parameters: |
| 18 | # - "joystick": the index of the joystick to bind | 23 | # - "guid": SDL identification GUID of the joystick |
| 24 | # - "port": the index of the joystick to bind | ||
| 19 | # - "button"(optional): the index of the button to bind | 25 | # - "button"(optional): the index of the button to bind |
| 20 | # - "hat"(optional): the index of the hat to bind as direction buttons | 26 | # - "hat"(optional): the index of the hat to bind as direction buttons |
| 21 | # - "axis"(optional): the index of the axis to bind | 27 | # - "axis"(optional): the index of the axis to bind |
| @@ -58,12 +64,29 @@ button_screenshot= | |||
| 58 | # - "modifier_scale": a float number representing the applied modifier scale to the analog input. | 64 | # - "modifier_scale": a float number representing the applied modifier scale to the analog input. |
| 59 | # Must be in range of 0.0-1.0. Defaults to 0.5 | 65 | # Must be in range of 0.0-1.0. Defaults to 0.5 |
| 60 | # - "sdl" for joystick input using SDL. Required parameters: | 66 | # - "sdl" for joystick input using SDL. Required parameters: |
| 61 | # - "joystick": the index of the joystick to bind | 67 | # - "guid": SDL identification GUID of the joystick |
| 68 | # - "port": the index of the joystick to bind | ||
| 62 | # - "axis_x": the index of the axis to bind as x-axis (default to 0) | 69 | # - "axis_x": the index of the axis to bind as x-axis (default to 0) |
| 63 | # - "axis_y": the index of the axis to bind as y-axis (default to 1) | 70 | # - "axis_y": the index of the axis to bind as y-axis (default to 1) |
| 64 | lstick= | 71 | lstick= |
| 65 | rstick= | 72 | rstick= |
| 66 | 73 | ||
| 74 | # for motion input, the following devices are available: | ||
| 75 | # - "keyboard" (default) for emulating random motion input from buttons. Required parameters: | ||
| 76 | # - "code": the code of the key to bind | ||
| 77 | # - "sdl" for motion input using SDL. Required parameters: | ||
| 78 | # - "guid": SDL identification GUID of the joystick | ||
| 79 | # - "port": the index of the joystick to bind | ||
| 80 | # - "motion": the index of the motion sensor to bind | ||
| 81 | # - "cemuhookudp" for motion input using Cemu Hook protocol. Required parameters: | ||
| 82 | # - "guid": the IP address of the cemu hook server encoded to a hex string. for example 192.168.0.1 = "c0a80001" | ||
| 83 | # - "port": the port of the cemu hook server | ||
| 84 | # - "pad": the index of the joystick | ||
| 85 | # - "motion": the index of the motion sensor of the joystick to bind | ||
| 86 | motionleft= | ||
| 87 | motionright= | ||
| 88 | |||
| 89 | [ControlsGeneral] | ||
| 67 | # To use the debug_pad, prepend `debug_pad_` before each button setting above. | 90 | # To use the debug_pad, prepend `debug_pad_` before each button setting above. |
| 68 | # i.e. debug_pad_button_a= | 91 | # i.e. debug_pad_button_a= |
| 69 | 92 | ||
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 4ac72c2f6..37dd1747c 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "common/scm_rev.h" | 7 | #include "common/scm_rev.h" |
| 8 | #include "common/settings.h" | 8 | #include "common/settings.h" |
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/hid/hid_core.h" | ||
| 10 | #include "core/perf_stats.h" | 11 | #include "core/perf_stats.h" |
| 11 | #include "input_common/drivers/keyboard.h" | 12 | #include "input_common/drivers/keyboard.h" |
| 12 | #include "input_common/drivers/mouse.h" | 13 | #include "input_common/drivers/mouse.h" |
| @@ -26,6 +27,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Co | |||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | EmuWindow_SDL2::~EmuWindow_SDL2() { | 29 | EmuWindow_SDL2::~EmuWindow_SDL2() { |
| 30 | system.HIDCore().UnloadInputDevices(); | ||
| 29 | input_subsystem->Shutdown(); | 31 | input_subsystem->Shutdown(); |
| 30 | SDL_Quit(); | 32 | SDL_Quit(); |
| 31 | } | 33 | } |