Mame applies any controller cfg files in this way:
That is, it starts with the internal default mame controls (if the default.cfg is empty in cfg folder). It then looks to the cfg file in the ctrlr mame folder (controllerremap .cfg) first for any default and then for specific game controls. It then examines the cfg file in the cfg mame folder (default or game.cfg) for any controls. If there are any controls in the cfg folder's file matching those in the ctrlr folder file, then those in the cfg folder's file take precedence.
The cfg folder file can store things that the ctrlr folder file can't, such as game settings and game use information. Thus, you may want to maintain a cfg file for the game to store these settings. However, it is best to store any player controls solely in the ctrlr folder file (controllerremap .cfg). You can keep an eye on all this via the admin interface.
Lastly, the controllerremap cfg file prioritizes controls within itself. It starts with the default controls and then overlays any game specific controls. For example, in:
When you play xmen, Player 2 controls will be remapped to H,N,B,M from the default of O,L,K,Colon.
Plug in any controllers you are likely to use for the game.
Check the game mame .cfg for any existing controls (see below) and deal with accordingly.
Click “Run Mame” under the “Mame Cfg” tab:
Select the game you want to set up:
Start game and go into admin menu (via Tab usually). Select “Input (this Game)“Important you select this and not “Input (general)” Set up any game controls and also any game controls (video/audio/dip switches etc).
Then open the specific game's mame cfg via MameCfg>Load and selecting the mame gamename:
If you just set game controls, you should see something like this:
Note the “Name” column - this contains the mame name of the game. If you set dipswitches, you may see this:
NB. DON'T transfer dipswitches to the ControllerRemap .cfg.
If there are no gamecontrols or dipswitches set, you'll see something like this:
(This just shows you other settings via the xml + means there will be no 'overmapping' of controls from the mame .cfg over the controllerremap.cfg).
Highlight any controls you want to transfer. Then from the drop-down, select the controller you want to map the mame controls against. (In this case - it's keyboard mappings, so keyboard selected, but obviously if it was something like JOYCODE_1_BUTTON1 you would map this against USB Gamepad 1). Then tick the tockboxes of all the controls you want to transfer. Then click “Transfer”
You will then see these controls within the CtrlRemap tab:
Again, note the “Name” column - this shows your different setups (the default controls and any game specific ones - filterable at the top). If you miss assigning controllers at the transfer stage, the app will let you know if you click “Show Errors”or if you try to “Write”the file with errors. Just assign an alias.. for e.g:
If you want to assign two controls to a mame control, just use the normal means in the mame gui:
the mame .cfg file looks like this (extract):
''<input>'' \\ '' <port tag=":P1" type="P1_JOYSTICK_RIGHT" mask="1" defvalue="1">'' \\ '' <newseq type="standard">'' \\ '' KEYCODE_D'' \\ '' </newseq>'' \\ '' </port>'' \\ '' <port tag=":P1" type="P1_JOYSTICK_LEFT" mask="2" defvalue="2">'' \\ '' <newseq type="standard">'' \\ '' KEYCODE_A'' \\ '' </newseq>'' \\ '' </port>'' \\ '' <port tag=":P1" type="P1_JOYSTICK_DOWN" mask="4" defvalue="4">'' \\ '' <newseq type="standard">'' \\ '' **KEYCODE_S OR JOYCODE_1_YAXIS_DOWN_SWITCH**'' \\ '' </newseq>'' \\ '' </port>'' \\ '' <port tag=":P1" type="P1_JOYSTICK_UP" mask="8" defvalue="8">'' \\ '' <newseq type="standard">'' \\ '' **KEYCODE_W OR JOYCODE_1_YAXIS_UP_SWITCH**'' \\ '' </newseq>'' \\ '' </port>''
ControllerRemapGUI then splits these into separate controls:
Allowing you to transfer whichever controls you wish to the controller remap .cfg.
To check the default.cfg file or specific game files, click Load on the Mame Cfg tab. If there is no .cfg file for the game in the cfg folder, then no worries. If there is you can open it. If you see controls like in the example above- edit these out once transferred. If you see something like this:
All should still be golden as the only things being stored in [game/default].cfg are settings and operation details. You may see this:
As long as it is only dipswitches - you should be OK as these aren't actual game controls.
If your mame cfg is a mixture of controls and info (e.g. screen setups etc) then CRGUI will only show the controls screen. So, don't assume that it only contains controls if you see a layout like that above. If you're needing rto preserve non-control items in your xml, then it's always best to click “edit” to see the full xml. Or, alternatively (as is best practice) to remove all controls from the xml, which will then display the remaining xml in CRGUI (allowing you to see the other info).