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).

Insides of CRT monitor

A TV like what they had in the old days. Don’t fiddle about inside kids: there’s bad electricity! Seriously!

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.

 

Raspberry Pi and other innrds MAME cabinet

PSU — Raspberry Pi — USB hub — iPAC2

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).

MAME cabinet

The finished cabinet.

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! “

19 Comments