Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Custom MAME game list

  1. #1
    Join Date
    Oct 2005
    State
    Brisbane
    Posts
    7,935
    Mentioned
    8 Post(s)
    Quoted
    62 Post(s)

    Custom MAME game list

    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:

    Code:
    for /f "delims=," %I IN (mame099_mature.txt) DO move "c:\roms\%I.zip" "c:\dontwantthekidstoseethem"
    And on Mac and Linux, a similar thing:
    Code:
    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.

  2. #2
    Join Date
    Jun 2007
    State
    King Island
    Posts
    843
    Mentioned
    14 Post(s)
    Quoted
    135 Post(s)
    I'm interested...



    Horizontal games that use a 4way JS and one button ???





    thanks


    john


    .

  3. #3
    Join Date
    Mar 2006
    State
    Brisbane, Australia
    Posts
    11,554
    Mentioned
    190 Post(s)
    Quoted
    1441 Post(s)
    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

  4. #4
    Join Date
    Oct 2005
    State
    Brisbane
    Posts
    7,935
    Mentioned
    8 Post(s)
    Quoted
    62 Post(s)

    Quote Originally Posted by Brad View Post
    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!

    Quote Originally Posted by lexmark View Post
    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:
    Code:
    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:

    Code:
    # 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:
    Code:
    # 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.

    Code:
    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.
    Last edited by elvis; 30th May 2010 at 11:30 AM.

  5. #5
    Join Date
    Jun 2007
    State
    King Island
    Posts
    843
    Mentioned
    14 Post(s)
    Quoted
    135 Post(s)
    Quote Originally Posted by Brad View Post
    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



    .

  6. #6
    Join Date
    Oct 2005
    State
    Brisbane
    Posts
    7,935
    Mentioned
    8 Post(s)
    Quoted
    62 Post(s)

    Quote Originally Posted by lexmark View Post
    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]

    Quote Originally Posted by lexmark View Post
    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).

  7. #7
    Join Date
    Mar 2008
    State
    Sydney (Normanhurst)
    Posts
    5,112
    Mentioned
    6 Post(s)
    Quoted
    6 Post(s)
    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

  8. #8
    Join Date
    Oct 2005
    State
    Brisbane
    Posts
    7,935
    Mentioned
    8 Post(s)
    Quoted
    62 Post(s)

    Quote Originally Posted by AskJacob View Post
    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:

    Code:
    # 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:
    Code:
    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).

  9. #9
    Join Date
    Apr 2009
    State
    Campbelltown NSW
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MAME 0.129u4
    By elvis in forum News and Articles
    Replies: 0
    Last Post: 19th February 2009, 09:31 PM
  2. PCB Bootleg
    By madal in forum Arcade
    Replies: 17
    Last Post: 19th September 2008, 08:41 AM
  3. Replies: 44
    Last Post: 20th June 2008, 12:07 PM
  4. Mame game History As Word or pdf doucment??
    By Johno in forum M.A.M.E, Computer and Console Emulation.
    Replies: 0
    Last Post: 25th June 2006, 04:33 PM
  5. mame list of coctail games
    By Davefjedi in forum M.A.M.E, Computer and Console Emulation.
    Replies: 5
    Last Post: 25th November 2005, 09:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •