From c5082ac85a618411bfbf7a17868ef0e0983d35da Mon Sep 17 00:00:00 2001 From: Maki <77-maki@users.noreply.git.ryujinx.app> Date: Fri, 14 Nov 2025 11:52:42 -0600 Subject: [PATCH 1/2] fix: make controller GUIDs match old SDL2 GUIDs (ryubing/ryujinx!218) See merge request ryubing/ryujinx!218 --- src/Ryujinx.Input.SDL3/SDL3GamepadDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.Input.SDL3/SDL3GamepadDriver.cs b/src/Ryujinx.Input.SDL3/SDL3GamepadDriver.cs index 0eb64cfab..b1100384f 100644 --- a/src/Ryujinx.Input.SDL3/SDL3GamepadDriver.cs +++ b/src/Ryujinx.Input.SDL3/SDL3GamepadDriver.cs @@ -65,7 +65,7 @@ namespace Ryujinx.Input.SDL3 string strGuid = new(guidBytes); - return $"{strGuid[0..8]}-{strGuid[8..12]}-{strGuid[12..16]}-{strGuid[16..20]}-{strGuid[20..32]}"; + return $"{strGuid[4..6]}{strGuid[6..8]}{strGuid[2..4]}{strGuid[0..2]}-{strGuid[10..12]}{strGuid[8..10]}-{strGuid[12..16]}-{strGuid[16..20]}-{strGuid[20..32]}"; } From 10476771d35b75258305c5bfa9f5dff6c64a9850 Mon Sep 17 00:00:00 2001 From: Maki <77-maki@users.noreply.git.ryujinx.app> Date: Fri, 14 Nov 2025 12:51:53 -0600 Subject: [PATCH 2/2] fix: detect face button layout for gamepads (ryubing/ryujinx!219) See merge request ryubing/ryujinx!219 --- src/Ryujinx.Input.SDL3/SDL3Gamepad.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Input.SDL3/SDL3Gamepad.cs b/src/Ryujinx.Input.SDL3/SDL3Gamepad.cs index 707fdb909..2b006147d 100644 --- a/src/Ryujinx.Input.SDL3/SDL3Gamepad.cs +++ b/src/Ryujinx.Input.SDL3/SDL3Gamepad.cs @@ -22,7 +22,7 @@ namespace Ryujinx.Input.SDL3 private StandardControllerInputConfig _configuration; - private static readonly SDL_GamepadButton[] _buttonsDriverMapping = + private readonly SDL_GamepadButton[] _buttonsDriverMapping = [ // Unbound, ignored. SDL_GamepadButton.SDL_GAMEPAD_BUTTON_INVALID, @@ -88,6 +88,20 @@ namespace Ryujinx.Input.SDL3 Features = GetFeaturesFlag(); _triggerThreshold = 0.0f; + // Face button mapping + SDL_GamepadButton[] faceButtons = _buttonsDriverMapping[1..5]; + foreach (SDL_GamepadButton btn in faceButtons) { + int mapId = SDL_GetGamepadButtonLabel(_gamepadHandle, btn) switch { + SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_A or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_CROSS => 1, + SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_B or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_CIRCLE => 2, + SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_X or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_SQUARE => 3, + SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_Y or SDL_GamepadButtonLabel.SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE => 4, + _ => -1 + }; + if (mapId == -1) { continue; } + _buttonsDriverMapping[mapId] = btn; + } + // Enable motion tracking if ((Features & GamepadFeaturesFlag.Motion) != 0) {