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 ;;;       VISTAR control package
12 ;;;       BSG 3/21/78 from DD4000ctl
13 ;;;
14 
15 (declare (special X Y screenheight screenlinelen))
16 (declare (special idel-lines-availablep idel-chars-availablep tty-type))
17 
18 
19 ; Initialize terminal and terminal control package.
20 (defun DCTL-init ()
21        (setq idel-lines-availablep nil idel-chars-availablep nil)
22        (setq screenheight 24. screenlinelen 79.)
23        (setq tty-type 'vistar)
24        (setq X 0 Y 0)
25        (Rtyo 14))
26 
27 
28 ; Move terminal's cursor to desired position.
29 (defun DCTL-position-cursor (x y)
30        (cond ((and (= x X)(= y Y))
31               nil)
32              ((and (= x 0)(= y 0))
33               (Rtyo 32)
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 31)))
38                     ((< x X)
39                      (do ex x (1+ ex)(= ex X)(Rtyo 010))))
40               (cond ((< Y y)
41                      (do wy Y (1+ wy)(= wy y)(Rtyo 35)))
42                     ((< y Y)
43                      (do wy y (1+ wy)(= wy Y)(Rtyo 34))))
44               (setq X x Y y))
45 ;; Direct Cursor Addressing is best.
46              (t (setq X x Y y)
47                 (Rtyo 27)(Rtyo x)(Rtyo y))))
48 
49 
50 ; Output string.
51 (defun DCTL-display-char-string (string)
52        (setq X (+ X (stringlength string)))
53        (Rprinc string))
54 
55 
56 ; Clear to end of screen.
57 (defun DCTL-clear-rest-of-screen () (Rtyo 14))
58 
59 
60 ; Clear to end of line.
61 (defun DCTL-kill-line () (Rtyo 13))
62 
63 
64