-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvt100terminal.txt
109 lines (80 loc) · 1.82 KB
/
vt100terminal.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
\ *********************************************************************
\ VT100
\ Filename: vt100terminal.txt
\ Date: 15/09/2020
\ Updated: 17/09/2020
\ File Version: 1.0
\ MCU: ARDUINO all models
\ Copyright: Marc PETREMANN
\ Author: Marc PETREMANN
\ GNU General Public License
\ *********************************************************************
\ convert int to char sequence and display it
: .#c ( n ---)
base @ >r
decimal
0 \ convert to unsigned double integer
<# #s #> \ convert to string
type \ display string
r> base ! ;
\ start escape sequence
: .esc ( ---)
27 emit ; \ send ESC char
\ start escape[ sequence
: .esc[ ( ---)
.esc
[char] [ emit ; \ send ESC[ char
\ set cursor at x y position on screen terminal
: at-xy ( x y ---)
.esc[
.#c \ send y position
[char] ; emit
.#c \ send x position
[char] H emit ;
\ clear entire screen
: page ( ---)
.esc[ ." 2J"
0 0 at-xy ;
0 constant black
1 constant red
2 constant green
3 constant yellow
4 constant blue
5 constant magenta
6 constant cyan
7 constant white
: bold ( ---)
.esc[ ." 1m" ;
: underline ( ---)
.esc[ ." 4m" ;
: negative ( ---)
.esc[ ." 7m" ;
: normal ( ---)
.esc[ ." 0m" ;
: background ( color ---)
.esc[
[char] 4 emit
.#c
[char] m emit ;
: foreground ( color ---)
.esc[
[char] 3 emit
.#c
[char] m emit ;
: alternate-font ( ---)
.esc ." (0" ;
: ascii-font ( ---)
.esc ." (B" ;
: .chars ( ---)
128 32 - for
r@ 32 + emit
next ;
\ *** NOT FUNCTIONNAL ***
: primary-font
.esc[ ." 10m" ;
: f1
.esc[ ." 11m" ;
: rf \ reset font config
.esc[ ." 10c" ;
: italic
.esc[ ." 3m" ;