Friday, May 21, 2010

MAME Tutorial

(this post is taken from my other blog)

So, some friends of mine have expressed an interest in MAME, so I thought I'd write a little tutorial to help them out. This tutorial is for windows users. I don't know if MAME works on an apple, but somehow I doubt it.

What is MAME? M.A.M.E. stands for Multiple Arcade Machine Emulator.
Wikipedia:     "MAME is an emulator application designed to recreate the hardware of arcade game systems in software, with the intent of preserving gaming history and preventing vintage games from being lost or forgotten. The aim of MAME is to be a reference to the inner workings of the emulated arcade machines; the ability to actually play the games is considered "a nice side effect".
There are tons of different MAME versions and programs to choose from, we're going to be working with WolfMamePlus 0.106 because that's the one I'm using right now and it has a lot of cool features. Also if you want to upload your scores to Twin Galaxies, that's the version you'll need, more on that later.

Ok let's start!
Download and run the wolfmameplus-0106.exe executable file. (7.8 MB) Make sure you give it it's own folder, it's going to make a bunch of new directories. It should look like this:

The first thing you are going to want to do is make three new folders. Name them:  roms snap and inp

roms is where you will put your roms.

snap is where your game snapshots will save to.

inp is where you're recorded games will save to.

 Now go ahead and open the mamep106gui-vc.exe executable.

You will see big list of games that are possible to play. You aren't going to be able to play any games yet except for Pong. In order to play other games you are going to need ROMs. ROMs come in .zip file format and you don't need to extract them.
Now let's get you a ROM. We'll start with something simple.
Notice how in the title bar it says description, samples, name, type, trackball, etc.?
Well next to the game you want to play, notice the entry "name". This is the name of your ROM.
We are going to play Dig Dug, so we will need to find the ROM named

If we wanted to play Diet Go Go we would need to find the file get it? Ok.
There are plenty of sites that host ROM files. I've found that if you just search for the name of the ROM you are looking for with .zip added onto it, you will be able to find it pretty easily usually
Right. So download your Dig Dug ROM
Put the file into your roms folder that you created.
On the left side of your mame program click on the folder labled available.
Notice that it only says pong. Click on File and selct Audit all games.
Wait for it to audit and you should see Dig Dug listed as available.
Doubleclick on Dig Dug to load the ROM.

Type OK at the first prompt, then press enter when you see the black screen with the blue box in the corner.
You will see the game doing a bunch of weird stuff, this is the game booting up just like it would if it was an arcade game getting turned on, then you'll see the attract screen. Now to play you'll need to insert a coin, but before we do that, lets press TAB and take a look.

Input (general) lets you map the buttons to your keyboard for EVERY game that you will play.
Input (this game) let's you map the buttons to your keyboard for this game only.
After you have mapped the buttons, they will stay that way until you change them again.
Dip switches let's you change some options on the game, like difficulty level, number of lives, etc. It depends on what switches the game has. (on some newer games you have to press F2 to change some options.)
Press ENTER to get into the sub-menus and ESCAPE to go back.

The keys are already mapped for you to start, the arrow keys are your joystick, and Dig Dug only has one button (besides the start button) and by default it is mapped to LeftCtrl.
So give Dig Dug a try. To insert a coin, press 5. To press player one start, press 1. If you want to pause your game press P.
Now you are playing Dig Dug! Wheee! Press ESCAPE when you are done playing to quit.

So that's easy enough for a game with one button, but when you start playing games with more buttons you'll find that the default keys are mapped all over the place. If you like it like that then fine, but I like to change them so they are more manageable. So let's go ahead and change the controls.
Press TAB to get into your menu, highlight Input (general) and press ENTER.

You can see that there are a ridiculous amount of buttons, I've yet to play a game that uses more than six.
So lets change the first six buttons for Player 1.
Scroll down to P1 Button 1 and press ENTER then press a
Scroll down to P1 Button 2 and press ENTER then press s
Scroll down to P1 Button 3 and press ENTER then press d
Scroll down to P1 Button 4 and press ENTER then press z
Scroll down to P1 Button 5 and press ENTER then press x
Scroll down to P1 Button 6 and press ENTER then press c
Press ESCAPE and then TAB or highlight Return to Game and press ENTER.
Now your six buttons are mapped to asdzxc in a standard Street Fighter-like layout for ALL your games.
If you play with your keyboard it's a lot easier to remember where they all are too.

Ok that's the end of part one.
You should be able to find a ROM for the game you want to play and play it now.

Part two.
Playing arcade games with a keyboard is interesting but it gets old pretty quick. If you want to really have fun with MAME you need to buy a programmable controller. I have a Saitek P880 USB controller, it looks like a PS2 controller with six buttons on the face, two shoulder buttons, a D-pad and two analog sticks and it works really well. It cost me about 20$.
So get yerself a controller and program your buttons to the corresponding keyboard keys that we set earlier (asdzxc)
Now in your MAME screen Select OPTIONS, select DEFAULT GAME OPTIONS from the drop down menu and select the controllers tab. Check the enable joystick button check box and press OK.
That should be all you need to get your controller working.

Part 3
Sometimes you will have your ROM file and try to play a game and get an error message that looks something like this.

If it's a REALLY long list of not founds, you could try to re-download your ROM, maybe from a different site and try again. If it still doesn't work, or if it's a short list, then you probably need a BIOS file. Now obviously the error message doesn't really tell you what BIOS file you need, so you will have to do some investigating. You can copy the contents of the error message in the usual way and search google. With a little reading you can figure out the name of the BIOS you are missing. The BIOS file is another .zip file that you will place, unzipped in your roms folder.
All neo-geo games for instance require the neo-geo bios named
Sometimes (especially in the case of neo-geo) you will get your BIOS file and your game still won't work, this is because sometimes there is more than one version of  the BIOS you need, as people keep re-dumping them. If it doesn't work, try getting one from another site, if it still doesn't work, try getting one from another site, if it still doesn't work...well you get the idea.

Part 3
Recording your games and submitting them to Twin Galaxies.
Twin Galaxies is kinda the reason I've been playing so much MAME again.
If there is a game you are really good at, you can go there and find out the current top score for your game.
If you think you can beat it, you can use WolfMame to record your game and send it to them to judge and get your name up and get some nerd-fame. As of right now I have 3 top scores and it's pretty fun.
To record your game when you play just right-click on the game and select Play and record input.
To submit your scores you are going to have to follow a bunch of rules for not only the game you are playing, but also just general rules.
Here are the general guidelines for MAME submissions.

Another cool thing you can do with your wolfmame, is download the .inp files for most games from Twin Galaxies and watch the actual games that are in the top scoring positions. Just go to FILE - Playback Input and select the .inp file that you downloaded, or the .inp file of the game you recorded to watch the game.

Part 4
Not every game you play will work.
Some games, like some driving games, lightgun games, trackball games, and games like Ikari Warriors that have spinning joysticks have special controller setups that I'm not really sure how to set up.
Some newer games use CHD files, I'm still working on getting these games to work.

Here are some general commands:

[TAB] key to bring up the internal menu system.

[~ TILDE] the onscreen display.

[p] for the pause button.

[F3] resets the game.

[F4] displays the game’s color palette.

[Shift-F7] save current game state [a-z, 1-0]

[F7] load game state [a-z, 1-0]

[F9] changes the frameskip on the fly.

[F10] toggles throttling.

[F11] toggles the FPS display.

[F12] takes a *.png snapshot of the game and places it in the \mame32\snap directory.

[ESC] exits from the game back to the Mame32 GUI.

[Left-Alt + Enter] toggle from fullscreen mode to windowed mode

Here are some good websites to get ROMS from:

I guess that's about it! Good luck!

I figured out how to play games on MAME with analog dial controls, like Ikari Warriors, TRON, etc.
Press TAB. go to player controls (this game) go down to where it says dial analog, select it with enter and press Esc to turn it off. Assign dial inc and dial dec to whatever keys you want to use. From the main menu go into analog controls and adjust dial digital speed to a managable level.

Robbo helpfully added:
You mentioned that 5 is "insert coin" and 1 is "start", but it's good to know that keys 5-8 are actually coin slots for players 1-4, and keys 1-4 are "start" for players 1-4. So if you were playing a two-player game against a friend, player one would insert credits with 5, while player two would use 6.

Also, another trick I learned a while ago -- instead of typing "OK" to start a game, you can press "left" and then "right" on your controller. If you are using the keyboard, you can just hit left arrow and then right arrow. If you are using a joystick, you press left and then right. This comes in handy on a MAME cabinet, where there is no easily accessible keyboard!
Discuss this topic on the forums!