Use Arduino to emulate an Atari-compatible joystick. Should work on any computer supporting the familiar D9 plug, such as MSX, Commodore 64 or Amiga.
Building the interface
You need the following bits and pieces to build the interface:
- An Arduino board, obviously. I’ve used an Uno, but any recent model should work fine.
- Two CD4066B chips
- Female D9 plug
- Wires, a breadboard or vero board, soldering iron etc.
The schematics look like this:
Nothing complex here, really. Arduino voltages are used to control the four switches of the 4066. Atari joyport pins are active when they’re grounded. Blue lines, +5V and GND should be connected to the Arduino pins. The design is somewhat easy to implement as a shield, if that’s what you’re after.
Next you need to take the following steps:
- Upload joyduino.pde to the board. After this you don’t need the Arduino IDE for anything.
- If needed, compile the host joyduino application for your setup. x86 Linux and Mac OS X binaries can be found in the package. SDL is the only major external dependency.
- Start the host. If you don’t have an Uno you’ll probably need to change the port device name to something else. The port can be given as a command line parameter to the application. On a Mac, give the device name starting with cu.
- On Linux you need to have permissions to use the serial port. At least on Ubuntu you should be a member of the dialout group.
At this point you should be able to use the arrow keys and space as an Atari-compatible joystick as long as the window is active. Press esc to quit the host program.
This is still ongoing work, so there’s a lot that could be improved:
- Provide Windows binaries — reader contributions are welcome!
- Support two joysticks. Wouldn’t need more than a third 4066 plus wires. There is untested support for two controllers already in the software.
- Not all joyports are the same. For example many MSX games need two buttons. Spectrum +2 pinout is different. Five lines aren’t enough to support MSX or Amiga mouse emulation.
- Joypad support and configurable keys would be nice (and rather simple to implement).
- Joyduino 0.01. The initial release.