Command Line Introduction


MAME running from the command line

MAME running from the command line.

MAME running from the command line

MAME running from the command line.


If you want to get the most out of MAME then you should be using the command line. Knowing the command line options will help you with creating custom configuration files and changing the settings in the mame.ini file. The default command line format is...

mame64 <machine> <media> <software> <device> <options>

<machine> is the machine you want to emulate. <media> is the image format that software for the machine is on. <software> is the image file of the software you want to run. <device> is a hardware device that you want to add to the machine. <options> are the commands used to configure MAME. The <media>, <device> and <software> parts are used for mostly non-arcade machines though arcade systems such as the Sega Mega-Tech do support them.

The <options> part of the command line overrides any values stored in ini files that run when you start a machine. You can chain multiple options to a command line as well. A command line with multiple options looks like this...

mame64 <machine> <option-1> <option-2> ...

Some options require an additional argument which contains a value for the option to use. Some arguments can have multiple values which are separated with a semicolon (;) between each one. You can still add extra options after as well if you need to. Options with arguments are formatted like this...

mame64 <machine> <option> <argument>

A command with an option that takes multiple arguments looks like this...

mame64 <machine> <option> <argument>;<argument>

A command with multiple options and an argument looks like this...

mame64 <machine> <option-1> <argument> <option-2>

Most of the command line options are mirrored in the mame.ini file which is where their default values are stored. You can generate a list of the options by typing...

mame64 -showusage

This will show a long list of options that you can add to the command line and a brief description. You can make MAME generate this list into a text file by typing...

mame64 -showusage >usage.txt

The usage.txt file can then be opened in a text editor.

I've arranged the menu on left-hand side in two ways. The first way is arranged by category, listed in ther same order as the -showusage command. It's a bit disjointed in terms of theming the options, but it helps due to similar commands being listed together. The second way is alphabetically which makes it far easier to find specific commands.

Each option is listed in it's own section. Each section will give you the command line option and the equivalent  mame.ini  entry. It also show the reverse command if it is available. The reason that some commands have a reverse command is to override the original setting in the mame.ini file. The argument format at the bottom of each sections tells you the type of value that the argument expects. Here's a list of the different formats...

Argument Format Description
<path> This argument requires a path to a folder. e.g. C:\Mame\roms. Paths with spaces require quotes ("") around them. You can use a semicolon (;) to add extra paths to an option. e.g. -rp C:\Mame\Roms;C:\Mame\CHDs
<boolean> This is an on / off option 1=On and 0=Off. e.g. -readconfig 1
<wildcard> This argument requires a wildcard in the format of %<argument>. e.g. -snapname %g;%i. They are explained on each option.
<integer> This argument requires a whole number input. e.g. 1
<float> This argument requires a number input with a decimal point. e.g. 1.0
<string> This argument requires a text string. If it has spaces then you will need to add quotes ("") around it
<keycode> This argument need a word associated to a keyboard command. e.g. -uimodekey SCRLOCK. These keys code are listed on the Controller Ini page.
<key_code> This argument requires a specific key code associated to the command. They are explained on each option.
<ip-address> This is for arguments that require and IP address and are formatted as <number>.<number>.<number>.<number>. e.g. -comm_localhost 192.168.0.1
<host-name> This argument requires the name of a network host name.
<filename> This argument requires the name of a file. It doesn't require a path as those are already set in the directory options.
<rgb> This argument requires a colour value in rgb (red,green,blue) format. It is formatted in <red value>,<green value>,<blue value>. The values are a decimal percentage of the colour value. e.g. 1.0,1.0,0.75 would give the red and green colours at 100% and the blue colour lower at 75%.
<custom> This argument has a custom set of values. They will be listed on each option.
<slot number> This argument specifies a numbered slot used by save states.