Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Hey guys, I attempted to load the new MAME software list roms into gameex as an emulator but found that the existing databases dont have the filenames there for it yet. I created a powershell script that gets the XML data from the hash.xml files in MAME and outputs the naming info to a new mdb database template using that info. Thought Id share this as a stopgap measure for the community till the databases are officially updated. Feel free to use this script and modify it however you see fit. No royalties needed.

#Location of Mame Hash File XML
[xml]$xmlhash = get-content G:\0-GameEx-0\Emulators\MAME\hash\gameboy.xml
#Gets System name and stores variable to be used in name of csv file
$systemname = $xmlhash.softwarelist.name 
#Where to output the CSV file (technically a semicolon delimited file)
$csv = "G:\0-GameEx-0\GameEx\DATA\EMULATORS\$systemname.csv"
#Delete file if exists
remove-item $csv -Force
#Names of columns in destination mdb that you want these values to reflect and write to file
$line = "MAME;MAMECloneOf;Name"
$line | out-file -FilePath "$csv" -Encoding ascii -force
#For each rom listing in xml file write the filename name, if clone, and readable name to file 
foreach ($software in $xmlhash.softwarelist.software){
    $line = "$($software.name);$($software.cloneof);$($software.description)"
    $line | out-file -FilePath "$csv" -Append -Encoding ascii
}

Steps: run script (editing to point to the correct xml file in your <mameinstall>\hash folder)->import csv into a copy of database template->point emulator to use that database.

 

Hope this makes life easier :D

 

  • Like 1
Posted

Although I'm not big-up on Mame - this looks funky - thanks for the share. If I'm reading this right this takes xml as input and outputs in a different format? Whoa - powershell looks quite errrr... powerful!

Posted

It outputs to CSV which is really just a text file with values seperated with a delimiter such as a comma. I had to do it this way because a direct import from xml, using access, didnt import the "software name" of the file. it just put all the other info under the software header. In other words it wouldnt have captured the "3punyoso" which is what the file is named.

<software name="3punyoso">
		<description>3-pun Yosou Umaban Club (Jpn)</description>
		<year>1992</year>
		<publisher>Hect</publisher>
		<info name="serial" value="DMG-U4J"/>
		<info name="release" value="19921016"/>
		<info name="alt_title" value="3分予想 馬番倶楽部"/>
		<part name="cart" interface="gameboy_cart">
			<feature name="pcb" value="DMG-GDAN-03" />
			<feature name="u1" value="U1 PRG" />
			<feature name="u2" value="U2 MBC2A" />
			<feature name="u3" value="U3 26A" />
			<feature name="batt" value="Batt CR1616" />
			<feature name="slot" value="rom_mbc2" />
			<dataarea name="rom" size="65536">
				<rom name="dmg-u4j-0.u1" size="65536" crc="cafe0d2b" sha1="76643f3f3481f7e515a24482779870862dd8b373" offset="0" />
			</dataarea>
			<dataarea name="nvram" size="8192">
			</dataarea>
		</part>
</software>

 

Posted

Have you tried with SQL Lite?  As of th he last few years GameEx has been using that format as opposed to Access . mdb. although it will use .mdb.

Posted

Importing from CSV into db3 would most likely work as well although i havent tried it. I just used what was readily available to make a whole new database. i havent found an easy way to merge this info with current official data since the name fields are so different. Sadly i dont have the madd skillz necessary to facilitate that.

For example .. whats currently in the game boy database is: "Best of the Best: Championship Karate"

The Mame hash xml file info is: "Best of the Best - Championship Karate (Euro)"

Maybe i can write something thats a little more interactive to verify each "software" item so that human eyes can verify the fields. Maybe I can actually contribute to updating the official DBs that way. Ill also have to find a way to connect to the database via powershell instead of daisychaining the process thru a csv file. Ill let you know if Im successful.

Posted

You may want to PM @headkaze and @greatflash as they are our two DB gurus, especially Greatflash who has been working to get the databases current for both GameEx and GameEx Evolution. They may be able to give you some pointers or lead you to some tools that will be helpful.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...