Hi,
Please find attached update to sdl2-2.0.9 with a fix for the missing
XBox 360 gamepad/XInput D-pad functionality. I kept it together because
the diff isn't overly long or complicated, but if preferred I'd be
happy to split it into 2 separate diffs.
1.
The update to 2.0.9 is trivial. Some new additions to API for sensors
and joystick/gamecontroller. I tested launching and brief application
use/gameplay with the following SDL2 ports without any issues:
- milkytracker
- citra
- dolphin
- mednafen
- mgba
- fnaify (multiple FNA games)
- 0ad
- barony
- endless-sky
- lugaru
- megaglest
- scummvm
- sdl-jstest
Per release notes and from looking at the lib with nm, only additions
to API, therefore bumping only minor. Official release notes here:
https://discourse.libsdl.org/t/sdl-2-0-9-released/25228
The local diffs to SDL_x11sym.h and SDL_x11keyboard.c have been merged
upstream and are therefore removed.
2.
The D-pad of the Xbox 360 controller and its family of generally
compatible controllers doesn't hasn't worked with SDL applications so
far. I dug into the SDL2 backend code and found that with legacy
(DInput) controllers, the D-pad works because SDL2 recognizes the
usage as a hat switch and reads the numerical value that represents
the position of the hat switch.
The Xbox 360 controller on the other hand contains for individual D-pad
button usages in its report descriptor that are not picked up by SDL2.
This diff adds recognition of a D-pad (as a hat) to the backend. The
individual D-pad button presses are converted into SDL's internal
representation of the hat position with dpad_to_sdl().
Tested and works with sdl2-jstest (from sdl-jstest package) and several
FNA games (Owlboy, Rogue Legacy), both with my Xbox 360 controller and
the Logitech F310 in XInput mode.
The D-pad diff has been sent to upstream:
https://bugzilla.libsdl.org/show_bug.cgi?id=4436
The Xbox 360 controller and Logitech F310 (XInput mode) button layout
and axis directions can be set to the standard layout on other
platforms with the following env var:
$ export SDL_GAMECONTROLLERCONFIG="none,X360,a:b7,b:b8,back:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b2,lefttrigger:a2,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b3,righttrigger:a5,rightx:a3,righty:a4~,start:b0,x:b9,y:b10,"
ok?
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/sdl2/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- Makefile 29 Oct 2018 05:39:49 -0000 1.23
+++ Makefile 28 Dec 2018 17:38:53 -0000
@@ -4,14 +4,13 @@ COMMENT= cross-platform multimedia libra
BROKEN-hppa= src/atomic/SDL_spinlock.c:101:2: error: \
#error Please implement for your platform.
-V= 2.0.8
+V= 2.0.9
DISTNAME= SDL2-${V}
PKGNAME= sdl2-${V}
CATEGORIES= devel
MASTER_SITES= https://www.libsdl.org/release/
-REVISION= 1
-SHARED_LIBS= SDL2 0.5 # 0.8
+SHARED_LIBS= SDL2 0.6 # 0.9
HOMEPAGE= https://www.libsdl.org/
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/sdl2/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo 11 Mar 2018 22:40:20 -0000 1.7
+++ distinfo 28 Dec 2018 17:38:53 -0000
@@ -1,2 +1,2 @@
-SHA256 (SDL2-2.0.8.tar.gz) = 7cd8VzCGYdV26EM0TYY44CWngYv/c/j7+rCcPF/Qkuw=
-SIZE (SDL2-2.0.8.tar.gz) = 4909017
+SHA256 (SDL2-2.0.9.tar.gz) = JVGG3GduzQwdvxDsiizF1oabUHnYo4GUwq7N/1SzJLE=
+SIZE (SDL2-2.0.9.tar.gz) = 5246942
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/devel/sdl2/patches/patch-Makefile_in,v
retrieving revision 1.5
diff -u -p -r1.5 patch-Makefile_in
--- patches/patch-Makefile_in 11 Mar 2018 22:40:20 -0000 1.5
+++ patches/patch-Makefile_in 28 Dec 2018 17:38:53 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-Makefile_in,v 1.5 2018/0
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
-@@ -122,7 +122,7 @@ LT_AGE = @LT_AGE@
+@@ -123,7 +123,7 @@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
Index: patches/patch-src_SDL_c
===================================================================
RCS file: /cvs/ports/devel/sdl2/patches/patch-src_SDL_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-src_SDL_c
--- patches/patch-src_SDL_c 7 Jan 2018 22:56:46 -0000 1.1
+++ patches/patch-src_SDL_c 28 Dec 2018 17:38:53 -0000
@@ -7,7 +7,7 @@ until OpenBSD support has been rolled ou
Index: src/SDL.c
--- src/SDL.c.orig
+++ src/SDL.c
-@@ -227,8 +227,6 @@ SDL_InitSubSystem(Uint32 flags)
+@@ -228,8 +228,6 @@ SDL_InitSubSystem(Uint32 flags)
}
}
SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
@@ -16,7 +16,7 @@ Index: src/SDL.c
No comments:
Post a Comment