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.

YouTube Preview Image

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


An award win! And a teeny-tiny MAME cabinet from Orlando, Florida.

Before I start on the meat of this post, I have a boast to make: we won another award! We’re so excited at the way the press about Raspberry Pi has been getting recently; I got into the car we’d hired to take us home from the airport yesterday, and the driver lunged into the passenger seat and brought out a copy of Stuff Magazine to show us, with a two-page spread about things you can hack with your Raspberry Pi. Then, last night (at an event we were sadly unable to attend), we won a T3 Award for Innovation of the Year. We’re very proud, very pleased and extremely grateful to all of you who voted to get us onto the shortlist.

Back to the matter in hand. One of the nice things about this mini-tour of US hackspaces that Eben and I have just completed has been the way we’ve met some people we feel we already know well from the forums or from this blog and its comments section. Shea Silverman is one of those people; he’s had a MAME project featured here before, and he’s been helping people in our forums out with their MAME ideas too. Turns out that in real life, he’s a lovely, lovely chap. I spent a long time with Shea, coveting his newest Raspberry Pi hack: a miniature MAME cabinet which, when we saw it, was doing a very smart job of running Street Fighter II on its 2-inch display. I am still feeling terrible about the bit where I got over-enthused and started to walk across the room to show it to someone, forgetting that it was still plugged in at the wall. Happily, Shea has an awesome rugby-tackle on him (for an American). This cabinet is laser-cut using the facilities at FamiLAB, a really impressive hackspace in Orlando, Florida. This machine is running Advmame under the latest Raspbian at 900mhz; Shea will be releasing the SVG files for the cabinet itself soon (he’s planning to upgrade the screen to a 3in one for better visibility).

Shea has written a bit about the evening on his blog. I’m hoping we can return to some of the places we visited on this trip later on – we had an absolute blast on this trip, and really want to see what you all get up to over the next year with your Raspberry Pis!


Retro games and a retro joystick

A lot of people of a certain age (cough – that’d be me) have been using their Raspberry Pis to play the games that we wasted spent endless 10p coins on down at the arcade when we were kids. MAME (the Multiple Arcade Machine Emulator) is a really popular download for the Raspberry Pi, and you can run an increasing number of games on your Pi as developers in the community work on recompiling for Raspbian. Below, for example, is the most excellent Metal Slug 3. (If you want a MAME download for your own Raspberry Pi, Shea Silverman has a handy little tutorial on his site along with the relevant binaries.)

I don’t know about you, but I find that what controller you use has a massive impact on the satisfaction you get from a game. Sure, you can use keyboard commands, but a joystick built for the game is a tremendously cheering thing. And sure, you can use a modern USB joystick – but where’s the fun in that?

Chris Swan thinks so too, and has hacked a lovely 1980s Competition Pro 5000 (hurrah for eBay) to work with the GPIO pins on his Raspberry Pi.

Competition Pro 5000

The Competition Pro 5000 - back in the day, the Amiga user's joystick of choice. I'm looking at my DualShock3 PS3 controller and experiencing feelings of vertigo.

If you want to adapt your own retro joystick, there are hardware instructions and Python script to get everything working on his site. Frankly, the whole thing has me feeling like a 9-year-old with a bad haircut and twitchy thumbs again. Thanks Chris!