MAMEWah Tutorial:
How to Use Relative Paths in MAMEWah 1.62b13

Here is a directory snapshot of a MAMEWah setup. A carefully set up directory structure can make MAMEWah a relatively easy system to maintain.

f:\mamewah162b13\config\09supernintendo
f:\mamewah162b13\config\09supernintendo

f:\mamewah162b13\emu\09supernintendo
f:\mamewah162b13\emu\09supernintendo

There are three primary types of files you need to edit to configure MAMEWah.
  • mamewah.ini
  • mamewah.cfg
  • emulator specific configuration files e.g. 09supernintendo.ini

mamewah.ini

Contains your global settings such as the emulator_root_path which needs to be manually set to the parent directory. In my case this is:

f:\mamewah162b13\emu

From now on if you use the variable "emurootpath", MAMEWah will read it as "f:\mamewah162b13\emu"

Almost everything else in the mamewah.ini can be configured from inside the program.

mamewah.cfg

This file contains all of the key settings for MAMEWah and is where you can set some of the buttons to easily move around the front-end such as Next Emulator and Random Game.

09supernintendo.ini

This is where all the magic takes place. When you tell MAMEWah to run a particular game on a particular emulator, you are essentially just passing it a command line.

For example (and assuming you have your directory structure like mine), to run Super Punch Out on ZSNES you would type the command line:

f:\mamewah162b13\emu\09supernintendo\zsnes\zsnesw.exe "f:\mamewah162b13\emu\09supernintendo\roms\PUNCHOUT.zip"

Of course, most people would change to the target directory first, like this:

Using variable paths the emulator config file (09supernintendo.ini) represents this command line like this:

[emurootpath]\[emuname]\zsnes\zsnesw.exe "[rompath]\[name].[romext]"

Where [emurootpath] = f:\mamewah162b13\emu (as set by mamewah.ini)

[emuname] = 09supernintendo (name of the config directory for the emulator chosen)

This variable is very useful and is the reason why the emulator directories are named exactly the same as the config directories.

[rompath] = [emurootpath]\[emuname]\roms (as set in the emulator config file)

If you extrapolate this pathname out, you get:

[rompath] = f:\mamewah162b13\emu\09supernintendo\roms

[name] = PUNCHOUT (or the game title selected via the MAMEWah selection screen)

[romext] = .zip (as set in the emulator config file)

 

Now all that's required is a bit of discipline. Images always go in the emulator directory as snap, titles and flyers. Roms are always in the parent emulator directory rather than under the emulator itself, so that multiple emulators for the same format can easily access the same set of roms. Finally, the actual directory for the emulator can be anything you like since it is manually set in the emulator_commandline variable.

To create a new emulator configuration file:

  • create a new config directory for the emulator e.g. 26colecovision.
  • copy the 09supernintendo.ini file to the new directory and rename it 26colecovision
  • Change the following values:

    emulator_title

    [emurootpath]\[emuname]\snes.nms (optional)

    emulator_commandline

And you've got it!

 

###09supernintendo.ini (mamewah v1.62)###
emulator_titleNintendo SNES
 
### List Generation Settings ### 
rom_path[emurootpath]\[emuname]\roms
rom_extensionzip
dat_file 
nms_file[emurootpath]\[emuname]\snes.nms
catver_ini_file 
list_generation_methodrom_folder
 
### Execution Settings ### 
pre_emulator_app_commandlines[emurootpath]\cpv2\cpv2.exe
emulator_commandline[emurootpath]\[emuname]\zsnes\zsnesw.exe "[rompath]\[name].[romext]"{nodosbox}{safelaunch}
post_emulator_app_commandlines 
general_app_commandlines[emurootpath]\cpv2\cpv2.exe
 
### Artwork Settings ### 
artwork_image_paths[emurootpath]\[emuname]\snap;[emurootpath]\[emuname]\titles;[emurootpath]\[emuname]\flyers
movie_preview_path[emurootpath]\[emuname]\previews
movie_artwork_no1
enable_fuzzy_search0
history_dat_fileauto
history_dat_artwork_no2
 
### Screen-Saver Settings ### 
enable_music_in_screensaver1
select_random_game0
saver_typemovie
movie_path[emurootpath]\[emuname]\previews
movie_fullscreen1
quit_delay0
saver_commandline 
 
### Additional Settings ### 
music_path 
lcd_display_file_path 
description_display[description]{scroll}
 
### Settings used by MAMEWAH ### 
current_list0