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: Permanently saving Mame ini/cfg for Aimtrak (and indeed all controls)  (Read 7304 times)

0 Members and 1 Guest are viewing this topic.

EssexMame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 472
  • Last login:May 20, 2025, 09:13:39 am
  • Mame Weekender
In Mame Tab menu, where do the Input (General) and Input (This Game) settings get saved once you exit the current game?

I have cfg files for each game it seems, but no ini for each game (auto save is turned off in mame.ini) at present. Is .ini replaced by .cfg in later mame anyway (I'm on 0.149 with hiscore/nonag compile).

I want to set the Input (General) so that the keys/controls are the same in each and every game - including lightgun settings where games have/work with a lightgun or use a positional gun and I set Analog X accordingly. I have all this working BUT it doesn't seem to save so I need to set it each time.

I don't want to overwrite/start again by deleting the current .cfg files for each game as I have other per-game settings which were saved successfully - such as Rotate 90 degrees for Vertical games or brightness increase changes on some vector games. There may be others, and that's the point, I don't recall them all and don't want to have to start again. I also don't want to set each game individually to add lightgun/joystick controls if at all possible where the Input (General) could/should do it.

For example, on changing the "Input (General)" settings to add Aimtrak Lightgun for Lightgun X Analog/Y Analog. The Buttons are saved and persist (button 2 on gun being mapped to P1B1 in the Aimtrak config utility) but the lightgun movement is not saved. Is it/should it be saved to the cfg file for the overall settings but is then overidden by .cfg for the individual game (Input (This Game) essentially?

Should I have the "save ini on exit" (or whatever its called) set so that it will save the settings? Or is .ini in this case replaced by .cfg for each game or do you need both?

pfcwintergreen

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:October 10, 2014, 10:26:44 pm
  • I want to build my own arcade controls!
Re: Permanently saving Mame ini/cfg for Aimtrak (and indeed all controls)
« Reply #1 on: March 03, 2014, 02:14:12 pm »
I'm at work so I can't reference my actual Mame files, but I've had problems like this and I know roughly how it works. I also use an aimtrak gun.

FYI If I remember correctly, "Input (General)" controls get saved to CFG/default.cfg, and "input (this Game)" controls get saved to CFG/[game-name].cfg

There are two main problems with the mame key/axis binding system imo, one or both may be happening to you:

#1:) Mame enumerates joysticks and mice each time you run the executable, and if you have plugged or unplugged usb devices, or restarted your computer, anything you have bound in mame involving a joystick or analog axis may no longer be valid. For instance, if you set up an axis in mame it might report to you that you have set it to "JOY 2 -XAXIS". The next day, you might discover it no longer works. You rebind the axis, and this time mame will tell you it is "JOY 1 -XAXIS".. even though you are using the exact same controller. Joysticks numbers in mame will change with any change to usb devices, and even after a windows restart. It is extremely frustrating. :badmood: Keyboard keys are not affected by this, so any opportunity you have to use a keyboard button(ipac etc) instead of an axis is one you should take if you want universal controls. Obviously, for aimtrak this is not an option.

One solution to this problem is to never plug or unplug usb controllers of any kind, and never change the ports/hubs you may have them connected to. And just pray that Windows reports them to mame in the same order each time...which it usually will, but not always  :banghead:, if like I said if you never change any of your usb ports.

The best solution to this is some software called ContollerRemap for mame. It is a pain to setup(involves manual xml file editing), but once your done it solves this problem permanently:
http://forum.arcadecontrols.com/index.php?topic=108767.0




#2:) The other issue is that if you EVER re-map a key in "Input (this game"), Mame will never let you revert back to the default "Input(general)" until you manually go in and delete the cfg/[game-name].cfg file. Even if you go into "Input (this game)" and delete the key you just binded so it says "none", mame will not default back to the "general" keys you set until you delete the file.  You might be able to go into the cfg/[game-name].cfg file and try to delete the specific binding that conflicts, but the only reliable way I've found is delete the file.

Summing it all up; the only way I was able to use a universal set of controllers/axes for all games(including light gun) was to use ControllerRemap, and to never set anything in "Input (this game)". If there is any easier way, I'd love to hear it.

Anyways..hope that helps at least a little bit.
« Last Edit: March 03, 2014, 02:15:55 pm by pfcwintergreen »

EssexMame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 472
  • Last login:May 20, 2025, 09:13:39 am
  • Mame Weekender
Re: Permanently saving Mame ini/cfg for Aimtrak (and indeed all controls)
« Reply #2 on: March 04, 2014, 05:12:15 am »
Thanks! On #2, I've removed all my .cfg and set the default.cfg (input general) to have the lightgun setting. That's solved the problem!

I'm not plugging/unplugging so it shouldn't be an issue as long as it stays plugged in. I do notice my PS controllers (into 1 USB port together) switch from Player 1 to Player 2 but not really a problem - I'd just swap controller with player 2 :-) I'll keep an eye out as it develops though - extra controllers may cause the issues you've had.