-- file: GFtoPressImpl4.mesa
-- Pascal-to-Mesa translator output, translated at October 25, 1985 5:07:13 pm PDT


DIRECTORY
  PascalBasic,
  PascalWizardFiles,
  GFtoPressPrivate,
  GFtoPressVars1,
  GFtoPressVars2,
  GFtoPressVars3;

GFtoPressImpl4: PROGRAM IMPORTS PascalBasic, PascalWizardFiles, GFtoPressPrivate, GFtoPressVars1, GFtoPressVars2, GFtoPressVars3 EXPORTS GFtoPressPrivate = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, GFtoPressPrivate, GFtoPressVars1, GFtoPressVars2, GFtoPressVars3;
 DoPixels: PROCEDURE
 = 
BEGIN  PaintBlack:PascalBoolean;
StartingCol, FinishingCol:PascalInteger[0..WidestRow];J:PascalInteger[0..WidestRow];L:PascalInteger;
I:FourQuarters;V:EightBits; PressSetFont[3];
DeltaX←DeltaX+PascalROUND[UnscXRatio*PascalFLOAT[MinX]];
FOR i:INT    IN [ INT[0 ].. INT[MaxX-MinX ]] DO  J ← i; A↑[J]←0 ENDLOOP;L←1;Z←0;StartingCol←0;
FinishingCol←0;Y←MaxY+12;PaintBlack←FALSE;BlankRows←0;
CurGf←GetByte[];{WHILE TRUE DO BEGIN--211:--
 --215:
 DO--212:
 IF BlankRows>0  THEN BlankRows←BlankRows-1  ELSE IF CurGf#69  THEN
BEGIN  X←Z;IF StartingCol>X  THEN StartingCol←X;--213:
{WHILE TRUE DO BEGIN DO {--Label22:--SELECT CurGf FROM 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38
,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62
,63 =>K←CurGf;64 =>K←GetByte[];65 =>K←GetTwoBytes[];66 =>K←GetThreeBytes[];
69 => GOTO Label31;70 =>BEGIN BlankRows←0;Z←0;PaintBlack←FALSE;
CurGf←GetByte[]; GOTO Label31; END;71 =>BEGIN BlankRows←GetByte[];Z←0;
PaintBlack←FALSE;CurGf←GetByte[]; GOTO Label31; END;
72 =>BEGIN BlankRows←GetTwoBytes[];Z←0;PaintBlack←FALSE;
CurGf←GetByte[]; GOTO Label31; END;73 =>BEGIN BlankRows←GetThreeBytes[];Z←0;
PaintBlack←FALSE;CurGf←GetByte[]; GOTO Label31; END;
74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,
98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,
116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,
134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,
152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,
170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,
188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,
206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238 =>BEGIN Z←
CurGf-74;PaintBlack←TRUE;CurGf←GetByte[]; GOTO Label31; END;
239,240,241,242,243,244 =>BEGIN SkipNop[]; GOTO Label22; END;
 ENDCASE =>BEGIN {PascalWriteLongString[file: @TermOut, item: " "]; PascalWriteLongString[file: @TermOut, item: "Bad GF file: "]; PascalWriteLongString[file: @TermOut, item: "Improper opcode"]
; PascalWriteLongString[file: @TermOut, item: "! (at byte "]; PascalWriteInteger[file: @TermOut, item: CurLoc-1, fieldMinLength: 1]; PascalWriteLongString[file: @TermOut, item: ")"]};JumpOut[]; END ;--214:
IF X+K>FinishingCol  THEN FinishingCol←X+K;
IF PaintBlack  THEN FOR i:INT    IN [ INT[X ].. INT[X+K-1 ]] DO  J ← i; A↑[J]←A↑[J]+L ENDLOOP;
PaintBlack← NOT PaintBlack;X←X+K;CurGf←GetByte--:214--[];EXIT; EXITS Label22 => NULL} ENDLOOP; END ENDLOOP ;EXITS Label31 => NULL};--:213
 END;--:212--L←L+L;Y←Y-1; IF L=4096 THEN EXIT; ENDLOOP;--:211--PressGoto[0,DeltaY-PascalROUND[UnscYRatio*PascalFLOAT[Y]]];--206:--J←StartingCol;
{WHILE TRUE DO BEGIN WHILE( INT[J]<=FinishingCol)AND (B↑[A↑[J]]=0)DO J←J+1 ENDLOOP ;
IF  INT[J]>FinishingCol  THEN  GOTO Label30;PressPushPos[];--207:
PressMoveX[PascalROUND[UnscXRatio*PascalFLOAT[J]+UnscSlantRatio*PascalFLOAT[Y]]+DeltaX]--:207--;
DO V←B↑[A↑[J]];A↑[J]←A↑[J]-C↑[V];K←J;J←J+1;
WHILE B↑[A↑[J]]=V DO BEGIN A↑[J]←A↑[J]-C↑[V];J←J+1; END ENDLOOP ;K←J-K;--208:
DO {--Label21:--IF K=1  THEN PressSetChar[V] ELSE BEGIN I←FontInfo↑[CharBase↑[3]+V].
Qqqq;IF( PascalMODPower2Mask[(I.B2-0),3])=2  THEN BEGIN IF PascalODD[K] THEN PressSetChar[V];
K← PascalDIVPower2[K ,1];V←I.B3-0; GOTO Label21; END  ELSE DO PressSetChar[V];K←K-1;
 IF K=0 THEN EXIT; ENDLOOP; END--:208--;EXIT; EXITS Label21 => NULL} ENDLOOP; IF B↑[A↑[J]]=0 THEN EXIT; ENDLOOP;PressPopPos[]; END ENDLOOP ;EXITS Label30 => NULL};--:206--L←R↑[A↑[StartingCol]];
FOR i:INT    IN [ INT[StartingCol+1 ].. INT[FinishingCol ]] DO  J ← i; IF L>R↑[A↑[J]] THEN L←R↑[A↑[J]] ENDLOOP;
IF L=4096  THEN IF CurGf=69  THEN  GOTO Label10  ELSE BEGIN Y←Y-BlankRows;
BlankRows←0;L←1;StartingCol←Z;FinishingCol←Z;
 END  ELSE BEGIN WHILE A↑[StartingCol]=0 DO StartingCol←StartingCol+1 ENDLOOP ;
WHILE A↑[FinishingCol]=0 DO FinishingCol←FinishingCol-1 ENDLOOP ;
FOR i:INT    IN [ INT[StartingCol ].. INT[FinishingCol ]] DO  J ← i; A↑[J]← A↑[J]/L ENDLOOP;L← 4096 /L;
 END--:215--; END ENDLOOP ;EXITS Label10 => NULL}; END;--:216----217:--
END.