Getting Started with MAME on macOS - Part 4 - Going Further with Command Line

Guide Emulators by sky

Logo de MAME

Even though everything has been done to hide the fact that MAME is a command-line application, it shouldn't be forgotten that it is one! So why not take advantage of it?

By adding parameters when launching MAME, it is possible to make it perform other actions.


1/ Machine-related actions

To start, let's go back in time and launch a game without going through the graphical interface. If I want to launch Street Fighter 2 (just in case, you know…), it's enough to type the name of the application followed by the name of the machine:

mame sf2

As MAME is kind, you can also use the name of the file, with the .zip extension.

mame sf2.zip

By quitting the game by pressing Escape (ESC), you won't return to MEWUI, but to your terminal.

It is also possible to check if a ROM is valid by adding the -verifyroms parameter. For the same game:

mame -verifyroms sf2

MAME will directly return the result, here:

romset sf2 is good
1 romsets found, 1 were OK.

If I take the defective ROM seen in part 2:

mame -verifyroms sf2ce

I get the result:

sf2ce       : ioc1.ic7 (260 bytes) - INCORRECT LENGTH: 279 bytes
romset sf2ce is bad
1 romsets found, 0 were OK.

MAME indicates what is wrong.

To get the exact name of the ROM, you can use the -listfull parameter:

mame -listfull sf2

The result obtained is:

Name:             Description:
sf2               "Street Fighter II: The World Warrior (World 910522)"


2/ Actions related to a set of machines

Apart from launching a game, it is possible to execute other commands on a set of machines or all the machines known by MAME.

Be careful, however, running a command on all games can take quite some time.

You can try it out, and if you find it too long, you can always interrupt the program with ctrl+C.

To check all ROMs related to Street Fighter 2, or all ROMs whose name starts with "sf2", you need to request

mame -verifyroms "sf2*"

The result starts with

romset sf2 is good

and ends with

90 romsets found, 66 were OK.

As the end of the result indicates, 90 ROMs were tested and only 66 are correct. Be careful, in this batch there are not only ROMs related to Street Fighter 2. For example, the game "sf2049", whose name is "San Francisco Rush 2049", also matched the search.

You can confirm this with the listfull command

mame -listfull "sf2*"

Note the use of quotes so that the asterisk character, indicating "any character," is interpreted correctly.


3/ Actions related to configuration files

In the second part of our article series, we already saw the createconfig parameter.

mame -createconfig

It allows you to ask MAME to create the configuration files in their default version. On macOS, these files are created at the root of your user directory. If files already exist there, they will be overwritten by the new ones.

If, after tinkering with the configuration files, you have lost elements or completely messed up the configuration, it may be interesting to retrieve the original files to compare and fix the issues.

The showconfig command displays the current configuration of MAME. The command reads the configuration files.

However, by combining it with the grep command, you can obtain precise information, such as here for example, to get the path to the ROMs

mame -showconfig | grep rompath

The result contains only the line

rompath                   /Volumes/Data/ROMs/MAME/ROMs;/Volumes/Data/ROMs/MAME/ROMs/CHD;


4/ Configuration Parameters

You can add the same parameters as those found in the configuration files. This option simply allows you to test parameters without modifying your configuration files.

For example, to use a different rendering mode, such as the one from the SDL library

mame -video accel sf2


5/ Even More?

This article is just a small overview of MAME's command-line capabilities. If you want a more exhaustive list, you can always refer to the MAME documentation (in English), which contains all the possibilities.

Related software

Reply on the forum

A question or a hands-on report? Open the discussion on the forum.

Reply on the forum