\section{drawing.h File Reference}
\label{drawing.h}\index{drawing.h@{drawing.h}}
All Points Addressable (APA) mode drawing library. 


\subsection*{Defines}
\begin{CompactItemize}
\item 
\label{drawing.h_a0}
\index{GRAPHICS_WIDTH@{GRAPHICS\_\-WIDTH}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!GRAPHICS_WIDTH@{GRAPHICS\_\-WIDTH}}
\#define {\bf GRAPHICS\_\-WIDTH}
\begin{CompactList}\small\item\em Size of the screen in pixels.\item\end{CompactList}

\item 
\label{drawing.h_a2}
\index{SOLID@{SOLID}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!SOLID@{SOLID}}
\#define {\bf SOLID}
\begin{CompactList}\small\item\em Possible drawing modes.\item\end{CompactList}

\item 
\label{drawing.h_a6}
\index{WHITE@{WHITE}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!WHITE@{WHITE}}
\#define {\bf WHITE}
\begin{CompactList}\small\item\em Possible drawing colours.\item\end{CompactList}

\item 
\label{drawing.h_a10}
\index{M_NOFILL@{M\_\-NOFILL}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!M_NOFILL@{M\_\-NOFILL}}
\#define {\bf M\_\-NOFILL}
\begin{CompactList}\small\item\em Possible fill styles for {\bf box}() {\rm (p.~\pageref{drawing.h_a23})} and {\bf circle}() {\rm (p.~\pageref{drawing.h_a24})}.\item\end{CompactList}

\item 
\label{drawing.h_a12}
\index{SIGNED@{SIGNED}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!SIGNED@{SIGNED}}
\#define {\bf SIGNED}
\begin{CompactList}\small\item\em Possible values for signed\_\-value in {\bf gprintln}() {\rm (p.~\pageref{drawing.h_a15})} and {\bf gprintn}() {\rm (p.~\pageref{drawing.h_a16})}.\item\end{CompactList}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\label{drawing.h_a14}
\index{gprint@{gprint}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!gprint@{gprint}}
void {\bf gprint} (char $\ast$str) NONBANKED
\begin{CompactList}\small\item\em Print the string 'str' with no interpretation.\item\end{CompactList}

\item 
void {\bf gprintln} ({\bf INT16} number, {\bf INT8} radix, {\bf INT8} signed\_\-value)
\begin{CompactList}\small\item\em Print the long number 'number' in radix 'radix'.\item\end{CompactList}

\item 
\label{drawing.h_a16}
\index{gprintn@{gprintn}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!gprintn@{gprintn}}
void {\bf gprintn} ({\bf INT8} number, {\bf INT8} radix, {\bf INT8} signed\_\-value)
\begin{CompactList}\small\item\em Print the number 'number' as in 'gprintln'.\item\end{CompactList}

\item 
\label{drawing.h_a17}
\index{gprintf@{gprintf}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!gprintf@{gprintf}}
{\bf INT8} {\bf gprintf} (char $\ast$fmt,...) NONBANKED
\begin{CompactList}\small\item\em Print the formatted string 'fmt' with arguments '...'.\item\end{CompactList}

\item 
\label{drawing.h_a18}
\index{plot@{plot}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!plot@{plot}}
void {\bf plot} ({\bf UINT8} x, {\bf UINT8} y, {\bf UINT8} colour, {\bf UINT8} mode)
\begin{CompactList}\small\item\em Old style plot - try {\bf plot\_\-point}() {\rm (p.~\pageref{drawing.h_a19})}.\item\end{CompactList}

\item 
\label{drawing.h_a19}
\index{plot_point@{plot\_\-point}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!plot_point@{plot\_\-point}}
void {\bf plot\_\-point} ({\bf UINT8} x, {\bf UINT8} y)
\begin{CompactList}\small\item\em Plot a point in the current drawing mode and colour at (x,y).\item\end{CompactList}

\item 
\label{drawing.h_a20}
\index{switch_data@{switch\_\-data}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!switch_data@{switch\_\-data}}
void {\bf switch\_\-data} ({\bf UINT8} x, {\bf UINT8} y, unsigned char $\ast$src, unsigned char $\ast$dst) NONBANKED
\begin{CompactList}\small\item\em I (MLH) have no idea what switch\_\-data does...\item\end{CompactList}

\item 
\label{drawing.h_a21}
\index{draw_image@{draw\_\-image}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!draw_image@{draw\_\-image}}
void {\bf draw\_\-image} (unsigned char $\ast$data) NONBANKED
\begin{CompactList}\small\item\em Ditto.\item\end{CompactList}

\item 
\label{drawing.h_a22}
\index{line@{line}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!line@{line}}
void {\bf line} ({\bf UINT8} x1, {\bf UINT8} y1, {\bf UINT8} x2, {\bf UINT8} y2)
\begin{CompactList}\small\item\em Draw a line in the current drawing mode and colour from (x1,y1) to (x2,y2).\item\end{CompactList}

\item 
\label{drawing.h_a23}
\index{box@{box}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!box@{box}}
void {\bf box} ({\bf UINT8} x1, {\bf UINT8} y1, {\bf UINT8} x2, {\bf UINT8} y2, {\bf UINT8} style)
\begin{CompactList}\small\item\em Draw a box (rectangle) with corners (x1,y1) and (x2,y2) using fill mode 'style' (one of NOFILL or FILL.\item\end{CompactList}

\item 
void {\bf circle} ({\bf UINT8} x, {\bf UINT8} y, {\bf UINT8} radius, {\bf UINT8} style)
\begin{CompactList}\small\item\em Draw a circle with centre at (x,y) and radius 'radius'.\item\end{CompactList}

\item 
\label{drawing.h_a25}
\index{getpix@{getpix}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!getpix@{getpix}}
{\bf UINT8} {\bf getpix} ({\bf UINT8} x, {\bf UINT8} y)
\begin{CompactList}\small\item\em Returns the current colour of the pixel at (x,y).\item\end{CompactList}

\item 
\label{drawing.h_a26}
\index{wrtchr@{wrtchr}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!wrtchr@{wrtchr}}
void {\bf wrtchr} (char chr)
\begin{CompactList}\small\item\em Prints the character 'chr' in the default font at the current position.\item\end{CompactList}

\item 
void {\bf gotogxy} ({\bf UINT8} x, {\bf UINT8} y)
\begin{CompactList}\small\item\em Sets the current text position to (x,y).\item\end{CompactList}

\item 
\label{drawing.h_a28}
\index{color@{color}!drawing.h@{drawing.h}}\index{drawing.h@{drawing.h}!color@{color}}
void {\bf color} ({\bf UINT8} forecolor, {\bf UINT8} backcolor, {\bf UINT8} mode)
\begin{CompactList}\small\item\em Set the current foreground colour (for pixels), background colour, and draw mode.\item\end{CompactList}

\end{CompactItemize}
\vspace{0.4cm}\hrule\vspace{0.2cm}
\subsection*{Detailed Description}
All Points Addressable (APA) mode drawing library.

Drawing routines originally by Pascal Felber Legendary overhall by Jon Fuge $<${\tt jonny@q}-continuum.demon.co.uk$>$ Commenting by Michael Hope

Note that the standard text {\bf printf}() {\rm (p.~\pageref{stdio.h_a1})} and {\bf putchar}() {\rm (p.~\pageref{stdio.h_a0})} cannot be used in APA mode - use {\bf gprintf}() {\rm (p.~\pageref{drawing.h_a17})} and {\bf wrtchr}() {\rm (p.~\pageref{drawing.h_a26})} instead. \vspace{0.4cm}\hrule\vspace{0.2cm}
\subsection*{Function Documentation}
\label{drawing.h_a15}
\index{drawing.h@{drawing.h}!gprintln@{gprintln}}
\index{gprintln@{gprintln}!drawing.h@{drawing.h}}
\subsection{\setlength{\rightskip}{0pt plus 5cm}void gprintln ({\bf INT16} {\em number}, {\bf INT8} {\em radix}, {\bf INT8} {\em signed\_\-value})}

Print the long number 'number' in radix 'radix'.

signed\_\-value should be set to SIGNED or UNSIGNED depending on whether the number is signed or not \label{drawing.h_a24}
\index{drawing.h@{drawing.h}!circle@{circle}}
\index{circle@{circle}!drawing.h@{drawing.h}}
\subsection{\setlength{\rightskip}{0pt plus 5cm}void circle ({\bf UINT8} {\em x}, {\bf UINT8} {\em y}, {\bf UINT8} {\em radius}, {\bf UINT8} {\em style})}

Draw a circle with centre at (x,y) and radius 'radius'.

'style' sets the fill mode \label{drawing.h_a27}
\index{drawing.h@{drawing.h}!gotogxy@{gotogxy}}
\index{gotogxy@{gotogxy}!drawing.h@{drawing.h}}
\subsection{\setlength{\rightskip}{0pt plus 5cm}void gotogxy ({\bf UINT8} {\em x}, {\bf UINT8} {\em y})}

Sets the current text position to (x,y).

Note that x and y have units of cells (8 pixels) 