mame cabinet front end

What is it?

A simple front end for mame/emulator cabinets.
It runs in a terminal window (using curses) on UNIX/linux/OSX (might work on Windows with CygWin or ActivePerl)

It can optionally display images/screenshots for any games you have. (if perl Tk installed)

It uses mame/emulator keybindings, so you can control your mame cabinet using just your mame controls.

(In fact, this is where the name comes from - player 2 buttons 1,2,3)

Doesn't verifyroms for MAME because I have the full set. Supports MAME as well as other emulators and various games. Someday maybe I'll add rom filtering...


This software is essentially free, but please read my payment spiel
Please read the full license
Screenshot - click for full-size


It's a single perl script. There is also an example asq.rc available.


asq reads a configuration file (asq.rc) to create the main menu.
It looks for this file in these directories (in this order):
  1. Your home directory
  2. The directory that asq is in
  3. The current directory
The asq.rc contains a list of the main menu items. There are three types of menu items: Comments (anything after a '#') and blank lines are ignored

Let's look at some examples:

Space Ace [DOS]		/usr/games/bin/SpaceAce
Mame (X11)		MAME:/usr/games/roms		mame.x11
Mame (SDL-fullscreen)	MAME:/usr/games/roms		mame.sdl -fullscreen
Atari 2600		DIR:/usr/games/2600roms/	stella -fullscreen
asq will only read the list of mame games if a MAME: type is found (and only reads it once). The two MAME: lines above show how you can specify different args for the same command by putting it on the menu more than once.

You can also specify filter the DIR: contents through a regexp to only pick certain types of files. As an example:

Commodore64		DIR[.d64]:/usr/games/c64/	x64 -dsize

Key Mapping:

asq can also temporarily remap keys (UNIX only, using xmodmap) for specific games/emulators, so that you don't have to whip out a keyboard just to play a game that doesn't use the mame "keyset".

To do this, specify an extra option on a launcher line in the asq.rc file:

Commodore64		DIR[.d64]:/usr/games/c64/	x64 -dsize	MAP=/usr/games/
The map file contains keys to replace while the game is playing (though it uses xmodmap, so the keys will be switched for your entire system while the game is playing, and if asq dies before fixing the keys, you'll be in a spot of trouble :). The keys are replaced all at once, which allows you to swap keys. A simple example:

# Map file for asq.  Comments are ignored.
Control_L space
Left Right
Right Left
This mapfile will replace Control_L with space - so when you press what would be the left control (mame player 1 button 1), you'll get a space instead. It also swaps the left and right arrow keys. To get the proper names for keys, look at the output of xmodmap -pk.

For a better example, stella is an Atari2600 emulator which doesn't use normal mame keys. Here is my

It may help to understand what keys I chose to use for my MAME cabinet, here's my basic layout, a 2x3 grid of control buttons and then two players, each with a joystick and a 3x2 grid of buttons. Here's the ascii layout:

   5       7          Up        1      Shift_L Return      r      2 w p
  F8      F9      Left  Right   Control_L Alt_L space     d g     a s q
  Escape  Tab        Down                                  f


asq can optionally popup a window to show screenshots as you browse through the menus. perl Tk is only required if you use this option, otherwise no extra window pops up.

Each menu can have an image directory. When a menu item is active it will look for an image of the same name and of the given image type. Any text inside parentheses () is optional in the image name, and also mame rom names can be used instead of the full names.

Image directories are specified as an extra option to a launcher line (like MAP):

Commodore64	DIR[.d64]:/usr/games/c64/	x64 -dsize	IMAGES[gif]=/usr/games/c64/images
You need to specify the type of images to look for (though you can specify multiple types separated with commas). Any types you use that aren't builtin to Tk will require a separate loader, such as Tk::JPEG.

Because mame rom names can be used, you can just set the IMAGES directory for mame roms to include the screenshots directory and then asq will automatically use screenshots as you take them. Make sure to include the 'png' image type in your IMAGES specification (this requires installation of the Tk::PNG module). Example:

Mame (X11)	MAME:/usr/games/roms		mame.x11	IMAGES[jpg,png]=/usr/games/mame/images
You can specify an IMAGES option and a MAP option, just separate them with tabs.


  1. Perl, which kicks ass
  2. Perl::Curses
    (Also needs a oneline change to Curses::UI, see the top of the script).
  3. Optionally Perl/Tk


It's just a perl script. No install required.


Revision History:



You bet.