Introduction: MAME Gaming Table With Raspberry Pi

About: IT Professional, Parent of 3, Cub Scout leader. Based in New Zealand

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. Recommend using a Pi3 or later as the older models can't keep up with many of the emulations - 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. At least 1A (preferably 2A) 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 $5
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, which is a lot but worth it for safety if you'll have kids using it..
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: Wiring

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: Power

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.

When everything is finished, you should consider enclosing the back of the table for safety; you can get a sheet of pegboard (covered in many holes) which will let air flow but keep little fingers out.

Step 4: Sound

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: Software

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 (for RasPi 1):

An alternative is to install the RetroPi image. This is excellent but will require a bit of configuration (the controls, and if you have rotated your screen) plus you'll need to obtain and install some ROMs.

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