MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

Typhon
MAME Fan
Reged: 02/18/17
Posts: 24
Send PM


Changing system specific controls from default.cfg
#363749 - 02/22/17 11:31 AM


I don't have a toggle autofire button mapped to my gamepad, since some arcade games actually use most or all of the buttons.

However, for TurboGrafx16 for example, I'd like to map a toggle autofire button to L2 on my Xbox 360 gamepad. Is there a way to do this, without altering the main default.cfg file?

I've figured out already that tg16.cfg is the go to file for "This game" alterations. But 'toggle autofire' isn't something you can change from that menu.



Typhon
MAME Fan
Reged: 02/18/17
Posts: 24
Send PM


Re: Changing system specific controls from default.cfg new [Re: Typhon]
#363750 - 02/22/17 12:05 PM


Awesome, you can totally do this it seems.

Did some playing around. You have to specify a file from the # CORE INPUT OPTIONS (the 'ctrlrl' line) of your mame.ini (or in my case, the horizont.ini since I have a separate config file for horizont games - I prefer stretch to screen display on those).



You can easily create a ctrlr file by copying the 'default' file that gets created (in your cfg folder) after you map all of your controls, and copying it to your 'ctrlr' folder. I'm not sure if this is the 'right' way to do this but it works. And there is also one distinct advantage to doing this. If you map multiple controllers, MAME will erase all the data for every controller that isn't plugged or turned on the next time you load MAME. Only way around this is to change the default.cfg file to 'read only.' But if you have a file in your 'ctrlr' folder, and point mame to it (as specified above), mame will look there first, then *override* any of those settings with whatever is in your default.cfg.



It's brilliant really. You can make changes this way to your default.cfg, and the changed entries (from your file in the 'ctrlr' folder) will be grey instead of white. You can then choose to delete that file altogether, and you will still have all of your default settings from the 'ctrlr' folder.

But back to the main objective.

If you open up your ctrlr file, you will see xml data. All you have to do really is copy everything between the lines "system name="default"" and /system, paste it, then change the system name for the new section you've just created to whatever you need it to be. In my case, it would be system name="tg16".

From there you just need to edit entries for whatever you need changed from the section. In my case, I needed to change the "toggle_autofire" section. So I changed:

port type="UI_TOGGLE_AUTOFIRE"

newseq type="standard"

KEYCODE_F7

/newseq

/port



to



port type="UI_TOGGLE_AUTOFIRE"

newseq type="standard"

JOYCODE_1_ZAXIS_POS_SWITCH

/newseq

/port



Everything is working as expected.

I hope this helps someone. I have a tendency to ask questions and then answer them later on because I have OCD until I figure something out, and my reasoning is, someone else will probably have a similar problem later on and google this page.


Edit: And after further testing, any subsequent alterations, e.g. you added a system name="tg16" section, you only need to add entries that are going to be different from the system name="default" section. They simply work as "overrides" (kinda like the way RetroArch works).

Edited by Typhon (02/22/17 12:59 PM)


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 21 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1427