IMD 1.18: 14/11/2012 8:21:48 graph: graphdraw source & code        l lining enabledBlinking enableddInverse enabledAlternate font enableddVisible control chars enabledColorBlackRedBlueePurpleeGreenYelloww TurquoiseWhiteInvalidBlackRedBlueePurpleeGreenYelloww TurquoiseWhite07Character OptionsAHStatus line enabledDate status enabledKeys status enabledDisk status enabledStatus Line OptionsADCursor blinking/solidSolidBlinkinggSolidBlinkingg01 GRAPH8ڐ*  PAT.COMP.TEXT\/ PAT.COMP.CODE\/ PAT.A.TEXT \/ܤ PAT.B.TEXT \/ܤ" PAT.C.TEXT \/L"& PAT.D.TEXT \/ܥ&' PAT00.PTRN \/'( PAT02.PTRN \/() PAT03.PTRN \/)* PAT01.PTRN \/*4 PONG.TEXT \/r47 PONG.CODE \/r7: FONT00.FONT \/{:R FONT.B.TEXT \/{R~ FONT.A.TEXT \/{~ DEMO.TEXT \/L DEMO.CODE \/쥎 HOT.DOG.TEXT \/R HOT.DOG.CODA O^E \/R READ.ME.TEXT \/A HEXAGON.CODE \/ PAT.E.TEXT \/G PAT05.PTRN \/GGRAF.LINE.TEXT/GRAF.CURS.TEXT/GRAF.RECT.TEXT/7220.PROC0.TEXT7220.PROC0.CODEGRAF.FLOOD.TEXTNCR.LETTER.BACKL 1 \/>7220.PROC1.CODEx7220.PROC1.TEXTx!7220.PROC2.CODEx!%7220.PROC2.TEXTx%5GRAF.FONT.BACK/x5M 7220.ARC.TEXT\/xMqGRAF.CIRCL.TEXTx7220.CIRCL.TEXTx7220.CORE.CODE/x7220.FLOOD.TEXTx)7220.RECT.TEXT/x)M7220.MISC.TEXT/xx7220.CORE.TEXT/x GRAFTEST.CODE\/x5NGRAFDRAW.CODE/xSiGRAF.MISC.TEXT/ӧi GRAFTEST.TEXT\/ӧ READ.ME1.TEXT\/ӧ! 1K.DOC.TEXT+ !)NCR.LETTER.TEXT)9GRAF.FONT.TEXT/9W GRAFDRAW.TEXT\/WzG.CODE 1b \/z GRAFDRAW.CODE\/GRAFDRAW2.CODEGRAFDRAW.TEXTSYSTEM.INFO \/ Program Pat_Compiler;   Type Nibble = 0..15;   Var Row, $Column, $Nibs_Row, $Pat_X, $Pat_Y : Integer; $Pat_Src : Text; $Pat_Dest : File; $Pat_Buffer : Record 3Case Integer Of 50 : (Ch : Packed Array [0..4095] Of Char); 51 : (Nib : Packed Array [0..8191] Of Nibble);  End {of Pat_Buffer}; $Pat_Row, $Pat_Out, $Pat_In : String;  Color : Array [0..255] Of Nibble;   Function Get_Source (Var Pat_Src : Text; Var Pat_In : String) : Boolean; "BeginJLNǑ`KM O Җf!   !! "Q!!!` ʊք"Q!  .ɀH !*ɀF !/!5G"S!8!;!A!F`ʊFʆ HʊքJ"SOQSVǑ`R Tք[  _jq{`/RAPH C $Repeat &Write ('Pattern source name ? '); &Readln (Pat_In); &If Length (Pat_In) <> 0 Then " Begin  {$I-} *Close (Pat_Src); *Reset (Pat_Src, Concat (Pat_In, '.Text')); *If IO_Result <> 0 Then ,Reset (Pat_Src, Pat_In);  {$I^} $ End {of If}; $Until (IO_Result = 0) Or (Length (Pat_In) = 0); " Get_Source := Length (Pat_In) <> 0; "End {of Get_Source}; " " "  Begin {of Pat_Compiler} "If Not Get_Source (Pat_Src, Pat_In) Then $Exit (Pat_Compiler); "Readln (Pat_Src, Pat_X, Pat_Y);  GRAPH8ڐ*  PAT.COMP.TEXT\/ PAT.COMP.CODE\/ PAT.A.TEXT \/ܤ PAT.B.TEXT \/ܤ" PAT.C.TEXT \/L"& PAT.D.TEXT \/ܥ&' PAT00.PTRN \/'( PAT02.PTRN \/() PAT03.PTRN \/)* PAT01.PTRN \/*4 PONG.TEXT \/r47 PONG.CODE \/r7: FONT00.FONT \/{:R FONT.B.TEXT \/{R~ FONT.A.TEXT \/{~ DEMO.TEXT \/L DEMO.CODE \/쥎 HOT.DOG.TEXT \/R HOT.DOG.COD"Writeln ('Pat name file ', Pat_In, ' contains a pattern of dimension ', +Pat_X, ' x ', Pat_Y); "Writeln; "Repeat $Write ('Pattern destination name ? '); $Readln (Pat_Out); $If Pat_Out = '$' Then &Pat_Out := Pat_In; $If Length (Pat_Out) = 0 Then &Exit (Pat_Compiler);  {$I-} $If Pat_Out[Length (Pat_Out)] = '.' Then &Rewrite (Pat_Dest, Copy (Pat_Out, 1, Pred (Length (Pat_Out)))) $Else &Rewrite (Pat_Dest, Concat (Pat_Out, '.Ptrn'));  {$I^} "Until IO_Result = 0; $ "Fillchar (Color, Sizeof (CoE \/R READ.ME.TEXT \/A HEXAGON.CODE \/ PAT.E.TEXT \/G PAT05.PTRN \/GGRAF.LINE.TEXT/GRAF.CURS.TEXT/GRAF.RECT.TEXT/7220.PROC0.TEXT7220.PROC0.CODEGRAF.FLOOD.TEXTNCR.LETTER.BACKL 1 \/>7220.PROC1.CODEx7220.PROC1.TEXTx!7220.PROC2.CODEx!%7220.PROC2.TEXTx%5GRAF.FONT.BACK/x5M 7220.ARC.TEXT\/xMqGRAF.CIRCL.TEXTx722  `0 +# ց Ժ!   !!"! "!   !!! "!!!`ʊ ʊց"] ` ւ ږz !   ! "! " !  ! "! " !  ! "!!0.CIRCL.TEXTx7220.CORE.CODE/x7220.FLOOD.TEXTx)7220.RECT.TEXT/x)M7220.MISC.TEXT/xx7220.CORE.TEXT/x GRAFTEST.CODE\/x5NGRAFDRAW.CODE/xSiGRAF.MISC.TEXT/ӧi GRAFTEST.TEXT\/ӧ READ.ME1.TEXT\/ӧ! 1K.DOC.TEXT+ !)NCR.LETTER.TEXT)9GRAF.FONT.TEXT/9W GRAFDRAW.TEXT\/WzG.CODE 1b \/z GRAFDRAW.CODE\/GRAFDRAW2.CODEGRAFDRAW.TEXTSYSTEM.INFO \/ "!( !"  !E "#! "#b !)  ! "%! "% !/  ! "'! "' !6  ! ")! ") !=  !- "+! "+Z !F   !N!V "-!X!`!b` ʊ  ʊւf"-/ j!#%')+- s`H C ; "3 $     lor), 0); Color[Ord ('D')] := 0; "Color[Ord ('R')] := 1; "Color[Ord ('G')] := 2; "Color[Ord ('Y')] := 3; "Color[Ord ('B')] := 4; "Color[Ord ('P')] := 5; "Color[Ord ('T')] := 6; "Color[Ord ('W')] := 7; "Color[Ord ('d')] := 0; "Color[Ord ('r')] := 1; "Color[Ord ('g')] := 2; "Color[Ord ('y')] := 3; "Color[Ord ('b')] := 4; "Color[Ord ('p')] := 5; "Color[Ord ('t')] := 6; "Color[Ord ('w')] := 7; "Fillchar (Pat_Buffer.Nib, Sizeof (Pat_Buffer), 255); "Moveleft (Pat_X, Pat_Buffer, 2); "Moveleft (Pat_Y, Pat_Buffer.Ch[2], 2); "Nibs_Row := (Pat_X + 3) Div 4 * 4; "For Row := 1 To Pat_Y Do $Begin &If Eof (Pat_Src) Then (Writeln ('Warning -- premature end of input'); &Readln (Pat_Src, Pat_Row); &If Length (Pat_Row) < Pat_X * 3 - 2 Then (Writeln ('"', Pat_Row, '" is not long enough to be a row') &Else (For Column := 0 To Pred (Pat_X) Do *Pat_Buffer.Nib[8 + (Pat_Y - Row) * Nibs_Row + Column] := EColor[Ord (Pat_Row[Succ (Column * 3)])]; $End {of For Row}; "If Blockwrite (Pat_Dest, 10 10 (X direction size, Y direction size)  b b b b b b b b b b  b b b b b b b b b .  b b b b b b b b . .  b b b b b b b . . .  b b b b b b . . . .  b b b b b . . . . .  b b b b . . . . . .  b b b . . . . . . .  b b . . . . . . . .  b . . . . . . . . .   Pat_Buffer, (4 + Nibs_Row * Pat_Y + 1023) Div 1024) %= 0 Then $Writeln ('I/O error writing pattern file'); "Close (Pat_Dest, Lock);  End. jPATCOMPI   &GRAFICS@@@ @  @@@  0O^ܤܤiPATCOMPI+r p,Pr pr p,0-s-h`,Pt`Ut`sp -,sp,Ԝ,.-3_s2s[prprpr pr p[r pr p1rp*r p0rprprp,r pPr pr p: [Pp지.3t֘s&3ֆֆPtւ;Ut֘spfpրDĆրRĆրGĆրYĆրBĆրPĆրTĆրWĆրdĆրrĆրgĆրyĆրbĆրpĆրtĆրwĆ[p[p[p10֥4ֲծrp>r prpPr pr p1,"upr pOr prp@1ץ3ײ1[0423ֆ3x34J3[20up`r prp3sp3ssPattern sourc 11 11 (X direction size, Y direction size)  . b b b b b b b b b .  y . b b b b b b b . g  y y . b b b b b . g g  y y y . b b b . g g g  y y y y . b . g g g g  y y y y y . g g g g g y y y y . r . g g g g  y y y . r r r . g g g  y y . r r r r r . g g  y . r r r r r r r . g  . r r r r r r r r r . e name ? .TextPat name file ! contains a pattern of dimension  x Pattern destination name ? $.Ptrn!Warning -- premature end of input " is not long enough to be a rowwI/O error writing pattern filee EEXTRAIO STRINGOPFILEOPS PASCALIO O^ܤܤ      3 3 (X direction size, Y direction size)  . r .  r . r  . r . 33333333333333@333333D333333@D33333DD33333@DD3333DDD3333@DDD333DDDD333@DDDD33DDDDD33@DDDDD3DDDDDD3@DDDDDDDDDDDDD@DDDDDDD 3 3"33 "33""33@ "3D"3@DD DDD@DDDDO^ܥܥ$CURSOR $EQUAL $TAG \O.rr 16 16 (X direction size, Y direction size)  . b b b b b b b b b b b b b b b  y . b b b b b b b b b b b b b b  y y . b b b b b b b b b b b b b  y y y . b b b b b b b b b b b b  y y y y . b b b b b b b b b b b  y y y y y . b b b b b b b b b b  y y y y y y . b b b b b b b b b  y y y y y y y . b b b b b b b b  y y y y y y y y . b b b b b b b  y y y y y  Program Pong;  {$U GrafDraw.Code}  Uses Graf_Draw;  Const Paddle_X_Size = 10; &Paddle_Y_Size = 50; &Ball_Size = 10; &Key_Up = 31; &Key_Down = 10;  Bell = 7;  Var Delta_X, $Delta_Y, $New_X, $New_Y, $Old_X, $Old_Y, $Save_Index, $Paddle_X, $Paddle_Y_Top, $Paddle_Y_Bottom, $Paddle_Speed, $Ball_Speed : Integer; $Ch : Char; $Save_Edge : Edge_Type; $Stat_Rec : Array [0..29] Of Integer;  Begin "Repeat $Write ('Ball Speed (1-10) ? '); $Readln (Ball_Spee y y y y . b b b b b b  y y y y y y y y y y . b b b b b  y y y y y y y y y y y . b b b b  y y y y y y y y y y y y . b b b  y y y y y y y y y y y y y . b b y y y y y y y y y y y y y y . b  y y y y y y y y y y y y y y y .  O^ܤL  DDDDDDDDDDDDDDDDDDDDDDDDD     d); "Until Ball_Speed In [1..10]; "Paddle_Speed := Ball_Speed * 4; Ch := ' '; "Core^.Display_Mode := Fill; "Core^.Fill_Index := 4; Core^.Polygon_Edge := Interior; "Paddle_X := Core^.X_Max - Paddle_X_Size; "Paddle_Y_Bottom := (Core^.Y_Max - Paddle_Y_Size) Div 2; "Paddle_Y_Top := Paddle_Y_Bottom + Paddle_Y_Size; "Move_Abs (Paddle_X - 1, Paddle_Y_Bottom - 1); "Box_Rel (Paddle_X_Size, Paddle_Y_Size + 1); " "Delta_X := -Ball_Speed; "Delta_Y := -Ball_Speed; "Core^.Line_Index := 1; PONG s psps p00  Ě ĚĚ~ |22242r 2r 0 0  ĚĚĚ Ě~ | 98r r989;0 9 94)636294ptp; 9; 8:0 8 8| tp: 8: 98r r76r rp$xՔ p Ě <*3|1 42r 1r 2143r 1r 31< )21$421r 1r 21431r 1r 31=Ě 5Ball Speed (1"Core^.Polygon_Edge := Solid_Line; "Core^.Overlay_Mode := Xor; "Core^.Fill_Index := 2; New_X := Core^.X_Max Div 2; "New_Y := Core^.Y_Max Div 2; "Move_Abs (New_X, New_Y); "Circle_Rel (Ball_Size); "Repeat $Old_X := New_X; $Old_Y := New_Y; $New_X := New_X + Delta_X * Ball_Speed; $If (New_X < Ball_Size) Or (New_X > Paddle_X) Then &Begin (If ((Old_Y > Paddle_Y_Top) Or (Old_Y < Paddle_Y_Bottom)) And +(New_X > Paddle_X) Then *Exit (Pong); (Write (Chr (Bell)); (Delta_X := -Delta_X; (New_X := New-10) ? EXTRAIO PASCALIOGRAFDRAW _X + 2 * Delta_X; &End {of If (New_X}; $New_Y := New_Y + Delta_Y * Ball_Speed; $If (New_Y < Ball_Size) Or (New_Y > Core^.Y_Max - Ball_Size) Then &Begin (Write (Chr (Bell)); (Delta_Y := -Delta_Y; (New_Y := New_Y + 2 * Delta_Y; &End {of If (New_Y}; $Move_Abs (New_X, New_Y); $Circle_Rel (Ball_Size); {Draw new one} $Move_Abs (Old_X, Old_Y); $Circle_Rel (Ball_Size); {Wipe out old one} $Unitstatus (2, Stat_Rec, 1); $If Stat_Rec[0] <> 0 Then &Begin (Unitread (2, Ch, 1);  $66""""""""">IIH> II> QQ""EENQ!Q   I**I @>ACCEEIQQa>  8@AA""A@  @A" ""$$((0 "A@@"~"AAA#A"!A"AA""AA""A@\bAAA"   0@AA"6IIIIIF@A"AAAAAAA"!AA!!AA!"AA"(Save_Edge := Core^.Polygon_Edge; (Save_Index := Core^.Fill_Index; (Core^.Polygon_Edge := Interior; (Core^.Fill_Index := 4; (If Ord (Ch) = Key_Up Then *If Paddle_Y_Top < Core^.Y_Max - Paddle_Speed Then ,Begin .Move_Abs (Paddle_X - 1, Paddle_Y_Bottom - 1); .Box_Rel (Paddle_X_Size, Paddle_Speed + 1); .Paddle_Y_Bottom := Paddle_Y_Bottom + Paddle_Speed; .Move_Abs (Paddle_X - 1, Paddle_Y_Top - 1); .Box_Rel (Paddle_X_Size, Paddle_Speed + 1); .Paddle_Y_Top := Paddle_Y_Top + Paddle_Speed; ,End {of If "BBBBBBB"?\bAAAqA"AAAAAAAAAA! pA!  !A~AAAAAIIIUcAAAaQQIIEECA"AAAAAAA"!AAA!\"c]AAAAA"A! !AA!"A@ A""AAAAAAAAA"AAAAAAAA""UUIIAAAAAAAA""AAA"AAA @@88@ A".1!!> !&BBBB&"AA",2!!!!2, "A"$!@\bAAAb\BBBBBBPaddle_Y_Top}; (If Ord (Ch) = Key_Down Then *If Paddle_Y_Bottom > Paddle_Speed Then ,Begin .Move_Abs (Paddle_X - 1, Paddle_Y_Bottom - Paddle_Speed - 1); .Box_Rel (Paddle_X_Size, Paddle_Speed + 1); .Paddle_Y_Bottom := Paddle_Y_Bottom - Paddle_Speed; .Move_Abs (Paddle_X - 1, Paddle_Y_Top - Paddle_Speed - 1); .Box_Rel (Paddle_X_Size, Paddle_Speed + 1); .Paddle_Y_Top := Paddle_Y_Top - Paddle_Speed; ,End {of If Paddle_Y_Bottom}; (Core^.Polygon_Edge := Save_Edge; (Core^.Fill_Index := Save_Index; & B" "BIIIIIII7BBBBBBF:"AAAA"&BBBB& ,2!!!!2,&>A@@>A>$.1!!!!!!""AA""UIIAAAA""A$$BBBBB 000I&End {of If}; "Until False;  End. O^{{PONG , &NEC_0.4@@   @@  0     . . . . . . . . . . . . . . . . "n" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . n . n n n . . . n n . . . n . . n . . . . n . . n . . . . n . . n . . . . n . . n . . . . n . . n . . . . n . . n . . . . n . . . . . . . . . . . . . . . . . "o" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o o o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c c c . . . . c . . . c . . c . . . . . c . c . . . . . . . c . . . . . . . c . . . . . c . . c . . . c . . . . c c c . . . . . . . . . . . . . . . . . . . "d" . . . . . . . . . . . . . d . . . . . . . d . . . . . . . d . . . . d d . d . . . d . . d d . . d . . . . d . . d . . . . d . . d . . . . d . . d . o . . . o . . o . . . . . o . o . . . . . o . o . . . . . o . o . . . . . o . . o . . . o . . . . o o o . . . . . . . . . . . . . . . . . . . "p" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p . p p . . . . p p . . p . . . p . . . . p . . p . . . . p . . p . . . . p . . p . . . . p . . p p . . p . . . p . p p . . . . p . . . . . . .  . . . . d . . . d . . d d . . . . d d . d . . . . . . . . . . . . . . . . . . "e" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e e e . . . . e . . . e . . e . . . . . e . e e e e e e e . e . . . . . . . e . . . . . . . . e . . . e . . . . e e e . . . . . . . . . . . . . . . . . . . "f" . . . . . . . . . . . f f . . .  p . . . . . . "q" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q . q . . . q . . q q . . q . . . . q . . q . . . . q . . q . . . . q . . q . . . . q . . . q . . q q . . . . q q . q . . . . . . . q . . . . . . . q . . "r" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . r . r r . . . . r r . . r . . . . f . . f . . . . f . . . . . . f f f f . . . . . f . . . . . . . f . . . . . . . f . . . . . . . f . . . . . . . f . . . . . . . f . . . . . . . f . . . . . . . . . . . . . . . . . . . . . "g" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . g g g . g . . g . . . g g . g . . . . . g . g . . . . . g . g . . . . . g . . g . . . g g . . . r . . . . . . . r . . . . . . . r . . . . . . . r . . . . . . . r . . . . . . . r . . . . . . . . . . . . . . . . . . . . . . "s" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . s s s s s . . s . . . . . s . s . . . . . . . . s s s s s . . . . . . . . s . . . . . . . s . s . . . . . s . . s s s s s . . . . . . . . . . . . . . . . . . "t . g g g . g . . . . . . . g . g . . . . g . . . g g g g . . . "h" . . . . . . . . . h . . . . . . . h . . . . . . . h . . . . . . . h . h h . . . . h h . . h . . . h . . . . h . . h . . . . h . . h . . . . h . . h . . . . h . . h . . . . h . . h . . . . h . . . . . . . . . . . . . . . . . "i" . . . . . . . . . . . i . . . . . . . i . . . . " . . . . . . . . . . t . . . . . . . t . . . . . . . t . . . . . t t t t t . . . . . t . . . . . . . t . . . . . . . t . . . . . . . t . . . . . . . t . . . . . . . t . . t . . . . . t t . . . . . . . . . . . . . . . . . . . "u" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . u . . . . u . . u . . . . u . . u . . . . u . . . . . . . . . . . . . . . . . . . . . i . . . . . . . i . . . . . . . i . . . . . . . i . . . . . . . i . . . . . . . i . . . . . . . i . . . . . . . . . . . . . . . . . . . . "j" . . . . . . . . . . . . j . . . . . . . j . . . . . . . . . . . . . . . . . . . . . . . j . . . . . . . j . . . . . . . j . . . . . . . j . . . . . . . j . . . . . . . j . . . . u . . . . u . . u . . . . u . . u . . . . u . . u . . . u u . . . u u u . u . . . . . . . . . . . . . . . . . . "v" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v . . . . . v . v . . . . . v . . v . . . v . . . v . . . v . . . . v . v . . . . . v . v . . . . . . v . . . . . . . v . . . . . . . . . . . . . . . . . . . . "w" . . . . . . .  . . . j . . . . j . . j . . . . . j j . . . . "k" . . . . . . . . . k . . . . . . . k . . . . . . . k . . . . . . . k . . . . k . . k . . . k . . . k . . k . . . . k . k . . . . . k k k . . . . . k . . k . . . . k . . . k . . . k . . . . k . . . . . . . . . . . . . . . . . "l" . . . . . . . . . l l l . . . . . . . l . . . . . . . l . . . . "`" . . . . . . . . . ` ` . . . . . . . . ` ` . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "a" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a a a a . . . a . . . . a . . . . . . . a . . . a a a a a . . . . l . . . . . . . l . . . . . . . l . . . . . . . l . . . . . . . l . . . . . . . l . . . . . . . l . . . . . . . l . . . .  . . . . . . . . . . . . . . . . "m" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . m m m . m m . . m . . m . . m . m . . m . . m . m . . m . . m . m . . m . . m . m . . m . . m . m . . m . . m . m . . m . . m . . a . . . . a . . a . . . . a . . a . . . a a . . . a a a . a . . . . . . . . . . . . . . . . . . "b" . . . . . . . . . b . . . . . . . b . . . . . . . b . . . . . . . b . b b . . . . b b . . b . . . b . . . . b . . b . . . . b . . b . . . . b . . b . . . . b . . b b . . b . . . b . b b . . . . . . . . . . . . . . . . . . . "c" . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . w . . . . . w . w . . . . . w . w . . . . . w . w . . w . . w . w . . w . . w . w . w . w . w . . w . . . w . . . w . . . w . . . . . . . . . . . . . . . . . . "x" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . x . . x . . . x . . . . x . x . . . . . . x . . . . . . . x . . . . . . x . x . . . . x . . . x . . x . . . . . x . . . . . . . . . . . . . . . . . "y" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y . . . . y . . y . . . . y . . y . . . . y . . y . . . . y . . y . . . . y . . . y . . y . . . . y . . y . . . . . y y . . . . . . y . . . . . y y . . . . . "z" . . . . . . . . . . . . . . . 8 14 32 127 (X-size, Y-size, Minimum character, Maximum character) " " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "!" . . . . . . . . . . ! . . . . . . . ! . . . . . . . ! . . . . . . . ! . . . . . . . . . . . . . . . . . . . . . z z z z z z z . . . . . . z . . . . . . z . . . . . . z . . . . . . z . . . . . . z . . . . . . z . . . . . . . z z z z z z z . . . . . . . . . . . . . . . . . "{" . . . . . . . . . . . . { { . . . . . { . . . . . . . { . . . . . . . { . . . . . . . { . . . . . . { . . . . . . . . { . . . . . . . { . . . .  . . . ! . . . . . . . ! . . . . . . . ! . . . . . . . ! . . . . . . . . . . . . . . . ! . . . . . . . ! . . . . . . . . . . . . . . . . . . . . . """ . . . . . . . . . " " . " " . . . " " . " " . . . . " . . " . . . " . . " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . { . . . . . . . { . . . . . . . . { { . . . . . . . . . . . . . . . . . . "|" . . . . . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . | . . . . . . . . . . . . . . . . . . . . "}" . . . . . . . . . } } . . . . . . . . } . . . . . . . . . . . . . . . . . . . "#" . . . . . . . . . # . . . # . . . # . . . # . . # # # # # # # . . # . . . # . . . # . . . # . . . # . . . # . . . # . . . # . . . # . . . # . . # # # # # # # . . # . . . # . . . # . . . # . . . . . . . . . . . . . . . . . . "$" . . . $ . . . . . . . $ . . . . . $ $ $ $ $ . . $ . . $ . . $ . $ . . $ . . $ . $ . . $ . . . . . . . } . . . . . . . } . . . . . . . } . . . . . . . . } . . . . . . } . . . . . . . } . . . . . . . } . . . . . . . } . . . . . } } . . . . . . . . . . . . . . . . . . . . . "~" . . . . . . . . . ~ ~ . . . . . ~ . . ~ . . ~ . . . . . ~ ~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ $ $ $ $ . . . . . $ . . $ . $ . . $ . . $ . $ . . $ . . $ . . $ $ $ $ $ . . . . . $ . . . . . . . $ . . . . . . . . . . . . "%" . . . . . . . . . % . . . . . . % . % . . . % . % . % . . . % . . % . . . % . . . . . . % . . . . . . % . . . . . . % . . . . . . % . . . % . . % . . . % . % . % . . . % . % . . . . . . % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * . . . . . . . . "&" . . . . . . . . . & & & . . . . & . . . & . . . & . . . & . . . & . . . & . . . . & & & . . . . . & & . . . . . & . . & . . . . & . . . & . & . & . . . . & . . & . . . & . & . . & & & . . & . . . . . . . . . . . . . . . . . "'" . . . . . . . . . . ' ' . . . . . . ' ' . . . . . . . ' . . . . . . ' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "(" . . . . . . . . . . . . . ( . . . . . . ( . . . . . . ( . . . . . . . ( . . . . . . ( . . . . . . . ( . . . . . . . ( . . . . . . . . ( . . . . . . . ( . . . . . . . . ( . . . . . . . . ( . . . . . . . . . . . . . . . . . . ")"       . . . . . . . . . . . . . . . "7" . . . . . . . . 7 7 7 7 7 7 7 . 7 . . . . . 7 . 7 . . . . 7 . . . . . . 7 . . . . . . . 7 . . . . . . 7 . . . . . . . 7 . . . . . . . 7 . . . . . . . 7 . . . . . . . 7 . . . . . . . 7 . . . . . . . . . . . . . . . . . . . . "8" . . . . . . . . . . 8 8 8 . . . . 8 . . . 8 . . 8 . . . . . 8 . 8 . . . . . 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . , , . . . . . . , , . . . . . . . , . . . . . . , . . . . . . . . . . . . . . . "-" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - - - - - . . . . . . . . . . . . . . . . . . . 8 . . . 8 . . . . 8 8 8 . . . . 8 . . . 8 . . 8 . . . . . 8 . 8 . . . . . 8 . . 8 . . . 8 . . . . 8 8 8 . . . . . . . . . . . . . . . . . . . "9" . . . . . . . . . . 9 9 9 . . . . 9 . . . 9 . . 9 . . . . . 9 . 9 . . . . . 9 . 9 . . . . . 9 . . 9 . . . 9 9 . . . 9 9 9 . 9 . . . . . . . 9 . 9 . . . . . 9 . . 9 . . . 9 . . . . 9 9 9 . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "." . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * * . . . . . . * * . . . . . . . . . . . . . . . . . . . . . . "/" . . . . . . . . . . . . . . . .  . . . . . . . ":" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . : : . . . . . . : : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . : : . . . . . . : : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ; ; . . . . . . ; ; . . . . . . . . . . . . . . . . . . . / . . . . . . / . . . . . . / . . . . . . / . . . . . . / . . . . . . / . . . . . . / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "0" . . . . . . . . . 0 0 0 0 0 . . 0 . . . . 0 0 . 0 . . . 0 . 0 . 0 . . . 0 . 0 . 0 . . 0 . . 0 . 0 . 0 . . . 0 . 0 . 0 . . . 0 . 0 0 . . . . 0 . 0 0 . . . . 0 . 0 . . . . . . . . . . . . . . . . . . . . . . . . . ; ; . . . . . . ; ; . . . . . . . ; . . . . . . ; . . . . . . . . . . . . . . "<" . . . . . . . . . . . . . < . . . . . . < . . . . . . < . . . . . . < . . . . . . < . . . . . . < . . . . . . . . < . . . . . . . . < . . . . . . . . < . . . . . . . . < . . . . . . . . < . . . . . . . . . . . . . . . . . . "= . . . . . 0 . . 0 0 0 0 0 . . . . . . . . . . . . . . . . . . "1" . . . . . . . . . . . 1 . . . . . . 1 1 . . . . . 1 . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . . 1 . . . . . . 1 1 1 . . . . . . . . . . . . . . . . . . . "2" . . . . . . . . . . 2 2 2 . . . . 2 . . . 2 . . " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . = = = = = = = . . . . . . . . . . . . . . . . . = = = = = = = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ">" . . . . . . . . > . . . . . . . . > . . . . . . . . > . . . . . . . . > . . . . . . . . > . . . . . . . . > . . 2 . . . . . 2 . 2 . . . . . 2 . . . . . . . 2 . . . . 2 2 2 . . . . 2 2 . . . . . 2 . . . . . . 2 . . . . . . . 2 . . . . . . . 2 2 2 2 2 2 2 . . . . . . . . . . . . . . . . . "3" . . . . . . . . . . 3 3 3 . . . . 3 . . . 3 . . 3 . . . . . 3 . . . . . . . 3 . . . . . . 3 . . . . . 3 3 . . . . . . . . 3 . . . . . . . . 3 . 3 . . . . . 3 . . 3 . . . 3 . . . . . . . > . . . . . . > . . . . . . > . . . . . . > . . . . . . > . . . . . . . . . . . . . . . . . . . . . . . "?" . . . . . . . . . . ? ? ? . . . . ? . . . ? . . ? . . . . . ? . ? . . . . . ? . . . . . . . ? . . . . . ? ? . . . . . ? . . . . . . . ? . . . . . . . . . . . . . . . ? . . . . . . . ? . . . . . . . . . . . . . . . . . . . . "@" . . . . . . .  . 3 3 3 . . . . . . . . . . . . . . . . . . . "4" . . . . . . . . . . . . . 4 . . . . . . 4 4 . . . . . 4 . 4 . . . . . 4 . 4 . . . . 4 . . 4 . . . . 4 . . 4 . . . 4 . . . 4 . . . 4 . . . 4 . . 4 4 4 4 4 4 4 . . . . . . 4 . . . . . . . 4 . . . . . . . . . . . . . . . . . . "5" . . . . . . . . . 5 5 5 5 5 5 . . 5 . . . . . . . 5 . . . . . . . . . . . . . . ) . . . . . . . . ) . . . . . . . . ) . . . . . . . ) . . . . . . . . ) . . . . . . . ) . . . . . . . ) . . . . . . ) . . . . . . . ) . . . . . . ) . . . . . . ) . . . . . . . . . . . . . . . . . . . . . . . "*" . . . . . . . . . . . . . . . . . . . . . . . . . . . * . . . . * . . * . . * . . * . * . * . . . . * * * . . . . * . * . * . . * . 5 . . . . . . . 5 5 5 5 . . . . 5 . . . 5 . . . . . . . . 5 . . . . . . . 5 . 5 . . . . . 5 . . 5 . . . 5 . . . . 5 5 5 . . . . . . . . . . . . . . . . . . . "6" . . . . . . . . . . 6 6 6 . . . . 6 . . . 6 . . 6 . . . . . 6 . 6 . . . . . . . 6 . 6 6 6 . . . 6 6 . . . 6 . . 6 . . . . . 6 . 6 . . . . . 6 . 6 . . . . . 6 . . 6 . . . 6 . . . . 6 6 6 . . . .  . . * . . * . . . . * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "+" . . . . . . . . . . . . . . . . . . . + . . . . . . . + . . . . . . . + . . . . . . . + . . . . + + + + + + + . . . . + . . . . . . . + . . . . . . . + . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . "," . . . . . . . .      . . . @ @ @ . . . . @ . . . @ . . @ . . . . . @ . . . . . . . @ . . @ @ . . . @ . @ . . @ . . @ . @ . . @ . . @ . @ . . @ . . @ . @ . . @ . . @ . @ . . @ . . @ . . @ @ . @ @ . . . . . . . . . . . . . . . . . . "A" . . . . . . . . . . . A . . . . . . A . A . . . . A . . . A . . A . . . . . A . A . . . . . A . A . . . . . A . A . . . . . A . . . L . . . . . . . L . . . . . . . L . . . . . . . L . . . . . . . L . . . . . . . L . . . . . . . L L L L L L . . . . . . . . . . . . . . . . . "M" . . . . . . . . M . . . . . M . M M . . . M M . M . M . M . M . M . . M . . M . M . . M . . M . M . . M . . M . M . . . . . M . M . . . . . M . M . . . . . M . M . . . . . M . M . . . . . M . A A A A A A A . A . . . . . A . A . . . . . A . A . . . . . A . . . . . . . . . . . . . . . . . "B" . . . . . . . . B B B B B . . . B . . . . B . . B . . . . . B . B . . . . . B . B . . . . B . . B B B B B . . . B . . . . B . . B . . . . . B . B . . . . . B . B . . . . B . . B B B B B . . . . . . . . . . . . . . . . . . . "C" . . . . . . . . . . C C C . . . . . . . . . . . . . . . . . . "N" . . . . . . . . N . . . . . N . N N . . . . N . N . N . . . N . N . N . . . N . N . . N . . N . N . . N . . N . N . . . N . N . N . . . N . N . N . . . . N N . N . . . . . N . N . . . . . N . . . . . . . . . . . . . . . . . "O" . . . . . . . . . . O O O . . . . O . . . O . . O . . . . . O . O . . . . . O . O . . . . . O . . C . . . C . . C . . . . . C . C . . . . . . . C . . . . . . . C . . . . . . . C . . . . . . . C . . . . . . . C . . . . . C . . C . . . C . . . . C C C . . . . . . . . . . . . . . . . . . . "D" . . . . . . . . D D D D D . . . . D . . . D . . . D . . . . D . . D . . . . D . . D . . . . D . . D . . . . D . . D . . . . D . . D . . . . D . . O . . . . . O . O . . . . . O . O . . . . . O . O . . . . . O . . O . . . O . . . . O O O . . . . . . . . . . . . . . . . . . . "P" . . . . . . . . P P P P P . . . P . . . . P . . P . . . . . P . P . . . . . P . P . . . . . P . P . . . . P . . P P P P P . . . P . . . . . . . P . . . . . . . P . . . . . . . P . . . . . . . . . . . . . . . . D . . . . D . . D . . . D . . D D D D D . . . . . . . . . . . . . . . . . . . "E" . . . . . . . . E E E E E E E . E . . . . . . . E . . . . . . . E . . . . . . . E . . . . . . . E E E E E E . . E . . . . . . . E . . . . . . . E . . . . . . . E . . . . . . . E E E E E E E . . . . . . . . . . . . . . . . . "F" . . . . . . . . F F F F F F F . F . . . . . . . . . . . . . . "Q" . . . . . . . . . . Q Q Q . . . . Q . . . Q . . Q . . . . . Q . Q . . . . . Q . Q . . . . . Q . Q . . . . . Q . Q . . . . . Q . Q . Q Q Q . Q . Q Q . . . Q Q . . Q . . . Q . . . . Q Q Q . Q . . . . . . . . . . . . . . . . . "R" . . . . . . . . R R R R R . . . R . . . . R . . R . . . . . R . R . . . . . R . R . . . . R . . R R R R R . . . F . . . . . . . F . . . . . . . F . . . . . . . F F F F F . . . F . . . . . . . F . . . . . . . F . . . . . . . F . . . . . . . F . . . . . . . . . . . . . . . . . . . . . . . "G" . . . . . . . . . . G G G . . . . G . . . G . . G . . . . . G . G . . . . . . . G . . . . . . . G . . . G G G . G . . . . . G . G . . . . . G . G . . . . . G . . R . . R . . . . R . . . R . . . R . . . R . . . R . . . . R . . R . . . . . R . . . . . . . . . . . . . . . . . "S" . . . . . . . . . . S S S . . . . S . . . S . . S . . . . . S . S . . . . . . . . S . . . . . . . . S S S . . . . . . . . S . . . . . . . . S . S . . . . . S . . S . . . S . . . . S S S . . . . . . . . . . . . . . . . . . . "T" . G . . . G G . . . G G G . G . . . . . . . . . . . . . . . . . "H" . . . . . . . . H . . . . . H . H . . . . . H . H . . . . . H . H . . . . . H . H . . . . . H . H H H H H H H . H . . . . . H . H . . . . . H . H . . . . . H . H . . . . . H . H . . . . . H . . . . . . . . . . . . . . . . . "I" . . . . . . . . . . I I I . . . . . . I . . . . . . . I . . . . . . . . . . . T T T T T T T . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . T . . . . . . . . . . . . . . . . . . . . "U" . . . . . . . . U . . . . . U . U . . . . . U . U . . . . . U . U . . . . . U . U . . . . . U . U . . . . . U . U . . . . . U . U . . . . I . . . . . . . I . . . . . . . I . . . . . . . I . . . . . . . I . . . . . . . I . . . . . . . I . . . . . . I I I . . . . . . . . . . . . . . . . . . . "J" . . . . . . . . . . . . J J J . . . . . . J . . . . . . . J . . . . . . . J . . . . . . . J . . . . . . . J . . . . . . . J . . . . . . . J . . J . . . . J . . J . . . J . . .  . . . . . U . U . . . . . U . . U . . . U . . . . U U U . . . . . . . . . . . . . . . . . . . "V" . . . . . . . . V . . . . . V . V . . . . . V . V . . . . . V . V . . . . . V . V . . . . . V . V . . . . . V . V . . . . . V . V . . . . . V . . V . . . V . . . . V . V . . . . . . V . . . . . . . . . . . . . . . . . . . . "W" . . . . . . . . . J J J . . . . . . . . . . . . . . . . . . . . "K" . . . . . . . . K . . . . . K . K . . . . K . . K . . . K . . . K . . K . . . . K . K . . . . . K K . . . . . . K . K . . . . . K . . K . . . . K . . . K . . . K . . . . K . . K . . . . . K . . . . . . . . . . . . . . . . . "L" . . . . . . . . . L . . . . . . . L . . . . . . . L . . . . . . . L . . . . .      n, Off, Off, Off); $My_X_Value[1] := Width_Of_Frame; $My_Y_Value[1] := 0; $My_X_Value[2] := 0; $My_Y_Value[2] := Height_Of_Frame; $My_X_Value[3] := -Width_Of_Frame; $My_Y_Value[3] := 0; $My_X_Value[4] := 0; $My_Y_Value[4] := -Height_Of_Frame;  Move_Abs (10, 10); $PLine_Rel (My_X_Value, My_Y_Value, 4); $Core^.Line_Index := 6; $Set_Line_Style (On, On, On, On, On, On, On, On); $For Line_Number := 0 To 2 Do &Begin (My_X_Value [3 * Line_Number + 1] := Width_Grid; . . . . . . Z . . . . . . . Z . . . . . . Z . . . . . . Z . . . . . . Z . . . . . . Z . . . . . . Z . . . . . . Z . . . . . . . Z . . . . . . . Z Z Z Z Z Z Z . . . . . . . . . . . . . . . . . "[" . . . . . . . . . . . [ [ [ . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . . . [ . . . . . (My_Y_Value [3 * Line_Number + 1] := 0; (My_X_Value [3 * Line_Number + 2] := 0; (My_Y_Value [3 * Line_Number + 2] := 0; (My_X_Value [3 * Line_Number + 3] := -Width_Grid; (My_Y_Value [3 * Line_Number + 3] := Size_Grid; &End;  Move_Abs (Size_Grid, Size_Grid); $PLine_Rel (My_X_Value, My_Y_Value, 9); $For Line_Number := 0 To 5 Do &Begin (My_X_Value [3 * Line_Number + 1] := 0; (My_Y_Value [3 * Line_Number + 1] := Height_Grid; (My_X_Value [3 * Line_Number + 2] := 0; (My_Y_Value [3 * Line_Number  . . [ . . . . . . . [ [ [ . . . . . . . . . . . . . . . . . . "\" . . . . . . . . . . . . . . . . . . . . . . . . \ . . . . . . . . \ . . . . . . . . \ . . . . . . . . \ . . . . . . . . \ . . . . . . . . \ . . . . . . . . \ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "]" . . . . . . . . . ] ] ] . . . . . . . ] . . . . + 2] := 0; (My_X_Value [3 * Line_Number + 3] := Size_Grid; (My_Y_Value [3 * Line_Number + 3] := -Height_Grid; &End;  Move_Abs (2 * Size_Grid, Size_Grid); $PLine_Rel (My_X_Value, My_Y_Value, 18);  End; " "  Procedure Draw_Solids; "Begin $Core^.Line_Index := 7; $Core^.Fill_Index := 1; $Radius := (Size_Grid - 10) Div 2; $Move_Abs (5 * Size_Grid Div 2, 3 * Size_Grid Div 2); $Core^.Display_Mode := Fast; $Circle_Abs (Core^.X_CP + Radius, Core^.Y_CP); $Move_Rel (Size_Grid, 0); . . . ] . . . . . . . ] . . . . . . . ] . . . . . . . ] . . . . . . . ] . . . . . . . ] . . . . . . . ] . . . . . . . ] . . . . . ] ] ] . . . . . . . . . . . . . . . . . . . . "^" . . . . . . . . . . . ^ . . . . . . ^ . ^ . . . . ^ . . . ^ . . ^ . . . . . ^ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $Core^.Display_Mode := Fill; $Core^.Polygon_Interior := Plain; $Core^.Polygon_Edge := Solid_Line; $Circle_Abs (Core^.X_CP + Radius, Core^.Y_CP); $Move_Rel (Size_Grid, 0); $Core^.Polygon_Edge := Interior; $Circle_Abs (Core^.X_CP + Radius, Core^.Y_CP); $Move_Rel (Size_Grid, 0); $Core^.Polygon_Interior := Patterned; $Core^.Polygon_Edge := Solid_Line; $Circle_Abs (Core^.X_CP + Radius, Core^.Y_CP); " Move_Rel (Size_Grid, 0); $Core^.Polygon_Edge := Interior; $Circle_Abs (Core^.X_CP + Radius, Core^. . . . . . . . . . . . . . . . . . . . . . . . "_" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . _ _ _ _ _ _ _ . . . . . . . . . . . . . . . . . Y_CP); $Box_Width := Size_Grid - 10; $Box_Height := Size_Grid - 20; $Move_Abs (5 * Size_Grid Div 2 - Box_Width Div 2, .5 * Size_Grid Div 2 - Box_Height Div 2); Core^.Display_Mode := Fast; $Core^.Polygon_Edge := Solid_Line; $Box_Rel (Box_Width, Box_Height); $Move_Rel (Size_Grid, 0); $Core^.Display_Mode := Fill; $Core^.Polygon_Interior := Plain; $Box_Rel (Box_Width, Box_Height); $Move_Rel (Size_Grid, 0); $Core^.Polygon_Edge := Interior; $Box_Rel (Box_Width, Box_Height); A O^{L $Move_Rel (Size_Grid, 0); $Core^.Polygon_Interior := Patterned; $Core^.Polygon_Edge := Solid_Line; $Box_Rel (Box_Width, Box_Height); $Move_Rel (Size_Grid, 0); $Core^.Polygon_Edge := Interior; $Box_Rel (Box_Width, Box_Height); "End; " "  Procedure Label_It; "Begin $Core^.Char_Width := Core^.Font_Cols; $Core^.Char_Height := Core^.X_Max Div 40; $Core^.Text_Index := 3; $Core^.Left_Right := Center; $Core^.Top_Bottom := Center; $Move_Abs (3 * Size_Grid Div 2, 3 * Size_Grid Div 2); $Text ('CirW . . . . . W . W . . . . . W . W . . . . . W . W . . . . . W . W . . . . . W . W . . W . . W . W . . W . . W . W . W . W . W . W . W . W . W . . W . . . W . . . W . . . W . . . . . . . . . . . . . . . . . . "X" . . . . . . . . X . . . . . X . X . . . . . X . X . . . . . X . . X . . . X . . . . X . X . . . . . . X . . . . . . X . X . . . . X . . . X . . X  Program Example;  {$U Grafdraw.Code}  Uses Graf_Draw;  Var Box_Width, Box_Height, Radius, Height_Grid, Width_Grid, Size_Grid, $Height_Of_Frame, Width_Of_Frame : Integer; $My_X_Value, My_Y_Value : Point_Array; $Line_Number : Integer;  "Procedure Draw_Grid; "Begin $Height_Of_Frame := Core^.Y_Max - 20; $Width_Of_Frame := Core^.X_Max - 20;  Size_Grid := Core^.X_Max Div 8; $Height_Grid := 3 * Size_Grid; $Width_Grid := 6 * Size_Grid; $Core^.Line_Index := 2; $Set_Linestyle (On, On, On, On, O . . . . . X . X . . . . . X . X . . . . . X . . . . . . . . . . . . . . . . . "Y" . . . . . . . . Y . . . . . Y . Y . . . . . Y . Y . . . . . Y . . Y . . . Y . . . . Y . Y . . . . . . Y . . . . . . . Y . . . . . . . Y . . . . . . . Y . . . . . . . Y . . . . . . . Y . . . . . . . . . . . . . . . . . . . . "Z" . . . . . . . . Z Z Z Z Z Z Z .      cle'); $Move_Rel (0, Size_Grid); $Text ('Box'); $Move_Rel (0, Size_Grid + Core^.Char_Height); $Text ('Mode'); $Move_Rel (0, -Core^.Char_Height); $Text ('Interior'); $Move_Rel (0, -Core^.Char_Height); $Text ('Edge'); $Move_Rel (Size_Grid, 2 * Core^.Char_Height); $Text ('fast'); $Move_Rel (0, -Core^.Char_Height); $Text ('---'); $Move_Rel (0, -Core^.Char_Height); $Text ('---'); $Move_Rel (Size_Grid, 2 * Core^.Char_Height); $Text ('fill'); $Move_Rel (0, -Core^.Char_Height); $Text ('plain'); $Move_Rel (0, -Core^.Char_Height); $Text ('solid'); $Move_Rel (Size_Grid, 2 * Core^.Char_Height); $Text ('fill'); $Move_Rel (0, -Core^.Char_Height); $Text ('plain'); $Move_Rel (0, -Core^.Char_Height); $Text ('interior'); $Move_Rel (Size_Grid, 2 * Core^.Char_Height); $Text ('fill'); $Move_Rel (0, -Core^.Char_Height); $Text ('pattern'); $Move_Rel (0, -Core^.Char_Height); $Text ('solid'); $Move_Rel (Size_Grid, 2 * Core^.Char_Height); $Text ('fill'); $Move_Rel (0, -Core^.Char_Height); $Text (' Program Test;  Uses Grafdraw;  Const Row_Size = 500; &Hot_Dog_Width = 76; &Hot_Dog_Length = 500; &Hot_Dog_Half = 38; &Hot_Dog_X = 70; &Hot_Dog_Y = 202; &Bun_Width = 200; &Bun_Length = 450; &Bun_Half = 100; &Bun_X = 95; &Bun_Y = 140; &Plate_Radius = 237; &Plate_X_Center = 320; &Plate_Y_Center = 240;  Var Message : String; " "Procedure Draw_Plate; "Begin " Move_Abs (Plate_X_Center, Plate_Y_Center); $Core^.Line_Index := 6; $Core^.Display_Mode := Fill; $Core^.Fill_Index := 7; $Circle_pattern'); $Move_Rel (0, -Core^.Char_Height); $Text ('interior'); " Move_Abs (4 * Size_Grid, 5 * Size_Grid); $Core^.Text_Index := 7; $Core^.Char_Width := Core^.Font_Cols * 2; $Core^.Char_Spacing := -0.2; $Text ('GRAFDRAW Filled Object Parameters'); "End; " "  Begin "Set_Fill_Pattern (1); "Set_Font (0); "Draw_Grid;  Draw_Solids; "Label_It; "Readln;  End. Rel (Plate_Radius); $Core^.Fill_Index := 0; $Circle_Rel (Plate_Radius * 8 Div 9); $Core^.Fill_Index := 7; $Circle_Rel (Plate_Radius * 3 Div 4); $Core^.Display_Mode := Fast; "End {of Draw_Plate}; " " "Procedure Draw_Hot_Dog; "Var I : Integer; "Begin $Core^.Line_Index := 1; $Core^.Fill_Index := 1; $Move_Abs (Hot_Dog_X + Hot_Dog_Half, Hot_Dog_Y + Hot_Dog_Half); $For I := 0 To Hot_Dog_Half Do &Circle_Rel (I); $Move_Abs (Hot_Dog_X + Hot_Dog_Length - Hot_Dog_Half, .Hot_Dog_Y + Hot_Dog_Half); EXAMPLE   &GRAFICS@@@   @@@  0$For I := 0 To Hot_Dog_Half Do &Circle_Rel (I); $Move_Abs (Hot_Dog_X + Hot_Dog_Half, Hot_Dog_Y); " Core^.Display_Mode := Fill; $Box_Rel (Hot_Dog_Length - Hot_Dog_Width, Hot_Dog_Width); $Core^.Display_Mode := Fast; "End {of Draw_Hot_Dog}; " " "Procedure Draw_Bun; "Var I : Integer; "Begin $Core^.Line_Index := 3; $Core^.Fill_Index := 3; $Move_Abs (Bun_X + Bun_Half, Bun_Y + Bun_Half); $For I := 0 To Bun_Half Do &Circle_Rel (I); $Move_Abs (Bun_X + Bun_Length - Bun_Half, Bun_Y + Bun_Half); $FoEXAMPLE z|~~22 r0Ć ĆĆ 1Ć0Ć ĆĆ 1 r r rh w 3Ć  Ć Ć  Ć 3Ć  2ą 22r rh w Ć  4Ć Ć  Ć 2Ć  4ą 22r r#r I := 0 To Bun_Half Do &Circle_Rel (I); $Move_Abs (Bun_X + Bun_Half, Bun_Y); $Core^.Display_Mode := Fill; $Box_Rel (Bun_Length - Bun_Width, Bun_Width); $Core^.Display_Mode := Fast; "End {of Draw_Bun}; " " "Procedure Draw_Message; " $Procedure Delay; $Var A, (B, (C : Integer; " Begin &Time (A, B); &Repeat (Time (A, C); &Until C > B + 180; $End {of Delay}; $ "Begin {of Draw_Message} $Core^.Char_Width := Core^.Font_Cols * 4; $Core^.Char_Height := Core^.Font_Rows * 4;  Ě 2 22r Ěy5xr2r ĚĚĚy5xr2rĚy5xr2rĚĚy5xr2rĚy5xr2 22726r Ě76r 2r Ě76r 2r76r 2rĚ76r 2r76r Ě~(Ě ĚĚ22rr2r r2r rrrrr2rrrrrr2rrr!r$Move_Abs (Hot_Dog_X + Hot_Dog_Length Div 2 - .(Length (Message) * Core^.Char_Width) Div 2, .Hot_Dog_Y + Hot_Dog_Half Div 2); $Repeat $ Core^.Text_Index := 4; $ Text (Message); &Delay; &Core^.Text_Index := 1; &Text (Message); &Delay; $Until False; "End {of Draw_Message}; " "  Begin "Set_Font (0); "Write ('Message ? '); "Readln (Message); "Page (Output); "Write (Chr (26), 'G', Chr (26), 'N', Chr (26), 'P'); "Draw_Plate; "Draw_Bun; "Draw_Hot_Dog; "Draw_Message;  End. r$r2r'rr*rr-r2r2rr5rr9r2r<rr?rrCr22r ĚĚHrcrcr t pCircleeBoxModeeInteriorrEdgeefastt------filllplainsolidfilllplaininteriorrfilllpatternsolidfilllpatterninteriorr!GRAFDRAW Filled Object Parameters iPASCALIOREALOPS GRAFDRAW $CURSOR $EQUAL $TAG $SYNTAX ~O.RR       It will stay on the screen until the [Return] key is hit.   To run the Graftest program, first prefix to Grafics:, then X(ecute  Graftest. A prompt for the background color will appear. Answer with a  digit in the range 0..7 to indicate which color will be the screen  background throughout this run (0 = black, 1 = red, 2 = green, 3 = yellow,  4 = blue, 5 = magenta, 6 = turquiose, 7 = white). A prompt for the  font number will then appear. Answer with a font number (0 is the only  font currens ps p tptpGtptpNtptpPtp Message ? v8 EXTRAIO PASCALIOGRAFDRAW tly defined) followed by [Return]. A prompt for the fill  pattern number will then appear. Answer with a pattern number (0..3 are  currently defined, as described above) followed by [Return]. This pattern  will be used whenever a rectangle or a circle are filled with a pattern.  The graphics demonstration is divided into 6 sections: the cursor, lines,  boxes, circles, text, and blocks. A prompt preceeds each section to  determine whether or not that section is to be demonstrated. The valid O^AA responses are 'Y', 'N', and . Several frames are drawn within  each section. At the end of each frame, a prompt appears demanding  a to continue. An followed by a aborts the program. Note that because a frame may occupy the  entire screen, a prompt may not be legible. Since the set of responses  for the section and frame prompts are mutually exclusive, no ambiguities  should result.   Note that there may be a delay between the X(ecute command and the actual  execution of the program. This is due to system overhead involved with  the initialization of the system REALOPS unit.    All GRAFDRAW routines are included in the GRAFDRAW interface section.  Due to insufficient specification and/or insufficient hardware, not  all routines are implemented in the same manner as Ramtek's original  unit. Note that even though the implementation of most functions  are compatible with the Ramtek implementation, programs that run   On the graphics package, contained on GRAFICS:  "You have 6 program modules: %7220.Proc0.Text Contains entry points into the 7220.Core module. %7220.Proc1.Text Contains entry points into the 7220.Core module. %7220.Core.Text Contains assembly code for graphics assist. 8All other 7220.= files are included by this 8file. %Grafdraw.Text Contains Pascal interface text and code for 8GRAFDRAW unit. All other Graf.= files are 8included by this file. %Font.Comp.Text Font compile with the Ramtek GRAFDRAW unit must be recompiled before they may be  used with the NEC GRAFDRAW unit because of differences in variable  and procedure declaration orders.   The differences between the Ramtek and the NEC implementations fall into  three categories: incompatibilities, additions, and performance  considerations.   Incompatibilities arise from the incomplete implementation of some  GRAFDRAW intrinsics. They include:   1) Circles are not clipped at the display edges. As currr %Pat.Comp.Text Pattern compiler  "You have 2 test/demo programs: %Demo.Text Short demonstration program. %Graftest.Text Extensive demonstration and validation suite. %  You have 2 versions of the GRAFDRAW unit code file: %*Grafdraw.Code Contains GRAFDRAW unit that has been run 8through the native code generator. %*NGrafdraw.Code Contains GRAFDRAW unit in P-Code  "You have 1 character font and 4 patterns: ently %implemented, they will draw off the end of the screen and %possibly reenter the screen at an unexpected location. This %applies to circle borders and circle filling. I believe it %is possible to perform proper clipping, but only with %nontrivial analysis and coding.  "2) No documentation was provided as to the initial states of most %of the GRAFDRAW Core attributes. I have set them to reasonable %defaults, but cannot predict what will happen during the execution %Font00.Font Data file containing the default character 8font. %Font.A.Text Contains the source of the first 2/3 of the font 8definition found in Font00.Font. %Font.A.Text Contains the source of the last 1/3 of the font 8definition found in Font00.Font. %Pat00.Ptrn Data file containing a medium sized triangle 8pattern. %Pat.A.Text Contains the source to the pattern in Pat00.Ptrn. %Pat01.Ptrn Data file containing a medium sized rectangle 8pattern. %P;TEST ) &NEW_NEC@@ w  @@ w 0at.B.Text Contains the source to the pattern in Pat01.Ptrn. %Pat02.Ptrn Data file containing a small grid pattern. %Pat.C.Text Contains the source to the pattern in Pat02.Ptrn. %Pat03.Ptrn Data file containing a large triangle pattern. %Pat.D.Text Contains the source to the pattern in Pat03.Ptrn.    To run the Demo program, first prefix to Grafics:, then X(ecute Demo.  A drawing of all rectangle and circle drawing modes will appear. :TEST ,k@r Ě Ě Ār Ā r Ār Ė Ě ĀF&ʀ&r&ih ! r hF&ʀ&r&ih ! r hF&r āLLr  Ėc Ě Ā_ddrdih ! r h_ddrdih ! r h_dr āȣr  Ėzbapb`p !ĚĀFʀ&r Ćr ĆrۖUcr s pP     %of existing programs that depend on Ramtek's default values. % "3) Evidently, on most current NEC hardware the display hardware appears %to jam the leftmost pixels together. I understand that this can %be corrected by changing initialization parameters to the 7220. %I have not called NEC regarding these values as of yet, but %expect to doso in time to incorporate them into the next release %of the GRAFDRAW unit. % "4) When drawing a circle in XOR mode, the 45 degree points cancel %each other i"processes the character definitions until the end of the text file "is encountered. It then prompts for the name of a continuation "text file. If there are no other text files, a "causes the font compiler to close the font data file and terminate. " "Font text files are line oriented. The first line of the first "text file in a font definition contains four numbers describing the font. "The first number is the number of pixels in the horizontal direction. "The second number in many, if not most, cases. I have consulted with %NEC on this problem, but their solutions do not seem to work. I %expect to have a good solution in time for the next release of %the GRAFDRAW unit. % "5) Due to limitations imposed by the NEC hardware, the DEFINE_COLOR %procedure performs no action. In addition, the SET_PALETTE and %PLANE_VISIBLE procedures also perform no action. However, the %INQ_COLOR does return values consistent with the Ramtek %implementation. % s the number of pixels in the vertical direction. "The third number is the ASCII value of the first character in the font "definition (e.g. 32 for ). The fourth number is the ASCII value "of the last character in the font definition (e.g. 127 for ). "Numbers are separated by one or more spaces. A "follows the last number. The remainder of the text file (and "all of any continuation text files) contains character definitions,  6) Many of the options accessable through the SET_VALUE procedure %are not implemented. These include opcodes 1 and 3 and parts of %opcode 0 (options 1 through 7 and option 18). Option 1 of opcode %0 is not implemented because of hardware limitations. Options %2 through 7 and 18 of opcode 0 are not implemented because of %ambiguities in the GRAFDRAW specification. %  7) The Display_Mode option for the Text procedure is not implemented. %This is an optional feature used with special Ramtek "starting with the lowest valued character of the font and continuing "without interruption through the highest valued character. A "character definition consists of a line containing the character "enclosed in quotes (e.g. "G") followed by several lines containing a "drawing consisting of alternating patterns of either '.'s (representing "an empty pixel) or characters other than '.'s (representing a dot), "separated by two spaces. Each line corresponds to a row of the "character image. There hardware, and %is not easy to implement on NEC hardware.   8) Patterns processed during rectangle and circle filling and patterns %processed with the WRITE_BLOCK_PIXELS and READ_BLOCK_PIXELS %procedures are limited to 255 pixels in the X direction. This is %because the assembly language procedures responsible for %processing these patterns can hold their inner-loop variables in %registers, thus maintaining a reasonably fast drawing speed on all %pattern drawing. % are as many lines as there are rows in the "character image. The next character definition follows immediately "after the last line of the current character definition; there are no "intervening blank lines. An example of a character definition for "a 8 by 14 character is: " ;"b" ;. . . . . . . . ;. b . . . . . . ;. b . . . . . . ;. b . . . . . . ;. b . b b . . . ;. b b . . b . . ;. b . . . . b . ;. b . . . . b .  The additions are as follows: " "1) The GRAFDRAW unit specification does not mention any connection %between the WRITE_BLOCK_PIXELS and the Overlay_Mode. It appears %as though there is no interaction intended. I implemented this %procedure to draw in either Replace mode or XOR mode depending %on the value of Overlay_Mode. % %  The performance considerations are as follows:  "1) All drawing and filling procedes fastest when the Overlay_Mode %is set to XOR. This is because in Replace mode, a;. b . . . . b . ;. b . . . . b . ;. b b . . b . . ;. b . b b . . . ;. . . . . . . . ;. . . . . . . . = "Note that there should be no blank lines either at the end of the "font text file nor at the beginning. " "The format of the .FONT datafile is: " &Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3: Value of the first character in the font &Word 4: Value of the last character inll drawing must %be done in all three planes (either to set bits or to clear bits), %whereas in XOR mode, planes in which no bits need be processed are %not drawn. % "2) Since the NEC graphics hardware does not match the Ramtek hardware, %certain operations require extra processing in order to emulate %operation on the Ramtek. The most notable of these are the %READ_BLOCK_PIXELS and WRITE_BLOCK_PIXELS procedures. The %READ_BLOCK_PIXELS procedure is slightly slower than would be  the font &Word 5-? Array [Word3..Word4] of character images & &Each character image is an array of byte-aligned rows. Each row &occupies (Word1 + 7) Div 8 bytes. Each character occupies &Word2 * ((Word1 + 7) Div 8) bytes. There are no padding bytes &between rows nor between character definitions.     Using the pattern compiler:  "The pattern compiler accepts a text file containing a pattern "definition and produces a .PTRN data file acceptable for use with %expected. The WRITE_BLOCK_PIXELS has a large startup time involved %with decomposing the source patterns into three plane images %(red, green, and blue) before the pattern can be drawn. This %decomposition occurs on each call to WRITE_BLOCK_PIXELS (the %time delay is approximately 10% of the actual drawing time). " " Using the font compiler:  "The font compiler accepts a series of text files containing a font "definition and produces a .FONT data file acceptable for use with "the GRAFDRAW uni"the GRAFDRAW unit. To execute the pattern compiler, X(ecute PAT.COMP. "The compiler will prompt for the name of the text file containing "the pattern definition. This file contains pattern parameters and the "pattern definition. The next prompt is for the name of the pattern "data file. This should be specified as "PATxx" where xx is a two "digit font number (e.g. 00 or 15). The compiler will store the "pattern definition in the file PATxx.PTRN. The pattern compiler then "processes the pattt. To execute the font compiler, X(ecute FONT.COMP. "The compiler will prompt for the name of the first text file of "the font definition. This file contains font parameters and the "first part of the font definition. The next prompt is for the name "of the font data file. This should be specified as "FONTxx" where xx "is a two digit font number (e.g. 00 or 15). The compiler will store the "font definition in the file FONTxx.FONT. The font compiler then      2s2ÿZ2Z2s2¿Z2s2¿Z2Whr      āTrr   āTr r   "āTkrr   ār  Ăr    āT k rrȆˀGpˀNprc˥c˥1cr0cr rrt prr TICOM Systems Running the UCSD p-SystemJ. Curlite " "Each line corresponds to a row of the pattern image. There are as "many lines as there are rows in the pattern image. An example of a "character definition for an 11 by 11 pattern is: " /. b b b b b b b b b . /y . b b b b b b b . g /y y . b b b b b . g g /y y y . b b b . g g g /y y y y . b . g g g g /y y y y y . g g g g g /y y y y . r . g g g g /y y y . r r r . g g g /y y . r r r r r . g g yyTMMB PASCALIOREALOPS GRAFDRAW /y . r r r r r r r . g /. r r r r r r r r r . " "Note that there should be no blank lines either at the end of the "pattern text file nor at the beginning. " "The format of the .PTRN datafile is: " &Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3-? Array [Word1..Word2] of pattern rows & &The pattern image is an array of word-aligned rows. Each row &consists of an array of color identifiers each occupying$CURSOR $EQUAL O.GG 4 bits. &A row occupies (Word1 + 3) Div 4 words. The pattern occupies &Word2 * ((Word1 + 3) Div 4) words. Note that this format &corresponds to the internal representation of an array under the &UCSD Pascal system. An array declaration for the example &pattern might be 0 0Array [1..11] Of Packed Array [1..11] Of 0..15; * &The color token values for the possible colors are: & 20 for dark (black) 21 for red 22 for green 23 for yellow 24 for blue 25 for purple 26 for turquoise 27 for white " "  11 11 (X direction size, Y direction size)  t t t t t t t t t t t  t r r r r r r r r r t  t r y y y y y y y r t  t r y g g g g g y r t  t r y g . . . g y r t  t r y g . . . g y r t  t r y g . . . g y r t  t r y g g g g g y r t  t r y y y y y y y r t  t r r r r r r r r r t  t t t t t t t t t t t  PSYSTEM  &JAS_PLY@@   @@  0ern definition until the end of the text file "is encountered. The pattern compiler then closes the pattern data "file and terminates. " "Pattern text files are line oriented. The first line of the text file "contains two numbers describing the pattern. The first number is the "number of pixels in the horizontal direction. The second number is the "number of pixels in the vertical direction. The numbers are separated "by one or more spaces. A follows the second number. PSYSTEM Z Ě #%$r2sÿ2r2r2s俀2r2s俀2r2r%$rrr "b%$r22sÿ22r%2sÿ$2r22sÿ22r% $rr!\%2sÿ$2r22sÿ22r%2sÿ$2rrZs2¿Zs2¿Zs2ÿZ2s2ÿZ2s2ÿZ"The remainder of the text file contains the pattern definition. A "pattern definition consists of several lines containing a drawing "consisting of color identifiers representing the value of each "pixel, each separated by two spaces. The color identifiers are: " *D, d, or . for dark (black) *R or r for red *G or g for green *Y or y for yellow *B or b for blue *P or p for purple *T or t for turquoise *W or w for wh      fffff333#""# # # #""333fffffElse 0New_Len := X_Max - X_CP; .Len_Y := Round (Len_Y / Abs (Len_X) * Abs (New_Len)); .Len_X := New_Len; , Result := Draw_Clipped; ,End {of If X_CP}; *If (Y_CP + Len_Y > Y_Max) Or (Y_CP < -Len_Y) Then ,Begin .If Y_CP < -Len_Y Then 0New_Len := -Y_CP .Else 0New_Len := Y_Max - Y_CP; .Len_X := Round (Len_X / Abs (Len_Y) * Abs (New_Len)); .Len_Y := New_Len; .Result := Draw_Clipped; ,End {of If Y_CP}; *If Draw Then ,GR_Line (X_CP, Y_CP, Len_X, Len_Y, Line_Style, $CURSOR $EQUAL $TAG $SYNTAX $LAST gO.r 5Line_Index, Planes_On, Overlay_Mode); *Draw := (Len_X <> 0) Or (Len_Y <> 0); *X_CP := New_X; *Y_CP := New_Y; (End {of For}; $If Kill_Cursor Then &Draw_Cursor (Cursor_X, Cursor_Y); " Core^.Draw_Result := Result; "End {of PLine_Abs}; "{$N^} " " " "{$N+} "Procedure PLine_Rel {Var X_Length, ;Y_Length : Point_Array; ;Count : Integer}; "Var Len_X, &Len_Y, &Result, &New_Len, &I : Integer; &Kill_Cursor, &Draw : Boolean; "Begin $Draw := True; $Kill_Cursor := (Core^.Overlay_Mode = Replace) And CSR_Is_Enabled And 3CSR_Is_Visible; $If Kill_Cursor Then &Draw_Cursor (Cursor_X, Cursor_Y); $Result := Draw_OK; $With Core^ Do &For I := 1 To Count Do (Begin *Len_X := X_Length[I]; *Len_Y := Y_Length[I]; *Result := Draw_OK; *If (X_CP + Len_X > X_Max) Or (X_CP < -Len_X) Then ,Begin .If X_CP < -Len_X Then 0New_Len := -X_CP .Else 0New_Len := X_Max - X_CP; .Len_Y := Round (Len_Y / Abs (Len_X) * Abs (New_Len)); .Len_X := New_Len; , Result := Draw_Clipped; ,End {of If X_CP}; { Beginning of Graf.Line Include File } 8 " "Procedure Set_Line_Style {Dot_1,  Y_Max) Or (Y_CP < -Len_Y) Then ,Begin .If Y_CP < -Len_Y Then 0New_Len := -Y_CP .Else 0New_Len := Y_Max - Y_CP; .Len_X := Round (Len_X / Abs (Len_Y) * Abs (New_Len)); .Len_Y := New_Len; .Result := Draw_Clipped; ,End {of If Y_CP}; *If Draw Then ,GR_Line (X_CP, Y_CP, Len_X, Len_Y, Line_Style, 5Line_Index, Planes_On, Overlay_Mode); *Draw := (Len_X <> 0) Or (Len_Y <> 0); *X_CP := X_CP + Len_X; *Y_CP := Y_CP + Len_Y; (End {of For}; $If Kill_Cursor Then &Draw_Cursor (Cursor_XLine_Style};    "{$N+} "Procedure Line_Rel {X_Length, 6Y_Length : Point}; "Var Kill_Cursor : Boolean; " Result, &New_Length : Integer; "Begin $With Core^ Do &Begin (Result := Draw_OK; (Kill_Cursor := (Overlay_Mode = Replace) And CSR_Is_Enabled And 7CSR_Is_Visible; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (If (X_CP + X_Length > X_Max) Or (X_CP < -X_Length) Then *Begin ,If X_CP < -X_Length Then .New_Length := -X_CP ,Else .New_Length := X_Max - X_CP; , Cursor_Y); " Core^.Draw_Result := Result; "End {of PLine_Rel}; "{$N^} "  { Ending of Graf.Line Include File } 8 "  ,Y_Length := Round (Y_Length / Abs (X_Length) * Abs (New_Length)); ,X_Length := New_Length; * Result := Draw_Clipped; *End {of If X_CP}; (If (Y_CP + Y_Length > Y_Max) Or (Y_CP < -Y_Length) Then *Begin ,If Y_CP < -Y_Length Then .New_Length := -Y_CP ,Else .New_Length := Y_Max - Y_CP; ,X_Length := Round (X_Length / Abs (Y_Length) * Abs (New_Length)); ,Y_Length := New_Length; ,Result := Draw_Clipped; *End {of If Y_CP}; ( (GR_Line (X_CP, Y_CP, X_Length, Y_Length, Line_Style, 1Line_Index, Plane$CURSOR $EQUAL $TAG $SYNTAX $O.r s_On, Overlay_Mode); (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (Draw_Result := Result; (X_CP := X_CP + X_Length; (Y_CP := Y_CP + Y_Length; &End {of With}; "End {of Line_Rel}; "{$N^} " " 6 "Procedure Line_Abs {X_End, 6Y_End : Point}; "Begin $Line_Rel (X_End - Core^.X_CP, Y_End - Core^.Y_CP); "End {of Line_Abs}; " "  "{$N+} "Procedure PLine_Abs {Var X_End, ;Y_End : Point_Array; ;Count : Integer}; "Var New_X, &New_Y : Point; &Result, &New_Len, &Len_X, &Len_Y, &I : Integer; &Kill_Cursor, &Draw : Boolean; "Begin $Draw := True; $Kill_Cursor := (Core^.Overlay_Mode = Replace) And CSR_Is_Enabled And 3CSR_Is_Visible; $If Kill_Cursor Then &Draw_Cursor (Cursor_X, Cursor_Y); $Result := Draw_OK; $With Core^ Do &For I := 1 To Count Do (Begin *Result := Draw_OK; *New_X := X_End[I]; *New_Y := Y_End[I]; *Len_X := New_X - X_CP; *Len_Y := New_Y - Y_CP; *If (X_CP + Len_X > X_Max) Or (X_CP < -Len_X) Then ,Begin .If X_CP < -Len_X Then 0New_Len := -X_CP .     9Y_Position : Point}; "Begin $With Core^ Do &If CSR_Is_Enabled Then (Begin *Draw_Result := Draw_Overflow; *If (X_Position >= 0) And (X_Position <= X_Max) Then ,If (Y_Position >= 0) And (Y_Position <= Y_Max) Then .Begin 0If CSR_Is_Visible Then 2Draw_Cursor (Cursor_X, Cursor_Y); 0Cursor_X := X_Position; 0Cursor_Y := Y_Position; 0If CSR_Is_Visible Then 2Draw_Cursor (Cursor_X, Cursor_Y) 0Else 2Draw_Result := Draw_OK; .End {of If (Y_Position}; (End {of If CSR_} &Else (Draw_Result := Draw_OK;  { Beginning of Graf.Rect Include File } 8 " "Procedure Set_Fill_Pattern {Pattern_Num : Pat_Type}; Var Read_Words, &N_Words, &Valid_Words, &Index : Integer; &Pat_Ptr : Record 4Case Integer Of 60 : (Nib : Pat_Im_P); 61 : (Word : ^Font_Image); 2End {of Pat_Ptr}; &Have_Red, &Have_Green, &Have_Blue, &Have_Pattern, &Bad_IO : Boolean; &Pat_Name : String; &Pat_File : File; &Pat_Buff : Record 5Pat_X : Integer; 5Pat_Y : Integer; 5Trash : Array [0..255] Of Integer; 3End {of  "End {of Move_Cursor};    "Procedure Set_Cursor {Attrib : Cur_Attribute}; "Begin $Core^.Draw_Result := Draw_OK; $If Attrib <= Cur_Enable Then &Begin (If CSR_Is_Enabled <> (Attrib = Cur_Enable) Then *If CSR_Is_Visible Then ,Draw_Cursor (Cursor_X, Cursor_Y); (CSR_Is_Enabled := Attrib = Cur_Enable; &End {of If <= Cur_Enable} $Else &If CSR_Is_Enabled Then (If Attrib <= Cur_Invisible Then *Begin ,If CSR_Is_Visible <> (Attrib = Cur_Visible) Then .Draw_Cursor (Cursor_X, Cursor_Y); Pat_Buff}; "Begin $If Core^.Pat_Number >= 0 Then &Begin (Var_Dispose (Pat_Rec.Pat_Blue_Ptr, Pat_Im_Size); (Var_Dispose (Pat_Rec.Pat_Green_Ptr, Pat_Im_Size); (Var_Dispose (Pat_Rec.Pat_Red_Ptr, Pat_Im_Size); (Core^.Pat_Number := -1; & Pat_Rec.Pat_Is_Valid := False; &End {of If}; $Pat_Name := 'Patxx.Ptrn'; $Pat_Name[4] := Chr (Pattern_Num Div 10 + Ord ('0')); $Pat_Name[5] := Chr (Pattern_Num Mod 10 + Ord ('0'));  {$I-} $Reset (Pat_File, Concat (Core^.File_Prefix, ':', Pat_Name)); ,CSR_Is_Visible := Attrib = Cur_Visible; *End {of <= Cur_Invisible} (Else *If Attrib = Cur_Small Then ,Size_Cursor (Small_Cursor_Size) *Else ,Size_Cursor (Large_Cursor_Size); " If Not CSR_Is_Enabled Or Not CSR_Is_Visible Then &Core^.Draw_Result := Draw_OK; "End {of Set_Cursor};    "Procedure Size_Cursor {Size : Integer}; "Begin $Core^.Draw_Result := Draw_OK; $If CSR_Is_Enabled And (CSR_Size <> Size) Then &If Size >= 0 Then (Begin *If CSR_Is_Visible Then ,Draw_Cursor (Cursor_X, Curso$Core^.Draw_Result := Draw_Not_Found; $If IO_Result = 0 Then &If Blockread (Pat_File, Pat_Buff, 1) = 1 Then (With Pat_Buff, Pat_Rec Do *Begin ,Pat_Im_Size := (Pat_X + 23) Div 16 * Pat_Y; ,Have_Red := Var_New (Pat_Red_Ptr, Pat_Im_Size) = Pat_Im_Size; ,Have_Blue := Var_New (Pat_Green_Ptr, Pat_Im_Size) = Pat_Im_Size; ,Have_Green := Var_New (Pat_Blue_Ptr, Pat_Im_Size) = Pat_Im_Size; ,N_Words := (Pat_X + 3) Div 4 * Pat_Y; ,Have_Pattern := Var_New (Pat_Ptr.Nib, N_Words) = N_Words; , ,If Have_Pattern r_Y); *CSR_Size := Size; *If CSR_Is_Visible Then ,Draw_Cursor (Cursor_X, Cursor_Y); (End {of If Size} &Else & Core^.Draw_Result := Draw_Overflow; "End {of Size_Cursor}; "Procedure Move_Abs {X_Position, 6Y_Position : Point}; "Begin $With Core^ Do &If (X_Position >= 0) And (X_Position <= X_Max) Then (If (Y_Position >= 0) And (Y_Position <= Y_Max) Then *Begin * Draw_Result := Draw_OK; ,X_CP := X_Position; ,Y_CP := Y_Position; *End {of If (Y_Position} (Else Then .Begin 0Bad_IO := False; 0Valid_Words := 254; 0Index := 0; 0Repeat 2If N_Words <= Valid_Words Then 4Read_Words := N_Words 2Else 4Read_Words := Valid_Words; 2Moveleft (Trash, Pat_Ptr.Word^[Index],  0 Then 4Bad_IO := Blockread (Pat_File, Trash, 1) <> 1; 2Valid_Words := 256; 0Until Bad_IO Or (N_Words = 0); 0If Not Bad_IO Then 2With Core^ Do 4Begin 6Pat_Number := Pattern_Num; & Draw_Result := Draw_Overflow &Else (Draw_Result := Draw_Overflow; "End {of Move_Abs};    "Procedure Move_Rel {Delta_X, 6Delta_Y : Point}; "Var New_X, &New_Y : Integer; "Begin $With Core^ Do &Begin (New_X := X_CP + Delta_X; (New_Y := Y_CP + Delta_Y; (If (New_X >= 0) And (New_X <= X_Max) Then *If (New_Y >= 0) And (New_Y <= Y_Max) Then ,Begin .Draw_Result := Draw_OK; .X_CP := New_X; .Y_CP := New_Y; ,End {of If (Y_Position} *Else ,Draw_Result := Draw_Overflow (Else *Draw_Resul6Pat_Cols := Pat_X; 6Pat_Rows := Pat_Y; 6Pat_Is_Valid := True; 6Core^.Draw_Result := Draw_OK; 6With Pat_Rec Do 8GR_Unpack (Pat_Ptr.Nib^, Pat_X, Pat_Y, CPat_Red_Ptr^, Pat_Uses_Red, CPat_Green_Ptr^, Pat_Uses_Green, CPat_Blue_Ptr^, Pat_Uses_Blue); 4End {of With Core^}; 0Var_Dispose (Pat_Ptr.Nib, (Pat_X + 3) Div 4 * Pat_Y); .End {of If Have_Pattern} ,Else .Begin 0Core^.Draw_Result := Draw_No_Memory; 0If Have_Red Then 2Var_Dispose (Pat_Red_Ptr, Pat_Im_Size); 0If Have_Green Then 2Var_Dispose (t := Draw_Overflow; $ End {of With}; "End {of Move_Rel};     {$N^}  { Ending of Graf.Curs Include File }   { Beginning of Graf.Curs Include File }  {$N+} 8 "Procedure Draw_Cursor (X, Y : Integer); "Var Low, &High : Integer; "Begin $Core^.Draw_Result := Draw_OK; $If X - CSR_Size < 0 Then &Begin (Low := 0; (Core^.Draw_Result := Draw_Clipped; &End {of If} $Else &Low := X - CSR_Size; $If X + CSR_Size > Core^.X_Max Then &Begin (High := Core^.X_Max; (Core^.Draw_Result := Draw_Clipped; &End {of If} $Else &High := X + CSR_Size; $GR_Line (Low, Y, High - Low, 0, 255, -Ord (C_White) - Ord (Odd (Core^$CURSOR $EQUAL $TAG $LAST _O.R.Background) And Odd (7)), 7, -Xor); $If Y - CSR_Size < 0 Then &Begin (Low := 0; (Core^.Draw_Result := Draw_Clipped; &End {of If} $Else &Low := Y - CSR_Size; $If Y + CSR_Size > Core^.Y_Max Then &Begin (High := Core^.Y_Max; & Core^.Draw_Result := Draw_Clipped; &End {of If} $Else &High := Y + CSR_Size; $GR_Line (X, Low, 0, High - Low, 255, -Ord (C_White) - Ord (Odd (Core^.Background) And Odd (7)), 7, Xor); "End {of Draw_Cursor}; " " " "Procedure Move_Cursor {X_Position,      Pat_Green_Ptr, Pat_Im_Size); 0If Have_Blue Then 2Var_Dispose (Pat_Blue_Ptr, Pat_Im_Size); .End {of Else Have_Pattern}; *End {of With Pat_Buf};  {$I^} "End {of Set_Fill_Pattern};  " " Procedure Rect_Pattern (Length_X, :Length_Y : Integer; 6Var R_Pat_Rec : Pattern_Rec; :R_Pat_Cols, :R_Pat_Rows : Integer); "Var X_Offset, &Y_Offset : Integer; "Begin $With Core^, R_Pat_Rec Do &If Pat_Is_Valid Then (Begin *If X_CP + Length_X >= 0 Then ,X_Offset := 0 *Else s, &N_Words : Integer; &L_Pat_Rec : Pattern_Rec; "Begin $With L_Pat_Rec, Core^ Do &If (Rows > 0) And (Columns > 0) Then (Begin *Pattern.Prm := Data; *N_Words := (Columns + 23) Div 16 * Rows; *Red_Words := Var_New (Pat_Red_Ptr, N_Words); *Green_Words := Var_New (Pat_Green_Ptr, N_Words); *Blue_Words := Var_New (Pat_Blue_Ptr, N_Words); *If Blue_Words <> 0 Then ,Begin .GR_Unpack (Pattern.Ptr^, Columns, Rows, 9Pat_Red_Ptr^, Pat_Uses_Red, 9Pat_Green_Ptr^, Pat_Uses_Green, ,X_Offset := Pred (-X_CP - Length_X) Mod R_Pat_Cols; *If Y_CP + Length_Y >= 0 Then ,Y_Offset := 0 *Else ,Y_Offset := Pred (-Y_CP - Length_Y) Mod R_Pat_Rows; *If (Pat_Uses_Red Or (Overlay_Mode = Replace)) And Odd (Planes_On) Then ,GR_R_Pat (X_CP, Y_CP, Length_X, Length_Y, 6Pat_Red_Ptr^, R_Pat_Cols, R_Pat_Rows, 6X_Offset, Y_Offset, 1, Overlay_Mode); *If (Pat_Uses_Green Or (Overlay_Mode = Replace)) .And (Ord (Odd (Planes_On) And Odd (2)) = 2) Then ,GR_R_Pat (X_CP, Y_CP, Length_X, Length_Y, 6Pat_G9Pat_Blue_Ptr^, Pat_Uses_Blue); .Pat_Is_Valid := True; .Kill_Cursor := (Overlay_Mode = Replace) And =CSR_Is_Enabled And CSR_Is_Visible; .If Kill_Cursor Then 0Draw_Cursor (Cursor_X, Cursor_Y); .X_CP := Pred (X_CP); .Y_CP := Pred (Y_CP); .Rect_Pattern (Succ (Columns), Succ (Rows),  X_Max) Or (Y_CP + Rowreen_Ptr^, R_Pat_Cols, R_Pat_Rows, 6X_Offset, Y_Offset, 2, Overlay_Mode); *If (Pat_Uses_Blue Or (Overlay_Mode = Replace)) /And (Ord (Odd (Planes_On) And Odd (4)) = 4) Then ,GR_R_Pat (X_CP, Y_CP, Length_X, Length_Y, 6Pat_Blue_Ptr^, R_Pat_Cols, R_Pat_Rows, 6X_Offset, Y_Offset, 4, Overlay_Mode); (End {of If Pat_Is_Valid}; "End {of Rect_Pattern}; " " " "Procedure Box_Abs {X_Corner, Y_Corner : Point}; "Var Kill_Cursor : Boolean; " Cur_X, &Cur_Y, &Result : Integer; "Begin s > Y_Max) Then 0Draw_Result := Draw_Clipped .Else 0Draw_Result := Draw_OK; ,End {of If} *Else ,Draw_Result := Draw_No_Memory; *If Green_Words <> 0 Then ,Var_Dispose (Pat_Green_Ptr, Green_Words); *If Red_Words <> 0 Then ,Var_Dispose (Pat_Red_Ptr, Red_Words); (End {of If} &Else (Draw_Result := Draw_OK; "End {of Write_Block_Pixels}; " " " "Procedure Read_Block_Pixels {Data : Sorcery; Rows, Columns : Integer}; Var Kill_Cursor : Boolean; "Begin $With Core^ Do $With Core^ Do &Begin (If (X_Corner < 0) Or (X_Corner > X_Max) Or +(Y_Corner < 0) Or (Y_Corner > Y_Max) Then ( Result := Draw_Clipped (Else *Result := Draw_OK; (Kill_Cursor := ((Overlay_Mode = Replace) Or 8(Display_Mode = Fill)) And CSR_Is_Enabled And 7CSR_Is_Visible; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (If Polygon_Edge = Solid_Line Then *If Result = Draw_Clipped Then ,Begin .Cur_X := X_CP; .Cur_Y := Y_CP; .Line_Abs (X_Corner, Y_CP); .If (X_Corner >= 0) And (X_Corner&If (Rows > 0) And (Columns > 0) Then (Begin *Kill_Cursor := (Overlay_Mode = Replace) And CSR_Is_Enabled And 9CSR_Is_Visible; *If Kill_Cursor Then ,Draw_Cursor (Cursor_X, Cursor_Y); *GR_Read (X_CP, Y_CP, Data^, Columns, Rows); *If Kill_Cursor Then ,Draw_Cursor (Cursor_X, Cursor_Y); *If (X_CP + Columns > X_Max) Or (Y_CP + Rows > Y_Max) Then ,Draw_Result := Draw_Clipped *Else ,Draw_Result := Draw_OK; (End {of If} &Else (Draw_Result := Draw_OK; "End {of Read_Block_Pixels};  { Ending of Graf. <= X_Max) Then 0Line_Abs (X_Corner, Y_Corner); .X_CP := Cur_X; .Y_CP := Cur_Y; .Line_Abs (X_CP, Y_Corner); .If (Y_Corner >= 0) And (Y_Corner <= Y_Max) Then 0Line_Abs (X_Corner, Y_Corner); .X_CP := Cur_X; .Y_CP := Cur_Y; ,End {of If X_Corner} *Else ,GR_Box (X_CP, Y_CP, X_Corner - X_CP, Y_Corner - Y_CP, Line_Style, 4Line_Index, Planes_On, Overlay_Mode); (If Display_Mode = Fill Then *If Polygon_Interior = Plain Then ,GR_R_Fill (X_CP, Y_CP, X_Corner - X_CP, Y_Corner - Y_CP, Rect Include File } 8 "  7Fill_Index, Planes_On, Overlay_Mode) *Else ,Rect_Pattern (X_Corner - X_CP, Y_Corner - Y_CP, :Pat_Rec, Pat_Cols, Pat_Rows); (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); & Draw_Result := Result; &End {of With}; "End {of Box_Abs};    "Procedure Box_Rel {Width, Height : Point}; "Var Kill_Cursor : Boolean; " X_Corner, &Y_Corner : Integer; "Begin $With Core^ Do &Begin (X_Corner := X_CP + Width; (Y_Corner := Y_CP + Height; (If (X_Corner < 0) Or (X_Corner > X_Max) Or +($CURSOR $EQUAL \;O.R Y_Corner < 0) Or (Y_Corner > Y_Max) Then ( Box_Abs (X_Corner, Y_Corner) (Else *Begin ,Kill_Cursor := ((Overlay_Mode = Replace) Or <(Display_Mode = Fill)) And CSR_Is_Enabled And ;CSR_Is_Visible; ,If Kill_Cursor Then .Draw_Cursor (Cursor_X, Cursor_Y); ,If Polygon_Edge = Solid_Line Then .GR_Box (X_CP, Y_CP, Width, Height, Line_Style, 6Line_Index, Planes_On, Overlay_Mode); ,If Display_Mode = Fill Then .If Polygon_Interior = Plain Then 0GR_R_Fill (X_CP, Y_CP, Width, Height, ;Fill_Index, Planes_On, Overlay_Mode) .Else 0Rect_Pattern (Width, Height, Pat_Rec, Pat_Cols, Pat_Rows); ,If Kill_Cursor Then .Draw_Cursor (Cursor_X, Cursor_Y); * Draw_Result := Draw_OK; *End {of If (X_Corner}; &End {of With}; "End {of Box_Rel}; " " & Procedure Write_Block_Pixels {Data : Sorcery; Rows, Columns : Integer}; "Var Pattern : Record 4Case Integer Of 60 : (Ptr : Pat_Im_P); 61 : (Prm : Sorcery); 2End {of Pattern}; &Kill_Cursor : Boolean; &Red_Words, &Green_Words, &Blue_Word        { Beginning of Graf.Flood Include File } 8 " "Procedure Flood; "Var Kill_Cursor : Boolean; "Begin $With Core^ Do &Begin (Kill_Cursor := (Overlay_Mode = Replace) And CSR_Is_Enabled And 7CSR_Is_Visible; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (If Polygon_Interior = Plain Then *GR_Area_Solid (X_CP, Y_CP, Fill_Index, Planes_On, Overlay_Mode) (Else *{Insert GR_Area_Pattern call here}; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); " Draw_Result := Draw_OK; &E@; Length_X, Length_Y, @; Color, Enabled, @; Overlay : Integer); (.Ref Rect_Fill ( (Jmp (Junk)  Junk .Word Rect_Fill  ( (.End nd {of With Core^}; "End {of Flood};    { Ending of Graf.Flood Include File } 8 "  $CURSOR $EQUAL G.MGRINIT GRINIT IV.0 [1e]L &"&46.&LN:&dfF&|~<0$  Barbara Firchau January 31, 1984  NCR GmbH  Ulmer Strasse 160  D-8900 Augsburg  West Germany   Dear Barbara,  %Enclosed you will find a DecisionMate diskette containing a  demonstration version of the Grafdraw graphics module and documentation.  This fulfills the terms of the agreement between NCR and Ticom Systems  dated May 3, 1983. We are sorry that you were made to wait so long for  this package. We assumed Ticom's obligation only recently and GRINIT GRINIT INIT IT GRCLEAR GRCLEAR CLEAR 6EAR GRLINE GRLINE LINE NNE GRBOX GRBOX BOX fX RECTFILL~CTFILLGRRFILL GRRFILL  have  acted as expeditiously as possible.  %The diskette contains the Grafdraw unit (in Grafdraw.Code), a native  code generated version of Grafdraw (in NGrafdraw.Code), a demonstration  program (Graftest.Code) and a number of fonts and patterns. To execute  the demonstration:  ,1) Boot your p-System with the demonstration disk in the /right drive. / ,2) Change the Userlib.Text on the system disk to contain /NGrafdraw.Code. / ,3) X(ecute Graftest p=#5 , $CURSOR $EQUAL ugO.R(.NoPatchList ( (.Relproc GR_Init,1 ; Procedure GR_Init (Var Rec : Init_Rec); (.Ref Init ( (Jmp (Junk)  Junk .Word Init  ( (.Relproc GR_Clear,7 ; Procedure GR_Clear (Start_X, Start_Y, ( ; Length_X, Length_Y, @; Color, Enabled, @; Overlay : Integer); (.Ref Clear ( (Jmp (Junk)  Junk .Word Clear  ( (.Relproc GR_Line,8 ; Procedure GR_Line (X_Start, Y_Start, @;  X_Length, Y_Length, @; Pattern, Color, @; Enabled, Overlay : Integer); (.Ref Line  (Jmp (Junk)  Junk .Word Line  (.Relproc GR_Box,8 ; Procedure GR_Box (X_Start, Y_Start, @; X_Length, Y_Length, @; Pattern, Color, Enabled, @; Overlay : Integer); (.Ref Box ( (Jmp (Junk)  Junk .Word Box  (.Relproc GR_R_Fill,7 ; Procedure GR_R_Fill (Start_X, Start_Y,       ,4) Watch the demonstrations flash up on the screen. Type / when a draw is complete and the next demonstration  will begin. Type to abort the program.  %The Graftest program is actually a validation program and is not  intended as a marketing demonstration. Thus, some screens will appear  to do nothing while they are actually doing something invisible or are  supposed to do nothing. You should be able to get a good idea of the  speed and capabilities of the package " Y_Array : Array [0..Max_Window] Of Record MY_Start, MY_Size : Integer; K Clipped : Boolean; KEnd {of Y_Array}; &Occupied : Set Of 0..Max_Coord; "Begin " With Core^ Do &Begin (Rec_Count := 0; (Cur_Rec := Window_Chain; (Draw_Result := Draw_OK; (Occupied := []; (While (Cur_Rec <> Nil) And (Draw_Result = Draw_OK) Do *With Cur_Rec^, Y_Array[Rec_Count] Do ,Begin .If (Win_X_Org < 0) Or (Win_Y_Org < 0) Or 1(Disp_X_Org < 0) Or (Disp_Y_Org < 0) Or 1(Win_X_Size < 0) Or (Win_Y_Size < 0) Thfrom these demonstrations.  %The enclosed documentation consists of Ticom's documentation for a  prior release and my notes to Ticom describing the differences between  the prior release and the current release. Because the implementation  of the NEC 7220 chip differs between the NEC APC and the DecisionMate,  the documentation for the DecisionMate will differ slightly, but will  also include the new intrinsics. Nevertheless, you should be able to en 0Draw_Result := Draw_Overflow .Else 0If (Win_X_Size <> Main_Window^.Win_X_Size) Or 3(Disp_X_Org <> 0) Or 3(Pred (Win_X_Org + Win_X_Size) > Glob_X_Max) Then 2Draw_Result := Draw_Win_Imp 0Else 2Begin 4Clipped := False; 4If Win_Y_Org Mod Win_Y_Res <> 0 Then 6Begin 8Y_Start := Win_Y_Org - Win_Y_Org Mod Win_Y_Res; 8Clipped := True; 8(*1 Writeln ('Clipping for Y resolution'); (*2*) 6End {of If} 4Else 6Y_Start := Win_Y_Org; 4If Disp_Y_Org + Win_Y_Size > Main_Window^.Win_Y_Size Then 6Begin  write programs that exercise Grafdraw. The source to the Graftest  program is provided as a courtesy so that you may understand how the  demonstration was constructed.  %Please give me a call when you have evaluated the package and  either have questions or are ready to discuss terms. You can reach me  either at our offices or at home. The office number is (619) 457-1595.  My home number is (619) 455-7904.   XSincerely,    XBarry Demchak XVice President   8Y_Size := Main_Window^.Win_Y_Size - Disp_Y_Org; 8Clipped := True; 8(*1 Writeln ('Clipping for Y display overflow'); (*2*) 6End {of If Y_Start} 4Else 6Y_Size := Win_Y_Size; 4If Pred (Y_Start + Y_Size) > Glob_Y_Max Then 6Begin 8Y_Size := Succ (Glob_Y_Max - Y_Start); 8Clipped := True; 8(*1 Writeln ('Clipping for Y space overflow'); (*2*) 6End {of If Pred}; 4(*1 Writeln ('Attempting window from ', Disp_Y_Org, ' to ', =Pred (Disp_Y_Org + Y_Size)); (*2*) 4Occupied := Occupied + F[Disp_Y_Org..Pred (Disp_Y_Org + Y_Size)]; , End {of Else}; .Rec_Count := Succ (Rec_Count); .Cur_Rec := Cur_Rec^.Next_Window; ,End {of With}; (If Draw_Result = Draw_OK Then *If (Occupied * [0..Pred (Main_Window^.Win_Y_Size)] <> ,[0..Pred (Main_Window^.Win_Y_Size)]) And (Window_Chain <> Nil) Then ,Draw_Result := Draw_Win_Imp *Else ,If Rec_Count <= Max_Windows Then .If Window_Chain <> Nil Then 0Begin 2Cur_Rec := Window_Chain; 2Rec_Count := 0; 2While Cur_Rec <> Nil Do $Core^.Draw_Result := Draw_Not_Imp; "End {of Set_Palette};    "Procedure Set_Value {Opcode, 7Value : Integer}; "Var Temp_Value : Integer; "Begin $Core^.Draw_Result := Draw_Not_Imp; $Case Opcode Of &0 : Case Value Of ,0 : Graf_Init; ,1 : { Not implemented -- see Set_Palette }; ,2 : {*** Not implemented yet, enable text display ***}; ,3 : {*** Not implemented yet, disable text display ***}; ,4 : {*** Not implemented yet, set all attributes to blink ***}; ,5 : {*** Not implemented yet, se4With Cur_Rec^, Y_Array[Rec_Count] Do 6Begin 8If Win_X_Org Mod Win_X_Res <> 0 Then :Begin  Main_Window^.Win_X_Size Then :Begin  Glob_X_Max Then :Begin  0)ackground, Planes_On, Replace); $If Kill_Cursor Then &Draw_Cursor (Cursor_X, Cursor_Y); " Core^.Draw_Result := Draw_OK; "End {of Erase}; " " " "Procedure Erase_Alpha; "Var Buffer : Packed Array [0..0] Of Char; "Begin $Buffer[0] := Chr (12); $Unitwrite (1, Buffer, 1); $Core^.Draw_Result := Draw_OK; "End {of Erase_Alpha}; "   {$N+} " "Procedure Set_Window {Window_Chain : Win_Rec_P}; "Var Cur_Rec : Win_Rec_P; " X_Size, &X_Start, &Rec_Count : Integer;        (.NoPatchList ( (.Relproc GR_Text,11 ; Procedure GR_Text (X_Start, Y_Start : Integer; @; Var Pattern; @; P_Rows, P_Cols, @; Mag_X, Mag_Y, @; Color, Enabled, Overlay, @; Direct : Integer); (.Ref Text ( (Jmp (Junk)  Junk .Word Text   (.Relproc GR_R_Pat,11 ; Procedure GR_R_Pat (X_Start, Y_Start, @; Rect_X, Rect_Y : Integer; @; Var Pattern; @; lg 7220.core 7220.proc0 7220.proc1 7220.proc2 grafdraw.code  Pat_X, Pat_Y, @; Pat_Start_X, Pat_Start_Y, @; Color, Overlay : Integer); (.Ref Rect_Pat ( (Jmp (Junk)  Junk .Word Rect_Pat   (.Relproc GR_Read,5 ; Procedure GR_Read (X_Start, Y_Start : Integer; @; Var Pattern; @; Columns, Rows : Integer); (.Ref Read  (Jmp (Junk)  Junk .Word Read   (.Relproc GR_Unpack,9 ; Procedure GR_Unpack ( @; Var Pattern; GRTEXT GRTEXT IV.0 [1e]@; Pat_X, Pat_Y : Integer; @; Var Red_Pat; @; Var Uses_Red : Boolean; @; Var Green_Pat; @; Var Uses_Green : Boolean; @; Var Blue_Pat; @; Var Uses_Blue : Boolean); 7 (.Ref Unpack  (Jmp (Junk)  Junk .Word Unpack   (.Relproc GR_Fill_Circle,6 ; Procedure Fill_Circle (Center_X, Center_Y, A; Radius, Overlay, A;  &"&46.&LN:&dfF&|~R&^&j&v&l`TH<0$  Color, A; Enabled : Integer); 7 (.Ref Cir_Fill  (Jmp (Junk)  Junk .Word Cir_Fill  ( (.Relproc GR_Cir_Pat,8 ; Procedure GR_Cir_Pat (Center_X, Center_Y, A; Radius : Integer; A; Var Pattern; A; Pat_X, Pat_Y, Color, A; Overlay : Integer); 7 (.Ref Cir_Pat  (Jmp (Junk)  Junk .Word Cir_Pat   TEXT XT GRTEXT  GRTEXT RECTPAT 6CTPAT GRRPAT  GRRPAT READ NAD GRREAD GRREAD GRUNPACK  GRUNPACKUNPACK fPACK CIRFILL ~RFILL GRFILLCI GRFILLCICIRPAT RPAT GRCIRPAT GRCIRPATAREASOLIEASOLIGRAREASO GRAREASOARC C GRARC  GRARC (.Relproc GR_Area_Solid,5 ; Procedure GR_Area_Solid (X, Y, H; Color, Enclosed, H; Overlay : Integer); (.Ref Area_Solid (Jmp (Trash)  Trash .Word Area_Solid  ( (.RelProc GR_Arc,13 ; Procedure GR_Arc (X, Y, Radius, H; Oct_Start, Len_Start, H; Oct_End, Len_End : Integer; H; Trunc_Prm, Round_Prm, H; Pattern, Color, Enabled, H; Overlay : Integer); (.Ref Arc (Jmp (Trash)  Trash .Word Arc (REGION GION GRREGION GRREGION   And (Pred (X_Start + X_Length) <= Glob_X_Max) Then *If (Y_Length > 0) And (Pred (Y_Start + Y_Length) <= Glob_Y_Max) Then ,Begin .If CSR_Is_Enabled And CSR_Is_Visible Then 0Draw_Cursor (Cursor_X, Cursor_Y); .X_CP := 0; .Y_CP := 0; .X_Max := Pred (X_Length); .Y_Max := Pred (Y_Length); .Region_X_Org := X_Start; .Region_Y_Org := Y_Start; .GR_Region (X_Start, Y_Start, X_Length, Y_Length); .Cursor_X := 0; .Cursor_Y := 0; .If CSR_Is_Enabled And CSR_Is_Visible Then 0Draw_Cursor (0, 0) .Else $CURSOR $EQUAL $LAST $SYNTAX dO.Rx0Draw_Result := Draw_OK; ,End {of If (Y_Length}; &End {of With}; "End {of Set_Region}; "  {$N^} "   { Ending of Graf.Misc Include File } " "         ( " .RelProc GR_Region,4 ; Procedure GR_Region ( H; X_Start, H; Y_Start, H; X_Length, H; Y_Length : Integer); (.Ref Region (Jmp (Trash)  Trash .Word Region ( ( (.End $CURSOR $EQUAL $TAG $LAST qLTqO.rxMGRSTART GRSTART IV.0 [1e]L &"&46.&LN:&dfF&|~<0$  { Beginning of Graf.Font Include File } 8 " "Procedure Set_Font {Font_Num : Font_Type}; Var Read_Words, &N_Words, &Valid_Words, &Index : Integer; &Bad_IO : Boolean; &Font_Name : String; &Font_File : File; &Font_Buff : Record 4Font_X : Integer; 4Font_Y : Integer; 4Min_Ch : Char; 4Max_Ch : Char; 4Trash : Array [0..255] Of Integer; 2End {of Font_Buff}; "Begin $If Core^.Font_Number >= 0 Then &Begin (Var_Dispose (Font_Ptr, Font_Im_Size); (Core^.Font_Number := -1; &End {of If}; START ART GRSTART GRSTART GRSTOP GRSTOP STOP 6OP GRWINDOW GRWINDOWWINDOW NNDOW GRYVAL GRYVAL YVAL fAL GRSCANUN GRSCANUNSCANUNTI~ANUNTI $Font_Name := 'Fontxx.Font'; $Font_Name[5] := Chr (Font_Num Div 10 + Ord ('0')); $Font_Name[6] := Chr (Font_Num Mod 10 + Ord ('0'));  {$I-} $Reset (Font_File, Concat (Core^.File_Prefix, ':', Font_Name)); $Core^.Draw_Result := Draw_Not_Found; $If IO_Result = 0 Then &If Blockread (Font_File, Font_Buff, 1) = 1 Then (With Font_Buff Do *Begin ,N_Words := Succ (Ord (Max_Ch) - Ord (Min_Ch)) * 7(Succ (Font_Y * ((Font_X + 7) Div 8)) Div 2); ,Font_Im_Size := Var_New (Font_Ptr, N_Words); $CURSOR $EQUAL $LAST $SYNTAX O.Rx,If Font_Im_Size <> 0 Then .Begin 0Bad_IO := False; 0Valid_Words := 252; 0Index := 0; 0Repeat 2If N_Words <= Valid_Words Then 4Read_Words := N_Words 2Else 4Read_Words := Valid_Words; 2Moveleft (Trash, Font_Ptr^[Index], Read_Words * 2); 2Index := Index + Read_Words; 2N_Words := N_Words - Read_Words; 2If N_Words <> 0 Then 4Bad_IO := Blockread (Font_File, Trash, 1) <> 1; 2Valid_Words := 256; 0Until Bad_IO Or (N_Words = 0); 0If Not Bad_IO Then 2With Core^ Do 4Begin 6Font_Number := Font_Num; 6Font_Cols := Font_X; 6Font_Rows := Font_Y; 6Font_Min_Ch := Min_Ch; 6Font_Max_Ch := Max_Ch; 4 Draw_Result := Draw_OK; 4End {of With}; .End {of If Font_Im_Size} ,Else .Core^.Draw_Result := Draw_No_Memory; (End {of If Blockread};  {$I^} "End {of Set_Font};  " " Procedure Set_Charup {DX_Charup, 8DY_Charup : Integer}; "Begin $If Abs (DY_Charup) >= Abs (DX_Charup) Then &Begin (Core^.DX_Charup := 0; (If DY_Charup = 0 Then *Core^.DY_Charup := 1 (Else  (.NoPatchList ( (.Relproc GR_Start,0 ; Procedure GR_Start; (.Ref Start ( (Jmp (Junk)  Junk .Word Start   (.Relproc GR_Stop,0 ; Procedure GR_Stop; (.Ref Stop ( (Jmp (Junk)  Junk .Word Stop   (.Relproc GR_Window,5 ; Procedure GR_Window (Win_Num, X_Org, Y_Org, @; X_Size, Y_Size : Integer; (.Ref Window  (Jmp (Junk)  Junk .Word Window ( ( (.Relfunc GR_Y_Val,2 ; Function Y_Val (Radius, N) : Integer; (.Ref *Core^.DY_Charup := DY_Charup Div Abs (DY_Charup); &End {of If Abs} $Else &Begin (Core^.DY_Charup := 0; (Core^.DX_Charup := DX_Charup Div Abs (DX_Charup); &End {of Else Abs}; " Core^.Draw_Result := Draw_OK; "End {of Set_Charup};   7  {$N+} "Procedure Text {The_String : String}; "Var Write_X, &X, &Y, &New_X, &New_Y, &X_Mag, &Y_Mag, &Spacing, &Index, &R_Length, &R_Width, &L_Length, &Result, &Font_Size, &Rotation : Integer; &Do_Char, &Kill_Cursor : Boolean; "Begin $With C Y_Val  (Jmp (Junk)  Junk .Word Y_Val ( ( (.Relfunc GR_Scan_Until,3 ; Function Scan_Until (Radius, Max_Y_Val, @; N) : Integer; (.Ref Scan_Until  (Jmp (Junk)  Junk .Word Scan_Until ( ( (.End       $CURSOR $EQUAL $TAG $SYNTAX $LAST eO.Rx*d (Y + R_Width) > Y_Max) Then 8Result := Draw_Clipped; 4End {of Left}; ,Right : Begin 6Case Top_Bottom Of 8Bottom : {Do nothing}; 8Center : Y := Y - R_Width Div 2; 8Top : Y := Y - R_Width; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - (L_Length + R_Length) Div 2; 8Right : X := X - L_Length - R_Length; 6End {of Case Left_Right}; 6If (Y < 0) Or (Pred (Y + R_Width) > Y_Max) Then 8Result := Draw_Clipped; 4End {of Right}; ,Up : Begin 6Case Top_Bottom Of 8Top : Y := Y - L_Length - R_Length; 8Center : Y := Y - (L_Length + R_Length) Div 2; 8Bottom : {Do nothing}; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - R_Width Div 2; 8Right : X := X - R_Width; 6End {of Case Left_Right}; 6If (X < 0) Or (Pred (X + R_Width) > X_Max) Then 8Result := Draw_Clipped; 4End {of Up}; ,Down : Begin 6Case Top_Bottom Of 8Top : Y := Y - R_Length; 8Center : Y := Y - R_Length + F(L_Length + R_Lengt ;  ; Beginning of 7220.Arc Include File  ;   AR_X_Start .Equ 28 ; Offset of X coordinate  AR_Y_Start .Equ 26 ; Offset of Y coordinate  AR_Radius .Equ 24 ; Offset of radius  AR_Oct_Start .Equ 22 ; Offset of starting octant  AR_Len_Start .Equ 20 ; Offset of number of dots in start  AR_Oct_End .Equ 18 ; Offset of ending octant  AR_Len_End .Equ 16 ; Offset h) Div 2; 8Bottom : Y := Y + L_Length; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - R_Width Div 2; 8Right : X := X - R_Width; 6End {of Case Left_Right}; 6If (X < 0) Or (Pred (X + R_Width) > X_Max) Then 8Result := Draw_Clipped; 4End {of Down}; *End {of Case Char_Path}; *If Result = Draw_OK Then ,Begin .Kill_Cursor := (Core^.Overlay_Mode = Replace) And CSR_Is_Enabled =And CSR_Is_Visible; .If Kill_Cursor Then 0Draw_Cursor (Cursor_X, Cursor_Y); of number of dots in end  AR_Trunc .Equ 14 ; Offset of counterclockwise max dots  AR_Round .Equ 12 ; Offset of clockwise maximum dots  AR_Pattern .Equ 10 ; Offset of draw pattern  AR_Color .Equ 8 ; Offset of color  AR_Enabled .Equ 6 ; Offset of planes enabled  AR_Overlay .Equ 4 ; Offset of overlay mode  .New_X := X; .New_Y := Y; .For Index := 1 To Length (The_String) Do 0If (The_String[Index] >= Font_Min_Ch) And 3(The_String[Index] <= Font_Max_Ch) Then 2Begin 4Case Char_Path Of 6Left : Begin @New_X := X - Spacing; 6 Do_Char := (X + Spacing <= X_Max) And K(New_X >= -1); >End {of Left}; 6Right : Begin @New_X := X + Spacing; @Do_Char := (X >= 0) And (Pred (New_X) <= X_Max); >End {of Right}; 6Up : Begin @New_Y := Y + Spacing; @Do_Char := (Y >= 0) And (Pred (New_Y) <= Y_Max);  Arc: ; Draw an arc according to the parameters on the stack   Mov BP,SP ; Set up stack addressing (Mov GR_V_P8,0FFFFH ; Setup D1 := -1 (Mov SI,(BP+AR_Radius) ; Load radius (Mov BX,SI (Dec BX (Jns $00 ; Is there anything to draw ? (Jmp $99  $00: Mov GR_V_P4,BX ; Setup D := Radius - 1 (Shl BX,1 (Mov GR_V_P6,BX ; Setup D2 := 2 x (Radius - 1) (Mov SI,(BP+AR_Trunc) (Mov AX,(BP+AR_Round) ( (Xor DI>End {of Up}; 6Down : Begin @New_Y := Y - Spacing; @Do_Char := (Y + Spacing <= Y_Max) And K(New_Y >= -1); >End {of Down}; 4End {of Case}; 4If Do_Char Then 6GR_Text (X, Y, Font_Ptr^[(Ord (The_String[Index]) - OOrd (Font_Min_Ch)) * Font_Size], ?Font_Cols, Font_Rows, X_Mag, Y_Mag, ?Text_Index, Planes_On, ?Core^.Overlay_Mode, Rotation) 4Else 6Result := Draw_Clipped; 2 X := New_X; 4Y := New_Y; 2End {of If (The_String}; .If Kill_Cursor Then 0Draw_Cursor (Cursor_X, Cursor_Y); ,DI ; Indicate that the last part needs to be drawn (Mov DX,(BP+AR_Oct_Start) $ Test DL,01H ; Is this a counterclockwise draw ? (Jz $40 (Mov BX,(BP+AR_Len_Start) (Cmp BX,AX ; Is Dots_Missing > Round ? $ Jle $41 (Mov BX,AX ; Yes, keep this in line  $41: Cmp DX,(BP+AR_Oct_End) (Jne $42 ; Is the last octant the same as the first ? $ Mov CX,(BP+AR_Len_End) (Cmp CX,(BP+AR_Len_Start) ( End {of If Result}; *Draw_Result := Result; (End {of If Font_Number} &Else (Draw_Result := Draw_No_Font; "End {of Text};  {$N^}  { Ending of Graf.Font Include File } 8 "  ore^ Do &If Font_Number >= 0 Then (Begin *Result := Draw_OK; *Font_Size := ((Font_Cols + 7) Div 8 * Font_Rows) Div 2; *Rotation := Text_Rotations[DX_Charup, DY_Charup]; *X_Mag := (Char_Width + Font_Cols Div 2) Div Font_Cols; *Y_Mag := (Char_Height + Font_Rows Div 2) Div Font_Rows; *If (DX_Charup <> 0) = (Char_Path <= Right) Then ,Begin .R_Length := Y_Mag * Font_Rows; .R_Width := X_Mag * Font_Cols; ,End {of If} *Else ,Begin .R_Length := X_Mag * Font_Cols; .R_Width := Y_Mag * Font_Rows; ,End {of Else}; *Spacing := Trunc (R_Length * (Char_Spacing + 1)); *L_Length := Pred (Length (The_String)) * Spacing; *X := X_CP; *Y := Y_CP; *Case Char_Path Of ,Left : Begin 6Case Top_Bottom Of 8Bottom : {Do nothing}; 8Center : Y := Y - R_Width Div 2; 8Top : Y := Y - R_Width; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : X := X + L_Length; 8Center : X := X - R_Length + F(L_Length + R_Length) Div 2; 8Right : X := X - R_Length; 6End {of Case Left_Right}; 6If (Y < 0) Or (Pre      (Jl $42 ; Yes, and is the arc wholly contained ? $ Inc DI ; Yes, we will draw ending part here, too $ Mov AX,CX ; Stop draw short for ending part  $42: Mov CX,BX ; Set up starting X point (Jmp $52  $40: Xor BX,BX ; Draw counter clockwise  Mov AX,(BP+AR_Len_Start)  Cmp AX,SI ; Is Dot_Count > Trunc ? (Jle $45 (Mov AX,SI ; Yes, keep Dot_Count within limit(Add DX,(BP+AR_Radius) ; Yes, start above origin (Jmp $30  $22: Sub DX,(BP+AR_Radius) ; No, start below origin $  $30: Mov GR_V_P10,BX ; Setup dots misssing (Mov GR_V_P2,SI ; Setup dot count (Lea BX,Arc_Dir_Table (Xlat (Or AL,20H ; Setup direction (Mov GR_V_P1,AL ( (Call GR_XY_CV ; Set up cursor position command (Mov GR_Ead,DX (Mov GR_Dad,CL (Mov AH,(BP+AR_Color) ; Get Ramtek colors (Mov AL,(BP+AR_Enabled) (Ls  $45: Cmp DX,(BP+AR_Oct_End) (Jne $46 ; Is this also the ending octant ?  Mov CX,(BP+AR_Len_End) (Cmp AX,CX (Jl $46 ; Yes, and is the arc wholly contained ? (Inc DI ; Yes, we will draw ending arc here, too (Mov BX,CX ; Set up Dots_Missing to make ending angle  $46: Mov CX,AX ; Set up starting X point  Dec CX (Jmp $52  ea BX,Color_Table ; Derive NEC colors (Xlat (Xchg AH,AL (Xlat (Mov SI,(BP+AR_Pattern) ; Get pattern   $05: Shr AH,1 ; Is this plane even enabled ? (Jc $07  Shr AL,1 ; No, shift color out (Jmp $08  $07: Shr AL,1 ; Get low order bit into Carry (Push AX (Mov BL,(BP+AR_Overlay) ; Get overlay mode (Mov AX,SI ; Get requested pattern (Jc $04 ; Should a color be drawn ?  $50: Dec DL ; Move on to next octant (And DL,07H (Cmp DX,(BP+AR_Oct_End) (Jne $51 ; Is this the last octant ? (Inc DI ; Yes, set termination flag  $51: Xor BX,BX ; Assume entire octant will be drawn (Test DL,01H ; Is this a counterclockwise draw ? (Jz $55 (Mov AX,(BP+AR_Round) ; Set up Dot_Count to cover entire angle (Or DI,DI ; Is this the last octant ? (Jz $52 (Mov CX,(BP(Cmp BL,00H ; No, but is this replace mode ? (Jne $06 (Mov BL,2 ; Yes, set mode to clear (Mov AL,0FFH ; Set up for all bits  $04: Mov GR_Text_P1,AL (Mov GR_Text_P2,AL (Call GR_Mode ; Set up overlay mode (Call GR_Text_W ; Set up pattern (Call GR_CSR_R ; Set cursor to (X_Start, Y_Start) in plane (Mov CX,0BH ; Declare vector parameters (Call GR_Vect_W (Call GR_Vect_E ; Execute vector   $+AR_Len_End) ; Yes, stop at ending angle (Cmp CX,AX  Jge $52 ; Does Len_End overrun octant ? (Mov AX,CX ; No, use Len_End  Jmp $52  $55: Mov AX,(BP+AR_Trunc) ; Set up dot count for entire octant  Or DI,DI ; Is this the last octant ?  Jz $52 (Mov BX,(BP+AR_Len_End) ; Yes, set up Dots_Missing for final angle  $52: Push DX (Push DI (Push AX (Push BX 06: Pop AX  $08: Incmb GR_Dad ; Move to next plane (Cmp AL,01H ; Are there more planes left ? (Jnz $05   $90: Ret     YV_Result .Equ 8 ; Offset of Function result  YV_Radius .Equ 6 ; Offset of Arc radius  YV_N .Equ 4 ; Offset of Point on arc 2 2; Calculate the n'th point on the arc 2; return the Y component of the point (Mov SI,AX ; Set up for call (Mov AX,DX (Call Draw_Arc ; Go draw the arc (Pop BX (Pop AX (Pop DI (Pop DX & Or DI,DI ; Are we finished ? (Jz $50  $99: Retl 26 (  Draw_Arc: ; Draw an arc in octant AX, DC = SI, DM = BX (Test AL,01H ; Is this a counterclockwise draw ? (Jnz $11 (Or BX,BX ; Yes, are we attempting draw on major axis ? (Jnz $10 (Cmp AX,(BP+AR_Oct_End) ; Yes, is this t Y_Val: Mov BP,SP ; Establish stack environment (Mov AX,(BP+YV_N) ; Get point we are interested in (Dec AX (Xor SI,SI ; Start X out at 0 (Mov CX,(BP+YV_Radius) (Mov DI,CX ; Start D out at 3 - 2 * Radius (Shl DI,1 (Neg DI (Add DI,0003H   $00: Cmp SI,AX ; Have we finished the loop (X >= Count) ? (Jge $10 (Or DI,DI ; Is D >= 0 ? (Js $05 (Dec CX ; Yes, move in towards che end of the draw ? (Jne $09 (Cmp (BP+AR_Len_Start),0000H ; Yes, but will the start draw collide ? (Jne $10 (Mov CX,(BP+AR_Oct_Start) ; Maybe, are octants next to each other ? (Inc CX (And CL,07H (Cmp CL,AL (Jne $10  $09: Inc BX ; Yes, make sure we don't draw major axis (Jmp $10  $11: Or DI,DI ; Yes, is this the end of the draw ? (Jz $13 (Mov CX,(BP+AR_Trunc) enter (Mov BX,CX (Shl BX,1 ; Calculate new D := D - 4 * Y (Shl BX,1 (Sub DI,BX  $05: Mov BX,SI ; Add offset D := D + 4 * X + 6 (Shl BX,1 (Shl BX,1 (Add DI,BX (Add DI,0006H (Inc SI ; Go to next X (Jmp $00   $10: Mov (BP+YV_Result),CX ; Return Y value as function result (Retl 04    SU_Result .Equ 10 ; Offset of Function result (Cmp (BP+AR_Len_Start),CX ; Yes, but will the start draw collide ? (Jne $10 (Mov CX,(BP+AR_Oct_Start) ; Maybe, are octants next to each other ? (Inc CX (And CL,07H (Cmp CL,AL (Jne $10  $13: Dec SI ; No, make sure there is no later collision  $10: Or BX,BX ; Make sure missing is non-negative (Jns $12 (Xor BX,BX  $12: Cmp BX,SI ; Is there more count than missing ? (Jle $20 (Jmp $90   $20: Mov SU_Radius .Equ 8 ; Offset of Arc radius  SU_Max_Y_Val .Equ 6 ; Offset of Y ceiling  SU_N .Equ 4 ; Offset of X ceiling  2; Calculate the n'th point on the arc, or where arc 2; crosses Y = Max_Y_Val, return the X component of the point  Scan_Until: (Mov BP,SP ; Establish stack environment (Mov AX,(BP+SU_N) ; Get point we are interested in (Mov DX,(BP+SU_Max_Y_Val) ; Get limiting Y value (Xor  CX,(BP+AR_X_Start) ; Draw arc around (X,Y) (Mov DX,(BP+AR_Y_Start) (Test AL,03H ; Does this draw originate on the X-axis ? (Jpo $23 (Test AL,06H ; Yes, is octant in positive Y ? (Jpo $21 (Add CX,(BP+AR_Radius) ; Yes, start to right of origin (Jmp $30  $21: Sub CX,(BP+AR_Radius) ; No, start to left of origin (Jmp $30  $23: Test AL,04H ; No, is octant in positive X ? (Jnz $22        {$E Debug_Arcs} *Case S_Octant Of ,0 : Begin 2If Delta_Y < Cntr Then 4S_Offset := Delta_Y 2Else 4S_Offset := Cntr; 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset < S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := GR_Y_Val (Radius, S_Offset) <= Delta_X; 0End {of 0}; ,1 : Begin 2S_Offset := GR_Scan_Until (Radius, Delta_Y, Clk); 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset > S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := (S_Offset <= Clk) And (S_Offset <= Delta_X); 0End {of 1}; ,2 : Begin 2If Core^.X_CP < Cntr Then 4S_Offset := Core^.X_CP 2Else 4S_Offset := Cntr; 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset < S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := GR_Y_Val (Radius, S_Offset) <= Delta_Y; 0End {of 2}; ,3 : Begin 2S_Offset := GR_Scan_Until (Radius, Core^.X_CP, Clk); 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset > S_Offset Then 8S_Offset := Start_Offset; $CURSOR $EQUAL $TAG $SYNTAX $LAST  tltO.Rx2Has_Offset := (S_Offset <= Clk) And (S_Offset <= Delta_Y); 0End {of 3}; ,4 : Begin 2If Core^.Y_CP < Cntr Then 4S_Offset := Core^.Y_CP 2Else 4S_Offset := Cntr; 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset < S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := GR_Y_Val (Radius, S_Offset) <= Core^.X_CP; 0End {of 4}; ,5 : Begin 2S_Offset := GR_Scan_Until (Radius, Core^.Y_CP, Clk); 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset > S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := (S_Offset <= Clk) And (S_Offset <= Core^.X_CP); 0End {of 5}; ,6 : Begin 2If Delta_X < Cntr Then 4S_Offset := Delta_X 2Else 4S_Offset := Cntr; 2If Is_First Then 4If Start_Octant = S_Octant Then 6If Start_Offset < S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := GR_Y_Val (Radius, S_Offset) <= Core^.Y_CP; 0End {of 6}; ,7 : Begin 2S_Offset := GR_Scan_Until (Radius, Delta_X, Clk); 2If Is_First Then 4If Start_Octant = S_Octant Then  { Beginning of Graf.Circl Include File } 8 " "Procedure Circle_Pattern (Radius : Integer); "Begin $With Core^, Pat_Rec Do &If Pat_Is_Valid Then (Begin *If (Pat_Uses_Red Or (Overlay_Mode = Replace)) And Odd (Planes_On) Then ,GR_Cir_Pat (X_CP, Y_CP, Radius, 8Pat_Red_Ptr^, Pat_Cols, Pat_Rows, 1, Overlay_Mode); *If (Pat_Uses_Green Or (Overlay_Mode = Replace)) .And (Ord (Odd (Planes_On) And Odd (2)) = 2) Then ,GR_Cir_Pat (X_CP, Y_CP, Radius, , Pat_Green_Ptr^, Pat_Cols, Pat_Rows, 2, O6If Start_Offset > S_Offset Then 8S_Offset := Start_Offset; 2Has_Offset := (S_Offset <= Clk) And (S_Offset <= Core^.Y_CP); 0End {of 7}; *End {of Case}; (Until Has_Offset Or .((S_Octant = End_Octant) And -((Long_Arc And Not Is_First) Or (Not Long_Arc And Is_First)));  {$B Debug_Arcs} (Writeln ('Long_Arc = ', Ord (Long_Arc), ' Is_First = ', Ord (Is_First)); (Writeln ('End_Octant = ', End_Octant, ' Start_Octant = ', Start_Octant); (Writeln ('Starting octant = ', S_Octant, ' offset = ', S_Offset); verlay_Mode); *If (Pat_Uses_Blue Or (Overlay_Mode = Replace)) /And (Ord (Odd (Planes_On) And Odd (4)) = 4) Then ,GR_Cir_Pat (X_CP, Y_CP, Radius, 8Pat_Blue_Ptr^, Pat_Cols, Pat_Rows, 4, Overlay_Mode); (End {of If Pat_Is_Valid}; "End {of Circle_Pattern}; " " " "Procedure Arc_Rel {Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Var X_Start, 5Y_Start, 5X_End, 5Y_End : Integer}; "Var Oct_End, &Oct_Start, &Len_Start, &Len_End, &Bias, &Max_Clockwise, &Max_Counterwise,  {$E Debug_Arcs} ( (Done := Not Has_Offset; (If Has_Offset Then *Begin ,E_Octant := Succ (S_Octant) Mod 8; ,Has_Offset := False; ,Repeat .E_Octant := (E_Octant + 7) Mod 8;  {$B Debug_Arcs} .Writeln ('Checking out last octant ', E_Octant);  {$E Debug_Arcs} .Case E_Octant Of 00 : If Radius > Delta_X Then 6Begin 8E_Offset := Delta_X; 8If End_Octant = E_Octant Then :If E_Y_Val < E_Offset Then  Count) ? (Jg $10 (Cmp CX,DX ; Have we crossed our Y boundary ? (Jle $10 (Or DI,DI ; Is D >= 0 ? (Js $05 (Dec CX ; Yes, move in towards center (Mov BX,CX ^.X_Max - Core^.X_CP; &Delta_Y := Core^.Y_Max - Core^.Y_CP; &If Start_Octant = End_Octant Then (If Odd (Start_Octant) Then *Long_Arc := Start_Offset > End_Offset (Else *Long_Arc := Start_Offset < End_Offset &Else (Long_Arc := End_Octant <> (Start_Octant + 7) Mod 8; &Is_First := True; &Done := False; &S_Octant := Succ (Start_Octant) Mod 8; &Repeat (Has_Offset := False; (Repeat *S_Octant := (S_Octant + 7) Mod 8;  {$B Debug_Arcs} *Writeln ('Checking out start octant ', S_Octant); (Shl BX,1 ; Calculate new D := D - 4 * Y (Shl BX,1 (Sub DI,BX  $05: Mov BX,SI ; Add offset D := D + 4 * X + 6 (Shl BX,1 (Shl BX,1 (Add DI,BX (Add DI,0006H (Inc SI ; Go to next X (Jmp $00   $10: Mov (BP+SU_Result),SI ; Return X value as function result (Retl 06  ;  ; End of 7220.Arc Include File  ;           6End {of If}; 01 : If Clk >= Delta_X Then 6Begin 8E_Offset := Delta_X; 8Has_Offset := True; 6End {of If}; 02 : If Radius > Delta_Y Then 6Begin 8E_Offset := Delta_Y; 8If End_Octant = E_Octant Then :If E_Y_Val < E_Offset Then = Delta_Y Then 6Begin 8E_Offset := Delta_Y; 8Has_Offset := True; 6End {of If}; 04 : If Radius > Core^.X_CP Then 6Begin 8E_Offset := Core^.X_CP&Line_Rel (Round (Start_X_Line - Offset * X_Delta), 0Round (Start_Y_Line - Offset * Y_Delta)); &Move_Abs (Center_X, Center_Y); $End {of Draw_Lines}; 8 " "Begin {of Arc_Rel} $With Core^ Do &If Polygon_Edge = Solid_Line Then (Begin *Result := Draw_OK; *Kill_Cursor := (Overlay_Mode = Replace) And CSR_Is_Enabled And 9CSR_Is_Visible And Not Drawing_Circle; *If Kill_Cursor Then ,Draw_Cursor (Cursor_X, Cursor_Y); *Raw_Length := Radius * Sin_45; *Max_Counterwise := Trunc (Raw_Length + 0.25); *Max; 8If End_Octant = E_Octant Then :If E_Y_Val < E_Offset Then = Core^.X_CP Then 6Begin 8E_Offset := Core^.X_CP; 8Has_Offset := True; 6End {of If}; 06 : If Radius > Core^.Y_CP Then 6Begin 8E_Offset := Core^.Y_CP; 8If End_Octant = E_Octant Then :If E_Y_Val < E_Offset Then  X_Max) Or (X_CP - Radius < 0) Or -(Y_CP + Radius > Y_Max) Or (Y_CP - Radius < 0) Then ,Begin .Result := Draw_Clipped; .Doing_Circle := False; ,End {of If X_CP} *Else ,Doing_Circle := Drawing_Circle; . *If Doing_Circle Then 6End {of If}; 07 : If Clk >= Core^.Y_CP Then 6Begin 8E_Offset := Core^.Y_CP; 8Has_Offset := True; 6End {of If}; .End {of Case}; ,Until Has_Offset Or 2((E_Octant = End_Octant) And 3Not (Long_Arc And Is_First And (End_Octant = Start_Octant))); ,If Not Has_Offset Then .E_Offset := End_Offset; ,Abort := False; ,If E_Octant = S_Octant Then .Begin 0If (S_Octant = End_Octant) And Not Long_Arc Then 2If Odd (E_Octant) Then 4Done := S_Offset > End_Offset 2Else 4Done := S_Offset < End_Offset; 0I,GR_Arc (X_CP, Y_CP, Radius, 7, 0, 0, 0, 4Max_Counterwise, Max_Clockwise, Line_Style, 4Line_Index, Planes_On, Overlay_Mode) *Else ,Begin  {$B Debug_Arcs} .Writeln ('Start Angle = ', Start_Angle, 7', End_Angle = ', End_Angle, ' Radius = ', Radius);  {$E Debug_Arcs} .Oct_Start := Trunc (Start_Angle / PI_4 + 0.0083) Mod 8; .Oct_End := Trunc (End_Angle / PI_4 + 0.0083) Mod 8; .Sin_Start := Sin (Start_Angle); .Cos_Start := Cos (Start_Angle); .Sin_End := Sin (End_Angle); .Cos_End := Cos (End_Anglf (End_Octant = E_Octant) And Long_Arc And Not Is_First Then 2If Odd (E_Octant) Then 4Abort := E_Offset > End_Offset 2Else 4Abort := E_Offset < End_Offset; .End {of If E_Octant};  {$B Debug_Arcs} ,Writeln ('Ending octant = ', E_Octant, ' offset = ', E_Offset); ,Writeln ('Abort = ', Ord (Abort), ' Done = ', Ord (Done), 5' Long_Arc = ', Ord (Long_Arc));  {$E Debug_Arcs} ,If Not (Abort Or Done) Then .GR_Arc (Core^.X_CP, Core^.Y_CP, Radius, 6S_Octant, S_Offset, E_Octant, E_Offset, e); .If Oct_Start In [0, 7, 3, 4] Then 0Len_Start := Round (Abs (Radius * Sin_Start)) .Else 0Len_Start := Round (Abs (Radius * Cos_Start)); .If Oct_End In [0, 7, 3, 4] Then 0Len_End := Round (Abs (Radius * Sin_End)) .Else 0Len_End := Round (Abs (Radius * Cos_End)); .Fudge_Circle := False; .If Odd (Oct_Start) Then . Begin 2If Len_Start > Max_Clockwise Then 4Len_Start := Max_Clockwise; 0 If Oct_End = Succ (Oct_Start) Mod 8 Then 4If (Len_Start = 0) And (Len_End = 0) Then 6Begin 6Cntr, Clk, Core^.Line_Style, Core^.Line_Index, 6Planes_On, Core^.Overlay_Mode); ,If Not Done Then .If (End_Octant = E_Octant) Then 0Done := Not Long_Arc Or Not Is_First 8Or (End_Octant <> Start_Octant); *End {of If Has_Offset}; (Is_First := False; (S_Octant := E_Octant; &Until Done; $End {of Clip_Arc};  {$N^}   $Procedure Draw_Lines (Center_X, :Center_Y : Integer; :X_Point, :Y_Point : Integer; :Octant : Integer; :Sin_Angle, :Cos_Angle : Real; :Offset : Integer); $Var St8Fudge_Circle := True; 8Len_End := 1; 6End {of If (Len_Start}; 0End {of If} .Else 0Begin 2If Len_Start > Max_Counterwise Then 4Len_Start := Max_Counterwise; 0End {of Else}; .If Odd (Oct_End) Then . Begin 2If Len_End > Max_Clockwise Then 4Len_End := Max_Clockwise; 0End {of If} .Else 0Begin 2If Len_End > Max_Counterwise Then 4Len_End := Max_Counterwise; 0End {of Else};  {$B Debug_Arcs} .Writeln ('Start Octant = ', Oct_Start, ', Length = ', Len_Start); .Writeln ('End Octant = ', Oct_End,art_X_Line, (Start_Y_Line : Integer; (Normal, (X_Delta, (Y_Delta : Real; $Begin &If Abs (Cos_Angle) > Abs (Sin_Angle) Then (Normal := Abs (Cos_Angle) &Else (Normal := Abs (Sin_Angle); &Y_Delta := Sin_Angle / Normal; &X_Delta := Cos_Angle / Normal; &Case Octant Of (0 : Begin .Start_X_Line := Y_Point; .Start_Y_Line := X_Point; ,End {of 0}; (1 : Begin .Start_X_Line := X_Point; .Start_Y_Line := Y_Point; ,End {of 1}; (2 : Begin .Start_X_Line := -X_Point; .Start_Y_Line := Y_Point;  ', Length = ', Len_End);  Writeln ('Clk = ', Max_Clockwise, ' Cntr = ', Max_Counterwise);  {$E Debug_Arcs} .If Not Drawing_Circle Then 0Begin 2Enabled := CSR_Is_Enabled; 2CSR_Is_Enabled := False; 2If Odd (Oct_Start) Then 4X_Start := Len_Start 2Else 4X_Start := Len_Start - 1; 2Y_Start := GR_Y_Val (Radius, Succ (X_Start)); 2If X_Start < 0 Then 4X_Start := 0; 2If Fudge_Circle Then 4X_End := 0 2Else 4X_End := Len_End; 2Y_End := GR_Y_Val (Radius, Succ (X_End)); ,End {of 2}; (3 : Begin .Start_X_Line := -Y_Point; .Start_Y_Line := X_Point; ,End {of 3}; (4 : Begin .Start_X_Line := -Y_Point; .Start_Y_Line := -X_Point; ,End {of 4}; (5 : Begin .Start_X_Line := -X_Point; .Start_Y_Line := -Y_Point; ,End {of 5}; (6 : Begin .Start_X_Line := X_Point; .Start_Y_Line := -Y_Point; ,End {of 6}; (7 : Begin .Start_X_Line := Y_Point; .Start_Y_Line := -X_Point; ,End {of 7}; &End {of Case}; &If Offset = 1 Then (Move_Abs (Center_X, Center_Y) &Else (Move_Abs (Ce {$B Debug_Arcs} 2Writeln (' X_Start = ', X_Start, ' Y_Start = ', Y_Start); 2Writeln (' X_End = ', X_End, ' Y_End = ', Y_End);  {$E Debug_Arcs} 0End {of If Drawing_Circle}; .If Result = Draw_OK Then 0GR_Arc (X_CP, Y_CP, Radius, Oct_Start, Len_Start, 8Oct_End, Len_End, Max_Counterwise, Max_Clockwise, 8Line_Style, Line_Index, Planes_On, Overlay_Mode) .Else 0Clip_Arc (Radius, Oct_Start, Len_Start, Oct_End, Len_End, :Max_Clockwise, Max_Counterwise, Y_End); .If Not Drawing_Circle Then 0Begin 2Finter_X + Round (X_Delta), Center_Y + Round (Y_Delta));  {$B Debug_Arcs} &Writeln ('Drawing line to (', X_Point, ', ', Y_Point, ') Octant: ', /Octant); &Writeln ('Start_X_Line = ', Start_X_Line, ' Start_Y_Line = ', /Start_Y_Line); &Writeln (' Delta_X = ', X_Delta, ' Delta_Y = ', Y_Delta); &Writeln ('Drawing line from (', Core^.X_CP, ', ', Core^.Y_CP, ') for (', /Round (Start_X_Line - Offset * X_Delta), ', ', /Round (Start_Y_Line - Offset * Y_Delta), ')');  {$E Debug_Arcs}       GRAFDRAW "(  &GRAPH" @@ w  @@ w 0e := PI_2 (Else *Real_Angle := -PI_2 &Else (Real_Angle := Atan ((Y_Edge - Center_Y) / (X_Edge - Center_X)); &If X_Edge < Center_X Then (Real_Angle := Real_Angle + PI &Else (If Y_Edge < Center_Y Then *Real_Angle := Real_Angle + PI_x2; &Angle_Calculate := Real_Angle;  {$B Debug_Arcs} &Writeln ('Edge = (', X_Edge, ', ', Y_Edge, '), Radians = ', Real_Angle, /', Degrees = ', Round (Real_Angle * PI_180));  {$E Debug_Arcs} $End {of Angle_Calculate}; $ " "Begin {of Arc_Abs} $With Core^ Do   "Const Graf_Version = '0.5';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (&Begin (Radius := Round (Sqrt (Sqr (X_Start - X_CP + 0.0) + ?Sqr (Y_Start - Y_CP + 0.0))); (Start_Angle := Angle_Calculate (X_CP, Y_CP, X_Start, Y_Start); (End_Angle := Angle_Calculate (X_CP, Y_CP, X_End, Y_End); (Arc_Rel (Radius, Start_Angle, End_Angle, 3X_Start, Y_Start, X_End, Y_End); " End {of With}; "End {of Arc_Abs}; " " " "Procedure Circle_Rel {Radius : Point}; "Var Kill_Cursor : Boolean; " Result, &Junk : Integer; "Begin $With Core^ Do &Begin (Kill_Cursor := (OverlDraw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( ay_Mode = Replace) And CSR_Is_Enabled And 7CSR_Is_Visible; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (Radius := Abs (Radius); (If Polygon_Edge = Solid_Line Then *Begin * Drawing_Circle := True; ,Arc_Rel (Radius, Deg_359, 0, Junk, Junk, Junk, Junk); ,Drawing_Circle := False; *End {of If}; (If Display_Mode = Fill Then *If Polygon_Interior = Plain Then ,GR_Fill_Circle (X_CP, Y_CP, Radius, Overlay_Mode,  X_Max) Or (X_CP - Radius < 0) Or +(Y_CP + Radius > Y_Max) Or (Y_CP - Radius < 0) Then *Draw_Result := Draw_Clipped (Else *Draw_Result := Draw_OK; &End {of With Core^}; "End {of Circle_Rel}; " " " "Procedure Circle_Abs {X_Of_Edge, Y_Of_Edge : Point}; "Var Kill_Cursor : Boolean; &Junk, &Radius : Integer; "Begin $With Core^ Do &Begin (Radius := Round (Sqrt (Sqr (X_Of_Edge - X_CP + 0.0) + ?Sqr (Y_Of_Edge - Y_'Int_Type = (Plain, { Solid rectangle } 8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } CP + 0.0))); (Kill_Cursor := (Overlay_Mode = Replace) And CSR_Is_Enabled And 7CSR_Is_Visible; (If Kill_Cursor Then *Draw_Cursor (Cursor_X, Cursor_Y); (If Polygon_Edge = Solid_Line Then *Begin * Drawing_Circle := True; ,Arc_Rel (Radius, Deg_359, 0, Junk, Junk, Junk, Junk); ,Drawing_Circle := False; *End {of If}; (If Display_Mode = Fill Then *If Polygon_Interior = Plain Then ,GR_Fill_Circle (X_CP, Y_CP, Radius, Overlay_Mode,  X_Max) Or (X_CP - Radius < 0) Or +(Y_CP + Radius > Y_Max) Or (Y_CP - Radius < 0) Then *Draw_Result := Draw_Clipped (Else *Draw_Result := Draw_OK; &End {of With Core^}; "End {of Circle_Abs};     { Ending of Graf.Circl Include File } 8 "  rst_Line := (X_End < X_Start) Or @((X_End = X_Start) And (Y_End < Y_Start)); 2If First_Line Then 4Begin 4 Draw_Lines (X_CP, Y_CP, X_Start, Y_Start, Oct_Start, BSin_Start, Cos_Start, 1); 6Bias := 2; 4End {of If} 2Else 4Bias := 1; 2Draw_Lines (X_CP, Y_CP, X_End, Y_End, Oct_End, >Sin_End, Cos_End, Bias); 2If Not First_Line Then 4Draw_Lines (X_CP, Y_CP, X_Start, Y_Start, Oct_Start, @Sin_Start, Cos_Start, 3 - Bias); 2CSR_Is_Enabled := Enabled; 0End {of If Drawing_Circle}; ,End {of If Doing_Circle}; *If Kill_Cursor Then ,Draw_Cursor (Cursor_X, Cursor_Y); ( Draw_Result := Result; (End {of If Polygon_Edge}; "End {of Arc_Rel}; " " " "Procedure Arc_Abs {Var Radius : Integer; 5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer}; " $Function Angle_Calculate (Center_X, >Center_Y, >X_Edge, >Y_Edge : Integer) : Real; $Var Real_Angle : Real; $Begin &If X_Edge = Center_X Then (If Y_Edge >= Center_Y Then *Real_Angl       { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record 9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 r X_Start, 5Y_Start, 5X_End, 5Y_End : Integer); " "Procedure Arc_Abs (Var Radius : Integer; 5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer);   Procedure Set_Region (X_Start, 8Y_Start, 8X_Length, 8Y_Length : Integer); 8  Procedure Set_Window (Window_Chain : Win_Rec_P); "  Implementation 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text color} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, GRAFDRAW 0/#1 i0/Ċ#1i#10~ 0~h0/Ċ#1h!" !0&"1 i0/Ċ"1i"10| 0|h0/Ċ"1h#! !0&0h96 / "" ~%!! |8327"!8327 /Ċ /ĖC0/ 9 8327  '9$ 8 327   980/Ėw0/91  8327 83270/ Ė0h"" ~ !! | / " !Ċ / Ċ / Ė0j"y$i"x#h!!"~ "|"/"!" Ċ"/ Ċ"/ ĖE { Columns per char } 9Font_Rows : Point; { Rows per char } 9 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 `$$ rĆĆĆ0o''''' ' ' '' ' ''''''''''''''''!' '"N'.'- ','+!"#"777777"7#'(7'*%')&'(#'/ĖQ0/ Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0/Ėi0/Ė 0/Ė0/ Ė)`*P0/ Ė+?0/ "Z!281/-+)'%#9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coor րO#!!0h0!đ0 Ċ!րdr098h 3270~0|06% 3270/Ė` `p0/ĖP0NiQhN/Ą@@ N/ Od!PO~O}O|O{OzOy N/ ċOz7zO|O~OzN- N/ċPćO}N)PO}O}N)ćPĊPO}ćO{Oy7yP7yO{ćPĊPOyćPyPxN+PN+PyćPĄ@@O{O{Px@@!i xhN/@@7y7yQ N/ċ!ջQթQhi Ռ Od!POdinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw} 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " ~N*O~O~N*jN/ĊO~jO|Oz7z7zO|kN/ĊOzk"#N-N-"kN/ćN/PzN/!"Py#Px4!iOxhnN(2N(QĊ N(Qđ3N/ĖQ0h / "$" -R!#! +C98327  " ! '$ &#$#"!1987 /ĖP0i!98h 327!!y!x! 6!/ 327!/Ė 4`s04t4t4t0ĆĄ pP  0Ȅ  0Ȅ4^^0"u^vu^ Xu^s0/ p%4\v^\]"Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, $yk$xj&$x&&$~: Switch_Type); " "Procedure Line_Abs (X_End, 6Y_End : Point); 6 "Procedure Line_Rel (X_Length, 6Y_Length : Point); 6 "Procedure PLine_Abs (Var X_End, ;Y_End : Point_Array; ;Count : Integer); 7 "Procedure PLine_Rel (Var X_Length, ;Y_Length : Point_Array; ;Count : Integer); 7 Procedure Circle_Abs (X_Of_Edge, Y_Of_Edge : Point); " "Procedure Circle_Rel (Radius : Point); " "Procedure Define_Color (Index, :Red, :Green, :Blue, :Blink, :Hard_Copy : Integer); " &%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$!$ 9 327$/!Ė 0k#y%j#x$i""#~!!#|"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$#!# 9 327#/Ė 0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|-/Ċ-/Ċ-/ $g$t% %t-/Ė6 0i#"B!98h 327"Procedure Inq_Color (Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer); " "Function Inq_Value (Option : Integer) : Integer; " "Procedure Plane_Enable (Planes : Integer); " "Procedure Plane_Visible (Planes : Integer); " "Procedure Set_Palette (Pal_Name : String); " "Procedure Set_Value (Opcode, 7Value : Integer); " "Procedure Erase; " "Procedure Erase_Alpha; "  Procedure Flood; " "Procedure Arc_Rel (Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Va     9 c?DvQ =*** HEAPOPS EXTRAIO STRINGOPEXTRAHEAFILEOPS REALOPS  +,' ,*|,' ,'|*᳡ր%-,&`(`'`&`%`$`#`"`!0 0/Ė u0kj#98h 327#y%#~#y%᳟##y%#yi#~#yi$%!¿l!mj#x$#|#x$᳟##x$#xi#|#xi%$!¿m!lj#y#x%$# # 6#& 327#/"##y%##x$Ė!0y 0xm o098 (327n0 + j"*խn-"xi,"xh!)yl )xk)y$)~)y$᳟#)y$)ym)~)ym#$%¿k%lDRAWOK DRAWCLIPCURDISABCENTER BOTTOM CBLACK CBLUE CCYAN CGREEN CMAGENTACORE CRED CSRSIZE CSRISENA CSRISVIS CURENABLCURVISIBCURINVISCURFULL CURSMALLCURSORX CURSORY CYELLOW CWHITE DOWN DRAWINITDRAWINGC DRAWNOTI DRAWNOTF DRAWNOME DRAWNOFODRAWMAX n)x#)|)x#᳟#)x#)xm)|)xm$#%¿l%kn')y)x$#) ) 6)&$#o)!) "jM(3270/&ĖO m098n&327j0o) h (թ+ xl* xkj'y$'~'y$᳟#'y$'yi'~'yi#$!¿k!lj'x#'|'x#᳟#'x#'xi'|'xi$#!¿l!kj%'y'x$#' ' 6'&$#m''y$''x# hQ&3270/"Ė 0hi!~e!} 6 y x"!z !  .!| 6 y x"!y !  .!{ 6 y x"!x !  . 0~0y 0|0x /.i.i /ihDRAWOVER DRAWWINODRAWWINIFAST FILL FONTIMSIFONTMINC FONTMAXC FONTPTR OFF INTERIORGRINIT $GRCLEAR %GRBOX 'GRAREASO/GRARC 0 GRCIRPAT.GRFILLCI-GRLINE &GRTEXT ( GRRFILL )GRREAD +GRREGION1GRRPAT * GRSTART 2GRSCANUN 6GRSTOP 3GRUNPACK, GRWINDOW4GRYVAL 5LEFT LARGECURk l( (6),)o,o ( 'o'5*l)-6o ( 'o'-'*l0y,0yo,o ( 'o'5)l0y-6o ( 'o'-')l0x,0xo,o ( 'o'50ylt0x-6o ( 'o'-'0ylO*,*o,o ( 'o'50xl'*-6o ( 'o'-'0xlր$(/! ! ժ$k$B(nl&n&**m/&+%+m%,6ml-**ml))m/&+%+m%,6mlj-))ml_0y0ym/&+%+m%,6ml>-0y0yml10MAXCOORDMAINWINDMAXWINDOON REPLACE PLAIN PATTERNEPATIMSIZPATREC PLANESONSOLIDLINRIGHT SIN45 SMALLCURXOR UP TOP TEXTROTA x0xm/&+%+m%,6ml-0x0xmlր$&/! /塠/$.mj&(0(/!&'.k'.k/&! &%.j%.j"#0y0x('&%,-0 0 600#/& ! /kh& #Vj  b f HihCih;ih2ih)ihihih ihր.f󿢇b󿢑!.f .b"0""uh"98:塤 (327/̆i j:)//+ ++' ''"y/"~"y/"x/"|"x$CURSOR $EQUAL $TAG $LAST $SYNTAX wPO.Rx%/h : * "y"x/!"" " 6"0+n'"o+r+r'r'r& /̄m /̄m' /̄l /̄l &%""m'&%$ l%!!m' $""l$!!l:D9 &&%Ċ&%ć%/&x5ć&x&+$Ċ$$ć#/$x5 "y"x/&%'$!"" " 6"0 /&%'$"!#x;:n$x&x$x&x#x%x ,"y"x&x%x&<kk"y"x$x#x'#<,"y"x&x%x&#<) (327"/ Ė/B%'$&`&`*`$&%'r%' ``. $&``2 `0h'$ y6# x:r& y x$#=% y x"!='x&%dcba 0k#98h 327$l# $>aaaa # ##y#x$## 6-$: 327#y$#~#y$#x$#|#x$#/Ċ#/Ė0k%#yB$#xFri#98h 327# !Jbbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#/Ċ#/Ėw0w8 0-0+"0W&!y!x$"#+ 327!y"!~!x#!|!/Ċ!/Ċ!/ĖZ /[s0 5t0ewPe 0e 0Ȅ/[[0"u[}u[eXu[s0/ pխ/Wv՜ZYXWj"t5wlih"!"k!k[ #p #h"#j"/[vli$"$,0[[ć[Wć[XćY Z [/Ċ0/ Ą/s !0 0Ċ0 Ċ 00!!0/Ėy<=P0սjixh  K<<W&SW&S""E &<yy Patxx.Ptrnn: Fontxx.Font: \=bKkw \  GT# ;"K (m)l)m(l%̇¾o'kyx D,$ ,$ ր~-#-%#% -%ր,,$|j,$ ,$ ր-#% -#%ր,,$|j,#% ,#% ր-$ -$ր--$~jV,% ,%#% ,# ր-$ -$ր--$~jր"098/327- , n&ՠ&<&;ՊP-' -'~+᳡>-' -+~      ;  ; Beginning of 7220.Circl Include File  ;   FC_X .Equ 14 ; Offset of X center coordinate  FC_Y .Equ 12 ; Offset of Y center coordinate  FC_Radius .Equ 10 ; Offset of circle radius  FC_Overlay .Equ 8 ; Offset of overlay mode  FC_Color .Equ 6 ; Offset of filling color  FC_Enabled .Equ 4 ; Offset of planes enabled   FC_Last_Y .Word   Cir_Fill(Cmp DX,SS:Y_Clip ; Are we out of the region entirely ? (Jg $32 (Push CX ; Save starting X for later (Call FC_Draw ; Go draw top filling line (Pop CX (  $32: Mov DX,(BP+FC_Y) ; Calculate Center Y - Edge Y  Sub DX,DI (Js $33 ; Are we out of the region entirely ? (Call FC_Draw ; Go draw bottom filling line (  $33: Pop BX ; Retrieve draw length (Mov DX,(BP+FC_Y) ; Get center Y co: ; Fill a circle solid  Mov BP,SP ; Set up stack addressing environment (Movbim GR_Text_P1,0FFH ; Set up line to look solid (Movbim GR_Text_P2,0FFH ; Set up line to look solid  Call GR_Text_W ; Feed pattern parameters  (Xor SI,SI ; Set X edge to 0 (Mov DI,(BP+FC_Radius) ; Set Y edge to Radius (Mov FC_Last_Y,DI (Or DI,DI (Jz $99 (Mov DX,0003H ; Set edge D to 3 - 2 * Radius (Sub DX,DI (Sub DX,DI ordinate (Sub DX,SI ; Calculate Center Y - Edge X + 1 (Inc DX (Jns $34 ; Are we within the region ? (Add BX,DX ; No, shorten the draw length (Xor DX,DX ; Jam Y coordinate to zero  $34: Mov AX,SS:Y_Clip ; Are we out of region on top ? (Sub AX,BX (Sub AX,DX  Jge $35 (Add BX,AX ; Yes, shorten the draw length  $35: Mov GR_V_P2,BX ; Setup DC := |X'| (Neg BX (  $00: Cmp DI,FC_Last_Y ; Has there been movement toward center ? (Je $01 (Mov FC_Last_Y,DI ; Yes, fill further (Call FC_Fill  $01: Mov AX,SI ; Is edge D < 0 ? (Or DX,DX (Jns $02 (Shl AX,1 ; No, make D offset 4 * X + 6 (Shl AX,1 (Add AX,0006H (Jmp $03  $02: Sub AX,DI ; Yes, make D offset 4 * (X - Y) + 10 (Shl AX,1 (Shl AX,1 (Add AX,000AH (Dec DI ; Move in toward cente(Mov GR_V_P4,BX ; Setup D := 2 * |Y'| - |X'| (Shl BX,1 (Mov GR_V_P6,BX ; Setup D2 := 2 x (|Y'| - |X'|) (Movbim GR_V_P1,0CH ; Set direction for down to up (Mov CX,(BP+FC_X) ; Get center X coordinate (Sub CX,DI ; Calculate Center X - Edge Y (Js $36 ; Are we out of the region entirely ? (Push DX ; Save result for later (Call FC_Draw ; Go draw left filling line (Pop DX (  $36: Mov CX,(BP+FC_X) ;r  $03: Add DX,AX ; Apply offset to edge D (Inc SI ; Move to next X (Cmp SI,DI ; Are there still more pixels in this section ? (Jb $00 ( (Jne $10 ; Did we leave one off ? (Cmp DI,FC_Last_Y (Je $10 (Call FC_Fill ; Yes, fill that row too (  $10: Mov AX,SI (Shl SI,1 ; Start out with X length same as Y length (Mov DI,SI (Mov DX,(BP+FC_X) ; Set up to fill middle rectangle  Get center X coordinate (Add CX,DI ; Calculate Center X + Edge Y (Cmp CX,SS:X_Clip ; Are we off the end of the region ? (Jg $37 (Call FC_Draw ; Go draw right filling line (  $37: Pop DX ; Retrieve Edge D (Ret   FC_Draw: (Call GR_XY_CV ; Set up cursor position command (Mov GR_Ead,DX (Mov GR_Dad,CL (Mov AH,(BP+FC_Color) ; Get Ramtek colors (Mov AL,(BP+FC_Enabled) (Lea BX,Color_Table ; Derive NEC colors (Sub DX,AX (Jns $11 ; Are we out of the region ? (Add SI,DX ; Yes, adjust back in (Inc SI (Xor DX,DX (Dec DX  $11: Push DX ; Stack starting X (Mov DX,(BP+FC_Y) (Sub DX,AX (Jns $12 ; Are we out of the region ? (Add DI,DX ; Yes, adjust back in (Inc DI (Xor DX,DX (Dec DX  $12: Push DX ; Stack starting Y (Push SI ; Stack X length (Push DI (Xlat  Xchg AH,AL (Xlat   $05: Shr AH,1 ; Should we even draw in this plane ? (Jc $00  Shr AL,1 ; No, ignore this color  Jmp $02  $00: Shr AL,1 ; Get low order bit into Carry (Push AX (Mov BL,(BP+FC_Overlay) ; Get overlay mode (Jc $01 ; Should a color be drawn ?  Cmp BL,00H ; No, but is this replacement mode ? (Jne $06 (Mov BL,02H ; Set to clear ; Stack Y length (Push (BP+FC_Color) ; Stack colors (Push (BP+FC_Enabled) ; Stack planes enabled (Push (BP+FC_Overlay) ; Stack overlay mode (Push CS ; Stack part of return long address (Call Rect_Fill ; Draw interior block (  $99: Retl 12 (  FC_Fill: ; Fill a rectangular pattern at (CX, DX) constrained by circle  Push DX ; Save edge D (Mov BX,SI ; Calculate 2 * Edge Y - 2 (Dec BX (Shl BX,1  mode  $01: Call GR_Mode ; Set up overlay mode (Call GR_CSR_R ; Set cursor in appropriate plane (Mov CX,0BH ; Declare vector parameters (Call GR_Vect_W (Call GR_Vect_E ; Execute vector (  $06: Pop AX  $02: Incmb GR_Dad ; Move to next plane (Cmp AL,01H ; Are there more planes left ? (Jnz $05 (Ret (    CP_X_Center .Equ 18 ; Offset of center X coordinate (Push BX ; Save initial draw length (Mov GR_V_P8,0000H ; Setup D1 := 2 x |Y'| ( (Mov CX,(BP+FC_X) ; Get center X coordinate (Sub CX,SI ; Calculate Center X - Edge X + 1 (Inc CX (Jns $30 ; Need we clip on left side ?  Add BX,CX ; Yes, adjust length of draw (Xor CX,CX ; Jam start of draw to left border  $30: Mov AX,SS:X_Clip ; Check for clipping on right side (Sub AX,BX ; Must  CP_Y_Center .Equ 16 ; Offset of center Y coordinate  CP_Radius .Equ 14 ; Offset of radius  CP_Pattern .Equ 12 ; Offset of pointer to pattern  CP_Pat_X .Equ 10 ; Offset of horizontal pattern size  CP_Pat_Y .Equ 8 ; Offset of vertical pattern size  CP_Color .Equ 6 ; Offset of draw color  CP_Overlay .Equ 4 ; Offset of overlay mode   CP_Pos_RX we ? (Sub AX,CX (Jns $31 (Add BX,AX ; Yes, adjust length accordingly  $31: Mov GR_V_P2,BX ; Setup DC := |X'| (Neg BX (Mov GR_V_P4,BX ; Setup D := 2 * |Y'| - |X'| (Shl BX,1 (Mov GR_V_P6,BX ; Setup D2 := 2 x (|Y'| - |X'|) (Movbim GR_V_P1,0AH ; Set direction for down to up (Mov DX,(BP+FC_Y) ; Get center Y coordinate (Add DX,DI ; Calculate Center Y + Edge Y      (Inc AX (Call CP_Draw_LR ; Draw lower circle left and right (Pop DI ; Retrieve Y length (Mov SI,DX ; Draw with upper pattern row position (Mov AX,CP_Last_X (Call CP_Draw_LR ; Draw upper circle left and right  $26: Pop SI ; Retrieve Pat_Pos_LY (Pop AX ; Retrieve X coordinate (Pop DI ; Retrieve D  (Add DX,AX ; Bump pattern for next group of rows (Sub DX,CP_Last_X  $25:  DI,0003H ; No, set D to 3 - 2 * Radius (Sub DI,AX (Dec AX ; Set Pat_Pos_HY to (2 * Radius) - 1 Mod Pat_Y (Xor DX,DX (Div SI (Dec SI ; Set Pat_Pos_LY to Pat_Y - 1 (Xor AX,AX ; Set X to 0 (  $01: Cmp CX,CP_Last_Y ; Has there been a change in Y ? (Je $02  Mov CP_Last_Y,CX ; Yes, draw upper and lower lines (Call CP_Draw_HL   $02: Or DI,DI ; Is D < 0 ? (Js $03  Cmp DX,(BP+CP_Pat_Y) ; Should we wrap pattern around ? (Jb $24 (Sub DX,(BP+CP_Pat_Y) ; Take no chances on this Mod (Jmp $25  $24: Inc BX ; Move to next pattern row (Cmp BX,(BP+CP_Pat_Y) ; Should we wrap around (Jne $23 (Xor BX,BX  $23: Dec CX ; Move Y up one row (Mov CP_Last_X,AX ; Set marker for next time around  $21: Add DI,0002H ; Finish D calculation (Add DI,AX (Add DI,AX (Add DI,AX (Add DI,0004H ; No, calculate D := D + 4 * (X - Y) + 10 (Sub DI,CX (Sub DI,CX (Sub DI,CX (Sub DI,CX  Dec CX ; Move down one line (Inc SI ; Move to next pattern row for lower circle (Cmp SI,(BP+CP_Pat_Y) ; Should we wrap around to pattern start ? (Jne $04 (Xor SI,SI ; Yes, that was easy  $04: Or DX,DX ; Should we wrap upper circle's pattern ? (Jne $05 (Mov DX,(BP+CP_Pat_Y)  $05: (Add DI,AX (Or SI,SI ; Should we wrap low pattern row ? (Jnz $22 (Mov SI,(BP+CP_Pat_Y) ; Yes, wrap to top of pattern  $22: Dec SI ; Move to next pattern row  (Cmp AX,CX ; Is X >= Y ? (Js $20 (  Cir_Pat_Center: (Mov DX,AX ; Calculate Y coordinate (Neg DX (Inc DX (Shl AX,1 ; Calculate Y length (Dec AX (Add DX,(BP+CP_Y_Center) (Jns $30 ; Are we still within the region Dec DX ; Move to next pattern row for upper circle  $03: Add DI,AX ; Finish calculating new D by adding 4 * X + 6 (Add DI,AX (Add DI,AX (Add DI,AX  Add DI,0006H (Inc AX ; Move one pixel to the left (Or BX,BX ; Should we wrap around to last column ? (Jne $06 (Mov BX,(BP+CP_Pat_X)  $06: Dec BX ; Move one column in for pattern (Cmp AX,CX ; Is X >= Y ? (Js $01  ? (Sub SI,DX ; No, adjust back into region (Add AX,DX (Xor DX,DX (  $30: Mov DI,SS:Y_Clip ; Are we still within the region ?  Sub DI,DX (Sub DI,AX (Inc DI (Jns $31  Add AX,DI ; No, truncate draw height   $31: Inc SI ; Calculate pattern row number  $34: Cmp SI,(BP+CP_Pat_Y) (Jl $33 (Sub SI,(BP+CP_Pat_Y) (Jmp $34  ( (Jne $10 ; Yes, but are there any leftovers ? (Cmp CX,CP_Last_Y (Je $10 (Call CP_Draw_HL   $10: Dec AX (Mov CP_X_Limit,AX ; Save inner edge of inside box (Mov CX,(BP+CP_Radius) ; Set Y to Radius (Mov CP_Last_Y,CX (Add AX,CX ; Calculate Pat_Pos_RX (Dec AX ; as (Radius + X_Limit - 1) Mod Pat_X (Xor DX,DX (Div (BP+CP_Pat_X) (Mov CP_Pos_RX,DX (Mov AX,CX ; Calculate Pat_Pos_HY (Dec  $33: Add BX,CX ; Calculate pattern column number (Mov CX,CP_X_Limit (Sub BX,CX (Mov DI,CX ; Calculate X length (Shl DI,1 (Dec DI (Neg CX ; Calculate X coordinate (Inc CX  Add CX,(BP+CP_X_Center) (Jns $32 ; Are we still in region ? (Sub BX,CX ; No, adjust into region (Add DI,CX (Xor CX,CX   $32: Cmp BX,(BP+CP_Pat_X) ; Must we MOD the pattern column ? (Jb $35 (Su AX ; as (Radius - 1) Mod Pat_Y (Divmb (BP+CP_Pat_Y) ; No, draw, sucker (Xor DH,DH (Mov DL,AH (Xor BX,BX ; Set Pat_Pos_LX to 0 (Mov CP_Last_X,0001H ; Start last X out conflicting  (Mov SI,DX ; Set starting pattern row (Mov DI,0001H ; Draw axis with height of 1 (Xor AX,AX ; Set X to 0 (Call CP_Draw_LR ; Draw left and right sides (Xor AX,AX ; We really want X = 0 b BX,(BP+CP_Pat_X) (Jmp $32   $35: Mov BP,SS:X_Clip ; Are we still in region ? (Sub BP,CX (Sub BP,DI (Inc BP (Jns $36 (Add DI,BP ; No, truncate draw length   $36: Lea BP,CP_Stack_Space ; Set up parameters for center section (Mov (BP+RP_Start_X),CX (Mov (BP+RP_Start_Y),DX (Mov (BP+RP_Pat_X_Start),BX (Mov (BP+RP_Pat_Y_Start),SI (Mov (BP+RP_Rect_X),DI (Mov (BP+RP_Rect_Y),AX (Mov SI,DX ; Set Pat_Pos_LY to Pat_Pos_HY (Mov DI,0003H ; Start D out as 3 - 2 * Radius (Sub DI,CX (Sub DI,CX (Js $11 ; Is there any more pattern ?  $12: Jmp Cir_Pat_End  $11: Inc DX ; Move to next pattern row for upper (Cmp DX,(BP+CP_Pat_Y) ; Should we wrap around to row 0 ? (Jne $20 (Xor DX,DX ; Yes, that was easy   $20: Inc AX ; Move to next circle row (Or DI,DI  .Word  CP_Last_X .Word  CP_X_Limit .Word  CP_Last_Y .Word 0.Private CP_Stack_Space:13 ; Make sure this is in SS   Cir_Pat: ; Draw a circle with a pattern in it according to parameters (Mov BP,SP ; Set up stack addressing and parameter frame (Mov AX,(BP+CP_Pattern) (Mov BX,(BP+CP_Pat_X) (Mov SI,(BP+CP_Pat_Y) (Mov DX,(BP+CP_Color) (Mov CX,(BP+CP_Overlay) (Lea BP,CP_Stack_Space (Mov (BP+RP_Pattern),AX  ; Is D < 0 ? (Js $21 (Add DI,0004H ; No, calculate D = D + 4 * (X - Y) + 6 (Sub DI,CX (Sub DI,CX (Sub DI,CX (Sub DI,CX (Push DI ; Save D and X while we draw pattern (Push AX (Push SI ; Save Pat_Pos_LY during drawing (Mov DI,AX ; Set Y Length to X - Last_X (Sub DI,CP_Last_X (Jbe $26 (Push DI ; We will use this for upper circle (Neg AX ; Pass Y coordinate -X + 1 (Mov (BP+RP_Pat_X),BX (Mov (BP+RP_Pat_Y),SI (Mov (BP+RP_Color),DX (Mov (BP+RP_Overlay),CX (Mov (BP+RP_Rect_Y),0001H (Mov BP,SP ( (Mov CX,(BP+CP_Radius) ; Set Y to Radius (Mov AX,CX (Mov CP_Last_Y,AX ; Start Last_Y as current Y (Divmb (BP+CP_Pat_X) ; Set Pat_Pos_LX to Radius Mod Pat_X (Mov BL,AH (Xor BH,BH (Mov AX,CX ; Calculate Radius * 2 (Shl AX,1 (Jnz $00 ; Is radius 0 ? (Jmp Cir_Pat_End  $00: Mov     (Call Rect_Draw_Pat ; Draw center section (  Cir_Pat_End: (Retl 16 ( (  CP_Draw_HL: ; Draw horizontal high and low lines (Push BP ; Save addressing environment (Push AX ; Save X (Push BX ; Save Pat_Pos_LX (Push CX ; Save Y (Push SI ; Save Pat_Pos_LY (Push DI ; Save D (Push DX ; Save Pat_Pos_HY (Mov DX,AX (Shl DX,1 ; Calculate X length as 2 * X - 1 (D(Add DX,CX ; Adjust number of columns (Xor CX,CX ; Jam to left margin  $22: Cmp BX,(BP+CP_Pat_X) ; Do we need to MOD this ? (Jl $30 (Sub BX,(BP+CP_Pat_X) (Jmp $22   $30: Lea BP,CP_Stack_Space (Mov (BP+RP_Start_X),CX ; Set X coordinate (Mov (BP+RP_Rect_X),DX ; Set number of columns (Mov (BP+RP_Start_Y),AX ; Set Y coordinate (Mov (BP+RP_Rect_Y),DI ; Set number of rows (Mov (BP+ec DX (Neg AX ; X coordinate is X_Center - X + 1 (Inc AX (Add AX,(BP+CP_X_Center) (Jns $30 ; Are we off the region ? (Sub BX,AX ; Yes, adjust back in (Add DX,AX (Xor AX,AX  $31: Cmp BX,(BP+CP_Pat_X); Do we need to MOD the pattern start (Jl $30 (Sub BX,(BP+CP_Pat_X) (Jmp $31  $30: Mov DI,SS:X_Clip ; Are we off the region ? (Sub DI,AX (Sub DI,DX (Inc DI (Jns $34 RP_Pat_Y_Start),SI ; Set starting pattern row (Mov (BP+RP_Pat_X_Start),BX ; Set starting pattern column (Push AX ; Save Y coordinate for next call (Or DX,DX ; Are there any columns to draw ? (Jz $32 (Js $32 (Call Rect_Draw_Pat ; Draw left hand image (  $32: Mov AX,CP_Pos_RX (Mov (BP+RP_Pat_X_Start),AX ; Set starting pattern column (Pop (BP+RP_Start_Y) ; Set starting Y coordinate (Add DX,DI ; Yes, truncate draw length   $34: Mov DI,(BP+CP_Y_Center) (Add DI,CX (Shl CX,1 (Neg CX ; Y coordinate is Y_Center - Y (Add CX,DI (Lea BP,CP_Stack_Space (Mov (BP+RP_Rect_X),DX Mov (BP+RP_Pat_X_Start),BX (Mov (BP+RP_Start_X),AX (Mov (BP+RP_Start_Y),CX (Mov (BP+RP_Pat_Y_Start),SI (Push DI ; Save this Y for draw of upper circle (Js $32 ; Was Y coordinate off region ? (Ca(Pop AX ; Get number of columns (Or AX,AX (Mov (BP+RP_Rect_X),AX ; Set number of columns (Pop AX ; Get new right hand X coordinate (Js $01 ; Are there any columns to draw ? (Jz $01 (Cmp (BP+RP_Start_X),AX ; Is it the same as the last one ? (Je $01 (Mov (BP+RP_Start_X),AX ; No, draw this line, too (Call Rect_Draw_Pat ; Draw right hand image (  $01: Pop CX (Popll Rect_Draw_Pat ; Draw pattern in lower circle  $32: Pop CX ; Get Y back (Cmp CX,SS:Y_Clip ; Is Y coordinate in region ? (Jg $33 (Pop DX ; Get Pat_Pos_HY back (Push DX (Mov (BP+RP_Start_Y),CX (Mov (BP+RP_Pat_Y_Start),DX (Call Rect_Draw_Pat ; Draw pattern in upper circle  $33: Pop DX ; Restore Pat_Pos_HY (Pop DI ; Restore D (Pop SI ; Restore Pat_Pos_LY  DX (Pop BX (Pop BP (Ret H  ;  ; End of 7220.Circl Include File  ;     (Pop CX ; Restore Y (Pop BX ; Restore Pat_Pos_LX (Pop AX ; Restore X (Pop BP ; Restore addressing environment (Ret H  CP_Draw_LR: ; Draw regions on the left and right on either upper or lower  Push BP (Push BX (Push DX (Push CX ( (Add AX,(BP+CP_Y_Center) ; Calculate absolute Y coordinate (Jns $10 ; Are we still within the region ? (Add DI,AX ; No, a" GRCORE GRCORE IV.0 [1e]djust row count (Jle $12 ; Do we have any rows to draw ? (Sub SI,AX ; Yes, adjust starting pattern row  Xor AX,AX ; Force Y coordinate to zero  $11: Cmp SI,(BP+CP_Pat_Y) ; Should we MOD the result ? (Jl $10 (Sub SI,(BP+CP_Pat_Y) (Jmp $11  $10: Mov DX,SS:Y_Clip ; Is the draw within the region ? (Sub DX,AX (Sub DX,DI (Inc DX (Jge $20 !    &F}G@FK@JIxpL9;8_NY9lrù<H(hr rù5/ Z3ɻZputùEp up trCp66QP+ʸ@YʋXQX$ ËVvKyRTvF 3Vt^;~;Vu N;N|GO3ۋF;~;Vu N;|GًI/ʀ;VuG3tF tN;} F t^RWPS [X_Z tu u2;Fu~u'NA:uC Add DI,DX ; No, shorten the row count  $12: Jle $01 ; Are there rows left ?   $20: Mov DX,(BP+CP_X_Center) (Add DX,CP_X_Limit ; Calculate next X coordinate (Push DX (Add DX,CX ; Calculate right edge of circle (Sub DX,CP_X_Limit (Dec DX (Sub DX,SS:X_Clip ; Are we still within the region ? (Neg DX (Js $21 (Xor DX,DX ; Yes, don't apply a bia tN9Nu NA:uN y3;~NV{{N+N uV+VX6P O9;fF׆׋v r,P^r u=> X;<uËFH3N߃;} x I+FNFV3N߃;;~ x I+F݉v s  $21: Add DX,CX ; Calculate number of columns on right (Sub DX,CP_X_Limit (Push DX ( (Mov DX,CX ; Calculate the number of columns (Sub DX,CP_X_Limit (Neg CX ; Calculate lefthand X coordinate (Inc CX (Add CX,(BP+CP_X_Center) (Jns $30 ; Are we still in clipping region ? (Sub BX,CX ; No, adjust pattern start      4EKPTW]dhq;?Ckojnqu| "+/8jw       f l s    & + : > E N ^ b     L O _ c  z $(4PX^ejtwz1Tip ;@EV 1OU[_ Ijp)5K~ YtPPSQRAO +Hx]PأRTV9;fF׆r!P^r uc>$ '*X;<uZY[X36666rvF1nr$A-8//1&3PPSSPSP 336d6nFFFF42FF F p tp u r r rˋF 6F6FH6FH6N V~JFv xL Ff Hx ؊FfHyNOzt^Ft t^u F x FOuF{ w Fy}I P X ` 6 PoaCj+z7l' Ckojnqu| "+/8jw       f l s    & + : > E N ^ b     L O _ c  z $(4PX^ejtwz1Tip ;@EV 1OU[_ Ijp)5K~ Ytz Dx y u v vz 6w 2 u:Vu 6C΀tuƊVt:vuЊ-Oy uv N y ^2t v :Nt낈6w z *2RT*2P{ VOuV09;f F׆r$^Pr u uX;<uO{{ .{ w :Ntvy x >OrOuFFv u :Nt{F^VN 2 y  y ;s O£P ȋVR)R+؉T FN ^V hubF^N V ON IPFXCLIP  CaoX  YCLIP  l7zj` ARC GRCORE GRCORE START  READ CIRPAT SCANUNTIRECTPAT 9 REGION ( XCLIPBASP6 I ytYCLIPBASP }YPLANESABABLINE U RECTFILL BOX vYVAL AREASOLIINIT [WINDOW K CPSTACKS + CLEAR  STOP   F׊ Ê࣬ 67=CCkF6%tY+؋F ;vãRTF)F V6 . rQ ^ru:Yu. F %tWرRTNV^)^ B6 . r"Q^ruYu. F tDRTNV6 . rQ\^ruVjYu^VFNt^VFNOF t) ~ u3ۉ+ ^- F/ F 3 F1 F5 + - 7 6/ 3 D6O7 B6) 7 ;F u v7 CIRFILL ~TEXT } UNPACK ( ;Vtuӡ1 =rRTRJP5 VF >Z^v@T3 F;3 w)3 Z5 .1 vL+ 7 - F6/ + ;FtËVN 2 y  y zѻ @OPVRXT tb t^NV9;fF׆׋v r,P^r u=>w] `cX;<u2^CC$ك+K" Ny3ɋ^&2ۋv6 Au~65F~ 6F ~6=F; t;&u v6&uFـt~65~ 6~6="N$EQUAL $CURSOR $TAG $LAST $SYNTAX  vO.xN N$Na^ ^ ^36Ў67OF 6%NAAuJ6+v+ډ^؃PNxQ~3V 6;pN S9;׀&;;ptrptrĊ*~3ۊs6C;^u<uYNF muGuptrptr tPy +y3CJy3ҋ6+>v+B t)y +y3@Iy3ɋ6+>v+A t =>3~ >| tq++;>|t>|` y  + OF;ru ;>|t4V+yF3JRV +yG3JRVWvvv RKSVN+Ay36++y؉PۉRTO V 6;QVYV +xK[V +By36++}؉PۉRTO N+xRZN6;Z09;fF׆rP^ru X;<uF ^ vVNF^v VNFNv 2u+H3N3;ti x++++IF;vu3 uVJ@ u^ K;xu ;t&HNH3v Hv233c3++xB;Vu67=>36XF6 $ Fu~tYN 6ȉN V 6ӉV 6@61~u8FtN V V Ӌ VW6;|uPYPPVH;~‡T;} ދ=^XQȋ@;} *-;~ދƇ_^;;u_YSQRWVPA;}EZRV}΀2oo/3@ xE++++WPV+>vW@)_ ^X_+;Vr+VC;^u3I uvN;xBHVy+36>++GyF;v|+vً+ًOANy+3;^ r+^ 6.++EyNV^ v~FUPSQVWRJ@Fy+3;^ |+^ 6>++Gy׋~ϽV^ FNvWxEY6; ZRNV2Z_^Y[X]USRQFy~+3;v|+v6++B}~}VR+J6+x3+R+ANy+3;^ |+^ NVF~v^ P txF FX FXx t 9FtFYZ[]|:tF;}u[ZRWS*^_XX^_ZY[VWSQR9;D?:ZY[_^VWSQR9;6JzupZY[_^Äu];tY@3֊ʀt 3;u;vBq;}׃>Pt puu;Äu;t@֊ʂـt 3;u;~Jq;뎋2oo/Ë9;Ü$+ȝuP#΀YIt(3;âOPS[ptrptr      ;  ; Beginning of 7220.Flood.Text include file  ; ( (  AS_X_Offset .Equ 12 ; Offset of starting X coordinate  AS_Y_Offset .Equ 10 ; Offset of starting Y coordinate  AS_Color_Offset .Equ 8 ; Offset of color  AS_Enabled .Equ 6 ; Offset of planes enabled  AS_Overlay_Mode .Equ 4 ; Offset of overlay mode  Read_Delay .Equ 30 ; Delay for 7220 fifo turn around  AS_Line .Block <(Mov DI,SI ( (Inc AX ; Is X_R + 1 < Last_X_R ? (Cmp AX,DI (Jge $20 (Mov SI,BX ; Yes, recurse down (Mov AX,DX (Call AS_Search_Fill ; Sub_Area_Fill (X_R, Last_X_R, Y, Y_Inc) (Jmp $28   $20: Sub AX,0002H ; Is X_R - 1 > Last_X_R ? " Cmp AX,DI (Jle $28 (Mov SI,BX ; Yes, recurse back up (Neg SI (Mov AX,DX (Add AX,SI (Xchg DI,CX (Call AS_Search_Fill ; Sub_Area_Fill (Last_X_R, X_R,Pitch+Pitch>*3 ; Temp for scan line  AS_Bad_Planes .Byte ; Planes not to count on  AS_Pattern .Byte ; Current internal pattern  AS_Y_Clip .Word ; Global coordinate Y clip value  AS_X_Clip1 .Word ; Global coordinate X clip value + 1   Area_Solid: ; Fill area between X and X' on line Y in Y_Inc direction " Mov BP,SP ; Set up stack environment  Y - Y_Inc, -Y_Inc); (Xchg DI,CX   $28: Pop DI ; Assign new Last_X_L (Pop SI ; Assign new Last_X_R & Add DX,BX ; Adjust Y for next row (Cmp DX,AS_Y_Clip ; Has Y moved off screen ? (Jg $30 (Cmp SI,DI ; Is X_R = X_L ? (Jne $00  $30: Pop DI ; Return first X_L (Pop CX ; Return first X_R (Ret "  AS_Search_Fill: ; Fill any OFF's in search space : (CX,AX) to (DI,AX) (Movbim GR_Mask_L,0FFH ; Set mask for word increments (Movbim GR_Mask_H,0FFH (Movbim GR_Text_P1,0FFH ; Set up for solid line (Movbim GR_Text_P2,0FFH (Xor SI,SI ; We need a word of zeros all over here (Mov GR_V_P10,SI (Mov AL,(BP+AS_Enabled) (Not AL (Or AL,SS:Planes_Absent (And AL,07H (Mov AS_Bad_Planes,AL (Not AL (And (BP+AS_Color_Offset),AL (Jnz $00 (Cmpbim (BP+AS_Overlay_Mode),01H (Je $10  $00: Mov CX,(BP+AS_X_Offset) ;  ; Direction contained in SI (Push BX (Push CX (Push DX (Push DI (Push SI (Push AX   $00: Inc CX ; Move to first actual position (Cmp CX,DI ; Is X_Start < X_End ? (Jge $90 (Pop DX ; Set up Y coordinate (Push DX (Push SI ; Save direction (Call AS_Get_Buffer ; Get line buffer (Mov CX,SI ; Calculate number of good bits in first word (And CL,0FH (Sub CL,10Calculate X coordinate global based (Mov AX,SS:X_Clip_Base (Add CX,AX (Mov (BP+AS_X_Offset),CX (Mov DX,(BP+AS_Y_Offset) ; Calculate Y coordinate global based (Mov BX,SS:Y_Clip_Base (Add DX,BX (Mov (BP+AS_Y_Offset),DX (Add AX,SS:X_Clip ; Calculate boundaries global based (Inc AX (Mov AS_X_Clip1,AX (Add BX,SS:Y_Clip (Mov AS_Y_Clip,BX (Call AS_Get_Pixel ; Get the current pixel value (Mov AS_Pattern,AL ; Set up background pattern H (Neg CL (  $10: Xor AL,AL ; Construct composite image (Shr (BX+4),1 (Rcl AL,1 ; Capture blue bit (Shr (BX+2),1 (Rcl AL,1 ; Capture green bit (Shr (BX),1 (Rcl AL,1 ; Capture red bit (Cmp AL,AS_Pattern ; Is it what we're looking for ? (Je $20 (Inc SI ; No, move to next coordinate (Cmp SI,DI ; Have we run out of our limit ? (Jge $80 (Cmpbim (BP+AS_Overlay_Mode),00H (Jne $02 (Cmp (BP+AS_Color_Offset),AL (Je $10  $02: Mov CX,(BP+AS_X_Offset) (Mov DX,(BP+AS_Y_Offset) (Mov BX,0001H " Call AS_Fill ; Fill upper half of pattern (Mov DX,(BP+AS_Y_Offset) (Mov BX,0FFFFH " Add DX,BX (Mov SI,CX (Add CX,DI ; Start lower half at midpoint (Shr CX,1 (Call AS_Fill_0 ; Fill lower half of pattern  $10: Retl 10 "  AS_Fill: ; Fill are(Dec CL ; We have one less bit (Jnz $10 (Mov CL,10H ; Set up new bit count (Add BX,0006H ; Move to new word (Jmp $10 ; Go another round   $20: Pop BX ; Recover Y_Inc (Pop DX (Push DX ; Recover Y (Push DI ; Save X_End (Push BX ; Save Y_Inc (Mov CX,SI ; Set up X coordinate (Call AS_Fill ; Area_Fill (X, Y, Y_Inc); -- Return next X (Pop a starting at (CX,DX) in BX direction 0; Return CX as X_R and DI as X_L on first attempted row (Call AS_Left ; Go set up Last_X_L (Mov DI,AX (Call AS_Right ; Go set up Last_X_R (Mov SI,AX  AS_Fill_0: ; Fill lower half of pattern (Push SI ; Save this for the return value  Push DI  $00: Cmp DX,SS:Y_Clip_Base ; Are we off the screen ? (Jl $30 (Mov CX,SI ; Pull X coordinate out to middle (Add CX,DI  SI ; Recover Y_Inc (Pop DI ; Restore X_Start and X_End (Jmp $00 (  $80: Pop AX ; Trash out extra Y_Inc  $90: Pop AX (Pop SI (Pop DI (Pop DX (Pop CX (Pop BX (Ret   AS_Right: ; Scan to the right starting at (CX, DX) for a dot that's not AX 0; Return new X in AX (Push SI (Push DI (Push BX (Push CX (Push DX (Mov SI,CX ; Hold on to starting X coordinate (Shr CX,1 (Call AS_Left ; Get first dot to left (Push AX (Call AS_Right (Pop CX ; Draw line between (and not including) (Call AS_Draw_Line ; CX and AX on line DX (Push AX ; Save X_R (Push AX (Push SI ; Save Last_X_R ( (Mov AX,CX ; Is X_L - 1 > Last_X_L ? (Dec AX (Cmp AX,DI (Jle $10 (Mov SI,BX ; Yes, recurse down (Mov AX,DX (Xchg DI,CX (Call AS_Search_Fill ; Su(And CL,0F0H ; Use word aligned address (Call GR_Raw_CV ; Convert to screen coordinates (Mov GR_Ead,DX ; Save address in plane 0 (Mov GR_Dad,CL (Mov DX,AS_X_Clip1 ; Get upper bound for search (Mov BL,02H (Call AS_Scan_Right ; Scan green plane (Mov BL,04H (Call AS_Scan_Right ; Scan blue plane (Mov BL,01H (Call AS_Scan_Right ; Scan red plane (Mov AX,DX (Pop DX (Pop CX (Pop BX (Pop DI (Pop SI (Ret  b_Area_Fill (Last_X_L, X_L, Y, Y_Inc) (Xchg DI,CX (Jmp $18   $10: Add AX,0002H ; Is X_L + 1 < Last_X_L ? " Cmp AX,DI (Jge $18 (Mov SI,BX ; Yes, recurse back up (Neg SI (Mov AX,DX (Add AX,SI (Call AS_Search_Fill ; Sub_Area_Fill (X_L, Last_X_L, Y - Y_Inc, -Y_Inc);   $18: Pop SI ; Restore Last_X_R (Pop AX ; Restore X_R  Push CX ; Save X_L (Mov CX,AX      (Rcl AL,1 ; Capture blue bit (Shr (BX+2),1 (Rcl AL,1 ; Capture green bit (Shr (BX),1 (Rcl AL,1 ; Capture red bit  Ret ( (  AS_Get_Buffer: ; Get line into AS_Line buffer from (CX, DX) to (DI, DX) 0; Return X coordinate in SI, buffer pointer in BX (Mov SI,CX (Call GR_Raw_CV ; Set up starting coordinates (Mov GR_Ead,DX (Mov GR_Dad,CL (Lea BX,AS_Line+2 ; Get green image (Testbim AS_Bad_Planes,02H ; Can we dd we scan at all ? (Je AS_Ret (Mov AL,02H ; Set direction forward (Mov CX,Pitch ; Set maximum count (Call AS_Read_Start ; Start up read and set up X and limit (Mov DI,DX ; Get search end (Mov DX,SI ; Recover X coordinate (Mov CL,DL ; Calculate initial shift (And CL,0FH  Test AS_Pattern,BL ; Is this bit ON ? (Jz $20 (Mov BX,0FFFFH ; Set mask for background color set (Not AX raw in the green plane ? (Call AS_Read_Line (Lea BX,AS_Line+4 ; Get blue image (Testbim AS_Bad_Planes,04H ; Can we draw in the green plane ? (Call AS_Read_Line (Lea BX,AS_Line ; Get red image (Testbim AS_Bad_Planes,01H ; Can we draw in the green plane ? (Call AS_Read_Line (Lea BX,AS_Line  Ret (  AS_Read_Line: ; Read a scan line between SI and DI into buffer BX 0; Clear buffer to zeros if NZ 0 (Shr AX,CL ; Position bit for testing (Not AX (Jmp $00  $20: Xor BX,BX ; Set mask for background color clear (Shr AX,CL ; Position bit for testing (  $00: Cmp AX,BX ; Are there any bits in this word ? (Jne $01 (Add DX,0010H ; No, update X coordinate (And DL,0F0H (Cmp DI,DX ; Are we out of screen ? (Jbe AS_Scan_Done  Call GR_Read_Word ; Fetch next word (Jmp $00 (  $02: (Pushf ; Save Zero flag until length is known (Mov AX,SI ; Calculate pixel count (And AL,0F0H ; Word align address (Sub AX,DI (Neg AX (Add AX,0010H ; Convert to a word count (Mov CL,04H (Shr AX,CL (Mov CX,AX (Popf ; Should we fill zeros instead ? (Jnz $20 (Push AX (Mov AL,02H ; Set direction forward  Call AS_Read_Start ; Start up read and return first word in AX   Inc DX ; Count up one pixel  $01: Shr AX,1 ; Get low order bit into carry (Rcr BX,1 (Jno $02 ; Is this bit different ? (Cmp DI,DX ; Set up comparison  AS_Scan_Done: (Jge $10 ; Should we switch ? (Mov DX,DI ; Yes, we went under, use mimimum  $10: Cmp GR_V_P2,0000H ; Are there any bytes left to read ? (Jz AS_Ret  $12: In AL,GR_Status  Mov CX,SI ; Shift word appropriately (And CL,0FH (Shr AX,CL (Pop CX  $00: Mov (BX),AX ; Store word in buffer (Dec CX ; Count down words (Jz $10 (Add BX,0006H ; Move to next location in buffer (Call GR_Read_Word ; Get next word (Jmp $00  $20: Xor AX,AX ; Clear out buffer, no plane here  $21: Mov (BX),AX (Add BX,0006H (Loop $21 (Test AL,02H ; Is the fifo full of data ? (Jnz AS_Ret (Call GR_Read_Word (Jnz $12  AS_Ret: Incmb GR_Dad ; Set up for next color plane (Ret (   AS_Scan_Left: ; Scan to the left from SI until we find a dot that is not ON 0; Scan no further than DX, Return X coordinate in DX (Test AS_Bad_Planes,BL ; Can we draw this plane ? (Jnz AS_Ret (Cmp SI,DX ; Yes, should we scan at all ? (Je AS_Ret (Mov AL,06H ; Set direction backw $10: Incmb GR_Dad ; Move on to next plane (Ret ( (  AS_Read_Start: ; Start read in direction AL, maximum words in CX, limit in DI 0; Return word in AX (Mov GR_V_P1,AL ; Set up direction and mode (Mov GR_V_P2,CX ; Set up vector word count parameter (Push BX (Call GR_CSR_R ; Position cursor (Call GR_Mask ; Set up mask for word increments (Mov CX,0003H (Call GR_Vect_W ; Issue vector (mode and word count) (Call GR_Read ard (Mov CX,Pitch ; Set maximum count (Call AS_Read_Start ; Start up read and set up X and limit (Mov DI,DX ; Get search end (Mov DX,SI ; Recover X coordinate (Mov CL,DL ; Calculate initial shift 15 - X Mod 16 (Sub CL,0FH (Neg CL (And CL,0FH (Test AS_Pattern,BL ; Is this bit ON ? (Jz $20 (Mov BX,0FFFFH ; Set mask for background color set (Not AX (Shl AX,CL ; Position bit for testing  ; Start read  Pop BX   GR_Read_Word: ; Read word from GDC and return in AX (In AL,GR_Status (Test AL,01H ; Is read data ready ? (Jz GR_Read_Word (In AL,GR_R_Data ; Yes, get low order data byte (Mov AH,AL ; Save low order byte  $01: In AL,GR_Status (Test AL,01H ; Is high byte ready ? (Jz $01 (In AL,GR_R_Data ; Get high byte (Xchg AL,AH ; Set word correctly (Not AX (Jmp $00  $20: Xor BX,BX ; Set mask for background color clear (Shl AX,CL ; Position bit for testing (  $00: Cmp AX,BX ; Are there any bits different in this word ? (Jne $01 (And DL,0F0H ; No, update X coordinate (Sub DX,0010H (Or DL,0FH (Cmp DX,DI ; Are we out of screen ? (Jle AS_Scan_Done  Call GR_Read_Word ; Fetch next word (Jmp $00 (  $02: Dec DX   AS_Left: ; Scan to the left starting at (CX, DX) for a dot that's ON 0; Return new X in AX (Push SI (Push DI (Push BX (Push CX (Push DX (Mov SI,CX ; Hold on to starting X coordinate (And CL,0F0H ; Use word aligned address (Call GR_Raw_CV ; Convert to screen coordinates (Mov GR_Ead,DX ; Save address in plane 0 (Mov GR_Dad,CL (Mov DX,SS:X_Clip_Base ; Get lower bound for search (Dec DX (Mov BL,02H  ; Count up one pixel  $01: Shl AX,1 ; Get high order bit into carry (Rcr BX,1 (Jno $02 ; Is this bit different ? (Cmp DX,DI ; Set up comparison (Jmp AS_Scan_Done (   AS_Get_Pixel: ; Read pixel at (CX, DX), return in AL (Mov DI,CX ; Go only as far as one pixel (Call AS_Get_Buffer ; Get first pixel for background comparisons (Xor AL,AL ; Construct composite image (Shr (BX+4),1 (Call AS_Scan_Left ; Scan green plane (Mov BL,04H (Call AS_Scan_Left ; Scan blue plane (Mov BL,01H (Call AS_Scan_Left ; Scan red plane (Mov AX,DX (Pop DX (Pop CX (Pop BX (Pop DI (Pop SI  Ret    AS_Scan_Right: ; Scan to the right from SI until we find a dot that is not ON 0; Scan no further than DX, Return X coordinate in DX (Test AS_Bad_Planes,BL ; Can we draw this plane ? (Jnz AS_Ret (Cmp SI,DX ; Yes, shoul     (Dec GR_V_P2 ; Another word bytes the dust (Ret (  AS_Draw_Line: ; Draw a line between CX+1 and AX-1 on the DX line (Push AX (Push BX (Push CX (Push DX (Inc CX ; Move to starting position (Movbim GR_V_P1,0AH ; Set up line vector (Sub AX,CX ; Calculate line length (Dec AX (Js $10 ; Is there any line to draw ? (Mov GR_V_P2,AX (Neg AX (Mov GR_V_P4,AX (Shl AX,1 (Mov GR_V_P6,AX (Mov GR_V_(Mov (BP+C_X_Length),DX (  Clear: ; Force a clear without checking coordinates (Movbim GR_V_P1,12H ; Set to graphics drawing mode (Mov BP,SP ; Set up environment just in case (Mov CX,(BP+C_Y_Length) (Dec CX (Mov GR_V_P2,CX ; Set up draw height - 1 (Mov AX,(BP+C_Color) ; Get color (Lea BX,Color_Table (Xlat ; Translate Ramtek color into NEC color (Mov GR_Color,AX (Mov CX,0004H ; Set up shift count  P8,0000H ( (Call GR_Raw_CV ; Set up cursor position command (Mov GR_Ead,DX (Mov GR_Dad,CL (Mov AH,(BP+AS_Color_Offset) ; Get Ramtek colors (Mov AL,(BP+AS_Enabled) (Lea BX,Color_Table ; Derive NEC colors (Xlat  Xchg AH,AL (Xlat   $05: Shr AH,1 ; Can we even draw in this plane ? (Jc $09  Shr AL,1 ; No, junk this color bit (Jmp $08  $09: Shr AL,1 ; Get low order bit into Carry  Mov AX,(BP+C_Enabled) (Xlat ; Translate Ramtek mask into NEC mask  Mov BL,AL (Shl AX,CL ; Make 3 (actually 4) copies of the plane mask  Or AL,BL (Mov AH,AL  Mov GR_Enabled,AX  (Movbim GR_Mask_L,0FFH ; Set bit mask to get all bits (Movbim GR_Mask_H,0FFH (Lea BX,GR_Text_P1 ; Set up solid text image (Note -- CX := 4!)  $06: Mov AX,0FFFFH (Mov (BX),AX (Inc BX (Inc BX (Loop $06 (Push AX (Mov BL,(BP+AS_Overlay_Mode) ; Set up for overlay mode (Jc $04 ; Should a color be drawn ? (Or BL,BL ; No, is this replace mode ? (Jnz $06 (Mov BL,02H ; Yes, set mode to clear  $04: Call GR_Mode ; Set up overlay mode (Call GR_Text_W ; Set up pattern (Call GR_CSR_R ; Set cursor in plane (Mov CX,0BH ; Declare vector parameters (Call GR_Vect_W (Call GR_Vect_E ; Execute vector (Call GR_Text_W ; Set up text parameters  (Mov AX,(BP+C_X_Start) ; Get X Coordinate (Mov CX,AX (Add AX,SS:X_Clip_Base (And AX,000FH ; Does this start on a word boundary ? (Jz $20 (Mov BX,0010H ; Calculate 16 - X Mod 16 (Sub BX,AX (Mov AX,(BP+C_X_Length) ; Get X length (Cmp AX,BX ; Use the lesser (Jbe $13 (Mov AX,BX  $13: Mov GR_V_P4,AX ; Set X count (Mov GR_V_P6,AX (Add (BP+C_X_Start),AX ; Ne $06: Pop AX  $08: Incmb GR_Dad ; Move to next plane (Cmp AL,01H ; Are there more planes left ? (Jnz $05   $10: Pop DX (Pop CX (Pop BX (Pop AX (Ret   ;  ; End of 7220.Flood.Text include file  ; xt operation starts ahead (Sub (BP+C_X_Length),AX ; Next operation is shorter (Mov DX,(BP+C_Y_Start) ; Get Y Coordinate (Call GR_XY_CV (Mov SI,GR_Color   $11: Shr GR_Enabled,1 ; Should we even draw in this plane ?  Jc $16 (Shr SI,1 ; No, trash this bit (Jmp $15  $16: Push CX ; Save high order address (Call GR_CSR_W ; Set up cursor address (Mov BL,(BP+C_Overlay) ; Set, use specified mode $EQUAL $CURSOR $LAST $TAG O.Rx(Shr SI,1 ; Should we draw in this plane ? (Jc $12 (Cmp BL,00H ; No, but is this replacement mode ? (Jne $14 (Mov BL,2 ; Yes, set mode to clear  $12: Call GR_Mode (Mov CX,0007H (Call GR_Vect_W (Call GR_Text_E ; Execute clear draw  $14: Pop CX  $15: Inc CL ; Move to next plane (Cmp SI,0001H ; IS there another plane ? (Jne $11 (Shr GR_Enabled,1 ; Shift trailer bit out   $20: Mov AX,(BP+C_X_Length) ; Get X Length (And AX,0FFF0H ; Is there enough to do a block clear on ? (Jz $30 (Mov BX,AX (Mov CL,04H (Shr AX,CL ; Get word count (divide by 16) (Mov GR_V_P4,AX ; Set X count (Mov GR_V_P6,AX  Mov CX,(BP+C_X_Start) ; Get X Coordinate (Mov DX,(BP+C_Y_Start) ; Get Y Coordinate (Add (BP+C_X_Start),BX ; Next operation starts ahead (Sub (BP+C_X_Length),BX ; Next operation is shorter ;  ; Beginning of 7220.Rect Include File  ;   C_X_Start .Equ 16 ; Offset of X coordinate  C_Y_Start .Equ 14 ; Offset of Y coordinate  C_X_Length .Equ 12 ; Offset of X length  C_Y_Length .Equ 10 ; Offset of Y length  C_Color .Equ 8 ; Offset of color mask  C_Enabled .Equ 6 ; Offset of planes enabled  C_Overlay .Equ 4 ; Offset of overlay mode ((Call GR_XY_CV (Mov SI,GR_Color   $21: Shr GR_Enabled,1 ; Should we even draw in this plane ? (Jc $26 (Shr SI,1 ; No, trash this color bit (Jmp $25  $26: Push CX ; Save high order address (Call GR_CSR_W ; Set up cursor address (Call GR_Mask ; Set up to do ALL bits, word oriented (Mov BL,(BP+C_Overlay) ; Use specified mode (Shr SI,1 ; Should we draw in this plane ? (Jc $22 (Cmp BL,00  GR_Color .Word 0000H GR_Enabled .Word 0000H   Rect_Fill: ; Clear/Set inside rectangle specified by parameters on stack (Mov BP,SP (Mov AX,(BP+C_Y_Start) (Mov CX,(BP+C_Y_Length) (Mov BX,(BP+C_X_Start) (Mov DX,(BP+C_X_Length) (Call Clip_R_Offsets ; Adjust and clip coordinates, lengths (Jne $02 ; Is there anything to draw ? (Jmp Clear_Ret   $02: Mov (BP+C_Y_Start),AX (Mov (BP+C_X_Start),BX (Mov (BP+C_Y_Length),CX      (Mov BX,RP_P_Col ; Get pattern column number (Mov CL,BL (Shr BX,1 ; Calculate byte offset to SI (Shr BX,1 (Shr BX,1 (And CL,07H ; Calculate shift count (Lea DI,GR_Text_P8 ; Get pointer to base of image buffer  Pat_Row: (Mov AX,SS:(BX)(SI) ; Get pattern byte and padding (Shr AX,CL ; Shift desired bits into bit 0 (Mov (DI),AL ; Store in image buffer (Dec  ; Set up cursor address (Mov BL,(BP+C_Overlay) ; Use specified mode (Shr SI,1 ; Should we draw in this plane ? (Jc $32 (Cmp BL,00H ; No, but is this replace mode ? (Jne $33 (Mov BL,2 ; Yes, set mode to clear  $32: Call GR_Mode (Mov CX,0007H (Call GR_Vect_W (Call GR_Text_E ; Execute clear draw  $33: Pop CX  $34: Inc CL ; Move to next plane  DI (Inc RP_P_Row_T ; Go to next pattern row (Inc DX ; Go to next rectangle row (Add SI,RP_Row_Size ; Go to next pattern row (Mov AX,RP_P_Row_T ; Should we wrap pattern around ? (Cmp AX,(BP+RP_Pat_Y)  Jne $01 (Mov SI,(BP+RP_Pattern) ; Yes, start on row 0 again (Mov RP_P_Row_T,0000H (  $01: Cmp DX,(BP+RP_Rect_Y) ; Are we at the top of the rectangle ? (Je $02 (Cmp SI,0001H ; IS there another plane ? (Jne $31  Clear_Ret: (Retl 14   RP_Start_X .Equ 24 ; Offset of starting X coordinate  RP_Start_Y .Equ 22 ; Offset of starting Y coordinate  RP_Rect_X .Equ 20 ; Offset of rectangle X size  RP_Rect_Y .Equ 18 ; Offset of rectangle Y size  RP_Pattern .Equ 16 ; Offset of pattern pointer  RP_Pat_X .Equ 14 ; Offset (Test DX,0007H ; Have we formed a block of 8 ? (Jne Pat_Row (  $02: Mov AX,RP_R_Col ; Draw R_Col Min 8 columns (Cmp AX,0008H (Jb $03 (Mov AX,0008H  $03: Mov GR_V_P4,AX ; Setup D := number of columns (Mov GR_V_P6,AX ; Setup D2 := number of columns (Push DX (Dec DX ; Draw DX Mod 8 (0 -> 8) rows (And DX,0007H (Mov GR_V_P2,DX ; Setup DC := number of rows - 1  of pattern X size  RP_Pat_Y .Equ 12 ; Offset of pattern Y size  RP_Pat_X_Start .Equ 10 ; Offset of starting pattern column  RP_Pat_Y_Start .Equ 8 ; Offset of starting pattern row  RP_Color .Equ 6 ; Offset of color plane address  RP_Overlay .Equ 4 ; Offset of overlay mode  RP_Row_Size .Word  RP_R_Row .Word  RP_P_Row .Word  RP_Pat_T .Word  RP_R_Col .Word  (Mov CX,RP_Cur_X ; Get X Coordinate (Mov DX,(BP+RP_Start_Y) ; Get Y Coordinate (Call GR_XY_CV (Mov AX,(BP+RP_Color) ; Get color plane (Lea BX,Plane_Table (Xlat ; Translate Ramtek color into NEC color (Or CL,AL (Call GR_CSR_W ; Set up cursor address ( (Call GR_Text_W ; Set up text parameters (Mov BL,(BP+RP_Overlay) ; Set mode parameter (Call GR_Mode (Mov CX,0007H  RP_P_Col .Word  RP_Cur_X .Word  RP_P_Row_T .Word   Rect_Pat: ; Fill rectangle with a pattern (Mov BP,SP ; Set up stack addressing ( (Mov BX,(BP+RP_Start_X) (Mov DX,(BP+RP_Rect_X) (Mov AX,(BP+RP_Start_Y) (Mov CX,(BP+RP_Rect_Y) (Call Clip_R_Offsets ; Adjust and clip coordinates, offsets (Jz $03 ; Is there anything to draw ? (Mov (BP+RP_Start_X),BX (Mov (BP+RP_Rect_X),DX (Mov (BP+RP(Call GR_Vect_W (Call GR_Text_E ; Execute clear draw  (Add RP_P_Col,0008H ; Count up 8 pattern columns (Mov AX,(BP+RP_Pat_X) ; Get number of pattern columns  $07: Cmp AX,RP_P_Col ; Have we run out of pattern cols ? (Ja $05 (Sub RP_P_Col,AX ; Yes, adjust back to beginning  Jmp $07  $05: Pop DX (Add RP_Cur_X,0008H ; Move cursor over 8 (Sub RP_R_Col,0008H ; Count down 8_Start_Y),AX (Mov (BP+RP_Rect_Y),CX (Call Rect_Draw_Pat  $03: Retl 22 ( (  Rect_Draw_Pat: ; Draw a pattern according to parameters on stack (Movbim GR_V_P1,12H ; Set up direction and mode (Mov AX,(BP+RP_Pat_X) ; Calculate number of bytes in row (Or AX,AX ; Is pattern X length zero ? (Je $03 (Add AX,000FH ; Include right padding (Mov CL,03H (Shr AX,CL (Mov RP_Row_Size,AX   rectangle columns (Jbe $06 (Jmp Pat_Col   $06: Mov RP_R_Row,DX ; Adjust working rectangle row (Mov AX,RP_P_Row_T ; Adjust working pattern row (Mov RP_P_Row,AX (Add (BP+RP_Start_Y),0008H ; Adjust drawing rectangle row (Mov RP_Pat_T,SI ; Adjust working pattern ptr  (Mov AX,RP_R_Row ; Have we run out of rectangle rows ? (Cmp AX,(BP+RP_Rect_Y) (Je RP_Ret (Jmp Pat_Block (  RP_Ret: (Ret (  (Cmp (BP+RP_Pat_Y),0000H ; Is the pattern Y length zero ? (Jne $04  $03: Jmp RP_Ret   $04: Xor BX,BX (Mov RP_R_Row,BX ; Start on row 0 of rectangle (Mov BX,(BP+RP_Pat_Y_Start) ; Get starting row of pattern (Mov RP_P_Row,BX (Mul BX ; Calculate offset from start of pat (Add AX,(BP+RP_Pattern) ; Set up working pattern ptr (Mov RP_Pat_T,AX (  Pat_Block: (Mov AX,(BP+RP_Pat_X_Start) ; Where to start for le ; No, but is this replace ? (Jne $23 (Mov BL,2 ; Yes, set mode to clear  $22: Call GR_Mode (Mov CX,0007H (Call GR_Vect_W (Call GR_Text_E ; Execute clear draw  $23: Pop CX  $25: Inc CL ; Move to next plane (Cmp SI,0001H ; IS there another plane ? (Jne $21 (Shr GR_Enabled,1 ; Shift the trailer bit out  $30: (Mov AX,(BP+C_X_Length) ; Get X Length ft side (Mov RP_P_Col,AX (Mov AX,(BP+RP_Rect_X) ; Count backwards from last (Mov RP_R_Col,AX ; rectangle column (Mov AX,(BP+RP_Start_X) ; Get working rectangle column (Mov RP_Cur_X,AX (  Pat_Col: (Mov DX,RP_R_Row ; Get working rectangle row (Mov AX,RP_P_Row ; Get working pattern row (Mov RP_P_Row_T,AX (Mov SI,RP_Pat_T ; Get pattern source row pointer (Or AX,AX ; Is there any residual ? (Jz Clear_Ret (Mov GR_V_P4,AX ; Set X count (Mov GR_V_P6,AX  Mov CX,(BP+C_X_Start) ; Get X Coordinate (Mov DX,(BP+C_Y_Start) ; Get Y Coordinate (Call GR_XY_CV (Mov SI,GR_Color   $31: Shr GR_Enabled,1 ; Should we even draw in this plane ? (Jc $35 (Shr SI,1 ; No, trash this color bit (Jmp $34  $35: Push CX ; Save high order address (Call GR_CSR_W     Box: ; Draw a box according to the parameters on the stack   Mov BP,SP ; Set up stack addressing ( (Mov DX,(BP+L_X_Length) (Mov CX,(BP+L_Y_Length) (Xor AL,AL ; Clear direction (Or DX,DX ; Is X' < 0 ? (Jns $01 (Neg DX ; Yes, take absolute value (Or AL,02H ; Refine direction  $01: Or CX,CX ; Is Y' < 0 ? (Jns $02 (Neg CX ; Yes, take absolute value (Inc AL (Mov BX,CX ; Calculate max number of bits per row (Add BX,000FH ; as (Pat_X + 15) Div 8 * 8 (And BL,0F8H (Sub BX,CX ; Calculate number of bytes left over (Dec BX ; as (Maxbits - Pat_X - 1) Div 8 (Shr BX,1 (Shr BX,1 (Shr BX,1 (Mov UP_Next_Color,BX ( (Add CX,0008H ; Set up for redundant trailer (Mov UP_Last_Col,CX (  $30: Dec (BP+UP_Pat_Y) ; Are t ; Refine direction further  $02: Or AL,AL ; Is either X' or Y' < 0 (but not both) ? (Jpe $03 (Xchg DX,CX ; Exchange places for further calculations   $03: Lea BX,Box_Dir_Table ; Translate to appropriate direction (Xlat (Or AL,40H ; Draw a box (Mov GR_V_P1,AL ; Setup direction (Mov GR_V_P2,0003H ; Setup DC := 3 (Mov GR_V_P8,0FFFFH ; Setup D1 := -1 (Mov GR_V_P4,DX ; Setup D := X' here any rows left ? (Jns $31  Jmp $90  $31: Xor CX,CX ; Initialize destination column count  Mov BX,(BP+UP_Pat_X) ; Where to recycle pattern (Mov UP_Reset_Col,BX   $05: Xor BL,BL ; Initialize source column count  Mov SI,(BP+UP_Pattern) (  $00: Mov AL,SS:(SI) ; Get new byte containing 2 nibbles  $01: Or AH,AL ; Record color usage (Mov GR_V_P10,DX ; Setup DM := X' (Mov GR_V_P6,CX ; Setup D2 := Y' (  B_L_Draw: ; Draw either box or line, CX, DX are related to X', Y' (Or CX,CX (Je $01 ; Is there anything to draw ? (Or DX,DX (Je $01 ; Is there anything to draw ? (Mov CX,(BP+L_X_Start) ; Get starting coordinates (Mov DX,(BP+L_Y_Start) (Call GR_XY_CV ; Set up cursor position command (Mov GR_Ead,DX (Mov GR_Dad,CL (Mov AH,(BP+L_Colo(Shr AL,1 ; Move red bit into Carry (Rcr DH,1 ; Shift bit into red array (Shr AL,1 ; Move green bit into Carry (Rcr DL,1 ; Shift bit into green array (Shr AL,1 ; Move blue bit into Carry (Rcr BH,1 ; Shift bit into blue array (Shr AL,1 (Inc CX $03: Test CL,07H ; Move on to next color byte ? (Jnz $04 (Mov DI,(BP+UP_Red_Pat) r) ; Get Ramtek colors (Mov AL,(BP+L_Enabled) (Lea BX,Color_Table ; Derive NEC colors (Xlat (Xchg AH,AL (Xlat (Mov SI,(BP+L_Pattern) ; Get pattern   $05: Shr AH,1 ; Is drawing on this plane even enabled ? (Jc $07  Shr AL,1 ; No, shift this color out (Jmp $08  $07: Shr AL,1 ; Get low order bit into Carry (Push AX (Mov BL,(BP+L_Overlay) ; Get overlay mode  ; Yes, save red pattern byte (Mov SS:(DI),DH (Inc (BP+UP_Red_Pat) (Mov DI,(BP+UP_Green_Pat) ; Save green pattern byte (Mov SS:(DI),DL (Inc (BP+UP_Green_Pat) (Mov DI,(BP+UP_Blue_Pat) ; Save blue pattern byte (Mov SS:(DI),BH (Inc (BP+UP_Blue_Pat)  $04: Cmp CX,UP_Last_Col ; Are we at end of pattern row ? (Je $20 Cmp CX,UP_Reset_Col ; Should we repeat pattern ? (Jne $02 (Mov AX,SI ; Get requested pattern (Jc $04 ; Should a color be drawn ? (Cmp BL,00H ; No, but is this replace mode ? (Jne $06 (Mov BL,2 ; Yes, set mode to clear (Mov AL,0FFH ; Set up for all bits  $04: Mov GR_Text_P1,AL (Mov GR_Text_P2,AL (Call GR_Mode ; Set up overlay mode (Call GR_Text_W ; Set up pattern (Call GR_CSR_R ; Set cursor to (X_Start, Y_Start) in plane (Mov CX,0BH (Mov SI,(BP+UP_Pat_X) ; Yes, update next reset point (Add UP_Reset_Col,SI (Jmp $05  $02: Inc BL (Test BL,01H ; Move on to next pattern byte ? (Jnz $01 (Inc SI ; Yes, increment pointer (Jmp $00   $20: Neg CX ; Finish shifting pattern 8 - Col Mod 8 (And CL,07H (Jz $21 (Mov DI,(BP+UP_Red_Pat) ; Save red pattern byte (Shr DH,CL (Mov SS:(DI),DH (Mov DI,(BP+UP_G ; Declare vector parameters (Call GR_Vect_W (Call GR_Vect_E ; Execute vector (  $06: Pop AX  $08: Incmb GR_Dad ; Move to next plane (Cmp AL,01H ; Are there more planes left ? (Jnz $05  $01: (Retl 16    UP_Pattern .Equ 20 ; Offset of pointer to nibble pattern  UP_Pat_X .Equ 18 ; Offset of number of columns  UP_Pat_Y .Equ 16 ; Offset of number of rows reen_Pat) ; Save green pattern byte (Shr DL,CL (Mov SS:(DI),DL (Mov DI,(BP+UP_Blue_Pat) ; Save blue pattern byte (Shr BH,CL (Mov SS:(DI),BH  $21: Mov CX,UP_Next_Color (Add (BP+UP_Red_Pat),CX ; Move to next red row (Add (BP+UP_Green_Pat),CX ; Move to next green row (Add (BP+UP_Blue_Pat),CX ; Move to next blue row  Mov CX,UP_Next_Pattern ; Move to next pattern row (Add (BP+UP_Pattern),CX (Jmp $30 ( ( UP_Red_Pat .Equ 14 ; Offset of red pattern  UP_Uses_Red .Equ 12 ; Offset of red usage boolean  UP_Green_Pat .Equ 10 ; Offset of green pattern  UP_Uses_Green .Equ 8 ; Offset of green usage boolean  UP_Blue_Pat .Equ 6 ; Offset of blue pattern  UP_Uses_Blue .Equ 4 ; Offset of blue usage boolean  UP_Last_Col .Word  UP_Next_Color .Word  UP_Next_Pattern .Word  UP_Reset_Col .Wo $90: Mov BX,(BP+UP_Uses_Red) ; Did we have any red patterns ? (Call $91 (Mov BX,(BP+UP_Uses_Green) ; Did we have any green patterns ? (Call $91 (Mov BX,(BP+UP_Uses_Blue) ; Did we have any blue patterns ? (Call $91 ( (Retl 18   $91: Xor CX,CX ; Set up for false (Shr AH,1 ; Move color bit into carry (Rcl CL,1 ; Move color bit into bit 0 (Mov SS:(BX),CX ; Set boolean value rd   Unpack: ; Unpack a nibble pattern into constituent colors  Mov BP,SP ; Set up stack access (Xor AH,AH ; Initialize color usage flags ( (Mov BX,(BP+UP_Pat_X) ; Get number of columns  Mov CX,BX (Inc BX ; Calculate (Pat_X + 3) Div 4 * 2 (Shr BX,1 (Inc BX (And BL,0FEH (Mov UP_Next_Pattern,BX ; Save number of bytes per pattern row (       $07: In AL,GR_Status (Test AL,01H (Jz $07 (In AL,GR_R_Data ; Get high data byte (Xchg AH,AL (Mov DH,10H (Jmp $00   $99: Retl 10   Clip_R_Offsets: ; Adjust, then clip rectangle at (BX,AX) for (DX,CX) ( ; Return Z = 1 if zero length (Or DX,DX (Je $02 ; Is X length = 0 ? (Jns $00 ; Is X length positive ? (Neg DX ; No, make length positive (Sub BX,DX ; Adjust FH ; Calculate X Mod 16 (Mov RW_Init_Shift,AL ( (Mov CX,(BP+RW_Cols) ; Get image and array length (Mov BX,CX (Inc CX ; Calculate number of bytes in nibble row (Shr CX,1 (Inc CX (And CL,0FEH (Jnz $15 ; Are there any colums to grab ?  $98: Jmp $99 (  $15: Add DX,BX ; Check to see that we are in clipping region (Dec DX (Sub DX,SS:X_Clip (Jbe $20 X coordinate  Jns $00 ; Did we just go negative ? (Add DX,BX (Xor BX,BX ; Yes, jam to zero  Jmp $03  $00: Inc BX ; Start filling to right of left border (Dec DX ; Fill up to and not including right border (Jns $03 (Xor DX,DX ; Force length to zero $03: Mov DI,BX (Add DI,DX (Sub DI,SS:X_Clip ; Are we off the top of the screen ? (Jbe $04 (Sub BX,DX ; We are not in region, adjust to right edge (Mov (BP+RW_Cols),BX (  $20: Add BX,AX ; Calculate image word count (Add BX,000FH (Shr BX,1 (Shr BX,1 (Shr BX,1 (Shr BX,1 (Mov GR_V_P2,BX ; Set up vector word count parameter for later   $10: Dec (BP+RW_Rows) ; Are there any rows left ? (Js $98 (Push CX ; Save this for next row (Shr CX,1 ; Convert to a word count (Mov DI,(B(Sub DX,DI ; Yes, bring it back in (Inc DX (  $04: Or CX,CX (Je $02 ; Is Y length = 0 ? (Jns $01 ; Is Y length positive ? (Neg CX ; No, make Y length positive (Sub AX,CX ; Adjust Y coordinate  Jns $01 ; Did we just go negative ? (Add CX,AX (Xor AX,AX ; Yes, jam to zero  Jmp $05  $01: Inc AX ; Start filling above bottom border (Dec P+RW_Array) ; Get nibble array base (Xor AX,AX (Rep Stosw (DI),AX ; Clear out nibble array ( (Mov DX,(BP+RW_Start_Y) ; Calculate image cursor address (Cmp DX,SS:Y_Clip ; Are we off clipping region ? (Jg $12 (Mov CX,(BP+RW_Start_X); Get starting X coordinate (Call GR_XY_CV (Mov GR_Ead,DX ; Set up screen-relative coordinates for later (Mov GR_Dad,CL (Mov AL,01H ; Start at red plane (  $09: Mov RW_Nib_Bit,AL  CX ; Decrement for row count and to avoid top (Jns $05 (Xor CX,CX ; Force length to zero  $05: Mov DI,AX (Add DI,CX (Sub DI,SS:Y_Clip ; Are we off the edge of the screen ? (Jbe $06 (Sub CX,DI ; Yes, bring it back in (Inc CX (  $06: Or DX,DX ; Set Z flag (Je $02  Or CX,CX  $02: Ret   ;  ; End of 7220.Rect Include File  ;    (Lea BX,Plane_Table ; Get plane address (Xlat (Andbim GR_Dad,0FCH ; Add in plane address (Or GR_Dad,AL  Call GR_CSR_R ; Issue cursor address command ( (Call GR_Mask ; Set up mask for word increments (Mov CX,0003H (Call GR_Vect_W ; Issue vector (mode and word count) ( (Call GR_Read ; Start read $04: In AL,GR_Status (Test AL,01H ; Is read data ready ? (Jz $04 (In AL,GR_R_Data ; Yes, get low data $CURSOR $EQUAL $TAG $LAST $SYNTAX  =O.#x(byte (Mov AH,AL  $06: In AL,GR_Status (Test AL,01H (Jz $06 (In AL,GR_R_Data ; Get high data byte (Xchg AL,AH ( (Mov CL,RW_Init_Shift; Get X coordinate Mod 16 (Shr AX,CL ; Shift bit into position (Mov DH,10H ; Calculate number of bits remaining (Sub DH,CL (Mov DI,(BP+RW_Array) ; Get array base (Xor BX,BX ; Set up image bit counter (Mov DL,RW_Nib_Bit ; Set up nibble color bit value (Mov CL,04H ; Set up color bit rotate count   $00: Shr AX,1 ; Get bit into carry (Jnc $01 ; Is the bit set ? (Or SS:(DI),DL ; Yes, set bit in nibble  $01: Rol DL,CL ; Rotate color bit (Inc BX ; Are there any more image bits ? (Cmp BX,(BP+RW_Cols) (Jnz $05  (Mov AL,RW_Nib_Bit ; Go to next color plane (Shl AL,01H (Cmp AL,08H ; Are we out of planes ? (Jnz $09 (  $12: (Ret (   RW_Start_X .Equ 12 ; Offset of starting X coordinate  RW_Start_Y .Equ 10 ; Offset of starting Y coordinate  RW_Array .Equ 8 ; Offset of starting memory address  RW_Cols .Equ 6 ; Offset of column count  RW_Rows .Equ 4 ; Offset of row count   RW_Init_Shift .Byte ; Number of bits to shift for first column  RW_Nib_Bit .Byte ; Color bit in current nibble   Pop CX ; Go to next row (Add (BP+RW_Array),CX (Inc (BP+RW_Start_Y) (Jmp $10   $05: Test BL,01H ; Is it time to move to a new byte ? (Jnz $02 (Inc DI ; Yes, move to new byte  $02: Dec DH ; Is this word exhausted ? (Jnz $00  $03: In AL,GR_Status (Test AL,01H ; Is read data ready ? (Jz $03 (In AL,GR_R_Data ; Yes, get low data byte (Mov AH,AL  Read: ; Read a string of words into memory from a specified address  Mov BP,SP ; Set up stack addressing (Mov AX,SS ; Set up addressing in stack/heap (Mov ES,AX (Cld ( (Movbim GR_Mask_L,0FFH ; Set mask for word increments (Movbim GR_Mask_H,0FFH (Movbim GR_V_P1,02H ; Set up direction, mode for later ( (Mov AX,(BP+RW_Start_X); Get starting X coordinate (Mov DX,AX (Add AX,SS:X_Clip_Base ; Convert to global coordinates (And AX,000     ;  ; Beginning of 7220.Misc Include File  ;   Rec_Offset .Equ 4 ; Offset of pointer to init record  GL_X_Size .Equ 0 ; Offset in record of global X size  GL_Y_Size .Equ 2 ; Offset in record of global Y size  Win_X_Size .Equ 4 ; Offset in record of window X size  Win_Y_Size .Equ 6 ; Offset in record of window Y size  Planes .Equ 8 ; Offset in record of planes ena(Mov SS:Y_Clip_Base,AX (Mov AX,(BP+Reg_X_Length) ; Calculate maximum X value (Dec AX (Mov SS:X_Clip,AX (Mov AX,(BP+Reg_Y_Length) ; Calculate maximum Y value (Dec AX (Mov SS:Y_Clip,AX (Retl 08   W_Win_Num .Equ 12 ; Offset of window number  W_Win_X_Org .Equ 10 ; Offset of window X coordinate  W_Win_Y_Org .Equ 8 ; Offset of window Y coordinate  W_X_Size .Equ 6 ; Offset of wbled  Win_X_Res .Equ 10 ; Offset in record of window X res  Win_Y_Res .Equ 12 ; Offset in record of window Y res   Init: ; Initialize 7220, clear display RAM, and start displaying (Xor AX,AX ; Set up .Privates (Mov SS:X_Clip_Base,AX (Mov SS:Y_Clip_Base,AX (Mov SS:X_Clip, (Mov SS:Y_Clip, ( (Mov AL,Reset_Cmd ; Reset 7220 (Out GR_Cmd,AL ( (Mov AL,01H ; Enable graphics board indow X size  W_Y_Size .Equ 4 ; Offset of window Y size   Window: ; Define a viewing window  Mov BP,SP ; Establish stack environment (Mov CX,(BP+W_Win_X_Org) ; Get coordinates of lower left corner (Mov DX,(BP+W_Win_Y_Org) (Mov DI,(BP+W_Y_Size) ; Compute upper left corner (Add DX,DI (Dec DX (Call GR_Raw_CV ; Compute memory address (Lea BX,GR_Sad_1 ; Compute table address (Out 76H,AL (Mov AL,08H (Out 46H,AL ( (Call GR_GDC_C1 ; Synchronize with text controller (Mov AL,Slv_Cmd (Out GR_Cmd,AL ( (Mov CX,8 ; Syncronize horizontally and vertically (Lea BX,DA_Sync (Call GRM_Out ( (Mov CX,1 ; Set up horizontal dot spacing (Lea BX,DA_Pitch (Call GRM_Out ( (Mov CX,1 ; Set up zoom factor (Lea BX,DA_Zoom (Call GRM_Out ( (Mov CX,3 ; Initialize cursor form (L(Mov SI,(BP+W_Win_Num) (Shl SI,1 (Shl SI,1 (Mov (SI)(BX),DX ; Save starting address (Mov CL,04H ; Position row count (Shl DI,CL (Mov (SI)(BX+2),DI (Call GR_Scroll ; Register new window parameters (Retl 10 ( (   T_X_Start .Equ 24 ; Offset of X_Start parameter  T_Y_Start .Equ 22 ; Offset of Y_Start parameter  T_Pattern .Equ 20 ; Offset of Pattern pointeea BX,DA_CSR_Form (Call GRM_Out ( (Call GR_Scroll ; Set up window parameters ( (Xor AX,AX (Push AX ; Set up starting X (Push AX ; Set up starting Y (Mov BX,Glob_X ; Set X length of full screen (Push BX (Mov BX,Glob_Y ; Set Y length of full memory (Push BX (Push AX ; Clear all colors (Mov BX,0007H ; Clear all planes (Push BX (Push AX ; Move in replace mode (Push CS r parameter  T_Col .Equ 18 ; Offset of Pattern columns parameter  T_Row .Equ 16 ; Offset of Pattern rows parameter  T_Mag_X .Equ 14 ; Offset of X-magnification parameter  T_Mag_Y .Equ 12 ; Offset of Y-magnification parameter  T_Color .Equ 10 ; Offset of Color parameter  T_Enabled .Equ 8 ; Offset of Planes enabled parameter (Call Clear ; Clear out RAM ( (Xor CX,CX ; Find out which planes are REALLY there (Xor DX,DX (Mov SS:Planes_Absent,CL (Call AS_Get_Pixel (Mov SS:Planes_Absent,AL (Mov BP,SP ; Establish stack addressing (Mov BP,(BP+Rec_Offset) ; Get pointer to initialization record (Mov (BP+GL_X_Size),Glob_X (Mov (BP+GL_Y_Size),Glob_Y (Mov (BP+Win_X_Size),Win_X (Mov (BP+Win_Y_Size),Win_Y (Xor AL,07H ; Invert so active plane T_Overlay .Equ 6 ; Offset of Overlay parameter  T_Dir .Equ 4 ; Offset of Direction parameter P_Row_Pos .Byte 00H P_Row_Pos_T .Byte 00H  P_Col_Pos .Byte 00H  Mag_Y_T .Byte 00H Mag_Y_TT .Byte 00H Mag_X_T .Byte 00H  X_T .Word 00H  Text: ; Draw a pattern at a given set of coordinates with magnification (Mov BP,SP ; Set up parameter addressing environment ( (Mov AL,(Bs are represented (Xor AH,AH ; Clear out upper byte (Mov (BP+Planes),AX (Mov AL,01H ; Set up Y resolution  Mov (BP+Win_Y_Res),AX (Mov AL,10H ; Set up X resolution (Mov (BP+Win_X_Res),AX  (Mov CX,0002H ; Wait for two vertical sync periods $02: In AL,GR_Status ; Wait until vertical sync is up (Test AL,20H (Jz $02  $03: In AL,GR_Status ; Ok, now wait until it is down (Test AL,20H (Jnz $03 P+T_Row) ; Get pattern height - 1 in case we need it (Mul AL,(BP+T_Mag_Y) (Dec AX (Js $06 ; Is there any pattern to worry about ? (Mov BX,AX (Mov AL,(BP+T_Col) ; Get pattern width - 1 in case we need it (Mul AL,(BP+T_Mag_X) (Dec AX (Jns $01 ; Is there any pattern to worry about ?  $06: Jmp Text_Done  $01: Mov CL,(BP+T_Dir) ; Get rotation direction (either 0, 2, 4, or 6) (And CL,06H ; Just in case (Loop $02 ( (Call GR_GDC_C1 ; Start display (Mov AL,Start_Cmd (Out GR_Cmd,AL ( (Retl 02   Start: ; Start up video display (Call GR_GDC_C1 ; Wait for fifo empty (Mov AL,Start_Cmd (Out GR_Cmd,AL ; Start display (Retl ( (  Stop: ; Shut down video display (Call GR_GDC_C1 ; Wait for fifo empty (Mov AL,Stop_Cmd (Out GR_Cmd,AL ; Stop display (Retl ( (  Reg_X_Start .Equ 10 ; Offset of(Or CL,10H ; Include character drawing bit (Mov GR_V_P1,CL ; Set into vector (Jp $02 ; Is the direction either 0 or 6 ? (Test CL,06H ; Yes, is it 6 ? (Jz $05 (Add (BP+T_Y_Start),BX ; Yes (Jmp $02  $05: Add (BP+T_Y_Start),AX ; No  $02: Test CL,04H ; Is direction either 4 or 6 ? (Jz $04 (Test CL,02H ; Yes, is it 6 ? (Jz $03 (Mov BX,AX  $03: Add (BP+T_X_Start),BX ; Start over on X_Start parameter  Reg_Y_Start .Equ 8 ; Offset of Y_Start parameter  Reg_X_Length .Equ 6 ; Offset of X_Length parameter  Reg_Y_Length .Equ 4 ; Offset of Y_Length parameter   Region: ; Set region variables  Mov BP,SP ; Establish stack addressing (Mov AX,(BP+Reg_X_Start) ; Get global X coordinate (Mov SS:X_Clip_Base,AX (Mov AX,(BP+Reg_Y_Start) ; Get global Y coordinate       $05: Shr AH,1 ; Should we even draw this plane ? (Jc $17 (Shr AL,1 ; No, trash this color bit (Jmp $18  $17: Mov BL,(BP+T_Overlay) (Shr AL,1 ; Get low order bit into Carry (Push AX (Jc $16 ; Should a color be drawn ? (Or BL,BL (Jnz $15 ; No, but is this replace mode ? (Mov BL,02H ; Yes, use CLEAR mode  $16: Or BL,BL ; Is this replace mode ? (Jnz  ; Set display column (Mov DH,P_Col_Pos ; Get working column position (Mov BL,DH ; Move working pattern pointer to right column (Shr BL,1 (Shr BL,1 (Shr BL,1 (Xor BH,BH (Add BX,SI (Jmp Text_Byte_New ; Go set up pattern byte   Text_Col: (Test DH,07H ; Is the column now byte aligned ? (Jnz Text_New_Bit (Cmp DL,(BP+T_Mag_X) ; Yes, is this the first repitition ? (Jnz Text_New_Bit   Text_Byte_New:  $06 (Mov BL,03H ; Yes, use SET mode instead  $06: Call GR_Mode ; Set up overlay mode ( (Call GR_CSR_R ; Set cursor to (X_Start, Y_Start) in plane (Mov CX,07H ; Declare vector parameters (Call GR_Vect_W (Call GR_Text_E ; Execute vector (  $15: Pop AX  $18: Incmb GR_Dad ; Move to next plane (Cmp AL,01H ; Are there more planes left ? (Jnz $05 (  Mov AL,SS:(BX) ; Yes, load a new pattern byte (Inc BX (Mov CL,DH ; Get column position (And CL,07H ; Prepare to shift pattern byte into position (Shr AL,CL  Text_New_Bit: (Test AL,01H ; Put low order bit of pattern into carry (Jz $01 (Stc  $01: Rcrmb (DI),1 ; Shift into display image (Dec DL ; Decrement working X-magnification counter (Jnz $04 ; Should we get a new bit next time (Testbim GR_V_P1,016H ; Is the direction 2 or 4 ? (Jnp $10 (Add X_T,0008H ; Yes, position on screen out for next block (Jmp $11  $10: Sub X_T,0008H ; No, move new position in for next block  $11: Mov CL,P_Col_Pos ; Is this the last of the pattern row ? (Cmp CL,(BP+T_Col) (Jz $99 (Jmp Text_Block  $99: Mov (BP+T_Pattern),SI ; Update pattern ptr for next group of blocks (Mov CL,Mag_Y_TT ; Update real Y-magnification counter (Mo? (Shr AL,1 ; Yes, set up next bit (Inc DH ; Move working column counter (Mov DL,(BP+T_Mag_X) ; Reset working X-magnification counter  $04: Dec AH ; Decrement display column number (Jz $02 ; Is the display buffer byte full ? (Cmp DH,(BP+T_Col) ; No, is this the last column of pattern ? (Jnz Text_Col  $02: Mov CL,AH ; Yes, finish shifting display pattern (Shrmb (DI),CL v Mag_Y_T,CL (Mov AX,0008H (Cmpbim GR_V_P1,14H ; Is direction 4 or 6 ? (Jb $12 (Neg AX ; Yes, we are decrementing our position  $12: Testbim GR_V_P1,02H ; Is direction 2 or 6 ? (Jnz $13 (Add (BP+T_X_Start),AX ; Yes, go to next X coordinate (Jmp $14  $13: Add (BP+T_Y_Start),AX ; Go no next Y coordinate  $14: Mov CL,P_Row_Pos_T ; Update real pattern row number  Mov P_Row_Pos,CL (Dec DI ; No, go to new display row (Decmb Mag_Y_TT ; Decrement working Y-magnification counter (Jnz $07 ; Should we move to a new pattern row ? ( (Incmb P_Row_Pos_T ; Yes, bump working pattern row number (Mov CL,(BP+T_Mag_Y) ; Reset working Y-magnification counter (Mov Mag_Y_TT,CL (Mov BL,(BP+T_Col) ; Get number of columns in pattern (Add BL,07H ; Calculate number of bytes in pattern row (Shr BL,1 (Shr BL,1 (Shr (Cmp CL,(BP+T_Row) ; Do we have more rows of blocks ? (Je Text_Done (Jmp Text_Band (  Text_Done: (Retl 16H    L_X_Start .Equ 18 ; Offset of X_Start parameter  L_Y_Start .Equ 16 ; Offset of Y_Start parameter  L_X_Length .Equ 14 ; Offset of X_Length parameter  L_Y_Length .Equ 12 ; Offset of Y_Length parameter  L_Pattern .Equ 10 ; Offset of Pattern parameter  L_Color  BL,1 (Xor BH,BH (Add SI,BX ; Move pattern pointer to next row (  $07: Dec CH ; Decrement display row counter (Jz $03 ; Is this the last row of the display buffer ? (Mov CL,P_Row_Pos_T ; No, is this the last row of pattern ? (Cmp CL,(BP+T_Row) (Je $03  Jmp Text_Row  $03: Mov P_Col_Pos,DH ; Yes, update real column position (Mov Mag_X_T,DL ; Update real X-magnification counter (  .Equ 8 ; Offset of Color parameter  L_Enabled .Equ 6 ; Offset of Planes enabled parameter  L_Overlay .Equ 4 ; Offset of Overlay parameter  Line: ; Draw a line according to the parameters on the stack   Mov BP,SP ; Set up stack addressing ( (Mov AX,(BP+L_Y_Start) (Mov BX,(BP+L_X_Start) (Mov DX,(BP+L_X_Length) (Mov CX,(BP+L_Y_Length) (Xor AL,AL ; Clear direction (Mov AL,08H ; Calculate number of columns (8 - AH) (Sub AL,AH (Xor AH,AH (Mov GR_V_P4,AX ; Setup D := number of columns (Mov GR_V_P6,AX ; Setup D2 := number of columns ( (Mov CL,07H ; Calculate number of rows - 1 (7 - CH) (Sub CL,CH (Xor CH,CH (Mov GR_V_P2,CX ; Setup DC := number of rows - 1 ( (Call GR_Text_W ; Write pattern to parameter RAM (Mov CX,X_T ; Get working coordinate (Mov DX,(BP+T_Y_Start the right somewhere  $04: Movbim P_Row_Pos,00H ; Set pattern row position (Mov AL,(BP+T_Mag_Y) ; Set Y-magnification counter (Mov Mag_Y_T,AL   Text_Band: (Mov AX,(BP+T_X_Start) ; Set working coordinate in X direction (Testbim GR_V_P1,02H ; Is direction actually 0 or 4 ? (Jnz $01 (Mov AX,(BP+T_Y_Start) ; Yes, make working coordinate Y  $01: Mov X_T,AX (Movbim P_Col_Pos,00H ; Set pattern column position ) ; Get Y-coordinate (Testbim GR_V_P1,02H ; Is direction actually 0 or 4 ? (Jnz $09 (Mov DX,(BP+T_X_Start) ; Yes, the working coordinate is Y, get X  Xchg CX,DX ; Set up X and Y for cursor positioning  $09: Call GR_XY_CV ; Set up cursor position command (Mov GR_Ead,DX (Mov GR_Dad,CL (Mov AH,(BP+T_Color) ; Get Ramtek colors (Mov AL,(BP+T_Enabled) (Lea BX,Color_Table ; Derive NEC colors (Xlat  Xchg AH,AL (Xlat  (Mov AL,(BP+T_Mag_X) ; Set X-magnification counter (Mov Mag_X_T,AL   Text_Block:  Mov CH,08H ; Set display row (Lea DI,GR_Text_P8 ; Set display address (Mov AL,Mag_Y_T ; Set working Y-magnification counter (Mov Mag_Y_TT,AL (Mov AL,P_Row_Pos ; Set working row position (Mov P_Row_Pos_T,AL (Mov SI,(BP+T_Pattern) ; Get pointer to pattern (  Text_Row: (Mov DL,Mag_X_T ; Set working X-magnification counter (Mov AH,08H      (Or DX,DX ; Is X' < 0 ? (Jns $01 (Neg DX ; Yes, take absolute value (Or AL,04H ; Refine direction  $01: Or CX,CX ; Is Y' < 0 ? (Jns $02 (Neg CX ; Yes, take absolute value (Or AL,02H ; Refine direction further  $02: Cmp DX,CX ; Is |X'| < |Y'| ? (Jae $03 (Xchg DX,CX ; Exchange places for further calculations Inc AL   $03: Lea BX,Line_Dir_Tabl'Int_Type = (Plain, { Solid rectangle } 8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } e ; Translate to appropriate direction (Xlat (Or AL,08H ; Draw a line (Mov GR_V_P1,AL ; Setup direction (Mov AX,DX (Mov GR_V_P2,AX ; Setup DC := |X'| (Mov BX,CX ; Save Y' (Or CX,AX ; Set DX, CX <> 0 if either X' or Y' <> 0 (Mov DX,CX (Shl BX,1 (Mov GR_V_P8,BX ; Setup D1 := 2 x |Y'| (Mov GR_V_P4,BX (Sub GR_V_P4,AX ; Setup D := 2 x |Y'| - |X'| (Shl AX,1 (Sub BX,AX 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, (Mov GR_V_P6,BX ; Setup D2 := 2 x |Y'| - 2 x |X'| ( (Jmp B_L_Draw ; Go draw line   ;  ; End of 7220.Misc Include File  ;   { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record 9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text color} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, GRAFDRAW 4(  IV.0 [1e] { Columns per char } 9Font_Rows : Point; { Rows per char } 9 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9   "Const Graf_Version = '0.5';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coorDraw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( dinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw} 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons }      &%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$!$ 9 327$/!Ė 0k#y%j#x$i""#~!!#|"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$#!# 9 327#/Ė 0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|-/Ċ-/Ċ-/ $g$t% %t-/Ė6 0i#"B!98h 327"Procedure Inq_Color (Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer); " "Function Inq_Value (Option : Integer) : Integer; " "Procedure Plane_Enable (Planes : Integer); " "Procedure Plane_Visible (Planes : Integer); " "Procedure Set_Palette (Pal_Name : String); " "Procedure Set_Value (Opcode, 7Value : Integer); " "Procedure Erase; " "Procedure Erase_Alpha; "  Procedure Flood; " "Procedure Arc_Rel (Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Va!y!x$"#+ 327!y"!~!x#!|!/Ċ!/Ċ!/ĖZ /[s0 5t0ewPe 0e 0Ȅ/[[0"u[}u[eXu[s0/ pխ/Wv՜ZYXWj"t5wlih"!"k!k[ #p #h"#j"/[vli$"$,0[[ć[Wć[XćY Z [/Ċ0/ Ą/s !0 0Ċ0 Ċ 00!!0/Ėy<=P0սjixh  r X_Start, 5Y_Start, 5X_End, 5Y_End : Integer); " "Procedure Arc_Abs (Var Radius : Integer; 5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer);   Procedure Set_Region (X_Start, 8Y_Start, 8X_Length, 8Y_Length : Integer); 8  Procedure Set_Window (Window_Chain : Win_Rec_P); "  Implementation (m)l)m(l%̇¾o'kyx D,$ ,$ ր~-#-%#% -%ր,,$|j,$ ,$ ր-#% -#%ր,,$|j,#% ,#% ր-$ -$ր--$~jV,% ,%#% ,# ր-$ -$ր--$~jր"098/327- , n&ՠ&<&;ՊP-' -'~+᳡>-' -+~fGRAFDRAW 0/#1 i0/Ċ#1i#10~ 0~h0/Ċ#1h!" !0&"1 i0/Ċ"1i"10| 0|h0/Ċ"1h#! !0&0h96 / "" ~%!! |8327"!8327 /Ċ /ĖC0/ 9 8327  '9$ 8 327   980/Ėw0/91  8327 83270/ Ė0h"" ~ !! | / " !Ċ / Ċ / Ė0j"y$i"x#h!!"~ "|"/"!" Ċ"/ Ċ"/ ĖE+,' ,*|,' ,'|*᳡ր%-,&`(`'`&`%`$`#`"`!0 0/Ė u0kj#98h 327#y%#~#y%᳟##y%#yi#~#yi$%!¿l!mj#x$#|#x$᳟##x$#xi#|#xi%$!¿m!lj#y#x%$# # 6#& 327#/"##y%##x$Ė!0y 0xm o098 (327n0 + j"*խn-"xi,"xh!)yl )xk)y$)~)y$᳟#)y$)ym)~)ym#$%¿k%l`$$ rĆĆĆ0o''''' ' ' '' ' ''''''''''''''''!' '"N'.'- ','+!"#"777777"7#'(7'*%')&'(#'/ĖQ0/ Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0/Ėi0/Ė 0/Ė0/ Ė)`*P0/ Ė+?0/ "Z!281/-+)'%#n)x#)|)x#᳟#)x#)xm)|)xm$#%¿l%kn')y)x$#) ) 6)&$#o)!) "jM(3270/&ĖO m098n&327j0o) h (թ+ xl* xkj'y$'~'y$᳟#'y$'yi'~'yi#$!¿k!lj'x#'|'x#᳟#'x#'xi'|'xi$#!¿l!kj%'y'x$#' ' 6'&$#m''y$''x# hQ&3270/"Ė 0hi!~e!} 6 y x"!z !  .!| 6 y x"!y !  .!{ 6 y x"!x !  . 0~0y 0|0x /.i.i /ih րO#!!0h0!đ0 Ċ!րdr098h 3270~0|06% 3270/Ė` `p0/ĖP0NiQhN/Ą@@ N/ Od!PO~O}O|O{OzOy N/ ċOz7zO|O~OzN- N/ċPćO}N)PO}O}N)ćPĊPO}ćO{Oy7yP7yO{ćPĊPOyćPyPxN+PN+PyćPĄ@@O{O{Px@@!i xhN/@@7y7yQ N/ċ!ջQթQhi Ռ Od!POk l( (6),)o,o ( 'o'5*l)-6o ( 'o'-'*l0y,0yo,o ( 'o'5)l0y-6o ( 'o'-')l0x,0xo,o ( 'o'50ylt0x-6o ( 'o'-'0ylO*,*o,o ( 'o'50xl'*-6o ( 'o'-'0xlր$(/! ! ժ$k$B(nl&n&**m/&+%+m%,6ml-**ml))m/&+%+m%,6mlj-))ml_0y0ym/&+%+m%,6ml>-0y0yml10~N*O~O~N*jN/ĊO~jO|Oz7z7zO|kN/ĊOzk"#N-N-"kN/ćN/PzN/!"Py#Px4!iOxhnN(2N(QĊ N(Qđ3N/ĖQ0h / "$" -R!#! +C98327  " ! '$ &#$#"!1987 /ĖP0i!98h 327!!y!x! 6!/ 327!/Ė 4`s04t4t4t0ĆĄ pP  0Ȅ  0Ȅ4^^0"u^vu^ Xu^s0/ p%4\v^\]"Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, $yk$xj&$x&&$~: Switch_Type); " "Procedure Line_Abs (X_End, 6Y_End : Point); 6 "Procedure Line_Rel (X_Length, 6Y_Length : Point); 6 "Procedure PLine_Abs (Var X_End, ;Y_End : Point_Array; ;Count : Integer); 7 "Procedure PLine_Rel (Var X_Length, ;Y_Length : Point_Array; ;Count : Integer); 7 Procedure Circle_Abs (X_Of_Edge, Y_Of_Edge : Point); " "Procedure Circle_Rel (Radius : Point); " "Procedure Define_Color (Index, :Red, :Green, :Blue, :Blink, :Hard_Copy : Integer); "      x0xm/&+%+m%,6ml-0x0xmlր$&/! /塠/$.mj&(0(/!&'.k'.k/&! &%.j%.j"#0y0x('&%,-0 0 600#/& ! /kh& #Vj  b f HihCih;ih2ih)ihihih ihր.f󿢇b󿢑!.f .b"0""uh"98:塤 (327/̆i j:)//+ ++' ''"y/"~"y/"x/"|"x<uZY[X36T6R6N6PrvF1nrA8/&3PPSSPSP 336Vd6VnFFFF42FF F p tp u r r rˋF 6TF6RFH6NFH6PN V~Jv xL Ff Hx ؊FfHyNzt^Ft t^%'F ('FuF+'''F*'(')'%'&'v*'6''2 u:Vu 6C΀tuƊVt:vuЊ-O)'u/h : * "y"x/!"" " 6"0+n'"o+r+r'r'r& /̄m /̄m' /̄l /̄l &%""m'&%$ l%!!m' $""l$!!l:D9 &&%Ċ&%ć%/&x5ć&x&+$Ċ$$ć#/$x5 "y"x/&%'$!"" " 6"0 /&%'$"!#x;:n$x&x$x&x#x%x ,"y"x&x%x&<kk"y"x$x#x'#<,"y"x&x%x&#<) (327"/ Ė/B%'$&&'N )'^2t &':Nt낈6''*'*2*2+'VuV0f F׆r$^Pr u uX<u{+'.+''':Ntv)'('>ruFF&'%':Nt{F^VN 2 y  y ;s £ ȋ)+؉ FN ^V hubF^N V N IFףZ)F׊ Ê\)CCkF6T%tY+؋F ;vãF)F V6Z).\)r`&`*`$&%'r%' ``. $&``2 `0h'$ y6# x:r& y x$#=% y x"!='x&%dcba 0k#98h 327$l# $>aaaa # ##y#x$## 6-$: 327#y$#~#y$#x$#|#x$#/Ċ#/Ė0k%#yB$#xFri#98h 327# !Jbbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#/Ċ#/Ėw0w8 0-0+"0W&Q ^ru:Yu.\)F %tWرNV^)^ B6Z).\)r"Q^ruYu.\)F tDNV6Z).\)rQ\^ruVjYu^VFNt^VFNF t*~ u3ۉ*^*F*F *F*F****6**6O*B6**;F u v*;Vtuӡ*=rRJ*VF >Z^v@T*F;*w)*Z*.K<<W&SW&S""E &<yy Patxx.Ptrnn: Fontxx.Font: \=bKkw  &F}G@FK@JIxpL*vL***F6**;FtËVN 2 y  y zѻ @ tb t^NVfF׆׋v r,P^r uw] `cX<u2^CC,ك+K,,Ny3ɋ^,2ۋv6 Au~65F~ 6F ~6=F;,t;,u v6,uFـt~65~ 6~6=,NN N,Na^ ^ ^36ЎF 6T%-NAAu_Y9lrùH(hr rù/  3ɻ putùp up trCp6T6RQP+ʸ@YʋXQX$ ËvKyvF 3Vt^;~;Vu N;N|GO3ۋF;~;Vu N;|GًI/ʀ;VuG3tF tN;} F t^RWPS [X_Z tu u2;Fu~u'NA:uC tN9Nu NA:uN y3;~NV{{N+N uV+V6 J6+Nv+ډ^؃NxQ~3V 6;PpN S-׀&ptrptrĊ-*~3ۊ-s6C;^u-<uYNF muGuptrptr tPy +y3CJy3ҋ6+>Nv+B t)y +y3@Iy3ɋ6+>Pv+A t 3~ >,/ tq++;>,/t>,/` y  + OF;ru ;>,/t4V+yF3JRV +yG3JRVWvvv RKSN+Ay36N++y؉ۉ V 6;fF׆׋v r,P^r u X<uËFH3N߃;} x I+FNFV3N߃;;~ x I+F݉v PQVYV +xK[V +By36P++}؉ۉ N+xRZN6;NZ0fF׆rP^ru X<uF ^ vVNXF^v VNFN0v 2u+H3N3;0t0i x++++IF;vu3 uVJ@ u^ K;xu ;0t&H0N0H3v 0Hv2303c3++xB;Vu3@ xE++++WPV+>0vW@)_0 ^X_+0;Vr+VC;^u3I0 uvN;xB36F6 V$F" Fu~tYN 6TȉN V 6RӉV 6N@J"6PH"1G"~u8FtN V V Ӌ VW6;R|uPYPPVH;~‡T;} ދ=^XQȋ@;} *-;~ދƇ_^;H";u_YSQRWVPA;}EZRV}΀2oo/:G"tF;}u[ZRWS*^_XX^_ZY[VWSQRJ"D?:ZY[_^VWSQRHVy+36>P++GyF;v|+vً0+ًOANy+3;^ r+^ 6.N++EyXNV^ v~FUPSQVWRJ@Fy+3;^ |+^ 6>N++Gy׋~ϽXV^ FNvWxEY6;P ZRNV2Z_^Y[X]USRQFy~+3;v|+v6P++B}~}V0R+0J6+Nx3+0R+0ANy+3;^ |+^ XNVF~v^ P tx0F FX FXx t 9FtFYZ[]&3 &&3)&3)&3&,&3^)&3-'&3*&3-&3,&3./&306TJzupZY[_^ÄF"u];tY@3֊ʀG"t 3;u;vBq;}׃>t puuÄF"u;t@֊ʂـG"t 3;u;~Jq;뎋2oo/Ë F" F" F" Ü$+ȝuP#΀YIt(3âS[ptrptrPSQRA +Hx]أfF׆r!P^r uc>$ '*X      ; Current global Y coordinate of clip 0.Private X_Clip:1 ; Current X clipping maximum 0.Private Y_Clip:1 ; Current Y clipping maximum   Plane_Table .Equ $ 0.Byte 00H,02H,00H,02H,01H,02H,01H,00H   Arc_Dir_Table .Equ $ 0.Byte 4,1,6,3,0,5,2,7   Box_Dir_Table .Equ $ 0.Byte 2,0,4,6 0  Line_Dir_Table .Equ $ 0.Byte 2,3,1,0,5,4,6,7 0 Color_Table .Equ $ 0.Byte 08H,0CH,09H,0DH,0AH,0EH,0BH,0FH 0 DA_Sync .Byte 00H 0.Byte 16H $CURSOR $EQUAL $SYNTAX $LAST $TAG ~r~oO.xP0.Byte 26H 0.Byte 46H 0.Byte 0EH 0.Byte 03H 0.Byte 13H 0.Byte 0E0H 0.Byte 7DH  DA_Pitch .Byte 47H 0.Byte Pitch 0 DA_Zoom .Byte 46H  GR_Zoom_P .Byte 00H 0  DA_CSR_Form .Byte 4BH 0.Byte 00H 0.Byte 40H 0.Byte 00H   DA_Mask .Byte 4AH  GR_Mask_L .Byte 0FFH  GR_Mask_H .Byte 0FFH 0 DA_CSR_W .Byte 49H  GR_Ead .Word 0000H  GR_Dad .Byte 00H 0  DA_Text_W .Byte 78H  GR_Text_P1  .Byte 00H  GR_Text_P2 .Byte 00H  GR_Text_P3 .Byte 00H  GR_Text_P4 .Byte 00H  GR_Text_P5 .Byte 00H  GR_Text_P6 .Byte 00H  GR_Text_P7 .Byte 00H  GR_Text_P8 .Byte 00H   DA_Scroll .Byte 70H  GR_Sad_1 .Word Glob_Upper_Left  GR_SL_1 .Word 1E00H  GR_Sad_2 .Word 0000H  GR_SL_2 .Word 0000H   DA_Vect_W .Byte 4CH  GR_V_P1 .Byte 00H  GR_V_P2 .Word 0000H  ; GrafDraw Graphics Unit ;  ; Assembly Code Support ;  ; by ;  ; Barry Demchak, Software Construction Inc. ;  ; for Ticom ;  ; December 30, 1982 ;   ; 15 Aug 83 BD Added Overlay_Mode parameter to Text procedure for XOR mode  ; 15 Aug 83 BD Verified and corrected clipping in all routines  ; 15 Aug 83 BD Mo GR_V_P4 .Word 0000H  GR_V_P6 .Word 0000H  GR_V_P8 .Word 0000H  GR_V_P10 .Word 0000H (  DA_Write .Equ $  GR_Wrt .Byte 00H  GR_Wrt_P1 .Byte 00H  GR_Wrt_P2 .Byte 00H (   GR_CSR: (Call GR_XY_CV ; Calculate graphics cursor position (CX, DX) GR_CSR_W: (Mov GR_Ead,DX ; Set up cursor command block (Mov GR_Dad,CL  GR_CSR_R: (Mov CX,3 ; Execute command block (Lea BX,DA_Csrw (Jmp GRM_ved all permenant variables to .Privates in case of Memswap  ; 15 Aug 83 BD Added Window and Region routines and suppport throughout  ; 15 Aug 83 BD Fixed GR_CV_XY to calculate out-of-plane coordinates correctly  ; 15 Aug 83 BD Fixed all routines to accept Enabled parameter as color mask  ; 15 Aug 83 BD Modified Arc drawing routine to work with new arc clipper  ; 31 Mar 83 BD Fixed Area_Solid to work correctly with all 3 planes  ; 08 Mar 83 BD Installed Arc drawing routine Arc Out (  GR_Vect_W: (Lea BX,DA_Vect_W ; Set up drawing parameter vector with CX params (Jmp GRM_Out ( GR_Vect_E: (Call GR_GDC_C1 ; Execute parameter vector (Mov AL,Vect_E_Cmd (Out GR_Cmd,AL (Ret ( GR_Text_W: (Mov CX,8 ; Declare text parameter vector (Lea BX,DA_Text_W (Jmp GRM_Out ( GR_Text_E: (Call GR_GDC_C1 ; Execute text parameter vector (Mov AL,Text_E_Cmd (Out GR_Cmd,AL (Ret (  GR_Read:  ; 02 Mar 83 BD Installed Solid Area Fill routine AS_Area_Solid  ; 23 Feb 83 BD Fixed 45 degree lines on XOR mode on circles  ; 23 Feb 83 BD Fixed boundary blowup on rectangle fill clipping  ; 23 Feb 83 BD Fixed chip syncronization parameters so left isn't bunched  (.NoPatchList (  (.RelProc GR_Core (.Def Clear, Line, Init, Box, Text, Rect_Fill (.Def Rect_Pat, Read, Unpack, Cir_Fill, Cir_Pat (.Def Area_Solid, Arc, Region, Window, Start, Stop (.Def Y_Val, Scan_Until ( (Call GR_GDC_C1 ; Execute read data (Mov AL,GR_Read_W (Out GR_Cmd,AL (Ret ( GR_Mask: (Mov CX,2 ; Set up drawing mask (Lea BX,DA_Mask (Jmp GRM_Out (  GR_Mode: (And BL,03H ; Set modification mode BL (Or BL,GR_Wrt_W (Mov GR_Wrt,BL (Xor CX,CX (Lea BX,DA_Write (Jmp GRM_Out (  GR_GDC_C1: (In AL,GR_Status ; Wait until controller idle (Test AL,01H ; Is there a read in progress ? (Jnz $01 (Test  False .Equ 0  True .Equ ~False   Reset_Cmd .Equ 00H  Start_Cmd .Equ 0DH  Stop_Cmd .Equ 0CH  M_Str_Cmd .Equ 6FH  Slv_Cmd .Equ 6EH  Vect_E_Cmd .Equ 6CH  Text_E_Cmd .Equ 68H  Scroll_Cmd .Equ 70H  GR_Wrt_W .Equ 20H  GR_Wrt_L .Equ 30H  GR_Wrt_H .Equ 38H  GR_Read_W .Equ 0A0H  GR_Read_L .Equ 0B0H  GR_Read_H .Equ 0B8H &4L"&4&4&&&4&&04&&:4&&D4N &N4  \  $ GT# ;"K 9 c?DvQ >n343-333*21111s1c1W1P1G11100p0g0c0>0:040.0//////Y/S/D/7/2/..}.V.Q.L.I.D.@..------c-Z-T---,,,,,,~,z,e,a,],W,Q,M,G,,,, , ,,+++++++++++++~+r+d+`+\+Y+V+R+L+F+@+8+1+"++*****U*Q*>*;***))))))))))))U)M)I)E)9)4).)(((((((((((p(g(c(T(M( CSR_R_Cmd .Equ 0E0H  Pitch .Equ 40H  GR_Cmd .Equ 72H  GR_Para .Equ 70H  GR_Status .Equ 70H  GR_R_Data .Equ 72H   Glob_X .Equ 1024  Glob_Y .Equ 1024  Win_X .Equ 640  Win_Y .Equ 480  Glob_Upper_Left .Equ * Pitch  0.Private Planes_Absent:1 ; Contains 1's for nonexistent planes 0.Private X_Clip_Base:1 ; Current global X coordinate of clip 0.Private Y_Clip_Base:1 F(<(9(0(,(!( ((''''''''''''{'t'Q' 'U&L&C&:&&%%%%%%%%%n%j%f%(%!%%%% %%%%$$$w$A$&$$$####`#"""u"f"_"Z"U"P"G 0 -  r^YL3"3333333333333333333333444444&4$404.4:484D4B4N4L40Z22O3p"z&&" $&&)-""&&&4./0"0223"&&../U0N22!3"&'*** HEAPOPS EXTRAIO STRINGOPEXTRAHEAFILEOPS REALOPS       AL,04H ; No, is the controller busy ? (Jz GR_GDC_C1  $01: Ret (  GR_Scroll: (Mov CX,8 ; Set up display regions (Lea BX,DA_Scroll  $00: In AL,GR_Status ; Wait until vertical sync is down (Test AL,20H (Jnz $00  $01: In AL,GR_Status ; Ok, now wait until it is up (Test AL,20H (Jz $01 (  GRM_Out: (Call GR_GDC_C1 ; Issue a command block at BX with CX params (Mov AL,(BX) (Out GR_Cmd,AL (Jcxz $02 s where appropriate  15 Aug 83 BD Added Overlay_Mode parameter to Text procedure for XOR mode  15 Aug 83 BD Verified and corrected clipping in all routines  15 Aug 83 BD Added Window and Region routines and suppport throughout  15 Aug 83 BD Fixed all routines to accept Enabled parameter as color mask  15 Aug 83 BD Recoded arc clipping routines (WHAT A BITCH!)  01 Jul 83 BD Added Draw_Result status variable  01 Jul 83 BD Added Set_Region call  $01: Inc BX (Mov AL,(BX) (Out GR_Para,AL (Loop $01  $02: Ret   GR_XY_CV: ; Convert point (CX,DX) into offset (DX,CL) (Add CX,SS:X_Clip_Base ; Make clip-relative coordinates into global (Add DX,SS:Y_Clip_Base  GR_Raw_CV: (Mov AX,CX ; Calculate bit address within row (And CX,0000FH (Push CX (Mov CL,4 ; Calculate word address within row (Sar AX,CL (Push AX (Mov CX, ; Get row address 01 Jul 83 BD Added Core fields for Global coordinate values  01 Jul 83 BD Added in Disp fields in Core record for windowing  10 Mar 83 BD Added clipping for lines and the cursor  10 Mar 83 BD Added version identifier, Graf_Version  08 Mar 83 BD Added Arc code and made circle procs call it  02 Mar 83 BD Added Flood procedure to do solid area filling  23 Feb 83 BD Added file prefix variable in CORE  23 Feb 83 BD Fixed incorrect memory space error handling in Write_Block...  23 Feb 83 BD Mad relative to memory bottom (Sub CX,DX (Mov AX,Pitch ; Calculate word address of row start (Mul CX (Pop CX (Add AX,CX ; Calculate word address of pixel within row (Mov CX,DX (Mov DX,AX (Pop AX (Push CX (Mov CL,4 ; Position bit address for actual use (Shl AX,CL (Mov CL,AL (Pop AX (And AL,03H ; Add in upper bits (Or CL,AL (Ret ( (.Include 7220.Arc.Text (.Include 7220.Flood.Text e initialized CORE variables consistent with RAMTEK  }   Interface  "Const Graf_Version = '0.5';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (.Include 7220.Misc.Text (.Include 7220.Rect.Text (.Include 7220.Circl.Text   (.End  (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable,  { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } $CURSOR $EQUAL $LOG $LAST $SYNTAX $TAG  vO.RxE8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type  = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record  { GrafDraw Graphics Unit }  { by }  { Barry Demchak, Software Construction Inc. }  { for Ticom }  { December 30, 1982 }   {$R-,I- for speed only}  {$D Debug_Arcs-}  Unit Graf_Draw;  {*** Does Overlay_Mode apply to pixel blocks ? }  {*** Find out what the text plane options mean for Set_Value }   {  15 Aug 83 BD Added {$N} directive     00; { Gauranteed to be larger than screen } (PI_180 = 57.29578; {180 / PI} (PI_2 = 1.5707963; {PI / 2} (PI_4 = 0.78539815; {PI / 4} (PI = 3.1415926; {PI} (PI_x2 = 6.2831852; {PI * 2} (Deg_359 = 6.265732; {359 degrees (359/PI_180)} ( "Type Bit_Vector = Record 6Case Integer Of 80 : (Arr : Packed Array [0..15] Of 0..1); 81 : (Int : Integer); 4End {of Bit_Vector}; 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns'Colors = (C_Black, C_Red, C_Green, C_Yellow, C_Blue, C_Magenta, 1C_Cyan, C_White); 'Font_Image = Array [0..30000] Of Integer; " Pat_Plane = Packed Array [0..30000] Of 0..255; 'Pat_Image = Packed Array [0..30000] Of Color_Index; " Pat_Pl_P = ^Pat_Plane; 'Pat_Im_P = ^Pat_Image; 'Pattern_Rec = Record 7Pat_Red_Ptr, 7Pat_Green_Ptr, 7Pat_Blue_Ptr : Pat_Pl_P; 7Pat_Is_Valid, 7Pat_Uses_Red, 7Pat_Uses_Green, 7Pat_Uses_Blue : Boolean; 5End {of Pattern_Rec}; " "Var Planes_On,  in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coordinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw}  { Bit vector for planes enabled } &Font_Im_Size, { # of words in current font image } &Pat_Im_Size, { # of words in current pattern plane } &Cursor_X, { Cursor address X } &Cursor_Y, { Cursor address Y } &CSR_Size : Integer; { Pixels in each cursor segment } &Main_Window : Win_Rec_P; { Default display window } &Drawing_Circle, { Flag to Arc_Rel for optimized draw } 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_B&CSR_Is_Enabled, { Cursor enabled } &CSR_Is_Visible : Boolean; { Cursor disabled } &Font_Min_Ch, { Lowest character defined in font } &Font_Max_Ch : Char; { Highest character defined in font } &Sin_45 : Real; { Sine of 45 degrees } &Font_Ptr : ^Font_Image; { Pointer to current font image } &Pat_Rec : Pattern_Rec; { Information on active pattern } &Text_Rotations : Array [-1..1, -1..1] Of 0..6; & " "Procedure GRlock_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1,  Core^.Window_List^ Then (Begidure GR_Region (X_Start, Y_Start, 7X_Length, Y_Length : Integer); External;  "Procedure GR_Start; External; " "Procedure GR_Stop; External; " "Procedure GR_Window (Win_Num, X_Org, Y_Org, 7X_Size, Y_Size : Integer); External;  "Function GR_Y_Val (Radius, N : Integer) : Integer; External;  "Function GR_Scan_Until (Radius, Y_Max_Val, N : Integer) : Integer; External;    {$I Graf.Curs.Text}  {$I Graf.Misc.Text}  {$I Graf.Flood.Text}  {$I Graf.Rect.Text}  {$I Graf.Font.Text} n *Hit_Digit := False; *Set_Window (Core^.Window_List); *If (Core^.Draw_Result <> Draw_OK) And Print_Errors Then ,Writeln (' Draw result on window movement was ', Core^.Draw_Result); *If Core^.Draw_Result >= Draw_Overflow Then ,Core^.Window_List^ := W; (End {of If W}; $Until Ch In Allowed; " Read_Key := Ch; "End {of Read_Key}; " " " "Procedure Check_Result (Expected : Result_Set); "Var Ch : Char; "Begin " If Not (Core^.Draw_Result In Expected) Then &Begin (If Print_Errors Then  {$I Graf.Line.Text}  {$I Graf.Circl.Text}   Begin {of Graf_Draw} "New (Main_Window); "New (Core); "Graf_Init; "***; "Set_Cursor (Cur_Disable); "Set_Region (0, 0, Succ (Core^.Glob_X_Max), Succ (Core^.Glob_Y_Max)); "Core^.Background := 0; "Plane_Enable (7); "Erase;  End {of Graf_Draw}. *Write ('Unexpected draw result ', Core^.Draw_Result, '; Hit [RETURN]'); (Ch := Read_Key ([Chr (CR)]); &End {of If}; " Core^.Draw_Result := 9; {Just to see if it changes} "End {of Check_Result}; " " " "Function Do_Test (S : String) : Boolean; "Var Ch : Char; "Begin $Write ('Test ', S, ' (Y/N/Esc) ? '); $Ch := Read_Key (['y', 'Y', 'n', 'N', Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Do_Test := Ch In ['Y', 'y']; $Writeln (Ch); $If Ch In ['Y', 'y'] Then &Erase; $Erase_Alpha; $Goto_XY (0, 24); "End {of Do_Test}; " " " "Procedure Continue; "Var Ch : Char; "Begin $Write ('Type to continue'); $Ch := Read_Key ([Chr (CR), Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Erase_Alpha; $Goto_XY (0, 24); "End {of Continue}; " " " "Procedure Test_Cursor; " $Procedure Box_Cursor (Size : Integer); $Var I : Integer; $Begin &Size_Cursor (Size); &Check_Result ([Draw_OK, Draw_Clipped]); &For I := 0 To Core^.X_Max Do (Begin *Move_Cursor (I, 0); $TAG $CURSOR $EQUAL $LAST $SYNTAX @/@SO.#xf*Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.Y_Max Do (Begin *Move_Cursor (Core^.X_Max, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (I, Core^.Y_Max); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.Y_Max Downto 0 Do (Begin *Move_Cursor (0, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.X_Max Do (Begin *Move_Cursor (I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (Core^.X_Max - I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &Continue; $End {of Box_Cursor}; $ "Begin {of Test_Cursor} $Set_Cursor (Cur_Enable); $Check_Result ([Draw_OK]); $Set_Cursor (Cur_Visible); $Check_Result ([Draw_OK, Draw_Clipped]); $Continue; $Box_Cursor (15); $Box_Cursor (30);  Program Test_Core;  Uses {$U Grafdraw.Code} Graf_Draw;  Const Print_Errors = False; &Esc = 27; { Escape key }  CR = 13; { Return key } &Up_Key = 31; { Up arrow key } &Down_Key = 10; { Down arrow key } &Right_Key = 28; { Right arrow key } &Left_Key = 15; { Left arrow key }  BS_Key = 8; { Backspace key } &Home_Key = 25; { Home key }  Type Result_Set = Set Of Draw_OK..Draw_Max;  Char_Set = Set Of Char;  Var Font_ID : Font_Type; $Pat_ID :      ,Check_Result ([Draw_OK]); ,Line_Abs (1, Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_OK]); *End {of For};  &End {of With}; "End {of Test_Line};    "Procedure Test_Box; "Var I : Integer; & &Procedure Draw_Boxes (Display : Display_Type; ?@ABCDEFGHIJKLMNO'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; , ,Move_Abs (Start_X + Font_Cols *Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max Div 20 + 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (Y_Max Div 20 - 3, Y_Max Div 20 - 3, Y_Max Div 10); *Clip_Circle (Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10);  24 * Mag, 6Start_Y - (24 * Font_Cols + Font_Rows) * Mag); ,Char_Path := Left; ,Top_Bottom := Bottom; ,Left_Right := Right; ,Set_Charup (0, -1); ,Text ('PQRSTUVWXYZ[\]^_`abcdefg'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; 4 ,Move_Abs (Start_X - Font_Rows * Mag, 6Start_Y - 24 * Font_Cols * Mag); ,Char_Path := Up; ,Top_Bottom := Bottom; ,Left_Right := Left; ,Set_Charup (-1, 0); ,S := 'hijklmnopqrstuvwxyz{|}~ ';  S[Length(S)] := Chr (127); ,Text (S); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max Div 20 - 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, 0, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, 0, Succ (X_Max)); (End {of With}; $End {of Do_Circles};   $Procedure Circle_Groups (Ovl     Max - Core^.X_Max Div 64); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle + PI_x3_2, End_Angle + PI_x3_2, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (Core^.X_Max - Core^.X_Max Div 64, Y_Max_2); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle + PI, End_Angle + PI, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (X_Max_2, Core^.X_Max Div 64); &Check_Result ([Draw_OK]); &Test_Position (Right, Bottom); &Test_Position (Right, Center); &Test_Position (Right, Top); &Erase; $End {of Test_Direction}; $ $ " "Begin {of Test_Text} " With Core^ Do &Begin (Char_Spacing := 0; (Text_Index := 1; (Char_Width := Font_Cols * 2; (Char_Height := Font_Rows * 1; (Set_Cursor (Cur_Enable); (Set_Cursor (Cur_Visible); (Move_Abs (X_Max_2, Y_Max_2); (Move_Cursor (X_Max_2, Y_Max_2); (Test_Direction (Right); (Test_Direction (Left); (Test_Direction (Up); (Test_Direction (Down); &Arc_Rel (Radius, Start_Angle + PI_2, End_Angle + PI_2, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Continue; &Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; &If Core^.Line_Index = Core^.Background Then (Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; &Erase; &Check_Result ([Draw_OK]); $End {of Clip_Test}; $ "Begin {of Arc_Test} $Combo_Radius := Core^.Y_Max Div 17; $Set_Line_Style (On, On, On, On, On, On, On, On); $Check_Result ([Draw_OK]); $Core^.Polygon_Edge :(Set_Cursor (Cur_Disable); (Erase_Alpha; (Test_Rotations; &End {of With}; "End {of Test_Text}; " " Procedure Test_Flood; "Begin $Set_Line_Style (On, On, On, On, On, On, On, On); $Check_Result ([Draw_OK]); $With Core^ Do &Begin (Overlay_Mode := Replace; (Display_Mode := Fill; (Line_Index := 6; ( (Move_Abs (0, Y_Max Div 5 * 3); {Draw upper zig zag} (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); = Solid_Line; $Core^.Overlay_Mode := Replace; $For I := 0 To 7 Do &For J := 0 To 7 Do (Begin *Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *If Core^.Line_Index = Core^.Background Then ,Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *Move_Abs (J * (Core^.X_Max Div 8) + Combo_Radius, 4I * (Core^.Y_Max Div 8) + Combo_Radius); *Check_Result ([Draw_OK]); *Arc_Rel (Combo_Radius, I * PI_8, J * PI_8, 3X_Start, Y_Start, X_End, Y_End); *Check_Result ([Draw_OK]); (End {of For J}; $Continue; (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); ( (Move_Rel (0, -Y_Max Div 5); {Draw lower zig zag} (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y$Erase; $Check_Result ([Draw_OK]); $Core^.Overlay_Mode := Xor; $For I := 0 To 7 Do &For J := 0 To 7 Do (Begin *Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *If Core^.Line_Index = Core^.Background Then ,Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *Move_Abs (J * (Core^.X_Max Div 8) + Combo_Radius, 4I * (Core^.Y_Max Div 8) + Combo_Radius); *Check_Result ([Draw_OK]); *Arc_Rel (Combo_Radius, PI_x2 / (J + 1), I * PI_8, 3X_Start, Y_Start, X_End, Y_End); *Check_Result ([Draw_OK]); (End_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y_Max Div 5); (Check_Result ([Draw_OK]); ( (Polygon_Interior := Patterned; {Draw circles} (Overlay_Mode := Replace; (Polygon_Edge := Interior; (Move_Abs (X_Max_2 Div 3, Y_Max_2); (Check_Result ([Draw_OK]);  {of For J}; $Continue; $Erase; $Check_Result ([Draw_OK]); $Clip_Test (Core^.Y_Max Div 24, PI_x3_4, -PI_x3_4); $Clip_Test (Core^.Y_Max Div 12, PI_x3_4, -PI_2); $Clip_Test (Core^.Y_Max Div 8, PI_2, -PI_x3_4); $Clip_Test (Core^.Y_Max Div 6, PI_2, -PI_2); $ $Move_Abs (Core^.Y_Max Div 6, Y_Max_2); $Check_Result ([Draw_OK]); $Core^.Line_Index := 2; $Pac_X_Open := Core^.X_Max Div 12; $Pac_Y_Open := Core^.Y_Max Div 9; $Pac_X_Closed := Core^.X_Max Div 10; $Pac_Y_Closed := Core^.Y_Max Div 18; (Line_Index := 2; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); (Move_Rel (X_Max Div 3, 0); (Check_Result ([Draw_OK]); (Line_Index := 4; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); (Move_Rel (X_Max Div 3, 0); (Check_Result ([Draw_OK]); (Line_Index := 6; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); ( (Polygon_Interior := Plain; (Fill_Index := 2; {Fill pattern} (Move_Abs (X_Max_2, Y_Max Div 8 * 5 + 7); (Check_Result ([Draw_OK]); (Flo$Open_Mouth := True; $Repeat &If Open_Mouth Then (Arc_Abs (Radius, Start_Angle, End_Angle, 1Core^.X_CP + Pac_X_Open, Core^.Y_CP - Pac_Y_Open, 1Core^.X_CP + Pac_X_Open, Core^.Y_CP + Pac_Y_Open) &Else (Arc_Abs (Radius, Start_Angle, End_Angle, 1Core^.X_CP + Pac_X_Closed, Core^.Y_CP - Pac_Y_Closed, 1Core^.X_CP + Pac_X_Closed, Core^.Y_CP + Pac_Y_Closed); &Open_Mouth := Not Open_Mouth; &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle, End_Angle, /X_Start, Y_Start, X_End, Y_End); &Check_Reod; (Check_Result ([Draw_OK]); (Continue; (Flood; (Check_Result ([Draw_OK]); (Continue; (Fill_Index := 3; (Overlay_Mode := Xor; (Flood; (Check_Result ([Draw_OK]); &End {of With}; "End {of Test_Flood}; $ " "  Procedure Test_Arcs; "Const PI_8 = 0.39269907; (PI_4 = 0.78539815; (PI_2 = 1.5707963; (PI = 3.1415926278; (PI_x2 = 6.2831852; (PI_x3_2 = 4.7123889; (PI_x3_4 = 2.3561944; (PI_x7_4 = 5.497787; (PI_x5_4 = 3.9269907; "Var X_Start, &Y_Start, &X_End, &Y_End, &Pac_X_Open, ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; * *End {of For}; $End {of Test_Rotations}; & & " $Procedure Test_Direction (Dir : Direction); $ &Procedure Test_Position (Horiz, Vert : Directions); &Var Horiz_Name, *Vert_Name : String; &Begin (Case Horiz Of *Left : Horiz_Name := 'Left - '; *Center : Horiz_Name := 'Center - '; *Right : Horiz_Name := 'Right - '; (End {of Case}; (Case Vert Of *Top : Vert_Name := 'Top'; *Center : Vert_Name := 'Center'; *Bottom : Vert_Name :=&Pac_Y_Open, &Pac_X_Closed, &Pac_Y_Closed, &Combo_Radius, &Radius, &J, &I : Integer; &Open_Mouth : Boolean; &Start_Angle, &End_Angle : Real; " $Procedure Clip_Test (Radius : Integer; Start_Angle, End_Angle : Real); $Var Start_X, (Start_Y, (End_X, (End_Y : Integer; $Begin &Move_Abs (Core^.X_Max Div 64, Y_Max_2); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle, End_Angle, Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (X_Max_2, Core^.Y_ 'Bottom'; (End {of Case}; (Core^.Top_Bottom := Vert; (Core^.Left_Right := Horiz; (Text (Concat (Horiz_Name, Vert_Name)); (Core^.Text_Index := Succ (Core^.Text_Index) Mod 8; (Continue; &End {of Test_Position}; $ $ $Begin {of Test_Direction} $ Core^.Char_Path := Dir; &Test_Position (Left, Bottom); &Test_Position (Left, Center); &Test_Position (Left, Top); &Erase; &Test_Position (Center, Bottom); &Test_Position (Center, Center); &Test_Position (Center, Top); &Erase;      sult ([Draw_OK]); &Move_Rel (Core^.X_Max Div 22, 0); &Check_Result ([Draw_OK]); " Until Core^.X_CP + Radius >= Core^.X_Max; "End {of Test_Arcs};    "Procedure Test_Block; " $Procedure Breakup (X, Y, Side_Length, Level : Integer); $Type Color_Array = Packed Array [0..30000] Of Color_Index; $Var New_Length : Integer; (Pattern : Record 7Case Integer Of 90 : (S : Sorcery); 91 : (P : ^Color_Array); 5End {of Pattern}; $ d 8; ,End {of For J}; ( (For I := Region_Y_Org To Succ (Glob_Y_Max - Window^.Win_Y_Size) Do ( Begin * Window^.Win_Y_Org := I; ,Set_Window (Window); ,If Window^.Win_Y_Org Mod Win_Y_Res = 0 Then .Check_Result ([Draw_OK]) ,Else .Check_Result ([Draw_Clipped]); *End {of For}; (For I := Region_X_Org To Succ (Glob_X_Max - Window^.Win_X_Size) Do ( Begin ,Window^.Win_X_Org := I; ,Set_Window (Window); ,If Window^.Win_X_Org Mod Win_X_Res = 0 Then .Check_Result ([Draw_OK]) ,Else &Procedure Draw_Section (Sect_X, Sect_Y, X_Offset, Y_Offset : Integer); &Begin (Move_Abs (Sect_X, Sect_Y); (Check_Result ([Draw_OK]); (Read_Block_Pixels (Pattern.S, New_Length, New_Length); (Check_Result ([Draw_OK]); (Move_Rel (X_Offset * New_Length, Y_Offset * New_Length); (Check_Result ([Draw_OK]); (Write_Block_Pixels (Pattern.S, New_Length, New_Length); (Check_Result ([Draw_OK]); (If Level > 0 Then *Breakup (Sect_X + X_Offset * New_Length, 3Sect_Y + Y_Offset * New_Length, New_Length, Pred (.Check_Result ([Draw_Clipped]); *End {of For}; ( (Continue; (Window^.Win_X_Org := Region_X_Org; (For I := 0 To 5 Do ( For J := 0 To 7 Do ,Begin .Window^.Win_Y_Org := J * Y_Max Div 20; .Set_Window (Window); ,End {of For J}; ( (Continue; (Set_Region (Region_X_Org, Region_Y_Org - Char_Height, 4Succ (X_Max), Succ (Y_Max + Char_Height)); (Check_Result ([Draw_OK]); (Set_Window (Old_Window); (Check_Result ([Draw_OK]); (Dispose (Window^.Next_Window); (Dispose (Window); &End {of With}; "End {oLevel)); &End {of Draw_Section}; & $Begin {of Breakup} &New_Length := Side_Length Div 2; &If Var_New (Pattern.P, New_Length * ((New_Length + 3) Div 4)) <> 0 Then; &Draw_Section (X, Y, -2, -2); &Draw_Section (X, Y + Side_Length - New_Length, -2, 2); &Draw_Section (X + Side_Length - New_Length, Y, 2, -2); &Draw_Section (X + Side_Length - New_Length, Y + Side_Length - New_Length, 42, 2); &Var_Dispose (Pattern.P, New_Length * ((New_Length + 3) Div 4)); $End {of Breakup}; $ " f Test_Windows}; $ $  Begin {of Test_Core} "Check_Result ([Draw_Init]); "Goto_XY (0, 24); "Write ('Background color ? '); "Readln (Core^.Background); "Write ('Pattern number ? '); "Readln (Pat_ID); "Set_Fill_Pattern (Pat_ID); "Check_Result ([Draw_OK]); "Write ('Font number ? '); "Readln (Font_ID); "Set_Font (Font_ID); "Check_Result ([Draw_OK]); "Write ('Planes enabled ? '); "Readln (Planes); "Plane_Enable (Planes); "Check_Result ([Draw_OK]); "Begin {of Test_Block} $With Core^ Do &Begin (Display_Mode := Fill; (Overlay_Mode := Xor; (Polygon_Interior := Patterned; (Polygon_Edge := Interior; (Move_Abs (X_Max_2 - (Y_Max Div 5), 2Y_Max_2 - (Y_Max Div 5)); (Check_Result ([Draw_OK]); (Box_Rel (Succ (Y_Max Div 5), Succ (Y_Max Div 5)); (Check_Result ([Draw_OK]); (Move_Rel (1, 1); (Check_Result ([Draw_OK]); (Breakup (X_CP, Y_CP, Y_Max Div 5, 1); &End {of With}; "End {of Test_Block}; $ $ "Procedure Test_Windows; "Var J, &I : Inte"Writeln ('Global space at (', Core^.Glob_X_Min, ', ', Core^.Glob_Y_Min, +') to (', Core^.Glob_X_Max, ', ', Core^.Glob_Y_Max, ')'); "With Core^.Window_List^ Do $Writeln ('Display at (', Win_X_Org, ', ', Win_Y_Org, ') to (', -Pred (Win_X_Org + Win_X_Size), ', ', -Pred (Win_Y_Org + Win_Y_Size), ')'); "Writeln ('Clipping region at (', Core^.X_Min, ', ', Core^.Y_Min, +') to (', Core^.X_Max, ', ', Core^.Y_Max, ')'); "Write ('Clipping region lower left corner (X, Y) ? '); "Readln (Reg_X, Reg_Y); "Wriger; " Old_Window, &Window : Win_Rec_P; "Begin $With Core^ Do &Begin (Old_Window := Window_List; ({Set_Window (Nil); (Check_Result ([Draw_OK]);} ( (Char_Width := Font_Cols; (Char_Height := Font_Rows; (Char_Spacing := 0; (Char_Path := Right; (Set_Charup (0, 1); (Check_Result ([Draw_OK]); (Top_Bottom := Bottom; (Left_Right := Center; (Move_Abs (X_Max Div 2, 0); (Check_Result ([Draw_OK]); (Text_Index := Succ (Background_Index) Mod 8; (Text ('Hi, mom!'); (Check_Result ([Draw_OK]); ( te ('Clipping region size (X'', Y'') ? '); "Readln (Reg_X_Size, Reg_Y_Size); "Set_Region (Reg_X, Reg_Y, Reg_X_Size, Reg_Y_Size); "Check_Result ([Draw_OK]); "Erase; "Check_Result ([Draw_OK]); "Erase_Alpha; "Check_Result ([Draw_OK]); "Goto_XY (0, 24); "X_Max_2 := Core^.X_Max Div 2; "Y_Max_2 := Core^.Y_Max Div 2; "If Do_Test ('Cursor') Then $Test_Cursor;  If Do_Test ('Line') Then $Test_Line; If Do_Test ('Box') Then $Test_Box; "If Do_Test ('Text') Then $Test_Text; (Overlay_Mode := Replace; (Line_Index := Succ (Background_Index) Mod 8; (Move_Rel (0, 0); (Check_Result ([Draw_OK]); (New (Window); (New (Window^.Next_Window); (Window^.Win_X_Org := 0; (Window^.Win_Y_Org := Char_Height; (Window^.Disp_X_Org := 0; (Window^.Disp_Y_Org := Char_Height; (Window^.Win_X_Size := Window_List^.Win_X_Size; (Window^.Win_Y_Size := Window_List^.Win_Y_Size - Char_Height; (With Window^.Next_Window^ Do *Begin ,Next_Window := Nil; ,Win_X_Org := 0; ,Win_Y_Org := 0; ,Disp_X_Or If Do_Test ('Circle') Then $Test_Circle; "If Do_Test ('Block') Then $Test_Block; "If Do_Test ('Area Fill') Then $Test_Flood; "If Do_Test ('Arc') Then $Test_Arcs; "If Do_Test ('Windows') Then $Test_Windows; "Continue; "Erase_Alpha;  End {of Test_Core}. g := 0; ,Disp_Y_Org := 0; * Win_X_Size := Window_List^.Win_X_Size; ,Win_Y_Size := Char_Height; *End {of With Window}; (Set_Region (Region_X_Org, Region_Y_Org + Char_Height, 4Succ (X_Max), Succ (Y_Max - Char_Height)); (Check_Result ([Draw_OK]); ( (For I := 0 To 19 Do *Begin ,Move_Abs (I * X_Max Div 20, 0); ,Check_Result ([Draw_OK]); ,Line_Rel (0, Y_Max); ,Check_Result ([Draw_OK]); *End {of For}; (For I := 0 To 19 Do *Begin ,Move_Abs (0, I * Y_Max Div 20); ,Check_Result ([Draw_OK]); ,Line_Rel (X_Max, 0); ,Check_Result ([Draw_OK]); *End {of For}; (Display_Mode := Fill; (Fill_Index := Succ (Background_Index) Mod 8; (Polygon_Interior := Plain; (Polygon_Edge := Interior; (For I := 0 To 19 Do *For J := 0 To 19 Do ,Begin .Move_Abs (I * X_Max Div 20, J * Y_Max Div 20); .Check_Result ([Draw_OK]); .Circle_Rel (Y_Max Div 50); .Check_Result ([Draw_OK, Draw_Clipped]); .Fill_Index := Succ (Fill_Index) Mod 8; .If Fill_Index = Background_Index Then 0Fill_Index := Succ (Fill_Index) Mo     r r r .-.j".U--"ć--"7 --"i6 --" h! r-ć-ć-r r- - ˏđ!-" r-ć-ć-r r- - ˏđ!-" --"r-ć-ć-r r- - ˏđ!-" -"r-ć-ć-r cPcccr- - ˏđ"j.+*&P**P */Pց4`<P`>P `BPցFĚSS h|ih !~ r h~ih ! |r h|ih ! r h~ih ! |̚~ ¿r hޚ~ih !"~ |̚~ ¿r hّrrrr76rrr\ rć}|h _  r | r~  r~ | r  r h  ć}r}|h U| r~*PvS`vSr  ˏđc rrrh      rr76r76rrrwrh    |r ~ |r ~ |r ~ |r ~ |r ~ |r ~ |r |r ~ |r ~ |r ~ |r ~ |r ~ |r ~ |r   76r  |r ~r  r| r~ rr h  ćć}|h yaxĄ a Ą a| Ą~ a Ą~ a| Ą a Ąar h'  ćć}r}|h a| Ą~ aĄa| Ą~ aĄ |r ~r  |r  7 |rrr  rh~@6r, dcba`r 7|~@r, dcba`r ~~@6r, dcba`r 7~@r, dcba`r   ˏĚ   ˏr |krĚh Յi!t  ˏĚ   ˏ!~# |#r# aĄaĄar h7rrć ᇁ~h g  ˏ76r-̇+ ¿|r76r-̇+ ¿r hᇁ|h g  ˏ76r~퇁+̇- ¿r76rᇁ+̇- ¿r hć ~h f  ˏ76r-̇+ ¿|r76r-̇+ ¿r h|h f  ! „ r !i htrh Նi!u  ˏĚ   ˏ!~# |#r#$! („ r !i hsr|,0| 48|<@|DH|6r Ě~ o| n~ m|l ,!by'x&y'x&r!by%x$y%x$r!, " r ~ry"~Ԁ#"rr ! rr ˏ76r~+̇- ¿r76r+̇- ¿r h h # " ! ˏđr76r ~ |r r ~r r |r rr r ˏ76r y ~ x |rr y ~ xrr y x |rr y xr h !đr ~ | r r  ~ r r  r r  | r r #!" l#ha  %$%$# %# $%# $# a  h    7 |6 |r | |r r y x |sl$(k$$$$$$r $$$~r$ $ˏĂKr$$ $ˏrb " ""$""$"$(z"$(y$"xm%%%%%%$(z%$$'$&$$~$|$r"mh % $~r$|r hmh % $|r i! r!76r76r 76r 76r 76r 76r 76r 76r 76r !}!|jh "8  r!~ !| r! ! ˏ hÑr!}!|jh "8  r!~ !| r ! ! ˏ h! ! !        !!   r! !!! !|jh "8  r!| !| r ! ! ˏ hÖ "!r rL$~r h$ $ $ˏ$$mh %^ni!&P $~!$|r$|2r$ $ ˏ$ $$ $ ˏ!i h$&$+"ymh %(" "r#"}$)ˏ h$'$-"zmh %(" "r#"~$*ˏ hӑ"$'mh % ni!&"!$|"r#!i hۑ$'$&$$~$|$r"#r#" b vuPs psps pZs psps p1crcs psps p0cr ki! $!#!! ! 76r!!| jh "&!y !xr! ! ˏ hՑ! !| jh "! r! ! ˏ hڑ! !!| jh "! r! ! ˏ hڑr! ! ˏ! ! ˏ!|!|!| !|!|!|!| !~!|!|!|!| !~!|!|!| r!|!|!| !|!|!|!| !~!|!|!|!| !~!|!|!| r!|!|!| !|!|!|!| !~!|!|!|!| !~!|!|!|CTESTCORE  -  &GRAPH" @@   @@  0 r!~r!|!~r!~!|!~r!~!~ m%%%~%%| %%%r %*%|l% % % $$rni!&!oj"' h (% %!%" k#):$r$r% % ˏ% % ˏ#k rr%r" rr%r! rr% % ˏ% %% % ˏ$$%r h"j!i .rrBTESTCORE< ji`s psp hc(( F**}"Ċ?**}"Ċ5**~"Ċ+**~"Ċ!**Ċ!j" 0jiրLc(Gi(r#/!s p/spsp/ (c 3 =/a3's p/sps p h/ Ė*a+Ps pas ps p⼃h p ڤ- tpsp rru,s p h pru"r~ih ! r     s p sps p8rts p.sp}s p,sps p-sps p+sp)tpsp( s p9~sps p9}sps p9~9zsps p9}9ysp)tpsps psps p}sps p~sps p|sp)tpsps pspsps ps pspsps p5432r"rru~F#sD3^|@^3~;F#s^G^^FGF^^G^ ^G^ `$$ rĆĆĆ0o''''' ' ' '' ' ''''''''''''''''!' '"N'.'- ','+!"#"777777"7#'(7'*%')&'(#'/Ė0/ Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0/Ė|  rh1h1E & E & ""V&V&<V&4 4 4 ""4 ""9$ Draw result on window movement was Unexpected draw result ; Hit [RETURN]]Test (Y/N/Esc) ? @@i0/Ė 0/Ė#0/ Ė4)`*P0/ Ė+0/ "Z!281/-+)'%# րO#!!0h0!đ0 Ċ!րd098h 3270~0|06% 3270/Ė` `p0/Ėf PڋGFFG^NQQ@@3^t@3_^uF#rFF»^ ؉3_ }@3_ }F Ƌ3_}F Ƌ3_}F Ƌ3_}F Ƌ3_}F s G^ st3_;\t@3_tF ƋType to continue Fast,  Fill,  Solid,  Trace,  Plainn Patternedd !"#$%&'()*+,-./01234567789:;<=>?@ABCDEFGHIJKLMNOOPQRSTUVWXYZ[\]^_`abcdefgghijklmnopqrstuvwxyz{|}~ Left - Center - Right - TopCenterrBottommHi, mom!!Background color ? Pattern number ? Font number ? Planes enabled ? Global space at (, ) to ((, Display at ((, ) to ((, Clipping region at ((, ) to ((, +Clipping region lower left corner (X, Y) ? Clipping regi_ \3K;\Z~G s G^!GG ™|R…yDR=t;GPE ™R…yGR‹\ +^GD GGDڋ_;G~ ڋ_G+DG GGH;GV~GV+D@GNQNQ@DH@QwP@@F@F^FG^=tNQ@ڋ_GH@QQPܨڋ_GHQPX%3ۋtC#s G^F=~=ujFFF=u3FF»on size (X', Y') ? CursorrLineeBoxTexttCircleeBlock Area FillArcWindowse  8 > Z  4 (1`y HEAPOPS EXTRAHEA REALOPS STRINGOPGOTOXY EXTRAIO PASCALIOGRAFDRAW ^ ؉G ™|T…yDT=t3D ™}T…yET‹_ +؉^G^ G FGDڋ_;G~ڋ_G+DFG^ GFFFH;GZ~GZ+F@FG^3_^u@#Gs G^vvwv44F@FFGP=u2GPGP3 G^QiڋGF^G^ 3^~@^^ v3K;\ZG#r3^~@^^v3K;\VG#rڋG#Dsڋwt7^G^^FHGY$GRAFDRAW &4(  IV.0 [1e] ^FHG^F GN^FGLv vvv1GGڋG#DsQQ7^G^0i!98h 327!!y!x! 6!/ 327!/ĖX4`s04t4t4t0ĆĄ pP  0Ȅ  0Ȅ4^^0"u^vu^ Xu^s0/ p%4\v^\]^4t4 ^4t4o^4t4 \]jd"t"n&զmih"!"k!k^$ #p #h"#j"4^vmi%"%P0__ć_!\ć_ ]ć^0/Ć#X$GRAFDRAW W&K<<W&SW&S""E &<yy Patxx.Ptrnn: Fontxx.Font:trA*(df,DDDzj r(R}##"$$$6%%%& '$'j''''?(ڋG^ڋF+G=}FڋG^`$\]`z``y``x`,d\]t$0/ )^4t(^4t'^4t4s0j&k#~Ռ"y(i "y(%i"x'h "x'$h#}"6"y"x('#z%$! "*#|"6"y"x('#y%$! "*#{"6"y"x('#x%$! "* 0l&&$~%%$|ii$$ 98h 327$Z!>$yk$xj&$x&&$~&%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$!$ 9 327$/!Ėk0k#y%j#x$i""#~!!#| ڋF+GFڋGFڋ_;G ~ڋ_G FڋG^ ڋGFFF+Fڋ__+vvPQQVQQ&ڋF+G=}FڋG^ ڋF+GFڋGFڋ_;G~ڋ_GFڋG^ ڋGFFF+Fڋ__+vvQPQVQQ&ڋGFڋGr^G^ 3^|@^3~; F#sw3^|@^3~;F#sXڋGsڋwt7ڋFGڋFGڋGsڋwt7^G^^G^ڋG^F=@3vu@"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$#!# 9 327#/Ė/0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|-/Ċ-/Ċ-/ $g$t% %t-/Ė0i#"B!98h 327!y!x$"#+ 327!y"!~!x#!|!/Ċ!/Ċ!/Ė/[s0 5t0ewPe 0e 0Ȅ/[[0"u[}u[eXu[s0/ pխ_;tڋGsڋwt73^u@ډGhڋGs_F=73vu@_;tڋwt73^u@ډG F=u Q QڋGЋڋ_ sڋG^EڋG^ڋ3t;vt@#GsTF=|>ڋGsڋwt7ڋFGڋGs!ڋwt7ڋG^ ڋGF3^|@^3~; F#sD3^|@^3~;F#s^G^^FGF^^G^ ^G^ YڋGF^GF F^FF3^|@^3~;      sF$;FuF";F~F"F3^;^@ڋ_3~;?F#ƉF [w.3^;^ u@^#^F#F # F rF ЉFF r!F@™…ỷFF F™…ỷFvF&;FFF F ;FuF;F }FF Qv&v v6F F ^F;F}SFF F EF&;F:FF F ;FuF;F }FF Qv&v v6F F F;F}FF F ڋ_F&;Gڋ_GF F ;FuF;F }FF Qv&v v6F F ڋ_F;G}ڋ_GF F tڋ_F&;~w.J^$w2$/F ™‹^+؉^F+F F [w.T3^}@^ ^v$3K;\ ~G rF^$w47F+F F~`(`'`&`%`$`#`"`!0 0/Ė hڋGFF^3_u@#G#GFFsڋwt7^GF ^3;G ~F^F 3_;}G sm^F ؋_;ih;ih2ih)ihihih ihր.f󿢇b󿢑!.f .b,"0""uh"98:塤 (327/̆i j:)//+ ++' ''"y/"~"y/"x/"|"x/h : * "y"x/!"" " 6"0+n'"o+r+r'r'r& /̄m /̄m' /̄l /̄l &%""m'&%$ l%!!m' $""l} ^G؉F^vG +DFv ̨F yy3PèFyy3P¿F FF F^F ^3;G~F^F 3;}G sj^F ؋;} ^؉F^vG+Fv ̨F yy3PèFyy3P¿F FF F^v~G^P4E~v v Pwtu&Fsڋwt7^FG^^vDF G^F ^x!0y 0x Fڋ_3_u@#G#GFFsڋwt7FڋGFFFFF;F~FFH^FFH^F$!!l:D9 &&%Ċ&%ć%/&x5ć&x&+$Ċ$$ć#/$x5 "y"x/&%'$!"" " 6"0 /&%'$"!#x;:n$x&x$x&x#x%x ,"y"x&x%x&<kk"y"x$x#x'#<,"y"x&x%x&#<) (327"/ Ė/N-%'$&`&`*`$&%'r%' ``. $&``2 `-0h'$ y6# x:r& y x$#=% y x"!='x&%dcba '.0k#98h 327$l# $>aaaa # ##y#x$## 6-$: 327#y$#~^F+GF ^F+F^GF ^3;G ~F^F 3_;}G sm^F ؋_;} ^G؉F ^vG +DF v̨F yy3PèF yy3P¿FF F F^F^3;G~F^F3;}G sj^F؋;} ^؉F ^vG+F v ̨Fyy3PèF yy3P¿F F FFFs1^v~G^P4E~v vPwtu&3^ t@3ۋvtC ؉^^FGF^F@FFsڋwt7ڋG^v؉7@" F ڋ_3_u@#y$#x$#|#x$#/Ċ#/Ė.0k%#yB$#xFri#98h 327# !Jbbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#/Ċ#/Ė.w0w8 0-0+"0T  &F}G@FK@JIxpL=/?/AvW@)_A ^X_+A;Vr+VC;^u3IA uvN;xBHVy+36>P++GyF;v|+vًA+ًOANy+3;^ r+^ 6.N++EyXNV^ v~FUPSQVWRJ@Fy+3;^ |+^ 6>N++Gy׋~313~u8FtN V V Ӌ VW6;R|uPYPPVH;~‡T;} ދ=^XQȋ@;} *-;~ދƇ_^;3;u_YSQRWVPA;}EZRV}΀2oo/:3tF;}u[ZRWS*^_XX^_ZY[VWSQR=/?/3D?:ZY[_^VWSQR=/?/6TJzupZY[_^Ä3u];tY@3֊ʀ3t 3;u;vBq;}׃>T/t puu?/Ä3u;t@֊ʂـϽXV^ FNvWxEY6;P ZRNV2Z_^Y[X]USRQFy~+3;v|+v6P++B}~}VAR+AJ6+Nx3+AR+AANy+3;^ |+^ XNVF~v^ P txAF FX FXx t 9FtFYZ[]T&D_7T&D:T&EY:T& Ez=T&E:T& E8T&*E=E,>T&HE@T&REBT&\E3T&fE0T&pE,8T&zE8T&E$8T&EO8T&E1T&E1\"1/""""""""""""""""~"y"t"w=7kR 3t 3;u;~Jq;뎋2oo/Ë=/?/2323232Ü$+ȝuP#΀YIt(3?/âS/T/S[ptrptrT/PSQRAS/ +Hx]T/أV/X/Z/=/?/fF /׆r!P^r uc>$ '*X?/<uZY[X36T6R6N6PrvF1nr(/A1/83//5/&3PPSSPSP 336Vd6VnFFFF42FF F y \ 8 Tci>DDDoDhD~C5CCCCBBBBBZBTB3BAAAAAAAAIAEA?A9AA@@@@@@?????????q?@?/?*?%?>>>>>k>Z>S>>>>>>==========o=l=d=a=^=T=O=H=B=:======<<<<<<<<<<<<<<<<1:150/00/ p tp u r r rˋF 6TF6RFH6NFH6PN V~JJ/v xL Ff Hx ؊FfHyNS/zt^Ft t^y8F |8FS/uF8{8F~8H/|8}8y8z8v~86{82 u:Vu 6C΀tuƊVt:vuЊ-O}8uz8N }8^2t z8:Nt낈6{8~8*2V/X/*2T/8VS/uV0=/?/f F /׆r$^Pr u uX?/<u////v/p/j/f/DDDDEE E EEE EE*E(E4E2E>ES/rS/uFFz8y8:Nt{F^VN 2 y  y ;s/ S/£T/ ȋZ/V/)V/+؉X/ FN ^V hubF^N V S/N IT/F /ף:F׊ Êࣰ::/;/A/CCkF6T%tY+؋F ;vãV/X/F)F V6:.:rQ ^ru:Yu.:F %tWرV/X/NV^)^ B6:.:r"Q^ruYu.:F tDV/X/NV6:.:r  "Const Graf_Version = '0.5';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Q\^ruVjYu^VFNt^VFNS/F t-<~ u3ۉ/<^1<F3Z^v@T7<F;7ك+K&>$>Ny3ɋ^*>2ۋv6 Au~65F~ 6F ~6=F;$>t;*>u v6*>uFـt~65~ 6~6=&>NN N(>Na^ ^ ^36Ў:/;/S/F 6T%?NAAuJ6+Nv+ډ^؃T/NxQ~3V 6;PpN S=/?/?/׀&?/?/ptrptrĊ?*~3ۊ?s6C;^u?<uYN"Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } F muGuptrptr tPy +y3CJy3ҋ6+>Nv+B t)y +y3@Iy3ɋ6+>Pv+A t A/B/3~ >@ tq++;>@t>@` y  + OF;ru ;>@t4V+yF3JRV +yG3JRVWvvv RKSZ/N+Ay36N++y؉T/ۉV/X/S/ V 6;PQVYV +xK[V +By36P++}؉T/ۉV/X/S/ N+xRZN6;NZ0=/?/fF /׆rP^ru X?/<u     "Procedure Inq_Color (Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer); " "Function Inq_Value (Option : Integer) : Integer; " "Procedure Plane_Enable (Planes : Integer); " "Procedure Plane_Visible (Planes : Integer); " "Procedure Set_Palette (Pal_Name : String); " "Procedure Set_Value (Opcode, 7Value : Integer); " "Procedure Erase; " "Procedure Erase_Alpha; "  Procedure Flood; " "Procedure Arc_Rel (Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Va { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record 9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 r X_Start, 5Y_Start, 5X_End, 5Y_End : Integer); " "Procedure Arc_Abs (Var Radius : Integer; 5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer);   Procedure Set_Region (X_Start, 8Y_Start, 8X_Length, 8Y_Length : Integer); 8  Procedure Set_Window (Window_Chain : Win_Rec_P); "  Implementation 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text color} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, $CURSOR $EQUAL $LOG $LAST $SYNTAX $TAG 2 1  LvLL O.RӧF { Columns per char } 9Font_Rows : Point; { Rows per char } 9 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coor { GrafDraw Graphics Unit }  { by }  { Barry Demchak, Software Construction Inc. }  { for Ticom }  { December 30, 1982 }   {$R-,I- for speed only}  {$D Debug_Arcs-}  Unit Graf_Draw;  {*** Does Overlay_Mode apply to pixel blocks ? }  {*** Find out what the text plane options mean for Set_Value }   {  15 Aug 83 BD Added {$N} directivedinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw} 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " s where appropriate  15 Aug 83 BD Added Overlay_Mode parameter to Text procedure for XOR mode  15 Aug 83 BD Verified and corrected clipping in all routines  15 Aug 83 BD Added Window and Region routines and suppport throughout  15 Aug 83 BD Fixed all routines to accept Enabled parameter as color mask  15 Aug 83 BD Recoded arc clipping routines (WHAT A BITCH!)  01 Jul 83 BD Added Draw_Result status variable  01 Jul 83 BD Added Set_Region call "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1,  Nil) And (Draw_Result = Draw_OK) Do *With Cur_Rec^, Y_Array[Rec_Count] Do ,Begin .If (Win_X_Org < 0) Or (Win_Y_Org < 0) Or 1(Disp_X_Org < 0) Or (Disp_Y_Org < 0) Or 1(Win_X_Size < 0) Or (Win_Y_Size < 0) Thw^.Win_Y_Org := 0; (Main_Window^.Disp_X_Org := 0; (Main_Window^.Disp_Y_Org := 0; (Main_Window^.Win_X_Size := Init_Rec.Win_X_Size; (Main_Window^.Win_Y_Size := Init_Rec.Win_Y_Size; (Window_List := Main_Window; (Win_X_Res := Init_Rec.Win_X_Res; (Win_Y_Res := Init_Rec.Win_Y_Res; (Set_Window (Window_List); (Draw_Result := Draw_Init; &End {of With}; "End {of Graf_Init}; " " " "Procedure Define_Color {Index, :Red, :Green, :Blue, :Blink, :Hard_Copy : Integer}; "Begin en 0Draw_Result := Draw_Overflow .Else 0If (Win_X_Size <> Main_Window^.Win_X_Size) Or 3(Disp_X_Org <> 0) Or 3(Pred (Win_X_Org + Win_X_Size) > Glob_X_Max) Then 2Draw_Result := Draw_Win_Imp 0Else 2Begin 4Clipped := False; 4If Win_Y_Org Mod Win_Y_Res <> 0 Then 6Begin 8Y_Start := Win_Y_Org - Win_Y_Org Mod Win_Y_Res; 8Clipped := True; 8(*1 Writeln ('Clipping for Y resolution'); (*2*) 6End {of If} 4Else 6Y_Start := Win_Y_Org; 4If Disp_Y_Org + Win_Y_Size > Main_Window^.Win_Y_Size Then 6Begin $Core^.Draw_Result := Draw_Not_Imp; "End {of Define_Color}; " " " "Procedure Inq_Color {Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer}; "Var Vect : Bit_Vector; "Begin $Vect.Int := Index; $If Vect.Arr[0] <> 0 Then &Red := 3 $Else &Red := 0; $If Vect.Arr[1] <> 0 Then &Green := 3 $Else &Green := 0; $If Vect.Arr[2] <> 0 Then &Blue := 3 $Else &Blue := 0; $Blink := 0; $Hard_Copy := 0; $Core^.Draw_Result := Draw_OK; "End {of Inq_Color};    "Function Inq_Valu8Y_Size := Main_Window^.Win_Y_Size - Disp_Y_Org; 8Clipped := True; 8(*1 Writeln ('Clipping for Y display overflow'); (*2*) 6End {of If Y_Start} 4Else 6Y_Size := Win_Y_Size; 4If Pred (Y_Start + Y_Size) > Glob_Y_Max Then 6Begin 8Y_Size := Succ (Glob_Y_Max - Y_Start); 8Clipped := True; 8(*1 Writeln ('Clipping for Y space overflow'); (*2*) 6End {of If Pred}; 4(*1 Writeln ('Attempting window from ', Disp_Y_Org, ' to ', =Pred (Disp_Y_Org + Y_Size)); (*2*) 4Occupied := Occupied + F[Disp_Y_Org..Pre {Option : Integer) : Integer}; "Begin $Inq_Value := 1; { NEC 640 x 480 } $Core^.Draw_Result := Draw_OK; "End {of Inq_Value};    "Procedure Plane_Enable {Planes : Integer}; "Begin $Planes_On := Ord (Odd (Planes) And Odd (7)); $Core^.Draw_Result := Draw_OK; "End {of Plane_Enable};    "Procedure Plane_Visible {Planes : Integer}; "Begin $Core^.Draw_Result := Draw_Not_Imp; "End {of Plane_Visible};    "Procedure Set_Palette {Pal_Name : String}; "Begin ed (Disp_Y_Org + Y_Size)]; , End {of Else}; .Rec_Count := Succ (Rec_Count); .Cur_Rec := Cur_Rec^.Next_Window; ,End {of With}; (If Draw_Result = Draw_OK Then *If (Occupied * [0..Pred (Main_Window^.Win_Y_Size)] <> ,[0..Pred (Main_Window^.Win_Y_Size)]) And (Window_Chain <> Nil) Then ,Draw_Result := Draw_Win_Imp *Else ,If Rec_Count <= Max_Windows Then .If Window_Chain <> Nil Then 0Begin 2Cur_Rec := Window_Chain; 2Rec_Count := 0; 2While Cur_Rec <> Nil Do $Core^.Draw_Result := Draw_Not_Imp; "End {of Set_Palette};    "Procedure Set_Value {Opcode, 7Value : Integer}; "Var Temp_Value : Integer; "Begin $Core^.Draw_Result := Draw_Not_Imp; $Case Opcode Of &0 : Case Value Of ,0 : Graf_Init; ,1 : { Not implemented -- see Set_Palette }; ,2 : {*** Not implemented yet, enable text display ***}; ,3 : {*** Not implemented yet, disable text display ***}; ,4 : {*** Not implemented yet, set all attributes to blink ***}; ,5 : {*** Not implemented yet, se4With Cur_Rec^, Y_Array[Rec_Count] Do 6Begin 8If Win_X_Org Mod Win_X_Res <> 0 Then :Begin  Main_Window^.Win_X_Size Then :Begin  Glob_X_Max Then :Begin  0)ackground, Planes_On, Replace); $If Kill_Cursor Then &Draw_Cursor (Cursor_X, Cursor_Y); " Core^.Draw_Result := Draw_OK; "End {of Erase}; " " " "Procedure Erase_Alpha; "Var Buffer : Packed Array [0..0] Of Char; "Begin $Buffer[0] := Chr (12); $Unitwrite (1, Buffer, 1); $Core^.Draw_Result := Draw_OK; "End {of Erase_Alpha}; "   {$N+} " "Procedure Set_Window {Window_Chain : Win_Rec_P}; "Var Cur_Rec : Win_Rec_P; " X_Size, &X_Start, &Rec_Count : Integer;      *Write ('Unexpected draw result ', Core^.Draw_Result, '; Hit [RETURN]'); *Ch := Read_Key ([Chr (CR)]); (End {of If Check_Result}; " Core^.Draw_Result := 9; {Just to see if it changes} "End {of Check_Result}; " " " "Function Do_Test (S : String) : Boolean; "Var Ch : Char; "Begin $Write ('Test ', S, ' (Y/N/Esc) ? '); $Ch := Read_Key (['y', 'Y', 'n', 'N', Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Do_Test := Ch In ['Y', 'y']; $Writeln (Ch); $If Ch In ['Y', 'y'] Then &Erase; $Erase_Alpha; $Goto_XY (0, 24); "End {of Do_Test}; " " " "Procedure Continue; "Var Ch : Char; "Begin $Write ('Type to continue'); $Ch := Read_Key ([Chr (CR), Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Erase_Alpha; $Goto_XY (0, 24); "End {of Continue}; " " " "Procedure Test_Cursor; " $Procedure Box_Cursor (Size : Integer); $Var I : Integer; $Begin &Size_Cursor (Size); &Check_Result ([Draw_OK, Draw_Clipped]); &For I := 0 To Core^.X_Max Do (Begin  $TAG $CURSOR $EQUAL $LAST $SYNTAX 1 2 3 4 "" " u S_ O.#ӧg*Move_Cursor (I, 0); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.Y_Max Do (Begin *Move_Cursor (Core^.X_Max, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (I, Core^.Y_Max); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.Y_Max Downto 0 Do (Begin *Move_Cursor (0, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.X_Max Do (Begin *Move_Cursor (I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (Core^.X_Max - I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &Continue; $End {of Box_Cursor}; $ "Begin {of Test_Cursor} $Set_Cursor (Cur_Enable); $Check_Result ([Draw_OK]); $Set_Cursor (Cur_Visible); $Check_Result ([Draw_OK, Draw_Clipped]); $Continue; $Box_Cursor (15);  Program Test_Core;  Uses {$U Grafdraw.Code} Graf_Draw;  Const Print_Errors = False; &Esc = 27; { Escape key }  CR = 13; { Return key } &Up_Key = 31; { Up arrow key } &Down_Key = 10; { Down arrow key } &Right_Key = 28; { Right arrow key } &Left_Key = 15; { Left arrow key }  BS_Key = 8; { Backspace key } &Home_Key = 25; { Home key }  Type Result_Set = Set Of Draw_OK..Draw_Max;  Char_Set = Set Of Char;  Var Font_ID : Font_Type; $Pat_ID : $Box_Cursor (30); $Box_Cursor (2000); " Set_Cursor (Cur_Invisible); $Check_Result ([Draw_OK]); $Set_Cursor (Cur_Small); $Check_Result ([Draw_OK]); $Move_Cursor (Succ (X_Max_2), Succ (Y_Max_2)); $Check_Result ([Draw_OK]); $Set_Cursor (Cur_Visible); $Check_Result ([Draw_OK, Draw_Clipped]); $Continue; $Set_Cursor (Cur_Disable); $Check_Result ([Draw_OK]); "End {of Test_Cursor};   " "Procedure Test_Line; "Var I : Integer; " X, &Y : Point_Array; "Begin $With Core^ Do &Begin (Line_InPat_Type;  Planes, $X_Max_2, $Y_Max_2, $Reg_X, $Reg_Y, $Reg_X_Size, $Reg_Y_Size : Integer;   "Function Read_Key (Allowed : Char_Set) : Char; "Var Ch : Char; &Hit_Digit : Boolean; &Move_Mult : Integer; &W : Win_Rec; "Begin $Move_Mult := 1; $Hit_Digit := False; $Repeat &Read (Keyboard, Ch); $ If Eoln (Keyboard) Then (Ch := Chr (CR); $ W := Core^.Window_List^; &With Core^.Window_List^ Do (Case Ord (Ch) Of *Down_Key : Win_Y_Org := Win_Y_Org + Move_Mult; dex := 1; (Set_Line_Style (On, On, Off, On, On, Off, On, On); (Check_Result ([Draw_OK]); (Overlay_Mode := Xor; (For I := Y_Min To Y_Max Div 4 Do *Begin ,Move_Abs (I * 2, I * 2); ,Check_Result ([Draw_OK]); ,Line_Abs (I * 2, Y_Max - I * 2); ,Check_Result ([Draw_OK]); ,Line_Abs (X_Max - I * 2, I * 2); ,Check_Result ([Draw_OK]); ,Line_Abs (X_Max - I * 2, Y_Max - I * 2); ,Check_Result ([Draw_OK]); ,Line_Abs (I * 2, I * 2); ,Check_Result ([Draw_OK]); *End {of For}; ( (Continue; *Up_Key : Win_Y_Org := Win_Y_Org - Move_Mult; *Right_Key : Win_X_Org := Win_X_Org - Move_Mult; *BS_Key, *Left_Key : Win_X_Org := Win_X_Org + Move_Mult; ( Home_Key : Begin 8Win_X_Org := 0; 8Win_Y_Org := 0; 6End {of Home_Key}; *48, 49, 50, {'0'..'9'} *51, 52, 53, *54, 55, 56, *57 : Begin 8If Not Hit_Digit Then :Move_Mult := 0; 8Move_Mult := Move_Mult * 10 + Ord (Ch) - Ord ('0'); 6 Hit_Digit := True; 6End {of '0'..'9'}; (End {of Case}; $ If W <> Core^.Window_List^ Then (Begi And (Pred (X_Start + X_Length) <= Glob_X_Max) Then *If (Y_Length > 0) And (Pred (Y_Start + Y_Length) <= Glob_Y_Max) Then ,Begin .If CSR_Is_Enabled And CSR_Is_Visible Then 0Draw_Cursor (Cursor_X, Cursor_Y); .X_CP := 0; .Y_CP := 0; .X_Max := Pred (X_Length); .Y_Max := Pred (Y_Length); .Region_X_Org := X_Start; .Region_Y_Org := Y_Start; .GR_Region (X_Start, Y_Start, X_Length, Y_Length); .Cursor_X := 0; .Cursor_Y := 0; .If CSR_Is_Enabled And CSR_Is_Visible Then 0Draw_Cursor (0, 0) .Else n *Hit_Digit := False; *Set_Window (Core^.Window_List); *If (Core^.Draw_Result <> Draw_OK) And Print_Errors Then ,Writeln (' Draw result on window movement was ', Core^.Draw_Result); *If Core^.Draw_Result >= Draw_Overflow Then ,Core^.Window_List^ := W; (End {of If W}; $Until Ch In Allowed; " Read_Key := Ch; "End {of Read_Key}; " " " "Procedure Check_Result (Expected : Result_Set); "Var Ch : Char; "Begin " If Not (Core^.Draw_Result In Expected) Then &If Print_Errors Then (Begin 0Draw_Result := Draw_OK; ,End {of If (Y_Length}; &End {of With}; "End {of Set_Region}; "  {$N^} "   { Ending of Graf.Misc Include File } " "       (Line_Index := Succ (Line_Index); (Move_Abs (X_Min, Y_Min); (Check_Result ([Draw_OK]); (For I := Y_Min To Y_Max Div 4 Do *Begin ,Line_Rel (0, Y_Max - 4 * I); ,Check_Result ([Draw_OK]); ,Line_Rel (X_Max - 4 * I, 0); ,Check_Result ([Draw_OK]); ,Line_Rel (0, -Y_Max + 4 * I); ,Check_Result ([Draw_OK]); ,Line_Rel (-X_Max + 4 * I, 0); ,Check_Result ([Draw_OK]); ,Move_Rel (2, 2); ,Check_Result ([Draw_OK]); *End {of For}; ( (Continue; (Line_Index := Succ (Line_Index); (Overlay_Mode := Replace; ,Check_Result ([Draw_OK]); ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Box_Rel (X_Max Div 3, Y_Max Div 3); ,Check_Result ([Draw_OK]); ,Move_Rel (0, -3); ,Check_Result ([Draw_OK]); ,Box_Rel (X_Max Div 3, -2); ,Check_Result ([Draw_OK]); ,Move_Rel (-3, 0); ,Check_Result ([Draw_OK]); ,Box_Rel (-2, -Y_Max Div 3); ,Check_Result ([Draw_OK]); ,Move_Rel (0, 3); ,Check_Result ([Draw_OK]); ,Box_Rel (-2, 2); ,Check_Result ([Draw_OK]); ,Continue; ,Erase; ,Check_Result ([Draw_OK]); ,Fil(For I := Y_Min To Y_Max Div 4 Do *Begin ,X[1] := X_CP; { Penup command } ,Y[1] := Y_CP; ,X[2] := I * 2; { Move_Abs (I * 2, I * 2) } ,Y[2] := I * 2; ,X[3] := I * 2; { Line_Abs (I * 2, Y_Max - I * 2) } ,Y[3] := Y_Max - I * 2; ,X[4] := X_Max - I * 2; { Line_Abs (X_Max - I * 2, I * 2) } ,Y[4] := I * 2; ,X[5] := X_Max - I * 2; { Line_Abs (X_Max - I * 2, } ,Y[5] := Y_Max - I * 2; { Y_Max - I * 2) } l_Index := Succ (Fill_Index) Mod 8; ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Box_Abs (X_CP + X_Max Div 3, Y_CP + Y_Max Div 3); ,Check_Result ([Draw_OK]); ,Move_Rel (0, -3); ,Check_Result ([Draw_OK]); ,Box_Abs (X_CP + X_Max Div 3, Y_CP - 2); ,Check_Result ([Draw_OK]); ,Move_Rel (-3, 0); ,Check_Result ([Draw_OK]); ,Box_Abs (X_CP - 2, Y_CP - Y_Max Div 3); ,Check_Result ([Draw_OK]); ,Move_Rel (0, 3); ,Check_Result ([Draw_OK]); ,Box_Abs (X_CP - 2, Y_CP + 2); ,X[6] := I * 2; { Line_Abs (I * 2, I * 2) } * Y[6] := I * 2; * PLine_Abs (X, Y, 6); ,Check_Result ([Draw_OK]); *End {of For}; ( (Continue; (Line_Index := Succ (Line_Index); (Overlay_Mode := Xor; (Move_Abs (X_Min, Y_Min); (Check_Result ([Draw_OK]); (For I := Y_Min To Y_Max Div 4 Do *Begin ,X[1] := 0; { Line_Rel (0, Y_Max - 4 * I) } ,Y[1] := Y_Max - 4 * I; ,X[2] := X_Max - 4 * I; { Line_Rel (X_Max - 4 * I, 0) } ,Y[2] := 0; ,X[3] := 0; { L,Check_Result ([Draw_OK]); *End {of With}; &End {of Draw_Boxes}; & $Procedure Test_Clipping (Int : Int_Type); $Begin &With Core^ Do (Begin *Polygon_Interior := Int; *Continue; *Erase; *Check_Result ([Draw_OK]); *Move_Abs (X_Max - 10, Y_Max - 10); *Check_Result ([Draw_OK]); *Box_Rel (11, 11); *Check_Result ([Draw_Clipped]); *Move_Abs (X_Max - 10, 10); *Check_Result ([Draw_OK]); *Box_Rel (11, -11); *Check_Result ([Draw_Clipped]); *Move_Abs (10, 10); *Check_Result ([Draw_OK]); *Box_Rel (ine_Rel (0, -Y_Max + 4 * I) } ,Y[3] := -Y_Max + 4 * I; ,X[4] := -X_Max + 4 * I; { Line_Rel (-X_Max + 4 * I, 0) } ,Y[4] := 0; ,X[5] := 0; { Penup command} ,Y[5] := 0; ,X[6] := 2; { Move_Rel (2, 2) } ,Y[6] := 2; * PLine_Rel (X, Y, 6); ,Check_Result ([Draw_OK]); *End {of For}; (Continue;  (Erase; (Check_Result ([Draw_OK]); (Set_Line_Style (On, On, On, On, On, On, On, On); (Check_Result ([Draw_OK]); (Overlay_Mode := Replace; (Line_Index := 0; -11, -11); *Check_Result ([Draw_Clipped]); *Move_Abs (10, Y_Max - 10); *Check_Result ([Draw_OK]); *Box_Rel (-11, 11); *Check_Result ([Draw_Clipped]); (End {of With}; $End {of Test_Clipping}; $ "Begin {of Test_Box} $With Core^ Do $ Begin (Line_Index := 1; (Set_Line_Style (On, On, Off, On, On, Off, On, On); (Check_Result ([Draw_OK]); (Overlay_Mode := Xor; ( (Move_Abs (X_Max_2, Y_Max_2); (Box_Rel (X_Max_2, Y_Max_2); (Check_Result ([Draw_OK]); (Continue; (Box_Rel (-(X_Max_2), Y_Max_2); (For I := -1 To Succ (X_Max) Do *Begin ,Line_Index := Succ (Line_Index) Mod 8; ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Line_Abs (Round (Glob_X_Max / Glob_Y_Max * I), Succ (Y_Max)); ,Check_Result ([Draw_Clipped]); ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Line_Abs (Round (Glob_X_Max / Glob_Y_Max * I), -1); ,Check_Result ([Draw_Clipped]); *End {of For}; (For I := -1 To Succ (Y_Max) Do *Begin ,Line_Index := Succ (Line_Index) Mod 8; ,Move_Abs (X_Max_2, Y_Max_2);(Check_Result ([Draw_OK]); (Continue; (Box_Rel (-(X_Max_2), -(Y_Max_2)); (Check_Result ([Draw_OK]); (Continue; (Box_Rel (X_Max_2, -(Y_Max_2)); (Check_Result ([Draw_OK]); (Continue; (Box_Rel (X_Max_2, Y_Max_2); (Check_Result ([Draw_OK]); (Box_Rel (-(X_Max_2), Y_Max_2); (Check_Result ([Draw_OK]); (Box_Rel (-(X_Max_2), -(Y_Max_2)); (Check_Result ([Draw_OK]); (Box_Rel (X_Max_2, -(Y_Max_2)); (Check_Result ([Draw_OK]); ( (Continue; (For I := Y_Min To Y_Max Div 4 Do *Begin ,Move_Abs (I * 2, I  ,Check_Result ([Draw_OK]); ,Line_Abs (Succ (X_Max), Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_Clipped]); ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Line_Abs (-1, Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_Clipped]); *End {of For}; Continue;  (Overlay_Mode := Xor; (Line_Index := 0; (For I := 1 To Pred (X_Max) Do *Begin ,Line_Index := Succ (Line_Index) Mod 8; ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); * 2); ,Check_Result ([Draw_OK]); ,Box_Abs (X_Max - I * 2, Y_Max - I * 2); ,Check_Result ([Draw_OK]); ,Line_Index := Succ (Line_Index) Mod 8; *End {of For}; ( (Continue; (Set_Line_Style (On, On, On, On, On, On, On, On); (Check_Result ([Draw_OK]); (For I := Y_Min To Y_Max Div 4 Do *Begin ,Move_Abs (I * 2, I * 2); ,Check_Result ([Draw_OK]); ,Box_Rel (X_Max - I * 4, Y_Max - I * 4); ,Check_Result ([Draw_OK]); ,Line_Index := Succ (Line_Index) Mod 8; *End {of For}; & &Fill_Index := 0; ,Line_Abs (Round (Glob_X_Max / Glob_Y_Max * I), Pred (Y_Max)); ,Check_Result ([Draw_OK]); ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Line_Abs (Round (Glob_X_Max / Glob_Y_Max * I), 1); ,Check_Result ([Draw_OK]); *End {of For}; (For I := 1 To Pred (Y_Max) Do *Begin ,Line_Index := Succ (Line_Index) Mod 8; ,Move_Abs (X_Max_2, Y_Max_2); ,Check_Result ([Draw_OK]); ,Line_Abs (Pred (X_Max), Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_OK]); ,Move_Abs (X_Max_2, Y_Max_2); &Line_Index := 5; &Overlay_Mode := Replace; &Draw_Boxes (Fast, Plain, Solid_Line); &Draw_Boxes (Fast, Plain, Interior); &Draw_Boxes (Fast, Patterned, Solid_Line); &Draw_Boxes (Fast, Patterned, Interior); &Draw_Boxes (Fill, Plain, Solid_Line); &Draw_Boxes (Fill, Plain, Interior); &Draw_Boxes (Fill, Patterned, Solid_Line); &Draw_Boxes (Fill, Patterned, Interior); , &Polygon_Edge := Solid_Line; &Fill_Index := 1; &Test_Clipping (Plain); &Test_Clipping (Patterned); $ &Continue; &Erase; &Check_,Check_Result ([Draw_OK]); ,Line_Abs (1, Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_OK]); *End {of For};  &End {of With}; "End {of Test_Line};    "Procedure Test_Box; "Var I : Integer; & &Procedure Draw_Boxes (Display : Display_Type; ?@ABCDEFGHIJKLMNO'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; , ,Move_Abs (Start_X + Font_Cols *Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max Div 20 + 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (Y_Max Div 20 - 3, Y_Max Div 20 - 3, Y_Max Div 10); *Clip_Circle (Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10);  24 * Mag, 6Start_Y - (24 * Font_Cols + Font_Rows) * Mag); ,Char_Path := Left; ,Top_Bottom := Bottom; ,Left_Right := Right; ,Set_Charup (0, -1); ,Text ('PQRSTUVWXYZ[\]^_`abcdefg'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; 4 ,Move_Abs (Start_X - Font_Rows * Mag, 6Start_Y - 24 * Font_Cols * Mag); ,Char_Path := Up; ,Top_Bottom := Bottom; ,Left_Right := Left; ,Set_Charup (-1, 0); ,S := 'hijklmnopqrstuvwxyz{|}~ ';  S[Length(S)] := Chr (127); ,Text (S); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max Div 20 - 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, 0, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, 0, Succ (X_Max)); (End {of With}; $End {of Do_Circles};   $Procedure Circle_Groups (Ovl,Text_Index := Succ (Text_Index) Mod 8; ,Continue; * *End {of For}; $End {of Test_Rotations}; & & " $Procedure Test_Direction (Dir : Direction); $ &Procedure Test_Position (Horiz, Vert : Directions); &Var Horiz_Name, *Vert_Name : String; &Begin (Case Horiz Of *Left : Horiz_Name := 'Left - '; *Center : Horiz_Name := 'Center - '; *Right : Horiz_Name := 'Right - '; (End {of Case}; (Case Vert Of *Top : Vert_Name := 'Top'; *Center : Vert_Name := 'Center'; *Bottom : Vert_Name :=y : Overlay_Type); $Var Disp : Display_Type; (Int : Int_Type; (Edge : Edge_Type; (Radius, (I : Integer; $Begin $ With Core^ Do (Begin *Char_Spacing := 0; *Char_Width := X_Max Div 20; *Char_Height := Y_Max Div 32; *Char_Path := Right; *Top_Bottom := Bottom; *Left_Right := Left; *Set_Charup (0, 1); *Check_Result ([Draw_OK]); *Overlay_Mode := Ovly; *Radius := Succ (Y_Max) Div 17; *Fill_Index := 5; *Line_Index := 1; *Text_Index := 1; *Move_Abs (Radius, Radius);  'Bottom'; (End {of Case}; (Core^.Top_Bottom := Vert; (Core^.Left_Right := Horiz; (Text (Concat (Horiz_Name, Vert_Name)); (Core^.Text_Index := Succ (Core^.Text_Index) Mod 8; (Continue; &End {of Test_Position}; $ $ $Begin {of Test_Direction} $ Core^.Char_Path := Dir; &Test_Position (Left, Bottom); &Test_Position (Left, Center); &Test_Position (Left, Top); &Erase; &Test_Position (Center, Bottom); &Test_Position (Center, Center); &Test_Position (Center, Top); &Erase; *Check_Result ([Draw_OK]); *For Int := Plain To Patterned Do ,For Edge := Solid_Line To Interior Do .For Disp := Fast To Fill Do 0Begin 0 Display_Mode := Disp; 2Polygon_Interior := Int; 2Polygon_Edge := Edge; 0 For I := 0 To 7 Do 0 Begin 4 Circle_Rel (Radius); 6Check_Result ([Draw_OK]); 6Move_Rel (Radius, 0); 6Check_Result ([Draw_OK]); 6Fill_Index := Succ (Fill_Index) Mod 8; 6Line_Index := Succ (Line_Index) Mod 8; 4End {of For I}; 2If Disp = Fast Then 4Text (' Fast, ') 2Else 4TextResult ([Draw_OK]); &Display_Mode := Fill; &Polygon_Interior := Plain; &Polygon_Edge := Interior; &Fill_Index := 1; &For I := 0 To Y_Max Div 30 Do & Begin ( Move_Abs (I * 15, I * 15); *Check_Result ([Draw_OK]); *Box_Rel (Y_Max - I * 30, Y_Max - I * 30); *Check_Result ([Draw_OK]); *Fill_Index := Succ (Fill_Index) Mod 8; (End {of For}; ( $End {of With}; & "End {of Test_Box}; "  "Procedure Test_Circle; $ $Procedure Do_Circles (Disp : Display_Type; Int : Int_Type); $Var I : Integer;  (' Fill, '); 2Check_Result ([Draw_OK]); 2Move_Rel (0, -Char_Height); 2Check_Result ([Draw_OK]); 2If Edge = Solid_Line Then 4Text (' Solid, ') 2Else 4Text (' Trace, '); 2Check_Result ([Draw_OK]); 2Move_Rel (0, -Char_Height); 2Check_Result ([Draw_OK]); 2If Int = Plain Then 4Text (' Plain') 2Else 4Text (' Patterned'); 2Check_Result ([Draw_OK]); 2Text_Index := Succ (Text_Index) Mod 8; 2If Text_Index = Background Then 4Text_Index := Succ (Text_Index) Mod 8; * &Procedure Clip_Circle (X, Y, R : Integer); &Begin (Move_Abs (X, Y); (Check_Result ([Draw_OK]); (Circle_Rel (R); (Check_Result ([Draw_Clipped]); &End {of Clip_Circle}; ( $Begin {of Do_Circles} &With Core^ Do (Begin *Display_Mode := Disp; *Polygon_Interior := Int; *Polygon_Edge := Solid_Line; *Line_Index := 1; *Fill_Index := 1; *Move_Abs (X_Max_2, Y_Max_2); *Check_Result ([Draw_OK]); *Overlay_Mode := Xor; * *For I := 0 To Y_Max Div 32 Do ,Begin .Circle_Abs (X_CP + I * 16, Y_CP); .C     &Test_Position (Right, Bottom); &Test_Position (Right, Center); &Test_Position (Right, Top); &Erase; $End {of Test_Direction}; $ $ " "Begin {of Test_Text} " With Core^ Do &Begin (Char_Spacing := 0; (Text_Index := 1; (Char_Width := Font_Cols * 2; (Char_Height := Font_Rows * 1; (Set_Cursor (Cur_Enable); (Set_Cursor (Cur_Visible); (Move_Abs (X_Max_2, Y_Max_2); (Move_Cursor (X_Max_2, Y_Max_2); (Test_Direction (Right); (Test_Direction (Left); (Test_Direction (Up); (Test_Direction (Down); &Arc_Rel (Radius, Start_Angle + PI_2, End_Angle + PI_2, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Continue; &Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; &If Core^.Line_Index = Core^.Background Then (Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; &Erase; &Check_Result ([Draw_OK]); $End {of Clip_Test}; $ "Begin {of Arc_Test} $Combo_Radius := Core^.Y_Max Div 17; $Set_Line_Style (On, On, On, On, On, On, On, On); $Check_Result ([Draw_OK]); $Core^.Polygon_Edge :(Set_Cursor (Cur_Disable); (Erase_Alpha; (Test_Rotations; &End {of With}; "End {of Test_Text}; " " Procedure Test_Flood; "Begin $Set_Line_Style (On, On, On, On, On, On, On, On); $Check_Result ([Draw_OK]); $With Core^ Do &Begin (Overlay_Mode := Replace; (Display_Mode := Fill; (Line_Index := 6; ( (Move_Abs (0, Y_Max Div 5 * 3); {Draw upper zig zag} (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); = Solid_Line; $Core^.Overlay_Mode := Replace; $For I := 0 To 7 Do &For J := 0 To 7 Do (Begin *Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *If Core^.Line_Index = Core^.Background Then ,Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *Move_Abs (J * (Core^.X_Max Div 8) + Combo_Radius, 4I * (Core^.Y_Max Div 8) + Combo_Radius); *Check_Result ([Draw_OK]); *Arc_Rel (Combo_Radius, I * PI_8, J * PI_8, 3X_Start, Y_Start, X_End, Y_End); *Check_Result ([Draw_OK]); (End {of For J}; $Continue; (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (X_Max Div 6, -(Y_Max Div 5)); (Check_Result ([Draw_OK]); ( (Move_Rel (0, -Y_Max Div 5); {Draw lower zig zag} (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y$Erase; $Check_Result ([Draw_OK]); $Core^.Overlay_Mode := Xor; $For I := 0 To 7 Do &For J := 0 To 7 Do (Begin *Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *If Core^.Line_Index = Core^.Background Then ,Core^.Line_Index := Succ (Core^.Line_Index) Mod 8; *Move_Abs (J * (Core^.X_Max Div 8) + Combo_Radius, 4I * (Core^.Y_Max Div 8) + Combo_Radius); *Check_Result ([Draw_OK]); *Arc_Rel (Combo_Radius, PI_x2 / (J + 1), I * PI_8, 3X_Start, Y_Start, X_End, Y_End); *Check_Result ([Draw_OK]); (End_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y_Max Div 5); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), -(Y_Max Div 5)); (Check_Result ([Draw_OK]); (Line_Rel (-(X_Max Div 6), Y_Max Div 5); (Check_Result ([Draw_OK]); ( (Polygon_Interior := Patterned; {Draw circles} (Overlay_Mode := Replace; (Polygon_Edge := Interior; (Move_Abs (X_Max_2 Div 3, Y_Max_2); (Check_Result ([Draw_OK]);  {of For J}; $Continue; $Erase; $Check_Result ([Draw_OK]); $Clip_Test (Core^.Y_Max Div 24, PI_x3_4, -PI_x3_4); $Clip_Test (Core^.Y_Max Div 12, PI_x3_4, -PI_2); $Clip_Test (Core^.Y_Max Div 8, PI_2, -PI_x3_4); $Clip_Test (Core^.Y_Max Div 6, PI_2, -PI_2); $ $Move_Abs (Core^.Y_Max Div 6, Y_Max_2); $Check_Result ([Draw_OK]); $Core^.Line_Index := 2; $Pac_X_Open := Core^.X_Max Div 12; $Pac_Y_Open := Core^.Y_Max Div 9; $Pac_X_Closed := Core^.X_Max Div 10; $Pac_Y_Closed := Core^.Y_Max Div 18; (Line_Index := 2; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); (Move_Rel (X_Max Div 3, 0); (Check_Result ([Draw_OK]); (Line_Index := 4; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); (Move_Rel (X_Max Div 3, 0); (Check_Result ([Draw_OK]); (Line_Index := 6; (Circle_Rel (Y_Max Div 8); (Check_Result ([Draw_OK]); ( (Polygon_Interior := Plain; (Fill_Index := 2; {Fill pattern} (Move_Abs (X_Max_2, Y_Max Div 8 * 5 + 7); (Check_Result ([Draw_OK]); (Flo$Open_Mouth := True; $Repeat &If Open_Mouth Then (Arc_Abs (Radius, Start_Angle, End_Angle, 1Core^.X_CP + Pac_X_Open, Core^.Y_CP - Pac_Y_Open, 1Core^.X_CP + Pac_X_Open, Core^.Y_CP + Pac_Y_Open) &Else (Arc_Abs (Radius, Start_Angle, End_Angle, 1Core^.X_CP + Pac_X_Closed, Core^.Y_CP - Pac_Y_Closed, 1Core^.X_CP + Pac_X_Closed, Core^.Y_CP + Pac_Y_Closed); &Open_Mouth := Not Open_Mouth; &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle, End_Angle, /X_Start, Y_Start, X_End, Y_End); &Check_Reod; (Check_Result ([Draw_OK]); (Continue; (Flood; (Check_Result ([Draw_OK]); (Continue; (Fill_Index := 3; (Overlay_Mode := Xor; (Flood; (Check_Result ([Draw_OK]); &End {of With}; "End {of Test_Flood}; $ " "  Procedure Test_Arcs; "Const PI_8 = 0.39269907; (PI_4 = 0.78539815; (PI_2 = 1.5707963; (PI = 3.1415926278; (PI_x2 = 6.2831852; (PI_x3_2 = 4.7123889; (PI_x3_4 = 2.3561944; (PI_x7_4 = 5.497787; (PI_x5_4 = 3.9269907; "Var X_Start, &Y_Start, &X_End, &Y_End, &Pac_X_Open, sult ([Draw_OK]); &Move_Rel (Core^.X_Max Div 22, 0); &Check_Result ([Draw_OK]); " Until Core^.X_CP + Radius >= Core^.X_Max; "End {of Test_Arcs};    "Procedure Test_Block; " $Procedure Breakup (X, Y, Side_Length, Level : Integer); $Type Color_Array = Packed Array [0..30000] Of Color_Index; $Var New_Length : Integer; (Pattern : Record 7Case Integer Of 90 : (S : Sorcery); 91 : (P : ^Color_Array); 5End {of Pattern}; $ &Pac_Y_Open, &Pac_X_Closed, &Pac_Y_Closed, &Combo_Radius, &Radius, &J, &I : Integer; &Open_Mouth : Boolean; &Start_Angle, &End_Angle : Real; " $Procedure Clip_Test (Radius : Integer; Start_Angle, End_Angle : Real); $Var Start_X, (Start_Y, (End_X, (End_Y : Integer; $Begin &Move_Abs (Core^.X_Max Div 64, Y_Max_2); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle, End_Angle, Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (X_Max_2, Core^.Y_&Procedure Draw_Section (Sect_X, Sect_Y, X_Offset, Y_Offset : Integer); &Begin (Move_Abs (Sect_X, Sect_Y); (Check_Result ([Draw_OK]); (Read_Block_Pixels (Pattern.S, New_Length, New_Length); (Check_Result ([Draw_OK]); (Move_Rel (X_Offset * New_Length, Y_Offset * New_Length); (Check_Result ([Draw_OK]); (Write_Block_Pixels (Pattern.S, New_Length, New_Length); (Check_Result ([Draw_OK]); (If Level > 0 Then *Breakup (Sect_X + X_Offset * New_Length, 3Sect_Y + Y_Offset * New_Length, New_Length, Pred (Max - Core^.X_Max Div 64); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle + PI_x3_2, End_Angle + PI_x3_2, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (Core^.X_Max - Core^.X_Max Div 64, Y_Max_2); &Check_Result ([Draw_OK]); &Arc_Rel (Radius, Start_Angle + PI, End_Angle + PI, /Start_X, Start_Y, End_X, End_Y); &Check_Result ([Draw_Clipped]); &Move_Abs (X_Max_2, Core^.X_Max Div 64); &Check_Result ([Draw_OK]);       "Writeln ('Global space at (', Core^.Glob_X_Min, ', ', Core^.Glob_Y_Min, +') to (', Core^.Glob_X_Max, ', ', Core^.Glob_Y_Max, ')'); "With Core^.Window_List^ Do $Writeln ('Display at (', Win_X_Org, ', ', Win_Y_Org, ') to (', -Pred (Win_X_Org + Win_X_Size), ', ', -Pred (Win_Y_Org + Win_Y_Size), ')'); "Writeln ('Clipping region at (', Core^.X_Min, ', ', Core^.Y_Min, +') to (', Core^.X_Max, ', ', Core^.Y_Max, ')'); "Write ('Clipping region lower left corner (X, Y) ? '); "Readln (Reg_X, Reg_Y); "Wriger; " Old_Window, &Window : Win_Rec_P; "Begin $With Core^ Do &Begin (Old_Window := Window_List; ({Set_Window (Nil); (Check_Result ([Draw_OK]);} ( (Char_Width := Font_Cols; (Char_Height := Font_Rows; (Char_Spacing := 0; (Char_Path := Right; (Set_Charup (0, 1); (Check_Result ([Draw_OK]); (Top_Bottom := Bottom; (Left_Right := Center; (Move_Abs (X_Max Div 2, 0); (Check_Result ([Draw_OK]); (Text_Index := Succ (Background_Index) Mod 8; (Text ('Hi, mom!'); (Check_Result ([Draw_OK]); ( te ('Clipping region size (X'', Y'') ? '); "Readln (Reg_X_Size, Reg_Y_Size); "Set_Region (Reg_X, Reg_Y, Reg_X_Size, Reg_Y_Size); "Check_Result ([Draw_OK]); "Erase; "Check_Result ([Draw_OK]); "Erase_Alpha; "Check_Result ([Draw_OK]); "Goto_XY (0, 24); "X_Max_2 := Core^.X_Max Div 2; "Y_Max_2 := Core^.Y_Max Div 2; "If Do_Test ('Cursor') Then $Test_Cursor;  If Do_Test ('Line') Then $Test_Line; If Do_Test ('Box') Then $Test_Box; "If Do_Test ('Text') Then $Test_Text; (Overlay_Mode := Replace; (Line_Index := Succ (Background_Index) Mod 8; (Move_Rel (0, 0); (Check_Result ([Draw_OK]); (New (Window); (New (Window^.Next_Window); (Window^.Win_X_Org := 0; (Window^.Win_Y_Org := Char_Height; (Window^.Disp_X_Org := 0; (Window^.Disp_Y_Org := Char_Height; (Window^.Win_X_Size := Window_List^.Win_X_Size; (Window^.Win_Y_Size := Window_List^.Win_Y_Size - Char_Height; (With Window^.Next_Window^ Do *Begin ,Next_Window := Nil; ,Win_X_Org := 0; ,Win_Y_Org := 0; ,Disp_X_Or If Do_Test ('Circle') Then $Test_Circle; "If Do_Test ('Block') Then $Test_Block; "If Do_Test ('Area Fill') Then $Test_Flood; "If Do_Test ('Arc') Then $Test_Arcs; "If Do_Test ('Windows') Then $Test_Windows; "Continue; "Erase_Alpha;  End {of Test_Core}. g := 0; ,Disp_Y_Org := 0; * Win_X_Size := Window_List^.Win_X_Size; ,Win_Y_Size := Char_Height; *End {of With Window}; (Set_Region (Region_X_Org, Region_Y_Org + Char_Height, 4Succ (X_Max), Succ (Y_Max - Char_Height)); (Check_Result ([Draw_OK]); ( (For I := 0 To 19 Do *Begin ,Move_Abs (I * X_Max Div 20, 0); ,Check_Result ([Draw_OK]); ,Line_Rel (0, Y_Max); ,Check_Result ([Draw_OK]); *End {of For}; (For I := 0 To 19 Do *Begin ,Move_Abs (0, I * Y_Max Div 20); ,Check_Result ([Draw_OK]); ,Line_Rel (X_Max, 0); ,Check_Result ([Draw_OK]); *End {of For}; (Display_Mode := Fill; (Fill_Index := Succ (Background_Index) Mod 8; (Polygon_Interior := Plain; (Polygon_Edge := Interior; (For I := 0 To 19 Do *For J := 0 To 19 Do ,Begin .Move_Abs (I * X_Max Div 20, J * Y_Max Div 20); .Check_Result ([Draw_OK]); .Circle_Rel (Y_Max Div 50); .Check_Result ([Draw_OK, Draw_Clipped]); .Fill_Index := Succ (Fill_Index) Mod 8; .If Fill_Index = Background_Index Then 0Fill_Index := Succ (Fill_Index) Mo$CURSOR $EQUAL $TAG  G.Wӧd 8; ,End {of For J}; ( (For I := Region_Y_Org To Succ (Glob_Y_Max - Window^.Win_Y_Size) Do ( Begin * Window^.Win_Y_Org := I; ,Set_Window (Window); ,If Window^.Win_Y_Org Mod Win_Y_Res = 0 Then .Check_Result ([Draw_OK]) ,Else .Check_Result ([Draw_Clipped]); *End {of For}; (For I := Region_X_Org To Succ (Glob_X_Max - Window^.Win_X_Size) Do ( Begin ,Window^.Win_X_Org := I; ,Set_Window (Window); ,If Window^.Win_X_Org Mod Win_X_Res = 0 Then .Check_Result ([Draw_OK]) ,Else .Check_Result ([Draw_Clipped]); *End {of For}; ( (Continue; (Window^.Win_X_Org := Region_X_Org; (For I := 0 To 5 Do ( For J := 0 To 7 Do ,Begin .Window^.Win_Y_Org := J * Y_Max Div 20; .Set_Window (Window); ,End {of For J}; ( (Continue; (Set_Region (Region_X_Org, Region_Y_Org - Char_Height, 4Succ (X_Max), Succ (Y_Max + Char_Height)); (Check_Result ([Draw_OK]); (Set_Window (Old_Window); (Check_Result ([Draw_OK]); (Dispose (Window^.Next_Window); (Dispose (Window); &End {of With}; "End {oLevel)); &End {of Draw_Section}; & $Begin {of Breakup} &New_Length := Side_Length Div 2; &If Var_New (Pattern.P, New_Length * ((New_Length + 3) Div 4)) <> 0 Then; &Draw_Section (X, Y, -2, -2); &Draw_Section (X, Y + Side_Length - New_Length, -2, 2); &Draw_Section (X + Side_Length - New_Length, Y, 2, -2); &Draw_Section (X + Side_Length - New_Length, Y + Side_Length - New_Length, 42, 2); &Var_Dispose (Pattern.P, New_Length * ((New_Length + 3) Div 4)); $End {of Breakup}; $ " f Test_Windows}; $ $  Begin {of Test_Core} "Check_Result ([Draw_Init]); "Goto_XY (0, 24); "Write ('Background color ? '); "Readln (Core^.Background); "Write ('Pattern number ? '); "Readln (Pat_ID); "Set_Fill_Pattern (Pat_ID); "Check_Result ([Draw_OK]); "Write ('Font number ? '); "Readln (Font_ID); "Set_Font (Font_ID); "Check_Result ([Draw_OK]); "Write ('Planes enabled ? '); "Readln (Planes); "Plane_Enable (Planes); "Check_Result ([Draw_OK]); "Begin {of Test_Block} $With Core^ Do &Begin (Display_Mode := Fill; (Overlay_Mode := Xor; (Polygon_Interior := Patterned; (Polygon_Edge := Interior; (Move_Abs (X_Max_2 - (Y_Max Div 5), 2Y_Max_2 - (Y_Max Div 5)); (Check_Result ([Draw_OK]); (Box_Rel (Succ (Y_Max Div 5), Succ (Y_Max Div 5)); (Check_Result ([Draw_OK]); (Move_Rel (1, 1); (Check_Result ([Draw_OK]); (Breakup (X_CP, Y_CP, Y_Max Div 5, 1); &End {of With}; "End {of Test_Block}; $ $ "Procedure Test_Windows; "Var J, &I : Inte         Dear George,  #This is the documentation for the graphics disk I sent you last   week. It is organized as a list of changes to the existing routines   and exposition of the new routines. In addition, the assembly procedure   and the disk contents are described. Please review this to make sure   there are no typos nor transmission errors. If there are any omissions   or ambiguities, please let me know so that I may correct them.    Please make the following substitution *| | | | *| ____________________________ | *| [X_Start, Y_Start] | *| or (0, 0) | *|-------------------------------------------------| ([0, 0] 1[x, y] are global coordinates 1(x, y) are viewport coordinates 1 1 &In the example above, the global space is the 1024 by 1024 &rectangle. A viewport is defined at (X_Start, Y_Start) relative &to the global space. The viewpin the Graftest program. # # # # "Procedure Check_Result (Expected : Result_Set); "Var Ch : Char; "Begin " If Not (Core^.Draw_Result In Expected) Then &If Print_Errors Then (Begin *Write ('Unexpected draw result ', Core^.Draw_Result, 1'; Hit [RETURN]'); *Ch := Read_Key ([Chr (CR)]); (End {of If Check_Result}; " Core^.Draw_Result := 9; {Just to see if it changes} "End {of Check_Result}; " # PThanks, P P PBarry P P P  I Graphics Features  -------------------- $ ort is X_Length pixels wide and &Y_Length pixels high. & &Any operations attempting to draw outside of the current viewport &are clipped and a Draw_Clipped status is returned as the &Draw_Result. Generally, clipping is performed so that the figure &actually drawn appears exactly as it would have if no clipping &were performed, except that it is truncated at the viewport &boundaries. The exception to this rule is text. Text erased &using the Erase_Alpha procedure and text written to the screen &The August, 1983 graphics upgrade (version 0.5) contains four &major features: viewport and window facilities, draw statuses, &correct (and faster) arc clipping and color masking, and XOR in &conjunction with TEXT drawing. & &  I.1 Viewports and Windows  --------------------------  &The NEC APC is capable of drawing in a 1024 by 1024 pixel, 3 plane &graphics space and displaying a 640 by 480 pixel subset. The &GRAFDRAW unit defines a global coordinate space with dimensions &1024 by 1024 pix&using the Pascal and Unit I/O procedures is neither associated &with, nor constrained to a viewport. In addition, a character &written using the Text procedure is drawn only if the character &fits entirely within the viewport. & &Note that in addition to allowing drawing in a much larger &graphics space than is actually displayed, a viewport may also be &declared to be very small. This allows multiple zero-based &graphics spaces. It also provides a method of flooding subsets of ®ions. +  els. A rectangular subset of the global space may &be defined as the current working drawing region (called a &viewport). Another (possibly coincident) rectangular subset of &the global space may be defined as the currently displayed region &(called a window). & &In order to make applications using the GRAFDRAW unit portable, &Core variables have been added to indicate the size of the global &coordinate space. The variables Glob_X_Min and Glob_Y_Min are  I.1.2 Windows  -------------- $ &Windows are related to viewports only in that they are declared in &the same global coordinate space. While viewports are spaces in &which drawing can occur, windows are subsets of the global &coordinate space which the display hardware actually displays on &the screen. Windows may or may not be coincident with viewports. & &Windows are defined by calling the Set_Window procedure. The &Set_Window procedure accepts a pointer to a linked list of window &always set to zero. The variables Glob_X_Max and Glob_Y_Max are &set to the maximum global X and Y coordinates, respectively. Both &are 1023 for the NEC APC implementation. &   I.1.2 Viewports  ---------------- & &A viewport is defined using the Set_Region procedure. The &Set_Region procedure accepts four parameters: the global X and Y &coordinates of the viewport's lower left corner (X_Start and &Y_Start), and the number of pixels in the X and Y directions &(X_Length and Y_Length). & &records as a parameter. Each window record defines the global &coordinates of a window in the drawing space, its coordinates on &the physical screen and the window's size. The global coordinates &within the drawing space specify the lower left corner of the &window. The physical screen coordinates specify the location of &the lower left corner of the image on the display screen (assuming &the lower left corner is (0, 0)). The window's size is specified &by the number of pixels in the horizontal&All coordinates used in subsequent graphic operations are &interpreted relative to the viewport's lower left corner. As a &result of a call to Set_Region, the current position (X_CP, Y_CP) &and the cursor position are set to (0, 0) and the cursor is &disabled. In addition, the Core variables X_Max and Y_Max are set &to the viewport-relative coordinates of the upper right corner of &the viewport (i.e. (X_Length-1,Y_Length-1)). The Core variables  and vertical directions. &The record is declared as follows: ' -Win_Rec_P = ^Win_Rec; -Win_Rec = Record ?Next_Window : Win_Rec_P; { Link to next rec } ?Win_X_Org, { Global drawspace } ?Win_Y_Org, { coordinates } ?Disp_X_Org, { Display screen } ?Disp_Y_Org, { coordinates } ?Win_X_Size, { Window size } ?Win_Y_Size : Point; =End {of Win_Rec}; ' &Region_X_Org and Region_Y_Org are set to the global coordinates of &the viewport origin (X_Start and Y_Start, respectively). The &default viewport starts at (0, 0) relative to the global space and &is 640 pixels horizontally and 480 pixels vertically. & &A viewport may be of any size between 1-by-1 and 1024-by-1024. &However, a viewport must be contained entirely within the global &space. Attempts to define a viewport outside of this space or &attempts to move either the current position or the&The Core variable Window_List initially points to a window record &that declares a window at (0, 0) in the global coordinate space &and (0, 0) on the display screen for the entire display screen &(640 pixels horizontally and 480 pixels vertically). & & ,Global Coordinates Physical Display -(Drawing space) *|------------------| |----------| *| |-----| | | | *| | |=====================>| | *| |_____| | |...... cursor out of &the viewport are ignored and a Draw_Result of Draw_Overflow is &returned (see section I.2). & *|-------------------------------------------------| [1023, 1023] *| | *| (X_Length-1, Y_Length-1) | *| ---------------------------- | *| | | | *| | | | *| | | | !     &Draw_Max result is provided to aid in defining draw result &subranges even as new draw results are added. The current draw &results are summarized below: & ( (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state}  (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (Draw_Not_Found = 12; {Draw ignored, filepable of &horizontally-split screen display. In addition, all 480 rows of &the display must be allocated among the declared windows. &Finally, no windows may be declared to overlap. Attempts to &violate of any of these constraints cause an entire Set_Window &call to be ignored and a Draw_Win_Imp status to be returned as the &Draw_Result. & &The NEC APC is capable of setting a window boundary on 16-pixel &(word) boundaries in the global coordinate space instead of on any  not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} (Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} ( (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( (  I.3 Arc Drawing and Color Masking  ----------------------------------  &Previous releases of the GRAFDRAW unit contained flawed algorithms &pixel. The Core variables Win_X_Res and Win_Y_Res give the window &resolutions for X and Y coordinates, respectively. For the NEC &APC, the Win_X_Res is 16 and the Win_Y_Res is 1. Attempts to &declare a window having a global X or Y coordinate that is not &divisible by the respective resolution factor causes the &coordinate to be truncated toward the lower legal value and a &Draw_Result of Draw_Clipped to be returned. In addition, attempts &to declare a window that extends beyond the highest gl&for arc clipping and color masking. The arc clipping algorithms &caused arcs to be drawn beyond the bounds of the current viewport. &However, since the pervious releases equated the current viewport &and display window to the entire screen, the flaws were &unnoticable. In the current versions, the arc clipping algorigthms &do not use trigonometric functions and hence are not subject to &the sluggishness and roundoff problems of prior versions. &Additionally, arcs clipped at the top of screen oftenobal &coordinate space row or physical display row causes the window to &be truncated to fit in both coordinate systems and a Draw_Result &of Draw_Clipped to be returned. & &Windows may be used to produce a split screen display. Animation &may be simulated by switching a window between one or more &viewports. Smooth horizontal or vertical scrolling may be &performed by changing the window's global coordinates slowly. ( &Note that the window record list may be changed during the  appeared to &be clipped at their 45 degree points instead of the display &boundary. This problem has also been corrected. ( &In previous releases, the mask specified by calling the &Plane_Enable procedure was anded directly with the color value &before drawing. This had the unwanted effect of erasing images in &"disabled" planes when the Core Overlay_Mode was set to Replace. &In the current version, the "disabled" planes are not affected by &execution of GRAFDRAW procedures. The list is only relevant &during a call to the Set_Window procedure and is not referenced &afterward. & &  I.2 Draw Results  ----------------- ( &Each procedure in the GRAFDRAW unit returns a status describing &the success or failure of the requested operation. The status is &deposited in the Core variable Draw_Result. Hence, the &Draw_Result variable reflects the status of the most recent draw &request. Draw statuses with values below 10 are considered &any drawing operations regardless of the color of the draw. In &addition, the red and blue planes are automatically "disabled" &when using a monochrome graphics board. Note that the speed of a &draw varies directly with the number of "disabled" planes. (   I.4 Text XOR Mode  ------------------  &Use of the Core Overlay_Mode state is not specified in the Ramtek &GRAFDRAW specification. In previous releases of the GRAFDRAW &unit, the Text procedure drew in Replace mode only. In the &curre&successful or non-fatal statuses. Draw statuses of 10 and above &are considered fatal and cause the requested operation to be &ignored. & &The non-fatal statuses are Draw_OK, Draw_Clipped and Draw_Init. &Successful calls to GRAFDRAW procedures cause the Draw_Result to &be set to Draw_OK. The Draw_Clipped result is returned after a &successful draw that was clipped when it ran into a viewport &boundary. The Draw_Init is returned after the initialization or nt version, The Text procedure observes the state of the &Overlay_Mode variable and hence draws text in either Replace mode &or XOR mode. (  (  II Changes to GRAFDRAW  ----------------------- " &A number of the GRAFDRAW procedures have subtly changed as a &result of the addition of the viewport and windowing facilities. &This section briefly describes the changes made for each procedure &and variable in the GRAFDRAW interface. References to the &reinitialization of the GRAFDRAW unit. ( &There are seven fatal draw statuses. The Draw_Overflow status &indicates that a coordinate was out of range of the relevant &coordinate system. The Draw_Not_Imp status indicates that the &desired operation is not currently implemented. The &Draw_Not_Found status indicates that a requested font or pattern &file was not available. The Draw_No_Memory status indicates that &there was not enough memory available to facilitate the opening of &a new font or ....| *| |----| | |=>|__________| *| | |=============| *| |____| | *|__________________|   &Global drawspace coordinates not within the global coordinate &space, physical display coordinates not within the screen's &coordinate space and negative window sizes cause an entire &Set_Window request to be ignored and a Draw_Overflow status to be &returned as the Draw_Result (see section I.2). & &Due to hardware constraints within the NEC APC, a number of pattern file. The Draw_Win_Ovfl status indicates &that an attempt was made to create too many windows. The &Draw_Win_Imp status indicates that an attempt was made to create a &window that the current hardware cannot process. The Draw_No_Font &status indicates that an attempt to draw text was made when no &font had been successfully defined. ( &In addition to the standard draw results, a pseude-draw result has &been defined to equal the highest defined draw result. The &constraints are placed on the contents of the window list. There &may be a minimum of zero and a maximum of two entries in the &window list. If there are no entries (i.e. the list pointer is &NIL), the screen is blanked. (Note that since the 7220 chip draws &quite quickly when the screen is blanked, this mode can be used to &increase drawing speed). If there are any entries in the window &list, each entry must have a Win_X_Size of 640 pixels and a &Disp_X_Org of zero since the 7220 chip is inca!     &relevant expository sections are also given. Note that all &procedures return a status in the Core Draw_Result variable. "   II.1 The Core Record  _____________________ " &The Overlay_Mode value is observed in the Text procedure. See §ion I.4. & &The Region_X_Org and Region_Y_Org variables contain the global &coordinates of the origin of the current viewport. See section &I.1.2. 9 &The Window_List variable points to the list of currently defined &windows. The Win_X_Res and Win_Y_R&into the GRAFDRAW.CODE file. This file contains an executable &version of the GRAFDRAW unit. & &A non-trivial overall speed increase can be obtained by running &the native code generator over the GRAFDRAW.CODE file. The &destination code file should be called NGRAFDRAW.CODE. & &Both the GRAFDRAW.CODE and NGRAFDRAW.CODE files should be &released.    IV Description of GRAFDRAW Source Disk  --------------------------------------- & &PAT.COMP.TEXT Pattern compiler source &PAT.COMes variables specify the window &placement resolution within the global coordinate space. See §ion I.1.2. 9 &The Glob_X_Min, Glob_X_Max, Glob_Y_Min and Glob_Y_Max variables &describe the bounds of the global coordinate space. See section &I.1. 9 &The Draw_Result variable indicates the result of the most recent &draw operation. See section I.2. "  II.2 The Move_Cursor Procedure  -------------------------------  &The Move_Cursor procedure has been changed to draw a clipped P.CODE Pattern compiler object &PAT.A.TEXT Sample pattern 0 source &PAT.B.TEXT Sample pattern 1 source &PAT.C.TEXT Sample pattern 2 source &PAT.D.TEXT Sample pattern 3 source &PAT00.PTRN Sample pattern 0 object &PAT02.PTRN Sample pattern 2 object &PAT03.PTRN Sample pattern 3 object &PAT01.PTRN Sample pattern 1 object &PONG.TEXT Pong game demonstration source &cursor when overrunning the edge of a viewport. Previous version &maintained axial symmetry at all times. " "  II.3 The Box_Abs and Box_Rel Procedures  ----------------------------------------  &In previous versions, boxes drawn with either the Box_Abs or &Box_Rel procedures were clipped so that all four sides of the &rectangle were always drawn. Currently, only the portions of the &rectangle sides that are contained within the viewport (if at all) &are drawn. " "  II.4 The Text Procedu&PONG.CODE Pong game demonstration object &FONT00.FONT Sample font 0 object &FONT.B.TEXT Sample font 0 source, part 2 &FONT.A.TEXT Sample font 0 source, part 1 &DEMO.TEXT Ramtek demonstration source &DEMO.CODE Ramtek demonstration object &HOT.DOG.TEXT Hot dog demonstration source &HOT.DOG.CODE Hot dog demonstration object &READ.ME.TEXT Old documentation source &HEXAGON.CODE Hexre  ------------------------  &The Overlay_Mode value is observed in the Text procedure. See §ion I.4. In addition, text drawn beyond the end of the &viewport is clipped. See section I.1.2. " "  II.5 The Circle_Abs and Circle_Rel Procedures  ----------------------------------------------  &The Circle_Abs and Circle_Rel procedures are now capable of &drawing circles of radius greater than 480. Circle clipping has &also been altered so that circles drawn over the top boundary are agon demonstration object &PAT.E.TEXT Sample pattern 5 source &PAT05.PTRN Sample pattern 5 object &GRAF.LINE.TEXT GRAFDRAW Pascal source include file &GRAF.CURS.TEXT GRAFDRAW Pascal source include file &GRAF.RECT.TEXT GRAFDRAW Pascal source include file &7220.PROC0.TEXT GRAFDRAW assembly source &7220.PROC0.CODE GRAFDRAW assembly object &GRAF.FLOOD.TEXT GRAFDRAW Pascal source include file &clipped at the top boundary instead of at their 45 degree points. &Clipping calculations are now also alot faster. See section I.3. " "  II.6 The Arc_Abs and Arc_Rel Procedures  ----------------------------------------------  &The Arc_Abs and Arc_Rel procedures are now capable of drawing arcs &of radius greater than 480. Arc clipping has also been altered so &that arcs drawn over the top boundary are clipped at the top &boundary instead of at their 45 degree points. Arc clipping now &obser&L GRAFDRAW Linker command file &7220.PROC1.CODE GRAFDRAW assembly object &7220.PROC1.TEXT GRAFDRAW assembly source &7220.PROC2.CODE GRAFDRAW assembly object &7220.PROC2.TEXT GRAFDRAW assembly source &GRAF.FONT.TEXT GRAFDRAW Pascal source include file &7220.ARC.TEXT GRAFDRAW assembly source include file &GRAF.CIRCL.TEXT GRAFDRAW Pascal source include file &G.CODE GRAFDRAW Pascal object (unlinked) &722ves viewport boundaries exactly instead of approximately. &Clipping calculations are now also alot faster. See section I.3. " "  II.7 The Set_Region Procedure  ------------------------------ " &The Set_Region procedure is new in this release and allows the &declaration of viewports. See section I.1.2.    II.8 The Set_Window Procedure  ------------------------------ " &The Set_Window procedure is new in this release and allows the &declaration of windows. See section I.1.3.   0.CIRCL.TEXT GRAFDRAW assembly source include file &7220.CORE.CODE GRAFDRAW assembly object &7220.FLOOD.TEXT GRAFDRAW assembly source include file &7220.RECT.TEXT GRAFDRAW assembly source include file &7220.MISC.TEXT GRAFDRAW assembly source include file &GRAFDRAW.CODE GRAFDRAW Pascal object (linked) &7220.CORE.TEXT GRAFDRAW assembly source include file &GRAFDRAW.BACK Junk &GRAFTEST.TEXT GRAFDRAW validation source  III Creating a GRAFDRAW Release  --------------------------------  &The GRAFDRAW unit is organized as a collection of Pascal and &assembly language files. The main Pascal file is GRAFDRAW.TEXT. &All Pascal include files have the GRAF. prefix. There are four &main assembly code files: 7220.PROC0.TEXT, 7220.PROC1.TEXT, &7220.PROC2.TEXT and 7220.CORE.TEXT. The remaining files with the &prefix 7220. are include files for the 7220.CORE file. Each main &file may be compiled or assembled independen&GRAFTEST.CODE GRAFDRAW validation object &NGRAFDRAW.CODE GRAFDRAW Pascal object (linked, native code gen) &GRAFDRAW.TEXT GRAFDRAW Pascal source &GRAF.MISC.TEXT GRAFDRAW Pascal source include file & &  V The Graftest Program  -----------------------  &The Graftest program is intended for the validation and demonstration &of the various features of the GRAFDRAW unit. This section describes &the legal and desirable responses to Graftest's prompts. The &Grtly of the other main &files. & &An executable GRAFDRAW unit is obtained by: & (1) Assembling 7220.PROC0.TEXT to 7220.PROC0.CODE. ( (2) Assembling 7220.PROC1.TEXT to 7220.PROC1.CODE.  (3) Assembling 7220.PROC2.TEXT to 7220.PROC2.CODE.  (4) Assembling 7220.CORE.TEXT to 7220.CORE.CODE. ( & 5) Compiling GRAFDRAW.TEXT to G.TEXT. ( (6) Redirecting input to the file L. ( &The L command file directs the system to link together all modules "     &repitition factor remains in effect until another repitition &factor is typed to superceed it. &  ck 81 for Red 82 for Green 83 for Yellow 84 for Blue 85 for Purple 86 for Pink 87 for White & &The recommended values for the background color are 0 or 1. & &The pattern number is specified as an integer between 0 and 5 &followed by the [RETURN] key. The pattern number selects a &PATxx.PTRN file containing pattern to be used during rectangle &and circle filling. The recommended value for the pattern &number is 1. & &The font number is specified by typing 0 followed by the [RETURN] &key. The font number selects a FONTxx.FONT file containing &pattern to be used during text drawing. (There is only one font &file supplied). & &The enabled planes is specified as an integer between 0 and 7 &followed by the [RETURN] key. The enabled planes indicate the &planes in which drawing may occur. Possible values are: & 80 for no planes 81 for the Red plane only 82 for the Green plane only 83 $CURSOR $EQUAL $TAG fPCG.W for both the Red and Green planes 84 for the Blue plane only 85 for both the Red and Blue planes 86 for both the Green and Blue planes 87 for all planes & &The recommended value for the enabled plane is 7. & &The clipping region (viewport) location is the X and Y coordinates &of the viewport for the test. It is specified as an integer &between 0 and 1023 followed by a space and another integer between &0 and 1023, followed by the [RETURN] key. Recommended values for &the viewport location are either 0 0 or 200 200. The 0 0 &value shows the test occupying the entire screen, while the 200 &200 value shows the test and the effects of clipping. & &The clipping region (viewport) size is the X and Y size of the &viewport for the test. It is specified as an integer between 1 &and 1024 followed by a space and another integer between 1 and &1024, followed by the [RETURN] key. Recommended values for tP P 6Temporary Documentation Supplement 6================================== 6 P  I Graphics Features  -------------------- $ &The August, 1983 graphics upgrade (version 0.5) contains four &major features: viewport and window facilities, draw statuses, &correct (and faster) arc clipping and color masking, and XOR in &conjunction with TEXT drawing. & &  I.1 Viewports and Windows  --------------------------  &The NEC APC is capable of drawing in a 1024 by 1024 pixel, 3 plane &graphics sphe &viewport size are either 640 480, 200 150 or 1024 1024. The 640 &480 value shows the test occupying the entire screen and should be &used with a location of 0 0, while the 200 150 value shows the &test and the effects of clipping and should be used with a &location of 200 200. The 1024 1024 value show the test occupying &the full 1024 by 1024 graphics space; this value is not &recommended for the cursor and circle tests, but is heartily &recommended for the window test.   ace and displaying a 640 by 480 pixel subset. The &GRAFDRAW unit defines a global coordinate space with dimensions &1024 by 1024 pixels. A rectangular subset of the global space may &be defined as the current working drawing region (called a &viewport). Another (possibly coincident) rectangular subset of &the global space may be defined as the currently displayed region &(called a window). & &In order to make applications using the GRAFDRAW unit portable,  V.2 Ongoing Prompts  --------------------  &There are two types of prompts that appear at the bottom of the &screen. The first type asks whether or not to execute a &particular test. The approriate responses are 'Y' to execute the &test and 'N' to skip the test. The second type prompts for the &[RETURN] key before continuing to the next sub-test. Hitting the &[ESC] key in response to either prompt aborts the Graftest &program. & &In addition to the keys that control the progress of the teaftest program is not intended as a sales demonstration, but may &be used as such at the salesman's peril. & &The Graftest program contains several test suites, each testing &a different aspect of the GRAFDRAW unit. In order of appearance, &they are: & =Cursor =Line =Box =Text =Circle =Block =Area Fill =Arc =Windows < &Each test demonstrates typical usage of each related GRAFDRAW &procedure using most of the available modes. In addition, some st, a &set of keys are defined to move the screen display over different &portions of the clipping region (viewport). The up-arrow key &moves the image up; the down-arrow key moves the image down. The &backspace and left-arrow keys move the image to the left; the &right-arrow key moves the image to the right. The [CLEAR-HOME] &key moves to the original image. Repitition factors may be &applied to any key by typing an integer followed by the key. A &boundary and clipping conditions are tested.    V.1 Initial Prompts  --------------------  &Certain parameters may be specified when the program starts. These &include the background color, the pattern number, the font number, &the enabled planes and the viewport location and size. These ¶meters influence the location and appearance of the tests on &the screen. & &The background color is specified as an integer followed by the &[RETURN] key. Possible values are: & 80 for Bla"     &Core variables have been added to indicate the size of the global &coordinate space. The variables Glob_X_Min and Glob_Y_Min are &always set to zero. The variables Glob_X_Max and Glob_Y_Max are &set to the maximum global X and Y coordinates, respectively. Both &are 1023 for the NEC APC implementation. &   //   I.1.2 Viewports  ---------------- & &A viewport is defined using the Set_Region procedure. The &Set_Region procedure accepts four parameters: the global X and Y &coordinates of t&the screen. Windows may or may not be coincident with viewports. & &Windows are defined by calling the Set_Window procedure. The &Set_Window procedure accepts a pointer to a linked list of window &records as a parameter. Each window record defines the global &coordinates of a window in the drawing space, its coordinates on &the physical screen and the window's size. The global coordinates &within the drawing space specify the lower left corner of the &window. The physical screen coordinates sphe viewport's lower left corner (X_Start and &Y_Start), and the number of pixels in the X and Y directions &(X_Length and Y_Length). & &All coordinates used in subsequent graphic operations are &interpreted relative to the viewport's lower left corner. As a &result of a call to Set_Region, the current position (X_CP, Y_CP) &and the cursor position are set to (0, 0) and the cursor is &disabled. In addition, the Core variables X_Max and Y_Max are set ecify the location of &the lower left corner of the image on the display screen (assuming &the lower left corner is (0, 0)). The window's size is specified &by the number of pixels in the horizontal and vertical directions. &The record is declared as follows: '  // & -Win_Rec_P = ^Win_Rec; -Win_Rec = Record ?Next_Window : Win_Rec_P; { Link to next rec } ?Win_X_Org, { Global drawspace } ?Win_Y_Org, { coordinates } &to the viewport-relative coordinates of the upper right corner of &the viewport (i.e. (X_Length-1,Y_Length-1)). The Core variables &Region_X_Org and Region_Y_Org are set to the global coordinates of &the viewport origin (X_Start and Y_Start, respectively). The &default viewport starts at (0, 0) relative to the global space and &is 640 pixels horizontally and 480 pixels vertically. & &A viewport may be of any size between 1-by-1 and 1024-by-1024. &However, a viewport must be contained entirely ?Disp_X_Org, { Display screen } ?Disp_Y_Org, { coordinates } ?Win_X_Size, { Window size } ?Win_Y_Size : Point; =End {of Win_Rec}; ' &The Core variable Window_List initially points to a window record &that declares a window at (0, 0) in the global coordinate space &and (0, 0) on the display screen for the entire display screen &(640 pixels horizontally and 480 pixels vertically). & & ,Global Coordinates Physical Display -(Drawing space) *|--within the global &space. Attempts to define a viewport outside of this space or &attempts to move either the current position or the cursor out of &the viewport are ignored and a Draw_Result of Draw_Overflow is &returned (see section I.2). & *|-------------------------------------------------| [1023, 1023] *| | *| (X_Length-1, Y_Length-1) | *| ---------------------------- | ----------------| |----------| *| |-----| | | | *| | |=====================>| | *| |_____| | |..........| *| |----| | |=>|__________| *| | |=============| *| |____| | *|__________________|   &Global drawspace coordinates not within the global coordinate &space, physical display coordinates not within the screen's &coordinate space and negative window sizes cause an entire *| | | | *| | | | *| | | | *| | | | *| ____________________________ | *| [X_Start, Y_Start] | *| or (0, 0) | *|-------------------------------------------------| ([0, 0] 1[x, y] are global coordinates 1(x, y) are viewport coordinates 1 1&Set_Window request to be ignored and a Draw_Overflow status to be &returned as the Draw_Result (see section I.2). &  // & &Due to hardware constraints within the NEC APC, a number of &constraints are placed on the contents of the window list. There &may be a minimum of zero and a maximum of two entries in the &window list. If there are no entries (i.e. the list pointer is &NIL), the screen is blanked. (Note that since the 7220 chip draws &quite quickly when the screen is blanked, this mode ca  // & &In the example above, the global space is the 1024 by 1024 &rectangle. A viewport is defined at (X_Start, Y_Start) relative &to the global space. The viewport is X_Length pixels wide and &Y_Length pixels high. & &Any operations attempting to draw outside of the current viewport &are clipped and a Draw_Clipped status is returned as the &Draw_Result. Generally, clipping is performed so that the figure &actually drawn appears exactly as it would have if no clipping n be used to &increase drawing speed). If there are any entries in the window &list, each entry must have a Win_X_Size of 640 pixels and a &Disp_X_Org of zero since the 7220 chip is incapable of &horizontally-split screen display. In addition, all 480 rows of &the display must be allocated among the declared windows. &Finally, no windows may be declared to overlap. Attempts to &violate of any of these constraints cause an entire Set_Window &were performed, except that it is truncated at the viewport &boundaries. The exception to this rule is text. Text erased &using the Erase_Alpha procedure and text written to the screen &using the Pascal and Unit I/O procedures is neither associated &with, nor constrained to a viewport. In addition, a character &written using the Text procedure is drawn only if the character &fits entirely within the viewport. & &Note that in addition to allowing drawing in a much larger &graphics space than is &call to be ignored and a Draw_Win_Imp status to be returned as the &Draw_Result. & &The NEC APC is capable of setting a window boundary on 16-pixel &(word) boundaries in the global coordinate space instead of on any &pixel. The Core variables Win_X_Res and Win_Y_Res give the window &resolutions for X and Y coordinates, respectively. For the NEC &APC, the Win_X_Res is 16 and the Win_Y_Res is 1. Attempts to &declare a window having a global X or Y coordinate that is not &divisible by the respectactually displayed, a viewport may also be &declared to be very small. This allows multiple zero-based &graphics spaces. It also provides a method of flooding subsets of ®ions. +   I.1.2 Windows  -------------- $ &Windows are related to viewports only in that they are declared in &the same global coordinate space. While viewports are spaces in &which drawing can occur, windows are subsets of the global &coordinate space which the display hardware actually displays on #     &before drawing. This had the unwanted effect of erasing images in &"disabled" planes when the Core Overlay_Mode was set to Replace. &In the current version, the "disabled" planes are not affected by &any drawing operations regardless of the color of the draw. In &addition, the red and blue planes are automatically "disabled" &when using a monochrome graphics board. Note that the speed of a &draw varies directly with the number of "disabled" planes. (   I.4 Text XOR Mode  ------------------  success or failure of the requested operation. The status is &deposited in the Core variable Draw_Result. Hence, the &Draw_Result variable reflects the status of the most recent draw &request. Draw statuses with values below 10 are considered &successful or non-fatal statuses. Draw statuses of 10 and above &are considered fatal and cause the requested operation to be &ignored. & &The non-fatal statuses are Draw_OK, Draw_Clipped and Draw_Init.  &Use of the Core Overlay_Mode state is not specified in the Ramtek &GRAFDRAW specification. In previous releases of the GRAFDRAW &unit, the Text procedure drew in Replace mode only. In the ¤t version, The Text procedure observes the state of the &Overlay_Mode variable and hence draws text in either Replace mode &or XOR mode. (  (  //   II Changes to GRAFDRAW  ----------------------- " &A number of the GRAFDRAW procedures have subtly changed as a &Successful calls to GRAFDRAW procedures cause the Draw_Result to &be set to Draw_OK. The Draw_Clipped result is returned after a &successful draw that was clipped when it ran into a viewport &boundary. The Draw_Init is returned after the initialization or &reinitialization of the GRAFDRAW unit. ( &There are seven fatal draw statuses. The Draw_Overflow status &indicates that a coordinate was out of range of the relevant &coordinate system. The Draw_Not_Imp status indicates that the &desired ope&result of the addition of the viewport and windowing facilities. &This section briefly describes the changes made for each procedure &and variable in the GRAFDRAW interface. References to the &relevant expository sections are also given. Note that all &procedures return a status in the Core Draw_Result variable. "   II.1 The Core Record  _____________________ " &The Overlay_Mode value is observed in the Text procedure. See §ion I.4. & &The Region_X_Org and Region_Y_Org variables contration is not currently implemented. The &Draw_Not_Found status indicates that a requested font or pattern &file was not available. The Draw_No_Memory status indicates that &there was not enough memory available to facilitate the opening of &a new font or pattern file. The Draw_Win_Ovfl status indicates &that an attempt was made to create too many windows. The &Draw_Win_Imp status indicates that an attempt was made to create a &window that the current hardware cannot process. The Draw_No_Font ain the global &coordinates of the origin of the current viewport. See section &I.1.2. 9 &The Window_List variable points to the list of currently defined &windows. The Win_X_Res and Win_Y_Res variables specify the window &placement resolution within the global coordinate space. See §ion I.1.2. 9 &The Glob_X_Min, Glob_X_Max, Glob_Y_Min and Glob_Y_Max variables &describe the bounds of the global coordinate space. See section &I.1. 9 &status indicates that an attempt to draw text was made when no &font had been successfully defined. (  // & &In addition to the standard draw results, a pseude-draw result has &been defined to equal the highest defined draw result. The &Draw_Max result is provided to aid in defining draw result &subranges even as new draw results are added. The current draw &results are summarized below: & ( (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clip&The Draw_Result variable indicates the result of the most recent &draw operation. See section I.2. "  II.2 The Move_Cursor Procedure  -------------------------------  &The Move_Cursor procedure has been changed to draw a clipped &cursor when overrunning the edge of a viewport. Previous version &maintained axial symmetry at all times. " "  //   II.3 The Box_Abs and Box_Rel Procedures  ----------------------------------------  &In previous versions, boxes drawn with either the Box_ped} (Draw_Init = 2; {Draw variables at initial state}  (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} (Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} ( Abs or &Box_Rel procedures were clipped so that all four sides of the &rectangle were always drawn. Currently, only the portions of the &rectangle sides that are contained within the viewport (if at all) &are drawn. " "  II.4 The Text Procedure  ------------------------  &The Overlay_Mode value is observed in the Text procedure. See §ion I.4. In addition, text drawn beyond the end of the &viewport is clipped. See section I.1.2. " "  II.5 The Circle_Abs and Circle_Rel Procedures (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( (  //   I.3 Arc Drawing and Color Masking  ----------------------------------  &Previous releases of the GRAFDRAW unit contained flawed algorithms &for arc clipping and color masking. The arc clipping algorithms &caused arcs to be drawn beyond the bounds of the current viewport. &However, since the pervious releases equated the current viewport &and display window to the entire screen, the flaws were &unnoticable. In tive resolution factor causes the &coordinate to be truncated toward the lower legal value and a &Draw_Result of Draw_Clipped to be returned. In addition, attempts &to declare a window that extends beyond the highest global &coordinate space row or physical display row causes the window to &be truncated to fit in both coordinate systems and a Draw_Result &of Draw_Clipped to be returned. &  // & &Windows may be used to produce a split screen display. Animation he current versions, the arc clipping algorigthms &do not use trigonometric functions and hence are not subject to &the sluggishness and roundoff problems of prior versions. &Additionally, arcs clipped at the top of screen often appeared to &be clipped at their 45 degree points instead of the display &boundary. This problem has also been corrected. ( &In previous releases, the mask specified by calling the &Plane_Enable procedure was anded directly with the color value &may be simulated by switching a window between one or more &viewports. Smooth horizontal or vertical scrolling may be &performed by changing the window's global coordinates slowly. ( &Note that the window record list may be changed during the &execution of GRAFDRAW procedures. The list is only relevant &during a call to the Set_Window procedure and is not referenced &afterward. & &  I.2 Draw Results  ----------------- ( &Each procedure in the GRAFDRAW unit returns a status describing &the#      ----------------------------------------------  &The Circle_Abs and Circle_Rel procedures are now capable of &drawing circles of radius greater than 480. Circle clipping has &also been altered so that circles drawn over the top boundary are &clipped at the top boundary instead of at their 45 degree points. &Clipping calculations are now also alot faster. See section I.3. " "  II.6 The Arc_Abs and Arc_Rel Procedures  ----------------------------------------------  &The Arc_Abs and Arc_Rel &GRAF.CURS.TEXT GRAFDRAW Pascal source include file &GRAF.RECT.TEXT GRAFDRAW Pascal source include file &7220.PROC0.TEXT GRAFDRAW assembly source &7220.PROC0.CODE GRAFDRAW assembly object &GRAF.FLOOD.TEXT GRAFDRAW Pascal source include file &L GRAFDRAW Linker command file &7220.PROC1.CODE GRAFDRAW assembly object &7220.PROC1.TEXT GRAFDRAW assembly source &7220.PROC2.CODE GRAFDRAW assembly object &7220.PROC2.TEprocedures are now capable of drawing arcs &of radius greater than 480. Arc clipping has also been altered so &that arcs drawn over the top boundary are clipped at the top &boundary instead of at their 45 degree points. Arc clipping now &observes viewport boundaries exactly instead of approximately. &Clipping calculations are now also alot faster. See section I.3. " "  II.7 The Set_Region Procedure  ------------------------------ " XT GRAFDRAW assembly source &GRAF.FONT.TEXT GRAFDRAW Pascal source include file &7220.ARC.TEXT GRAFDRAW assembly source include file &GRAF.CIRCL.TEXT GRAFDRAW Pascal source include file &G.CODE GRAFDRAW Pascal object (unlinked) &7220.CIRCL.TEXT GRAFDRAW assembly source include file &7220.CORE.CODE GRAFDRAW assembly object &7220.FLOOD.TEXT GRAFDRAW assembly source include file &The Set_Region procedure is new in this release and allows the &declaration of viewports. See section I.1.2.    //   II.8 The Set_Window Procedure  ------------------------------ " &The Set_Window procedure is new in this release and allows the &declaration of windows. See section I.1.3.    //   III Creating a GRAFDRAW Release  --------------------------------  &The GRAFDRAW unit is organized as a collection of Pascal and &assembly language files. The main Pascal file is GRA&7220.RECT.TEXT GRAFDRAW assembly source include file &7220.MISC.TEXT GRAFDRAW assembly source include file &GRAFDRAW.CODE GRAFDRAW Pascal object (linked) &7220.CORE.TEXT GRAFDRAW assembly source include file &GRAFDRAW.BACK Junk &GRAFTEST.TEXT GRAFDRAW validation source &GRAFTEST.CODE GRAFDRAW validation object &NGRAFDRAW.CODE GRAFDRAW Pascal object (linked, native code gen) &GRAFDRAW.TEXT GRAFDRAW Pascal source FDRAW.TEXT. &All Pascal include files have the GRAF. prefix. There are four &main assembly code files: 7220.PROC0.TEXT, 7220.PROC1.TEXT, &7220.PROC2.TEXT and 7220.CORE.TEXT. The remaining files with the &prefix 7220. are include files for the 7220.CORE file. Each main &file may be compiled or assembled independently of the other main &files. & &An executable GRAFDRAW unit is obtained by: & (1) Assembling 7220.PROC0.TEXT to 7220.PROC0.CODE. ( (2) Assembling 7220.PROC1.TEXT to 7220.PROC1.CODE. &GRAF.MISC.TEXT GRAFDRAW Pascal source include file & &  //   V The Graftest Program  -----------------------  &The Graftest program is intended for the validation and demonstration &of the various features of the GRAFDRAW unit. This section describes &the legal and desirable responses to Graftest's prompts. The &Graftest program is not intended as a sales demonstration, but may &be used as such at the salesman's peril. &  (3) Assembling 7220.PROC2.TEXT to 7220.PROC2.CODE.  (4) Assembling 7220.CORE.TEXT to 7220.CORE.CODE. ( & 5) Compiling GRAFDRAW.TEXT to G.TEXT. ( (6) Redirecting input to the file L. ( &The L command file directs the system to link together all modules &into the GRAFDRAW.CODE file. This file contains an executable &version of the GRAFDRAW unit. & &A non-trivial overall speed increase can be obtained by running &the native code generator over the GRAFDRAW.CODE file. The &destination code&The Graftest program contains several test suites, each testing &a different aspect of the GRAFDRAW unit. In order of appearance, &they are: & =Cursor =Line =Box =Text =Circle =Block =Area Fill =Arc =Windows < &Each test demonstrates typical usage of each related GRAFDRAW &procedure using most of the available modes. In addition, some &boundary and clipping conditions are tested.    //   V.1 Initial Prompts  --------------------  &Certain parameters may be specified when the file should be called NGRAFDRAW.CODE. & &Both the GRAFDRAW.CODE and NGRAFDRAW.CODE files should be &released.    //   IV Description of GRAFDRAW Source Disk  --------------------------------------- & &PAT.COMP.TEXT Pattern compiler source &PAT.COMP.CODE Pattern compiler object &PAT.A.TEXT Sample pattern 0 source &PAT.B.TEXT Sample pattern 1 source &PAT.C.TEXT Sample pattern 2 source  program starts. These &include the background color, the pattern number, the font number, &the enabled planes and the viewport location and size. These ¶meters influence the location and appearance of the tests on &the screen. & &The background color is specified as an integer followed by the &[RETURN] key. Possible values are: & 80 for Black 81 for Red 82 for Green 83 for Yellow 84 for Blue 85 for Purple 86 for Pink &PAT.D.TEXT Sample pattern 3 source &PAT00.PTRN Sample pattern 0 object &PAT02.PTRN Sample pattern 2 object &PAT03.PTRN Sample pattern 3 object &PAT01.PTRN Sample pattern 1 object &PONG.TEXT Pong game demonstration source &PONG.CODE Pong game demonstration object &FONT00.FONT Sample font 0 object &FONT.B.TEXT Sample font 0 source, part 2 &FONT.A.TEXT Sample font 0 source87 for White & &The recommended values for the background color are 0 or 1. & &The pattern number is specified as an integer between 0 and 5 &followed by the [RETURN] key. The pattern number selects a &PATxx.PTRN file containing pattern to be used during rectangle &and circle filling. The recommended value for the pattern &number is 1. & &The font number is specified by typing 0 followed by the [RETURN] &key. The font number selects a FONTxx.FONT file containing &pattern to be used d, part 1 &DEMO.TEXT Ramtek demonstration source &DEMO.CODE Ramtek demonstration object &HOT.DOG.TEXT Hot dog demonstration source &HOT.DOG.CODE Hot dog demonstration object &READ.ME.TEXT Old documentation source &HEXAGON.CODE Hexagon demonstration object &PAT.E.TEXT Sample pattern 5 source &PAT05.PTRN Sample pattern 5 object &GRAF.LINE.TEXT GRAFDRAW Pascal source include file $      Barbara Firchau January 31, 1984  NCR GmbH  Ulmer Strasse 160  D-8900 Augsburg  West Germany   Dear Barbara,  %Enclosed you will find a DecisionMate diskette containing a  demonstration version of the Grafdraw graphics module and documentation.  This fulfills the terms of the agreement between NCR and Ticom Systems  dated May 3, 1983. We are sorry that you were made to wait so long for  this package. We assumed Ticom's obligation only recently and hile the 200 &200 value shows the test and the effects of clipping. &  // & &The clipping region (viewport) size is the X and Y size of the &viewport for the test. It is specified as an integer between 1 &and 1024 followed by a space and another integer between 1 and &1024, followed by the [RETURN] key. Recommended values for the &viewport size are either 640 480, 200 150 or 1024 1024. The 640 &480 value shows the test occupying the entire screen and should be have  acted as expeditiously as possible.  %The diskette contains the Grafdraw unit (in Grafdraw.Code), a native  code generated version of Grafdraw (in NGrafdraw.Code), a demonstration  program (Graftest.Code) and a number of fonts and patterns. To execute  the demonstration:  ,1) Boot your p-System with the demonstration disk in the /right drive. / ,2) Change the Userlib.Text on the system disk to contain /NGrafdraw.Code. / ,3) X(ecute Graftest p=#5 , &used with a location of 0 0, while the 200 150 value shows the &test and the effects of clipping and should be used with a &location of 200 200. The 1024 1024 value show the test occupying &the full 1024 by 1024 graphics space; this value is not &recommended for the cursor and circle tests, but is heartily &recommended for the window test.    V.2 Ongoing Prompts  --------------------  &There are two types of prompts that appear at the bottom of the &screen. The first type asks whether or,4) Watch the demonstrations flash up on the screen. Type / when a draw is complete and the next demonstration  will begin. Type to abort the program.  %The Graftest program is actually a validation program and is not  intended as a marketing demonstration. Thus, some screens will appear  to do nothing while they are actually doing something invisible or are  supposed to do nothing. You should be able to get a good idea of the  speed and capabilities of the package  not to execute a &particular test. The approriate responses are 'Y' to execute the &test and 'N' to skip the test. The second type prompts for the &[RETURN] key before continuing to the next sub-test. Hitting the &[ESC] key in response to either prompt aborts the Graftest &program. & &In addition to the keys that control the progress of the test, a &set of keys are defined to move the screen display over different &portions of the clipping region (viewport). The up-arrow key from these demonstrations.  %The enclosed documentation consists of Ticom's documentation for a  prior release and my notes to Ticom describing the differences between  the prior release and the current release. Because the implementation  of the NEC 7220 chip differs between the NEC APC and the DecisionMate,  the documentation for the DecisionMate will differ slightly, but will  also include the new intrinsics. Nevertheless, you should be able to &moves the image up; the down-arrow key moves the image down. The &backspace and left-arrow keys move the image to the left; the &right-arrow key moves the image to the right. The [CLEAR-HOME] &key moves to the original image. Repitition factors may be &applied to any key by typing an integer followed by the key. A &repitition factor remains in effect until another repitition &factor is typed to superceed it. &   write programs that exercise Grafdraw. The source to the Graftest  program is provided as a courtesy so that you may understand how the  demonstration was constructed.   // % %Please give me a call when you have evaluated the package and  either have questions or are ready to discuss terms. You can reach me  either at our offices or at home. The office number is (619) 457-1595.  My home number is (619) 455-7904.   XSincerely,    XBarry Demchak XVice President   $CURSOR $EQUAL G.uring text drawing. (There is only one font &file supplied). & &The enabled planes is specified as an integer between 0 and 7 &followed by the [RETURN] key. The enabled planes indicate the &planes in which drawing may occur. Possible values are: & 80 for no planes 81 for the Red plane only 82 for the Green plane only 83 for both the Red and Green planes 84 for the Blue plane only 85 for both the Red and Blue planes 86 for both the Green and Blue planes 87 for all planes & &The recommended value for the enabled plane is 7. & &The clipping region (viewport) location is the X and Y coordinates &of the viewport for the test. It is specified as an integer &between 0 and 1023 followed by a space and another integer between &0 and 1023, followed by the [RETURN] key. Recommended values for &the viewport location are either 0 0 or 200 200. The 0 0 &value shows the test occupying the entire screen, w$     $CURSOR $EQUAL $TAG $LAST _6L_O.r,End {of Else}; *Spacing := Trunc (R_Length * (Char_Spacing + 1)); *L_Length := Pred (Length (The_String)) * Spacing; *X := X_CP; *Y := Y_CP; *Case Char_Path Of ,Left : Begin 6Case Top_Bottom Of 8Bottom : {Do nothing}; 8Center : Y := Y - R_Width Div 2; 8Top : Y := Y - R_Width; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : X := X + L_Length; 8Center : X := X - R_Length + F(L_Length + R_Length) Div 2; 8Right : X := X - R_Length; 6End {of Case Left_Right}; 6If (Y < 0) Or (Pred (Y + R_Width) > Y_Max) Then 8Result := Draw_Clipped; 4End {of Left}; ,Right : Begin 6Case Top_Bottom Of 8Bottom : {Do nothing}; 8Center : Y := Y - R_Width Div 2; 8Top : Y := Y - R_Width; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - (L_Length + R_Length) Div 2; 8Right : X := X - L_Length - R_Length; 6End {of Case Left_Right}; 6If (Y < 0) Or (Pred (Y + R_Width) > Y_Max) Then 8Result := Draw_Clipped; 4End {of Right}; ,Up : Begin  { Beginning of Graf.Font Include File } 8 " "Procedure Set_Font {Font_Num : Font_Type}; Var Read_Words, &N_Words, &Valid_Words, &Index : Integer; &Bad_IO : Boolean; &Font_Name : String; &Font_File : File; &Font_Buff : Record 4Font_X : Integer; 4Font_Y : Integer; 4Min_Ch : Char; 4Max_Ch : Char; 4Trash : Array [0..255] Of Integer; 2End {of Font_Buff}; "Begin $If Core^.Font_Number >= 0 Then &Begin (Var_Dispose (Font_Ptr, Font_Im_Size); (Core^.Font_Number := -1; &End {of If}; 6Case Top_Bottom Of 8Top : Y := Y - L_Length - R_Length; 8Center : Y := Y - (L_Length + R_Length) Div 2; 8Bottom : {Do nothing}; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - R_Width Div 2; 8Right : X := X - R_Width; 6End {of Case Left_Right}; 6If (X < 0) Or (Pred (X + R_Width) > X_Max) Then 8Result := Draw_Clipped; 4End {of Up}; ,Down : Begin 6Case Top_Bottom Of 8Top : Y := Y - R_Length; 8Center : Y := Y - R_Length + F(L_Length + R_Lengt$Font_Name := 'Fontxx.Font'; $Font_Name[5] := Chr (Font_Num Div 10 + Ord ('0')); $Font_Name[6] := Chr (Font_Num Mod 10 + Ord ('0'));  {$I-} $Reset (Font_File, Concat (Core^.File_Prefix, ':', Font_Name)); $Core^.Draw_Result := Draw_Not_Found; $If IO_Result = 0 Then &If Blockread (Font_File, Font_Buff, 1) = 1 Then (With Font_Buff Do *Begin ,N_Words := Succ (Ord (Max_Ch) - Ord (Min_Ch)) * 7(Succ (Font_Y * ((Font_X + 7) Div 8)) Div 2); ,Font_Im_Size := Var_New (Font_Ptr, N_Words); h) Div 2; 8Bottom : Y := Y + L_Length; 6End {of Case Top_Bottom}; 6Case Left_Right Of 8Left : {Do nothing}; 8Center : X := X - R_Width Div 2; 8Right : X := X - R_Width; 6End {of Case Left_Right}; 6If (X < 0) Or (Pred (X + R_Width) > X_Max) Then 8Result := Draw_Clipped; 4End {of Down}; *End {of Case Char_Path}; *If Result = Draw_OK Then ,Begin .Kill_Cursor := (Core^.Overlay_Mode = Replace) And CSR_Is_Enabled =And CSR_Is_Visible; .If Kill_Cursor Then 0Draw_Cursor (Cursor_X, Cursor_Y); ,If Font_Im_Size <> 0 Then .Begin 0Bad_IO := False; 0Valid_Words := 252; 0Index := 0; 0Repeat 2If N_Words <= Valid_Words Then 4Read_Words := N_Words 2Else 4Read_Words := Valid_Words; 2Moveleft (Trash, Font_Ptr^[Index], Read_Words * 2); 2Index := Index + Read_Words; 2N_Words := N_Words - Read_Words; 2If N_Words <> 0 Then 4Bad_IO := Blockread (Font_File, Trash, 1) <> 1; 2Valid_Words := 256; 0Until Bad_IO Or (N_Words = 0); 0If Not Bad_IO Then 2With Core^ Do 4Begin 6Font_Number := Font_Num;.New_X := X; .New_Y := Y; .For Index := 1 To Length (The_String) Do 0If (The_String[Index] >= Font_Min_Ch) And 3(The_String[Index] <= Font_Max_Ch) Then 2Begin 4Case Char_Path Of 6Left : Begin @New_X := X - Spacing; 6 Do_Char := (X + Spacing <= X_Max) And K(New_X >= -1); >End {of Left}; 6Right : Begin @New_X := X + Spacing; @Do_Char := (X >= 0) And (Pred (New_X) <= X_Max); >End {of Right}; 6Up : Begin @New_Y := Y + Spacing; @Do_Char := (Y >= 0) And (Pred (New_Y) <= Y_Max);  6Font_Cols := Font_X; 6Font_Rows := Font_Y; 6Font_Min_Ch := Min_Ch; 6Font_Max_Ch := Max_Ch; 4 Draw_Result := Draw_OK; 4End {of With}; .End {of If Font_Im_Size} ,Else .Core^.Draw_Result := Draw_No_Memory; (End {of If Blockread};  {$I^} "End {of Set_Font};  " " Procedure Set_Charup {DX_Charup, 8DY_Charup : Integer}; "Begin $If Abs (DY_Charup) >= Abs (DX_Charup) Then &Begin (Core^.DX_Charup := 0; (If DY_Charup = 0 Then *Core^.DY_Charup := 1 (Else >End {of Up}; 6Down : Begin @New_Y := Y - Spacing; @Do_Char := (Y + Spacing <= Y_Max) And (Y >= 0); >End {of Down}; 4End {of Case}; 4If Do_Char Then 6GR_Text (X, Y, Font_Ptr^[(Ord (The_String[Index]) - OOrd (Font_Min_Ch)) * Font_Size], ?Font_Cols, Font_Rows, X_Mag, Y_Mag, ?Text_Index, Planes_On, ?Core^.Overlay_Mode, Rotation) 4Else 6Result := Draw_Clipped; 2 X := New_X; 4Y := New_Y; 2End {of If (The_String}; .If Kill_Cursor Then 0Draw_Cursor (Cursor_X, Cursor_Y); *Core^.DY_Charup := DY_Charup Div Abs (DY_Charup); &End {of If Abs} $Else &Begin (Core^.DY_Charup := 0; (Core^.DX_Charup := DX_Charup Div Abs (DX_Charup); &End {of Else Abs}; " Core^.Draw_Result := Draw_OK; "End {of Set_Charup};   7  {$N+} "Procedure Text {The_String : String}; "Var Write_X, &X, &Y, &New_X, &New_Y, &X_Mag, &Y_Mag, &Spacing, &Index, &R_Length, &R_Width, &L_Length, &Result, &Font_Size, &Rotation : Integer; &Do_Char, &Kill_Cursor : Boolean; "Begin $With C( End {of If Result}; *Draw_Result := Result; (End {of If Font_Number} &Else (Draw_Result := Draw_No_Font; "End {of Text};  {$N^}  { Ending of Graf.Font Include File } 8 "  ore^ Do &If Font_Number >= 0 Then (Begin *Result := Draw_OK; *Font_Size := ((Font_Cols + 7) Div 8 * Font_Rows) Div 2; *Rotation := Text_Rotations[DX_Charup, DY_Charup]; *X_Mag := (Char_Width + Font_Cols Div 2) Div Font_Cols; *Y_Mag := (Char_Height + Font_Rows Div 2) Div Font_Rows; *If (DX_Charup <> 0) = (Char_Path <= Right) Then ,Begin .R_Length := Y_Mag * Font_Rows; .R_Width := X_Mag * Font_Cols; ,End {of If} *Else ,Begin .R_Length := X_Mag * Font_Cols; .R_Width := Y_Mag * Font_Rows; %     8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type  = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record  { GrafDraw Graphics Unit }  { by }  { Barry Demchak, Software Construction Inc. }  { for Ticom }  { December 30, 1982 }   {$R-,I- for speed only}  {$D Debug_Arcs-}  Unit Graf_Draw;  {*** Does Overlay_Mode apply to pixel blocks ? }  {*** Find out what the text plane options mean for Set_Value }   (*  10 Feb 84 BD Fixed text down dra9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text colw to clip correctly instead of early  15 Aug 83 BD Added {$N} directives where appropriate  15 Aug 83 BD Added Overlay_Mode parameter to Text procedure for XOR mode  15 Aug 83 BD Verified and corrected clipping in all routines  15 Aug 83 BD Added Window and Region routines and suppport throughout  15 Aug 83 BD Fixed all routines to accept Enabled parameter as color mask  15 Aug 83 BD Recoded arc clipping routines (WHAT A BITCH!)  01 Jul 83 BD Added Draw_Result status variable or} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, { Columns per char } 9Font_Rows : Point; { Rows per char } 9  01 Jul 83 BD Added Set_Region call  01 Jul 83 BD Added Core fields for Global coordinate values  01 Jul 83 BD Added in Disp fields in Core record for windowing  10 Mar 83 BD Added clipping for lines and the cursor  10 Mar 83 BD Added version identifier, Graf_Version  08 Mar 83 BD Added Arc code and made circle procs call it  02 Mar 83 BD Added Flood procedure to do solid area filling  23 Feb 83 BD Added file prefix variable in CORE  23 Feb 83 BD Fixed incorrect memory space error handling9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in Write_Block...  23 Feb 83 BD Made initialized CORE variables consistent with RAMTEK  *)   Interface  "Const Graf_Version = '0.6';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented}  in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coordinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable,  { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } $CURSOR $EQUAL $LOG $LAST $SYNTAX $TAG 2 1  s O.RG%     7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_B&CSR_Is_Enabled, { Cursor enabled } &CSR_Is_Visible : Boolean; { Cursor disabled } &Font_Min_Ch, { Lowest character defined in font } &Font_Max_Ch : Char; { Highest character defined in font } &Sin_45 : Real; { Sine of 45 degrees } &Font_Ptr : ^Font_Image; { Pointer to current font image } &Pat_Rec : Pattern_Rec; { Information on active pattern } &Text_Rotations : Array [-1..1, -1..1] Of 0..6; & " "Procedure GRlock_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, `(`'`&`%`$`#`"`!0 0/Ė s0kj#98h 327#y%#~#y%᳟##y%#yi#~#yi$%!¿l!mj#x$#|#x$᳟##x$#xi#|#xi%$!¿m!lj#y#x%$# # 6#& 327#/"##y%##x$Ė!0y 0xk o098 (327n0 + j"*խn-"xi,"xh!)yl )xk)y$)~)y$᳟#)y$)ym)~)ym#$%¿k%ln`$$ rĆĆĆ0o''''' ' ' '' ' ''''''''''''''''!' '"N'.'- ','+!"#"777777"7#'(7'*%')&'(#'/ĖQ0/ Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0/Ėi0/Ė 0/Ė0/ Ė)`*P0/ Ė+?0/ "Z!281/-+)'%#)x#)|)x#᳟#)x#)xm)|)xm$#%¿l%kn')y)x$#) ) 6)&$#o)!) "jM(3270/&ĖM m098n&327j0o) h (թ+ xl* xkj'y$'~'y$᳟#'y$'yi'~'yi#$!¿k!lj'x#'|'x#᳟#'x#'xi'|'xi$#!¿l!kj%'y'x$#' ' 6'&$#m''y$''x# hQ&3270/"Ė 0hi!~e!} 6 y x"!z !  .!| 6 y x"!y !  .!{ 6 y x"!x !  . 0~0y 0|0x /.i.i /ihk րO#!!0h0!đ0 Ċ!րdr098h 3270~0|06% 3270/Ė` `p0/ĖP0NiQhN/Ą@@ N/ Od!PO~O}O|O{OzOy N/ ċOz7zO|O~OzN- N/ċPćO}N)PO}O}N)ćPĊPO}ćO{Oy7yP7yO{ćPĊPOyćPyPxN+PN+PyćPĄ@@O{O{Px@@!i xhN/@@7y7yQ N/ċ!ջQթQhi Ռ Od!PO l( (6),)o,o ( 'o'5*l)-6o ( 'o'-'*l0y,0yo,o ( 'o'5)l0y-6o ( 'o'-')l0x,0xo,o ( 'o'50ylt0x-6o ( 'o'-'0ylO*,*o,o ( 'o'50xl'*-6o ( 'o'-'0xlր$(/! ! ժ$k$B(nl&n&**m/&+%+m%,6ml-**ml))m/&+%+m%,6mlj-))ml_0y0ym/&+%+m%,6ml>-0y0yml10x~N*O~O~N*jN/ĊO~jO|Oz7z7zO|kN/ĊOzk"#N-N-"kN/ćN/PzN/!"Py#Px4!iOxhnN(2N(QĊ N(Qđ3N/ĖQ0h / "$" -R!#! +C98327  " ! '$ &#$#"!1987 /ĖP0i!98h 327!!y!x! 6!/ 327!/Ė 4`s04t4t4t0ĆĄ pP  0Ȅ  0Ȅ4^^0"u^vu^ Xu^s0/ p%4\v^\]0xm/&+%+m%,6ml-0x0xmlր$&/! /塠/$.mj&(0(/!&'.k'.k/&! &%.j%.j"#0y0x('&%,-0 0 600#/& ! /kh& #Vh  b f HihCih;ih2ih)ihihih ihր.f󿢇b󿢑!.f .b"0""uh"98:塤 (327/̆i j:)//+ ++' ''"y/"~"y/"x/"|"x/^4t4 ^4t4o^4t4 \]jd"t"n&զmih"!"k!k^$ #p #h"#j"4^vmi%"%P0__ć_!\ć_ ]ć^0/Ć`$\]`z``y``x`,d\]t$0/ )^4t(^4t'^4t4s 0j&k#~Ռ"y(i "y(%i"x'h "x'$h#}"6"y"x('#z%$! "*#|"6"y"x('#y%$! "*#{"6"y"x('#x%$! "* 0l&&$~%%$|ii$$ 98h 327$Z!>$yk$xj&$x&&$~h : * "y"x/!"" " 6"0+n'"o+r+r'r'r& /̄m /̄m' /̄l /̄l &%""m'&%$ l%!!m' $""l$!!l:D9 &&%Ċ&%ć%/&x5ć&x&+$Ċ$$ć#/$x5 "y"x/&%'$!"" " 6"0 /&%'$"!#x;:n$x&x$x&x#x%x ,"y"x&x%x&<kk"y"x$x#x'#<,"y"x&x%x&#<) (327"/ Ė/@%'$&`&%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$!$ 9 327$/!Ė 0k#y%j#x$i""#~!!#|"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$#!# 9 327#/Ė 0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|-/Ċ-/Ċ-/ $g$t% %t-/Ė6 0i#"B!98h 327'     (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, b>DvQ =*** HEAPOPS EXTRAIO STRINGOPEXTRAHEAFILEOPS REALOPS   { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } DRAWOK DRAWCLIPCURDISABCENTER BOTTOM CBLACK CBLUE CCYAN CGREEN CMAGENTACORE CRED CSRSIZE CSRISENA CSRISVIS CURENABLCURVISIBCURINVISCURFULL CURSMALLCURSORX CURSORY CYELLOW CWHITE DOWN DRAWINITDRAWINGC DRAWNOTI DRAWNOTF DRAWNOME DRAWNOFODRAWMAX 8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type DRAWOVER DRAWWINODRAWWINIFAST FILL FONTIMSIFONTMINC FONTMAXC FONTPTR OFF INTERIORGRINIT $GRCLEAR %GRBOX 'GRAREASO/GRARC 0 GRCIRPAT.GRFILLCI-GRLINE &GRTEXT ( GRRFILL )GRREAD +GRREGION1GRRPAT * GRSTART 2GRSCANUN 6GRSTOP 3GRUNPACK, GRWINDOW4GRYVAL 5LEFT LARGECUR = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record MAXCOORDMAINWINDMAXWINDOON REPLACE PLAIN PATTERNEPATIMSIZPATREC PLANESONSOLIDLINRIGHT SIN45 SMALLCURXOR UP TOP TEXTROTA 9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text colGRAFDRAW 4(  IV.0 [1e]or} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, { Columns per char } 9Font_Rows : Point; { Rows per char } 9   "Const Graf_Version = '0.6';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} &`*`$&%'r%' ``. $&``2 `0h'$ y6# x:r& y x$#=% y x"!='x&%dcba 0k#98h 327$l# $>aaaa # ##y#x$## 6-$: 327#y$#~#y$#x$#|#x$#/Ċ#/Ė0k%#yB$#xFri#98h 327# !Jbbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#/Ċ#/Ėw0w8 0-0+"0W&K<<W&SW&S""E &<yy Patxx.Ptrnn: Fontxx.Font: \=bKkw [  GT" ;"J 8 '     9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns`$$ rĆĆĆ0o''''' ' ' '' ' ''''''''''''''''!' '"N'.'- ','+!"#"777777"7#'(7'*%')&'(#'/ĖQ0/ Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0/Ėi0/Ė 0/Ė0/ Ė)`*P0/ Ė+?0/ "Z!281/-+)'%# in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coordinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw}  րO#!!0h0!đ0 Ċ!րdr098h 3270~0|06% 3270/Ė` `p0/ĖP0NiQhN/Ą@@ N/ Od!PO~O}O|O{OzOy N/ ċOz7zO|O~OzN- N/ċPćO}N)PO}O}N)ćPĊPO}ćO{Oy7yP7yO{ćPĊPOyćPyPxN+PN+PyćPĄ@@O{O{Px@@!i xhN/@@7y7yQ N/ċ!ջQթQhi Ռ Od!PO7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_B~N*O~O~N*jN/ĊO~jO|Oz7z7zO|kN/ĊOzk"#N-N-"kN/ćN/PzN/!"Py#Px4!iOxhnN(2N(QĊ N(Qđ3N/ĖQ0h / "$" -R!#! +C98327  " ! '$ &#$#"!1987 /ĖP0i!98h 327!!y!x! 6!/ 327!/Ė 4`s04t4t4t0ĆĄ pP  0Ȅ  0Ȅ4^^0"u^vu^ Xu^s0/ p%4\v^\]lock_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, $yk$xj&$x&&$~6Y_Length : Point); 6 "Procedure PLine_Abs (Var X_End, ;Y_End : Point_Array; ;Count : Integer); 7 "Procedure PLine_Rel (Var X_Length, ;Y_Length : Point_Array; ;Count : Integer); 7 Procedure Circle_Abs (X_Of_Edge, Y_Of_Edge : Point); " "Procedure Circle_Rel (Radius : Point); " "Procedure Define_Color (Index, :Red, :Green, :Blue, :Blink, :Hard_Copy : Integer); " "Procedure Inq_Color (Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer); " "Function Inq_Val&%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$!$ 9 327$/!Ė 0k#y%j#x$i""#~!!#|"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$#!# 9 327#/Ė 0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|-/Ċ-/Ċ-/ $g$t% %t-/Ė6 0i#"B!98h 327ue (Option : Integer) : Integer; " "Procedure Plane_Enable (Planes : Integer); " "Procedure Plane_Visible (Planes : Integer); " "Procedure Set_Palette (Pal_Name : String); " "Procedure Set_Value (Opcode, 7Value : Integer); " "Procedure Erase; " "Procedure Erase_Alpha; "  Procedure Flood; " "Procedure Arc_Rel (Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Var X_Start, 5Y_Start, 5X_End, 5Y_End : Integer); " "Procedure Arc_Abs (Var Radius : Integer; !y!x$"#+ 327!y"!~!x#!|!/Ċ!/Ċ!/ĖZ /[s0 5t0ewPe 0e 0Ȅ/[[0"u[}u[eXu[s0/ pխ/Wv՜ZYXWj"t5wlih"!"k!k[ #p #h"#j"/[vli$"$,0[[ć[Wć[XćY Z [/Ċ0/ Ą/s !0 0Ċ0 Ċ 00!!0/Ėx<=P0ռjixh  5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer);   Procedure Set_Region (X_Start, 8Y_Start, 8X_Length, 8Y_Length : Integer); 8  Procedure Set_Window (Window_Chain : Win_Rec_P); "  Implementation (m)l)m(l%̇¾o'kyx D,$ ,$ ր~-#-%#% -%ր,,$|j,$ ,$ ր-#% -#%ր,,$|j,#% ,#% ր-$ -$ր--$~jV,% ,%#% ,# ր-$ -$ր--$~jր"098/327- , n&՟&<&;ՉO-' -'~+᳡=-' -+~eGRAFDRAW 0/#1 i0/Ċ#1i#10~ 0~h0/Ċ#1h!" !0&"1 i0/Ċ"1i"10| 0|h0/Ċ"1h#! !0&0h96 / "" ~%!! |8327"!8327 /Ċ /ĖC0/ 9 8327  '9$ 8 327   980/Ėw0/91  8327 83270/ Ė0h"" ~ !! | / " !Ċ / Ċ / Ė0j"y$i"x#h!!"~ "|"/"!" Ċ"/ Ċ"/ ĖE(     36F6 V$D" Fu~tYN 6TȉN V 6RӉV 6N@H"6PF"1E"~u8FtN V V Ӌ VW6;R|uPYPPVH;~‡T;} ދ=^XQȋ@;} *-;~ދƇ_^;F";u_YSQRWVPA;}EZRV}΀2oo/:E"tF;}u[ZRWS*^_XX^_ZY[VWSQRH"D?:ZY[_^VWSQR l( (6),)o,o ( 'o'5*l)-6o ( 'o'-'*l0y,0yo,o ( 'o'5)l0y-6o ( 'o'-')l0x,0xo,o ( 'o'50ylt0x-6o ( 'o'-'0ylO*,*o,o ( 'o'50xl'*-6o ( 'o'-'0xlր$(/! ! ժ$k$B(nl&n&**m/&+%+m%,6ml-**ml))m/&+%+m%,6mlj-))ml_0y0ym/&+%+m%,6ml>-0y0yml10x6TJzupZY[_^ÄD"u];tY@3֊ʀE"t 3;u;vBq;}׃>t puuÄD"u;t@֊ʂـE"t 3;u;~Jq;뎋2oo/Ë D" D" D" Ü$+ȝuP#΀YIt(3âS[ptrptrPSQRA +Hx]أfF׆r!P^r uc>$ '*X0xm/&+%+m%,6ml-0x0xmlր$&/! /塠/$.mj&(0(/!&'.k'.k/&! &%.j%.j"#0y0x('&%,-0 0 600#/& ! /kh& #Vh  b f HihCih;ih2ih)ihihih ihր.f󿢇b󿢑!.f .b"0""uh"98:塤 (327/̆i j:)//+ ++' ''"y/"~"y/"x/"|"x/<uZY[X36T6R6N6PrvF1nrA8/&3PPSSPSP 336Vd6VnFFFF42FF F p tp u r r rˋF 6TF6RFH6NFH6PN V~Jv xL Ff Hx ؊FfHyNzt^Ft t^#'F &'FuF)'%'F('&'''#'$'v('6%'2 u:Vu 6C΀tuƊVt:vuЊ-O''uh : * "y"x/!"" " 6"0+n'"o+r+r'r'r& /̄m /̄m' /̄l /̄l &%""m'&%$ l%!!m' $""l$!!l:D9 &&%Ċ&%ć%/&x5ć&x&+$Ċ$$ć#/$x5 "y"x/&%'$!"" " 6"0 /&%'$"!#x;:n$x&x$x&x#x%x ,"y"x&x%x&<kk"y"x$x#x'#<,"y"x&x%x&#<) (327"/ Ė/@%'$&`$'N ''^2t $':Nt낈6%'('*2*2)'VuV0f F׆r$^Pr u uX<u{)'.)'%':Ntv''&'>ruFF$'#':Nt{F^VN 2 y  y ;s £ ȋ)+؉ FN ^V hubF^N V N IFףX)F׊ ÊZ)CCkF6T%tY+؋F ;vãF)F V6X).Z)r&`*`$&%'r%' ``. $&``2 `0h'$ y6# x:r& y x$#=% y x"!='x&%dcba 0k#98h 327$l# $>aaaa # ##y#x$## 6-$: 327#y$#~#y$#x$#|#x$#/Ċ#/Ė0k%#yB$#xFri#98h 327# !Jbbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#/Ċ#/Ėw0w8 0-0+"0W&Q ^ru:Yu.Z)F %tWرNV^)^ B6X).Z)r"Q^ruYu.Z)F tDNV6X).Z)rQ\^ruVjYu^VFNt^VFNF t*~ u3ۉ*^*F*F *F*F****6**6O*B6**;F u v*;Vtuӡ*=rRJ*VF >Z^v@T*F;*w)*Z*.*K<<W&SW&S""E &<yy Patxx.Ptrnn: Fontxx.Font: \=bKkw  &F}G@FK@JIxpLvL***F6**;FtËVN 2 y  y zѻ @ tb t^NVfF׆׋v r,P^r uw] `cX<u2^CC,ك+K,,Ny3ɋ^,2ۋv6 Au~65F~ 6F ~6=F;,t;,u v6,uFـt~65~ 6~6=,NN N,Na^ ^ ^36ЎF 6T%-NAAuJ_Y9lrùH(hr rù/ 3ɻputùp up trCp6T6RQP+ʸ@YʋXQX$ ËvKyvF 3Vt^;~;Vu N;N|GO3ۋF;~;Vu N;|GًI/ʀ;VuG3tF tN;} F t^RWPS [X_Z tu u2;Fu~u'NA:uC tN9Nu NA:uN y3;~NV{{N+N uV+V6 f*,' ,*|,' ,'|,ր%-,&`(`'`&`%`$`#`"`!0 0/Ė s0kj#98h 327#y%#~#y%᳟##y%#yi#~#yi$%!¿l!mj#x$#|#x$᳟##x$#xi#|#xi%$!¿m!lj#y#x%$# # 6#& 327#/"##y%##x$Ė!0y 0xk o098 (327n0 + j"*խn-"xi,"xh!)yl )xk)y$)~)y$᳟#)y$)ym)~)ym#$%¿k%lnF׆׋v r,P^r u X<uËFH3N߃;} x I+FNFV3N߃;;~ x I+F݉v )x#)|)x#᳟#)x#)xm)|)xm$#%¿l%kn')y)x$#) ) 6)&$#o)!) "jM(3270/&ĖM m098n&327j0o) h (թ+ xl* xkj'y$'~'y$᳟#'y$'yi'~'yi#$!¿k!lj'x#'|'x#᳟#'x#'xi'|'xi$#!¿l!kj%'y'x$#' ' 6'&$#m''y$''x# hQ&3270/"Ė 0hi!~e!} 6 y x"!z !  .!| 6 y x"!y !  .!{ 6 y x"!x !  . 0~0y 0|0x /.i.i /ihk(     6+Nv+ډ^؃NxQ~3V 6;PpN S-׀&ptrptrĊ-*~3ۊ-s6C;^u-<uYNF muGuptrptr tPy +y3CJy3ҋ6+>Nv+B t)y +y3@Iy3ɋ6+>Pv+A t 3~ >*/ tq++;>*/t>*/` y  + OF;ru ;>*/t4V+yF3JRV +yG3JRVWvvv RKSN+Ay36N++y؉ۉ V 6;P(Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, QVYV +xK[V +By36P++}؉ۉ N+xRZN6;NZ0fF׆rP^ru X<uF ^ vVNXF^v VNFN0v 2u+H3N3;0t0i x++++IF;vu3 uVJ@ u^ K;xu ;0t&H0N0H3v 0Hv2303c3++xB;Vu3@ xE++++WPV+>0vW@)_0 ^X_+0;Vr+VC;^u3I0 uvN;xBH { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } Vy+36>P++GyF;v|+vً0+ًOANy+3;^ r+^ 6.N++EyXNV^ v~FUPSQVWRJ@Fy+3;^ |+^ 6>N++Gy׋~ϽXV^ FNvWxEY6;P ZRNV2Z_^Y[X]USRQFy~+3;v|+v6P++B}~}V0R+0J6+Nx3+0R+0ANy+3;^ |+^ XNVF~v^ P tx0F FX FXx t 9FtFYZ[]&3 &&3~)&3)&3$,&3\)&3+'&3*&3-&3,&3,/&308Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type &4J"&4&4&&$4&&.4&&84&&B4L &L4  [  # GT" ;"J 8 b>DvQ >l323+333(21111q1a1U1N1E11000n0e0a0<08020,0//////W/Q/B/5/0/..{.T.O.J.G.B.>..------a-X-R---,,,,,,|,x,c,_,[,U,O,K,E,,,, ,,++++++++++++++|+p+b+^+Z+W+T+P+J+D+>+6+/+ ++*****S*O*<*9*(*))))))))))))S)K)G)C)7)2),)(((((((((((n(e(a(R(K(D( = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record :(7(.(*((((''''''''''''y'r'O' 'S&J&A&8&%%%%%%%%%%l%h%d%&%%%%% %%%$$$$u$?$$$$#####^#"""s"d"]"X"S"N"E . +  p\WJ1 3333333333333333333333444444$4"4.4,48464B4@4L4J40X22M3n"x&&"$ &&)-""&&&2.// 0223"&&../S0L223"&'*** HEAPOPS EXTRAIO STRINGOPEXTRAHEAFILEOPS REALOPS  9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text colGRAFDRAW 2(  IV.0 [1e]or} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, { Columns per char } 9Font_Rows : Point; { Rows per char } 9   "Const Graf_Version = '0.6';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented} 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns)     N(O~O~N(jN-ĊO~jO|Oz7z7zO|kN-ĊOzk"#N+N+"kN-ćN-PzN-!"Py#Px4!iOxhnN&2N&QĊ N&Qđ3N-ĖQ0h - "$" +R!#! )C98327  " ! %$ $#$#"!1987 -ĖN0i!98h 327!!y!x! 6!/ 327!-Ė 4`s04t4t4t0ĆĄ ]P  0Ȅ  0Ȅ4^^0 u^cu^ Xu^s0- p%4\v^\]lock_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, $yk$xj&$x&&$~&6Y_Length : Point); 6 "Procedure PLine_Abs (Var X_End, ;Y_End : Point_Array; ;Count : Integer); 7 "Procedure PLine_Rel (Var X_Length, ;Y_Length : Point_Array; ;Count : Integer); 7 Procedure Circle_Abs (X_Of_Edge, Y_Of_Edge : Point); " "Procedure Circle_Rel (Radius : Point); " "Procedure Define_Color (Index, :Red, :Green, :Blue, :Blink, :Hard_Copy : Integer); " "Procedure Inq_Color (Var Index, ;Red, ;Green, ;Blue, ;Blink, ;Hard_Copy : Integer); " "Function Inq_Val%$#$"$y%%%$|&%$#$"Ċ$y$x&$y%$x$ $ 6$'$ /$$y$x&$y%$x$ 6$)&$y%$x$$9 327$-!Ė 0k#y%j#x$i""#~!!#|"!d## 98h 327##y#x%$# # 6#'# ###y#x%$# 6#) %$##9 327#-Ė 0/.թh./j "tmg"tlf"tk#o ./( ' & , -98i!327--y--x./f./9--y--x!327f#t-y.-~-x/-|--Ċ--Ċ-- $g$t% %t--Ė4 0i#"B!98h 327!yue (Option : Integer) : Integer; " "Procedure Plane_Enable (Planes : Integer); " "Procedure Plane_Visible (Planes : Integer); " "Procedure Set_Palette (Pal_Name : String); " "Procedure Set_Value (Opcode, 7Value : Integer); " "Procedure Erase; " "Procedure Erase_Alpha; "  Procedure Flood; " "Procedure Arc_Rel (Radius : Integer; 5Start_Angle, 5End_Angle : Real; 1Var X_Start, 5Y_Start, 5X_End, 5Y_End : Integer); " "Procedure Arc_Abs (Var Radius : Integer; !x$"#+ 327!y"!~!x#!|!-Ċ!-Ċ!-ĖW /[s0 5t0edPe 0e 0Ȅ/[[0 u[ju[eXu[s0- pլ/Wv՛ZYXWj"t5vlih"!"k!k[? #p #h"#j"/[vli$"$,0[[ć[Wć[XćY Z [-Ċ0- Ą/s !0 0Ċ0 Ċ 00!!0-Ėu<=P0ջjixh  5Var Start_Angle, 9End_Angle : Real; 9X_Start, 9Y_Start, 9X_End, 9Y_End : Integer);   Procedure Set_Region (X_Start, 8Y_Start, 8X_Length, 8Y_Length : Integer); 8  Procedure Set_Window (Window_Chain : Win_Rec_P); "  Implementation (m)l)m(l%̇¾o'kyx D,$ ,$ րk-#-%#% -%րp,,$|j,$ ,$ րx-#% -#%ր},,$|j,#% ,#% ր-$ -$ր--$~jV,% ,%#% ,# ր-$ -$ր--$~jր"098/327- , n&՞&<&;ՈO-' -'~+᳡=-' -+~*>GRAFDRAW 0-#1 i0-Ċ#1i#10~ 0~h0-Ċ#1h!" !0&"1 i0-Ċ"1i"10| 0|h0-Ċ"1h#! !0&0h96 - "" ~%!! |8327"!8327 -Ċ -ĖC0- 9 8327  '9$ 8 327   980-Ėw0-91  8327 83270- Ė0h"" ~ !! | - " !Ċ - Ċ - Ė0j"y$i"x#h!!"~ "|"-"!" Ċ"- Ċ"- ĖC,' ,*|,' ,'|,ր$-,?&`(`'`&`%`$`#`"`!0 0-Ė q0kj#98h 327#y%#~#y%᳟##y%#yi#~#yi$%!¿l!mj#x$#|#x$᳟##x$#xi#|#xi%$!¿m!lj#y#x%$# # 6#& 327#-"##y%##x$Ė!0y 0xi o098 (327n0 + j"*խn-"xi,"xh!)yl )xk)y$)~)y$᳟#)y$)ym)~)ym#$%¿k%ln)x`$$ rĆĆĆ0o''''' ' ' '' ' '''''''''''''''''' ;','+ '*')!"#"777777"7#'&7'(%''&'&#'-ĖO0- Ė&xh`%Ċ%`$Ċ$`#Ċ#"!0-Ėi0-Ė 0-Ė0- Ė)`*P0- Ė+=0- "Z!281/-+)'%# in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coordinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw}  ր<#!!0h0!đ0 Ċ!րQp098h 3270~0|06% 3270-Ė` `p0-ĖP0NiQhN-Ą@@ N- Od!PO~O}O|O{OzOy N- ċOz7zO|O~OzN+ N-ċPćO}N'PO}O}N'ćPĊPO}ćO{Oy7yP7yO{ćPĊPOyćPyPxN)PN)PyćPĄ@@O{O{Px@@!i xhN-@@7y7yQ N-ċ!ջQթQhi Ռ Od!PO~7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_B)     #)|)x#᳟#)x#)xm)|)xm$#%¿l%kn')y)x$#) ) 6)&$#o)!) "jM(3270-&ĖK m098n&327j0o) h (թ+ xl* xkj'y$'~'y$᳟#'y$'yi'~'yi#$!¿k!lj'x#'|'x#᳟#'x#'xi'|'xi$#!¿l!kj%'y'x$#' ' 6'&$#m''y$''x# hQ&3270-"Ė 0hi!~e!} 6 y x"!z   .!| 6 y x"!y   .!{ 6 y x"!x   . 0~0y 0|0x /.i.i /ihk36F6 R$! Fu~tYN 6PȉN V 6NӉV 6J@!6L!1!~u8FtN V V Ӌ VW6;N|uPYPPVH;~‡T;} ދ=^XQȋ@;} *-;~ދƇ_^;!;u_YSQRWVPA;}EZRV}΀2oo/:!tF;}u[ZRWS*^_XX^_ZY[VWSQR!D?:ZY[_^VWSQR6PJzupZY[_^Ä!u];tY@3֊ʀ!t  l( (6),)o,o ( 'o'5*l)-6o ( 'o'-'*l0y,0yo,o ( 'o'5)l0y-6o ( 'o'-')l0x,0xo,o ( 'o'50ylt0x-6o ( 'o'-'0ylO*,*o,o ( 'o'50xl'*-6o ( 'o'-'0xlր$(/! ! ժ$k$B(nl&n&**m/&+%+m%,6ml-**ml))m/&+%+m%,6mlj-))ml_0y0ym/&+%+m%,6ml>-0y0yml10x3;u;vBq;}׃>t puuÄ!u;t@֊ʂـ!t 3;u;~Jq;뎋2oo/Ëx !z !v !v Ü$+ȝuP#΀YIt(3âS[ptrptrPSQRA +Hx]أࣴfF|׆r!P^r uc>$ '*X<uZY[X36P6N6J6LrvF1nrA8/0xm/&+%+m%,6ml-0x0xmlր$&/! /塠/$.mj&(0(/!&'.k'.k/&! &%.j%.j"#0y0x('&%,-0 0 600#/& ! /kh& #VQ f f b fd f-8.i/h5/i.h//i.h(.i/h!.i/h/i.h/i.h .i/hր(d󿢇b󿢑!(d (b0mh98:塤 (327!̆ij:)!!   y!~y!x!|x!h : * &3PPSSPSP 336Rd6RnFFFF42FF F p tp u r r rˋF 6PF6NFH6JFH6LN V~Jv xL Ff Hx ؊FfHyNzt^Ft t^&F &FuF&&F&&&&&v&6&2 u:Vu 6C΀tuƊVt:vuЊ-O&u&N &^2t &:Nt낈6&&*2䣲*2&yx!!"  60norrrr& !̄m !̄m' !̄l !̄l &%""m'&%$ l%!!m' $""l$!!l:D9 &%Ċ%ć!x5ćx+Ċ$ć!x5 yx!&%'$!"  60 !&%'$"!x;:nxxxxxx ,yxxx&<kkyxxx'#<,yxxx&#<) (327- Ė!#%"$`` `"$#%r#VuV0f F|׆r$^Pr u uX<u{&.&&:Ntv&&>ruFF&&:Nt{F^VN 2 y  y ;st £ ȋ)+؉ FN ^V hubF^N V N IF|ף )F׊ Ê )CCkF6P%tY+؋F ;vãF)F V6 ). )rQ ^ru:Yu. )F %tWر裲NV^)^ B% ``# "$``&f`j0h'$ y)# x,r& y x$#=% y x"!='x&%dcba 0k#98h 327$l# $/aaaa # ##y#x$## 6-$: 327#y$#~#y$#x$#|#x$#-Ċ#-Ė0k%#y2$#x5ri#98h 327# !8bbbb # ##y#x!## 6-!: 327#y!#~#y!#x!#|#x!#-Ċ#-Ėw.w8 0+0)"0W&K<<W&SW&6 ). )r"Q^ruYu. )F tDNV6 ). )rQ\^ruVjYu^VFNt^VFNF t裉*~ u3ۉ*^*F*F *F*F****6**6O*B6**;F u v*;Vtuӡ*=rRJ*VF` >Z^v@T*F;*w)*Z*.*vL***F6**;FtËVN 2 y  y zѻp @S""E &<yy Patxx.Ptrnn: Fontxx.Font: \=bKkw  &F}G@FK@JIxpL_Y9lrùH(hr rù/ tb t^NVfF|׆׋v r,P^r uw] `cX<u2^CC,ك+K,,Ny3ɋ^,2ۋv6 Au~65F~ 6F ~6=F;,t;,u v6,uFـt~65~ 6~6=,NN N,Na^ ^ ^36ЎF 6P%v-NAAuJ6+Jv+ډ^؃NxQ~3V 6;LpN Sw-`׀ 3ɻputùp up trCp6P6NQP+ʸ@YʋXQX$ ËvKyvF 3Vt^;~;Vu N;N|GO3ۋF;~;Vu N;|GًI/ʀ;VuG3tF tN;} F t^RWPS [X_Z tu u2;Fu~u'NA:uC tN9Nu NA:uN y3;~NV{{N+N uV+V6h fF|׆׋v r,P^r u X<uË&ptrptrĊv-*~3ۊw-s6C;^uw-<uYNF muGuptrptr tPy +y3CJy3ҋ6+>Jv+B t)y +y3@Iy3ɋ6+>Lv+A t 3~ >. tq++;>.t>.` y  + OF;ru ;>.t4V+yF3JRV +yG3JRVWvvv RKSN+Ay36J++y؉ۉ V 6;LQVYV +xK[V +By36L++}؉ۉ N+xRZNFH3N߃;} x I+FNFV3N߃;;~ x I+F݉v *      Z  FS :!7 | 7 a=CvQ >3222211{1o1`1#11110000P0 000////////w/3/ //...P.<.-...---------O-B-- --,,,,w,`,],7,.,*,,, ,,,++++++++++++z+n+j+`+]+R+B+6+3+.+"+++ + +++*******W*S*F*C*9***)))))))f)b)])Y)G)C)=)2))((((((((((((q(l(d(](U( ((((''''''''''d'^'W'T'Q'N'K'F'?';'2'+'$''&&%%%%~%u%q%h%d%_%Z%Q%G%%%%$$$$$$$$$^$>$9$'$#######H##c"]"T"%""" """z" J3H3T3R3^3\3h3f3r3p3|3z333333333333333333333333333q0 2b22 "*&1&D9"#%&|)-IF""%&&-.//1}22Y"%&-./01K22P"%'*** HEAPOPS EXTRAIO STRINGOPEXTRAHEAFILEOPS REALOPS  $CURSOR $EQUAL $LOG $LAST $SYNTAX $TAG 2 1 }}g2V c O.RG6;JZ0fF|׆rP^ru X<uF ^ vVNTF^v VNFN]0v 2u+H3N3;]0t]0i x++++IF;vu3 uVJ@ u^ K;xu ;]0t&H[0N]0H3v W0Hv23Y03c3++xB;Vu3@ xE++++WPV+>Y0vW@)_Y0 ^X_+Y0;Vr+VC;^u3IY0 uvN;xBHVy+36>L++GyF;v|+vً[0+ًOANy+3;^ r+^ 6.J++EyTNV^ v~FUPSQVWRJ@Fy+3;^ |+^ 6>J++Gy׋~ϽTV^ FNvWxEY6;L ZRNV2Z_^Y[X]USRQFy~+3;v|+v6L++B}~}V[0R+[0J6+Jx3+[0R+[0ANy+3;^ |+^ TNVF~v^ P txW0F FX FXx t 9FtFYZ[]&J3%&T30)&^3(&h3+&r3)&|3&&3*&3x-&3,&3.&3_0&3!&3v&3&&3x&&3&&3&&3&37 *     +     +     ,     ,     -     -     .     .     /     /     0     0     1     1     2     2     3     3     4     4     5     5     6     6     7     7     8     8     9     9     :     :     ;     ;     <     <     =     =     >     >     ?     ?     @     @     A     A     B     B     C     C     D     D     E     E     F     F     G     G     H     H     I     I     J     J     Pat_Type;  Planes, $X_Max_2, $Y_Max_2, $Reg_X, $Reg_Y, $Reg_X_Size, $Reg_Y_Size : Integer;   "Function Read_Key (Allowed : Char_Set) : Char; "Var Ch : Char; &Hit_Digit : Boolean; &Move_Mult : Integer; &W : Win_Rec; "Begin $Move_Mult := 1; $Hit_Digit := False; $Repeat &Read (Keyboard, Ch); $ If Eoln (Keyboard) Then (Ch := Chr (CR); $ W := Core^.Window_List^; &With Core^.Window_List^ Do (Case Ord (Ch) Of *Down_Key : Win_Y_Org := Win_Y_Org + Move_Mult; *Up_Key : Win_Y_Org := Win_Y_Org - Move_Mult; *Right_Key : Win_X_Org := Win_X_Org - Move_Mult; *BS_Key, *Left_Key : Win_X_Org := Win_X_Org + Move_Mult; ( Home_Key : Begin 8Win_X_Org := 0; 8Win_Y_Org := 0; 6End {of Home_Key}; *48, 49, 50, {'0'..'9'} *51, 52, 53, *54, 55, 56, *57 : Begin 8If Not Hit_Digit Then :Move_Mult := 0; 8Move_Mult := Move_Mult * 10 + Ord (Ch) - Ord ('0'); 6 Hit_Digit := True; 6End {of '0'..'9'}; (End {of Case}; $ If W <> Core^.Window_List^ Then (Begin *Hit_Digit := False; *Set_Window (Core^.Window_List); *If (Core^.Draw_Result <> Draw_OK) And Print_Errors Then ,Writeln (' Draw result on window movement was ', Core^.Draw_Result); *If Core^.Draw_Result >= Draw_Overflow Then ,Core^.Window_List^ := W; (End {of If W}; $Until Ch In Allowed; " Read_Key := Ch; "End {of Read_Key}; " " " "Procedure Check_Result (Expected : Result_Set); "Var Ch : Char; "Begin " If Not (Core^.Draw_Result In Expected) Then &If Print_Errors Then (Begin *Write ('Unexpected draw result ', Core^.Draw_Result, '; Hit [RETURN]'); *Ch := Read_Key ([Chr (CR)]); (End {of If Check_Result}; " Core^.Draw_Result := 9; {Just to see if it changes} "End {of Check_Result}; " " " "Function Do_Test (S : String) : Boolean; "Var Ch : Char; "Begin $Write ('Test ', S, ' (Y/N/Esc) ? '); $Ch := Read_Key (['y', 'Y', 'n', 'N', Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Do_Test := Ch In ['Y', 'y']; $Writeln (Ch); $If Ch In ['Y', 'y'] Then &Erase; $Erase_Alpha; $Goto_XY (0, 24); "End {of Do_Test}; " " " "Procedure Continue; "Var Ch : Char; "Begin $Write ('Type to continue'); $Ch := Read_Key ([Chr (CR), Chr (Esc)]); $If Ch = Chr (Esc) Then &Exit (Test_Core); $Erase_Alpha; $Goto_XY (0, 24); "End {of Continue}; " " " "Procedure Test_Cursor; " $Procedure Box_Cursor (Size : Integer); $Var I : Integer; $Begin &Size_Cursor (Size); &Check_Result ([Draw_OK, Draw_Clipped]); &For I := 0 To Core^.X_Max Do (Begin *Move_Cursor (I, 0); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.Y_Max Do (Begin *Move_Cursor (Core^.X_Max, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (I, Core^.Y_Max); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.Y_Max Downto 0 Do (Begin *Move_Cursor (0, I); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := 0 To Core^.X_Max Do (Begin *Move_C Program Test_Core;  Uses {$U Grafdraw.Code} Graf_Draw;  Const Print_Errors = False; &Esc = 27; { Escape key }  CR = 13; { Return key } &Up_Key = 31; { Up arrow key } &Down_Key = 10; { Down arrow key } &Right_Key = 28; { Right arrow key } &Left_Key = 15; { Left arrow key }  BS_Key = 8; { Backspace key } &Home_Key = 25; { Home key }  Type Result_Set = Set Of Draw_OK..Draw_Max;  Char_Set = Set Of Char;  Var Font_ID : Font_Type; $Pat_ID : ursor (I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &For I := Core^.X_Max Downto 0 Do (Begin *Move_Cursor (Core^.X_Max - I, Round (Core^.Y_Max / Core^.X_Max * I)); *Check_Result ([Draw_OK, Draw_Clipped]); (End {of For}; &Continue; $End {of Box_Cursor}; $ "Begin {of Test_Cursor} $Set_Cursor (Cur_Enable); $Check_Result ([Draw_OK]); $Set_Cursor (Cur_Visible); $Check_Result ([Draw_OK, Draw_Clipped]); $Continue; $Box_Cursor (15);  Program Test_Core;  Uses {$U Grafdraw.Code} Graf_Draw;  Const Print_Errors = False; &Esc = 27; { Escape key }  CR = 13; { Return key } &Up_Key = 31; { Up arrow key } &Down_Key = 10; { Down arrow key } &Right_Key = 28; { Right arrow key } &Left_Key = 15; { Left arrow key }  BS_Key = 8; { Backspace key } &Home_Key = 25; { Home key }  Type Result_Set = Set Of Draw_OK..Draw_Max;  Char_Set = Set Of Char;  Var Font_ID : Font_Type; $Pat_ID : K     ,Check_Result ([Draw_OK]); ,Line_Abs (1, Round (Glob_Y_Max / Glob_X_Max * I)); ,Check_Result ([Draw_OK]); *End {of For};  &End {of With}; "End {of Test_Line};    "Procedure Test_Box; "Var I : Integer; & &Procedure Draw_Boxes (Display : Display_Type; ?@ABCDEFGHIJKLMNO'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; , ,Move_Abs (Start_X + Font_Cols *Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max - Y_Max Div 20 + 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 + 3, Y_Max Div 20 + 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (Y_Max Div 20 - 3, Y_Max Div 20 - 3, Y_Max Div 10); *Clip_Circle (Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max - Y_Max Div 20 - 3, 7Y_Max Div 10);  24 * Mag, 6Start_Y - (24 * Font_Cols + Font_Rows) * Mag); ,Char_Path := Left; ,Top_Bottom := Bottom; ,Left_Right := Right; ,Set_Charup (0, -1); ,Text ('PQRSTUVWXYZ[\]^_`abcdefg'); ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; 4 ,Move_Abs (Start_X - Font_Rows * Mag, 6Start_Y - 24 * Font_Cols * Mag); ,Char_Path := Up; ,Top_Bottom := Bottom; ,Left_Right := Left; ,Set_Charup (-1, 0); ,S := 'hijklmnopqrstuvwxyz{|}~ ';  S[Length(S)] := Chr (127); ,Text (S); *Clip_Circle (X_Max - Y_Max Div 20 - 3, Y_Max Div 20 - 3, 7Y_Max Div 10); ( *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, 0, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (0, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, Y_Max, Succ (X_Max)); *Continue; *Erase; *Check_Result ([Draw_OK]); *Clip_Circle (X_Max, 0, Succ (X_Max)); (End {of With}; $End {of Do_Circles};   $Procedure Circle_Groups (OvlL      = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; 'Win_Rec_P = ^Win_Rec; 'Win_Rec = Record 9Next_Window : Win_Rec_P; 9Win_X_Org, { Global drawspace coordinates } 9Win_Y_Org, 9Disp_X_Org, { Display screen coordinates } 9Disp_Y_Org, 9Win_X_Size, { Window size in pixels } 9Win_Y_Size : Point; 7End {of Win_Rec}; ' 'Core_Record = Record  { GrafDraw Graphics Unit }  { by }  { Barry Demchak, Software Construction Inc. }  { for Ticom }  { December 30, 1982 }   {$R-,I- for speed only}  {$D Debug_Arcs-}  Unit Graf_Draw;  {*** Does Overlay_Mode apply to pixel blocks ? }  {*** Find out what the text plane options mean for Set_Value }   (*  10 Feb 84 BD Fixed text down dra9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text colw to clip correctly instead of early  15 Aug 83 BD Added {$N} directives where appropriate  15 Aug 83 BD Added Overlay_Mode parameter to Text procedure for XOR mode  15 Aug 83 BD Verified and corrected clipping in all routines  15 Aug 83 BD Added Window and Region routines and suppport throughout  15 Aug 83 BD Fixed all routines to accept Enabled parameter as color mask  15 Aug 83 BD Recoded arc clipping routines (WHAT A BITCH!)  01 Jul 83 BD Added Draw_Result status variable or} 9Background : Color_Index; { Background color } ; 9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, { Columns per char } 9Font_Rows : Point; { Rows per char } 9  01 Jul 83 BD Added Set_Region call  01 Jul 83 BD Added Core fields for Global coordinate values  01 Jul 83 BD Added in Disp fields in Core record for windowing  10 Mar 83 BD Added clipping for lines and the cursor  10 Mar 83 BD Added version identifier, Graf_Version  08 Mar 83 BD Added Arc code and made circle procs call it  02 Mar 83 BD Added Flood procedure to do solid area filling  23 Feb 83 BD Added file prefix variable in CORE  23 Feb 83 BD Fixed incorrect memory space error handling9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below text } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in Write_Block...  23 Feb 83 BD Made initialized CORE variables consistent with RAMTEK  *)   Interface  "Const Graf_Version = '0.6';  (Draw_OK = 0; {Nominal draw result} (Draw_Clipped = 1; {Draw performed, figure clipped} (Draw_Init = 2; {Draw variables at initial state} (Draw_Overflow = 10; {Draw ignored, coordinate out of range} (Draw_Not_Imp = 11; {Draw ignored, feature not implemented}  in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 9 9Region_X_Org, 9Region_Y_Org : Point; {Draw region origin} 9 9Window_List : Win_Rec_P; {Chain of window records} 9Win_X_Res, 9Win_Y_Res : Point; {Deltas for window coords} 9 9Glob_X_Min, 9Glob_X_Max, 9Glob_Y_Min, 9Glob_Y_Max : Point; {Global coordinates} 7 9Draw_Result : Draw_OK..Draw_Max; V{Result of last draw} (Draw_Not_Found = 12; {Draw ignored, file not found} (Draw_No_Memory = 13; {Draw ignored, not enough memory} (Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} " Draw_Win_Imp = 15; {Draw ignored, implementation restrict} (Draw_No_Font = 16; {Draw ignored, no font defined} (Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " Procedure Write_B { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } ,Text_Index := Succ (Text_Index) Mod 8; ,Continue; * *End {of For}; $End {of Test_Rotations}; & & " $Procedure Test_Direction (Dir : Direction); $ &Procedure Test_Position (Horiz, Vert : Directions); &Var Horiz_Name, *Vert_Name : String; &Begin (Case Horiz Of *Left : Horiz_Name := 'Left - '; *Center : Horiz_Name := 'Center - '; *Right : Horiz_Name := 'Right - '; (End {of Case}; (Case Vert Of *Top : Vert_Name := 'Top'; *Center : Vert_Name := 'Center'; *Bottom : Vert_Name :=8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position } 8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type  'Bottom'; (End {of Case}; (Core^.Top_Bottom := Vert; (Core^.Left_Right := Horiz; (Text (Concat (Horiz_Name, Vert_Name)); (Core^.Text_Index := Succ (Core^.Text_Index) Mod 8; (Continue; &End {of Test_Position}; $ $ $Begin {of Test_Direction} $ Core^.Char_Path := Dir; &Test_Position (Left, Bottom); &Test_Position (Left, Center); &Test_Position (Left, Top); &Erase; &Test_Position (Center, Bottom); &Test_Position (Center, Center); &Test_Position (Center, Top); &Erase; L     lock_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1,