-- doubleVersatec.mesa - April 1980 -- Low level output to Versatec -- NON-microcode, double spacing version -- To make a microcode version bind versatec.config -- Updated: February 6, 1981 4:55 PM DIRECTORY InlineDefs: FROM "InlineDefs" USING [BITSHIFT, BITAND, LongCOPY], MiscDefs: FROM "MiscDefs" USING [CallDebugger], VersatecDefs: FROM "VersatecDefs"; Versatec: PROGRAM IMPORTS InlineDefs, MiscDefs EXPORTS VersatecDefs = BEGIN OPEN InlineDefs, MiscDefs; StartVersatecPlot: PUBLIC PROCEDURE[fileName: STRING, width,height: CARDINAL] = BEGIN PlotterCommand[Vreset]; END; EndVersatecPlot: PUBLIC PROCEDURE = BEGIN PlotterCommand[Vformfeed]; END; WriteVersatecLine: PUBLIC PROCEDURE [line: LONG POINTER, nBytes: CARDINAL] = --*** THIS IS THE DOUBLE SPACING VERSION *** BEGIN OPEN InlineDefs; i, end: POINTER TO UNSPECIFIED; nWords: CARDINAL _ MIN[nBytes/2,217]; bank0line: ARRAY [0..217) OF CARDINAL; LongCOPY[line, nWords, @bank0line[0]]; PlotterCommand[Vclear]; WaitPlotterReady[]; end _ @bank0line[nWords-1]+1; FOR i _ @bank0line[0], i+1 UNTIL i=end DO Plotter^ _ (Plotter^ _ VClockLow-Expand[BITAND[BITSHIFT[i^,-12],17B]]) - 10000B; Plotter^ _ (Plotter^ _ VClockLow-Expand[BITAND[BITSHIFT[i^,-8],17B]]) - 10000B; Plotter^ _ (Plotter^ _ VClockLow-Expand[BITAND[BITSHIFT[i^,-4],17B]]) - 10000B; Plotter^ _ (Plotter^ _ VClockLow-Expand[BITAND[i^,17B]]) - 10000B; ENDLOOP; Plotter^ _ (Plotter^ _ VClockLow) - 10000B; Plotter^ _ VClockLow; PlotterCommand[Vrlter]; WaitPlotterReady[]; --and a blank line: PlotterCommand[Vclear]; WaitPlotterReady[]; Plotter^ _ (Plotter^ _ VClockLow) - 10000B; Plotter^ _ VClockLow; PlotterCommand[Vrlter]; WaitPlotterReady[]; END; -- Private stuff VClockLow: CARDINAL _ 14377B; VClockHigh: CARDINAL _ 4377B; Plotter: POINTER TO CARDINAL = LOOPHOLE[177016B]; PlotterStatus: POINTER TO CARDINAL = LOOPHOLE[177030B]; PlotterCommands: TYPE = {Vclear, Vreset, Vrlter, Vformfeed}; Expand: ARRAY [0..17B] OF CARDINAL _ [0,1,4,5,20B,21B,24B,25B,100B,101B,104B,105B,120B,121B,124B,125B]; HighByte: PROCEDURE [x: CARDINAL] RETURNS [CARDINAL] = INLINE BEGIN OPEN InlineDefs; RETURN [BITSHIFT[x, -8]]; END; WaitPlotterReady: PROCEDURE = INLINE BEGIN OPEN InlineDefs; UNTIL BITAND[10000B, PlotterStatus^] = 0 DO NULL; ENDLOOP; END; PlotterCommand: PROCEDURE [command: PlotterCommands] = BEGIN OPEN InlineDefs; UNTIL BITAND[40000B, PlotterStatus^] = 0 DO CallDebugger["Turn on plotter and Proceed"]; ENDLOOP; IF command = Vreset THEN Plotter^ _ VClockLow ELSE WaitPlotterReady[]; Plotter^ _ VClockLow; IF command # Vreset THEN WaitPlotterReady[]; Plotter^ _ VClockLow + (SELECT command FROM Vclear => 40000B, Vreset => 1000B, Vrlter => 20000B, Vformfeed => 100000B, ENDCASE => 0); Plotter^ _ VClockLow; END; -- *** START CODE *** END.(635)\363b8B97b17B102b15B63b17B1418b8B113b16B113b14B