diff --git a/femto b/femto index d267560..0812f55 100755 --- a/femto +++ b/femto @@ -7,7 +7,7 @@ TTY=`stty -g` BASE="$HOME/w/nxu" -if [ $1 = "-r" ]; then +if [ "$1" = "-r" ]; then shift uxnasm "$BASE/femto.tal" "$BASE/femto.rom" fi diff --git a/femto.tal b/femto.tal index 069ea3b..13d127a 100644 --- a/femto.tal +++ b/femto.tal @@ -23,6 +23,10 @@ %cr { #0d18 DEO } %crlf { cr nl } %ansi { #1b18 DEO #5b18 DEO } +%alternate-buffer-on { ( \e[?1049h ) + ansi #3f18 DEO #3118 DEO #3018 DEO #3418 DEO #3918 DEO #6818 DEO } +%alternate-buffer-off { ( \e[?1049l ) + ansi #3f18 DEO #3118 DEO #3018 DEO #3418 DEO #3918 DEO #6c18 DEO } ( emit macros ) ( ) @@ -51,6 +55,7 @@ %emit-~ { LIT2 "~ 18 DEO } %quit! { #01 .System/halt DEO BRK } +%quit-restore! { alternate-buffer-off quit! } %lmargin { #0006 } ( zero page ) @@ -138,7 +143,8 @@ ( startup ) |0100 - .Console/type DEI ?{ ;messages/usage print crlf quit! } + .Console/type DEI ?{ ;messages/usage print crlf quit! } + alternate-buffer-on ( init zero page ) #0050 .term/cols STZ2 @@ -457,10 +463,10 @@ ;messages/unknown-input ;tmp send-message BRK -( label that calls quit! ) +( label that calls quit-restore! ) ( ) ( this definition is needed so the address can be used by JCN2. ) -@quit-now quit! +@quit-now quit-restore! ( label that calls BRK ) ( )