-- ColorVersatecDriver.mesa
-- Jim Gasbarro 19-Mar-84 16:17:37

ColorVersatecDriver: DEFINITIONS 
	= BEGIN
	
-- Plotter constants
bpi: CARDINAL = 200;
pageWidthInches: CARDINAL = 40; 
white: CARDINAL = 0;
wordsPerScan: CARDINAL = bpi * pageWidthInches / 16;
scansPerBand: CARDINAL = 64;
wordsPerBand: LONG CARDINAL = LONG[wordsPerScan] * LONG[scansPerBand];
sectorsPerBand: CARDINAL = 125;

Color: TYPE = MACHINE DEPENDENT {Black(0), Cyan(1), Magenta(2), Yellow(3)};
ColorMode: TYPE = MACHINE DEPENDENT {
 SinglePassOfColor(0), FirstPassOfColor(1), IntermediatePassOfColor(2), (3)};
	
PlotBuffer: PROC [wordCount: LONG CARDINAL, hyperOffset: LONG CARDINAL];
-- sends 'length' words to the plotter in plot mode, 'hyperOffset' is offset
-- from begining of hyperspace

VersatecInitialCheckout: PROC [];
-- tests to make sure that the plotter is on line, and prints a message every
-- two seconds if it is not.  Initializes the controller and plotter dma channel

SetColorMode: PROC [inches: CARDINAL, mode: ColorMode, color: Color ← Black, cmdOffset: CARDINAL];
-- this header must precede every data transfer so that the plotter knows what
-- to do

Rewind: PROC [cmdOffset: CARDINAL];
-- rewinds to the top of plot,  used after each pass in color mode

SendEOT: PROC [];
-- send End of Text, used to inicate completion of plot.  Returns machine to
-- Ready status

FormFeed: PROC [];
-- causes machine to feed about 24 inches of paper

SendRLT: PROC [];
-- send Remote line terminate,  used to terminate a scan line when less than
-- 'wordsPerScan' words of scan data are sent

END.