Cfg files are created by MAME to store machine specific information not contained in an ini file. This could be information such as DIP switch settings all the way through to custom key settings. MAME cfg files are stored in XML format and can be edited in a text editor.
There are just too many variables to create your own cfg file due to the complexity and diversity of machines that MAME emulates. MAME will automatically create a cfg file when you run a machine and save it in the C:\Mame\cfg
folder. Most settings you change in the machine config menus will be saved in a file named after the machine you are running when you close MAME. For example, Run Star Wars and insert a coin to play, MAME will save a cfg file called starwars.cfg
in the C:\Mame\cfg
folder. This will have a line that says <coins index="0" number="1" />
which basically says that you have inserted one coin. This is the config file that MAME created for Star Wars whilst I've been writing this guide.
As you can see, it says I've run the machine 14 times and the last artwork used was the Hausjam_Artwork. These settings will be loaded every time I play Star Wars from now on unless I change any of them on the machine config menus. If I do change a setting, then a new cfg file will overwrite the old one with the new settings when I close MAME.
The only real problems for cfg files come if you mess up the settings in MAME and can't get back into the menus and change them back. For example, say I've been messing around with the keyboard settings for MAME and changed the UI configure key. I come back a few weeks later and I've forgotten which key I selected and now I can't get back into the config menus to change it back.
There are two ways to deal with this problem. Because the setting is related only to MAME, not a machine, it is stored in a file called default.cfg
which is stored in the C:\Mame\cfg
folder. Now, the easiest way to fix this is to delete the default.cfg
file. MAME will just create a new one when it runs again. The other way is to edit out the problematic entry in a text editor.
The first issue you will face is that Windows wont open a .cfg
file just by clicking on it. Click it and you'll get this...
If you click where it says "More apps " and click Notepad, Windows will default any files ending in .cfg
to the Notepad application. If you don't want this to happen then untick "Always use this app to open .cfg files". You could also just open Notepad from the Start Menu and open the default.cfg
file in the C:\Mame\cfg
folder.
Once you have opened up the default.cfg
file you'll see something like this...
As you can see, I've changed a few key settings. The first is the player one start button, which I am happy with. The problem lines are the ones for the UI_CONFIGURE
which is the key used to open MAME's config menus. The section says that I changed the config menu key to Left-Alt. This is shown by the line KEYCODE_LALT
. To delete this entry it's not as simple as just deleting the line, you need to delete the whole entry.
XML has a structure to it. An entry will start with a <name> and end with a </name>. To delete the wrong key code we need to delete the <port>
entry for UI_CONFIGURE
. To do this you would delete from <port type="UI_CONFIGURE">
through to the next </port>
entry. Once done, save the file and that's it. When MAME next loads, the config menu key will be back to Tab.
This method is not just for problems. You could, for instance, reset the coin counter or change the default view for the game without loading MAME.