diff --git a/dist/run48.sh b/dist/run48.sh index e83950b..21fb3c7 100755 --- a/dist/run48.sh +++ b/dist/run48.sh @@ -1,19 +1,21 @@ #!/bin/bash -eu -STATEDIR=./stateDir.48 -mkdir -p $STATEDIR +cd "$(dirname "$0")" ; CWD=$(pwd) -if [ ! -e $STATEDIR/gxrom-r ]; then +STATEDIR=$CWD/stateDir.48 +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/gxrom-r ]; then make -C .. get-roms - cp ../ROMs/gxrom-r $STATEDIR/gxrom-r + cp ../ROMs/gxrom-r "$STATEDIR"/gxrom-r fi RAM='' -if [ ! -e $STATEDIR/ram ]; then +if [ ! -e "$STATEDIR"/ram ]; then RAM=-reset fi -[ ! -e $STATEDIR/port1 ] && dd if=/dev/zero of=$STATEDIR/port1 bs=1k count=128 -[ ! -e $STATEDIR/port2 ] && dd if=/dev/zero of=$STATEDIR/port2 bs=1k count=1024 +[ ! -e "$STATEDIR"/port1 ] && dd if=/dev/zero of="$STATEDIR"/port1 bs=1k count=128 +[ ! -e "$STATEDIR"/port2 ] && dd if=/dev/zero of="$STATEDIR"/port2 bs=1k count=4096 -./run_saturn -face hp48 -hw hp48 -stateDir $STATEDIR -rom gxrom-r $RAM -port1 port1 -port2 port2 +./run_saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 diff --git a/dist/run49.sh b/dist/run49.sh index 8e8512a..c3bb20e 100755 --- a/dist/run49.sh +++ b/dist/run49.sh @@ -1,10 +1,12 @@ #!/bin/bash -eu -STATEDIR=./stateDir.49 -mkdir -p $STATEDIR +cd "$(dirname "$0")" ; CWD=$(pwd) -if [ ! -e $STATEDIR/rom.49g ]; then - ( cd $STATEDIR +STATEDIR=$CWD/stateDir.49 +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/rom.49g ]; then + ( cd "$STATEDIR" # wget -c https://www.hpcalc.org/hp49/pc/rom/hp4950v210.zip -O rom.zip wget -c https://www.hpcalc.org/hp49/pc/rom/beta1196.zip -O rom.zip unzip rom.zip @@ -13,8 +15,8 @@ if [ ! -e $STATEDIR/rom.49g ]; then fi RAM='' -if [ ! -e $STATEDIR/ram ]; then +if [ ! -e "$STATEDIR"/ram ]; then RAM=-reset fi -./run_saturn -face hp49 -hw hp49 -stateDir $STATEDIR -rom rom.49g $RAM +./run_saturn -face hp49 -hw hp49 -stateDir "$STATEDIR" -rom rom.49g $RAM