hackrom 485 Bytes
#!/bin/bash -x
GAME=$1
REPOSITORY=${REPOSITORY:=/d2/mp3/roms}
PATCH_FUNCS=${PATCH_FUNCS:=patch_funcs}
CID=`python -c "print '%08x' % hash('$GAME')"`
METADATA="errataSize=16384,errataAddress=0x807bc000"
if [ "$MD_OPTS" != "" ]; then
  METADATA="$METADATA,$MD_OPTS"
fi
./romhack -i $REPOSITORY/$GAME.rom -o $REPOSITORY/patch.test/$GAME.rom -v -p $PATCH_FUNCS $HACK_OPTS
pubrom -t $GAME -m "$METADATA" $REPOSITORY/patch.test/$GAME.rom 0x$CID
mv $CID.app $CID.cmd $REPOSITORY/publish.test