shithub: choc

Download patch

ref: c88aa553db9d97d1da182dba05e69cfbd7c8511f
parent: 88cfa18cfc2d86db6938b02e27f903b5c1163b6e
author: Jonathan Dowland <[email protected]>
date: Mon Jun 27 02:57:31 EDT 2016

setup: Add joystick config for 8bitdo SFC/SNES30

In both Bluetooth controller mode (Start+R) in both SFC30 and SNES30 variants
and and USB controller mode for SFC30 (tested with a beta firmware due to a bug
on OS X).

Information on this controller: http://www.8bitdo.com/sfc30/

--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -340,6 +340,20 @@
     {NULL, 0},
 };
 
+// http://www.8bitdo.com/sfc30/ or http://www.8bitdo.com/snes30/
+static const joystick_config_t sfc30_controller[] =
+{
+    {"joystick_strafe_axis",   0},
+    {"joystick_y_axis",        1},
+    {"joystick_x_axis",        CREATE_BUTTON_AXIS(4,0)}, // Y-A
+    {"joyb_use",               6}, // L
+    {"joyb_fire",              7}, // R
+    {"joyb_prevweapon",        3}, // X
+    {"joyb_nextweapon",        1}, // B
+    {"joyb_menu_activate",    11}, // Start
+    {NULL, 0},
+};
+
 static const known_joystick_t known_joysticks[] =
 {
     {
@@ -438,6 +452,33 @@
         "8Bitdo NES30 Pro",
         4, 16, 1,
         nes30_pro_controller,
+    },
+
+    // 8Bitdo SFC30 SNES replica controller in bluetooth controller mode
+    // (hold R + Start on power on)
+    // http://www.8bitdo.com/sfc30/
+    {
+        "8Bitdo SFC30 GamePad Joystick",
+        4, 16, 1,
+        sfc30_controller,
+    },
+
+    // SNES30 colour variation of the above
+    // http://www.8bitdo.com/snes30/
+    {
+        "8Bitdo SNES30 GamePad Joystick",
+        4, 16, 1,
+        sfc30_controller,
+    },
+
+    // 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
+    // XXX: there is probably a SNES30 variant of this too
+    {
+        "SFC30 Joystick",
+        4, 12, 1,
+        sfc30_controller,
     },
 };