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 (%include e-macros)
27 (declare (special X Y screenheight screenlinelen ospeed))
28 (declare (special idel-lines-availablep idel-chars-availablep tty-type))
29 (declare (*expr Rprinc Rtyo))
30
31
32 (defun DCTL-init ()
33 (setq idel-lines-availablep t idel-chars-availablep nil)
34 (setq screenheight 24. screenlinelen 79.)
35 (setq tty-type 'infoton100)
36 (DCTL-home-cursor)
37 (DCTL-clear-rest-of-screen)
38 (setq X 0 Y 0))
39
40
41 (defun DCTL-position-cursor (x y)
42 (cond ((and (= x X)(= y Y))
43 nil)
44 ((and (= x 0)(= y 0))
45 (DCTL-home-cursor)
46 (setq X 0 Y 0))
47 ((and (< (+ (abs (- X x))(abs (- Y y))) 4))
48 (cond ((< X x)
49 (do ex X (1+ ex)(= ex x)(Rtyo 33)(Rprinc "C")))
50 ((< x X)
51 (do ex x (1+ ex)(= ex X)(Rtyo 010))))
52 (cond ((< Y y)
53 (do wy Y (1+ wy)(= wy y)(Rtyo 33)(Rprinc "B")))
54 ((< y Y)
55 (do wy y (1+ wy)(= wy Y)(Rtyo 33)(Rprinc "A"))))
56 (setq X x Y y))
57
58 (t (setq X x Y y)
59 (Rtyo 33)(Rprinc "f")(Rtyo (+ 40 x))(Rtyo (+ 40 y))
60 )))
61
62
63 (defun DCTL-display-char-string (string)
64 (setq X (+ X (stringlength string)))
65 (Rprinc string))
66
67
68 (defun DCTL-home-cursor ()
69 (Rtyo 33) (Rprinc "H"))
70
71
72 (defun DCTL-clear-rest-of-screen ()
73 (Rtyo 33) (Rprinc "J"))
74
75
76 (defun DCTL-kill-line ()
77 (Rtyo 33)(Rprinc "K"))
78
79
80 (defun DCTL-insert-lines (n)
81 (do i 1 (1+ i)(> i n)
82 (Rtyo 33) (Rprinc "L")
83 (DCTL-pad 100000.)))
84
85
86 (defun DCTL-delete-lines (n)
87 (do i 1 (1+ i)(> i n)
88 (Rtyo 33) (Rprinc "M")
89 (DCTL-pad 100000.)))
90
91
92 (defun DCTL-pad (n)
93 (do i (// (* n ospeed) 1000000.) (1- i) (= i 0)
94 (Rtyo 0)))
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110