XMAME/XMESS DOCUMENTATION
Prev |  | Next

# Compiling, Setting Up and Starting Xmame/Xmess

Note: This section is not a Unix tutorial. You need to know some basic Unix commands to compile and install xmame/xmess.

## Requirements

- GNU make is MANDATORY in ALL Systems, even if you use a different compiler.

- On all platforms zlib is now needed since the core uses it. If you don't have zlib, a stripped version is included with xmame. See: FAQ: Why do I get gz_open symbol not while compiling? and FAQ: Why do I get zlib.h not found?

- You are encouraged to use a GNU development environment: gcc, gmake, GNU ar. Lots of problems are found due to the very permissive syntax in gcc, so if you use a strictly ANSI C compiler, you'll get lots of warnings, and if the version of xmame/xmess is not fully debugged, compilation errors.

- Xmame compilation breaks when using egcs-1.1.x or gcc-2.95, use -fno-strict-aliasing to fix it. gcc-2.95.1 does work with -fstrict-aliasing, and gives a nice speed increase.

- Xmame compilation also breaks when using Red Hat 7's latest (as of 16 January 2001) update for gcc. If you experience problems, please either downgrade your compiler to the one included on the Red Hat 7 CD-ROM, or try replacing “gcc” in the Makefile with “kgcc”, which will invoke egcs-1.1.2. (But please see above about the -fstrict-aliasing flag.)

## Follow these steps to compile xmame/xmess

1. See Compile Notes for Specific Operating Systems for platform specific compiling information.

2. See Display subsystem specific comments and notes for special display methods information.

3. Download the xmame/xmess source files archive.

4. Move the xmame/xmess source files archive to a suitable work directory. When you extract the archive, sub directories will be created under the work directory.

5. Use bzcat and tar to decompress the archive. For example:

       bzcat xmame-0.81.1.tar.bz2 | tar xv

   There are other ways to extract the archive, such as the great “atool” script.

6. After extracting the archive, cd (and X driver) is capable of doing so. You can achieve a very nice full-screen display without taxing your cpu very much because the scaling will all be done by your video card.

   To determine if your video card supports the Xv extension, you may use this command:

       xvinfo

   If you don't see a message indicating “no screens found”, then the Xv extension is supported by your machine.

   To compile this into xmame, select “DISPLAY_METHOD = x11” and uncomment the line “X11_XV = 1” in the makefile.

   Build xmame, and use the -fullscreen parameter when loading a game to get a nice full-screen display.

   If the colors seem messed up and/or you only see half of the game image, try using “-yuv” or “-yv12”. By default, the Xv extension attempts to use RGB mode if your driver supports it, but some cards' drivers are broken.

   If your screen goes blank or gets full of little green vertical lines, then your graphics card does not support the Xv extension and you're out of luck.

   ### xmame.x11/OpenGL

   To use OpenGL, you must have:

   - An OpenGL implementation

   - libjpeg

   - hardware 3D acceleration (if you want any kind of decent frame rate)

   Select “DISPLAY_METHOD = x11” and uncomment the line “X11_OPENGL = 1" in the makefile. Follow the general instructions for installing xmame. There are some additional makefile options:

   - For runtimerun-time printed debug info, add “-DGLDEBUG” to the “GLCFLAGS" variable.

   - GLU version 1.2 is recommended (e.g., from SGI). If you use Mesa's GLU, you may have to add “-DGLU_VERSION_1_2” to the “GLCFLAGS”.

   The OpenGL driver also adds several command-line options:

           -[no]gldblbuffer        Enable/disable double buffering
                                   (default: enabled)
           -gltexture_size <int>   Force the max width and height of one
                                   texture segment (default: autosize)
           -[no]glbilinear /       Enable/disable bilinear filtering
           -[no]glbilin            (default: enabled)

           -glbeam <float>         Set the beam size for vector games
                                   (default: 1.0)
           -[no]glantialias /      Enable/disable antialiasing
           -[no]glaa               (default: disabled)
           -[no]glantialiasvec /   Enable/disable vector antialiasing
           -[no]glaav              (default: disabled)
           -[no]cabview            Start/don't start in cabinet view mode
                                   (default: don't start in this mode)
           -cabinet <cabname>      Specify which cabinet model to use
                                   (default: glmamejau)

   Three cabinet models are provided. The default, "glmamejau", is designed to look like a standard arcade cabinet, like "glmame". The last one, "trans", is a box with a transparent game screen.

   Note that in order to display the game options or the fps display in vector games, the game's bitmap is overlaid above the vector display. Drawing the bitmap is a big CPU hog for some low-end hardware accelerated OpenGL implementations, so you'll notice that the game slows down when the bitmap is overlaid.

   Because bitmap overlaying is the default, you can toggle it on and off by pressing the "RIGHT_ALT-O" key, or turn it off at startup time by using the command line option "-noglbitmap".

   A problem with vector games and the cabinet mode is that some vector points do not reside within the screen coordinates, so you may see some vectors outside of the cabinet's MAME display.

   *** IMPORTANT! ***

   If you have trouble with GLmame, or it is slow, read the "Common Questions" section. Most of the questions people email me are answered here.

   #### Cabinet Models

   Cabinet model information is stored in the "cab" subdirectory of the directory you specified with the ROMPATH variable in the Makefile. Path information specified in xmamerc or with the 'rompath' shell environment variable is currently not used. Each cabinet model has it's own subdirectory. GLmame will first try to load either the user-specified cabinet model (using the -cabinet command-line option), or a model corresponding to the current game name. Failing that, it will use the generic "glmame" model.

   A cabinet model directory must contain a geometry file <modelname>.cab, and any .jpg files used for textures on the model. The format of the .cab file will be familiar if you have ever programmed using OpenGL -- it looks much like an OpenGL display list. The format is as follows:

           cabv1.1

   This header must be the first 7 characters of the file.

           #<text>

   Comment lines begin with '#'

           begin <type>

   Begins a geometry object, where type is one of (points, polygon, quads, quad_strip, screen). Each "begin" must be paired with an "end" statement. A "polygon" is specified using one vertex per, well... vertex. "quads" are four-sided polygons, each specified by four vertices in order around the polygon. A "quad_strip" is a series of four-sided polygons, each of which shares an edge with the polygons before and after it in the strip. A "screen" is a quad that defines the actual area in 3D space where the game will be displayed. only one of these should be defined. For more info, look at any description of OpenGL geometry.

           end

   Ends the geometry object begun with "begin".

           pointsize <s>

   Changes the current pointsize to the corresponding size value (specified as a floating point number between 0.0 and, e.g., 20.0). Note: You cannot use this statement between begin and end!

           color4 <r> <g> <b>

   Changes the current color to the corresponding rgb value (specified as floating point numbers between 0 and 1).

           color4 <r> <g> <b> <a>

   Changes the current color to the corresponding rgba value (specified as floating point numbers between 0 and 1).

           shading <type>

   Sets the shading type. available types are "smooth" (which blends colors from one vertex to the next) or "flat" (which doesn't).

           vertex <x> <y> <z>

   Specifies a vertex for the current geometry object as a point in 3-space.

           numtex <num>

   Specifies the number of different textures to be loaded. This declaration must precede any "loadtex" call.

           loadtex <num> <width> <height> <filename>

   Loads texture number <num> from .jpg file <filename>. The .jpg file *must* be <width> by <height> pixels, and both <width> and <height> must be powers of two (and must conform to the hardware requirements of any 3D card you want the cabinet to work with -- 256x256 for 3Dfx).

           texcoord <xcoord> <ycoord>

   Sets the texture coordinate of the next vertex. This specifies where in 2D texture space the vertex lies.

           enable texture

   Enables texture mapping (using the currently-selected texture).

           disable texture

   Turns off texture mapping.

           settex <num>

   Select texture <num> for doing texturing. The texture must previously have been loaded using "loadtex".

           camerapan <num>

   Starts the camera pan definition that will be followed by <num> camera transistions. After the last transision definition, the pan sequence must be ended with an "end" statement.

           goto <lx> <ly> <lz> <px> <py> <pz> <nx> <ny> <nz>

   Relocates and reorients the camera. The arguments are the same as are used by the OpenGL command "gluLookAt()". The camera is positioned at point <lx,ly,lz>, pointing along vector <px,py,pz>, with "up" normal (the direction that is "up" for the camera) <nx,ny,nz>.

           moveto <lx> <ly> <lz> <px> <py> <pz> <nx> <ny> <nz> <frames>

   Moves the camera to a new location (specified as in "goto"). The transition occurs over <frames> frames.

   All commands must be on separate lines. Use the (somewhat) commented glmamejau cabinet as an example to work from.

   #### Present Limitations/Bugs

   - No clipping of vector games (most noticeable in cabinet mode).

   - No preservation of game aspect ratio in cabinet mode.

   #### Future Work

   - Fixing existing bugs .. are there any ? Or are there some unknown features only ;-) ?

   - Optimize the drawing code to update only the changed portions of the game bitmap. Optimizing the dirty code ..

   #### License

   The GLmame code is based upon Mike Oliphant's GLmame code version 0.6.

   The GLMame code is Copyright 1998 by Mike Oliphant. It may be used and distributed under the terms of the MAME license.

   Since GLmame version 0.7, the code has been changed and improved heavily by Sven Goethel --- no license change, of course!

   #### Version History

   v0.83 -- March 29th, 2001 ---------------------------

   - Changed the code heavily to improve compatibility and speed. The new code is a re-merge of the GLMame32 code, which is a branch of Mike Oliphant's GLmame code version 0.6.

   - For a detailed list, please consult the file changes.opengl within the distribution's documentation directory! You can also view the current changes.opengl here: http://www.jausoft.com/glmame.html

   v0.6 -- December 14th, 1998 ---------------------------

   - added support for systems that do not support paletted textures (SGI and Solaris OpenGL implementations, for example)

   - merged source with xmame b8.1

   v0.5 -- October 30th, 1998 --------------------------

   - fixed a bug with texturing being left on in bad places

   - added 3Dfx gamma adjustment

   v0.4 -- October 21st, 1998 --------------------------

   - updated to work with xmame v0.34b5.2

   v0.3 -- October 12th, 1998 --------------------------

   - fixed vertical screen centering in full-screen mode

   - moved cabinet and camera panning information into a user-editable configuration file

   - added 'trans' cabinet model o added double buffer, view type, and cabinet selection command-line options

   v0.2 -- October 6th, 1998 -------------------------

   - adding missing 'cab' directory

   v0.1 -- October 5th, 1998 -------------------------

   - first public release

   #### Authors

   Since GLmame version 0.7: Sven Goethel (sgoethel@jausoft.com) http://www.jausoft.com/glmame.html

   Till GLmame version 0.6: Mike Oliphant (oliphant@ling.ed.ac.uk) http://glmame.linuxgames.com

   FXmame, a glide driver for xmame

   The latest version of this driver can be obtained at http://glmame.linuxgames.com.

   ### xmame.x11/GLIDE

   To run with 3Dfx support, you must have:

   - A 3Dfx card

   - Glide 2x or 3

   - The xmame distribution

   Select “DISPLAY_METHOD = x11” and uncomment the line “X11_GLIDE = 1" in the makefile. For Glide 2x support, also uncomment “GLIDE2 = 1”.

   The Glide driver adds several command-line options:

           -fxgama <value> 3Dfx gamma correction value

   #### Common Questions (FAQ)

   Q: When I run with Glide support, it just dumps core.

   A: Make sure you are running xmame as root. Root privileges are required to access the 3Dfx hardware

   Q: When I run with Glide support, it just hangs at the initial game screen.

   A: Are you running KDE? For some reason, I can't get keyboard input under KDE. If you have this problem, switch window managers or use xmame.svgafx instead.

   #### Present Limitations/Bugs

   - Antialiasing isn't working quite as well as it should

   - Input problems under KDE

   #### Future Work

   - Optimize the drawing code to update only the changed portions of the game bitmap.

   #### License

   The FXmame code is Copyright 1998 by Mike Oliphant. It may be used and distributed under the terms of the MAME license.

   #### Version History

   v0.5 -- December 11th, 1998 ---------------------------

   - implemented long copies in screen update

   - added dirty handling. this greatly increases the speed of games that support the dirty update strategy (although most of them are older games that already ran at full speed on modern hardware)

   - merged source with xmame b8.1

   v0.4 -- October 30th, 1998 --------------------------

   - improved alpha handling in vector games - now bitmapped overlays do not dim the screen o added svgalib support (xmame.svgafx) o fixed a tiling bug that gave artifacts on texture tile boundaries

   v0.3 -- October 29th, 1998 --------------------------

   - got rid of extra lines in vector games o added bitmap overlay in vector games to show options/fps o added antialiasing in vector games

   v0.2 -- October 28th, 1998 --------------------------

   - added screenshots o added 3Dfx gamma adjustment o added direct acceleration of vector games (still buggy)

   v0.1 -- October 27th, 1998 --------------------------

   - first public release

   ### Authors

   Since fall of 2004: Hans de Goede

   Original author: Mike Oliphant (oliphant@ling.ed.ac.uk) http://glmame.linuxgames.com

   ### xmame.SDL

   The SDL library was meant to make it easy for programmers to make full-screen applications. To start SDL in full-screen mode, just run xmame.SDL with the option '-fullscreen'. If you want to know the resolutions that SDL can use, run “xmame.SDL -listmodes”, choose the resolution you want, and start ”xmame.SDL -modenumber <insert chosen number here>”.

   You can add “fullscreen 1” to your xmamerc file if you want SDL to start full-screen automatically; the modenumber line can also be used in the xmamerc.

   Most problems experienced by people who are trying to use SDL for full-screen are related to the section fullscreen has a large border

   During play you can switch between windowed and fullscreen mode. See What keys does xmame/xmess use?

## I am only getting a few frames-per-second in xmame.x11/OpenGL. This sucks! What gives?

- You're probably running Mesa in software mode. You should read the "README.3Dfx" file in the Mesa distro. Specifically, you need to "setenv MESA_GLX_FX fullscreen".

- You don't have a 3D graphics card. Go buy one (see below)!

## When I run xmame.x11/OpenGL, it just dumps core. That's not as much fun as 3D Pac-Man, now is it?

- If you are using a 3Dfx card, make sure you are running xmame.x11 as root. Root privileges are required to access the 3Dfx hardware.

- If you're using Mesa and haven't upgraded to v3.0, do so.

## When I run xmame.x11/OpenGL, everything is messed up.

Read the above experiences, and try

- switching your X server's bpp value, e.g., switch from 32bpp or 24bpp to 16bpp;

- the command line option "-bpp 16";

- the command line option "-noglaa".

## xmame.SDL / fullscreen has a large border around the game.

If the game runs in fullscreen but occupies only a small area in the center of the screen, then your xserver does not have access to low resolutions (320x240, 400x300, and 512x384, for instance). In the case of SDL, the window will be in the resolution of closest matching resolution that SDL can switch to for full-screen display.

In this case, you have to add "Modelines" for these resolutions in your XF86config file and add these resolutions to the resolutions list of your display somewhere in your XF86config file (you know, the list of resolutions you can switch to using ctrl-+).

You should find modelines that works with most graphic cards in the xmame contrib subdirectory.

If you don't want to alter your XF86config file, another solution is to run xmame.x11 with the "-scale 2" argument. In this case, the emulator will use 640x480 instead of 320x240, 800x600 instead of 400x300, etc. But I don't recommend it. The scaling uses cpu and the games will run more slowly.

However, if your cpu is fast enough, a better option is to use the effects, e.g., ”-ef 1”. This introduces advanced render methods to create a nicer looking effect than the simple scaling. On the website you can see screenshots of the different effects.

## I only use some of the emulation parts (Neo Geo / CPS-2 /...). Do I need the entire xmame?

There used to be targets such as “cpmame” and “neomame”, but these have been removed from the core.

## Why does xmame freeze and lock up when I hit <ESC> to exit the game or P to pause the game?

There appears to be a bug in the "timer-based audio" code that xmame/oss uses on at least one motherboard that we are aware of. Specifically, the ATX 845Pro (Intel Pentium 4 processor) with an integrated i810 soundchip.

To get around this bug use EsounD (Enlightened Sound Daemon), found as esd with Gnome distributions, instead of the oss sound drivers.

Compile ESOUND support into the xmame executable by uncommenting the appropriate line in makefile.unix. Tell xmame to use esound by specifying "esound" on the "dsp-plugin" line in xmamerc, or use the -dp command line parameter to select esound. Also see the next section below.

## Why does xmame report “can't resolve host name '/dev/dsp'” when trying to use esound?

Remove the words "/dev/dsp" from the "audiodevice" line in xmamerc. In other words, you want to have the word "audiodevice" on a line all by itself, with no audiodevice specified.

## 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/

## I upgraded xmame and now some games do not work anymore.

This can happen, especially if the drivers are in full development or some internal core routines have changed and the drivers have to be updated to accomodate for these core changes. Sometimes a new romdump has been made from the game and you still have the old version, or the zipfile has changed names and you need to rename yours (or any combination of these factors :-).

Here are some things you can do:

1. Clear all the old configuration files, nvram files, etc. Also delete the content of the directories mem, nvram, cfg, and try to run the game again. Don't forget to delete the default.cfg file!

2. If that fails, check to see if the name of the zipfile is still in the list of supported games. If you enter an invalid game name, xmame will take a guess to determine which game you wanted; look at the first lines of output to see if it tries to load a different game than the one you want. To know if your game is still supported, try 'xmame.x11 -list gamename'. If you do not pass a game name, the complete list of supported games is printed, and you can search for the new game name (better use 'xmame.x11 -listfull').

3. If the name hasn't changed, check to see if you have the correct romdump. Run 'xmame.x11 -verifyroms gamename' to check your romset. If this fails you will need to download a newer romdump. Also check your parent roms as a possible cause of this romset failure.

4. Read the documentation!! Or like the experts would say, “RTFM!” :-) Chances are that if the driver is broken, the developer has noted this in the documentation.

5. If the above steps don't solve the problem, then check to see if it is a known problem; if necessary, report it to the MAME Testers project.

If none of these fixes the problem, then try using the older version of xmame you have backed up somewhere to play the game. (You did back-up, didn't you?)

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

See Mail of this document.

## What if my question is still not answered?

Please check the offical MAME and MESS readme files to see if that answers your question:

- The official mame readme file (readme.mame)

- The official mess readme file (readme.mess)

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

Prev | Home | Next
XMAME/XMESS DOCUMENTATION |  | Contact Information and Credits