« Linux OS| Main | AdvanceMENU »

AdvanceMAME

Category: MAME'd Millipede :: 4. Software

AdvanceMAME is the key to functionality of my system. It is a MAME-based project meaning it uses the core MAME source, adds a few patches and hooks on its various extensions. The primary focus is to gain low-level control over the video hardware in your system in an attempt to produce authentic classic arcade resolutions. These mostly exist in the neighborhood of a 15.75 kHz horizontal scan rate. By comparison, most PCs run at much higher resolutions and start around 31.5 kHz which is double the rate needed to drive an arcade monitor.

The AdvanceMAME project is open-source and entirely maintained by volunteers. It is constantly changing as new features are added, bugs are stomped and sometimes new bugs are introduced. I started with the 0.67 version, moved to 0.68 during the course of the project and have not yet moved to 0.69 (which also arrived during the few weeks I've been working on this system).

I compiled my installation from source under Linux against version 1.9.17 of SVGALib. I initially had quite a few problems with lockups and crashes due to SVGALib bugs in the Rage driver I needed for my hardware. I even switched to DOS for a few days for comparison when I discovered a series of patches to SVGALib included in the contrib directory of the AdvanceMAME source. Since I applied these patches I've have quite literally not had a single problem or lockup with the installation.

Configuration of AdvanceMAME is not for the faint of heart when it comes to the configuration of SVGALib and a 15.75 kHz monitor. While your mileage may vary, I will share the configuration settings I have used to achieve a stable system.

The first thing I discovered was not to let the default settings of SVGALib's configuration and its many options overhwhelm you. Trick number one: dump nearly everything in the /etc/vga/libvga.config file. Here is mine as it stands now on a running system:

HorizSync 15.5 16.0
VertRefresh 47 63
#HorizSync 30 85
#VertRefresh 48 120
mouse Microsoft
mouse_accel_type off

modeline 640x480 13.5821 640 696 760 864 480 484 491 521 -hsync -vsync interlace

This basically tells the underlying SVGALib system that my monitor (a Wells-Gardner K7200) is limited to 15.5 through 16.0 kHz for the horizontal frequency and from 47 to 63 Hz on the vertical refresh. The commented fields are for the rare case when I need to run it on a PC monitor for debugging.

Beyond that it simply says that its internal mouse control should use a Microsoft Mouse protocol (which is what the Opti-PAC generates) with absolutely no acceleration coefficients. The modeline does not apply to my use of AdvanceMAME (which maintains its own modlines) in this case but rather to the use of Daphne for emulating Dragon's Lair. I'll get to that later.

The configuration for AdvanceMAME is far more detailed. I'll hit some highlights here:

device_video_pclock 5-90
device_video_hclock 15.75
device_video_vclock 47-63

These settings somewhat mirror what is already declared in the SVGALib configuration.

device_color_bgr15 no
device_color_bgr16 no
device_color_bgr24 no
device_color_bgr32 yes
device_color_bgr8 no
device_color_palette8 no
device_color_yuy2 no

My video card is configured to only generate its output using a 32-bit depth. This makes sure the system is locked into that range.

device_keyboard svgalib
device_mouse svgalib
device_sound auto
device_video svgalib

These lines make sure svgalib is responsible for all input and output except for audio which is handled by modules in the Linux operating system.

display_rol yes

This line makes sure the system knows to rotate the output left 90 degrees since my monitor is mounted for vertical games.

device_video_modeline standard_640x480 13.5821 640 696 760 864 480 484 491 521 -hsync -vsync interlace

This is a sample modeline generated by interactive use of advv during the process of tweaking the system's output to match my monitor.

AdvanceMAME is launched each time after making game selections from AdvanceMenu which is our next topic of discussion.

My AdvanceMAME configuration file (advmame.rc) is available here for download if anyone finds it useful.