1 ;;; ***********************************************************
 2 ;;; *                                                         *
 3 ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4 ;;; *                                                         *
 5 ;;; * Copyright (c) 1978 by Massachusetts Institute of        *
 6 ;;; * Technology and Honeywell Information Systems, Inc.      *
 7 ;;; *                                                         *
 8 ;;; ***********************************************************
 9 ;;;
10 ;;;
11 ;;;            TVI912 Controller - ripped off from TVI920 controller.
12 ;;;               written by R. Jarrell Aug. 1982
13 ;;;
14 
15 (declare (special X Y screenheight screenlinelen tty-type ospeed))
16 (declare (special idel-lines-availablep idel-chars-availablep))
17 
18 
19 
20 ;;; initialize terminal and terminal control package.
21 
22 (defun DCTL-init ()
23        (setq idel-lines-availablep nil idel-chars-availablep nil)
24        (setq screenheight 24. screenlinelen 79.)
25        (setq tty-type 'tvi912)
26 
27        (Rtyo 36)(Rtyo 33)(Rprinc "Y")
28        (setq X 0 Y 0))
29 
30 ;;; prologue and epilogue will go here
31 
32 
33 ;;; Move terminal's cursor to desired position.
34 
35 (defun DCTL-position-cursor (x y)
36        (cond ((and (= x X)(= y Y))
37               nil)
38              ((and (= x 0)(= y 0))
39               (Rtyo 36)
40              (setq X 0 Y 0))
41              ((and (< (+ (abs (- X x))(abs (- Y y))) 4))
42               (cond ((< X x)
43                      (do ex X (1+ ex)(= ex x)(Rtyo 14)))
44                     ((< x X)
45                      (do ex x (1+ ex)(= ex X)(Rtyo 10))))
46               (cond ((< Y y)
47                      (do wy Y (1+ wy)(= wy y)(Rtyo 12)))
48                     ((< y Y)
49                      (do wy y (1+ wy)(= wy Y)(Rtyo 13))))
50               (setq X x Y y))
51 ;; Direct cursor addressing is best.
52               (t (setq X x Y y)
53                  (Rtyo 33)(Rprinc "=")
54                  (Rtyo (+ 40 y))(Rtyo (+ 40 x)))))
55 
56 
57 ;;; Output string.
58 
59 (defun DCTL-display-char-string (string)
60        (Rprinc string)
61        (setq X (+ X (stringlength string))))
62 
63 
64 ;;; clear to end of screen.
65 
66 (defun DCTL-clear-rest-of-screen ()
67        (Rtyo 33)(Rprinc "Y"))
68 
69 
70 ;;; Clear to end of line.
71 
72 (defun DCTL-kill-line ()
73        (Rtyo 33)(Rprinc "T"))
74 
75