From aa433990119b9e466ce4cd6ff0b403a3840a985d Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 22 Feb 2020 22:46:30 -0300 Subject: [PATCH 1/2] Bump bundled sdl2 and appveyor to sdl2.0.10 --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41d55f375..7c0a7db29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,7 @@ if (ENABLE_SDL2) if (CITRA_USE_BUNDLED_SDL2) # Detect toolchain and platform if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64) - set(SDL2_VER "SDL2-2.0.8") + set(SDL2_VER "SDL2-2.0.10") else() message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable CITRA_USE_BUNDLED_SDL2 and provide your own.") endif() diff --git a/appveyor.yml b/appveyor.yml index d8cbfc35f..6eb4bccaa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,7 +27,7 @@ install: - ps: | if ($env:BUILD_TYPE -eq 'mingw') { $dependencies = "mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-qt5 mingw64/mingw-w64-x86_64-ffmpeg" - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-SDL2-2.0.5-2-any.pkg.tar.xz" + C:\msys64\usr\bin\bash -lc "pacman --noconfirm -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-SDL2-2.0.10-1-any.pkg.tar.xz" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S $dependencies" # (HACK) ignore errors 0 From 8e3960b40984ae6b0d51cb6172f0907225b7d4c5 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Wed, 4 Mar 2020 21:08:26 -0300 Subject: [PATCH 2/2] sdl_joystick: disable the use of the hidapi drivers due to many problems caused by them. The main problem is the loss of compatibility with some controllers, but there are also unwanted changes to the behaviour of PS4 controllers (hardcoded lightbar color). --- src/input_common/sdl/sdl_impl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 0b69bfede..f186787b8 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -472,6 +472,14 @@ SDLState::SDLState() { if (SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1") == SDL_FALSE) { LOG_ERROR(Input, "Failed to set Hint for background events", SDL_GetError()); } +// these hints are only defined on sdl2.0.9 or higher +#if SDL_VERSION_ATLEAST(2, 0, 9) + // This can be set back to 1 when the compatibility problems with the controllers are + // solved. There are also hints to toggle the individual drivers. + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI, "0"); + // This hint should probably stay as "0" as long as the hidapi PS4 led issue isn't fixed + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "0"); +#endif SDL_AddEventWatch(&SDLEventWatcher, this);