2023-05-11 17:31:52 +03:00
|
|
|
#!/bin/sh
|
2023-05-11 18:36:41 +03:00
|
|
|
# Use the default awk in your OS:
|
|
|
|
|
AWKENGINE=awk
|
|
|
|
|
# or uncomment one of these:
|
|
|
|
|
#AWKENGINE="mawk -W posix"
|
2023-05-11 17:31:52 +03:00
|
|
|
#AWKENGINE="gawk -P"
|
|
|
|
|
#AWKENGINE="busybox awk"
|
|
|
|
|
ESC=$'\x1b'
|
|
|
|
|
STTYSTATE="$(stty -g)" # save the stty-readable state
|
|
|
|
|
trap cleanup 2 15 # trap Ctrl+C (SIGINT) and SIGTERM
|
|
|
|
|
cleanup() { # restore the state of stty and screen
|
|
|
|
|
printf '%s' "${ESC}[?47l"
|
|
|
|
|
stty "$STTYSTATE"
|
|
|
|
|
}
|
|
|
|
|
LANG=C $AWKENGINE -f tgl.awk -f dale8a.awk -v CLOCK_FACTOR=20 -- $1 # run the emulator
|
|
|
|
|
cleanup
|