saturnng/dist/saturn49g
2024-08-29 09:44:18 +02:00

27 lines
639 B
Bash
Executable file

#!/bin/bash -eu
cd "$(dirname "$0")" ; CWD=$(pwd)
STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
STATEDIR=$STATE_HOME/saturn/49g
mkdir -p "$STATEDIR"
if [ ! -e "$STATEDIR"/rom.49g ]; then
if [ ! -d ../share/saturn/ROMs/ ]; then
echo "Error: No ROMs/ dir found"
exit 1
fi
if [ ! -d "$STATEDIR"/../ROMs ]; then
cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs
fi
make -C "$STATEDIR"/../ROMs rom.49g
cp "$STATEDIR"/../ROMs/rom.49g "$STATEDIR"/rom.49g
fi
RAM=''
if [ ! -e "$STATEDIR"/ram ]; then
RAM=-reset
fi
./saturn -face hp49 -hw hp49 -stateDir "$STATEDIR" -rom rom.49g $RAM "$@"