logo


Valid XHTML 1.0 Transitional
Hits today: 46 (4% from www.mp3car.com).
Current time: Fri 12 Mar 2010 2:36:38 AEST.
Last updated: Sat 4 Feb 2006 10:31:39 AEST.

Software set-up

---------------------------------------------------------------------------

Software set-up on the PC

NOTE: Before asking me why binaries aren't available here to download, or how you
download and compile the MAME sources, please read this.

Since I had made the cabinet hardware look as authentic as possible, I needed to spend
an equal amount of attention on the software. The PC's only job is to run MAME, so I
didn't need the latest fancy software on it. I didn't include a CD-ROM drive in the PC, so
that also helped me decide on what got installed. I settled on using the DOS version of
MAME and Windows for networking to my other PC. Win95 was installed from floppies,
and the rest of the software installed over the network.

After everything was installed, the next step was to try and get MAME running as soon
as possible after the system starts, with the minimum amount of stuff on the screen that
gives away that there's a PC in there and not a real arcade machine.

When the PC starts, the usual DOS cruft is loaded (HIMEM, EMM386, SMARTDRV),
then my custom frontend is run, which starts MAME. Windows is only started after
MAME exits, which impossible unless the external keyboard is plugged in. To select
another game, you currently have to reboot the PC. I'll only fix that if/when it becomes
too annoying.

The next step was to fiddle with the MAME sourcecode so that there's no extra output
(the disclaimer & the game info screens). At the same time, I changed the default
cabinet type to cocktail and tweaked the controls so that P1 defaults to the joystick
and P2 has the arrow keys + control + alt.

Apart from the BIOS self-test output when the PC is powered on, there's now nothing
that gives away the fact that there's a PC in there.

Mission complete! :-)
Changing MAME 0.61's default cabinet type to cocktail

There didn't seem to be a way of configuring MAME to set the default cabinet type to
cocktail, and I really didn't feel like changing each game manually, so I had to somehow
change it at the source level. Unfortunately, the cabinet type is set using the default dip
switch settings in each driver file (hundreds of them), so changing them manually would
still have been somewhat tedious...

Fortunately, the settings were in a standard format, so that means I could write a
script to change them all at once. Here is an example dip switch setting:

PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )

The "PORT_DIPNAME" part signifies a dip switch setting. The first number (in hex
notation) is the bit that the switch controls. The second number is the default value of
the bit (0x00 if unset, or the value of the first number if set). The last part is the text
that is displayed in the on-screen-display inside MAME. Therefore, all the script needs
to do is set the second number to the first one if it is zero, otherwise set it to zero.

The Sed script I wrote is shown below. It needs to be run on all the C files in the
"src\drivers" directory. If you decide to use the script, it's probably a good idea to back
up the driver files first, just incase something goes wrong.

s/PORT_DIPNAME( 0x\(..\), 0x\1, DEF_STR( Cabinet ) )/PORT_DIPNAME( 0x\1, 0xxxabcdef, DEF_STR( Cabinet ) )/
s/PORT_DIPNAME( 0x\(..\), 0x00, DEF_STR( Cabinet ) )/PORT_DIPNAME( 0x\1, 0x\1, DEF_STR( Cabinet ) )/
s/0xxxabcdef/0x00/

Custom MAME bootloader

I wrote an extremely basic frontend for DOS. It displays a game selection screen only if both joystick 1 buttons A&B were pressed when it loaded, otherwise it just runs MAME using the last game that was played. The game is selected by highlighting its 8-letter name (I did say it was basic!) using the joystick, then pressing joystick 1 button 'C' / joystick 2 button 'A'.

The sourcecode needs DJGPP & STOSLib to compile. Here's a screenshot showing
the game selection screen:

Bootmame screenshot


All content © 2000-2006 AliasX
Questions/comments? Contact the author