The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: Brad Lee on March 13, 2003, 12:47:11 am

Title: Saving analog settings?
Post by: Brad Lee on March 13, 2003, 12:47:11 am
Is there any way to save/set default settings for games with analog controllers? Once I fiddle with the speed & sensitivity for a game it saves that, but every time I play a different game I need to set the analog options again

If not, there should be..

I'm open to any builds or frontends- mame32, mame, advancemame/menu, ctrlr files, cfg's, ini's, whatever
Title: Re:Saving analog settings?
Post by: Jakobud on March 13, 2003, 01:28:19 am
Yeah I don't know why the ctrlr files don't support the Analog settings... :(
Title: Re:Saving analog settings?
Post by: u_rebelscum on March 13, 2003, 02:19:11 am
Is there any way to save/set default settings for games with analog controllers? Once I fiddle with the speed & sensitivity for a game it saves that, but every time I play a different game I need to set the analog options again

If not, there should be..

I'm open to any builds or frontends- mame32, mame, advancemame/menu, ctrlr files, cfg's, ini's, whatever

It's been requested before.  I agree it would be nice to be able to set them in the ctrlrl/ini.

Reasons it's not included (yet)The last reason seems to be official reason (and a good one, too) mame hasn't done it yet.  The second to last one has been why FE's haven't tackled it.

BTW, this is on analog+'s ToDo list, but not actively worked on.  I will try include it at some point, or if you can't wait, if someone else writes it up for me.  ;D
Title: Re:Saving analog settings?
Post by: Jakobud on March 13, 2003, 02:09:20 pm
I'm wondering why no one has ever made any sort of mame cfg file parser program so people could adjust cfg files on the fly without having to open Mame and do it by hand.
Title: Re:Saving analog settings?
Post by: PacManFan on March 13, 2003, 02:32:26 pm
I'm wondering why no one has ever made any sort of mame cfg file parser program so people could adjust cfg files on the fly without having to open Mame and do it by hand.

That's what I'm working on, I hope to support both ctrlr files and INI file, and be able to batch create them based. I'm doing this to support the issue discussed a week ago about alternating/nonalternating player1 / player2 controls.

-PacManFan
Title: Re:Saving analog settings?
Post by: u_rebelscum on March 13, 2003, 05:25:54 pm
I'm wondering why no one has ever made any sort of mame cfg file parser program so people could adjust cfg files on the fly without having to open Mame and do it by hand.

That's what I'm working on, I hope to support both ctrlr files and INI file, and be able to batch create them based. I'm doing this to support the issue discussed a week ago about alternating/nonalternating player1 / player2 controls.

-PacManFan

Are you working on ctrlr/ini, ini/ini, and cfg/cfg files,  or just ctrlr/ini and ini/ini files?  (He's asking about cfg/cfg files.)


(FWIW) About cfg/cfg files:
How to read/write these files can be found in src/inptport.c/h. You would need to get the layout of each cfg file from the drivers in src/drivers order to be able to construct that game's cfg file.  Since drivers can change between versions of mame, you would need an update each version of mame.  (Off top of my head, easiest way would be to have a second parser that graps the needed info off the driver source files and puts it in a dat type file.)  If the cfg/cfg file already exists, you might be able to get away without the driver info if you parse correctly (without game specific error checking, though).

general cfg file layout:
header (8 char)
number inputs (int)
[game's driver default input settings]*
[game's current input settings]*
[other stuff]


If default.cfg, all mame inputs are saved; if game.cfg, only the inputs the game uses are saved.

input settings format:
input type (int)
input mask (word)
default value (word)
[sequence of key/joy/mouse set as the inputs]


sequence format:
number inputs (word)
"savecode" of input (int)*


input type includes info such as button1, AD_stick, or lightgun; player #; center, reverse, 8way, or other flags; and (for analog inputs) sensitivity, joy/key speed, min and max.

input mask is a mask showing which bits in the game memory will be changed.

Items with * at the end mean 0 up to a max (but not always) of 256 repetitions of that thing.  Items listed between [] mean that item is a collection of info.
Not that hard, huh?  I've thought about making a cfg parser (obviously), but the ctrlr/ini files do one of the major reasons for a cfg/cfg parser (map inputs to game ports).  Plus, I'm lazy and analog+ is enough for me ATM. :-\ ;)