1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 (declare (special X Y screenheight screenlinelen tty-type))
16 (declare (special idel-lines-availablep idel-chars-availablep))
17
18
19
20 (defun DCTL-init ()
21 (setq idel-lines-availablep nil idel-chars-availablep nil)
22 (setq screenheight 24. screenlinelen 79.)
23 (setq tty-type 'dm1521)
24 (Rtyo 14)
25 (setq X 0 Y 0))
26
27
28
29 (defun DCTL-position-cursor (x y)
30 (cond ((and (= x X)(= y Y))
31 nil)
32 ((and (= x 0)(= y 0))
33 (Rtyo 31)
34 (setq X 0 Y 0))
35 ((and (< (+ (abs (- X x))(abs (- Y y))) 4))
36 (cond ((< X x)
37 (do ex X (1+ ex)(= ex x)(Rtyo 34)))
38 ((< x X)
39 (do ex x (1+ ex)(= ex X)(Rtyo 10))))
40 (cond ((< Y y)
41 (do wy Y (1+ wy)(= wy y)(Rtyo 12)))
42 ((< y Y)
43 (do wy y (1+ wy)(= wy Y)(Rtyo 37))))
44 (setq X x Y y))
45
46 (t (setq X x Y y)
47 (Rtyo 36)(Rtyo (+ 40 x))(Rtyo y)
48 )))
49
50
51
52 (defun DCTL-display-char-string (string)
53 (setq X (+ X (stringlength string)))
54 (Rprinc string))
55
56
57
58 (defun DCTL-clear-rest-of-screen ()
59 (Rtyo 13))
60
61
62
63 (defun DCTL-kill-line ()
64 (Rtyo 35))