elvis Posted May 29, 2010 Share Posted May 29, 2010 I think I see a post a month here of people asking how they can get custom lists of things for MAME. Things like "how do I get a list of all vertical games?", or "how do I get a list of all adult games?", etc. My whole working existence is generally spent writing scripts to take massive amounts of data, search through it for particular things, sort it in a particular way, and then use it to automate something else (because machines should do repetitive tasks, not people). Building custom lists for MAME isn't that different. So feel free to ask here. Requests can be simple ("all vertical games") or complex ("all vertical games between 1985 and 1993 that require 2-way or 4-way joysticks"). I'll provide both the list of what you want, and the method I used to get it (which will generally be parsing MAME's XML output with some open source tools, which should work on any OS out there). Once you get these lists, you can do simple things with them to copy, move or delete the ROMs you want. Lets assume I provide you with a list of games that have mature content (called "mame099_mature.txt"), and you want to move them somewhere else. You could do this in the WindowsXP command prompt: for /f "delims=," %I IN (mame099_mature.txt) DO move "c:\roms\%I.zip" "c:\dontwantthekidstoseethem" And on Mac and Linux, a similar thing: cat mame099_mature.txt | while read ROM ; do mv ~/roms/$ROM.zip ~/dontwantthekidstoseethem/ ; done Substitute "copy/cp" or "del/rm" style commands in there if that's what you prefer. So, fire away and let me know what you need. Link to comment Share on other sites More sharing options...
lexmark Posted May 29, 2010 Share Posted May 29, 2010 I'm interested... Horizontal games that use a 4way JS and one button ??? thanks john . Link to comment Share on other sites More sharing options...
Administrators Brad Posted May 29, 2010 Administrators Share Posted May 29, 2010 Nice work elvis. For anyone that wants to do this themselves though, Rom Lister works a treat. I use for exactly the kinds of things your looking for lexmark and it will export it into a compatible list for your FE of choice. http://www.waste.org/~winkles/ROMLister/ Brad Link to comment Share on other sites More sharing options...
elvis Posted May 30, 2010 Author Share Posted May 30, 2010 (edited) Rom Lister works a treat http://www.waste.org/~winkles/ROMLister/ Hey cool, I didn't know about that one. There used to be a similar tool years ago, but it used the old output format and not the new XML based format. It appears some kind soul has finally filled the gap! Horizontal games that use a 4way JS and one button ??? I'll use this as an example on what I do to get the list. Impatient people, scroll to the bottom of the post to get the file. These scripts and tools are all run on Linux, and come as standard installable tools for any major distro. You can get the same tools via Cygwin for Windows. First, generate MAME's XML-based output and send it to a file: mame -listxml > mame.xml Next, look at the structure with "xml2". For brevity, I've cut out a few lines just so you get the gist of what it looks like: # cat mame.xml | xml2 /mame/game/@name=puckman /mame/game/@sourcefile=pacman.c /mame/game/description=PuckMan (Japan set 1) /mame/game/year=1980 /mame/game/manufacturer=Namco /mame/game/input/@players=2 /mame/game/input/@buttons=1 /mame/game/input/@coins=2 /mame/game/input/@service=yes /mame/game/input/control/@type=joy4way /mame/game/display/@type=raster /mame/game/display/@rotate=90 /mame/game/display/@width=288 /mame/game/display/@height=224 /mame/game/display/@refresh=60.606061 Cool. Things we care about are the "rotate" option (needs to be either "0" or "180" for a horizontal game), the input (joy4way) and the number of buttons (1 or less). So now we use "xmlstarlet" to grab that information and spit it out in a useful format. Again, chopping down the list for brevity: # xmlstarlet sel -t -m //game -v "concat(input/@buttons,';',@name,';',display/@rotate,';',input/control/@type)" -n mame.xml 1;hangly3;90;joy4way 1;popeyeman;90;joy4way 1;piranhah;90;joy4way 1;abscam;90;joy4way ;crush;90;joy4way So now we have formatted: buttons ; rom-name ; rotation ; joystick-type Using the mighty "grep", we filter out the crap we don't want (including double-joystick games :)). Then we pass that through "awk" to give us just the column we want (ROM Name). For laughs, I'll sort it alphabetically too. xmlstarlet sel -t -m //game -v "concat(input/@buttons,';',@name,';',display/@rotate,';',input/control/@type)" -n mame.xml \ | grep -E "^\;|^1\;" | grep -E "\;0\;|\;180\;" | grep joy4way | grep -v doublejoy4way \ | awk -F ';' '{print $2}' | sort > mame0138_horizontal_0-1button_joy4way.txt Wow, exciting. End result is this file: mame0138_horizontal_0-1button_joy4way.txt MAME 0.138 output, all games that are Horizontal, use 1 button or less, and require a single 4-way joystick. Now you can use the short commands back in the first post to copy these files onto your MAME machine. There's a good chance they'll weigh in under 100MB, so no need to copy the full 15GB set if all you want is a handful of ROMs. Edited May 30, 2010 by elvis Link to comment Share on other sites More sharing options...
lexmark Posted May 30, 2010 Share Posted May 30, 2010 Nice work elvis. For anyone that wants to do this themselves though, Rom Lister works a treat. I use for exactly the kinds of things your looking for lexmark and it will export it into a compatible list for your FE of choice. http://www.waste.org/~winkles/ROMLister/ Brad Brad...yeah, I knew about ROM lister. I was more interested how elvis got the result. Thanks elvis..........BUT...a qick look at the list shows one game that shouldnt be there ...WACKO... it uses 2 JS's...one to move around and one to direct your shots. no big deal. john . Link to comment Share on other sites More sharing options...
elvis Posted May 30, 2010 Author Share Posted May 30, 2010 Thanks elvis..........BUT...a qick look at the list shows one game that shouldnt be there ...WACKO... it uses 2 JS's...one to move around and one to direct your shots. no big deal. Easy fix. I'll add "grep -v doublejoy4way" to the final command above, and it'll filter that out (I'll go back and edit the post now). I thought about that just 5 minutes ago actually, as I did the same thing previously when "crazy climber" showed up on my cocktail list. :) [edit] Original post updated, and new file uploaded [/edit] Brad...yeah, I knew about ROM lister. I was more interested how elvis got the result. The other thing worth mentioning is ROM Lister appears to only work with MAME. I'm more than happy to do this for any emulation system out there - the "goodtools" lists for consoles, etc. I can also do it over catlist.ini (the MAME categorisation listing) so you can filter on more advanced things (e.g.: by genre - get all the fighting games or shmups out of MAME into a single list, etc). Link to comment Share on other sites More sharing options...
AskJacob Posted May 30, 2010 Share Posted May 30, 2010 A lot of requests have been to filter out adult games - is there an easy way to do this? I'm assuming the game needs to be properly classified first though! Cheers JAcob Link to comment Share on other sites More sharing options...
elvis Posted May 30, 2010 Author Share Posted May 30, 2010 A lot of requests have been to filter out adult games - is there an easy way to do this? I'm assuming the game needs to be properly classified first though! Currently catlist.ini is the only way to do this. Sadly that's only up to MAME 0.99 (at time of writing, 0.138 is out). Keeping that up to date requires a lot of human effort, and it's not part of the core MAME tree/code/database either. So yes, unless it's already in catlist, then filtering 100% of adult content is difficult. You'd get most of it, but there's no guarantees something would slip through. What is there is pretty easy. Grab catver from the catlist.ini site, and it looks like this: # head catver ;; CatVer(bz2) (rev. 1) / 11-Sep-05 / MAME .99u2 / http://www.mameworld.net/catlist ;; [Category] 005=Maze / Shooter Small 11beat=Unplayable 1941=Shooter / Flying Vertical 1941j=Shooter / Flying Vertical 1942=Shooter / Flying Vertical 1942a=Shooter / Flying Vertical 1942b=Shooter / Flying Vertical Simply use grep to find the mature games, and awk to print out the column needed: grep -i mature catver | awk -F '=' '{print $1}' | sort > mame099_mature.txt Output file is: mame099_mature.txt Once again, use the command back in the first post to move/delete these files. Replace the ".zip" extension in your roms folder with a ".png" extension in your snaps folder to also delete/move the corresponding screen shot (keep your front-end smut-free as well). Link to comment Share on other sites More sharing options...
Jaycw Posted June 8, 2010 Share Posted June 8, 2010 Id be interested in a list of all games which require 4 buttons or less ... if it could exclude trackball games also then that would be ideal. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now