OXYGENHUB
◆ main x16-emulator / .flow / jobs / boot.sh
897 B · Bourne Again Shell (bash) · executable · last changed ci: boot the R49 ROM on narvi-1 instead of the conformance suite 15 days ago source blame history raw
1
# The x16emu the build job made on narvi-1 boots the R49 ROM (in the image
2
# at /opt/x16rom) headless, to BASIC, and runs a program pasted in, which
3
# prints a sum that only right arithmetic gives: the 65C02 core, VERA's
4
# timing, the KERNAL and BASIC all working on riscv64. -echo copies what
5
# BASIC prints to stdout.
6
set -eu
7
chmod +x x16emu
8
printf '10 S=0:FOR I=1 TO 1000:S=S+I*I:NEXT\n20 PRINT "SUM";S\n' >/tmp/sum.bas
9
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy \
10
	./x16emu -rom /opt/x16rom/rom.bin -bas /tmp/sum.bas -run -echo -warp >/tmp/echo.txt 2>&1 &
11
emu=$!
12
i=0
13
while ! grep -q "SUM 333833500" /tmp/echo.txt && [ $i -lt 120 ]; do
14
	sleep 1
15
	i=$((i + 1))
16
done
17
kill $emu 2>/dev/null || true
18
tr -cd '[:print:]\n' </tmp/echo.txt
19
grep -q "SUM 333833500" /tmp/echo.txt || { echo "boot: BASIC did not print SUM 333833500 within ${i} s"; exit 1; }
20
echo "boot: BASIC ran on $(uname -m) in ${i} s"