- sudo apt-get install scons libsdl1.2-dev libsdl1.2debian subersion libgtk2.0-dev
- svn checkout svn://svn.code.sf.net/p/fceultra/code/fceu fceultra
- cd fceultra/trunk
- sudo apt-get install liblua5.1
- sudo scons GTK=1 install
So since the wire coming out of my controller is a Cat5 cable with an RJ45 connector, I made an RJ45 – GPIO adapter. It was easier than I had expected. When I went looking for a female-female RJ45 connector (could barely believe I didn’t have one sitting around the house), I first went to the local dollar store and was disappointed that they were out of stock (go figure). So I went to Home Depot and picked one up for $3 (the one at the dollar store is $1). I’ve looked around for more since then (just for curiousity’s sake) and they go for $8 at Radio Shack. I’m pretty sure they’re not all made the same though. I lucked out on the one I got as it was super simple to modify. I just twisted it open and the two sides are connected nicely by 8 wires.
These wires are connected to thin pins which feed through the case and touch the Cat5 wires. I just unbent the pins and pulled them out so that the wires were easier to work with. I then soldered the Cat5 wires to the RJ45 connector wires.
After that it was just as simple as pushing the thin pins back into the connector and bending them into place. WAY easier than I had expected.
There it is. A very clean and neat connector that makes hooking up the controller and disconnecting it for storage VERY easy…not done though. At this point, I had to figure out which wires went where on the controller so I got out a volt meter and just tested each one. I then used the chart on this page to hook the connectors into their respective spots on the RPi and gave it a whirl. My main problem at this point was that I had installed the joystick vertically instead of horizontally and my joystick controls were 90 degrees off. I just moved the GPIO wires around until I got it correct.
At this point everything works fine with the exception of the 3rd button I installed. The software from Adafruit’s tutorial called for a 2-button controller so I have to manually map that 3rd button in order to be able to use it.
So for the first controller, I had a large piece of 1/2 plywood in the basement. The idea was to basically make a sandwich out of two pieces of plywood with the wiring in the middle. (using regular wood is a better idea as this sits in your lap and the plywood splinters a lot easier, but I just went with what I had in the basement).
The joystick: I cut a piece about 9×15″ (which was my guess at how big it would be to fit comfortably in my lap). I then cut a rectangular hole on one side for the joystick….and threw that piece of wood out as the rectangle was too big. The joystick has a pretty odd shape and you can’t cut the hole too big or you won’t have enough room for the mounting screws. So for my second attempt I traced as close as I could around the black frame of the joystick and inserted it through the bottom (taking the top metal plate off of the joystick). The next problem was with the PCB boards that stick out around the black frame of the joystick. My wood is 1/2 thick and the gape between those boards and the top metal plate is less than 1/2 an inch. So I just inserted the joystick in from the bottom, and traced around the PCB’s with a pencil. I then took a router and routed down a little less than 1/2″ just in the areas where the PCB board needs room. I gave the area where the wires connect to the joystick a little more room. I then sanded the whole thing down fairly well to remove any rough edges that may cause splinters. The whole joysticks in pretty snuggly when I put two mounting screws on the top and bottom of the joystick.
(Note: at this point when I was happy with how the top piece of wood looked, I set it ontop of another piece of plywood, traced around the border and cut another piece the same size to match. This will be the bottom piece)
The buttons: The buttons are 30mm, but I was able to use a 1 1/4″ drill bit to drill 3 holes with 1″ between them. Then I just popped them in. Note that there’s 3 buttons instead of Adafruit’s 2 buttons. It’s just because I planned on connecting the controller to the RPi with a Cat5 cable. There’s 8 wires in a Cat5 cable so with 1 ground wire, and 4 wires for joystick directions, I had 3 wires left over…just perfect for 3 buttons.
The spacers. I then put in 6 spacers. It’s just a 1″ in diameter wood dowel rod that I cut into 1″ lengths and screwed them into the bottom of the board. In hind-sight, I’d make the spacers just a tad bit longer. The heigth of the buttons is right at 1.5 inches…so 1/2″ plywood + a 1″ spacer leaves no room at all for error. I had to bend a couple of the tabs over on the buttons to make everything fit.
Wiring, Preping the cable: To start, I took a piece of 30′ (ish) Cat5 wire and cut it pretty much right in half. This gave me two 15′ wires, each wire with male RJ45 connector on one side, and loose wires on the other.
(Note, here is where I started doing a chart to try to keep track of what colored wires were connected where…but at the end of the day I messed it up so I don’t actually recommend bothering with)
(Another note, I soldered all my connections as there’s nothing worse than trying to trouble shoot something with the possibility of a bad connection giving you additional problems)
Wiring, the ground wire: From here, I took care of the ground wires. I started with one tab (doesn’t matter which one) from the outside button and ran a piece of extra wire I had laying around to a tab on the middle button, then another wire from that tab to the 3rd button, and then another wire over to the black ground wire on the joystick. I then connected that last connection to one of the Cat5 wires. This effectively connects the joystick and each button to the same ground wire. So far, one Cat5 wire has been used.
Wiring, the other buttons: I then connected one loose RJ45 wire to each of the open tabs on the 3 buttons. Pretty simple. So far, four Cat5 wires have een used (one for each button, and one for the ground).
Wiring, the joystick: With the four remaining Cat5 wires, I connect one to each of the colored wires on the joystick (remembering that black has already been connected to the ground).
Putting it all together: Now that all the wires are connected, I tied the Cat5 cable in a little knot around one of the spacers. This way if someone pulls on the cable, it pulls the whole controller, not the wiring connections. I screwed on the bottom board and it’s done. I now have one incredibly sturdy 3-button game controller (the third button needs to be mapped, but more on that later) that connects to the RPi with an RJ45 connector (more on that later too) that fits nicely in someone’s lap while they’re sitting on the couch. At some point, I’ll paint it to help prevent splinters (it’s plywood after all), but I sanded it fairly well and it’s okay for now.
This one works well on 2-player…its a lot harder than I remember though.
This is a 2-player game. Blue Superman and Red Superman can play at the same time. Runs great.
My son loves this one but I’m not that impressed. Its four player, but there’s some real lag to deal with…both audio and visual. I do like the four player concept though. Once I get the second controller made, it actually means that 3 people could play as the one player can still use the keyboard.
This may sound a bit obvious, but the default location to install ROMs is:
…and there’s no need to un-zip them.
Also, there’s a lot of sites that have ROMs, but here’s where I’m starting out:
Right now, I’m just going with MAME4ALL as my emulator. Eventually, I’d like to get some NES games going as well, but that requires another emulator so I’m getting all the other kinks worked out first.
Wow, that was fast. I got an email yesterday afternoon from Adafruit saying the joysticks were back in stock. I ordered yesterday evening (and they’re in the mail today…woohoo). I just checked today, they’re out of stock already (less than 24 hours in-stock). Glad I didn’t wait. :) Even though the note on the Adafruit website says restocking takes 5-10 days, this last restock took closer to a month (which is about how long it takes to get a container from China).