BuGS/BuGS/make/launchEmulator

40 lines
907 B
Bash
Executable File

#!/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
DISKIMAGE="$1"
if echo $DISKIMAGE | grep -v '^/' > /dev/null
then
DISKIMAGE="$PWD/$DISKIMAGE"
fi
cd make
sed -i "" "s:^s7d1 *=.*$:s7d1 = $DISKIMAGE:" config.txt
# This magic ensure that clicking stop in Xcode results in the emulator terminating.
$EMULATORPATH -fullscreen -mem 1572864 &
PID=$!
#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 "$DISKIMAGE" &
#PID=$!
trap 'kill $PID' SIGTERM SIGINT SIGHUP EXIT
wait
exit 0