A couple of posts ago I mentioned A Megadrive Gamepad Repair I did.
While it's a great pad for use on classic computers and consoles, it's not so usable on a PC without dedicated hardware... which we can build quite easily with an arduino and an old serial socket.
There are projects to have the arduino act as a standard USB HID device, but after much trial and more error I could not get it working reliably. The alternative I chose was to send the joypad status over plain serial (the Arduino's FTDI serial device, the serial socket mentioned elsewhere is to plug the gamepad into) and issue Xlib key down/up events based on this to the currently focused window. Simply plug the arduino in, run 'sendkeys' and away you go. Arduino and C++ code is linked at the bottom of the post.
I connected the lines of the (9 pin D-Sub) serial socket to the Arduino (Nano 3.0) like so:
+-------------+-------------+ | Serial | Arduino | +-------------+-------------+ | 1 | D13 | | 2 | A0 | | 3 | A1 | | 4 | A2 | | 5 | +5V | | 6 | A3 | | 7 | A4 | | 8 | GND | | 9 | A5 | +-------------+-------------+
The Gamepad can now plug straight in. I used the analogue pins just to keep them out of the way while experimenting with USB.
Video of the Gamepad in action using the Gens/GS Megadrive Emulator. Yes, I know the gameplay is poor, but it wasn't the most comfortable playing angle :) :
Gist for the (single pass) code - comments and contributions welcome.
claude
Thu, 22 May 2014 17:40
claude
Wed, 28 May 2014 16:21
claude
Wed, 28 May 2014 22:38
claude
Sat, 31 May 2014 14:10
claude
Thu, 05 Jun 2014 19:00
claude
Thu, 12 Jun 2014 20:41
Text only, no HTML, * denotes a required field.