  % -*- Mode:TeX -*-
\chapter{Configuring the monitor(s)}\label{monitor}

\Cam\ produces a video signal intended to directly drive a standard \pc\ color monitor,\footnote
        {I.e., TTL RGBI, NTSC-compatible scanning format, with 60 Hz vertical sync
and 15,750 Hz horizontal sync---such as produced by a CGA card and accepted by
any CGA-compatible monitor, including EGA monitors and most multi-sync monitors.}
        and thus a color graphics adapter card is not needed.  However,
when using \cam\ it is desirable to retain the ordinary text terminal
functions of the \pc, and this can be done by either having a separate
monitor for the \pc\ or sharing a monitor between the \pc\ and the \cam\
card(s).\index{Monitor/configuration}


\section{Display multiplexing}

\index{Display/mode}The most trivial hook-up entails leaving the \pc\ connected to its own
monitor (either monochrome, through a monochrome card, or color, through
a color card), and adding a separate color monitor for \cam\ (or for each
of the \cam{}s if you have more than one), connected to the card's {\sl video-out}
port.

On the other hand, for economy, portability, or compactness you may want
to use only one monitor for both \cam\ and the \pc.  Moreover, if you have more than one \cam\
card installed, it may be impractical to use a separate monitor for
each card.

In order to provide maximum flexibility, the \cam\ card
has a {\sl video-in} as well as a  {\sl video-out} connector, and is equipped with
a two-input/one-output ``daisy-chain'' multiplexer, denoted by `MPX' in
the following diagram
        $$
        \setlength{\tabcolsep}{0pt}
        \begin{tabular}{|c|r|c|cl}
        \multicolumn{3}{c}{{\sc cam} card} \\
        \cline{1-1}\cline{3-3}
        {\sc cam} & $\longrightarrow$ & int\quad ext  & $\longleftarrow$  & video-in\\
        processor &                   &      MPX      & $\longrightarrow$ & video-out\\
        \cline{1-1}\cline{3-3}
        \end{tabular}
        $$
        \noindent ({\sl video-out} is a female 9-pin connector, {\sl video-in} a male one).
Depending on the setting (`int' or `ext') of a software switch, the signal appearing
at the video-out port will be either the \cam\ processor's {\sl internal} video signal
or a (TTL-buffered) copy of whatever {\sl external} signal is coming through the video-in port.

\medskip

Thus, for the trivial hook-up mentioned above the switch would be permanently set on the `int'
position and \cam's color monitor would be plugged into the video-out port, while
the video-in port would be left disconnected. The \pc's output would go directly
to its own monitor. This mode of operation is selected by the command
\id|2|\iprog{DISPLAYS}.

On the other hand, if your \pc\ comes equipped with a {\sl color} card, 
you can use a single color monitor and time-share it between \cam\ and the \pc.
In this case, the output of the color card would go
to \cam's video-in port via the {\sl routing cable}.\footnote
        {Supplied with \cam. This is just a foot or so of 9-conductor cable, with a male header at one
end and a female at the other. Pin 1 goes straight to pin 1, and so on.}
         This mode of operation is selected by the command
\id|1|\iprog{DISPLAYS}.  In this mode, pressing the \icp\keya\ key from
\cam's \cp\ will toggle the display source between `int' (the \cam\
signal) and `ext' (the \pc\ signal). Control-panel keys that
request keyboard input, such as \keyP\ and \keyG\ (but not \keyf) temporarily
switch back to the \pc\ display for this input.

As distributed, the \prog{CAM} program defaults to this ``{\tt 1
DISPLAYS}'' time-shared mode\index{Display/mode} (cf.\ Section \ref{first-exp}), and
initially selects the \pc\ as the display source.  See below and
Section \ref{personalize} for ways to customize the software so as to
reflect your actual monitor hook-up.

\medskip

\noindent {\bf Warning}: {\sl Do not attempt to share a single display with a {\rm monochrome}
card, unless you have a special, multi-purpose monitor that can indifferently accept color
or monochrome signals. Many color monitors (and in particular the standard {\sc ibm} one)
can be permanently damaged when driven by the 18-KHz horizontal sync provided by
the monochrome card.

For similar reasons, do not connect a standard \pc\ {\rm monochrome}
monitor to \cam's output (which is equivalent to that of a color card).
It won't work, and may be permanently damaged.}

\section{Multiple CAM{}s}\label{multi-card}

If your \pc\ is equipped with two or more%\index{Multiple \sc cam\rm s}
\cam\ cards\footnote
        {The software must be made aware of this by the command $n$
{\tt CAMS}\index{CAMS{\tt CAMS}}; see Section \ref{multiple}.}
        the fully nonmultiplexed display mode is selected by the command
$n$+1\iprog{DISPLAYS}, where $n$ is the number of cards you have (e.g.,
\id|5 DISPLAYS| for four cards).  The video signals from the $n$ cards
will go directly to the $n$ color monitors, while that from the \pc\
will go to the ($n$+1)-th monitor (color or monochrome).

\medskip

If you want to use one color monitor for all the \cam{}s and a
separate monitor for the \pc, daisy-chain the \cam{}s only and use the \id|2
DISPLAYS| mode. Typing \narg{3}\keya\ from the \cp\ will route to
the one color monitor the video signal from \cam\ 3 (remember that the numbering of \cam\ cards
starts from 0!); typing just \keya\
will have no effect.

If you want to share that one color monitor also with the \pc,
chain the \pc's video output to the last \cam's video-in port
and use the \id|1 DISPLAYS| mode. Typing \narg{3}\keya\ from the \cp\ will route to
the monitor the video signal from \cam\ 3; subsequently, typing just \keya\ will toggle
the display between the \pc\ and \cam\ 3.

\bigskip
{\small

A bit called \iprog{CAMOUT} in \cam's \iprog{CCR} register ({\sl
control and configuration register}) determines whether the external
(\id|0|) or the internal (\id|1|) video signal is fed to the video-out
port.  To set this bit for, say, \cam\ 3 you do
        \begin{verbatim}
    3 CAM-SELECT  CAMOUT SET-CCR\end{verbatim}
        and similarly you clear it with \id|CLR-CCR|.

These primitives are called by the Forth word \id|DISPLAYS| and the
\cxp\ functions attached to the \keya\ key; they can be used directly for
special configuration needs.

When you are in a fully non-multiplexed mode, the \cp\ will not
change any \prog{CAMOUT} bits. Thus, if you want to directly manipulate
these bits for several \cam{}s you should begin by telling the software that
you have $n$+1 displays.

}