Running Linux, 5th Edition - Matthias Kalle Dalheimer [114]
MAME
Probably the most famous and popular console emulator is MAME (Multiple Arcade Machine Emulator) . The focus of the MAME project (www.mame.net) is to create an emulator for the various different arcade platforms that have been in use over the years. In this respect the MAME project is much more complicated than many of the other console emulation projects because it supports many different platforms. Currently MAME supports thousands of arcade titles and the list continues to grow. You can view the list of currently supported titles on www.mame.net/gamelist.html.
MAME was originally a project for the Windows platform only; however, a Linux port, called Xmame , has been created. Xmame is based directly on the MAME source code, with changes being made only when necessary to run under Linux. Because of this you can treat Xmame under Linux like MAME under Windows, and ROMS that work on one will work on the other.
Xmame is a popular program and should already be packaged for your particular distribution, but if it isn't you can download the latest source from the project's site at x.mame.net. There are a number of different display options for Xmame , and some distributions package the different display options separately:
X11
The standard Xmame display option is output to a window under X.
SVGAlib
Xmame can also use SVGAlib to display to the console, allowing you to use Xmame without running X.
GL
Xmame can output to an X11 display using OpenGL libraries to take advantage of hardware acceleration on your video card.
SDL
Xmame can also use SDL libraries for output under an X11 environment. Similar to the OpenGL libraries, SDL lets Xmame take advantage of hardware acceleration where available.
Glide
As with OpenGL, Xmame can use the Glide libraries for hardware acceleration both under X and with SVGAlib for 3DFX cards.
To start, you will want to use the X11 display method because it is the default and is most likely to work with your system. The first time, just run xmame from the command line without any arguments. Xmame will search /etc/xmame/xmamerc for system-wide defaults and will create a local configuration directory under ~/.xmame. Copy the /etc/xmame/xmamerc file to ~/.xmame so you can tweak settings specific to your user. This file contains all the different settings for Xmame, but the first setting you will probably want to change is rompath. This setting controls in what directory Xmame looks for ROMs, so if your user has a local folder for MAME ROMs, put it here and save the file. Now you will be able to play any game you have a ROM for simply by passing the name of the ROM as an argument to Xmame. ROMs generally come in .zip files that contain a number of different files the emulator needs all in one package. To play your pacman.zip ROM, you would simply run:
$ xmame pacman
on the command line (Figure 7-7).
Now that the game is running, what do you do? Xmame uses the same keybindings as the DOS version of MAME. Table 7-1 lists some of the primary key bindings you will find yourself using.
Figure 7-7. Xmame with Pacman
Table 7-1. Xmame key bindings
Key
Action
P
Pause the game
F3
Reset the game
F8
Reduce frame skip
F9
Increase frame skip (useful to speed up games on slower machines)
ESC
Exit emulator
left-Shift + Pgup
Increase scale (makes game larger for higher-resolution displays)
left-Shift + Pgdn
Decrease scale
left-Shift + Insert
Normal window
left-Shift + Home
DGA fullscreen mode
In addition, individual games have their own key bindings. These vary from game to game, but there are some standard key bindings most games use for common buttons (Table 7-2).
Table 7-2. Common button