Custom Ini Files

The command line version of MAME supports custom settings files which are separate to the mame.ini file. This is of great use if, for instance, you are having performance issues with machines or say want to run certain machines in a window and certain ones in full screen. MAME will create individual config files automatically when you run a machine and save any changes as .cfg file in the C:\Mame\cfg folder. However, this will only affect the specific game and won't necessarily cover all the options available in the mame.ini file such as HLSL settings. Creating custom mame.ini files lets you add these extra options to the machine you want to use as well as other groups of machines too.


.

How ini files work

MAME looks for ini files in it's root folder and it's default ini path which is C:\Mame\ini. These ini files are loaded in a specific order. As each file loads, that files settings are overridden by the settings in the next ini file. For example, if you say that you want all machines to run in a window in the mame.ini file by setting window  1 and then have an ini file for a specific machine with the line window  0, it will override the mame.ini setting and run that machine full screen.

The order that MAME loads ini files is...

Config File Description
mame.ini This is the main MAME configuration file.
debug.ini This file is only loaded in debug versions of MAME.
<screen orientation>.ini These files affect machines that use either vertical or horizontal screens. The filenames are vertical.ini and horizont.ini.
<machine type>.ini These files affect only the machine type specified. e.g. Pacman would come under arcade.ini, whilst ZX Spectrum would come under computer.ini. The filenames are arcade.ini, console.ini, computer.ini and othersys.ini.
<monitor type>.ini These files affect machines with a specific monitor type. The filenames are raster.ini,vector.ini and lcd.ini.
source/<source name>.ini This is an advanced config file, most people won’t need to use it and it can be safely ignored. MAME will attempt to load <source name>.ini from the source folder if it is present. <source name> is the actual filename of the source code file. mame64 -listsource <game> will show the source file for a given game. This setting will affect any machines that are included in the selected source code.
<BIOS>.ini Holds the settings for the BIOS used by the current machine. For example, neogeo.ini will only override settings for Neo-Geo based machines.
<parent>.ini Holds the settings for the parent set of a machine. For example, if you run Pac Man, MAME will look for settings in puckman.ini as that is the parent set of Pac Man.
<machine>.ini Holds the settings for the current machine. If you look at the above example, pacman.ini will override any settings in puckman.ini

An important thing to remember is that any options you add to the command line will override any settings stored in ini files.


.

Ini File Structure

To find out which ini files affect a machine, you need to use the -listxml option to your command line. For example, mame64 mslug -listxml will generate all the information from Metal Slug in XML format. Here are the important parts that you are looking for...

<MAME build="0.220 (MAME0220)" debug="no" MAMEconfig="10">
<machine name="mslug" sourcefile="neogeo.cpp" romof="neogeo">
<description>Metal Slug - Super Vehicle-001</description>
<year>2015</year>
<manufacturer>Nazca</manufacturer>
<biosset name="euro" description="Europe MVS (Ver. 2)"/>
<display type="raster" rotate="0" />

The machine name is mslug which means that it will be affected by mslug.ini. neogeo is the source file name so adding a source/neogeo.ini file will affect all the games in the Neo Geo driver.

You can also tell that this machine requires a BIOS as it has the biosset option. All you have to do is check the romof option to find the BIOS name which in this case is neogeo. Once you have the BIOS name, you can create a file called neogeo.ini which will affect all the machines that use the Neo-Geo BIOS. If this machine is a clone ROM set, you will see the option cloneof. The machine listed here is the parent set and you would need to check the romof section in that machines XML file to find the correct name of the BIOS file used (if you don't already know it).

The <display> line contains the last two ini names. type="raster" determines that this machine is affected by raster.ini and rotate="0" determines that this machine is also affected by horizont.ini. The number is the angle of the screen therefore, 0 and 180 are horizontal and 90 and 270 are vertical.

The only ini file name that you can't find in the XML file is the <machine type>.ini. For this ini file you just need to add what kind of machine it is. Metal Slug is an arcade machine so would be affected by arcade.ini.


.

Creating Ini Files

All settings files are based on the mame.ini file that is created when MAME starts. There are two ways of creating ini files. The first way is to simply duplicate the original mame.ini file and remove/change the stuff you don't want. The other way is to use the command line option -writeconfig. Here's an example...

mame64 puckman -writeconfig

This command will create an ini file called puckman.ini in the root folder for MAME. You can keep it there or move it to the C:\Mame\ini folder.

To make a duplicate of the mame.ini file, open your current MAME folder and find the mame.ini file. It'll look something like this...


mame.ini File

mame.ini File

mame.ini File

mame.ini File


Right click on the file and select "Copy" from the menu. Now right click on a blank area and select "Paste" and you will see a file MAME - Copy.ini appear. Right click over this file and select "Rename". In the box type the name of the configuration filetype that you want to create. If for example it is an arcade game such as Pole Position you would need to match the filename of the rom zip file e.g. Pole Position (Atari) = polepos1. Use the table below if you need any more information.

MAME will always look for config files in it's root path but you can keep things a lot tidier if you move your new config file to the ini folder. The default path for this would be C:\Mame\ini. MAME will look there as well. Double click your config file and it should open up in Notepad. Below you can see the default mame.ini file...

As you can see most of the lines mimic the command line options use by MAME and you can find detailed explanations of these commands on the Command Line page. Lines starting with # are comments and are ignored by MAME.

Remember no matter what changes you make, you can't permanently mess up MAME. If you make a mistake, just change the setting back or delete the config file and start again.


.

Custom Ini Example

Here is an example of a config file that I have made up for Star Wars...

#
# MY STAR WARS OPTIONS
#
mouse          1
skip_gameinfo  1
ui_mouse       0
window         1
maximize       0
hlsl_enable    1

This ini file starts Star Wars with the mouse enabled, in a window and with HLSL post-processing.

Once you are happy with your settings, save the ini file, run MAME and it will use your new settings.