commit a8a7ea27319ababa65d7753cc1aec3f37e955d4b
Author: Jonathan Dowland <jon+github@alcopop.org>
AuthorDate: Mon Jun 27 17:13:23 2016 +0100
Commit: Jonathan Dowland <jon+github@alcopop.org>
CommitDate: Mon Jun 27 17:13:23 2016 +0100
setup: Fixes for SFC30 on Linux systems
The SFC30 joystick presents different names depending on mode (two
bluetooth modes and one USB) and platform (different names for the
same modes on Linux and OS X). Use glob-matching to catch them all.
Bizzarely, with bluetooth mode on Linux the gamepad presents 16 buttons.
Add another joystick_config_t element so that it is detected properly in
this situation.
---
src/setup/joystick.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index 06f9e7ec..53ea5a29 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -454,19 +454,27 @@ static const known_joystick_t known_joysticks[] =
nes30_pro_controller,
},
- // 8Bitdo SFC30 SNES replica controller in bluetooth controller mode
- // (hold R + Start on power on)
+ // 8Bitdo SFC30 SNES replica controller
+ // in default mode and in controller mode (Start+R)
+ // the latter suffixes "Joystick" to the name
// http://www.8bitdo.com/sfc30/
{
- "8Bitdo SFC30 GamePad Joystick",
+ "8Bitdo SFC30 GamePad*",
4, 16, 1,
sfc30_controller,
},
+ // As above, but as detected on RHEL Linux (odd extra axes)
+ {
+ "8Bitdo SFC30 GamePad*",
+ 6, 16, 1,
+ sfc30_controller,
+ },
+
// SNES30 colour variation of the above
// http://www.8bitdo.com/snes30/
{
- "8Bitdo SNES30 GamePad Joystick",
+ "8Bitdo SNES30 GamePad*",
4, 16, 1,
sfc30_controller,
},
@@ -474,9 +482,12 @@ static const known_joystick_t known_joysticks[] =
// 8Bitdo SFC30 SNES replica controller in USB controller mode
// tested with firmware V2.68 (Beta); latest stable V2.65 doesn't work on
// OS X in USB controller mode
+ // Names seen so far:
+ // 'SFC30 Joystick' (OS X)
+ // 'SFC30 SFC30 Joystick' (Fedora 24; RHEL7)
// XXX: there is probably a SNES30 variant of this too
{
- "SFC30 Joystick",
+ "SFC30 *",
4, 12, 1,
sfc30_controller,
},