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: Dat and Ini creation: I need a primer  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

jcroach

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 444
  • Last login:March 01, 2012, 09:36:56 am
  • I'm a llama!
Dat and Ini creation: I need a primer
« on: July 20, 2006, 01:01:14 pm »
Hey,

I hope someone can help me out with this.  I want to create a file to use with my front end (I currently use MALA, but I have used MameWah in the past) that will keep track of and display adiditonal customized information about my games.  Kind of like my own version of controls.ini or nplayers.ini   

Can anyone help me get started? Especially with answers to these questions?

  • What exactly is the difference in a DAT file and an INI file?
  • What programs do people use to create and maintain their files? Text editors? Excel? A database program?
  • Can both MALA and MameWah display info from custom files?
  • Is there a standard format for files? Do they use a hierarchy or programing language syntax for entries?
    • nplayers.ini is very simple; "rom name"=data
    • controls.ini is more complex with ["rom name"] "field1"=data "field 2"=data
    • history.dat is different still with $info="rom name","rom name" $bio "data" $end
« Last Edit: July 20, 2006, 01:21:45 pm by jcroach »

jcroach

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 444
  • Last login:March 01, 2012, 09:36:56 am
  • I'm a llama!
Re: Dat and Ini creation: I need a primer
« Reply #1 on: July 20, 2006, 01:30:31 pm »
I've also heard that there are several utilities around that make starting a dat or ini file easier.  Which ones do people recommend?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 09:00:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Dat and Ini creation: I need a primer
« Reply #2 on: July 20, 2006, 05:32:27 pm »
INI format is a throwback to system.ini which was used in windows 3.11 in leu of a registry and is still used today.  The format is popular because it doesn't have to be parsed manually.  There is a windows api to automatically retrive the data as well some some otehr m$ stuff that'll do the job. 

ini is this:

[Group]
key1=value
key2=value

[Group2]
key1=value
key2=value


When you search for a value you give the group name (in the case of mame it's usually the romname) and the key name and the api or whatever you are using returns the value.  The beauty of this system is that you don't have to know the keys contained in a group as there is a call to get that data too.  Then you can individually get teh value for each key in that game's group.  This format has issues in 98 though when it gets excessively large.  No such issues in xp though. 

Nplayers.ini and controls.ini are the same format, it's just nplayers has a single group [nplayers] and each romname is a key.  This is acceptable because nplayers only has one bit of data. Since controls.ini has more it makes a group for each rom. 


Dat is a generic term.  There's no such thing as a dat file anymore.  As it pertains to mame, however, dats are all based on the old listinfo format.  Open up and clrmamepro dat file and you can see this format.  There isn't much standardization amoungst the various dat files (history, info, ect) other than the fact that each entry starts with a "$game=" or "$info=" and ends with an "$end".  Basically each line is indented (why?) and the very first word is the key name followed by the data. These dats pretty much have to be parsed manually, and unless your goal is to display this data inside the mame ui, there isn't any point in using said format.  The one thing dat files can do that ini files can't is have a multiple line value.  You can have a really long value in an ini file, but not one with multiple lines.  There are ways around the limitation though. 


Dat files are often maintained manually in notepad as they are just ascii text.  Many of the simplier ini files are handled manually (catver, nplayers) but more complex ones are usually outputted by a database or program.  You really have to determine a set of fields and the data that will be stored in them before it's even possible to determine the format or how to maintain it. 



jcroach

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 444
  • Last login:March 01, 2012, 09:36:56 am
  • I'm a llama!
Re: Dat and Ini creation: I need a primer
« Reply #3 on: July 20, 2006, 07:32:35 pm »
Thank you very much, Howard_Casto!  That's exactly the kind of info I was looking for.