MAME with Ubuntu 11.10 in a JAMMA Arcade Cabinet
NOTE: My blog has now moved. Please visit my new blog where I write about audio apps, diy synthesizers, and CNCs.
NOTE: After trying to get MAME running with Ubuntu 11.10 on an arcade monitor I actually ran into a ton of trouble with some X11 crashes that would not go away. Since then, I've found Groovy Arcade Linux which is made for linux in arcade cabinets. I will be writing a review/tutorial for installing Groovy soon as I move to it as a possible solution!
Like this post? Consider following me on twitter!
This blog post describes the work necessary to get a PC running Ubuntu 11.10 running MAME and various other emulators inside a real JAMMA arcade cabinet with a real monitor.
For the interface between the PC and the arcade cabinet I chose a J-PAC adapter. On the computer side it plugs accepts a VGA and PS/2 connection, and it plugs directly into the JAMMA connector inside the arcade cabinet. I considered manually hacking the buttons of an xbox controller to the arcade buttons, but for $100 including shipping, this also includes an amplifier for the video signal which I did not want to build myself.
1. Parts needed
- JAMMA arcade cabinet. The monitor and arcade controls should work and be connected to the JAMMA standard connector.
- Computer. The faster, the better, if you want to emulate newer games. Needs video card, sound card, some sort of network card. I chose to install a wifi PCI adapter so that I could SSH/FTP to the computer while it's inside the arcade cabinet.
- J-PAC, as mentioned previously
- Another computer, networked to the MAME computer
- MAME ROMs. Can't help ya.
2. Prepare Arcade Cabinet
Following the JPAC installation page, remove the game power supply (not the monitor transformer!) and game board from the arcade cabinet. Be careful! There are voltages present in the cabinet that could kill you.
If your cabinet has 6 buttons per player, wire buttons 4/5/6 to the J-PAC adapter screw terminals. Daisy chain a ground connection to all the buttons and wire it to the GND connection on the J-PAC.
Find space in the cabinet to fit your computer. I had a shelf in mine for the original game board. I lowered it 3 inches in order to fit the case and not have to resort to putting it on the ground with the monitor transformer.
3. General computer installation
Until the last step, we're going to leave the computer out of the arcade cabinet. Hook it up to a normal PC monitor.
- Install Ubuntu 11.10. I downloaded and burnt the ISO to CD. I made my user account "mame". It doesn't matter if you choose "auto-login" here because we're actually going to modify things later.
- Click on the top-left and in the search bar type "terminal" and hit enter. Then enter the following command (It's long)
sudo apt-get install ssh samba ftpd fluxbox
You may need to configure samba by editing /etc/samba/smb.conf to enable home directory accounts.
We need to enable auto-logon, but we're also going to boot into the lighter-weight fluxbox instead of the Ubuntu Unity interface. Edit the file /etc/lightdm/lightdm.conf to contain:
This will boot fluxbox directly, without prompting for a user/password. Fluxbox takes up less resources and will load quicker than the Ubuntu Unity interface. I also know it better so it's easier for me to script it to load the MAME launcher.
3. MAME configuration
First, install MAME:
sudo apt-get install mame
The default Ubuntu MAME install tries to load a config from ~/.mame/, but we don't want to hide our MAME directory so do the following:
mkdir -p ~/emulators/mame
ln -s ~/emulators/mame ~/.mame
Put your ROMs into ~/emulators/mame/roms and make sure you can run them by with:
Download the MAME history, category list, controls.ini, etc.. and place them in ~/emulators/mame.
4. Wah!Cade configuration
To get it to auto-start on boot, edit ~/.fluxbox/startup and add the line:
/usr/local/bin/wahcade -f &
before the "exec fluxbox" line.
Reboot and make sure that wahcade starts without any needed input and goes to the game list. If you can reach the cord, plug the J-PAC just into the PS/2 (or USB) connection and make sure it is configured properly to run wahcade.
5. Reconfigure X11 for Arcade Monitor
This part was the toughest for me. Usually people use windows and the soft15 application to force their video card to output the arcade cabinet-friendly 15kHz signal. I tried a bunch of solutions to this and what I came up with was creating a file /home/mame/.xprofile that will use xrandr to add, then set, the perfect modeline for the arcade monitor. Be warned! After you reboot this will run and your normal monitor will likely not be able to display the signal. Be sure that you can SSH into the arcade machine from your other computer before adding the .xprofile file.
xrandr --newmode "mame" 12.192000 640 656 720 800 240 244 248 254 -HSync +VSync
xrandr --addmode VGA-1 "mame"
xrandr --output VGA-1 --mode mame
Shutdown and attach the PC into the arcade cabinet. Attach the J-PAC to both the PS/2 or USB, and the SVGA connector. Boot up and it should be working!