forked from opencode.energia.arti.ee/vt1200
- seed the game from the raw 0x1E93C0 counter (now_ms() returns 0 on its
first call, so the old seed was always zero)
- track pause ourselves: FocusOut pauses once, FocusIn resumes only what we
paused (game_input('p') is a toggle)
- select ExposureMask so the Expose redraw path actually fires
- play.sh/play_keys.sh rebuild the COFF (OUTNAME=termtris) and assert the
run: status=0, tick>0, loops/events/quit per mode; render.sh asserts the
renderer finished; map symbol lookup is column-order independent
- run.sh passes -lightgun -lightgun_device mouse so the pointer drives the
tablet
- docs: link map addresses, monochrome/reverse wording, honest caption and
limits text
Verified here: play.sh and input.sh pass. Still open: the MAME driver in the
tree is newer than the installed binary (Oct 30 build, VR150-era geometry),
so the acceptance suite must be re-run after a rebuild.
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# run.sh -- load termtris into a running VT1200 OS under MAME and play it.
|
|
#
|
|
# apps/termtris/run.sh # click the window active, then play
|
|
# apps/termtris/run.sh --build # rebuild the COFF first
|
|
#
|
|
# The emulated keyboard and tablet are driven by MAME's host input, so the
|
|
# terminal's X cursor follows the host pointer. Quit with Ctrl-C in the
|
|
# terminal running MAME, or press 'q' in the game (it stops the game loop).
|
|
set -eu
|
|
|
|
DIR=$(cd "$(dirname "$0")" && pwd)
|
|
ROOT=$(cd "$DIR/../.." && pwd)
|
|
M=${MAME:-/home/arti/code/k-space/mame0289/vt1200}
|
|
LOADER="$ROOT/dwt/loader/build/loader.bin"
|
|
COFF="$DIR/build/termtris.coff"
|
|
|
|
if [ "${1:-}" = "--build" ]; then
|
|
"$DIR/build.sh" "$DIR/src/vt1200/main.c" "$DIR/src/game.c" \
|
|
"$DIR/src/vt1200/scoredb.c" "$DIR/src/vt1200/x11.c" \
|
|
"$DIR/src/vt1200/compat.c" "$DIR/src/vt1200/xgfix.c"
|
|
fi
|
|
|
|
if [ ! -f "$COFF" ]; then
|
|
echo "run.sh: no $COFF (run with --build)" >&2
|
|
exit 1
|
|
fi
|
|
if [ ! -f "$LOADER" ]; then
|
|
echo "run.sh: no loader payload at $LOADER" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# The game is loaded at frame 2500, once the OS X server is up.
|
|
exec env VT1200_SKIP_LEVEL1=1 \
|
|
LOADER_AT=2500 LOADER_END=100000000 \
|
|
LOADER_BIN="$LOADER" LOADER_COFF="$COFF" LOADER_OUT="$DIR/build" \
|
|
"$M" vt1200 -rompath "$ROOT/harness/mame/roms" \
|
|
-skip_gameinfo -debug -debugger none \
|
|
-lightgun -lightgun_device mouse \
|
|
-autoboot_script "$DIR/tests/play.lua" -autoboot_delay 0
|