foxygit / doom Log in
commit 95a7160ca80c21057ecfe72fdba4a2dd977223e3
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Apr 12 02:19:44 2015 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Apr 12 02:19:44 2015 +0000

    setup: Add config for USB Gameport adapter.

    This configuration supports the "Super Joy Box 7" USB gameport adapter,
    for people using old PC gameport joysticks / gamepads. The button
    configuration matches the original Vanilla configuration, for
    authenticity.
---
 src/setup/joystick.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index 7f52c65d..dbd7815c 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -294,6 +294,24 @@ static const joystick_config_t buffalo_classic_controller[] =
     {NULL, 0},
 };

+// Config for if the user is actually using an old PC joystick or gamepad,
+// probably via a USB-Gameport adapter.
+static const joystick_config_t pc_gameport_controller[] =
+{
+    {"joystick_x_axis",        0},
+    {"joystick_y_axis",        1},
+    // Button configuration is the default as used for Vanilla Doom,
+    // Heretic and Hexen. When playing with a Gravis Gamepad, this
+    // layout should also be vaguely similar to the standard layout
+    // described above.
+    {"joyb_fire",              0},
+    {"joyb_strafe",            1},
+    {"joyb_use",               3},
+    {"joyb_speed",             2},
+    {NULL, 0},
+};
+
+
 static const known_joystick_t known_joysticks[] =
 {
     {
@@ -359,6 +377,18 @@ static const known_joystick_t known_joysticks[] =
         6, 14, 1,
         ps4_ds4_controller,
     },
+
+    // This is the configuration for the USB-Gameport adapter listed on
+    // this page as the "Mayflash USB to Gameport Adapter" (though the
+    // device is labeled as "Super Joy Box 7"):
+    // https://sites.google.com/site/joystickrehab/itemcatal
+    // TODO: Add extra configurations here for other USB-Gameport adapters,
+    // which should just be the same configuration.
+    {
+        "WiseGroup.,Ltd Gameport to USB Controller",
+        3, 8, 1,
+        pc_gameport_controller,
+    },
 };

 static const known_joystick_t *GetJoystickType(int index)