XMAME 0.66.2



TEST SYSTEM OVERVIEWS


Two old Linux systems are used for testing xmame.

System #1 Primary xmame testing

  • AMD K6-2 CPU @ 500 MHz
  • es1371 Ensonique sound card (supported in kernel)
  • VIA chipset
  • Clunky ol' Voodoo 3 card.

    System #2 Slightly better CPU for enjoying xmame

  • AMD K6-3+ CPU @ 450 MHz
  • es1371 Ensonique sound card (supported in kernel)
  • ALi Aladdin 7 chipset with dual-channel SDRAM
  • Integrated ArtX graphics, but used with fbdev in 32bpp.

    Software
    Both systems began as vanilla RedHat 6.2 boxes, but packages have been heavily recompiled for speed and updated with latest security enhancements. Highlights as follows.

  • 2.2.x kernel
  • glibc 2.1.3
  • egcs-1.1.2, aka gcc 2.91.66
  • XFree86 3.3.6

    No lectures on obsolescence, please. I know full-well the evils of old-school XFree et. al. Newer systems will be forthcoming on this list soon enough. K6-3+ is a great overclocker, but it won't cut the mustard for kinst. :)

    xmame Compile Options

  • No SDL support.
  • No svgalib support.
  • Just plain x11 support with MIT shared memory extensions.
  • No Xv support. Does not exist in XFree86 3.3.6 and will cause compile to die if left uncommented from makefile.unix
  • Voodoo 3 has accelerated X support, but fbdev is set to 32bpp on the other machine.
  • No ALSA support, or any other sound driver except default oss.
  • Compile succeeds with the following flags
    CFLAGS = -O2 -Wall -Wno-unused -march=i586 -pipe -fomit-frame-pointer -fstrict-aliasing -fstrength-reduce -ffast-math
    
    OR
    CFLAGS = -O3 -pipe -mcpu=pentium -march=pentium -Wall -Wno-unused -funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math -malign-functions=2 -malign-jumps=2 -malign-loops=2
    

    PROBLEM #1

    xneomame does not compile!

    EXPLANATION

    neomame/cpmame/tinymame cannot build by default. Mostly a makefile issue, but also requires fixes to fm.c. 3 files affected. The fixes below detail workarounds for compiling neomame, but cpmame and tinymame no doubt need similar repairs.

    FILES AFFECTED

    The following files need fixes.

  • src/unix/unix.mak
  • src/sound/fm.c
  • src/neomame.mak

    FIXES

    Below are the details of how to fix all 3 files.

    neomame.mak

    The following target needs to be added at the bottom of neomame.mak or else kof99_neogeo_gfx_decrypt and kof2000_neogeo_gfx_decrypt will not be defined.

    $(OBJ)/machine/neocrypt.o
    

    Here's the patch:

    --- xmame-0.66.2/src/neomame.mak    Mon Mar 17 21:36:59 2003
    +++ xmame-0.66.2.new/src/neomame.mak     Wed Apr  2 10:29:16 2003
    @@ -18,7 +18,7 @@
     DRVLIBS = $(OBJ)/neogeo.a
     
     $(OBJ)/neogeo.a: \
    -       $(OBJ)/machine/neogeo.o $(OBJ)/machine/pd4990a.o $(OBJ)/vidhrdw/neogeo.o $(OBJ)/drivers/neogeo.o \
    +       $(OBJ)/machine/neogeo.o $(OBJ)/machine/neocrypt.o $(OBJ)/machine/pd4990a.o $(OBJ)/vidhrdw/neogeo.o $(OBJ)/drivers/neogeo.o \
     
     # MAME specific core objs
     COREOBJS += $(OBJ)/driver.o $(OBJ)/cheat.o
    
    

    fm.c

    LFOCnt and LFOIncr are used several times throughout, but they are also in a place they shouldn't be. This fix for fm.c was already documented on tbble.com/kof2000n. The patch on that site, however, does not match xmame 0.66.2. The first line of the fix should now be #3612. In particular, the following lines must be deleted as per this new patch.

    --- xmame-0.66.2/src/sound/fm.c	Tue Mar 18 20:20:38 2003
    +++ xmame-0.66.2.new/src/sound/fm.c	Wed Apr  2 10:02:08 2003
    @@ -3609,9 +3609,6 @@
     		pcmbufA  = F2610->pcmbuf;
     		pcmsizeA = F2610->pcm_size;
     
    -		LFOCnt  = OPN->LFOCnt;
    -		LFOIncr = OPN->LFOIncr;
    -		if( !LFOIncr ) lfo_amd = lfo_pmd = 0;
     	}
     #ifdef YM2610B_WARNING
     #define FM_KEY_IS(SLOT) ((SLOT)->key)
    @@ -3640,13 +3637,6 @@
     	/* buffering */
     	for(i=0; i < length ; i++)
     	{
    -		/* LFO */
    -		if( LFOIncr )
    -		{
    -			lfo_amd = OPN_LFO_wave[(LFOCnt+=LFOIncr)>>LFO_SH];
    -			lfo_pmd = lfo_amd-(LFO_RATE/2);
    -		}
    -
     		/* clear output acc. */
     		out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0;
     		out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0;
    @@ -3726,8 +3716,6 @@
     		INTERNAL_TIMER_A( State , cch[1] )
     	}
     	INTERNAL_TIMER_B(State,length)
    -
    -	OPN->LFOCnt = LFOCnt;
     }
     
     #if BUILD_YM2610B
    

    unix.mak

    There is no flow to define compilation targets for neomame, cpmame, or tinymame.

    For neomame the quick hack is to replace src/mame.mak with src/neomame.mak in the ifeq ($(TARGET), mess) conditional. Wouldn't life be so much cleaner if gnu make supported "elsif" or "case" conditionals? (Side note: This was suggested in 1998.) Anyway, here's a simple patch to get away with the same thing. Seems to work on my version of gnu make anyway! =)

    --- xmame-0.66.2/src/unix/unix.mak  Mon Mar 17 21:36:59 2003
    +++ xmame-0.66.2.new/src/unix/unix.mak   Mon Apr  7 00:55:59 2003
    @@ -154,7 +154,7 @@
     ifeq ($(TARGET), mess)
     include mess/mess.mak
     else
    -include src/mame.mak
    +include src/$(TARGET).mak
     endif
     
     include src/rules.mak
    

    PROBLEM #2

    xmame has broken sound on Yamaha chips!

    EXPLANATION

    Sound is messed up for many, many games with Yamaha chips. Is this another problem with fm.c? This problem does not exist for xmame 0.55 and 0.36b!

    The following files need fixes.

  • growl (Taito F2 board) -- no sound anymore.
  • xmen (konami board) -- only a few tones and noises
  • neogeo games -- PCM sound effects, but no music!
  • altbeast -- PCM sound effects, but no music!
  • sf2 -- Whacked volumes and some channels play at different rates than others

    I only compile with the default oss sound support. No SDL, ALSA, etc.

    This problem still happens without any of the patches on this site, so my patches are not the cause of this problem!!!

    FIXES

    Don't use gcc 2.91.66! gcc 2.95.3 and above should be fine.


    PROBLEM #3

    xmame does not open a window when using XFree86 3.3.6 fbdev in 32-bpp!

    X11: Error: Couldn't find a suitable visual
    Unable to start video emulation
    

    EXPLANATION

    x11_window.c will not open a window unless the depth is 24, 16, 15, or 8-bit. Setting fbdev to 32-bit will return -1 instead of 0 and cause xmame to die.

    FILES AFFECTED

    The following files need fixes.

  • src/unix/video-drivers/x11_window.c

    FIXES

    Below are the details of how to fix x11_window.c. We just need to add 32-bit depth support.

    x11_window.c

    --- xmame-0.66.2/src/unix/video-drivers/x11_window.c       Mon Mar 17 21:36:59 2003
    +++ xmame-0.66.2.new/src/unix/video-drivers/x11_window.c        Mon Apr  7 07:17:23 2003
    @@ -379,6 +379,13 @@
        XVisualInfo visualinfo;
        int screen_no = DefaultScreen (display);
     
    +   if (XMatchVisualInfo (display, screen_no, 32, TrueColor, &visualinfo))
    +   {
    +      xvisual = visualinfo.visual;
    +      depth   = 32;
    +      return 0;
    +   }
    +
        if (XMatchVisualInfo (display, screen_no, 24, TrueColor, &visualinfo))
        {
           xvisual = visualinfo.visual;
    

    Back to the list of fixes