1Multiple Configuration Files
2============================
3
4MAME has a very powerful configuration file system that can allow you to tweak settings on a per-game, per-system, or even per-monitor type basis, but requires careful thought about how you arrange your configs.
5
6.. _advanced-multi-CFG:
7
8Order of Config Loading
9-----------------------
10
111. The command line is parsed first, and any settings passed that way *will take
12   precedence over anything in an INI file*.
13
142. ``mame.ini`` (or other platform INI; e.g. ``mess.ini``) is parsed twice.  The
15   first pass may change various path settings, so the second pass is done to
16   see if there is a valid configuration file at that new location (and if so,
17   change settings using that file).
18
193. ``debug.ini`` if the debugger is enabled.  This is an advanced config file,
20   most people won't need to use it or be concerned by it.
21
224. Screen orientation INI file (either ``horizont.ini`` or ``vertical.ini``).
23   For example Pac-Man has a vertical screen, so it loads ``vertical.ini``,
24   while Street Fighter Alpha uses a horizontal screen, so it loads
25   ``horizont.ini``.
26
27   Systems with no monitors, multiple monitors with different orientations, or
28   monitors connected to slot devices will usually load ``horizont.ini``.
29
305. System type INI file (``arcade.ini``, ``console.ini``, ``computer.ini``, or
31   ``othersys.ini``).  Both Pac-Man and Street Fighter Alpha are arcade games,
32   so ``arcade.ini`` will be loaded here, while Atari 2600 will load
33   ``console.ini`` as it is a home game console.
34
356. Monitor type INI file (``vector.ini`` for vector monitors, ``raster.ini`` for
36   CRT raster monitors, or ``lcd.ini`` for LCD/EL/plasma matrix monitors).
37   Pac-Man and Street Fighter Alpha use raster CRTs, so ``raster.ini`` is loaded
38   here, while Tempest uses a vector monitor, so ``vector.ini`` is loaded here.
39
40   For systems that have multiple monitor types, such as House Mannequin with
41   its CRT raster monitor and dual LCD matrix monitors, the INI file relevant to
42   the first monitor is used (``raster.ini`` in this case).  Systems without
43   monitors or with other kinds of monitors will not load an INI file for this
44   step.
45
467. Driver source file INI file.  MAME will attempt to load
47   ``source/``\ *<sourcefile>*\ ``.ini`` where *<sourcefile>* is the base name
48   of the source code file where the system driver is defined.  A system's
49   source file can be found using **mame -listsource <pattern>** at the command
50   line.
51
52   For instance, Banpresto's Sailor Moon, Atlus's Dodonpachi, and Nihon System's
53   Dangun Feveron all run on similar hardware and are defined in the
54   ``cave.cpp`` source file, so they will all load ``source/cave.ini`` at this
55   step.
56
578. BIOS set INI file (if applicable).  For example The Last Soldier uses the
58   Neo-Geo MVS BIOS, so it will load ``neogeo.ini``.  Systems that don't use a
59   BIOS set won't load an INI file for this step.
60
619. Parent system INI file.  For example The Last Soldier is a clone of The Last
62   Blade / Bakumatsu Roman - Gekka no Kenshi, so it will load ``lastblad.ini``.
63   Parent systems will not load an INI file for this step.
64
6510. System INI file.  Using the previous example, The Last Soldier will load
66    ``lastsold.ini``.
67
68
69Examples of Config Loading Order
70--------------------------------
71
72* Brix, which is a clone of Zzyzzyxx. (**mame brix**)
73
74  1. Command line
75  2. ``mame.ini`` (global)
76  3. (debugger not enabled, no extra INI file loaded)
77  4. ``vertical.ini`` (screen orientation)
78  5. ``arcade.ini`` (system type)
79  6. ``raster.ini`` (monitor type)
80  7. ``source/jack.ini`` (driver source file)
81  8. (no BIOS set)
82  9. ``zzyzzyxx.ini`` (parent system)
83  10. ``brix.ini`` (system)
84
85* Super Street Fighter 2 Turbo (**mame ssf2t**)
86
87  1. Command line
88  2. ``mame.ini`` (global)
89  3. (debugger not enabled, no extra INI file loaded)
90  4. ``horizont.ini`` (screen orientation)
91  5. ``arcade.ini`` (system type)
92  6. ``raster.ini`` (monitor type)
93  7. ``source/cps2.ini`` (driver source file)
94  8. (no BIOS set)
95  9. (no parent system)
96  10. ``ssf2t.ini`` (system)
97
98* Final Arch (**mame finlarch**)
99
100  1. Command line
101  2. ``mame.ini`` (global)
102  3. (debugger not enabled, no extra INI file loaded)
103  4. ``horizont.ini`` (screen orientation)
104  5. ``arcade.ini`` (system type)
105  6. ``raster.ini`` (monitor type)
106  7. ``source/stv.ini`` (driver source file)
107  8. ``stvbios.ini`` (BIOS set)
108  9. ``smleague.ini`` (parent system)
109  10. ``finlarch.ini`` (system)
110
111*Remember command line parameters take precedence over all else!*
112
113
114Tricks to Make Life Easier
115--------------------------
116
117Some users may have a wall-mounted or otherwise rotatable monitor, and may wish
118to actually play vertical games with the rotated display.  The easiest way to
119accomplish this is to put your rotation modifiers into ``vertical.ini``, where
120they will only affect vertical games.
121
122[todo: more practical examples]
123