|
DB15 female connector |
x 1 | |
|
100 kOhm resistors |
x 4 | |
|
DIP-4 switch |
x 1 | |
|
DIP24 Socket (optional) |
x 1 | |
|
Arduino Pro Micro Atmega32U4 5V 16MHzArduino
|
x 1 |
|
KiCADKicad
|
|
|
arduino IDEArduino
|
GamePort USB adapter - necroware
Necroware's GamePort Adapter
- For more information: https://github.com/necroware/gameport-adapter
- For Releases: https://github.com/necroware/gameport-adapter/releases
Many people from the retro community still have their beloved joysticks and gamepads from the early days. These devices often live their lives somewhere in the dark corners of our basements and we don't dare to throw them away, because of nostalgic reasons. They remind us so much of our childhoods, where we played our Wing Commanders, X-Wings, Descents and many other games. These old joysticks were all made to be connected to the game port, usually on a sound card. But by the end of 90's and beginning of 2000's game ports vanished from our computers and were replaced by USB and our old joysticks disappeared into the past. Today not everybody has a full retro PC and many people are using their modern computer with DOSBox to play the old games, sometimes with a modern USB joystick. But wouldn't it be great to play the old games with the same joystick which we used back then? And this is where this adapter comes into play. It can be used to connect gameport joysticks to a USB port.
GamePort Adapter Videos:
Part 1: Introduction
Part 2: Updates
How does it work?
The adapter is built around Arduino Pro Micro, which uses the same ATmega32U4 microcontroller as Leonardo. This microcontroller has built-in USB HID capabilities and can be used to build HID input devices, like joysticks. The adapter itself is super simple, the main brainwork was invested into the software. Very much simplified, it reads the joystick states and sends the data, via USB, to the computer, which thinks that it is communicating with a USB joystick.
What is special about this one?
There are already plenty of gameport to USB adapters for basic analog joysticks and, as far as I know, there were some efforts to communicate with Sidewinder joysticks by Microsoft as well. But there is no universal adapter, which would work with different types of joysticks. This adapter implements multiple drivers for various analog and digital joysticks, with an option to add more, in the future.
Features overview:
Support for generic analog joysticks with 2/4 buttons and 2/4 axes
Four switches to select joystick type
Autodetection for various digital protocol joysticks
Auto-Calibration
Very low input lag
What is the difference between analog and digital joystick?
Many people call button-only joysticks or gamepads digital. This is kind of right, because a button is either pressed or not. You can't have an analog values in between. However by digital, in this case, we mean something different. A gameport contains 15 pins, 8 of which are used for joystick communication. 4 pins are for buttons and carry digital values in sense of on/off and 4 pins are for analog axes, which deliver voltage somewhere between 0V and 5V. Joysticks which were made in the early days used this pinout. They could have a maximum of 4 buttons and 4 axes and were DOS compatible. Later, in the time of Windows 95/98 many joysticks were made to be plugged into a gameport as well, but they were not limited to 4 buttons and 4 axes. They had a lot more exciting features, like hat switches and throttle controls. But how did this work? Well the manufacturers implemented their drivers to communicate with the joystick via gameport using a proprietary communication protocol. For example, by using one pin of the gameport as clock and another one as data, the possibilities were almost limitless. Such joysticks are called digital as well, because they used digital protocols to communicate with the PC. And suddenly, many features were possible, but the price of these features was the lost compatibility to DOS. You couldn't just plug such a joystick into the gameport and expect it to work in old DOS games. The plug was the same, but the signaling was completely different.
Which joysticks does this adapter support?
Currently, the following drivers are implemented. To select the right driver, you have to use four switches, as shown in the table. The switches may be changed or extended in the future, so please pay attention to the updates.
Joystick ModelButtonsAxesHatSW1-4CommentsGeneric Analog2200000Generic Analog4201000Generic Analog43001003rd Axis is throttleGeneric Analog4401100CH FlightStick4410010Analog, DOS-compatibleCH F16 Combat Stick10310110Analog, DOS-compatibleThrustMaster4311010Analog, DOS-compatibleSidewinder GamePad10201110Digital protocolSidewinder 3D Pro8411110Digital protocolSidewinder 3D Pro Plus9411110First version of Precision ProSidewinder Precision Pro9411110Digital protocolSidewinder FFB Wheel8301110Digital, FFB not yet implementedGravis GamePad Pro10200001Digital protocol (GrIP)Logitech WingMan Extreme6311001Digital protocol (ADI)Logitech CyberMan 28601001Digital proticol (ADI)
Remarks:
Please pay attention to how the same switches are used for different families of digital devices. This is possible due to fully digital communication. Using this method, the adapter implements autodetection as soon as it knows, that it is connected to a digital joystick.
Currently, only the drivers for the listed Sidewinder devices are implemented, since I have no other models at hand. The Precision Pro works natively on USB as well, but was still implemented, because we can.
Gravis used their GrIP protocol, which is currently implemented only for the Gravis GamePad Pro, but without daisy chaining possibility so far.
The implementation of the ADI protocol used by Logitech should work with all the devices which support that protocol. However only the listed Logitech devices were tested so far.
Which joysticks were tested?
Many joysticks in the wild are using the same digital protocol or are backwards compatible to the analog joysticks as they were used back in the days in DOS. Following list contains all the devices wich were reported by others as working so far:
Gravis Analog Pro (analog)
Gravis PC GamePad (analog)
Gravis GamePad Pro
QuickShot QS-123E "Warrior 5" (analog)
QuickShot QS-201 "Super Warrior" (analog)
QuickShot QS-203 "Avenger" (analog)
Sidewinder GamePad
Sidewinder 3D Pro
Sidewinder 3D Pro Plus
Sidewinder Precision Pro
Sidewinder ForceFeedBack Wheel
Logitech WingMan Extreme Digital
Logitech CyberMan 2
InterAct UltraRacer PC (analog)
Sidewinder 3D Pro can be switched between analog and digital mode and in analog mode it can emulate the ThrustMaster and CH FlightStick. That's why you see them in the table above. Unfortunately I don't possess those joysticks in reality, so it may be that the implementation is not quite correct.
What is auto calibration?
Old analog joysticks have resistors inside, which are specified to be 100 kOhm. Unfortunately, these resistors are either worn out, bad quality or were wrong from the beginning. Therefore most of the generic analog joysticks had adjustment screws to correct the center point of the joystick. Also many games had calibration options in their settings to readjust the joystick. With USB and new digital solutions the calibration was not required anymore and was completely implemented in the joysticks and/or drivers. Many modern games have no option to re-calibrate the joystick anymore. If we try to play such newer games with an old analog joystick through this adapter, the joystick center point would be totally offset. That's why the adapter implements auto calibration internally and presents already corrected values to the operation system.
ATTENTION: a hard requirement for using the analog joysticks is that during plugging into the USB port all axes must be in their middle state, because all the subsequent calibration happens based on the initial state.
Technical insights into implementation
The code is well documented, so if you are interested in the details, feel free to take a look into the driver implementation. All the analog joysticks were actually a straight forward task, but the Sidewinder digital protocol was kind of tough. There are already some implementations of Sidewinder protocol made for Arduino. However, they are mostly only for the Sidewinder GamePad and not really universally made. In the end I was heavily inspired by the Linux Sidewinder driver implementation. The code you can see in this project is a complete rewrite, I just took the Linux driver implementation as a reference to understand how it works. Also the Sidewinder patent US#5628686A helped a lot, especially with switching between digital and analog mode for Sidewinder 3D Pro.
In opposition to the already mentioned Sidewinder for Arduino implementations, this one doesn't rely on interrupts. This implementation is from a similar idea to what the Linux driver does. It polls the port and makes a lot of things simpler due to synchronous process. The biggest problem was that the Sidwinder devices send the data incredibly fast, with a clock pulse of only 5us. It was not possible to use Arduino's digitalRead(...) function for that. It was too slow with about 2.7us per call on an Arduino Pro Micro of 16MHz. It simply made it impossible to poll 5us pulses, with such a slow function, not even considering doing something with the data in between. So out of that need, my own implementation came about, which is up to 50% faster and needs only about 1.6us per call, on the same hardware. The custom I/O functions made it possible to read the data with the speed which a Sidewinder joystick requires. The best part is that the code is written in pure C++. It is very simple to read and to use. There are no macros, no assembler or any dirty hacks, just a lot of optimization.
Bill of materials (BOM)
The hardware is super simple. To build an adapter you'll need the PCB from this project and following parts:
PartQtyLCSC #Digikey #Mouser Electronics #CommentCONN11C77835609-5371-ND523-L77SDA15SA4CH4FDB15 female connectorR1..R44C17296513-MFR-25FTE52-100KCT-ND603-MFR-25FTE52-100K100 kOhm resistorsSW11C157812449-KG04ET-ND642-DS04TDIP-4 switchU11C72120ED3051-5-ND649-DILB24P-223TLFDIP24 Socket (optional)U11N/A1568-1060-ND474-DEV-12640Arduino Pro Micro (ATmega32U4 16MHz, 5V), including two 12 pin header connectors, MicroUSB version (see "Known issues")
Known issues
Some axes on an analog joystick are offset
Auto calibration requires all the axes to be in the center position during initialization. Please see the paragraph about auto calibration.
Joystick doesn't work
Make sure that you are using one of supported joysticks or a joystick which can work in legacy analog mode
MicroUSB port on the Arduino is not stable enough
Use the USB-C version of the Arduino instead.
Or always keep the MicroUSB cable attached to the Arduino MicroUSB version to avoid further wear and apply plug/unplug operations only on the remote side of the cable.
How to help the project?
The best way is to implement more drivers. Since I have only the joysticks mentioned above, I can't contribute more than what is currently included.
Special thanks
I would like to give some special thanks to Creopard from the German dosreloaded.de community for providing me the mentioned joysticks. Without that donation this project wouldn't be possible. Especially dealing with Sidewinder 3D Pro was a very exciting task.
Links
Linux Sidewinder Driver
Sidewinder patent
Creopard Retro Site
GamePort USB adapter - necroware
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(5)
- Engineer Sep 03,2024
- hanslomeland Mar 23,2024
- eart52 Mar 15,2024
- (DIY) C64iSTANBUL Feb 01,2023
- EL M Nabil Jan 31,2023
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
More by EL M Nabil
- CANPico v2 Raspberry Pi Pico : https://amzn.to/41P4ZYQ (Amazon)The Yes We CAN repositoryThis repository contain...
- OBD II GPS Tracker OBD II GPS Tracker OBD ii GPS tracker is the most convenient vehicle GPS tracking device. This track...
- LoRa Pro Mini LoRaProMini - A low power LoRaWAN NodeA LoRaWAN sensor node, based on ATmega328P MCU (Arduino Pro Mi...
- CAN HAT for Raspberry Pi CAN HAT for Raspberry PiRaspberry Pi 4 Model B : https://amzn.to/3S8a9vY (Amazon)Raspberry Pi Zero 2...
- GNSS HAT for Raspberry Pi Raspberry Pi 4 Model B : https://amzn.to/3S8a9vY (Amazon)Introduction to mosaicHATWhat is mosaicHAT?...
- HoneyPi - Connect various sensors To Raspberry Pi HoneyPi-PCB 3.0xRaspberry Pi 4 Model B : https://amzn.to/3S8a9vY (Amazon)Raspberry Pi Zero 2 W : htt...
- GamePort USB adapter - necroware Necroware's GamePort AdapterFor more information: https://github.com/necroware/gameport-adapterFor R...
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
72 0 0 -
DIY Laser Power Meter with Arduino
84 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
120 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
415 0 1 -
Custom Mechanic Keyboard - STM32
241 0 3