diff options
Diffstat (limited to 'src/setup/joystick.c')
-rw-r--r-- | src/setup/joystick.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/setup/joystick.c b/src/setup/joystick.c index 2a07d181..07beadcd 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -14,6 +14,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "doomtype.h" #include "i_joystick.h" @@ -28,6 +29,8 @@ #include "txt_joyaxis.h" #include "txt_joybinput.h" +#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-gamepad" + typedef struct { char *name; // Config file name @@ -292,6 +295,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[] = { { @@ -364,6 +385,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) @@ -692,6 +725,8 @@ void ConfigJoystick(void) window = TXT_NewWindow("Gamepad/Joystick configuration"); + TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); + TXT_AddWidgets(window, TXT_NewCheckBox("Enable gamepad/joystick", &usejoystick), joystick_table = TXT_NewTable(2), |