#!/usr/bin/perl # Stella Map Maker V1.0 (for glauncher) # David Mcanulty (dave@hellspark.com) # # just place this in your romdir and run it as ./stella-map.pl >a2600.map # # on my celeron 333 with full atari 2600 set (533) it takes 16 seconds ;) # # if you have trouble and get desperate you can get my premade a2600.map # file for glaunch from http://www.hellspark.com/dm/mame/software/stella/ # or if its not there, look around, i like to move stuff # unless (-T "stella.pro") { print "You need a stella.pro file to run this!\n"; print "Try: http://home.earthlink.net/~voch/atari.html/\n"; print "OR: http://www.hellspark.com/dm/mame/software/\n"; exit; } @md5 = `md5sum *.bin *.BIN`; #get md5s from files in dir foreach $line (@md5) { chomp($line); $line =~ s/\s\s/,/; #repl 1st instance of spacespace with , ($md5, $rom) = split(/,/, $line); #split on the comma chomp($md5); chomp($rom); $desc =`grep -a1 "$md5" stella.pro |tail -1`; #look for md5 in pro file $desc =~ s/"Cartridge.Name"\s//ig; #get rid of stella.pro header $desc =~ s/\s\[\S+\]//g; #remove weird [!] from desc ??? $desc =~ s/\r//g; #get rid of nasty ctrl-Ms unless ($desc) { $desc=$rom; #if no description use rom name $desc =~ s/\.bin//ig #remove .bin or .BIN from desc } chomp($desc); #remove possible carriage return $desc =~ s/\"//g; #remove any quotes in desc $rom =~ s/\.bin//ig; #remove .bin or .BIN from rom print "$rom \"$desc\"\r\n"; }