Software Support > GroovyMAME

Linux-command-line-tools for mame-gamelist-processing

<< < (2/4) > >>

Calamity:
Hi Lomaxx, really nice thread. I just wanted to confirm that checking for a "rotate" value of 90 or 270 is exactly the method I use in VMMaker to detect vertical games.

Lomaxx:
Hey Calamity. That's brilliant news. Now I can rest assured that I do the right thing. :)

Another small hint: I noticed, that there are BIOS-files among the result of my horizontal games. But only 14 of them. If you you want to sort them out, then do a negative search for them (search for lines that do not contain BIOS in their description).

Depending on which output you pipe into use something like


--- Code: ---grep -v "<description>.*BIOS.*</description>"
--- End code ---

or when you pipe a list of nothing but the sole long-name:


--- Code: ---grep -v "BIOS"
--- End code ---

If I'll find other things worth sorting out, then I will edit this post.

Lomaxx:
Here's another aspect: Categories

The "-listxml"-output of groovymame unfortunately does not contain any information about the category. You still might want to make a selection based on them for some reason. So what to do? I found an English catalog of categories on the net at http://www.progettoemma.net/history/catlist.php.  They do also offer them in a version for genres and a zip-file which offers all of them in some other sort-scheme. Actually they are all worth a look, because they might become handy for the one or other situation. For now I will stick to the "catver.ini". I downloaded that archive and unzipped it.
 After some testing I noticed that I better change the format of that file for further grep-processing. First of all it was written on a MsWindows-machine, because of which it uses a different line-break-special-character. We can fix that quickly by using "dos2unix". Additionally it's easier to grep entries when the shortname and the category are enclosed by doublequotes. And finally I only needed the first 18202 lines of the file since after that the category-listing ends and some versioning-stuff starts (see with an editor to understand what i mean). So i copied and modified the file a little:


--- Code: ---head -n 18202 catveren/Catver.ini | dos2unix | sed -e 's/^/\"/' -e 's/=/\"=\"/' -e 's/$/\"/' > catlist_modified.txt
--- End code ---

The sed-part adds a doublequote at the start of each line, at the end of each line and replaces the equal-sign with a doublequotes-equalsign-doublequotes combination. So in the and the lines look like in this example:

"1942"="Shooter / Flying Vertical"

So now that I have that modfied catlist, I can create a list of .... let's say' ... vertical games containing the shortnames still holding the doublequotes around them:


--- Code: ---egrep "rotate=\"(90|270)\"" groovymame_output_selection.txt | egrep -o "name=\"[^\"]*\"" | cut -b 6-  > vertical-games_shortname.txt
--- End code ---

and now grab only these vertical games from the modified catlist:


--- Code: ---fgrep -f vertical-games_shortname.txt catlist_modified.txt > vertical-games_with_category.txt

--- End code ---

Note:
When I did this, I noticed that 3 games were not mentioned in the resulting list: cprosocc, ddp3, taxidrvr
These were not listed in catlist most likely because I used version 0.145 of it while my groovymame-version was only 0.143. I assume their name changed for some reason. So better try to use the same version of both lists. Although I can't tell you right now where to get a 0.143-catlist.

From here on you can do further sorting or selecting with the list containing both the shortname and the category. A list holding genres should be creatable in an analog way.

krick:
You really should take a look at XSLT.

You can transform XML in amazing ways using XSL transforms.

In fact, the target format doesn't even have to be XML.

Check out the XSL file included with XML2INFO for an example of the sort of thing that can be done.

http://mame.3feetunder.com/xml2info/

Lomaxx:
I tried


--- Code: ---xsltproc xml2info.xsl groovymame_output.xml > listinfo.txt
--- End code ---

, but it seems like that needs quite a lot of memory. My computer started to swap and swap and swap memory .... and after something like 10 minutes i decided to cancel the operation. I guess my 8 year old computer with 512MB ram is simply too old for that. :) I'll keep it in mind once i buy a new one. ;) Thanks for pointing me to it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version