Next Previous Contents

3. Xmame frequently asked questions

3.1 What is mame?

Mame is a arcade machine emulator. Started in 1997, by Nicola Salmoria, mame started out as a series of emulators for individual games. This series of emulators was combined into a multiple game emulator format. This is the current form of mame, no longer a one man show, there are over 100 contributors to the project.

Mame was created by Nicola Salmoria.

Also see the official mame readme file (readme.mame)

3.2 What is mess?

Mess is just like mame a virtual machine emulator, only it doesn't emulate arcade machines but other computers and consoles.

Also see the official mess readme file (readme.mess)

3.3 What is xmame/xmess?

Xmame/xmess are the Unix/X11 ports of the mame and mess projects. It makes mame/mess available on *ix machines using the X11R6 X-Window system (and SVGAlib/ggi/XF86-DGA too).

Mame was orginally ported by Allard Van Der Bas, Dick the Ridder and Juan Antonio Marmnez.

Xmame/xmess is currently maintained by Hans de Goede.

3.4 What are the differences between mame/mess and xmame/xmess?

None significant.

Xmame/xmess is based on the mame/mess source code. Due to technical reasons beyond the scope of this document, the mame/mess source may not compile under Unix. That why the xmame/xmess project exists. Each time mame/mess is updated, the code is tested (and patched if needed) under Unix. This way xmame/xmess releases are always the same as their mame counterparts.

There are no plans for the independent development of xmame/xmess.

3.5 What hardware and operating systems are supported?

Xmame runs on both little endian and big endian CPU's, using aligned integer access if needed and is compatible with 64 bit CPU's. The current list of supported CPU's in the makefile is:

Adding support for another cpu (if nescesarry) should be trivial.

The following Unix platform's are specificly supported:

The generic unix entry should work for any reasonable standard Unix variant, but lacks sound since there is no single Unix sound standard.

On all platforms zlib is now needed since the core uses it, if you don't have zlib use the included one by uncommenting the appropriate line in Makefile.

The following display methods are supported, X11 is the only one which works on all platforms, except for OpenStep which only work with Openstep bitmaps:

The following is a list of arch/os/display combinations, with maintainers, for arch/os/display combinations which are activly supported. Please mail the maintainer of the arch/os/display combination for compilation and other arch/os/display specific problems. Mail Hans hans@highrise.nl for generic (e.g. x11) problems.

* These are supported using the generic unix entry of the makefile, and thus lack sound.

We are always looking for people willing to test and answer questions about xmame on a new arch/os/display. This takes very little work and could help other people tremendously. If you're interested mail Hans hans@highrise.nl.

3.6 My system is supported but xmame/xmess give me errors and fails. Why?

Xmame/xmess should run on 8bpp Pseudo Color displays and on 16, 24 and 32bpp True Color displays. If your X-Server does not support any of these display types, xmame/xmess will not run.

You can verify your X-Server support by starting your X-Server and running the xdpyinfo program. See the xdpyinfo manual page for more information.

3.7 What is the role of the xmamerc/xmessrc file?

A normal xmame/xmess invocation looks like:

    xmame pacman -sound -nojoy -frameskip 2 -heightscale 3 \   
        -widthscale 2

Most of the time, you will want to use the same configuration for each game. Xmame/xmess will read this file for default values for the parameters that you can set. This way the only parameters you need to express on the command line are the ones you want to override.

Another reason for xmamerc/xmessrc is keyboard remapping. Some Unix keyboards are very different than their PC counterparts. To compensate for the changes, xmame/xmess allows you to remap keys that are not available on Unix keyboards to keys that are available.

3.8 What is the syntax of the xmamerc/xmessrc file.

The syntax is quite simple:

   "keyword value"

See xmamerc.dist for most keywords. Allmost all commandline options can be used as keywords (without the -), use value 0 or 1 for commandline options which have a negating (-no[option]) counterpart. As usual lines begining with "#" are comments.

You can also generate a configfile with all the current settings to use as a template by typing:

   xmame -showconfig > ~/.xmame/xmamerc

3.9 Where do roms, images, samples, highscores, configfiles, etc go?

Roms/Samples

Xmame/xmess uses a ":" seperated rompath to find out which dirs to search for roms/samples.

The default rompath is XMAMEROOT as defined in Makefile during compile.

This is overwritten by any rompath in xmamerc/xmessrc. Which can be overwritten again with the -rompath commandline option.

Xmame/xmess searches every dir in this path for roms/samples in the following way:

    <dir>/gamename.zip             (containing filename.ext)
    <dir>/gamename/filename.ext
    <dir>/gamename/filename.ext.gz (containing filename.ext)
    <dir>/gamename/filename.zip    (containing filename.ext)

So lets say that we are searching for rom0001.1 which is part of pacman then xmame/xmess would search every dir in your rompath for:

    <dir>/pacman.zip               (containing rom0001.1)
    <dir>/pacman/rom0001.1
    <dir>/pacman/rom0001.1.gz      (containing rom0001.1)
    <dir>/pacman/rom0001.zip       (containing rom0001.1)

Note: If your neogeo games can't find neogeo.rom put it in a dir called neogeo somewhere in your rompath, or put it in neogeo.zip somewhere in your rompath.

Read/write Diskette Images

This section only applies to xmess emulations which support read/write diskette images and thus try to open the image read/write.

Xmess first searches for read/write images with the name specified on the commandline:

    <path>/image.ext

Where path is the path specified with the image on the commandline, this way absoulte and relative filenames can be used directly on the commandline for an image which is not in the rompath.

Then xmess searches every dir in the rompath for roms/samples in the following way:

    <dir>/image.ext

Note that (g)zipped images are not supported for r/w images.

Rom Cartridges/Read Only Diskette Images

Xmess begins by searching for cartdriges/disks from the current dir in the following way:

    <path>/image.ext
    <path>/image.ext.gz            (containing image.ext)
    <path>/image.zip               (containing image.ext)

Where path is the path specified with the image on the commandline, this way absoulte and relative filenames can be used directly on the commandline for an image which is not in the rompath.

Then xmess searches every dir in the rompath for carts/images in the following way:

    <dir>/image.ext
    <dir>/image.ext.gz             (containing image.ext)
    <dir>/image.zip                (containing image.ext)

Finally xmess searches the rompath as desribed above using the systemtype for gamename.

So letts say we want to play mario.nes on the nes emulation of xmess. We would then type: "xmess nes mario.nes". Xmess then begins by searching the current dir for:

    mario.nes
    mario.nes.gz                   (containing mario.nes)
    mario.zip                      (containing mario.nes)

After that xmess searches each dir in your rompath for:

    <dir>/mario.nes
    <dir>/mario.nes.gz             (containing mario.nes)
    <dir>/mario.zip                (containing mario.nes)

And finally xmess searches each dir in your rompath for:

    <dir>/nes.zip                  (containing mario.nes)
    <dir>/nes/mario.nes
    <dir>/nes/mario.nes.gz         (containing mario.nes)
    <dir>/nes/mario.zip            (containing mario.nes)

Since xmess first searches for cartridges/disks from the current dir you can also specify cartridges/disks not in your rompath for example:

    "xmess nes ../mario.nes"

Xmess then searches for:

    ../mario.nes
    ../mario.nes.gz                (containing mario.nes)
    ../mario.zip                   (containing mario.nes)

And will also search the rompath as described above with ../mario.nes as image name but this is not that usefull.

Artwork

Xmame/xmess searches every dir in the rompath for artwork in the following way:

    <dir>/artwork.png
    <dir>/artwork.png.gz           (containing artwork.png)
    <dir>/artwork.zip              (containing artwork.png)

Then xmame/xmess searches the rompath as in roms/samples.

So lets say we want to play foo which uses bar.png. Xmame/xmess then begins searching each dir in your rompath for:

    <dir>/bar.png
    <dir>/bar.png.gz               (containing bar.png)
    <dir>/bar.zip                  (containing bar.png)

And then xmame/xmess searches each dir in your rompath for:

    <dir>/foo.zip                  (containing bar.png)
    <dir>/foo/bar.png
    <dir>/foo/bar.png.gz           (containing bar.png)
    <dir>/foo/bar.zip              (containing bar.png)

Xmame configuration

Xmame looks for the following configuration files and parses each one found, later parsed files can overwrite options in previously parsed files:

    XMAMEROOT/xmamerc
    XMAMEROOT/xmame-DISPLAY_METHODrc
    ${HOME}/.xmame/xmamerc
    ${HOME}/.xmame/xmame-DISPLAY_METHODrc
    ${HOME}/.xmame/rc/<gamename>rc

XMAMEROOT is defined during compile time, see Makefile.

DISPLAY_METHOD is the DISPLAY_METHOD for which xmame was compiled, this can be one of: x11, svgalib, ggi, xgl, xfx, svgafx, openstep, SDL.

For xmess of course replace xmame by xmess ;)

Game configuration

Game configuration files are kept on a per user base in:

    ${HOME}/.xmame/cfg/<game>.cfg resp
    ${HOME}/.xmess/cfg/<game>.cfg

Game state

Game state files are kept on a per user base in:

    ${HOME}/.xmame/sta/<game>.sta resp
    ${HOME}/.xmess/sta/<game>.sta

NVram

NVram files are kept on a per user base in:

    ${HOME}/.xmame/nvram/<game>.nv resp
    ${HOME}/.xmess/nvram/<game>.nv

Mem cards

Mem cards files are kept on a per user base in:

    ${HOME}/.xmame/mem/<filename>.mem resp
    ${HOME}/.xmess/mem/<filename>.mem

Where <filename> is given by the game-driver.

Screenshots

Screenshots which can be made pry pressing F12 are saved as png files in the directory from where xmame is started (cwd).

This can be overidden by the screenshotdir entry in xmamerc/xmessrc. Which can again be overidden by the -screenshotdir cmdline-option.

They are saved as:

    <screenshotdir>/<game>xxxx.png
    Where xxxx is a number.

Highscore's

Hi-scores are stored in XMAMEROOT as defined in Makefile when building. This can be overidden by the spooldir entry in xmamerc/xmessrc. Which can again be overidden by the -spooldir cmdline-option.

So only give a

    drwxrwsr-x root games <spooldir>

permission and setgid xmame/xmess to "games" to get it to work. Note this doesn't work with suid root versions (svgalib & XF86-DGA), suggestions welcome.

For know use ${HOME}/.xmame or $ {HOME}/.xmess as spooldir in xmamerc/xmessrc for suid root versions.

Note for highscores to work, xmame must also be able to find hiscore.dat

hiscore.dat

If you want to use highscores mame needs to load hiscore.dat to get highscore info.

The default is XMAMEROOThiscore.dat/. XMAMEROOT is set during compile-time, see the Makefile. This can be overriden by the hiscorefile entry in xmamerc if present, which can again be overiden by the cmdline-option -hiscorefile.

hiscore.dat is available from the mame webpage: http://www.mame.net

cheat.dat

If you want to use cheats mame needs to load cheat.dat to get cheat info.

The default is XMAMEROOT/cheat.dat . XMAMEROOT is set during compile-time, see Makefile. This can be overriden by the cheatfile entry in xmamerc if present, which can again be overiden by the cmdline-option -cheatfile.

cheat.dat is available from the mame webpage: http://www.mame.net

history.dat

If you want to display some nice background info on games mame needs to load history.dat.

The default is XMAMEROOT/history.dat . XMAMEROOT is set during compile-time, see Makefile. This can be overriden by the historyfile entry in xmamerc if present, which can again be overiden by the cmdline-option -historyfile.

history.dat is available from the mame webpage: http://www.mame.net

Input logs

Input logs are saved / read under the name specified after the -record / -playback option, this name is relative to the current path.

Xmame/xmess still can't find file's / store highscore's

Type "xmame/xmess -showconfig | more" and check that the rompath and spooldir showed are correct and readable/writable. Otherwise recheck xmamerc/xmessrc. Remember that xmess also searches the current dir.

3.10 How do I start xmess/xmame ?

To start xmame type:

    xmame [options] <gamename> [more options]

For xmess type:

    xmess [options] <systemname> [more options] \
    <disk/romimage(s)> [more options]

All options are optional ;)

Xmame/xmess supports most dos commandline-options (see readme.mame / readme.mess) as well as a few of its own, type xmame -help | more for a complete list.

With xmess some systems don't require a disk/romimage, but most do.

3.11 What are the command line parameters for xmame/xmess?

To see a list of available parameters, type:

    /usr/games/xmame -help | more

Xmame/xmess supports most of the command line parameters as the DOS version as well a some of its own.

See the file readme.mame / readme.mess for more information about the command line parameters.

3.12 What keys does xmame/xmess use?

Xmame/xmess uses the same key-bindings as the DOS version of mame: The following keys work in all emulators:

    `  or ~      Enter On screen display to change volume, brightness etc.
    Tab          Enter configuration menu. Press Tab or Esc to get back to
                 the emulation.
    P            Pause
    F3           Reset
    F4           Show the game graphics. Use cursor keys to change set/color,
                 F4 or Esc to return to the emulation.
    F8           Reduce frame skip
    F9           Increase frameskip
    F10          Toggle speed throttling
    F10 + shift  Toggle idle sleeping
    F11          Toggle speed display
    F11 + shift  Toggle profiler display
    F12          Save a screen snapshot.
    ESC          Exit emulator

Xmame has 2 different auto frameskipping algorithms, these can be selected with the -frameskipper option. And with key combis:

    Key combi:             Gives you the:
    left-ctrl + insert     standard dos frameskipper
    left-ctrl + home       William Barath's frameskipper

Xmames display scaling can be controlled on the fly with the following key combis:

    Key combi:             Result:
    left-shift + insert    Increase widthscale
    left-shift + delete    Decrease widthscale
    left-shift + home      Increase heightscale
    left-shift + end       Decrease heightscale
    left-shift + pageup    Increase scale
    left-shift + pagedown  Decrease scale

Under X11 xmame can switch to and from different modes runtime:

    Key combi:             Warps you to:
    left-alt + insert      Normal window
    left-alt + home        DGA fullscreen mode

Under X11 in a window you can also grab the mouse to be able to play with the mouse, press left-alt + page-down to grab the mouse, press it again to release it.

3.13 Why doesn't a game have sound?

3.14 My sound seems lagged? / My sound Clicks? / What does -bufsize do?

With the -bufsize commandline option / the bufsize configfile keyword you can specify the number of frames of audio to buffer. The default is 2 frames.

This value should be ok for everyone, but if you still have problems read on.

If the buffersize is to small, this causes the buffer to get empty between frames which in turn causes clicks/pauses in the sound. If this is the case highering the -bufsize value to for example 2.5 should help.

If however you make the buffersize to large, then so much audio becomes buffered, that the sound could become lagged. E.g. you would here the coin drop sound 0.5 seconds after pressing the insert coin key. In this case lower the bufsize to for example 1.5 .

Please lett me know if you need to change this setting, since I'm planning on removing it in a future release.

3.15 Why doesn't a game work?

3.16 What are PROMs?

PROMs contain game specific information that used to be built in to mame in versions prior to 0.34. This information has been extracted and is now included with new versions of ROM files for games that require this information.

If you want to use your current ROM files, you can obtain just the PROM images in one large file at:

http://mame.retrogames.com/

3.17 Why is xmame/xmess slow?

xmame/xmess is a compiled C program that is emulating hardware. Software emulation of hardware always pays a speed penalty. Here are some things you can do:

You can also try recompiling xmame/xmess with more optimal settings, the following suggestions may not work or may not be appropriate on some machines and in some installations. However, in cases where they do work, there can be a noticeable increase in overall performance of xmame/xmess.

These "enhancements" simply require editing the Makefile that is distributed with xMame, and then recompiling the source. If you are compiling the source for the second time you will need to do:

    make clean
    make
    make install

after editing the Makefile to set your new settings.

SPEEDUP # 1 - Inline compiling

Try enabling inline compiling by commenting and uncommenting the following lines:

    # IL    = '-DINLINE=static inline'
    IL     = -DINLINE=static

SPEEDUP # 2 - Direct Graphics Access

For a big boost try enabling DGA by uncommenting the following line:

    DGA = 1

Then start xmame as root, and press left-alt + home to switch to dga mode, that should be a lot faster, and doesn't need / use xsync ;)

To get back to a window without exiting press left-alt + insert.

The benefit of DGA is that it is Direct Graphics Access and as such writes directly to the framebuffer (Think directx versus GDI under windows). So it should be a tad faster, unless you've got a really really well accelerated X-server, which could be just as fast. Try pressing F11 to see the actual framerate, although it might be hardly noticable (visually atleast), it should give you some speed increase.

Besides that it automaticly switches to the right mode and removes any window manager stuff, but that can be done without DGA too (I might at such a feature later, sine it allows easy fullscreen without running as root).

And adding a 320x240 mode will most definatly get you a very nice fullscreen display at scale = 1 ;)

Don't forget that you need still need to set up the Modes line of the "Display" subsection of the "Screen" section of your X config file if you want the games to fill the screen in DGA mode. Xmame will pick the best mode it can find, so if you have a line like:

    Modes  "1024x768" "800x600" "640x480" "320x240" "256x224"

then any game which fits into a 320x240 screen can be displayed in that resolution, and so on. Don't forget you X11 config file might have a number of different "Screen" sections in it, and you will need to add Modes to the one that is actually active with your Xserver is running. And of course it's not always that easy, since you also need to tell X what monitor settings are required for these resolution modes. This is done through Modeline entries in the "Monitor" section of your X config file.

You can check out the /contrib/tools/modelines file for a set of crazy modes made especially for xmame in DGA mode, they should work on any reasonable multisync, but don't use them on an old fixed-frequency (well if you can't resist trying I won't pay for a new one)

SPEEDUP # 3 - NASM

You can also try installing nasm and compiling the asm core, that helps a bit too.

3.18 I've got a dual processor machine. What can I do to take full advantage of this?

Not much. Xmame is a single-threaded port of a single-threaded DOS app. Some degree of speedup will hopefully be found on an SMP since xmame is more likely to get to hog its one CPU for longer. But of course the same applies to any CPU-intensive program. And all the things one would normally do to any application to give it more CPU time (higher priority, kill or renice unecessary process, etc.) will work with xmame.

Now you may at this point be thinking "Surely you could have one thread doing emulation and another thead doing graphics to get a speedup." Yes, but there are some serious issues to consider. The first is synchronisation between the threads, which needs to be pretty tight. If not done smoothly the overhead will blow most of the benefit away. Also it needs to be implemented with a portable threads interface ... which basically means POSIX threads. In a nutshell its a lot of effort and probably not much gain. But of course if you are feeling particulary energetic and in the mood to code then patches can always be submitted to the xmame devel mailing list ... :)

3.19 Why doesn't my joystick handle diagonal movement correctly on my Intel x86 system?

Xmame/xmess uses autocalibrating but you could try to use specific programs to calibrate it ( jscal that comes with joystick module works fine.... )

3.20 How do I enable XinputExtensions X11 based joystick in Xfree86?

You need to edit XF86Config to enable the XInput section. See the manual page for XF86Config.

3.21 How do I read a manual page?

Easy. If you want to read the manual page for XF86Config, type: man XF86Config

3.22 Why do I get gz_open symbol not found while compiling?

Xmame/xmess versions newer then 0.35 use zlib for some compression routines. Unfortunatly a lott of Linux distributions have an old version of zlib installed as /usr/X11R6/lib/libz.a And the new version installed as /usr/lib/libz.a. If this is the case its harmless to remove /usr/X11R6/lib/libz.a. If your not sure wether this is the case just move /usr/X11R6/lib/libz.a to another location.

Removing or just moving /usr/X11R6/lib/libz.a should fix this problem.

Also see: FAQ: Why do I get zlib.h not found?

3.23 Why do I get zlib.h not found?

Xmame/xmess versions newer then 0.35 use zlib for some compression routines.

Zlib is standard on most Unix versions, for those who don't ship with zlib or ship with a too old version xmame/xmess now comes with a stripped down version of zlib. Uncomment the appropriate line in the Makefile to use this.

3.24 Where can I get the latest version of xmame/xmess?

The xmame/xmess Home Page always has the most up to date version. The address is:

http://x.mame.net/

3.25 Where can I send fixes, bug reports, suggestions, or money? :-)

See Mail of this document.

3.26 What if my question is still not answered?

Please check the offical mame and mess readme files to see if that answers your question:

If that doesn't help then ask your question on the mailinglist or send it to the xmame/xmess maintainer, see Mail for contact information.


Next Previous Contents