Guest blog # 6: MAME cabinet by Darren J
Raspberry Pi Gaming Day continues with a MAME cabinet. The arcade emulator MAME was first mentioned on the Raspberry Pi forum on 29 July 2011, just two days after it opened and the MAME meme has been popular ever since. We’ve seen our share of solid projects but Darren’s full size, ex-JAMMA cabinet complete with working coin slot is a thing of great beauty, especially if you spent the weekends of your youth perfecting your button flicking technique on the likes of Track and Field.
If the sound of the credits going on as the coin drops doesn’ t make you grin like a loon then you are dead; dead I tells ya! (Or under 30 years of age.)
“At the end of November, it’s my girlfriend’s 40th birthday party, and it is 1980s-themed. To that end, everyone is wearing fancy dress, and the room we’re having the party in will have some 80s-themed props, such as a giant Rubik’s cube, etc. Having had a Pi for a few months and having played with it for a few Linux tasks as well as shocking people that something so small is actually a working computer, I thought what could be a better idea than a full-sized arcade cabinet with the Pi in, running MAME and the 80s classic game Track and Field, with the money to play going to a local charity, and a prize for the high score at the end of the evening? It seemed such a simple plan.
First up, I had to get hold of a cabinet, and fortunately one came up at the right price on eBay the week I thought about it. It’s a JAMMA cabinet which was a standard form of cabinet with a well-documented edge connector for connection to the brains of the game, and comes with a DC PSU, speaker and the coin counting mechanism, plus a big and heavy CRT monitor. The first job was to remove all the parts I wouldn’t be using, namely the monitor and its surround, and fitting a 19” 4:3 TFT monitor in its place (which I’d been given when buying a cheap Shuttle PC a couple of months before).
However, there was some disappointment next, the PSU didn’t work, so I needed to repurpose the PC from said Shuttle whose motherboard had expired! A simple bridge on the power connection meant it was powered on all the time, and it was easy to rig up a USB socket to power the Pi. The most important issue, however, was getting the inputs from the buttons and joysticks to the Pi. Initially I’d had the idea of using a keyboard and wiring into the matrix to achieve this, but a quick look at some emulation sites showed that USB keyboards were not renowned for good performance, so an iPac 2 was bought; I hadn’t seen any information on anyone using one with a Pi, but as it supposedly appeared as a standard USB keyboard to the host system, I thought it was worth a try. In addition, having screw terminals would make connecting all the buttons a breeze – it was a simple case of finding a pinout of the JAMMA edge connector and attaching the cables one at a time. With the addition of a powered USB hub, it was time to see if the Pi worked with the iPac 2.
I needn’t have worried, it worked without any issues at all, so now it was time for audio. The JAMMA boards have a built in amplifier to power the cabinet’s speaker, but the Pi only has a line-level output. A simple DIY amplifier kit was bought on eBay for a few pounds, soldered up and connected to the appropriate cables in the cabinet, and a cable to take the output from one channel of the Pi’s output made up – the games of the period I’m interested in are mono, so that’s no problem. Everything was mounted to the inner board of the cabinet using either screws (for the iPac and amplifier as they had holes) or drilling holes in the board and using carefully-placed cable ties (for the Pi, USB hub and PSU).
Now it was time for the software. MAME is a big piece of software and takes a while to compile (I’d heard tales of 7 hours or so), but fortunately Shea Silverman’s excellent site provided a binary that was quick to download, and dead easy to run with his instructions. Once the Raspbian distribution was customised to work the way I wanted (most importantly to go to the command line rather than to the GUI on boot), I only had a couple of ROM images available, but fortunately one was Track and Field, and with a quick run of AdvanceMAME, it was working!
There were some configuration issues to address – one of the biggest was the inputs; AdvanceMAME is intelligent enough to know when you’ve got two keyboards connected and to differentiate between them, but if you’re planning long-term to have only an iPac in place then you should never run AdvanceMAME with both connected as later on you’ll have to reconfigure. Getting the screen resolution and expansion right for each game can take a few attempts, but once everything is set it’s easy enough to save the settings from the MAME menu and the game will be as it was the next time you reload it. Getting the audio volume right involved a potentiometer in the input of the amp to reduce the level; when connected directly it was far too loud, and reducing the volume in MAME meant the inevitable low-level noise on the Pi’s output was being amplified, so during portions of quiet there was a lot of background noise.
The cabinet came with a coin counter and converter board, which fortunately DIP switch connections were found on the Internet, and it recognises all modern UK coinage, allowing a game price to be set from 10p to £1.60.
I wanted the cabinet to be a stand-alone proposition, and use the AdvanceMENU front-end for MAME, but also to be able to lock the cabinet into the game. This was done by fitting a semi-concealed button to the underside of the cabinet (which generates an ‘ESC’ when pressed) and a keyswitch to disable it. By setting the Pi’s username and password suitably, it’s possible to log into it using only the buttons and joysticks, and also to run the Menu and shut the system down (as the left-hand joystick creates cursor key codes, it’s possible to recall previous commands, and enter is achieved by pressing the Player 1 start button and moving the joystick to the left).
The look on my friend’s face when I showed him what was running the entire cabinet was well worth it – he couldn’t believe such a small machine is capable of running the system at all, let alone as well as it does. The shock must have explained how I came to beat such a “Track and Field Legend” just after!
At present the range of games the Pi can play is limited – some need emulation that’s just beyond it and the sound is usually the first indicator that things are not going to go well, but for vintage games it’s working well, and is exactly what I planned for – no hard drives to worry about, and much lighter than a fragile PC. I hope it’ll raise a decent amount of money as a group of 30- and 40-somethings try to relive their wasted youths spent competing at Track and Field! “
You’ve got my attention.
Presario 4550,amd K6 233mhz Con 48mb De Ram vga agp sparkle
network tp link
This is exactly what I wanted to see in Raspberry Pi, with the SD card standing in as the game boards. Hopefully someone will make a dedicated distro to program games in to make this concept work.
Nice work mate, this exactly what I plan to do with my Pi. Oh and also introduce programming to my kids ;-)
For your wife’s birthday.
She’s not my wife.
Other than that, I have no idea what you mean! ;-)
I know what he means!!! x
If she puts up with this kind of thing then I’d suggest rectifying this forthwith!
That’s awesome, I’ve always wanted to build me a MAME/JAMMA cabinet.
But everybody seems to shove an LCD in there these days.
Would it be possible to drive the CRT at it’s proper low scan rate from a Raspberry Pi?
I remember back in the day DOS MAME on proper DOS with an ATI Rage with a multisync CRT would crank the scan rate down which looked much better than fake scan lines for the old games. You even got the faint diagonals between the lines.
However, with the advent of Win98 and up, you were no longer able to reprogram the graphics card in a bare-metal enough manner to achieve that effect.
Anybody have any ideas whether this would now be possible again with an RPi?
I sure hope that it’s possible with a suitable modeline. It’s bordering on blasphemous to put in a laggy TFT when you could have 15kHz CRT goodness. :-)
Isn’t there a perfectly good (ha) CVBS output connector on the RPI?
I built these , would be interesting how good the Pi is could do a computer swap out?!
clive — post author
Rob: they are two of the best designed and built MAME cabs I’ve seen. Cheers!
How does one make the RPi detect the coin that’s inserted into the coin slot?
clive — post author
The coin mechanism is wired to the coin 1 / coin 2 connections of the IPAC2, which then sends the signal as default MAME coin key presses (‘5’ and ‘6’)
Awesome post. I’d totally be up for doing something like that myself. I’m a Linux newbie so it may take me some time to get there.
Check out the proposal for the PiCade project of kickstarter – from the makers of the PiBow!
Great work Darren!
My “wife” has always wanted a Pacman cabinet, and i have always wanted to try something like this. My Pi is on order and should be able to rustle up most of the parts.
Would you have a complete list of equipment used and possibly a detailed schematic or drawing of the internal workings ?? I could mostly figure out most of it, just might need some details on the power and sound.
Is that PSU stolen from a DL320??
Nice design. Might reuse it. Thanks. I love the coment “The look on my friend’s face when I showed him what was running the entire cabinet was well worth it”
Sorta sums up the majority of the MAME arcade reality. All of those games we played as tiggers were running on bits… The Pi makes my projects so much more compact but at the same time keeping the 2 player street fighter (Classic) layout intact. All working 6 button per player… Fantastic.