This adds support for a NES-mini/SNES-mini gamepad USB adapter I use. Otherwise, games which use the SDL_GameController API rather than the SDL_Joystick API (such as zelda3) are unable to detect my controllers.
Patch has already been merged upstream: https://github.com/libsdl-org/SDL/pull/6485 ok? diff /usr/ports commit - 100ace77a1718374d9902d15acc70fc9950d34d7 path + /usr/ports blob - 50b23376fffe0524496dbb7cc1a76e5bb4a0cdee file + devel/sdl2/Makefile --- devel/sdl2/Makefile +++ devel/sdl2/Makefile @@ -1,6 +1,7 @@ COMMENT= cross-platform multimedia library V= 2.24.1 +REVISION= 0 DISTNAME= SDL2-${V} PKGNAME= sdl2-${V} CATEGORIES= devel blob - faa28ab4480a4f6d6660bc70c82e061d2a3c79aa file + devel/sdl2/patches/patch-src_joystick_SDL_gamecontrollerdb_h --- devel/sdl2/patches/patch-src_joystick_SDL_gamecontrollerdb_h +++ devel/sdl2/patches/patch-src_joystick_SDL_gamecontrollerdb_h @@ -1,5 +1,6 @@ - Enable controller detection by GUID on OpenBSD - Use both Linux and macOS GUIDs to match both XInput and DInput devices +- Recognize raphnet USB adapter for SNES/NES-mini gamepads (from upstream) Index: src/joystick/SDL_gamecontrollerdb.h --- src/joystick/SDL_gamecontrollerdb.h.orig @@ -22,3 +23,11 @@ Index: src/joystick/SDL_gamecontrollerdb.h "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", +@@ -846,6 +846,7 @@ static const char *s_ControllerMappings [] = + "050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,", + "030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,", ++ "030000009b2800008000000020020000,raphnet technologies 1-player WUSBMote v2.2,a:b1,b:b4,x:b0,y:b5,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,dpup:b12,dpdown:b13,dpleft:b14,dpright:b15,", + #endif + #if defined(__ANDROID__) + "05000000c82d000006500000ffff3f00,8BitDo M30 Gamepad,a:b0,b:b1,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a4,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",