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

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, chan to do if it doesn't.

    Linux PowerPC

    Linux PowerPC should work from now on. Here's an email from Andreas Varga sid@skater.htu.tuwien.ac.at, the Linux/PowerPC maintainer, describing the necessary steps:

    Required changes to compile xmame 0.34b3.1 on Linux/PowerPC with SVGALIB

    Makefile:

    • enable CFLAGS for linux/ppc

    • enable DISPLAY_METHOD = svgalib

    • enable ARCH = linux

    • remove -lvgagl from LIBS.svgalib in src/unix/unix.mak (only -lvga is required)

    Required changes to compile xmame 0.34b3.1 on Linux/PowerPC with X11

    Makefile:

    • enable CFLAGS for linux/ppc

    • enable DISPLAY_METHOD = x11

    • enable ARCH = linux

    Another thing... sound is not working, because sound drivers support is currently under development in Linux/PPC kernels...there is an old driver that is a hacked Soundblaster driver, and newer 2.1.1xx kernels have a sound drivers based on Amiga DMA sound drivers... Once this issues are settled there should be a full OSS-compatible driver... sound should work then...

    I can't speak about Joystick support...

    The original Linux/PPC target changes in the Makefile were done by me, but there are some other changes required to get it to compile... Starting from October I will have some more time to work on this, and I'll keep you updated...

    Cheers, Andreas

    IRIX

    Use the generic unix arch for those machines that have no sound support installed (xmame/xmess uses the dmedia package or the newer AL package on IRIX systems).

    Silicon Graphics provides several native compilers. xmame/xmess has been compiled and tested with the normal cc. There were some problems with this when using -n32 for new style 32bit code. It does work when using -o32 for oldstyle 32 bit code. It should now also work with -n32 which is much faster.

    The use of DCC is not recommended (anymore) since it's a C++ compiler and thus won't even compile xmame/xmess out of the box due to uncasted mallocs. Changing all these mallocs would be crazy, esp. since they are not only in the osd part, but also in the core which is not under our control. Besides that, MAME is normal C, so please compile it with a normal C compiler.

    Some problems have been reported using the GNU linker. It's recommended that you use the native one.

    HPUX

    Use the generic unix arch. In HP-UX, gcc and gnu-make are MANDATORY.

    ULTRIX

    Use the generic unix arch.

    Notes received from Danny dboxhoor@iso.vilspa.esa.es

    VERY IMPORTANT!!!

    The xmame/xmess CPU emulators access memory through pointers which are sometimes cast to illegal addresses - as far as the MIPS CPU is concerned. The Ultrix operating system is aware of that and fixes this "unaligned data access".

    Depending on your system setup, lots of warnings are generated for certain games. Fortunately these messages can be disabled by executing the command "uac p 0" in the same shell where xmame/xmess will be running.

    UPDATE: The new -DALIGN_INTS switch in the makefile fixes these unaligned accesses in the source which is probably a lot faster than hot fixing them in the kernel segfault handler.

    Use gnu make.

    Compile with the `c89' compiler. Though `gcc' has no problems with compiling and optimizing xmame/xmess, the resulting `c89' executable is faster on an empty machine (read: xmame can use all cpu & memory without competing with other high priority processes), so you can set `frameskip' to 1.

    When compiling with `c89 -O2' don't forget to also use `-Olimit 1000'. If 1000 is not enough, the compiler will tell you to increase it.

    SunOS & Solaris

    There are 2 relevant architecture options available in the makefile:

        ARCH = generic : use this for old SunOs running on Sparcs,
                         but a Sparc running Solaris will usually
                         handle this option too.
        ARCH = solaris : this is the one you should use for Sparcs
                         running Solaris.        
        

    Currently sound is not supported under sunos. The solaris arch does support audio.

    If you are using Sun's OpenWindows implementation of X11, then make sure that the X11INC and X11LIB variables in the X11 Options section of the makefile are set properly. (There are already entries for the standard OpenWin directory there that you can uncomment.)

    Of course, if you are compiling for X11 then you need to set these variables properly, no matter what implementation of X11 you are using! :)

    If you are using Sun's SunPro cc compiler, then the following optimisation flags have been reported to be good:

        OPTFLAGS    = -fast -xO4 -native
        

    Finally, there has been a case of the xmame compilation processes breaking over the "ar" program. Most Solaris installations will include a set of utilities that conform to the XPG4 standard, usually in the "/usr/xpg4/bin" directory. The XPG4 version of "ar" should be avoided like the plague. Ensure that the "/usr/ccs/bin" appears in your path before the "/usr/xpg4/bin" directory and everything should go smoothly.

    PLEASE NOTE : There is currently not much support for SunOS/Solaris. If you have any trouble, try to fix it yourself. If you succeed, send a message to the mailing list detailing what you did. If you don't succeed, send a message anyway and someone _may_ be able to help you. Either way, this is the only way that problems with xmame on SunOS/Solaris will get fixed.

    Openstep

    You must use the OpenStep gnumake, not make. You must also use the NeXT/Apple cc rather than gcc. Also use only the optimisation options as recommended for OpenStep in the makefile, others will cause the resulting executable to crash. The OpenStep assembler on i386 architectures is incompatible with the MAME assembler CPU cores and thus you must use the C versions (Use i386-noasm instead of i386 when compiling for i386).

    The supplied complier is based on gcc 2.7.2.1 which will not compile src/profiler.c without crashing. To get around this you must turn off + optimisation when this crash occurs, re-make to compile this file only, then stop the make, re-enable optimisation, and continue.

    On an OpenStep keyboard the functions keys do not all operate as expected. Using the command key in conjuction with a number key generates the equivalent function key within xmame, with 0, - and = + representing F10, F11 and F12 resepectively. Also note that the ALT + keys cannot be mapped. As most games tend to use this as the default fire button it is exteremly useful to remap this globally the first time you run xmame.