Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Saving analog settings?  (Read 1406 times)

0 Members and 1 Guest are viewing this topic.

Brad Lee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:May 26, 2005, 11:39:04 am
    • 666
Saving analog settings?
« 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

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:April 28, 2025, 12:29:02 am
Re:Saving analog settings?
« Reply #1 on: March 13, 2003, 01:28:19 am »
Yeah I don't know why the ctrlr files don't support the Analog settings... :(

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Saving analog settings?
« Reply #2 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)
  • ctrlr/ini files are new,
  • mame has better support for digital inputs than analog inputs,
  • the settings are currently saved in cfg/cfg files, which vary in layout game to game, and sometimes mame version to mame version for each game, and
  • setting a global player1 sensitivity, ect, can screw as many games as it helps, since mame needs to translate mame's internal -128 to 128 analog range to the game's internal range (which varies from game to game).
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
Robin
Knowledge is Power

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:April 28, 2025, 12:29:02 am
Re:Saving analog settings?
« Reply #3 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.

PacManFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:December 06, 2005, 12:18:56 pm
    • Kymaera Home Page
Re:Saving analog settings?
« Reply #4 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
All Hail Smezznar! The Giant purple centipede of Omnicron 5. Regail him with your odiferous offerings of onion powder!

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Saving analog settings?
« Reply #5 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. :-\ ;)
Robin
Knowledge is Power