// ScanConvert2.bcpl - overflow from ScanConvert.bcpl // last modified by Butterfield, April 17, 1980 10:53 AM // - this file is Joe's changed version - 4/17/80 //outgoing procedures external [ ScanColor] //outgoing statics external ScanColorTable //Pointer to matrix for this color static ScanColorTable //incoming procedures external [ //OS MoveBlock //SCANCHARS ScanCharColor //SCANCONVERT ScanColorPassValue //ALLOC FSGet ] //incoming statics external [ currentScanColor;ScanHalftoneDot;colorCache] // The table generated in ScanHalftoneDot gives // turn-on sequences: the entry labeled 0 should be made // black first. The parameter 'color' is 0 for black (all bits on), // 255 for while (all bits off). // The reason for the "currentScanColor" flag is that we often get // into situations in processing sync entries where successive // colors are the same: there is, somewhere on the page, an // intervening color, but not in this area. let ScanColor(colorV) be [ let color=ScanColorPassValue(colorV) if color eq currentScanColor then return currentScanColor=color ScanColorTable=colorCache!color if ScanColorTable eq 0 then //make it up [ let nWords=ScanHalftoneDot!0 let cycleAmount=ScanHalftoneDot!1 let nLines=ScanHalftoneDot!2 let lenTurnOn=ScanHalftoneDot!3 ScanColorTable=FSGet(nWords*(nLines+15)+3) if ScanColorTable eq 0 then //allocate failed for i=1 to 254 do if colorCache!i ne 0 then [ ScanColorTable=colorCache!i;colorCache!i=0;break] colorCache!color=ScanColorTable MoveBlock(ScanColorTable,ScanHalftoneDot,3) let val=nil let c=128-color let xTurnOn=0 for i=0 to nLines-1 do [ let line=ScanHalftoneDot+4+i*lenTurnOn for j=0 to nWords-1 do [ for b=0 to 15 do [ val=val lshift 1 if c gr line!xTurnOn then val=val+1 xTurnOn=xTurnOn+1 if xTurnOn ge lenTurnOn then xTurnOn=0 ] ScanColorTable!(3+j+i*nWords)=val ] ] //and replicate for additional 15 lines let sourceLine=1 let source=ScanColorTable+3 let dest = source+nWords*nLines let thisCycle=cycleAmount for i=1 to 15 do [ MoveBlock(dest,source+thisCycle,nWords-thisCycle) MoveBlock(dest+nWords-thisCycle,source,thisCycle) dest=dest+nWords test sourceLine eq nLines then [ sourceLine=1;source=ScanColorTable+3 thisCycle=(thisCycle+cycleAmount) rem nWords ] or [ sourceLine=sourceLine+1;source=source+nWords] ] ] //end of "test color eq 0 then .. or [ ] ScanCharColor(color) //Set up character handler for this color ] (635)\55f1 109f0 73f1 50f0 230f1 474f0 1f1 37f0 1f1 41f0 1f1 24f0 1f1 33f0 1f1 40f0 2f1 31f0 3f1 33f0 3f1 28f0 3f1 31f0 3f1 42f0 3f1 45f0 4f1 43f0 2f1 54f0 3f1 31f0 3f1 43f0 3f1 11f0 3f1 15f0 3f1 13f0 3f1 22f0 3f1 41f0 4f1 22f0 5f1 18f0 2f1 22f0 2f1 3f0 1f1 35f0 2f1 3f0 1f1 17f0 2f1 3f0 1f1 38f0 2f1 5f0 2f1 36f0 5f1 1f0 3f1 2f0 3f1 39f0 52f1 31f0 3f1 25f0 22f1 52f0 4f1 49f0 4f1 16f0 82f1 44f0 63f1 2f0 2f1 45f0 1f1