StalkS said:
CyprianZ said:
Is this spreadsheet up to date?
<cut>
It's a work in progress - we also having a few issues with metal slug 3 (glitches with the energy bar) . If you could post and explain how to use your script you would make a lot of people happy here
StalkS
Ok, but I have to warn you, it aint pretty, I spent about 15 minutes writing it, and I didn't mean to go public with it, I just wanted to organize my own rom collection.
the script I use looks like this:
Code:
#!/bin/bash
rc=${1}
rom=${2}
dr=${PWD}
processed="processed"
#make output dirs
mkdir -p "out"
mkdir -p "out/orig"
mkdir -p "${processed}"
#temporary dir and files
temprom="temprom_${2}"
mkdir ${temprom}
cd ${temprom}
unzip ../${rom}
#you can experiment with the regular expression passed to grep
#if you want the script to be more "universal", so it could handle other extensions
c1=`grep '\.rom' <../${rc} |awk '{print $1 }'|wc -l `
c2=$(ls *|wc -l)
if [ ${c1} != ${c2} ] ; then
echo "in rc file: ${c1} rom: ${c2}, rom has to be configured manually, sorry"
exit 1
fi
#you can experiment with the regular expression passed to grep
#if you want the script to be more "universal", so it could handle other extensions
lista=`grep '\.rom' <../${rc} |awk '{print $1 }' `
#main loop
for x in ${lista} ; do
l=$(echo ${x} |sed 's/^.*[-_]//'|sed 's/\..*$//')
echo ${l}
rename "s/.*[-_]${l}\..*/${x}/" *${l}.*
done
#exit 0
u=$(echo ${1}|sed 's/\.rc//')
#recompress
zip -9 -r ../out/${u}.zip *
cd ..
#clean up
rm -rf ${temprom}
mv ${rom} "out/orig/${rom}"
mv ${rc} ${processed}
now to use it(don't feel offended if I say something obvious):
first of all, always make backup copies of the files you'd like to process!
let's say, you'd save it as "script.sh"
you have to gather rom file and rc file in the same directory (preferable), and then invoke
Code:
./script.sh rc_file rom_file
the rc_file has to be prepared a little:
first, leave _only_one_ rom description in the rc file (my script is really simple, you can merge the rc files later, if you want multiple definitions),
files in rc file should have '.rom' extension (some of the descriptions I've found have .bin extension, so you'd have to edit these, or change the script).
and the last, but not least, the number of files in the rc file should be the same as in the zip archive, otherwise, the script would return with an error, complaining about the problem.
if you want examples, here you go, let's assume you have a mslug.zip rom file, with contents:
Code:
Archive: /home/c/caanoo/karty/sd_copy3/APPS/gngeo/roms/mslug.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
4194304 Defl:N 2126510 49% 1996-12-24 23:32 72813676 ms-c1.rom
4194304 Defl:N 1550330 63% 1996-12-24 23:32 96f62574 ms-c2.rom
4194304 Defl:N 1737609 59% 1996-12-24 23:32 5121456a ms-c3.rom
4194304 Defl:N 1126261 73% 1996-12-24 23:32 f4ad59a3 ms-c4.rom
131072 Defl:N 61385 53% 1996-12-24 23:32 c28b3253 ms-m1.rom
2097152 Defl:N 694492 67% 1996-12-24 23:32 08d8daa5 ms-p1.rom
131072 Defl:N 25778 80% 1996-12-24 23:32 2f55958d ms-s1.rom
4194304 Defl:N 3449415 18% 1996-12-24 23:32 23d22ed1 ms-v1.rom
4194304 Defl:N 2392794 43% 1996-12-24 23:32 472cf9db ms-v2.rom
-------- ------- --- -------
now let's say, you have a rc file, which looks like that:
Code:
longname Metal Slug - Super Vehicle-001
#mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
201-p1.bin 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
201-s1.bin 0x0 0x20000 NORM
END
SM1 0x20000
201-m1.bin 0x0 0x20000 NORM
END
SOUND1 0x800000
201-v1.bin 0x0 0x400000 NORM
201-v2.bin 0x400000 0x400000 NORM
END
GFX 0x1000000
201-c1.bin 0x0 0x400000 ALTERNATE
201-c2.bin 0x1 0x400000 ALTERNATE
201-c3.bin 0x800000 0x400000 ALTERNATE
201-c4.bin 0x800001 0x400000 ALTERNATE
END
END
#mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
201-p1.bin 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
201-s1.bin 0x0 0x20000 NORM
END
SM1 0x20000
201-m1.bin 0x0 0x20000 NORM
END
SOUND1 0x800000
201-v1.bin 0x0 0x400000 NORM
201-v2.bin 0x400000 0x400000 NORM
END
GFX 0x1000000
201-c1.bin 0x400000 0x200000 ALTERNATE
- 0x0 0x200000 ALTERNATE
201-c2.bin 0x400001 0x200000 ALTERNATE
- 0x1 0x200000 ALTERNATE
201-c3.bin 0xc00000 0x200000 ALTERNATE
- 0x800000 0x200000 ALTERNATE
201-c4.bin 0xc00001 0x200000 ALTERNATE
- 0x800001 0x200000 ALTERNATE
END
END
#old mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
mslug_p1.rom 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
mslug_s1.rom 0x0 0x20000 NORM
END
SM1 0x20000
mslug_m1.rom 0x0 0x20000 NORM
END
SOUND1 0x800000
mslug_v1.rom 0x0 0x400000 NORM
mslug_v2.rom 0x400000 0x400000 NORM
END
GFX 0x1000000
mslug_c1.rom 0x400000 0x200000 ALTERNATE
- 0x0 0x200000 ALTERNATE
mslug_c2.rom 0x400001 0x200000 ALTERNATE
- 0x1 0x200000 ALTERNATE
mslug_c3.rom 0xc00000 0x200000 ALTERNATE
- 0x800000 0x200000 ALTERNATE
mslug_c4.rom 0xc00001 0x200000 ALTERNATE
- 0x800001 0x200000 ALTERNATE
END
END
now what you should do is find rom description, that has as many files as your zip file has, in this case, all three descriptions "fit", so you should create 3 files (I didn't do it this way, but I'm trying to write the fool proof manual for this process
):
first file (change .bin to .rom):
Code:
longname Metal Slug - Super Vehicle-001
#mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
201-p1.rom 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
201-s1.rom 0x0 0x20000 NORM
END
SM1 0x20000
201-m1.rom 0x0 0x20000 NORM
END
SOUND1 0x800000
201-v1.rom 0x0 0x400000 NORM
201-v2.rom 0x400000 0x400000 NORM
END
GFX 0x1000000
201-c1.rom 0x0 0x400000 ALTERNATE
201-c2.rom 0x1 0x400000 ALTERNATE
201-c3.rom 0x800000 0x400000 ALTERNATE
201-c4.rom 0x800001 0x400000 ALTERNATE
END
END
second file
Code:
#mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
201-p1.rom 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
201-s1.rom 0x0 0x20000 NORM
END
SM1 0x20000
201-m1.rom 0x0 0x20000 NORM
END
SOUND1 0x800000
201-v1.rom 0x0 0x400000 NORM
201-v2.rom 0x400000 0x400000 NORM
END
GFX 0x1000000
201-c1.rom 0x400000 0x200000 ALTERNATE
- 0x0 0x200000 ALTERNATE
201-c2.rom 0x400001 0x200000 ALTERNATE
- 0x1 0x200000 ALTERNATE
201-c3.rom 0xc00000 0x200000 ALTERNATE
- 0x800000 0x200000 ALTERNATE
201-c4.rom 0xc00001 0x200000 ALTERNATE
- 0x800001 0x200000 ALTERNATE
END
END
and the last file:
Code:
#old mame set of mslug
game mslug MVS "Metal Slug - Super Vehicle-001"
CPU 0x200000
mslug_p1.rom 0x100000 0x100000 NORM
- 0x0 0x100000 NORM
END
SFIX 0x20000
mslug_s1.rom 0x0 0x20000 NORM
END
SM1 0x20000
mslug_m1.rom 0x0 0x20000 NORM
END
SOUND1 0x800000
mslug_v1.rom 0x0 0x400000 NORM
mslug_v2.rom 0x400000 0x400000 NORM
END
GFX 0x1000000
mslug_c1.rom 0x400000 0x200000 ALTERNATE
- 0x0 0x200000 ALTERNATE
mslug_c2.rom 0x400001 0x200000 ALTERNATE
- 0x1 0x200000 ALTERNATE
mslug_c3.rom 0xc00000 0x200000 ALTERNATE
- 0x800000 0x200000 ALTERNATE
mslug_c4.rom 0xc00001 0x200000 ALTERNATE
- 0x800001 0x200000 ALTERNATE
END
END
and try the script above with all three files, and test, if the output file will come right.
of course, you have to put modified rc file to the gngeo romrc.d directory, every time you test the rom.
Of course you can 'guess' the right rom description quite easly, if you look at the '.rom' file sizes, you can find out which one fits the description.
other example, just quick:
contents of zip file:
Code:
1048576 Defl:N 833659 21% 2000-02-26 13:15 0de53d5e 014-v2.rom
1048576 Defl:N 595733 43% 2000-02-26 13:15 5e4381bf 014-c1.rom
1048576 Defl:N 377412 64% 2000-02-26 13:15 69ba4e18 014-c2.rom
1048576 Defl:N 556229 47% 2000-02-26 13:15 890327d5 014-c3.rom
1048576 Defl:N 410694 61% 2000-02-26 13:15 e4002651 014-c4.rom
131072 Defl:N 43526 67% 2000-02-26 13:15 b6683092 014-m1.rom
524288 Defl:N 174161 67% 2000-02-26 13:15 6f1699c8 014-p1.rom
131072 Defl:N 29476 78% 1991-07-11 22:01 99419733 014-s1.rom
1048576 Defl:N 794273 24% 2000-02-26 13:15 25419296 014-v1.rom
rc file:
Code:
game mutnat MVS "Mutation Nation"
CPU 0x100000
mnat_p1.rom 0x0 0x80000 NORM
END
SFIX 0x20000
mnat_s1.rom 0x0 0x20000 NORM
END
SM1 0x20000
mnat_m1.rom 0x0 0x20000 NORM
END
SOUND1 0x200000
mnat_v1.rom 0x0 0x100000 NORM
mnat_v2.rom 0x100000 0x100000 NORM
END
GFX 0x400000
mnat_c1.rom 0x0 0x100000 ALTERNATE
mnat_c2.rom 0x1 0x100000 ALTERNATE
mnat_c3.rom 0x200000 0x100000 ALTERNATE
mnat_c4.rom 0x200001 0x100000 ALTERNATE
END
END
./script rcfile.rc zipfile.zip
and you should have mutation nation ready to be played
enjoy