Introduction: MAME Gaming Table With Raspberry Pi

Inspired by similar projects online, I've been working with a neighbour to build a pair of coffee-table MAME-based retro gaming tables.  The more compact one is mine; the larger with two sets of controls is his.  Photos ofboth are used in this instructable.

These use a Raspberry Pi computer, flat-screen monitor or TV, and arcade controls mounted inside an old wooden coffee table, and are simple to make, provided you have some skill with a soldering iron and know your way around Linux.  The total cost to me was about NZ$300, so about US$250 - though this is largely because of using cheap secondhand display and table.

This is what you will need:

1. Raspberry Pi computer - about $50
2. 4GB SD memory card - about $8 or less.
3. I-PACve USB controller from Ultimarc - $35
4. Arcade controls - 7 buttons, one joystick, extended length. about $100.  You can get multiple sets if you want multi players or additional control buttons (for example, a 'snapshot' or 'pause' button).  The IPAC will allow two joysticks, two sets of 8 fire buttons, plus 2 coin, 2 start and 4 control buttons.  You can also remap the keys within MAME or AdvMenu if you want.
5. Power supply for the Pi.  A 1A micro-USB phone charger (do not get a 500mA one!) - about $7
6. (optional) 4-way USB hub and USB extension cable, to allow an external USB port for upgrades. - About $3
7. (optional) wireless USB keyboard - $10
8. Flat-screen TV (HDMI capable) or monitor (DVI or HDMI capable). NOTE: NOT ALL screen will work with the Pi!  Many cannot follow the weak video signal put out, even with the hdmi boost enabled.  If you find that the red or all video is missing or static then you have this problem.  Also, you want a TV/Monitor which powers up into active mode, not standby.  I picked one up second-hand from eBay for $70
9. HDMI or HDMI-DVI cable (depending on your choice of screen) - $11
10. Power socket, power junction box, spare power cable. - $4
11. Amplified speakers for a PC.  These may not be required if you have an old HDMI TV for your screen, as the sound can then be sent via HDMI.  You may want it, though, as then the sound can be controlled via an external switch. About $10
12. Spare cable for connecting controls.  I used a few feet of CAT5 network cable as it is handily colour coded.
13. (optional but recommended) piece of toughened glass the size of your screen. This cost me $50.
14. Wooden table, about 80x80 or 90x90 cm.  You can pick these up from eBay for $40-$90 or so.  Make sure it is fairly solid.  I picked one up on eBay for $16 but realistically you'd expect to pay more.
15. Metal strips (for mounting screen).  Could use wooden bars, or small box-section steel instead.

1. Soldering iron and solder
2. Cable cutters and stripppers
3. Powered saw
5. Drill, with 28mm hole cutter
6. Screwdriver, with screws (small #4 and #6 ones)
7. Cable clips
8. Hammer
9. Hot glue gun
10. Black paint

Step 1: Prepare the Table

Measure the screen size of your display, and work out where you will mount this under the table.  Make sure to leave enough space for the controls, particularly the joystick, as it has a wider base (about 10cm).

Once you know where you want it, mark this out on the table and cut out the opening.  Drill through the corners and cut between the holes.  Optionally, use a router to inset the edge in order to hold a sheet of toughened glass to lie flush with the surface of the table and protect the display.

Check this is the correct size and position before continuing.

Drill out 28mm (check the size of the arcade controls you are using!) holes to mount the buttons, and for the joystick to go through.   I put four on the table side (coin, 1P, 2P, ESC) and three on the top (three fire buttons).  The ESC is important as this is the 'exit out' button to leave the game and go back to the menu.  You may also want a pause button on the top.

Also, drill out a small hole to mount the USB cable (if you want an external USB port) and a hole for the power socket, if you want one.

The picture here shows the screen held in place over the hole by two metal straps.  You can also see the (silver) USB cable poking through the hole, ready to be held in place with hot glue.

Step 2:

Now you have the holes all cut, and the screen mounted, time to fit all the buttons and joystick(s) in place.  The joystick will likely need the extended length arm, especially if the wood is thick.

The microswitches on the controls all have 3 terminals.  The top ones are ground, and should all be connected together, and then connected to GND on the I-PAC.

The middle terminal is the one you have to solder the signal wires to.  Note which wire is for u, down, left, right, etc (remember you're looking at the bottom of the table!)

Connect these wires to the appropriate place on the IPAC terminals.  The coin button should go to 1COIN, and the 1player and 2player start buttons to 1START and 2START.  The ESC button should go to 2B, and a pause button (if you have it) to 1A.  I used 1B for a snapshot button during development.  If you're interested, the key codes for each terminal are here

Attach the IPAC to the table GENTLY using some small (#4 or #6) screws.  Fix the cables in place using  cable nails.

You can similarly fix in place the Raspberry Pi, and USB hub (if you use one).  DO NOT use hot glue for this!  The heat of the glue can damage the circuitry, and makes it difficult to make changes later...

Run the video cable from the Pi to the display, and (if you want one) the USB cable from the hub to the external hole.  Connect the IPAC directly to the USB port on the Pi, and the USB hub as well.  Put the IPAC into the top USB port, so that it is always Keyboard0 even if you also plug in a second keyboard.

Step 3:

Now we need to provide power.

I've set up a euro socket on the side of the table (the sort of plug/socket generally used by desktop computers and kettles) to make things simpler.  This goes to a white junction box (to keep nasty 250V electricity away from children's fingers) and is split out to cables which go to the display, the USB charger, and the speaker amplifier (not shown).

The charger had to have the case opened, and the integral plug snipped off.  The two power wires were then joined to the black cable.  Note that internally it uses red/black for live/neutral; most cables use brown/blue.  Don't mix the two up.

When put into place, all cables are fixed down to hold them in place and prevent movement.

The charger and display power supply are fixed down with hot glue.

The final cable out of the box is soldered to the back of the power socket, which is then held in place with hot glue.

Step 4:

Next, we connect up the sounds amplifier, if we have one.  Take the speakers out of their cases and you should have two speakers plus a small amplifier board.  You connect the 2.5mm plug to the sound port on the Pi, and you can mount the speakers wherever is convenient; wire the power cable in to the power supply.

If your amplifier has controls (volume, on/off etc) you can situate the board in such a way that the controls are accessible from outside.

This marks the end of the hardware setup.  Now on to software.

Step 5:

If you want to make things easier, you can download a copy of the 4GB SD card image I've made and install it onto your 4GB SD card using DiskImage from or similar.
SD Card image:

If you're a Linux hacker, you can install the Raspbian image, AdvMame, Advmenu, a bunch of ROM images and set things up to start on boot.  ROM images need to be prepared for exactly your version of MAME so a ROM manager is essential.

Assuming you now have a working SD image, you still need to tell it about your monitor - is it 4x3 or 16x9, does it need HDMI boost, and so on.  You can also customise the keys in the menu system.

On my image, the important files are:

/boot/config.txt -- in here you set boot options.  Specify the screen size, and set 'overscan' options if the picture comes off of the edge of the screen.  Also, set if you have your screen mounted vertically or horizontally (I set it vertical by default)

/usr/local/share/advance -- default options and ROMs

/home/mame/.advance/advmenu,rc -- menu configuration.  Set menu keys here if you want to change them.

/home/mame/.advance/advmame,rc -- emulator configuration.  You need to set in here your screen aspect ratio and default orientation.  You also change any in-game command keys, make a game run with different options, and so on.

The default user/passwords I've set up are:

pi : strawberry
mame : mame
root : 3bmshtr

The system will auto-start MAME.  Connect up your keyboard, and use the ` key (or fire2+coin) to access the frontend menu; then you can select 'drop to shell' to get a command line as MAME.  Use the vi command to edit the files.  Note that, if you edit advmenu.rc, you will need to shutdown and reboot - exiting back to the menu will overwrite your changes!  Use "sudo shutdown -r now" to reboot.

There are over a thousand ROMs installed, and some do not work; some have corrupted sound or are too CPU-intensive to work on the Pi.  You need to delete the ones you do not want.

A later version of the image will have snapshots, fewer (but all working) games, more command menu options, and so on.

I've also hooked the table into the house 802.11b wireless network; now I can drop new ROMs in (and delete useless ones) by using FTP and SCP from my desktop, which is much simpler.

NOTE: Rarely, if you pull the power lead out while disk activity is going on, you might corrupt the filesystem and prevent the system from booting.  In this case, you should re-image the SD chip and all should be OK.  For this reason, it is worth taking a backup after making large changes or if you want to preserve a particularly good hiscore...


DannyG35 made it! (author)2016-03-13

Nice guide. I'm going to try and build one with the new raspberry pi 3. I hear this has much better processing power and should run most roms without issue. Has anyone built this with a rasperry pi 2 or 3 and can confirm how emulation speeds are?

sshipway made it! (author)sshipway2016-03-13

I was also wondering if the RPi3 would do better - many of the sprite-based games do not run fast enough under RpiB, or therir sound does not work. I have not heard of anyone doing this yet, though. Maybe one day I'll upgrade my table to an RPi3 and if I do I'll post here.

AidanHegg made it! (author)2016-01-13

do you have a link to where you got the joystick and buttons?

sshipway made it! (author)sshipway2016-01-13

They came from, the same place where I bought the iPac controller.
If you get a joystick from them, make sure that the handle is long enough for the thickness of your table. I had to get an extended long shaft replacement as their default is for a much thinner mounting surface.

partypanda2345 made it! (author)2013-07-29

Ok do u have to pay for the arcade cause to giv it a real feel u do not want to have to open the internet

JohnGo1 made it! (author)2013-07-06

Thanks! The root password will give me what I need. And it's the old games that I'm after. The ones I remember playing in the arcades when that's the only place you could.

JohnGo1 made it! (author)2013-07-05

This is a great piece of work, and the Mame work with all the ROMs will save me ahuge amount of time. Thankyou! I am a bit stuck though. I'm trying to access Raspi-config, but when I type in Sudo raspi-config and type in the password for mame (mame) I get the "mame is not in the sudoers file,, etc". response. Any help would be greatly appreciated. I'd like to overclock the Pi and I can't make any changes. Thanks.


sshipway made it! (author)sshipway2013-07-05

Also - in the sample SD image, the Pi is already overclocked to 800MHz (normal is 700MHz). I'd not want to go higher (though I've head of people going right up to 1GHz) as it can overheat in the enclosed space, and shortens the life of the Pi.

sshipway made it! (author)sshipway2013-07-05

In the SD image I've posted, the password for 'mame' is 'mame', the password for 'pi' is 'strawberry' and the password for 'root' is '3bmshtr'.
Once you get a shell (drop to shell from the MAME interface) you can use 'su' to change to root (give the root password).
I have an updated image I will post soon, that contains more items for control of wireless networking, some screenshots for some of the games, and a sudoers rule to allow the mame user to change to root.

sshipway made it! (author)2013-07-05

Something to note - while the Raspberry Pi is a great compact and cheap option, it doesn't have the power required to run many of the ROM images available. Many will work but at a slower rate, with corrupted source - you can overclock the Pi to help, but this has other issues with heat dissipation and component life.
Some games are simply not playable as the emulator cannot keep up with the requirements. The old Pacman, Kon, Frogger etc are fine, but more modern Street Fighter, Raiden2 etc where there is a lot of sprite action on the screen will have issues.
If this is a big thing for you, consider buying a small but more powerful PC to use in place of the Pi. Small hardback-book-sized PCs are available from many places. This will cost you more like $500 than $50, but will play all the games and give you more disk space to work with.

About This Instructable




More by sshipway:Increase disk space in a TiVoRepair a broken Series 3 TiVoMAME gaming table with Raspberry Pi
Add instructable to: