aaa.sl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. %
  2. % AAA.SL - EMODE support for Ann Arbor Ambassador terminals (nearly
  3. % identical to DEC VT100).
  4. %
  5. % Author: William F. Galway
  6. % Symbolic Computation Group
  7. % Computer Science Dept.
  8. % University of Utah
  9. % Date: 27 June 1982
  10. % Copyright (c) 1982 University of Utah
  11. %
  12. % Screen starts at (0,0), and other corner is offset by (79,47) (total
  13. % dimensions are 80 wide by 48 down). This corresponds to the values that
  14. % seem popular at the University of Utah CS Department. With a bit more
  15. % work, we might change the driver so that it set up the screen dimensions
  16. % by transmitting the appropriate character sequence to the terminal.
  17. (setf ScreenBase (Coords 0 0))
  18. (setf ScreenDelta (Coords 79 47))
  19. % Parity mask is used to clear "parity bit" for those terminals that don't
  20. % have a meta key. It should be 8#177 in that case. Should be 8#377 for
  21. % terminals with a meta key.
  22. (setf parity_mask 8#377)
  23. (DE EraseScreen ()
  24. (progn
  25. % First, erase the screen
  26. (PBOUT (Char ESC))
  27. (PBOUT (Char ![))
  28. (PBOUT (Char 2))
  29. (PBOUT (Char J))
  30. % then put the cursor at "home".
  31. (SetTerminalCursor 0 0)))
  32. (DE Ding ()
  33. (PBOUT (Char Bell)))
  34. % Clear to end of line from current position (inclusive).
  35. (DE TerminalClearEol ()
  36. (progn
  37. (PBOUT (Char ESC))
  38. (PBOUT (Char ![))
  39. (PBOUT (char !0))
  40. (PBOUT (Char K))))
  41. % Move physical cursor to Column,Row
  42. (DE SetTerminalCursor (ColLoc RowLoc)
  43. (progn
  44. (PBOUT (char ESC))
  45. (PBOUT (Char ![))
  46. % Use "quick and dirty" conversion to decimal digits.
  47. (PBOUT (plus (char 0) (quotient (add1 RowLoc) 10)))
  48. (PBOUT (plus (char 0) (remainder (add1 RowLoc) 10)))
  49. % Delimiter between row digits and column digits.
  50. (PBOUT (char !;))
  51. (PBOUT (plus (char 0) (quotient (add1 ColLoc) 10)))
  52. (PBOUT (plus (char 0) (remainder (add1 ColLoc) 10)))
  53. (PBOUT (char H)) % Terminate the sequence
  54. ))