{

                   T P R O    N U M B E R    3

   The following is a set of procedures that we have been used in
various commercial programs. Feel free to use them for commercial
and noncomercial uses. We claim no responsibility to the outcome of
the use of these procedures. You are using them at your own risk.
Enough of the legalities. If you find these routines useful, we
would greatly appreciate any small donation.




                                Soft-Touch Computers
                                James Billmeyer
                                7716 Balboa Blvd, Unit D
                                Van Nuys, Ca  91406
 }


program ddatest(input,output);

type
   line_info = record
                  x1,
                  y1,
                  x2,
                  y2 :  integer;
               end;

var
   xdir,ydir     :  integer;
   i,j           :  integer;
   x1,x2,x21,x22,
   y1,y2,y21,y22 :  integer;
   line1,line2   :  line_info;



procedure drawline(var line: line_info);

(**************************************************)
(*  The drawline procedure  draws line  at about  *)
(*  13,000 pixel per second  in  hires  graphics  *)
(*  mode. There is not any  boundery  or  window  *)
(*  checking in this procedure.                   *)
(*  The input must be  of the  line_info  record  *)
(*  format, where x1,y1,x2,y2 locate  the  line.  *)
(*  Each pixel of the line  i s xored  onto  the  *)
(*  screen. Draw a line once to place  it on the  *)
(*  screen, draw it once again to remove it.      *)
(*  variables  "XDir" and "YDir" must be defined  *)
(*  before entering the drawline procedure.       *)
(*  This procedure work on all versions of Turbo  *)
(*  Pascal.                                       *)
(**************************************************)


begin

   inline ($55/$8B/$EC/$8B/$76/$08/$8B/$0C/$8B/$54/$02/$BF/$01/$00/$B8/$00/$B8/
           $8E/$C0/$8B/$44/$04/$2B/$C1/$7D/$04/$F7/$DF/$F7/$D8/$89/$3E/Xdir/$BF/
           $01/$00/$8B/$5C/$06/$2B/$DA/$7D/$04/$F7/$DF/$F7/$DB/$89/$3E/Ydir/$3B/
           $D8/$7E/$0C/$8B/$F3/$46/$8B/$FB/$F7/$DF/$D1/$FF/$EB/$0C/$90/$8B/$F0/
           $46/$8B/$F8/$F7/$DF/$D1/$FF/$03/$F8/$53/$51/$50/$8B/$C2/$8A/$E0/$25/
           $FE/$01/$D1/$E0/$D1/$E0/$D1/$E0/$8B/$D8/$80/$E7/$07/$D1/$E0/$D1/$E0/
           $03/$D8/$8B/$C1/$80/$E1/$07/$D1/$F8/$D1/$F8/$D1/$F8/$03/$D8/$B0/$80/
           $D2/$E8/$26/$30/$07/$58/$59/$5B/$4E/$74/$18/$83/$FF/$00/$7C/$0B/$03/
           $0E/Xdir/$2B/$FB/$83/$FF/$00/$7D/$bb/$03/$16/Ydir/$03/$F8/$EB/$b3/$5D)
end;


begin  (* main program *)
   graphmode;
   hires;
   palette(3);
   hirescolor(white);
   gotoxy(24,1); write('Turbo Pascal Draw procedure Demo');
   for i := 1 to 100  do
      begin
         x21 := x1;
         y21 := y1;
         x22 := x2;
         y22 := y2;
         x1 := 1+i;
         y1 := 200-i;
         x2 := 640-i;
         y2 := 1+i;
         draw(x21,y21,x22,y22,0);
         draw(x1,y1,x2,y2,1);
      end;
   draw(x1,y1,x2,y2,0);
   gotoxy(22,1); write('Soft-Touchs DrawLine procedure Demo');
   with  line1  do
      begin
         x1 := 0;
         y1 := 0;
         x2 := 0;
         y2 := 0;
      end;
   for j := 1 to 3  do
      for i := 1 to 200  do
         begin
            line2 := line1;
            with  line1  do
               begin
                  x1 := 1+i;
                  y1 := 200-i;
                  x2 := 640-i;
                  y2 := 1+i;
               end;
            drawline(line2);
            drawline(line1);
         end;
   textmode(bw80);
   textcolor(lightgray);
end.  (* main program *)
 