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: Has someone mcm.ini and mame.xml (and controls.dat) combined?  (Read 2558 times)

0 Members and 1 Guest are viewing this topic.

MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
I want to display info about games in my front-end. I want to display 'manufacturer', 'year', 'catagory', 'sub catagory', 'button X info', 'additional info about game' and be able to filter on some.

This information seems not to be available in one file. I did a search here as well with mr. Google to find out if someone ever did combine the info from MCM.INI and MAME.XML and CONTROLS.DAT, but to no succes. Actually I can't really imagine that this has not been done yet. :dunno

Maybe there is someone that has done this allready? ;D

If not, well, I have to do it myself. To be honest, I have done some stuff myself allready (because of the above).

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:38:27 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #1 on: March 22, 2007, 01:55:05 pm »
I mean no offense, but it hasn't been done because it's a dumb idea. 

Adding all of that info to a single file would result in a HUGE file.  What we (and by we I mean fe developers and emu app developers) do is read all the files seperately and combine data on the fly when it's displayed.  Most front-ends already do this.  Dk, for example, can display all of that, save controls.dat and filter it out exactly like your are saying.  The only reason controls.dat isn't supported is the last public release pre-dates the dat and it'll be added later. 

A note on MCM though... it's a rather useless file imho, with the exception of a quick file sort.  What you do is get a copy of catver.ini and filter off all games with the *mature* flag tacked on.  It's more work, but you get the same results and have the added benefit of filtering by regular genres as well. 

MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #2 on: March 22, 2007, 02:19:23 pm »
that figures! ::)

Well thanks anyway for the insight. Then I'll just read 'em seperately and join the whole bunch in memory.

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #3 on: March 23, 2007, 10:50:42 am »
I can actually see this as being a useful thing (at least controls and mame's xml).

For my own pet project, ROMLister, controls.dat has some really useful information, but it lacks the screen orientation data that I also use.  Currently, ROMLister opens either of the 2 files, and you get to work with whatever data is inside each.  Having them combined into 1 file would (for me) be the best of both worlds.

I almost starting writing a program that does exactly what you're proposing.
If you write one, I'd use it.  If you write it in C++ and open source it, I'd fold your code into my project and give you a big kudos.

For my purposes, if you took mame's xml output and skipped all of the ROM CRC details, and merged it with controls.dat, you'd actually end up with a smaller file to work with.  My software isn't written in a way that loading in both files and merging would be useful-I never actually read the entire file in at once at any time.

http://www.waste.org/~winkles/ROMLister

-jeff!


MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #4 on: March 23, 2007, 03:42:53 pm »
I my FE I have a dedicated XML parser that reads the whole mame.xml file (line by line) and just grap the name, cloneof, description, year and controls (type) info. I also read the whole catver.ini file. I'm about to write the part that joins the whole lot. I wrote it in VB6.0 Not really pretty code, but that's because I didn't know VB and learned it as the project progresses.
I guess you can read the VB code and translate it into C++.

I'll PM you when I'm ready!

MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #5 on: March 29, 2007, 02:24:54 am »
NOP, you have some code to work out ;D

Have sent it by email.

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #6 on: March 29, 2007, 10:11:09 am »
yeah, I see that, and thank you!

Could your stuff be made into a standalone application that just takes the 2 files and outputs a 3rd? That would keep me from having to re-write the whole thing, and I'm as lazy as they come.   ;D

-jeff!

Extreme8

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 182
  • Last login:August 24, 2008, 03:46:24 pm
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #7 on: March 29, 2007, 01:41:57 pm »
Like my father has always said;
"Give the laziest man the hardest job and he'll find the easiest way to do it." ;)

MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #8 on: March 29, 2007, 04:44:06 pm »
That's a good quoot Extreme8!

NOP, in what format would that be then? I mean, just a comma separated file?? INI like??

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #9 on: March 30, 2007, 11:03:04 am »
For my purposes, this is what I'm dreaming of, a merged xml output file:

   <game romname="puckman" gamename="PuckMan (Japan set 1, Probably Bootleg)" numPlayers="2" alternating="1" mirrored="1" usesService="0" tilt="0" cocktail="1">
      <description>PuckMan (Japan set 1, Probably Bootleg)</description>
      <year>1980</year>
      <manufacturer>Namco</manufacturer>
      <player number="1" numButtons="0">
         <controls>
            <control name="4-way Joystick">
               <constant name="joy4way"/>
            </control>
         </controls>
      <labels>
            <label name="P1_JOYSTICK_RIGHT" value="Right"/>
            <label name="P1_JOYSTICK_LEFT" value="Left"/>
            <label name="P1_JOYSTICK_DOWN" value="Down"/>
            <label name="P1_JOYSTICK_UP" value="Up"/>
         </labels>
      </player>

      <rom name="namcopac.6e" size="4096" crc="fee263b3" sha1="87117ba5082cd7a615b4ec7c02dd819003fbd669" region="cpu1" offset="0"/>
      <rom name="namcopac.6f" size="4096" crc="39d1fc83" sha1="326dbbf94c6fa2e96613dedb53702f8832b47d59" region="cpu1" offset="1000"/>
      <rom name="namcopac.6h" size="4096" crc="02083b03" sha1="7e1945f6eb51f2e51806d0439f975f7a2889b9b8" region="cpu1" offset="2000"/>
      <rom name="namcopac.6j" size="4096" crc="7a36fe55" sha1="01b4c38108d9dc4e48da4f8d685248e1e6821377" region="cpu1" offset="3000"/>
      <rom name="pacman.5e" size="4096" crc="0c944964" sha1="06ef227747a440831c9a3a613b76693d52a2f0a9" region="gfx1" dispose="yes" offset="0"/>
      <rom name="pacman.5f" size="4096" crc="958fedf9" sha1="4a937ac02216ea8c96477d4a15522070507fb599" region="gfx1" dispose="yes" offset="1000"/>
      <rom name="82s123.7f" size="32" crc="2fc650bd" sha1="8d0268dee78e47c712202b0ec4f1f51109b1f2a5" region="proms" offset="0"/>
      <rom name="82s126.4a" size="256" crc="3eb3a8e4" sha1="19097b5f60d1030f8b82d9f1d3a241f93e5c75d6" region="proms" offset="20"/>
      <rom name="82s126.1m" size="256" crc="a9cc86bf" sha1="bbcec0570aeceb582ff8238a4bc8546a23430081" region="sound1" offset="0"/>
      <rom name="82s126.3m" size="256" crc="77245b66" sha1="0c4d0bee858b97632411c440bea6948a74759746" region="sound1" offset="100"/>
      <chip type="cpu" name="Z80" clock="3072000"/>
      <chip type="audio" name="Namco" clock="96000"/>
      <display type="raster" rotate="90" width="288" height="224" refresh="60.606060" />
      <sound channels="1"/>
      <input players="2" buttons="1" coins="2">
         <control type="joy4way"/>
      </input>
      <dipswitch name="Rack Test (Cheat)">
         <dipvalue name="Off" default="yes"/>
         <dipvalue name="On"/>
      </dipswitch>
      <dipswitch name="Service Mode">
         <dipvalue name="Off" default="yes"/>
         <dipvalue name="On"/>
      </dipswitch>
      <dipswitch name="Cabinet">
         <dipvalue name="Upright" default="yes"/>
         <dipvalue name="Cocktail"/>
      </dipswitch>
      <dipswitch name="Coinage">
         <dipvalue name="2 Coins/1 Credit"/>
         <dipvalue name="1 Coin/1 Credit" default="yes"/>
         <dipvalue name="1 Coin/2 Credits"/>
         <dipvalue name="Free Play"/>
      </dipswitch>
      <dipswitch name="Lives">
         <dipvalue name="1"/>
         <dipvalue name="2"/>
         <dipvalue name="3" default="yes"/>
         <dipvalue name="5"/>
      </dipswitch>
      <dipswitch name="Bonus Life">
         <dipvalue name="10000" default="yes"/>
         <dipvalue name="15000"/>
         <dipvalue name="20000"/>
         <dipvalue name="None"/>
      </dipswitch>
      <dipswitch name="Difficulty">
         <dipvalue name="Normal" default="yes"/>
         <dipvalue name="Hard"/>
      </dipswitch>
      <dipswitch name="Ghost Names">
         <dipvalue name="Normal" default="yes"/>
         <dipvalue name="Alternate"/>
      </dipswitch>
      <dipswitch name="2x Speed Cheat">
         <dipvalue name="Disabled" default="yes"/>
         <dipvalue name="Enabled Always"/>
         <dipvalue name="Enabled with Button"/>
      </dipswitch>
      <driver status="good" emulation="good" color="good" sound="good" graphic="good" savestate="supported" palettesize="32"/>
   </game>


This is taking MAME's listxml output and merging in controls.xml.  The highlighted stuff was taken from controls.xml.  To make the output smaller, I'd be totally ok with dumping all of the "<rom name="82s123.7f" Sha1...." lines, since they don't do me any good.

-jeff!


MaMeNnO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 201
  • Last login:August 18, 2021, 10:06:42 am
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #10 on: March 30, 2007, 11:46:45 am »
Well, that's far from what I'm planning on doing. I mean, I see the advantage of combining several files, but what good will it be to just dump it in a file and then read the dumped file again in another program???

I'm dreaming of a piece of public code with API calls for doing things like: read this file in a list, sort it on this key, combine these lists with this key, etc.

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #11 on: March 30, 2007, 03:36:25 pm »
Well, that's far from what I'm planning on doing. I mean, I see the advantage of combining several files, but what good will it be to just dump it in a file and then read the dumped file again in another program???

It does me a LOT of good-my software reads exactly 1 xml file.  Currently there's data that I would like to see in 2 xml files.  As previously mentioned, I'm lazy to re-write my code, and this is a perfect solution for me!   :D

Merging the 2 xml files would be a 1 time process; whenever a new MAME and a new controls.xml file is available (in other words, not that often).  After that, all software would only need to import that 1 file to do their respective jobs.

-jeff!

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Has someone mcm.ini and mame.xml (and controls.dat) combined?
« Reply #12 on: April 21, 2007, 07:51:20 pm »
for anyone still interested in this thread, I kicked up a program to merge mame's -listxml + controls.xml (aka, controls.dat) + catver.ini

The output file is another xml file; essentially mame's XML file with data from controls and catver injected into ROM's <game> </game> field. 

This was done entirely for ROMLister's use, but may come in handy for others.

http://www.waste.org/~winkles/ROMLister/mmm.html