Tuesday, September 16, 2008

How to build an arcade using Kubuntu, MAME, Wahcade, and X-Arcade

A friend and I have been wanting to build a MAME cabinet for the last few years. Recently we decided to go ahead and jump into the deep end. We took a lot of help from the internet, but found that we had to go it alone for a large part of the build. So I decided that it would be good for the both the internet at large as well as me to document my findings.


As far as building the arcade goes we used the directions at Arcadecab.com as a guide. These are great instructions, and the only issues I have are that his parts estimate is a little off (we spent about $475 w/o the coin door) and you have to make a few assumptions on finishing stages that could be a little more clear. You may want to check out his new plans. I will say that he probably made the parts list a few years ago, and prices have more than likely gone up. Lastly, you'll want to print out the directions or have a computer handy, because you'll need to read and re-read them a few times to get the point. As far as the build goes here are a few side notes:

  1. We didn't add the coin door so that we could save money
  2. Don't paint anything until you get the entire thing together. It's worth taking it back apart to paint it, so you can make sure it all fits together
  3. Think about a better way to mount the glass. We did, and it worked out great (Pics - None of these have the marquee in yet and some were with my iPhone so quality isn't the best). I'd tell you how to do it, but I'm going to focus on the software install. Email me if you have any questions, and I can help you with it.


Ok, with that out of the way I can tell you how to get your software up and running:

The first thing you're going to want to do is install your OS. I used Kubuntu and I'm going to base my directions off that, however once you get MAME installed the Wahcade directions should work for Windows.

To install Kubuntu go to Kubuntu.org. Once there, click on the download button to the left. Once you download and burn the ISO, pop it in your CD tray and restart your computer. The install is self explanatory, and there is plenty of help at the Ubuntu forums if you have any problems.

After you get Kubuntu installed, you need to install MAME. We used SDLMAME, but you could probably just as easily use XMAME.

To install MAME open a termial and type the following:

sudo apt-get install sdlmame

After you get MAME installed, you'll want to configure it. First, edit the mame.ini by doing the following:

sudo gedit /etc/sdlmame/mame.ini

You can also substitute gedit for vim or whatever you like. I'm using gedit for simplicity. The only thing we changed in here was the rom location. I took all the other directories out and put in:

~/roms/mame

I did this for a few reasons. First I want the location of my roms to be apparent because this is a community machine for work. Second, I want there to be only one location for my roms, so I know where all the roms are and lastly, I created a mame dir under roms because I may want to incorporate other emulators in the future (which Wahcade can do).

So after you save the mame.ini, you'll want to create the roms dir under you home directory by doing the following:

mkdir -p ~/roms/mame

Also, make a directory for your artwork (this is for Wahcade).

mkdir -p ~/roms/artwork/mame

We just decided to have screen shots and forgo the extra artwork. You can make the call on that and make other directories the extra artwork. Either way, you can find some artwork here.

To learn more about how to use mame either do the following:

man mame

at the console, or visit the website located here.

Now that you have MAME running, you need to get some roms. Getting roms is a grey area, so I'll leave out the specifics of where to get them, but I bet you can find some good ones here. Once you get your roms (and artwork if you want to be complete), save them in:

~/roms/mame

and

~/roms/artwork/mame

respectively. You need to make sure that the name of the screen shot matches the rom that it belongs to. This is how Wahcade will find your artwork. Next you need to configure your X-Arcade buttons in MAME. To do so, make sure your X-Arcade joystick is attached (I found that both USB and PS/2 connections worked) and type:

mame

at the command line. When you open MAME, your joystick will most likely not do much.

Use the keyboard to arrow up and down and go into the controller settings (you don't need to worry about having the arcade stick let you select games in MAME because you'll be using Wahcade). You'll want to map the player 1 buttons using the left side of the joystick and the player two buttons with the right side. All I did was map any of the up, down, right, and left key mappings to the up, down, right, and left joystick buttons. In the menu settings I also mapped the combination of first and second player buttons to exit a game. You'll want to map some kind of button combo to exit a game so you can get back to Wahcade. For some games, you'll need to map the "ball" to the joystick as well (unless you got the X-Arcade with the ball built in). After you do this, you'll want to go to each game and make sure all your controls work. You may find some don't work and you can figure out what button on the keyboard does what and then remember that and go back into the settings and map a button on the arcade pad. I also noticed that the buttons for player to seem to be opposite of player one. So I just recently switched the buttons around for player two. This is just a personal preference. You don't need to spend the time on this if you don't care. You can also map keys on a game by game basis by opening the game and pressing tab. This allows you to you a specific key combination for a certain game without having to change the global map. You can also edit the dip switch settings. You can change things like the difficulty of the game, the number of lifes, continues, etc... The settings will be different for each ROM.

Now you need to install Wahcade by doing the following:

cd ~/home
wget http://www.anti-particle.com/projects/wahcade/wahcade_0.99pre3_all.deb
dpkg -i wahcade*

Alternativly, you can point your browser to Anti-particle.com and find the latest version and download and install it.

Once you install Wahcade start up the Wahcade Setup Editor. You'll want to go to the "Keys" tab first and map all the up and down buttons to the up and down keys on the joystick and do the same for the left and right. All you have to do is select the function you want to re-map and then hit "enter". Then you just push the button you want to map. You can map more than one button to do the same thing. You can also map a combination of buttons to do one thing. The Setup Editor crashed on me a few times, but I just opened it back up and continued where I left off. The editor definitely needs a little more polishing, but it does the job. You can get more info on setup by going to the Wahcade site (these are for XMAME and an older version of Wahcade).

Next I went to the Emulators tab and selected MAME in the drop down. Next expand the List Generation section.

Set the ROM dir to

~/roms/mame

And set the List Generation Method to XML. Expand the Screen Saver section. I set mine to slide show and pointed it to the artwork directory. If you'd like to do a movie screen saver, then you need to find a movie you want and point Wahcade to the directory. You'll also need to install GStreamer by doing the following:

sudo apt-get install gstreamer

Next expand the Artwork section and point screen shot area to the artwork directory you created earlier (~/roms/artwork/mame). The last thing I did was go to the MAME only tab and edit the layout. I just edited the layout so it only showed the artwork that I have (screen shot in this case).

Now all you need to do is fire up Wahcade and give it a whirl. You can start it by opening up a command window and typing:

wahcade

I also created a few shortcuts on the desktop and by moving the joystick up and down, you can select it and fire it up with the player one button.

Here is a video of our arcade in action (minus the marquee):




I hope you find these directions useful and sorry they aren't more in depth. I should have created them while I was doing the work, but I didn't think about it, so I had to create them by memory. In the future, I'd like to add a history file so that we can keep high scores, add more games, and add more emulators. The arcade has been in action for about a month now, and it's a hit. It runs all the time and hasn't crashed often and is played everyday. If you have any questions or would like me to elaborate more, leave a commit or shoot me an email.