2020-06-11 01:47:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ ! -z "$GSPLUS" ] && [ -x "$GSPLUS" ]
|
|
|
|
then
|
|
|
|
EMULATORPATH="$GSPLUS"
|
|
|
|
elif [ ! -z "$GSPORT" ] && [ -x "$GSPORT" ]
|
|
|
|
then
|
|
|
|
EMULATORPATH="$GSPORT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$EMULATORPATH" ]
|
|
|
|
then
|
|
|
|
echo Unable to find GSplus or GSport at these locations.
|
|
|
|
echo " GSPLUS=$GSPLUS"
|
|
|
|
echo " GSPORT=$GSPORT"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-01-05 03:34:45 +00:00
|
|
|
BOOTIMAGE="$1"
|
|
|
|
if echo $BOOTIMAGE | grep -v '^/' > /dev/null
|
|
|
|
then
|
|
|
|
BOOTIMAGE="$PWD/$BOOTIMAGE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DISKIMAGE="$2"
|
2020-06-11 01:47:00 +00:00
|
|
|
if echo $DISKIMAGE | grep -v '^/' > /dev/null
|
|
|
|
then
|
|
|
|
DISKIMAGE="$PWD/$DISKIMAGE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# This magic ensure that clicking stop in Xcode results in the emulator terminating.
|
|
|
|
|
2020-12-25 06:19:19 +00:00
|
|
|
if true
|
2020-11-30 05:11:55 +00:00
|
|
|
then
|
2021-01-05 03:34:45 +00:00
|
|
|
cd make
|
|
|
|
sed -i "" "s:^s7d1 *=.*$:s7d1 = $BOOTIMAGE:
|
|
|
|
s:^s5d1 *=.*:s5d1 = $DISKIMAGE:" config.txt
|
|
|
|
$EMULATORPATH -fullscreen -mem 1572864 &
|
|
|
|
PID=$!
|
2020-11-30 05:11:55 +00:00
|
|
|
else
|
2021-01-05 03:34:45 +00:00
|
|
|
cd "/Users/jrand/Library/Application Support/Ample"
|
|
|
|
/Applications/Ample.app/Contents/MacOS/mame64 apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 -hard1 "$BOOTIMAGE" -flop3 "$DISKIMAGE" &
|
|
|
|
PID=$!
|
2020-11-30 05:11:55 +00:00
|
|
|
fi
|
2020-06-11 01:47:00 +00:00
|
|
|
|
|
|
|
trap 'kill $PID' SIGTERM SIGINT SIGHUP EXIT
|
|
|
|
wait
|
|
|
|
|
|
|
|
exit 0
|