2024-08-25 17:57:17 +02:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
2024-08-29 09:44:18 +02:00
|
|
|
cd "$(dirname "$0")" ; CWD=$(pwd)
|
|
|
|
|
2024-08-25 17:57:17 +02:00
|
|
|
STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
|
|
|
|
|
|
|
|
STATEDIR=$STATE_HOME/saturn/40g
|
|
|
|
mkdir -p "$STATEDIR"
|
|
|
|
|
2024-08-25 18:01:16 +02:00
|
|
|
if [ ! -e "$STATEDIR"/rom.39g ]; then
|
2024-08-29 09:44:18 +02:00
|
|
|
if [ ! -d ../share/saturn/ROMs/ ]; then
|
2024-08-25 17:57:17 +02:00
|
|
|
echo "Error: No ROMs/ dir found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -d "$STATEDIR"/../ROMs ]; then
|
2024-08-29 09:44:18 +02:00
|
|
|
cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs
|
2024-08-25 17:57:17 +02:00
|
|
|
fi
|
2024-08-25 18:01:16 +02:00
|
|
|
make -C "$STATEDIR"/../ROMs rom.39g
|
|
|
|
cp "$STATEDIR"/../ROMs/rom.39g "$STATEDIR"/rom.39g
|
2024-08-25 17:57:17 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
RAM=''
|
|
|
|
if [ ! -e "$STATEDIR"/ram ]; then
|
|
|
|
RAM=-reset
|
|
|
|
fi
|
|
|
|
|
2024-08-29 09:44:18 +02:00
|
|
|
./saturn -face hp40 -hw hp40 -stateDir "$STATEDIR" -rom rom.39g $RAM "$@"
|