EmuWizard 0.90


by Daniel Noguerol
Uses source code from the "Cocktail Frontend" (c) Mike Billings.
Filter modifications/general enhancements by Justin Waugh.

I recently downloaded Mike Billings' excellent front-end program for use in my ArcadePC. After using it for a while, I realized there were several things I wanted to change to make it more appropriate for my needs. Of course, I got carried away and have made enough changes that I thought it might be of use to other people as well. To avoid confusion with Mike's front-end, I've renamed the creation EmuWizard.

This program was created for my own use. I am releasing it (and the source code) in the hopes that it will benefit someone else. I've tested it to the best of my ability, but I can not and will not be responsible for any damage cause by its use.

General Usage

Description forthcoming...

Controller Configuration

By default, hitting the '~' key will bring up the controller configuration mechanism. This key can be changed using the ConfigControls key in the INI file. This allows you to set the key settings for the primary front-end controls: up, down, page-up, page-down and start game. It's certainly handy when you can't remember those scan code values!

Emulator Support

Originally written to support only MAME, EmuWizard has been greatly enhanced to support just about any emulator the uses a command-line. The list of emulators that the front-end should use is picked up from the INI file using the Emulators key. The value of this key should be a comma-separated list of emulators. Each emulator that is specified should have a corresponding section in the INI file. For example, if the key looks like this:
.
.
Emulators=MAME,Daphne
.
.

then there should be both [MAME] and [Daphne] sections in the INI file. What these sections should contain is detailed in the reference section below.

MAME

The MAME emulator gets special treatment by EmuWizard. Its game list is built differently than other emulators and it has its own filters that can be applied to that list.

If a [MAME] section is present in the INI file, the first time EmuWizard is run, it will ask MAME for a list of all the games it supports. This list is stored in a file called mame.lst. Subsequent EmuWizard runs will use the pre-generated list instead of asking the MAME executable again (so if you want to rebuild the list, simply delete the mame.lst file). Keep in mind that just because MAME supports a game, that doesn't mean it will show up in the list. EmuWizard verifies that the ROM file exists in the configured ROMs directory before it will add a game to the list.

Other emulators

As mentioned above, EmuWizard can support any emulator that uses a command-line (and with some cleverness, maybe even some that don't -- see simulated keypresses).

For emulators other than MAME, two steps are taken to build its supported list of games.

  1. The ROM directories specified for the emulator via the RomPath entry are searched and the file names are added to the list (minus the file extension). This behavior can be avoided by not specifying a RomPath value at all.


  2. The emulator's config section is searched for keys of the format:

    GameXXX

    where XXX is an integer starting from 1. The value of these keys should be a game description and a ROM name seperated with a comma. For example, the Daphne emulator might have the following entries:

    [Daphne]
    .
    .
    Game1=Dragon's Lair,lair
    Game2=Space Ace,ace
    .
    .

Image support

EmuWizard supports seperate images for game snapshots, flyers and marquees. When a game is selected in the front-end, the program will look for a corresponding image files for each image type the selected skin needs to display. The files are looked for in the directory specified by the emulator's config section for each image type. The correct file is looked for in the following order:

Whichever of the above searches returns an image first gets used. If no image is found, then nothing is displayed for that image type.

NOTE: the default image entries for an emulator (DefaultSnap, DefaultMarquee and DefaultFlyer) must be defined as a filename only. The file will be looked for in the path specified for emulator images of the necessary type (eg. defaultmarquee.png will be looked for in the path defined by the Marquees config entry for the current emulator).

Dynamic command lines

The command line that is ultimately executed is built dynamically based both on the game selected and the emulator that supports it. When a game is started, the program grabs the CmdLine entry from the associated emulators configuration section in the INI file. The entry should be a string containing the necessary command line argument to pass to the emulator executable to run the game. There are a number of variables substitutions that can be used when the command line is built:

%d the game's name as displayed in the front-end
%f the game's rom filename (including extension)
%p the game's rom path
%q a " character (useful for wrapping paths or names with spaces)
%r the game's rom name (no extension)

For example, let's say an emulator's CmdLine INI value is:

%q%p\%r%q

and its RomPath INI value is:

d:\roms

If the selected game's rom name is Actraiser (U).zip, the command line argument that is built would be:

"D:\roms\Actraiser (U).zip"

This is, of course, appended to the emulator's path and executable name to form the full command line that is executed.

NOTE: There is a configuration option called DebugCmdLine that will force the emulator to output the command-line generated to a file each time a game is run. This can be useful if you're not sure that the emulator you're adding is getting the command-line you expect.

Simulated Keypresses

EmuWizard has the ability to send keypresses to an emulator after it is started. This is useful for emulators that expect one or more keystrokes to be pressed before the game will start (eg. MAME's dreaded "OK" screen). Each emulator section that is created can have its own list of keys to send.

Each emulator specific section can define a SendKeys entry that specifies the keys to send to the emulator. An example of this would be:

.
.
[MAME]
SendKeys=OK
.
.

This will send the keys 'O' & 'K' to the emulator after it starts. By default, EmuWizard will wait 6 seconds before sending the first keystroke (in this case the 'O') and 6 milliseconds between keystrokes. This can be overriden using the SendKeyWait and SendKeyInterval entries in the [Settings] section of the INI file. There is currently no ability to have settings for these two values on a per-emulator basis, so changes to them will apply to all emulators.

Shutdown

The front-end can initiate a system shutdown at any time. To do this, there are 3 keys that must be hit in sequence. Any break in the sequence will abort the operation. The first two keys are configurable -- see Shutdown1 and Shutdown2 in the INI file. The third key is the "Player 1 Start" key.

Filtering

EmuWizard has a unique ability to configure a filter for each emulator independently. This filter will be applied to the game list to remove unwanted entries. For example, you might want to see only public domain games or never want to see games from Australia (not that there's anything wrong with that).

There are two types of filters in EmuWizard -- MAME filters and GOOD filters.

MAME filters

Since MAME looks quite a bit different than most other emulators (and because support was included for MAME since the front-end's first incarnation), there is support for a MAME-only filter set. Basically, this filter set will only apply to the one and only [MAME] emulator in the INI file. This filter set includes items like Display Vertical Games, Display Horizontal Games, etc.

GOOD filters

A programmer by the name of Cowering has made a series of "Good" tools available for ROM collectors. These are programs for various system types that can take a directory of ROM files, determine what they are and rename them using a consistent naming convention. EmuWizard can filter out games based on this file naming convention. If an emulator's ROMs are in the "Good" file format, you can set the UseGoodFilters key to TRUE and the Good filters will be available for that emulators game list. See the reference section below for the actual filters.

It's worth mentioning that emulator filters can be changed both manually in the INI file and dynamically through EmuWizard's configuration menu.

Skinning

Description forthcoming... :)

Configuration Reference

EMUWIZARD.INI

The following is a list of the INI file entries that are currently supported by the front end.

The "type" column can have the following values:

[Settings] Section

Name Type Default Description
AllowMenu Bool true Indicates whether menu can be accessed from the front-end
DebugCmdLine Str
The file name/path used to write out the command-line string generated when a game is started
Emulators Str MAME A comma-separated list of emulator names
MenuType ListView/ImageBrowser ListView The "browse mode" the front-end starts in
PreviewFontcolor Hex 0x000000 The font color in "ImageBrowser" mode
PreviewBackgroundcolor Hex 0xFFFFFF The background color in "ImageBrowser" mode
PreviewFontSize Int 8 The font size in "ImageBrowser" mode
PreviewHighlightBackcolor Hex 0x000000 The highlight background color in "ImageBrowser" mode
PreviewHighlightForecolor Hex 0x000000 The highlight foreground color in "ImageBrowser" mode
PreviewModeWidth Int 184 The width of images in "ImageBrowser" mode
PreviewModeHeight Int 244 The height of images in "ImageBrowser" mode
PreviewModeSpacer Int 20 The spacing between images in "ImageBrowser" mode
PreviewPictures Screenshots/Flyers Screenshots The images used for the "ImageBrowser" mode
ScreenSaverChangeInterval Int 60 Number of seconds until screensaver changes images
ScreenSaverStartInterval Int 60 Number of seconds until screensaver starts
ScreenSaverType Flyers/Marquees/Screenshots Flyers Type of image shown in screensaver mode
ScrollBorderPct Int 20
SendKeys Bool false Enables/disables the "simulated keystroke" feature
SendKeyInterval Int 6 Number of milliseconds to wait between sending each simulated keystroke
SendKeyWait Int 6 Number of seconds to wait after emulator is started to begin sending simulated keystrokes
Skin.dir Str skins The directory where skin sub-directories are located
Skin Str DefaultSkin The currently selected skin
UseJoystick Bool true Enables/disables joystick support
UseMameInfoDat Bool true Indicates whether to use mameinfo.dat

[Keymappings] Section

Name Type Default Description
Exit Int 27 Key scan code to exit the program
ChangeEmu Int 53 Key scan code to change the selected emulator
ConfigControls Int 51 Key scan code to dynamically configure the primary controls (up,down,pgup,pgdown,start)
GameInfo Int 17 Key scan code to display game information (if available)
SelectUp Int 38 Key scan code to change selection up one entry
SelectDown Int 40 Key scan code to change selection down one entry
SelectPageUp Int 38 Key scan code to change selection up one page
SelectPageDown Int 39 Key scan code to change selection down one page
ShowMenu Int 49 Key scan code to display the configuration menu
Shutdown1 Int 51 Key scan code for first shutdown key sequence
Shutdown2 Int 52 Key scan code for second shutdown key sequence
StartGame Int 49 Key scan code to start the selected game

Emulator Sections

These entries apply to any emulator specific sections that are created in the INI file.

Name Type Default Description
CmdLine Str %r Dynamic command-line string to use for this emulator
DefaultFlyer Str
Name of the default flyer image for this emulator.
DefaultMarquee Str
Name of the default marquee image for this emulator.
DefaultSnap Str
Name of the default snapshot image for this emulator
Executable Str
Emulator executable filename
ExecPath Str
Absolute path the executable resides in
Flyers Str
Absolute path the emulator flyer images are located in
Marquees Str
Absolute path the emulator marquee images are located in
RomFileExt Str zip The file extension the emulators' ROMs use
RomPath Str
A comma-separated list of absolute paths that emulator roms are located in
SendKeys Str
List of keys to send using the simulated keypress feature
Snaps Str
Absolute path the emulator snapshot images are located in
UseGoodFilters Bool FALSE Whether the emulator uses the "Good" rom naming convention
MAME-specific filter entries
DisplayMissingRoms Bool
Display roms not found on the filesystem
DisplayVertical Bool
Display vertically oriented roms
DisplayHorizontal Bool
Display horizontally oriented roms
DisplayClones Bool
Display clones
DisplayNeoGeo Bool
Display NeoGeo roms
DisplayVector Bool
Display vector based roms
DisplayRaster Bool
Display raster based roms
MinPlayers Int
Displays games supporting this number of players or greater
MaxPlayers Int
Displays games supporting this number of players or less
MinButtons Int
Displays games supporting this number of buttons or greater
MaxButtons Int
Displays games supporting this number of buttons or less
MinCoins Int
Displays games supporting this number of coins or greater
MaxCoins Int
Displays games supporting this number of coins or less
ControllerTypes Int
Add the following together to make your value:
DIAL            1
DOUBLE_JOY8WAY 2
JOY4WAY 4
JOY8WAY 8
PADDLE 16
STICK 32
TRACKBALL 64
"Good" filter entries
ShowAlternates Bool FALSE Shows alternate versions of the roms
ShowBadDumps Bool FALSE Shows bad rom dumps
ShowBetas Bool FALSE Shows beta roms
ShowFixed Bool FALSE Shows fixed roms
ShowHacks Bool FALSE Shows hacked roms
ShowMultiLanguage Bool FALSE Shows multilanguage roms
ShowOverDumps Bool FALSE Shows overdumps
ShowPirate Bool FALSE Shows pirate roms
ShowTrainers Bool FALSE Shows trainer roms
ShowTranslations Bool FALSE Shows translated roms
ShowUnlicensed Bool FALSE Shows unlicensed roms
ShowVerified Bool FALSE Shows verified good roms
ShowAustralia Bool FALSE Shows the appropriate country
ShowChina Bool FALSE Shows the appropriate country
ShowEngland Bool FALSE Shows the appropriate country
ShowEurope Bool FALSE Shows the appropriate country
ShowFinland Bool FALSE Shows the appropriate country
ShowFrance Bool FALSE Shows the appropriate country
ShowFrenchCanadian Bool FALSE Shows the appropriate country
ShowGermany Bool FALSE Shows the appropriate country
ShowGreece Bool FALSE Shows the appropriate country
ShowHongKong Bool FALSE Shows the appropriate country
ShowItaly Bool FALSE Shows the appropriate country
ShowJapan Bool FALSE Shows the appropriate country
ShowJapanAndKorea Bool FALSE Shows the appropriate country
ShowKorea Bool FALSE Shows the appropriate country
ShowNetherlands Bool FALSE Shows the appropriate country
ShowNonUSAGenesis Bool FALSE
ShowPublicDomain Bool FALSE Shows public domain ROMs
ShowSpain Bool FALSE Shows the appropriate country
ShowSweden Bool FALSE Shows the appropriate country
ShowUnknownCountry Bool FALSE Shows the appropriate country
ShowUSA Bool FALSE Shows the appropriate country
ShowUSAAndBrazilNTSC Bool FALSE Shows the appropriate country

SKIN.INI

[Settings] Section