Linux/UN*X tools for ROM collectors

These are some scripts and binaries that should make life easier for ROM/tape/disk image collectors running Linux or other Unixish OSs.
 

My own scripts

These are some Bourne shell scripts I wrote that should make handling large collections of ROM, disk and tape images a little easier. They all require a fairly standard setup unless otherwise noted. If they need non-standard tools to work, this will be mentioned in the Requires: line.
You should have some basic understanding of Bourne shell scripting and usage of the common UN*X tools because it will a) enable you to use these scripts more effectively and b) allow you to understand errors that may occur as most of the scripts have no error handling at all. Do not run these scripts as root!
They need to be placed in a directory in your search path in order to work. Since there are some dependencies between them you shouldn't delete scripts even if they seem useless to you. Some others might need them, and they don't take up much space anyway.

Download: emuscripts.tar.gz
 
sums creates a list of MD5 sums of all files inside the directories specified as arguments. It tries to convert files to "canonical" formats to avoid having different sums for the same file. Formats are recognized by the file's extension.The following formats are converted:
  • bz2, BZ2, gz, GZ, adz, ADZ, zip, ZIP, arj, ARJ, rar, RAR, lha, LHA, lzh, LZH: get unpacked first (sums handles multivolume RAR archives properly)
  • nes, NES, smd, SMD: headers are being removed
  • v64, V64: get converted to Big Endian format (aka Z64, extension rom)
  • gb, GB, gbc, GBC, cgb, CGB: headers are being removed if present
  • 078, 058, 048, smc, SMC, swc, SWC, fig, FIG: headers are being removed if present, split files following the sf*.0?8 naming convention are being joined
  • msa, MSA: being converted to raw format (aka ST)
sums works recursively, so e.g. archives inside archives are handled properly.

Usage: sums <directories>
Requires: md5sum, bzip2, unzip, unarj, unrar, lha, n64rom (see below), msatost (see below)

cleanlist This script takes an MD5 sums list as created by sums and outputs a list of files that are identical.

Usage: cleanlist <sums file>
Requires: nothing extraordinary

complists This is basically the same as cleanlist, but it takes two lists as arguments and checks for files that appear in both of them.

Usage: cleanlist <sums file> <sums file>
Requires: nothing extraordinary

extractzip extractzip unpacks all ZIP archives (files with extension zip or ZIP) in the current directory into the current directory. If everything works fine (i.e. there are no broken archives), the archives will be removed and the extracted files will appear in the current directory. Otherwise, you will end up with three directories:
  • good will contain all files that could be extracted properly
  • bad will contain all bad archives
  • done will contain the original archives that could be unpacked
Usage: extractzip
Requires: unzip
extractlzh This one works the same way as extractzip, but handles LZH archives (extension lzh, LZH, lha and LHA).

Usage: extractlzh
Requires: lha

extractzipsub The same as extractzip, but it unpacks each archive into a separate subdirectory named after the archive. For example, foo.zip will be unpacked into foo.

Usage: extractzipsub
Requires: unzip

gbname This prints the name of a Game Boy ROM image

Usage: gbname <ROM file>
Requires: nothing extraordinary

n64identify This checks the endianness of one or more Nintendo 64 ROM image and gives it the proper extension (v64 for Doctor 64 format, rom for Z64 format).

Usage: n64identify <ROM image(s)>
Requires: nothing extraordinary

mergeversions mergeversions assumes you have a number of files (given as arguments) in the current directory, and for each file another with the same name in the parent directory. It will check for each pair whether the files are identical. If so, it will delete the file in the current directory. If not, it will rename the file in the parent directory to filename_a.extension, move the file in the current directory to the parent directory and rename it to filename_b.extension.

Usage: mergeversions <file(s)>
Requires: nothing extraordinary

renromcenter This allows you to use RomCenterdat files to more or less properly name your files. It is nowhere near perfect, use it at your own risk. dat files need to be converted with recode from DOS format first, otherwise renromcenter will give your files some really strange names:

recode ibmpc..lat1 <name of dat file>

Usage: renromcenter <dat file> <image file(s)>
Requires: cksfv (see below)

renspace renspace takes one or more directories as arguments and replaces all space characters in the file names inside these directories with underscores ("_"). This is very useful as most scripts can't handle file names with spaces in them properly. (sums is a notable exception.)

Usage: renspace <directories>
Requires: nothing extraordinary

Tools used by my scripts

These are auxiliary tools my scripts need to accomplish their task. All of them are useful by themselves, too. Check them out. Apart from msatost, none of them have been written by me.
 
 
msatost msatost converts Atari ST disk images in Magic Shadow Archiver (MSA) format to raw images ("ST" format). It's an extremely basic commandline tool that should build on just about every system. If you're running a Big Endian system, don't forget to #define MSB_FIRST. Again, it has virtually no error checking, and it does not work with multi-volume MSA files.

Usage: msatost <MSA (source) file name> <ST (target) file name>

Source: msatost.c
Linux/i386: msatost.gz
n64rom This little tool written by Salim Gasmi allows you to get info on an N64 ROM, verify and/or recreate its checksum and convert it between Little (V64) and Big Endian (Z64, "ROM") formats.  Thanks to Salim, I can now offer you the sources, too. Source: n64rom.c
Linux/i386: n64rom.gz
cksfv cksfv by Bryan Call is a tool to create and verify Simple File Verification (SFV) listings. I abuse it to create CRC32s in renromcenter. Source: cksfv-1.1.tar.gz
Linux/i386: cksfv.gz
Homepage

Other tools that may be useful

cpcfs This is a tool for moving files to and from CPC disk images. It comes with source code, but I have not tried to compile it myself yet. Linux/i386 and source: cpcfs085-linux-static.tgz
undms undms is able to unpack DMS files (compressed Amiga disk images) to raw (ADF) format. Unfortunately, the author does not mention his/her name in the source code. If anyone knows it, mail me. Source: undms-1.3.c
Linux/i386: undms.gz

Back to emulinks.de

Contact: webmaster@emulinks.de