One of the things bugging me while tinkering with old computers has been the joysticks. Several of the computers I'm playing with can use the Atari 2600 joysticks, but those joysticks are awful. I've never liked them, even back when the Atari 2600 was new. I kept thinking about getting some other 2600 compatible joystick, or maybe making a box and sticking some of my arcade buttons and joysticks in it and wiring it up with the 9 pin Atari pinout.

Neither of those ideas seemed satisfactory though since I wasn't sure what was a "good" 3rd party joystick, and I didn't really want to use the arcade sticks. What I really like are the modern PS2 style controllers. These days every kind of controller either is USB, or can be converted to USB with a cheap adapter. Why not use a Raspberry Pi?

The hardware is pretty minimal. The Raspberry Pi talks to a USB game controller, and then using a couple of common ICs connected to three GPIO pins, the Raspberry Pi emulates an Atari 2600 joystick. Pretty much everything is done in software, and it only took a few lines of code. I can now use SNES, N64, PS2, and XBox controllers, Wiimotes, and others because for any that aren't native USB it's possible to convert them with a cheap USB adapter.

I have plans to add 2 player support, analog controls, and support more than just the Atari 2600 style pinout. I'm still trying to figure out how to emulate the different potentiometer values for the different platforms (Apple II is 150kΩ, C64 is 500kΩ, and Atari is 1MΩ). But this is a great start, and it amazes me how much more enjoyable the old games are by using a nice USB controller! (But Alley Cat is still way too hard...)