Wednesday, October 10, 2007

Play classic arcade games with XMAME

PC users have been using MAME (Multiple Arcade Machine Emulator) for years to play old school arcade games. With a N800 or N770 internet tablet, you can now put the same great software to use on a handheld device.

Installing the software
The N800/N770 port of MAME is called XMAME. You can download and install it here. This is an easy "one click" installation package.

XMAME is a command-line application. This is not very convenient for people that know little or nothing about Linux commands. There is a second application available that provides XMAME with a graphical user interface. This application is called XMAEME. Unfortunately, as of this writing, using a N800 with the most recent updates applied, XMAEME doesn't seem to work properly (more on this later).

Finding and installing games
You probably wouldn't guess that the owners of some long forgotten arcade game would care about the software that originally powered that ancient machine. Well apparently they do care. As a result, MAME is not distributed with actual games and finding games is more or less a "public secret".

The game files for classic arcade games are called "ROMS". These are essentially the original binary programs that were stored on the hardware ROMs manufactured and installed in the original arcade machines. Sound effects are usually located in separate files called "samples".

Finding ROMs on the Internet is not very difficult. (hint: Google is your friend) Hypothetically, if you were to search for something like "Asteroids ROM", you would find the search results quite useful.

The ROMs for each game are typically grouped together and distributed in a single ZIP file. You don't have to unzip these files because XMAME knows how to deal with them. Likewise, if you find sound samples for a game, they will typically be distributed in a ZIP as well. Again, no need to unzip.

My struggle with XMAEME
If you're like me, your first instinct after installing XMAME and XMAEME is to find a ROM file somewhere, put it on an SD card, and try running it with XMAEME. And like me, you would then see an ambiguous error message that simply says "Unable to load ROM". Damn it!

If you have a little bit of Linux command-line experience you might eventually track down an XMAME configuration file called /usr/lib/xmame/xmamerc which tells the program, among other things, where to look for ROM and sound sample files. Aha! Copy the test ROM to the default directory and XMAEME actually shows it in the list of ROMS it knows about. Launch the game and viola... "Unable to load ROM". Damn it!

I'm a late-comer to the internet tablet party. but I'm guessing XMAEME originally worked and maybe still works for other types of games (NES, GBA, etc). As of this writing however, using an N800 with the most recent OS updates, XMAEME simply doesn't seem possible.

When all else fails...
Hopefully, the keepers of XMAEME will soon resolve this problem. For the time being, however, it looks like the only way to actually launch MAME ROMs is via the command-line. If you have any experience with the Linux command-line, you'll have no problem following the next steps. If not, I guess you better grab some bench until XMAEME is working again or until I can figure out a straightforward method to add a shell script to the N800 task launcher.

The easiest way to use XMAME from the command-line is to have a look in the /usr/lib/xmame/xmamerc configuration file previously referenced. Although you can use command-line options to tell XMAME to look wherever you like for a particular ROM and/or sound sample file, it's actually much easier to just deposit your ROMs where XMAME expects to find them. As an alternative, you can edit the xmamerc file and tell it to look for ROMs and/or sound samples in locations of your choosing.

The default location for ROM files is /media/mmc1/roms (on the SD card in the external slot). So you'll simply need to make a folder on the SD card called roms and deposit any game ROMs inside.

The default location for sound samples is /usr/share/games/xmame/samples. Why this is not /media/mmc1/samples by default I don't know. On my N800, the path /usr/share/games didn't even exist. So, in my opinion, you should probably edit the xmamerc file. Find the line that reads:

samplepath /usr/share/games/xmame/samples

And modify it so that it reads:

samplepath /media/mmc1/samples

Launching XMAME from the command-line
At a command-line you need only type XMAME game [options]. For example:

XMAME startrek -fullscreen

There are several useful options for XMAME, including the "-fullscreen" option in the example above. You can see a complete list of the options by typing "XMAME -?".

Author's note
If any readers happen to know why XMAEME no longer works on the N800 and/or some easy work-around for the current issues - please post a comment and I will edit this article accordingly. Putting a user interface on XMAME makes it infinitely more usable by a large group of people that otherwise aren't going to bother learning how to use the Linux command-line just to use MAME.

1 comment:

Unknown said...

any chance you could give more detailed instructions on the command line commands to edit the file / run the roms etc ?

I have xmame installed on a n810