aboutsummaryrefslogtreecommitdiff
path: root/emulators/yuzu/files/patch-sdl2
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/yuzu/files/patch-sdl2')
-rw-r--r--emulators/yuzu/files/patch-sdl236
1 files changed, 26 insertions, 10 deletions
diff --git a/emulators/yuzu/files/patch-sdl2 b/emulators/yuzu/files/patch-sdl2
index 6eda6f9d8d2e..e10b98a630f8 100644
--- a/emulators/yuzu/files/patch-sdl2
+++ b/emulators/yuzu/files/patch-sdl2
@@ -20,9 +20,9 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
if (TRUE)
if (SDL2_FOUND)
---- src/input_common/sdl/sdl_impl.cpp.orig 2021-05-19 22:47:48 UTC
+--- src/input_common/sdl/sdl_impl.cpp.orig 2021-06-02 22:29:09 UTC
+++ src/input_common/sdl/sdl_impl.cpp
-@@ -74,6 +74,7 @@ class SDLJoystick { (public)
+@@ -64,6 +64,7 @@ class SDLJoystick { (public)
}
void EnableMotion() {
@@ -30,7 +30,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
if (sdl_controller) {
SDL_GameController* controller = sdl_controller.get();
if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_ACCEL) && !has_accel) {
-@@ -85,6 +86,7 @@ class SDLJoystick { (public)
+@@ -75,6 +76,7 @@ class SDLJoystick { (public)
has_gyro = true;
}
}
@@ -38,7 +38,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
}
void SetButton(int button, bool value) {
-@@ -92,6 +94,7 @@ class SDLJoystick { (public)
+@@ -82,6 +84,7 @@ class SDLJoystick { (public)
state.buttons.insert_or_assign(button, value);
}
@@ -46,7 +46,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
void SetMotion(SDL_ControllerSensorEvent event) {
constexpr float gravity_constant = 9.80665f;
std::lock_guard lock{mutex};
-@@ -119,6 +122,7 @@ class SDLJoystick { (public)
+@@ -109,6 +112,7 @@ class SDLJoystick { (public)
motion.UpdateRotation(time_difference * 1000);
motion.UpdateOrientation(time_difference * 1000);
}
@@ -54,7 +54,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
bool GetButton(int button) const {
std::lock_guard lock{mutex};
-@@ -352,12 +356,14 @@ void SDLState::HandleGameControllerEvent(const SDL_Eve
+@@ -378,12 +382,14 @@ void SDLState::HandleGameControllerEvent(const SDL_Eve
}
break;
}
@@ -69,7 +69,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
case SDL_JOYDEVICEREMOVED:
LOG_DEBUG(Input, "Controller removed with Instance_ID {}", event.jdevice.which);
CloseJoystick(SDL_JoystickFromInstanceID(event.jdevice.which));
-@@ -797,7 +803,9 @@ SDLState::SDLState() {
+@@ -823,7 +829,9 @@ SDLState::SDLState() {
// Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
@@ -79,7 +79,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
// Tell SDL2 to use the hidapi driver. This will allow joycons to be detected as a
// GameController and not a generic one
-@@ -1003,6 +1011,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
+@@ -1037,6 +1045,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
}
break;
}
@@ -87,7 +87,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
case SDL_CONTROLLERSENSORUPDATE: {
bool is_motion_shaking = false;
constexpr float gyro_threshold = 5.0f;
-@@ -1032,6 +1041,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
+@@ -1066,6 +1075,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
}
break;
}
@@ -95,7 +95,23 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
}
return {};
}
-@@ -1295,7 +1305,9 @@ class SDLMotionPoller final : public SDLPoller { (publ
+@@ -1169,6 +1179,7 @@ ButtonBindings SDLState::GetNintendoButtonBinding(
+ auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
+ auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
+
++#if SDL_VERSION_ATLEAST(2,0,14)
+ if (joystick->IsJoyconLeft()) {
+ sl_button = SDL_CONTROLLER_BUTTON_PADDLE2;
+ sr_button = SDL_CONTROLLER_BUTTON_PADDLE4;
+@@ -1177,6 +1188,7 @@ ButtonBindings SDLState::GetNintendoButtonBinding(
+ sl_button = SDL_CONTROLLER_BUTTON_PADDLE3;
+ sr_button = SDL_CONTROLLER_BUTTON_PADDLE1;
+ }
++#endif
+
+ return {
+ std::pair{Settings::NativeButton::A, SDL_CONTROLLER_BUTTON_A},
+@@ -1462,7 +1474,9 @@ class SDLMotionPoller final : public SDLPoller { (publ
[[fallthrough]];
case SDL_JOYBUTTONUP:
case SDL_JOYHATMOTION: