« SpiffMAME: Background| Main | Spiff's Bob-clock on MAKE Magazine's blog... »

Updating the romset

Category: SpiffMAME

OK. So I finally got some time again, and decided to do something about all the things I wanted to write about here on mameblog.com. Of course, since it has been a while since my last post, and that was about upgrading the packages, there is a bunch of new packages, so I'm going through another iteration of package upgrading.

But since I am also updating my romset, I thought I would share a little information about how I maintain my romset using the advscan utility. Way back I downloaded a complete romset (I think it was for version 0.70), and ever since, I have been using differential updates (one for each MAME version) and verifying with advscan. Let me explain how I apply one romset update at a time and check for any missing ROMs. Then I will give a few hints on how to fix it if it turns out some roms are bad.

The first thing is of course to find out which version of the romset you need to upgrade to. Whenever I decide to upgrade my romset, I go for the latest version (well, the latest version used by AdvanceMAME). So check what the latest version of the emulator is. Look at http://advancemame.sourceforge.net for the latest version of AdvanceMAME. Also checking mame.net can give a little heads-up on what version the official MAME has gotten to. This often means I can start downloading the new romset, and AdvanceMAME will probably come out in a new version shortly.

For instance, today I see that the latest version of AdvanceMAME is 0.104, while the latest version of the official MAME is 0.105. Last time I upgraded my romset was for version 0.101, so I need the updates for 0.101 to 0.102, 0.102 to 0.103 and 0.103 to 0.104. I have already downloaded these, but seeing that there is a 0.105 of the official MAME, I might as well start downloading the romset update for that, since this process can take some time. The easiest way of getting the romset updates these days seems to be by P2P filesharing programs. I am not going to write long instructions on how to use different P2P programs, but it should be possible to find the updates. Try to do a search for "mame roms" or something similar.

The romset updates I get are usually packed up in a RAR-archive, so the next step is to unpack this. Updating from version 0.101 to 0.102 I unrar'ed the files (with full path - the x option) to a tmp directory. In some cases the RAR-archive contains the zip-files of the needed ROMs, but most of the time it is just the files (not zipped). Since advscan works with the ZIP-files, I need to make the ROMs into appropriate zip-files. I know there are easier (and more bulletproof) ways of doing this, but here is what I normally do (from the tmp directory where the rom directories are):

$ for f in *;do cd "$f";zip "../../$f.zip" *;cd ..;done

This is bash-script (so you need to be running the bash shell), and BTW the first $ is the prompt, so it should not be typed. If everything works out, you should now have the zips, one per game. Sometimes these are what is found in the romset update. Of course that only makes it easier, since you don't have to zip it yourself. For this update, I now have 50 ZIPs, which should be placed in a directory that is listed under rom_import in advscan.rc.

The other thing that is needed before we can start updating the romset is the information about checksums of all rom files supported by the particular version of mame we are upgrading to. This information is generated by running MAME (or in this case advmame) with the --listxml option (older versions used --listinfo). The size of the generated file is currently arround 25MB, so there are probably not many places where this can be downloaded (although it could most likely be zipped quite well). Also, generating the list from the version of MAME that you intend to run will ensure you have the correct list.

So to get the info, go download the version of MAME you are uprgading your romset to. In this case I downloaded advancemame-0.102.0.tar.gz from a sourceforge mirror. Extract the sources, do a ./configure and a make. This will take a while, so go fetch a cup/glass of your favorite caffeinated beverage.

When the compile is done, run
$ ./advmame --listxml >0.102-romset.xml
and then move the xml-file to somewhere handy (e.g. where you normally run advscan). I like to keep these xml-files arround, so I can go back and check my romset against them. When you have the xml-file you don't need the program anymore (for the romset update anyway).

Of course you will also need advscan. This can be found from the AdvanceMAME site

We are now ready to invoke advscan to update the romset. Make sure all the directories exist and are specified correctly in your advscan.rc:

  • rom should specify the directory of the old romset

  • rom_new is where to put the new (updated) romset

  • rom_import should be where you keep the updates (the zip-files)

  • rom_unknown is where to store the old roms (the ones that are removed by the update)

My romset is what is called a differential romset. This means that the files needed to run a clone of a game will be residing in two zips: the parent rom zip , and the clone zip. This takes up less space on the drive, but it makes it a little more complicated if you want to copy a particular game somewhere else, since you need to find out what parent roms might be required. Advscan supports the three different types of romsets, so if you want to use a different type, look at the documentation. The rest of this article will use a differential romset.

Run advscan and pipe in the contents of the xml-file:
$ advscan -Rtv <0.102-romset.xml

After processing, the updated roms should be in the directory you specified as rom_new. Move these files into your rom directory, and you have the updated romset.

Now, we can check the romset. This is also done with advancescan:
$ advscan -rp <0.102-romset.xml >0.102check.txt

Sometimes a rom is reported as missing/corrupt when it is actually not playable anyway. You can limit the check to only report games that should be working:
$ advscan -rp -f working <0.102-romset.xml >0.102check.txt

Afterwards, you can check the file to see if all files are up to date. If some are reported missing, try to find the roms. I will not list where to look, but look arround and you should be able to find them. If you find some roms, put them into the directory listed as rom_import, and run the update again. Then redo the list. In this way it should be possible to get the romset fully updated.

All there is to do now is to do the whole thing once more with the next version. I recommend doing the update step by step, since this will allow you to find out which version of the romset updates a certain game was in, in case there was an error in the rom. Sometimes, however, there is not a version of MAME for each romset update. For instance there is no AdvanceMAME 0.103, so I will have to do both update sets for 0.103 and 0.104 at once.


Listed below are links to weblogs that reference Updating the romset:

» MAMEBLOG from The Pinney Digital Home
MAMEblog: Updating the romset Fellow MAME enthusiasts... [Read More]