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: MAME Config Generator Plugin  (Read 994 times)

0 Members and 1 Guest are viewing this topic.

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1957
  • Last login:December 02, 2024, 11:39:12 pm
MAME Config Generator Plugin
« on: November 06, 2024, 12:46:18 pm »
https://github.com/Jakobud/configgenerator

I made this plugin for MAME recently. Posting it here for posterity.

This plugin will generate .cfg files for your games. Similar to the ones that MAME already generates but they are "improved". When you exit a MAME game, MAME generates a .cfg file for the current values of the controls and dipswitches for that game.

The only problem is that it only records non-default values into the .cfg file. For example if you open a game and leave all controls at default and then exit it will generate a .cfg file but it will be mostly empty because all the controls and dipswitches are still at their default values.

This plugin I made will generate a similar .cfg file but it will include all values and all dipswitch values whether or not they are default or if you have customized them.

This plugin will also take into account if you have specified a CTRLR file to use. For example if you override controls using a CTRLR file, the .cfg generated by my plugin will use those CTRLR values when creating the .cfg file. This is something MAME does not do with it's .cfg files.

This plugin can also output the .cfg files to a custom directory and generate them when the game starts or ends or both.

Anyways, this plugin is most likely useless to 99% of the MAME community but could be useful when paired with tools like CFG Magician or LEDBlinky. Or maybe there is some other way someone could utilize it. Just posting it here to create visibility of it.

Cheers,

Endaar

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 154
  • Last login:December 02, 2024, 07:24:55 pm
Re: MAME Config Generator Plugin
« Reply #1 on: November 17, 2024, 11:17:11 pm »
This seems super useful, but unfortunately I can't seem to get it to work on MAME 271. The plugin shows up, I have it enabled, and I can see via Sysinternals Process Monitor that the lua files are being accessed. Nothing happens though, and the cfg files that get written out are exactly the same as if the plugin was disabled. Any suggestions? Happy to do some troubleshooting/debugging if I can help in any way.
Thanks,
Endaar

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1957
  • Last login:December 02, 2024, 11:39:12 pm
Re: MAME Config Generator Plugin
« Reply #2 on: November 18, 2024, 05:13:50 pm »
What directory are you looking for the new cfg's? The default directory is "cfg_generated". So it would be:

c:\path\to\mame\cfg_generated\pacman.cfg

You can change the path to something else in the settings file.

Endaar

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 154
  • Last login:December 02, 2024, 07:24:55 pm
Re: MAME Config Generator Plugin
« Reply #3 on: November 18, 2024, 06:48:18 pm »
Ugh...chalk this up to user error on my part. I totally missed the output directory, despite even reading through the code. I guess that's what happens after fighting with a cabinet for an entire day!

In any event, thank you for this utility. It's going to be extremely helpful.

Endaar

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1957
  • Last login:December 02, 2024, 11:39:12 pm
Re: MAME Config Generator Plugin
« Reply #4 on: November 20, 2024, 10:36:37 am »
No worries! The plugin is a bit confusing on what it does or how it works.

Also you can set the cfg_directory to "cfg" and will overwrite whatever .cfg files MAME generates. But there could be some race conditions involved when exiting a game. When you exit a game mame creates the cfg but then the plugin is also trying to create another cfg in the same directory with the same name. Could be some unexpected results there depending on which process finishes first. Not sure about that one.

Honestly it would be nice if the MAME dev's added in an option to fully generate .cfg files with all default values in them (thus eliminating the need for the plugin).