LISTING FOR >spec>on>11/30/82>tvi920.ctl COMPILED BY Multics LISP Compiler, Version hc9.2, June 5, 1981 ON 11/30/82 1530.5 mst Tue IN BEHALF OF Holmstedt.SysMaint.a ;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; TVI920 control ripped off from ADM3A, TELERAY1061 ;;; by CLS 06/20/80 ;;; modified 08/11/80 to fix insert-chars ;;; modified 09/05/80 to add pad control for =>1200 baud ;;; modified 09/18/80 by CDT to pad efficiently at all speeds ;;; The TVI920C has a 240-character writebehind buffer that can be used to ;;; good effect by carefully under-padding operations that need padding. ;;; Since there is no way to underpad these things deterministically (since ;;; emacs never lets you know when it has gone blocked for read and therefore ;;; you really don't know when the buffer is likely to have emptied itself out) ;;; we cautiously underpad by only slight amounts. (declare (special X Y screenheight screenlinelen tty-type ospeed)) (declare (special idel-lines-availablep idel-chars-availablep)) (declare (special DCTL-writebehind-buf-used)) ;;; initialize terminal and terminal control package. (defun DCTL-init () (setq idel-lines-availablep t idel-chars-availablep t) (setq screenheight 24. screenlinelen 79.) (setq tty-type 'tvi920) (DCTL-clear-writebehind-buf) (Rtyo 36)(Rtyo 33)(Rprinc "Y") (setq X 0 Y 0)) ;;; prologue and epilogue will go here ;;; Move terminal's cursor to desired position. (defun DCTL-position-cursor (x y) (cond ((and (= x X)(= y Y)) nil) ((and (= x 0)(= y 0)) (Rtyo 36) (setq X 0 Y 0)) ((and (< (+ (abs (- X x))(abs (- Y y))) 4)) (cond ((< X x) (do ex X (1+ ex)(= ex x)(Rtyo 14))) ((< x X) (do ex x (1+ ex)(= ex X)(Rtyo 10)))) (cond ((< Y y) (do wy Y (1+ wy)(= wy y)(Rtyo 12))) ((< y Y) (do wy y (1+ wy)(= wy Y)(Rtyo 13)))) (setq X x Y y)) ;; Direct cursor addressing is best. (t (setq X x Y y) (Rtyo 33)(Rprinc "=") (Rtyo (+ 40 y))(Rtyo (+ 40 x))))) ;;; Output string. (defun DCTL-display-char-string (string) (Rprinc string) (setq X (+ X (stringlength string)))) ;;; clear to end of screen. (defun DCTL-clear-rest-of-screen () (Rtyo 33)(Rprinc "Y")) ;;; Clear to end of line. (defun DCTL-kill-line () (Rtyo 33)(Rprinc "T")) ;;; Insert lines n blank lines at current position. (defun DCTL-insert-lines (n) (DCTL-clear-writebehind-buf) (do i 1 (1+ i)(> i n) (Rtyo 33)(Rprinc "E") (DCTL-underpad 78.)) (setq X 0) (DCTL-clear-writebehind-buf)) ;;; Delete lines. (defun DCTL-delete-lines (n) (DCTL-clear-writebehind-buf) (do i 1 (1+ i)(> i n) (Rtyo 33)(Rprinc "R") (DCTL-underpad 78.)) (setq X 0) (DCTL-clear-writebehind-buf)) ;;; Insert Characters (defun DCTL-insert-char-string (str) (DCTL-clear-writebehind-buf) (do i (stringlength str) (1- i) (= i 0) (Rtyo 33) (Rprinc "Q") (DCTL-underpad 19.)) (Rprinc str) (DCTL-clear-writebehind-buf) (setq X (+ X (stringlength str)))) ;;; Delete Characters. (defun DCTL-delete-chars (n) (DCTL-clear-writebehind-buf) (do i 0 (1+ i)(= i n) (Rtyo 33)(Rprinc "W") (DCTL-underpad 19.)) (DCTL-clear-writebehind-buf)) ;;; Send pad characters to wait specified number of milliseconds ;;; We underpad to take advantage of the 240-char writebehind buffer in the ;;; terminal. We underpad by 1/3 the buffer and hope it works. (defun DCTL-underpad (n) (do i (1+ (// (* n ospeed) 1000.)) (1- i) (= i 0) (setq DCTL-writebehind-buf-used (1+ DCTL-writebehind-buf-used)) (cond ((> DCTL-writebehind-buf-used 80.)(Rtyo 0))))) (defun DCTL-clear-writebehind-buf () (setq DCTL-writebehind-buf-used 0)) Functions Defined Name Offset Offset Name DCTL-clear-rest-of-screen 307 0 DCTL-init DCTL-clear-writebehind-buf 614 46 DCTL-position-cursor DCTL-delete-chars 522 272 DCTL-display-char-string DCTL-delete-lines 402 307 DCTL-clear-rest-of-screen DCTL-display-char-string 272 322 DCTL-kill-line DCTL-init 0 336 DCTL-insert-lines DCTL-insert-char-string 446 402 DCTL-delete-lines DCTL-insert-lines 336 446 DCTL-insert-char-string DCTL-kill-line 322 522 DCTL-delete-chars DCTL-position-cursor 46 560 DCTL-underpad DCTL-underpad 560 614 DCTL-clear-writebehind-buf Functions Referenced DCTL-clear-writebehind-buf Rtyo stringlength DCTL-underpad Rprinc ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved