Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including mamelist with all npm packages installed. Try it out:

var mamelist = require("mamelist")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mamelist v0.0.2

mame list xml parse

mame -listxml

Step one is grab a bunch of roms, eg from

now we try and sort through mame roms and remove the ones that do not make sense on a real mamecab, eg drop the mahjong and the home computers and mechanical etc etc.

Hardcoded decisions so it is up to you to mess with js/sort.js and change the filtering if you want.

This is nodejs so should work anywhere but we are assuming you are using bash here.

This repo is also published to so you could skip this first install step and just use npx mamelist instead as a replacement for .mamelist in the instructions bellow. npx will auto download from npm and run using node.

First clone this repo and cd into it then...

npm install

This will install dependencies and do a test run that will also explain the command line options available.

From here on we assume your mame files are in ~/mame/ so your roms are in ~/mame/roms/ you will need to adjust that if they are somewhere else. First get listxml from your mame, this does assume you have mame installed and working.

mame -listxml >~/mame/mamelist.xml

Then convert this xml file to a json file with some info striped and some info added, this will only include roms that you have. Think of this json as enough information for a reasonable launcher.

./mamelist parse --dir ~/mame

Finally we make a ~/mame/romsort with subdirectories full of sorted roms, these roms are hardlinked files so do not actually take up any more space.

./mamelist sort --dir ~/mame

Now I can copy the roms I want from these directories to my arcade cab, I actually only care about 19xx so I just grab that dir. What to do here is up to you, the roms have been sorted into folders and I found that rather helpful, for me it dropped a lot of files that I do not care about as they do not make sense in a real arcade machine.

There will be duplicates, so best to merge them all into one folder when copying.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free