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
Site News

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


  

Author Topic: MAME XML Shrinker  (Read 695 times)

0 Members and 1 Guest are viewing this topic.

the_77x42

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
MAME XML Shrinker
« on: May 04, 2018, 06:58:56 am »
I use AdvanceMENU Plus for my front end. My cabinet is over ten years old, so I need something extremely lightweight and this front end does a fine job. Unfortunately, with a full MAME set, loading the front end can take a solid ten seconds as it parses the mame.xml file. The Windows command line below will only output the relevant lines. The result is a mame.xml that is roughly a quarter the size, which means the front end loads about four times as fast.

Thanks to Robbbert below who came up with the original script!

Code: [Select]
findstr /L /I "<mame <machine <description <year <manufacturer <display <input <control <driver <device[^_] </input </machine </mame" mame.xml > mame-compact.xml

FINAL EDIT: The latest master branch of AdvMenu Plus automatically shrinks the mame.xml file after it generates it. I'll leave the script up for any other future front ends.
« Last Edit: May 09, 2018, 11:47:08 am by the_77x42 »

DaredevilDave

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 181
  • Yes, I really am still working on it!
Re: MAME XML Shrinker
« Reply #1 on: May 08, 2018, 01:06:14 am »
That's pretty cool. I ended up making my own frontend and decided not to even use mame.xml because it is so huge - I only have 300+ games as of now so I made all my own stuff.

Thanks for sharing this. I will use it at some point because I do want some bigger collections and will use other frontends for that.  :cheers:
"Computer Space" (1st coin-op game ever) for MAME Front Ends Available Now!
http://forum.arcadecontrols.com/index.php/topic,155041.0.html

My Custom Motorcycle Cabinet Build For Custom Game (Daredevil Dave):
http://forum.arcadecontrols.com/index.php/topic,151106.0.html

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1426
  • Web Developer.
Re: MAME XML Shrinker
« Reply #2 on: May 08, 2018, 06:33:59 am »
Surprised it doesnít parse the xml file once and store needed data in a csv file or SQLite database.

Iím sure people will use your tool.

Robbbert

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 76
Re: MAME XML Shrinker
« Reply #3 on: May 08, 2018, 10:30:48 am »
I use a batch file to pull out what I need.

It has one line, and assumes you've already piped the xml to a file called xml.txt

The output of the filtering process writes the new info to xml2.txt

Code: [Select]
findstr /L /I "<mame <machine <description <disk <rom <sample <driver </machine </mame" \xml.txt > \xml2.txt

the_77x42

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
Re: MAME XML Shrinker
« Reply #4 on: May 08, 2018, 11:41:23 pm »
I use a batch file to pull out what I need.

It has one line, and assumes you've already piped the xml to a file called xml.txt

The output of the filtering process writes the new info to xml2.txt

Code: [Select]
findstr /L /I "<mame <machine <description <disk <rom <sample <driver </machine </mame" \xml.txt > \xml2.txt

Excellent idea! I've modified it a bit so it works with the latest version of AdvMenu Plus and updated the main post. Thanks!
« Last Edit: May 09, 2018, 03:59:28 am by the_77x42 »

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31