Linux Arcade Miscellany

Advmenu image

Late 2003 I started work on a MAME cocktail cabinet (an Australian 20" Hankin, for those know).

This project is based on a Linux 2.6.0 kernel and a Matrox G400 (MAX) graphics card --- thanks to the sterling advice of several members of the AdvanceMAME users forum (notably Matthew Coulson).

I'm using the Matrox framebuffer support in the kernel (matroxfb), together with the sophisticated AdvanceMAME and AdvanceMENU modeline generation in order to have everything working on the arcade monitor.

On this page I'll attempt to describe some of the things I've learned in the process.

Remove white border from snapshots

The snap.zip file I obtained had images with an appalling white border around them. A simple way of removing the border is the pnmcrop command (from the netpbm package).

I whipped up a perl script to do the grunt-work:

#!/usr/bin/perl
mkdir "snap", 0777 unless -d "snap"; 
chdir "snap-orig" 
  or die "where is snap-orig dir?";
@files = <*.png>;
for my $file (@files) {
  print "trimming $file\n";
  system "pngtopnm $file | pnmcrop "
       . "| pnmtopng > ../snap/$file";
}

I unpacked the original images into a directory named "snap-orig" and ran this script to strip the border from each image.

Extracting the first frame of mng files (with a patched advmng)

File: advancecomp-1.9-X.patch

This patch adds the ability to extract a single png frame (the first) from one or more input mng files.

Each output file is named with a simple '.png' extension (without the number '-0000' that would be added if all frames were extracted with advmng).

Command line option: short form '-X', long form '--extractone'.

Example: advmng -X *.mng

I did this because I wanted the static snapshots displayed by advmenu to be the same as the first frame of a clip, providing some visual continuity when selecting a game and having the clip start playing.

Note: this patch is a bit of a hack.

Overwriting recordings in AdvanceMAME

File: advancemame-0.78.1-overwrite.patch

This patch adds a config item called 'record_overwrite'. It is yes/no valued and defaults to 'no'. If it is set to 'yes' then a new recording will overwrite the previous one (if any).


Go back to immir.com.