28 lines
679 B
Bash
Executable file
28 lines
679 B
Bash
Executable file
#!/bin/bash -eu
|
|
|
|
cd "$(dirname "$0")" || exit 1
|
|
#CWD=$(pwd)
|
|
|
|
STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
|
|
|
|
STATEDIR=$STATE_HOME/saturn/40g
|
|
mkdir -p "$STATEDIR"
|
|
|
|
if [ ! -e "$STATEDIR"/rom.39g ]; 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.39g
|
|
cp "$STATEDIR"/../ROMs/rom.39g "$STATEDIR"/rom.39g
|
|
fi
|
|
|
|
RAM=''
|
|
if [ ! -e "$STATEDIR"/ram ]; then
|
|
RAM=-reset
|
|
fi
|
|
|
|
./saturn --hw hp40 --40g --state-dir "$STATEDIR" --rom rom.39g "$RAM" --mod mod --cpu cpu --hdw hdw "$@"
|