spacetaxi/tools/stsim/gateLib.sh
2026-10-05 18:50:09 -05:00

25 lines
1 KiB
Bash

# Sourced by gate.sh and celGate.sh, which set $here first: the rides both
# gates replay, and the levels they replay them on.
# Every hook level as letter:level file number, and how long each ride runs.
ticks=4000
pairs="H:08 T:20 W:23 X:24 G:07 I:09 K:11 O:15 Q:17 R:18 U:21 V:22 E:05 J:10 L:12 P:16 S:19"
# The game's own level bake (program.mk). It is the same STL4 bytes for every
# target, so whichever target was built first will do; STSIM_LEVELS names
# another folder.
levels=${STSIM_LEVELS:-}
if [ -z "$levels" ]; then
for port in iigs dos amiga atarist x68000; do
if [ -f "$here/../../build/generated/$port/levels/level01.dat" ]; then
levels=$(cd "$here/../../build/generated/$port/levels" && pwd)
break
fi
done
fi
if [ -z "$levels" ]; then
echo "$(basename "$0"): no level bake in build/generated/<port>/levels (scripts/importData.sh, then make)" >&2
exit 2
fi
make -C "$here" >/dev/null || { echo "$(basename "$0"): building stsim failed" >&2; exit 2; }