-- File: GSysPress.mesa
-- Written by Martin Newell July 1981
-- Last edited: July 9, 1981 2:02 PM
DIRECTORY
GSysPressDefs: FROM "GSysPressDefs",
InlineDefs: FROM "InlineDefs" USING [LongCOPY],
PressDefs: FROM "PressDefs" USING [
InitPressFileDescriptor, PutComputedDots, ClosePressFile,
PressFileDescriptor];
GSysPress: PROGRAM
IMPORTS InlineDefs, PressDefs
EXPORTS GSysPressDefs =
BEGIN
OPEN InlineDefs, PressDefs;
ScreenToPress: PUBLIC PROCEDURE [name: STRING,
base: LONG POINTER, raster,height: CARDINAL] =
BEGIN
p: PressFileDescriptor;
BEGIN
nWords: CARDINAL = raster;
nBits: CARDINAL = 16*nWords;
nLines: CARDINAL = height;
InitPressFileDescriptor[@p, name];
PutLongAltoDots[
@p, 10795 - 16*nBits, 14605 + 16*nLines, nWords, nBits, nLines, base];
ClosePressFile[@p];
END;
END;
PutLongAltoDots: PROCEDURE [
p: POINTER TO PressFileDescriptor,
x, y, wordsPerLine, npixels, nscans: CARDINAL, bitmapAddress: LONG POINTER] =
--Generate Press bitmap file
BEGIN
width, height, wordindent: CARDINAL;
wordindent ← x/16;
width ← 32*npixels;
height ← 32*nscans;
ResetScanProc[bitmapAddress, wordsPerLine];
PutComputedDots[
p: p, x: x, y: y - height, nPixels: npixels, nScanLines: nscans,
bitsPerPixel: 0, width: width, height: height, nextScanLine: ScanProc];
END;
ResetScanProc: PROCEDURE [bitmapAddress: LONG POINTER, wordsPerLine: CARDINAL] =
BEGIN LineAddress ← bitmapAddress; WordsPerLine ← wordsPerLine; END;
ScanProc: PROCEDURE RETURNS [POINTER] =
BEGIN
--This procedure must return a pointer to a single scanline of dots
--It will be called repetitively by PutComputedDots
LongCOPY[LineAddress, WordsPerLine, LineBuffer];
LineAddress ← LineAddress + WordsPerLine;
RETURN[LineBuffer];
END;
LineArray: ARRAY [0..40) OF WORD;
LineBuffer: POINTER ← BASE[LineArray];
LineAddress: LONG POINTER;
WordsPerLine: CARDINAL;
END.