-
Notifications
You must be signed in to change notification settings - Fork 0
4. Understanding QMC2's Configuration
This chapter contains important information about how QMC2 handles the emulator configuration internally and how the QMC2 configuration relates to MAME external configuration(s).
When QMC2 launches an emulator, it will pass all the configuration parameters that are different than their respective defaults as command line arguments.
QMC2 uses a so-called emulator configuration template - an XML template file loaded into a map (dictionary) of emulator options - to support all available settings it knows about. Options which are not included in the template will not be available via QMC2 (though it can be easily enhanced with additional options). We are trying to keep up with the supported emulators and their latest versions; keep an eye on the template version reported in the front end log to make sure you're using an up to date configuration template. It uses the same versioning pattern as the emulator it supports.
Tip
If you use QMC2 for configuring MAME, there is no need for any external configuration files like ~/.mame/mame.ini (in case of MAME for example).
If you would like to avoid any accidental mixture with external configuration files (mame.ini, <machinename>.ini, ...), you should set the value of readconfig to false (0). If this has been set, QMC2 will fully control the emulator configuration. From within QMC2, existing external configuration files will be ignored. As this is not the default configuration, you must set this setting manually here:
That said, it is still possible to use external configurations (and thus **support unknown options **out of the box). In fact, if you would like to **use only external configuration files and not let QMC2 configure **the emulators at all, just **leave all emulator settings at their default values within QMC2 **(both the global and the machine-specific ones -- see below). There's one exception, though: depending on your specific installation, you will most likely have to setup the (global) inipath parameter within QMC2 to make sure your ini's are found. Anyway, you will have to take care of these configuration files yourself, of course.
The value of readconfig should be set to true (1) in this case, which is the default.
You can also mix both approaches, but note that the command line options (= settings made with QMC2) have higher precedence!
Note that QMC2 would usually not pass any options to the emulator (through the command line) that are set to their default values, but since these options may still be part of some ini file(s) with conflicting / unwanted values, you can change this behavior by activating an option's enforce default switch which will cause QMC2 to pass the option with its default value.
Another option is to make use of QMC2's ability to import and export emulator configuration files. Exported configurations will contain all available (known) options, regardless if they are at their default values or not. Settings imported from configuration files will overwrite those currently set in QMC2 selectively (that is, only options that are included in the imported file will be changed).
Warnings:
- The export function will blindly overwrite any existing configuration files (create backups!).
- The import function assumes a clean configuration syntax and may not be fail safe on malformed ini's (it's a fairly simple parser).
However, using this feature you are able to keep both worlds in sync and launch the emulators in the exact same way regardless if started via QMC2 or at the command line. It also provides an easy way to exchange machine settings between users and systems.
The global emulator options are used for all machines, which is obvious :). If a value is changed from its default (defined in the template) QMC2 will pass it to the emulator.
The same basically holds for any machine-specific options. The only difference is that if a setting has been made in the global configuration, this will be used as the new default.
For example, if you set flicker to 1.0 (default: 0.0) in the global settings, and to 2.0 in the machine-specific settings, -flicker 2.0 will be passed to the emulator. Any machine for which the flicker value hasn't been explicitly set will be called with -flicker 1.0.
QMC2 uses two emulator configurations for each machine: the global setup and the machine-specific one. The global setup acts as a default configuration for all machines, whereas the machine-specific (or local) configuration may overwrite individual settings for the respective machine.
When you launch a machine or edit its configuration, QMC2 will process all settings in this hierarchical manner (global -> local) and thus open the configuration for the machine in question. It will be kept open until you select a different machine or change the machine-specific settings of another machine (which in this case will be opened instead of the previous machine).
Now, when you change the global emulator configuration while a machine-specific setup is currently open, you will have to decide what to do, because this will change the global defaults. QMC2 will ask you whether to keep the local setup as it is or to overwrite the local setup with the changed global defaults (or to revert the changes made -- don't apply). If unsure, answer with overwrite, because this is most likely what you are aiming to achieve :).
All emulator configurations -- both global and local -- will be saved in the user's QMC2 settings file (usually ~/.qmc2/qmc2.ini or ~/Library/Application Support/qmc2/qmc2.ini on Mac OS X) below the [<emulator>] section ([MAME] in case of MAME for example). See Configuration/Global/... for global settings and Configuration/<machinename>/... for machine-specific ones. Following the above guidelines of the hierarchical configuration scheme, only settings that are different than the respective default will be stored.
All emulator settings are stored in QMC2's configuration file (qmc2.ini) - see the section for your emulator (for example the [MAME] section). Only options which were changed from their defaults get stored. QMC2 uses long option names which are compatible between command line and configuration files (i. e. scalemode and not sm).
You can pre-configure system-wide overwrites for any template-based defaults by storing them in /etc/qmc2/qmc2.ini on Linux/UNIX, or /Library/Application Support/qmc2/qmc2.ini on Mac OS X. System-wide pre-configuration is not supported (and not required) on Windows.