foxygit / doom Log in
commit 88cfa18cfc2d86db6938b02e27f903b5c1163b6e
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sun Jun 26 18:16:12 2016 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Sun Jun 26 18:16:12 2016 -0400

    setup: Add joystick config for 8bitdo NES30 PRO.

    Recently bought one of these; more info on these pads can be found
    here: http://www.8bitdo.com/nes30pro/
---
 src/setup/joystick.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index 9554a429..df5feabe 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -323,6 +323,22 @@ static const joystick_config_t pc_gameport_controller[] =
     {NULL, 0},
 };

+// http://www.8bitdo.com/nes30pro/
+static const joystick_config_t nes30_pro_controller[] =
+{
+    {"joystick_x_axis",        CREATE_HAT_AXIS(0, HAT_AXIS_HORIZONTAL)},
+    {"joystick_y_axis",        CREATE_HAT_AXIS(0, HAT_AXIS_VERTICAL)},
+    {"joyb_fire",              4},  // Y
+    {"joyb_speed",             1},  // B
+    {"joyb_jump",              2},  // X
+    {"joyb_use",               0},  // A
+    {"joyb_strafeleft",        8},  // L1
+    {"joyb_straferight",       9}, // R1
+    {"joyb_prevweapon",        6},  // L2
+    {"joyb_nextweapon",        7},  // R2
+    {"joyb_menu_activate",     11}, // Start
+    {NULL, 0},
+};

 static const known_joystick_t known_joysticks[] =
 {
@@ -415,6 +431,14 @@ static const known_joystick_t known_joysticks[] =
         2, 8, 1,
         pc_gameport_controller,
     },
+
+    // 8Bitdo NES30 Pro, http://www.8bitdo.com/nes30pro/
+    // Probably some of their other controllers can use the same config.
+    {
+        "8Bitdo NES30 Pro",
+        4, 16, 1,
+        nes30_pro_controller,
+    },
 };

 static const known_joystick_t *GetJoystickType(int index)