From ebca59b8e9f7304e8880c3db64c383d9ddc4a7b8 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 4 Feb 2023 10:59:14 -0600 Subject: yuzu_cmd: Fix mismatching controller input --- src/yuzu_cmd/config.cpp | 3 +++ src/yuzu_cmd/default_ini.h | 13 +++++++++++++ src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 527017282..9c34cdc6e 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -176,6 +176,9 @@ void Config::ReadValues() { Settings::values.debug_pad_analogs[i] = default_param; } + ReadSetting("ControlsGeneral", Settings::values.enable_raw_input); + ReadSetting("ControlsGeneral", Settings::values.enable_joycon_driver); + ReadSetting("ControlsGeneral", Settings::values.emulate_analog_keyboard); ReadSetting("ControlsGeneral", Settings::values.vibration_enabled); ReadSetting("ControlsGeneral", Settings::values.enable_accurate_vibrations); ReadSetting("ControlsGeneral", Settings::values.motion_enabled); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 67d230462..3f3651dbe 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -14,6 +14,7 @@ const char* sdl2_config_file = # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values # Indicates if this player should be connected at boot +# 0 (default): Disabled, 1: Enabled connected= # for button input, the following devices are available: @@ -94,6 +95,18 @@ motionright= # 0 (default): Disabled, 1: Enabled debug_pad_enabled = +# Enable sdl raw input. Allows to configure up to 8 xinput controllers. +# 0 (default): Disabled, 1: Enabled +enable_raw_input = + +# Enable yuzu joycon driver instead of SDL drive. +# 0: Disabled, 1 (default): Enabled +enable_joycon_driver = + +# Emulates an analog input from buttons. Allowing to dial any angle. +# 0 (default): Disabled, 1: Enabled +emulate_analog_keyboard = + # Whether to enable or disable vibration # 0: Disabled, 1 (default): Enabled vibration_enabled= diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index e2dfe3a9b..5450b8c38 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -18,11 +18,11 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Core::System& system_) : input_subsystem{input_subsystem_}, system{system_} { - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { + input_subsystem->Initialize(); + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER) < 0) { LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); exit(1); } - input_subsystem->Initialize(); SDL_SetMainReady(); } -- cgit v1.2.3