#!/bin/sh

if [ $# != 2 ]; then
   echo usage: $0 fromfile.rom tofile.rom
   echo
   echo copy header for file to file
   exit
fi

infile=$1
outfile=$2

echo ripping header

dd if=${infile} of=temp.rom count=1 bs=512 &&
dd if=${outfile} of=temp.rom seek=512 bs=1 &&
ucon64 --snes --chk temp.rom &&
rm -f ${outfile} &&
mv temp.rom ${outfile} &&
rm temp.bak &&

echo done...
