%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                           %
% UniTerm Users Guide, Copyright 1986, 1987 Simon Poole     %
%                                                           %
% This file may not be changed without permission, all      %
% rights reserved.                                          %
%                                                           %
% Simon Poole                                               %
% Bahnhofstr. 51 b                                          %
% CH-5430 Wettingen                                         %
% Switzerland                                               %
%                                                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Implementation Notes} 

\section{General}       


   Most of   UniTerm  is  written  in  CCD/OSS  Pascal  and  uses
standard GEM, GEMDos, Bios and XBios calls. The exceptions are: 

\begin{itemize}
\item Scrolling, this is done with a assembler routine instead
      of a raster operations.  

\item Character   output in the 128 column,  DW and DH  modes,  is 
done  with TXTBLT (which doesn't help very much  speedwise), 
all  other  terminal  mode output is done  with  fast  custom 
assembler routines, which are at least an order of magnitude 
faster  when  using text attributes than  the  corresponding 
TXTBLT calls. 

\item Some miscellaneous routines, like CRC calculation, supervisor
peeks and pokes.
\end{itemize}


Timing information for the main loop of UniTerm:

\begin{tabbing}
MMMM\=MMMMMM\=MMM\kill 
    \> 0.14 mS   \> RS232 state, keyboard and mouse state (0.07 with new TOS)\\
    \> If characters can be read from the serial port: \\
    \> 0.18 mS  \> Cursor on/off (disabling the cursor saves this)\\
    \> Innerloop (max. 20 iterations): \\
    \> 0.1  mS  \> Character read \\
    \> 0.3  mS  \> Character output \\
    \>          \> (VT100 mode 80 columns, no attributes set) \\
\end{tabbing}

Turning history recording on will naturally make the loop slower,
scrolling speed is 42 lines per second. 

  The carrier  detect  signal  and  the break bit on the Mfp  are 
polled  once  per main loop and if they are present a appropriate 
`LED' is displayed.  


  UniTerm needs one VBL interrupt slot and also installs its  own 
mouse-movement interrupt handler in GIN mode, additionly VDI mouse-movement,
mouse-button handlers and a trap 10 handler are installed. The mouse-button
handler may cause problems with programs that use both buttons, since
it maps both to the left button (this is a workaround AES's inability
to wait for a left or right mouse-button event).



 Please note,  that unlike other available products UniTerm  does 
NOT use any undocumented locations or functions of the  operating 
system.



\section{VT102/VT100 Mode}       


\subsection{Smooth Scrolling}       

   Only works  upwards  (this  is  hopefully  the  only direction
anybody  really  needs),   this  will  be  fixed the day I get a 
blitter.  


\subsection{132 Column Mode}     

   Only 128   columns   wide,  this  is  due  to  the  640  pixel
resolution  of the ST in horizontal direction.

\subsection{Double Height/Width Characters }      

   Restrictions: no double width in color.  

\subsection{Extended character set in 8 bit mode }  

   Using the  GR  character  set  will work, but is probably very
slow  due  to  the  fact that the font has to be set/reset for every
character.  


\section{VT200 Mode}       

\subsection{VT200 function keys}       


   There is  no  default assignment of the VT200 function keys to
ST  keys,  except  for  the downloadable function key strings. If
you  need  the default VT200 keys (\Rarrow appendix~\ref{keyref}), 
build yourself a setup file with the right settings.  


\subsection{C0/C1 Modes}       

   Not implemented,  that  means UniTerm always sends C0 codes (7
bit)  (this only a restriction for the escape sequences sent  by 
the  cursor and keypad keys,  you {\em can} send 8 bit codes  from  the 
keyboard), received C1 codes will be interpreted correctly.  

\subsection{International character set }      

   The international  character  set is the default GR set (\Rarrow the
characters  that  are  between  ASCII 128 and 256). For technical
reasons  use  of the GR set is slow (the set is changed for every
character!).  


\subsection{Downloadable character set}       

   Not implemented  (very  resolution  dependent,  useless on the
ST).  




\subsection{Downloadable function keys}       


   The lock/unlock/erase  parameters  are ignored. The mapping of
the  keys  is  described in appendix~\ref{keyref}, maximum string length per
key  is 80 characters (DON'T FORGET THAT {\%} IS A SPECIAL CHARACTER
FOR UNITERM!).  




\subsection{Regis}        


   Not implemented  (very  resolution  dependent,  useless on the
ST).  

\section{Tektronix Mode}

\section{General}         


   The Tektronix  mode is still a bit in a mess. This will change
with  the  using  the  4105  command  set,  this implies that you
should  only  use  the  vector  mode of the 4010 emulation as all
other 4010 commands will probably be removed from the program.  


   Right now  scaling  is  done  with  respect  to  a  4010  with
1024*780   points,   this  probably  will  change  for  the  4105
(512*360)  emulation.  In  Tek  coordinates  the  screen measures
4096*3120 points (4105: 4096*3072 points).  


   For redrawing  and  zooming  purposes  the incoming characters
are  stored in a circular buffer. This is quite a memory saving way
to  store  them\footnote{one could naturally store the decoded vectors},
but on the other hand this means they have to be
decoded every time the vectors are drawn.  

\subsection{Alpha Mode}       


   Restrictions: 1  margin, all (well nearly all) character sizes
are the same only the spacing is different.  


\subsection{Vector Mode}      




\subsection{Zoom Mode}        


   Restrictions: No zooming of graph text, slow.  




\section{Problems}        


 Sometimes the serial port seems to blocked (this has happened to  
me with other ST terminal emulators as well), the reason for this 
still  hasn't  been discovered (probably due to a bug in  the  ST 
Bios), try resetting the terminal if this happens.  


  Don't use the \button{Set RS232 Port Parameters}\ dialog in an editor  or 
the  like,  for some mysterious reason the serial port outputs  a  
delete   character  if  you  actually change something  and  exit 
with \button{OK}(probably due to a bug in the ST Bios).  


  Don't try to use the underscore character in the  file-selector 
dialogs   (this   is   a   bug  in   GEM,   fixed   in   the   so 
called Blitter-TOS).



