SpiffMAME Software

My software configuration on SpiffMAME has gone through several transformations, originally running MS DOS 6.22 with Standard MAME (0.54), and ArcadeOS. After going through a couple of different graphics adaptors and getting a cap-kit installed in my Hantarex MTC900 arcade monitor, I finally found a combination that worked well.

To overcome problems of the ROM-set becoming too big for the size of a FAT-16 partition allowed by DOS 6.22, I switched to Windows 98, with BootGUI=0. This also gave improved performance since the new operating system was able to use more memory.

After trying out AdvanceMAME, and discovering the superior options for generating video-signals that are an exact match of the ones produced by the original game hardware, I decided to go with this option, and also switched to AdvanceMENU, since it can use the same modelines, thus getting a frontend (menu) running on my arcade monitor. The configuration of AdvanceMENU was inherently more difficult than ArcadeOS, since the keyboard mapping had to be manually entered into the configuration file. Also, defining a nice color-scheme for the menu interface took quite some time.

After getting a complete 0.61 ROM-set, upgrading AdvanceMAME to this version, and making a power-relay to turn on and off the monitor from software via the parallel port, I was ready for some finishing touches concerning the software. First of all, I used the utilities from the AdvanceCAB-package to configure a working video-mode on the arcade monitor, show a nice bootup logo, and turn on the monitor during bootup. In this state, the system was working in my dorm kitchen for quite some time.

Switching to Linux

In 2003, after moving from the dorm, I decided to upgrade the hardware of my machine, simply because motherboards and processors were getting so cheap. This also allowed me to exchange the board in my desktop machine, getting a few extra features (such as firewire) on this machine. But since the new motherboard had no ISA-slots, I had to come up with a replacement for the old SoundBlaster 16 that provided the sound until then. Since the motherboard had onboard sound, which worked fine in Linux, but not in DOS, and since I was already running Linux on several other machines, including my desktop, I decided that I wanted to redo the entire software setup of my machine using Gentoo-Linux.

I installed a basic Gentoo-system, and tried to run only the most necessary services, in order to have the system boot up quickly. I also got the Linux version of AdvanceMAME up and running on the new system. Also, since I wanted to use framebuffer for bootup and for AdvanceMAME (in order for vsync to work properly), it's important to set the fbcon USE-flag before emerging advancemame.

I tried to use the Riva TNT2 graphics-card which had worked flawlessly under DOS, but was unable to get everything working correctly. I then decided to use a Matrox G400 Dual-head, which I had lying arround. The matroxfb is really incredible, and looking through the documentation in the kernel sources, it was fairly easy to figure out how to configure the framebuffer to run in a nice mode from the moment the kernel is initialized. After having compiled support for the matroxfb-framebuffer into my kernel, I configured framebuffer by going throug these steps.

Then came the task of setting up the video modes. This time I worked out a more methodical approach, using SortInfo to export a list of the video resolutions of all games, and a perl-script to output a list of the resolutions, the number of games using a particular resolution, and an example game. Sorting this list by the number of games using each resolution allowed me to create 10-15 perfect video modes, covering 95% of the games. I think I will soon do a new version of this list, and post it here, along with the perl scripts.

When this was all setup, I worked out a way to have AdvanceMENU started when the system booted up. This was accomplished by the following entry in /etc/inittab (and make sure that no other getty is running on the first console (at least in runlevel 3):

c0:3:respawn:/sbin/agetty -n -l /sbin/spiffmame 38400 tty1 linux

which simply runs the spiffmame perl script on the first console, but only in runlevel 3. This allows the machine to be booted in a different runlevel for maintenance.

/sbin/spiffmame is a perl script which logs in as the mame-user and runs AdvanceMenu. Since this script calls /sbin/poweroff and various other things, it needs to run as root. But I still think it is safer to run AdvanceMenu as a normal user. This also means that AdvanceMAME will run under the mame-user, and any configuration (and the romset) is in this users homedir.

When exitting AdvanceMAME (by using the EXIT-button on the control panel), the player is returned to AdvanceMENU. If the EXIT-button is pressed while the user is in AdvanceMENU, control will be returned to the spiffmame.pl-script. This will then pause for two seconds while checking for one of the service-keys (inside the coin-door) to be pressed. If no key is pressed before the timeout, the system calls /sbin/poweroff, and shuts down the arcade machine. If, however, one of the service keys are pressed, the machine can be switched into maintenance-mode, allowing the connection of a keyboard, and being able to get to a console (all on the arcade monitor). After the maintenance, the script can start AdvanceMENU again.

With this all setup, I created a small C-program to control the power-relay from Linux. I made an init-script for Gentoo, to call this when the system is started up.

Finally I spent some time looking at possible options for framebuffer splash, and finally came up with a very decent result. It just makes the "product" so much more perfect with eye-candy such as a nice progress-bar while the system is starting up and shutting down.

The spiffmame perl script has been extended with one more feature: It checks the rotation-parameters of the monitor from the AdvanceMENU configuration file, before AdvanceMENU is started, and again after it exits. If the parameter has changed, it means that the user rotated the screen in AdvanceMENU, and the script will update the framebuffer splash theme accordingly (by modifying the /etc/splash/mame-symlink).

Last updated: 2005.11.18