saturnng/dist/saturn48gx

32 lines
805 B
Text
Raw Normal View History

2024-08-25 16:52:42 +02:00
#!/bin/bash -eu
2024-09-24 15:14:15 +02:00
cd "$(dirname "$0")" || exit 1
#CWD=$(pwd)
2024-08-29 09:44:18 +02:00
2024-08-25 16:52:42 +02:00
STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
STATEDIR=${STATEDIR:-$STATE_HOME/sb4xng/48gx}
2024-08-25 16:52:42 +02:00
mkdir -p "$STATEDIR"
2024-09-24 20:23:21 +02:00
if [ ! -e "$STATEDIR"/rom ]; then
if [ ! -d ../share/sb4xng/ROMs/ ]; then
2024-08-25 17:05:35 +02:00
echo "Error: No ROMs/ dir found"
exit 1
fi
2024-08-25 17:46:42 +02:00
if [ ! -d "$STATEDIR"/../ROMs ]; then
cp -R ../share/sb4xng/ROMs/ "$STATEDIR"/../ROMs
2024-08-25 17:46:42 +02:00
fi
2024-08-25 17:57:17 +02:00
make -C "$STATEDIR"/../ROMs gxrom-r
2024-09-24 20:23:21 +02:00
cp "$STATEDIR"/../ROMs/gxrom-r "$STATEDIR"/rom
2024-08-25 16:52:42 +02:00
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=4096
2024-09-24 20:23:21 +02:00
RESET=''
if [ ! -e "$STATEDIR"/ram ]; then
RESET=--reset
fi
sb4xng --48gx --state-dir "$STATEDIR" "$RESET" "$@"