From ac10ee23ffeea856d971d98c10e122d90b4282f8 Mon Sep 17 00:00:00 2001 From: d6 Date: Mon, 23 Jan 2023 21:18:50 -0500 Subject: [PATCH] add more control sequences --- term.tal | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/term.tal b/term.tal index 1a82daf..ba4e4ab 100644 --- a/term.tal +++ b/term.tal @@ -7,6 +7,8 @@ ( ) ( move cursor home: ESC [ H ) ( move cursor: ESC [ $row ; $col H ) +( move to column: ESC [ $n G ) +( move to row: ESC [ $n d ) ( move up: ESC [ $n A ) ( move down: ESC [ $n B ) ( move forward: ESC [ $n C ) @@ -19,9 +21,10 @@ ( erase from current line to top: ESC [ 1 J ) ( erase screen: ESC [ 2 J ) ( ) -( ??? ESC [ ... ? ) -( ??? ESC [ ... d ) -( ??? ESC [ ... G ) +( NOT SUPPORTED YET: ) +( show cursor: ESC [ ? 25 h ) +( hide cursor: ESC [ ? 25 l ) +( various: ESC [ ? ... ) |00 @System [ &vect $2 &pad $6 &r $2 &g $2 &b $2 ] |10 @Console [ &vect $2 &r $1 &pad $5 &w $1 ] @@ -216,10 +219,12 @@ @end-arg ( c^ -> ) ;on-read .Console/vect DEO2 DUP ,debug-seq JSR + DUP LIT "d EQU ;exec-move-row JCN2 ( move cursor to row ) DUP LIT "h EQU ;exec-noop JCN2 ( enable line wrap ) DUP LIT "l EQU ;exec-noop JCN2 ( disable line wrap ) DUP LIT "m EQU ;exec-noop JCN2 ( set attr ) DUP LIT "n EQU ;exec-status JCN2 ( get status ) + DUP LIT "G EQU ;exec-move-col JCN2 ( move cursor to col ) DUP LIT "H EQU ;exec-move JCN2 ( move cursor ) DUP LIT "A EQU ;exec-up JCN2 ( up ) DUP LIT "B EQU ;exec-down JCN2 ( down ) @@ -289,6 +294,18 @@ #01 .dirty? STZ ( ; FIXME just redraw affected tiles ) JMP2r ( ) +@exec-move-row ( c^ -> ) + POP + #0001 ;read-arg-1 JSR2 #0001 SUB2 ( row ) + .cur-x LDZ2 ( col ) + ;goto JSR2 BRK + +@exec-move-col ( c^ -> ) + POP + .cur-y LDZ2 ( row ) + #0001 ;read-arg-2 JSR2 #0001 SUB2 ( col ) + ;goto JSR2 BRK + @exec-move ( c^ -> ) POP #0001 ;read-arg-1 JSR2 #0001 SUB2 ( row )