SNESDev-RPi: A SNES-Adapter for the Raspberry Pi
You already might have heard of the Raspberry Pi. It is a credit-card sized PC from the Raspberry Pi Foundation and is going into mass production and distribution these days. There is a huge demand for “the Pi” and the first orders are limited to one per person. A few weeks ago I got my Pi delivered and started working on what I would describe as “universal console”. In this post I describe my initial thoughts about this project and present an adapter that allows you to use SNES controllers as input devices for the Raspberry Pi.
UPDATE: The RetroPie GPIO Adapter is now available and provides an easy and safe way for connecting NES and SNES controllers to the RPi!
Being part of the 80ies generation I belong to the group of people that grew up with a whole bunch of 8- and 16-bit video consoles. Nowadays, you can find emulators for all kinds of these consoles and some time ago I got the idea that it would be nice to have a tiny PC that could just be switched on to play this or that good old game. When I read about the Raspberry I finally decided to start this project.
There are several things that have to be done for this:
- Decide for a stable working Linux distribution that provides access to the video and sound hardware.
- Make the emulator(s) work.
- Build a launch menu that allows for selecting the console and or the video game.
- Build a hardware controller interface that allows you to connect real video game controllers.
- Build a case that contains the Raspberry and the connector(s) for the controller(s).
I know that you are now saying “Each of these five points is a project on its own.” and I agree! Let’s have a brief look at each of these points now:
The distribution The decision for a “good” distribution is tricky and I am not sure which of the available ones is best suited. Since the Debian distro will be the official distribution of the Raspberry, I think that this might be the best choice. But, currently, even the Debian distro provides an ALSA module only in alpha stage. This produces horrible audio outputs and leads us to the second point:
The emulators There is already work going on for tht point and ToadKing is doing fantastic work here. He is adapting the RetroArch emulator to the Raspberry currently and provides a public Github repository. There is also a thread about this work in the official forum. This is a central piece of this “universal console” and I really hope that the Raspberry port of RetroArch and of the emulator cores will be further developed.
The launch menu Maybe there already exists a launcher that can be compiled on the Raspberry. If you know such a thing, please tell me! Otherwise, I thought of a rudimentary (Python?) script that could be used for the beginning. Update: In the meantime, the front end “Emulation Station” has started to be developed. A lot of ideas are still being discussed and on the to-do list, but there is already a running version of it. A follow-up article presents the RetroPie setup script that automates the installation of emulators and front end.
The controller interface I think that an authentic retro-gaming device needs authentic input hardware. The Raspberry comes with two USB ports and one possibility would be to use some remakes of, for example, SNES controllers with USB connectors. In order to use original controllers, however, one needs to come up with an interface for these controllers. This is where the second part of this post comes into play: I built an adapter board that allows you to connect two SNES connectors to the GPIO pins of the Raspberry. I got the SNES connectors from two controller extension cables. This wiki article gives some more details about the GPIO pins of the Rasperry. A short C program reads the states of the two controllers and passes all button presses to a virtual keyboard that is implemented with the help of the uinput module. In the following, I explain some more details of this adapter, show some pictures of it, and, at the end, also a video demo.
Let us first talk about the hardware part. The idea of designing a PCB that could be used for connecting SNES controllers to a microcontroller or PC came up when I read about a project, in which an NES controller was connected to an iPad. In previous posts, I wrote about the first prototype, the SNES-adapter PCB, and a case for the adapter. For the connection to the Raspberry I used the following parts:
- 1x SNES-adapter PCB
- 2x SNES connectors (obtained from extension cables)
- 2x Shrouded Pin Header, 2×3 pins
- 2x Ribbon Crimp Connector, 2×3 pins
- Ribbon Cable – 6 wire
- 1x Ribbon Crimp Connector, 2×13 pins
- Ribbon Cable – 26 wire
The SNES-adapter board really does nothing but to provide a clean wiring for the connectors. You could also connect a SNES connector with the 26-wire ribbon cable directly.
For more detail: SNESDev-RPi: A SNES-Adapter for the Raspberry Pi