home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / misc / doscyber / src / doscyber.c < prev    next >
Encoding:
Text File  |  1995-02-16  |  47.6 KB  |  1,583 lines

  1. eat
  2.     Color := RandColor;
  3.     SetColor(Color);
  4.     SetFillStyle(Random(CloseDotFill)+1, Color);
  5.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  6.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  7.   until KeyPressed;
  8.   WaitToGo;
  9. end; { RandBarPlay }
  10.  
  11. procedure ArcPlay;
  12. { Draw random arcs on the screen }
  13. var
  14.   MaxRadius : word;
  15.   EndAngle : word;
  16.   ArcInfo : ArcCoordsType;
  17. begin
  18.   MainWindow('Arc / GetArcCoords demonstration');
  19.   StatusLine('Esc aborts or press a key');
  20.   MaxRadius := MaxY div 10;
  21.   repeat
  22.     SetColor(RandColor);
  23.     EndAngle := Random(360);
  24.     SetLineStyle(SolidLn, 0, NormWidth);
  25.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  26.     GetArcCoords(ArcInfo);
  27.     with ArcInfo do
  28.     begin
  29.       Line(X, Y, XStart, YStart);
  30.       Line(X, Y, Xend, Yend);
  31.     end;
  32.   until KeyPressed;
  33.   WaitToGo;
  34. end; { ArcPlay }
  35.  
  36. procedure PutPixelPlay;
  37. { Demonstrate the PutPixel and GetPixel commands }
  38. const
  39.   Seed   = 1962; { A seed for the random number generator }
  40.   NumPts = 2000; { The number of pixels plotted }
  41.   Esc    = #27;
  42. var
  43.   I : word;
  44.   X, Y, Color : word;
  45.   XMax, YMax  : integer;
  46.   ViewInfo    : ViewPortType;
  47. begin
  48.   MainWindow('PutPixel / GetPixel demonstration');
  49.   StatusLine('Esc aborts or press a key...');
  50.  
  51.   GetViewSettings(ViewInfo);
  52.   with ViewInfo do
  53.   begin
  54.     XMax := (x2-x1-1);
  55.     YMax := (y2-y1-1);
  56.   end;
  57.  
  58.   while not KeyPressed do
  59.   begin
  60.     { Plot random pixels }
  61.     RandSeed := Seed;
  62.     I := 0;
  63.     while (not KeyPressed) and (I < NumPts) do
  64.     begin
  65.       Inc(I);
  66.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  67.     end;
  68.  
  69.     { Erase pixels }
  70.     RandSeed := Seed;
  71.     I := 0;
  72.     while (not KeyPressed) and (I < NumPts) do
  73.     begin
  74.       Inc(I);
  75.       X := Random(XMax)+1;
  76.       Y := Random(YMax)+1;
  77.       Color := GetPixel(X, Y);
  78.         if Color = RandColor then
  79.           PutPixel(X, Y, 0);
  80.      end;
  81.   end;
  82.   WaitToGo;
  83. end; { PutPixelPlay }
  84.  
  85. procedure PutImagePlay;
  86. { Demonstrate the GetImage and PutImage commands }
  87.  
  88. const
  89.   r  = 20;
  90.   StartX = 100;
  91.   StartY = 50;
  92.  
  93. var
  94.   CurPort : ViewPortType;
  95.  
  96. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  97. var
  98.   Step : integer;
  99. begin
  100.   Step := Random(2*r);
  101.   if Odd(Step) then
  102.     Step := -Step;
  103.   X := X + Step;
  104.   Step := Random(r);
  105.   if Odd(Step) then
  106.     Step := -Step;
  107.   Y := Y + Step;
  108.  
  109.   { Make saucer bounce off viewport walls }
  110.   with CurPort do
  111.   begin
  112.     if (x1 + X + Width - 1 > x2) then
  113.       X := x2-x1 - Width + 1
  114.     else
  115.       if (X < 0) then
  116.         X := 0;
  117.     if (y1 + Y + Height - 1 > y2) then
  118.       Y := y2-y1 - Height + 1
  119.     else
  120.       if (Y < 0) then
  121.         Y := 0;
  122.   end;
  123. end; { MoveSaucer }
  124.  
  125. var
  126.   Pausetime : word;
  127.   Saucer    : pointer;
  128.   X, Y      : integer;
  129.   ulx, uly  : word;
  130.   lrx, lry  : word;
  131.   Size      : word;
  132.   I         : word;
  133. begin
  134.   ClearDevice;
  135.   FullPort;
  136.  
  137.   { PaintScreen }
  138.   ClearDevice;
  139.   MainWindow('GetImage / PutImage Demonstration');
  140.   StatusLine('Esc aborts or press a key...');
  141.   GetViewSettings(CurPort);
  142.  
  143.   { DrawSaucer }
  144.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  145.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  146.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  147.   Circle(StartX+10, StartY-12, 2);
  148.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  149.   Circle(StartX-10, StartY-12, 2);
  150.   SetFillStyle(SolidFill, MaxColor);
  151.   FloodFill(StartX+1, StartY+4, GetColor);
  152.  
  153.   { ReadSaucerImage }
  154.   ulx := StartX-(r+1);
  155.   uly := StartY-14;
  156.   lrx := StartX+(r+1);
  157.   lry := StartY+(r div 3)+3;
  158.  
  159.   Size := ImageSize(ulx, uly, lrx, lry);
  160.   GetMem(Saucer, Size);
  161.   GetImage(ulx, uly, lrx, lry, Saucer^);
  162. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  163.  
  164.   { Plot some "stars" }
  165.   for I := 1 to 1000 do
  166.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  167.   X := MaxX div 2;
  168.   Y := MaxY div 2;
  169.   PauseTime := 70;
  170.  
  171.   { Move the saucer around }
  172.   repeat
  173. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  174.      Delay(PauseTime);
  175. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  176.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  177.   until KeyPressed;
  178.   FreeMem(Saucer, size);
  179.   WaitToGo;
  180. end; { PutImagePlay }
  181.  
  182. procedure PolyPlay;
  183. { Draw random polygons with random fill styles on the screen }
  184. const
  185.   MaxPts = 5;
  186. type
  187.   PolygonType = array[1..MaxPts] of PointType;
  188. var
  189.   Poly : PolygonType;
  190.   I, Color : word;
  191. begin
  192.   MainWindow('FillPoly demonstration');
  193.   StatusLine('Esc aborts or press a key...');
  194.   repeat
  195.     Color := RandColor;
  196.     SetFillStyle(Random(11)+1, Color);
  197.     SetColor(Color);
  198.     for I := 1 to MaxPts do
  199.       with Poly[I] do
  200.       begin
  201.         X := Random(MaxX);
  202.         Y := Random(MaxY);
  203.       end;
  204.     FillPoly(MaxPts, Poly);
  205.   until KeyPressed;
  206.   WaitToGo;
  207. end; { PolyPlay }
  208.  
  209. procedure FillStylePlay;
  210. { Display all of the predefined fill styles available }
  211. var
  212.   Style    : word;
  213.   Width    : word;
  214.   Height   : word;
  215.   X, Y     : word;
  216.   I, J     : word;
  217.   ViewInfo : ViewPortType;
  218.  
  219. procedure DrawBox(X, Y : word);
  220. begin
  221.   SetFillStyle(Style, MaxColor);
  222.   with ViewInfo do
  223.     Bar(X, Y, X+Width, Y+Height);
  224.   Rectangle(X, Y, X+Width, Y+Height);
  225.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  226.   Inc(Style);
  227. end; { DrawBox }
  228.  
  229. begin
  230.   MainWindow('Pre-defined fill styles');
  231.   GetViewSettings(ViewInfo);
  232.   with ViewInfo do
  233.   begin
  234.     Width := 2 * ((x2+1) div 13);
  235.     Height := 2 * ((y2-10) div 10);
  236.   end;
  237.   X := Width div 2;
  238.   Y := Height div 2;
  239.   Style := 0;
  240.   for J := 1 to 3 do
  241.   begin
  242.     for I := 1 to 4 do
  243.     begin
  244.       DrawBox(X, Y);
  245.       Inc(X, (Width div 2) * 3);
  246.     end;
  247.     X := Width div 2;
  248.     Inc(Y, (Height div 2) * 3);
  249.   end;
  250.   SetTextJustify(LeftText, TopText);
  251.   WaitToGo;
  252. end; { FillStylePlay }
  253.  
  254. procedure FillPatternPlay;
  255. { Display some user defined fill patterns }
  256. const
  257.   Patterns : array[0..11] of FillPatternType = (
  258.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  259.             OldColor which has a path of pixels of OldColor or NewColor
  260.             with sides touching back to the seed point, (XSeed, YSeed).
  261.             Therefore, only pixels of OldColor are modified and no other
  262.             information is changed.
  263.  
  264.             SEE ALSO
  265.  
  266.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  267.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  268.             SETVIEW
  269.  
  270.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  271.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  272.             IF WHICHVGA = 0 THEN STOP
  273.             DUMMY=RES640
  274.             SETVIEW 100, 100, 539, 379
  275.             FILLVIEW 10
  276.             WHILE INKEY$ = ""
  277.             WEND
  278.             VIDEOMODESET VMODE
  279.             END
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.                                                                          63
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.           FONTGETINFO
  304.  
  305.             PROTOTYPE
  306.  
  307.             SUB FONTGETINFO (Width%, Height%)
  308.  
  309.             INPUT
  310.  
  311.             no input parameters
  312.     WEND
  313.             MOUSEEXIT
  314.             VIDEOMODESET VMODE
  315.             END
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.                                                                          86
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.           MOUSECURSORDEFAULT
  364.  
  365.             PROTOTYPE
  366.  
  367.             SUB MOUSECURSORDEFAULT ()
  368.  
  369.             INPUT
  370.  
  371.             no input parameters
  372.  
  373.             OUTPUT
  374.  
  375.             no value returned
  376.  
  377.             USAGE
  378.  
  379.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  380.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  381. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  382. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  383. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  384. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  385. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  386. $╤
  387. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  388. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  389. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  390. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  391. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  392. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  393. ░£▒
  394. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  395. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  396.       end;
  397.     end;
  398.   end;
  399.   WaitToGo;
  400. end; { UserLineStylePlay }
  401.  
  402.  
  403. procedure SayGoodbye;
  404. { Say goodbye and then exit the program }
  405. var
  406.   ViewInfo : ViewPortType;
  407. begin
  408.   MainWindow('');
  409.   GetViewSettings(ViewInfo);
  410.   SetTextStyle(TriplexFont, HorizDir, 4);
  411.   SetTextJustify(CenterText, CenterText);
  412.   with ViewInfo do
  413.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  414.   StatusLine('Press any key to quit...');
  415.   repeat until KeyPressed;
  416. end; { SayGoodbye }
  417.  
  418.  
  419. PROCEDURE SelectMode;
  420. VAR
  421.     choice1,choice2     : CHAR;
  422.    xsize,ysize            : WORD;
  423. BEGIN
  424.     (* Let's select a mode *)
  425.     ClrScr;
  426.     WriteLn('VESADEMO:');
  427.     WriteLn('1. 256 colors');
  428.     WriteLn('2. 32768 colors');
  429.     WriteLn('3. 65536 colors');
  430.     WriteLn('4. 16777216 colors');
  431.     WriteLn('Q uit');
  432.     WriteLn;
  433.     Write('Your choice: ');
  434.     REPEAT
  435.         ReadLn(choice1);
  436.       IF choice1 <> '1' THEN BEGIN
  437.           WriteLn('Sorry !');
  438.          WriteLn('This demo wasn''t written for more as 256 colors !');
  439.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  440.          WriteLn('Switching to 256 colors.');
  441.          choice1 := '1';
  442.       END;
  443.     UNTIL choice1 IN ['1'..'4','q'];
  444.     IF choice1 = 'q' THEN Halt;
  445.  
  446.     WriteLn;
  447.     WriteLn;
  448.     WriteLn('a. 320x200');
  449.     WriteLn('b. 640x480');
  450.     WriteLn('c. 800x600');
  451.     WriteLn('d. 1024x768');
  452.     WriteLn('e. 1280x1024');
  453.     WriteLn('Q uit');
  454.     WriteLn;
  455.     Write('Your choice: ');
  456.     REPEAT
  457.         ReadLn(choice2);
  458.     UNTIL choice2 IN ['a'..'e','q'];
  459.     IF choice2 = 'q' THEN Halt;
  460.  
  461.     CASE choice2 OF
  462.         'a' : BEGIN
  463.             xsize := 320;
  464.             ysize := 200;
  465.         END;
  466.         'b' : BEGIN
  467.             xsize := 640;
  468.             ysize := 480;
  469.         END;
  470.         'c' : BEGIN
  471.             xsize := 800;
  472.             ysize := 600;
  473.         END;
  474.         'd' : BEGIN
  475.             xsize := 1024;
  476.             ysize := 768;
  477.         END;
  478.         'e' : BEGIN
  479.             xsize := 1280;
  480.             ysize := 1024;
  481.         END;
  482.     END;
  483.     CASE choice1 OF
  484.         '1' : mode := FindVesaMode(xsize,ysize,8);
  485.         '2' : mode := FindVesaMode(xsize,ysize,15);
  486.         '3' : mode := FindVesaMode(xsize,ysize,16);
  487.         '4' : mode := FindVesaMode(xsize,ysize,24);
  488.     END;
  489.     IF mode = 0 THEN BEGIN
  490.         WriteLn('No such mode could be found !');
  491.         WriteLn('Switching to to 320x200.');
  492.         ReadKey;
  493.         mode := V320x200x256;
  494.     END;
  495. END;
  496.  
  497. begin { program body }
  498.   SelectMode;
  499.   Initialize;
  500.   ReportStatus;
  501.  
  502. {  AspectRatioPlay; }
  503.   FillEllipsePlay;
  504.   SectorPlay;
  505.   WriteModePlay;
  506.  
  507.   ColorPlay;
  508.   { PalettePlay only intended to work on these drivers: }
  509.   if (GraphDriver = EGA) or
  510.       (GraphDriver = EGA64) or
  511.       (GraphDriver = VGA) then
  512.      PalettePlay;
  513.   PutPixelPlay;
  514. {  PutImagePlay; }
  515.   RandBarPlay;
  516.   BarPlay;
  517.   Bar3DPlay;
  518.   ArcPlay;
  519.   CirclePlay;
  520.   PiePlay;
  521.   LineToPlay;
  522.   LineRelPlay;
  523. {  LineStylePlay; }
  524. {  UserLineStylePlay; }
  525.   TextDump;
  526.   TextPlay;
  527.   CrtModePlay;
  528.   FillStylePlay;
  529.   FillPatternPlay;
  530.   PolyPlay;
  531.   SayGoodbye;
  532. {  CloseGraph; }
  533.   CloseVesa;
  534. end.
  535. ***************************************************
  536.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  537.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  538. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  539. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  540. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  541. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  542.     Color := RandColor;
  543.     SetColor(Color);
  544.     SetFillStyle(Random(CloseDotFill)+1, Color);
  545.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  546.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  547.   until KeyPressed;
  548.   WaitToGo;
  549. end; { RandBarPlay }
  550.  
  551. procedure ArcPlay;
  552. { Draw random arcs on the screen }
  553. var
  554.   MaxRadius : word;
  555.   EndAngle : word;
  556.   ArcInfo : ArcCoordsType;
  557. begin
  558.   MainWindow('Arc / GetArcCoords demonstration');
  559.   StatusLine('Esc aborts or press a key');
  560.   MaxRadius := MaxY div 10;
  561.   repeat
  562.     SetColor(RandColor);
  563.     EndAngle := Random(360);
  564.     SetLineStyle(SolidLn, 0, NormWidth);
  565.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  566.     GetArcCoords(ArcInfo);
  567.     with ArcInfo do
  568.     begin
  569.       Line(X, Y, XStart, YStart);
  570.       Line(X, Y, Xend, Yend);
  571.     end;
  572.   until KeyPressed;
  573.   WaitToGo;
  574. end; { ArcPlay }
  575.  
  576. procedure PutPixelPlay;
  577. { Demonstrate the PutPixel and GetPixel commands }
  578. const
  579.   Seed   = 1962; { A seed for the random number generator }
  580.   NumPts = 2000; { The number of pixels plotted }
  581.   Esc    = #27;
  582. var
  583.   I : word;
  584.   X, Y, Color : word;
  585.   XMax, YMax  : integer;
  586.   ViewInfo    : ViewPortType;
  587. begin
  588.   MainWindow('PutPixel / GetPixel demonstration');
  589.   StatusLine('Esc aborts or press a key...');
  590.  
  591.   GetViewSettings(ViewInfo);
  592.   with ViewInfo do
  593.   begin
  594.     XMax := (x2-x1-1);
  595.     YMax := (y2-y1-1);
  596.   end;
  597.  
  598.   while not KeyPressed do
  599.   begin
  600.     { Plot random pixels }
  601.     RandSeed := Seed;
  602.     I := 0;
  603.     while (not KeyPressed) and (I < NumPts) do
  604.     begin
  605.       Inc(I);
  606.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  607.     end;
  608.  
  609.     { Erase pixels }
  610.     RandSeed := Seed;
  611.     I := 0;
  612.     while (not KeyPressed) and (I < NumPts) do
  613.     begin
  614.       Inc(I);
  615.       X := Random(XMax)+1;
  616.       Y := Random(YMax)+1;
  617.       Color := GetPixel(X, Y);
  618.         if Color = RandColor then
  619.           PutPixel(X, Y, 0);
  620.      end;
  621.   end;
  622.   WaitToGo;
  623. end; { PutPixelPlay }
  624.  
  625. procedure PutImagePlay;
  626. { Demonstrate the GetImage and PutImage commands }
  627.  
  628. const
  629.   r  = 20;
  630.   StartX = 100;
  631.   StartY = 50;
  632.  
  633. var
  634.   CurPort : ViewPortType;
  635.  
  636. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  637. var
  638.   Step : integer;
  639. begin
  640.   Step := Random(2*r);
  641.   if Odd(Step) then
  642.     Step := -Step;
  643.   X := X + Step;
  644.   Step := Random(r);
  645.   if Odd(Step) then
  646.     Step := -Step;
  647.   Y := Y + Step;
  648.  
  649.   { Make saucer bounce off viewport walls }
  650.   with CurPort do
  651.   begin
  652.     if (x1 + X + Width - 1 > x2) then
  653.       X := x2-x1 - Width + 1
  654.     else
  655.       if (X < 0) then
  656.         X := 0;
  657.     if (y1 + Y + Height - 1 > y2) then
  658.       Y := y2-y1 - Height + 1
  659.     else
  660.       if (Y < 0) then
  661.         Y := 0;
  662.   end;
  663. end; { MoveSaucer }
  664.  
  665. var
  666.   Pausetime : word;
  667.   Saucer    : pointer;
  668.   X, Y      : integer;
  669.   ulx, uly  : word;
  670.   lrx, lry  : word;
  671.   Size      : word;
  672.   I         : word;
  673. begin
  674.   ClearDevice;
  675.   FullPort;
  676.  
  677.   { PaintScreen }
  678.   ClearDevice;
  679.   MainWindow('GetImage / PutImage Demonstration');
  680.   StatusLine('Esc aborts or press a key...');
  681.   GetViewSettings(CurPort);
  682.  
  683.   { DrawSaucer }
  684.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  685.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  686.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  687.   Circle(StartX+10, StartY-12, 2);
  688.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  689.   Circle(StartX-10, StartY-12, 2);
  690.   SetFillStyle(SolidFill, MaxColor);
  691.   FloodFill(StartX+1, StartY+4, GetColor);
  692.  
  693.   { ReadSaucerImage }
  694.   ulx := StartX-(r+1);
  695.   uly := StartY-14;
  696.   lrx := StartX+(r+1);
  697.   lry := StartY+(r div 3)+3;
  698.  
  699.   Size := ImageSize(ulx, uly, lrx, lry);
  700.   GetMem(Saucer, Size);
  701.   GetImage(ulx, uly, lrx, lry, Saucer^);
  702. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  703.  
  704.   { Plot some "stars" }
  705.   for I := 1 to 1000 do
  706.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  707.   X := MaxX div 2;
  708.   Y := MaxY div 2;
  709.   PauseTime := 70;
  710.  
  711.   { Move the saucer around }
  712.   repeat
  713. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  714.      Delay(PauseTime);
  715. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  716.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  717.   until KeyPressed;
  718.   FreeMem(Saucer, size);
  719.   WaitToGo;
  720. end; { PutImagePlay }
  721.  
  722. procedure PolyPlay;
  723. { Draw random polygons with random fill styles on the screen }
  724. const
  725.   MaxPts = 5;
  726. type
  727.   PolygonType = array[1..MaxPts] of PointType;
  728. var
  729.   Poly : PolygonType;
  730.   I, Color : word;
  731. begin
  732.   MainWindow('FillPoly demonstration');
  733.   StatusLine('Esc aborts or press a key...');
  734.   repeat
  735.     Color := RandColor;
  736.     SetFillStyle(Random(11)+1, Color);
  737.     SetColor(Color);
  738.     for I := 1 to MaxPts do
  739.       with Poly[I] do
  740.       begin
  741.         X := Random(MaxX);
  742.         Y := Random(MaxY);
  743.       end;
  744.     FillPoly(MaxPts, Poly);
  745.   until KeyPressed;
  746.   WaitToGo;
  747. end; { PolyPlay }
  748.  
  749. procedure FillStylePlay;
  750. { Display all of the predefined fill styles available }
  751. var
  752.   Style    : word;
  753.   Width    : word;
  754.   Height   : word;
  755.   X, Y     : word;
  756.   I, J     : word;
  757.   ViewInfo : ViewPortType;
  758.  
  759. procedure DrawBox(X, Y : word);
  760. begin
  761.   SetFillStyle(Style, MaxColor);
  762.   with ViewInfo do
  763.     Bar(X, Y, X+Width, Y+Height);
  764.   Rectangle(X, Y, X+Width, Y+Height);
  765.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  766.   Inc(Style);
  767. end; { DrawBox }
  768.  
  769. begin
  770.   MainWindow('Pre-defined fill styles');
  771.   GetViewSettings(ViewInfo);
  772.   with ViewInfo do
  773.   begin
  774.     Width := 2 * ((x2+1) div 13);
  775.     Height := 2 * ((y2-10) div 10);
  776.   end;
  777.   X := Width div 2;
  778.   Y := Height div 2;
  779.   Style := 0;
  780.   for J := 1 to 3 do
  781.   begin
  782.     for I := 1 to 4 do
  783.     begin
  784.       DrawBox(X, Y);
  785.       Inc(X, (Width div 2) * 3);
  786.     end;
  787.     X := Width div 2;
  788.     Inc(Y, (Height div 2) * 3);
  789.   end;
  790.   SetTextJustify(LeftText, TopText);
  791.   WaitToGo;
  792. end; { FillStylePlay }
  793.  
  794. procedure FillPatternPlay;
  795. { Display some user defined fill patterns }
  796. const
  797.   Patterns : array[0..11] of FillPatternType = (
  798.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  799.             OldColor which has a path of pixels of OldColor or NewColor
  800.             with sides touching back to the seed point, (XSeed, YSeed).
  801.             Therefore, only pixels of OldColor are modified and no other
  802.             information is changed.
  803.  
  804.             SEE ALSO
  805.  
  806.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  807.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  808.             SETVIEW
  809.  
  810.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  811.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  812.             IF WHICHVGA = 0 THEN STOP
  813.             DUMMY=RES640
  814.             SETVIEW 100, 100, 539, 379
  815.             FILLVIEW 10
  816.             WHILE INKEY$ = ""
  817.             WEND
  818.             VIDEOMODESET VMODE
  819.             END
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.                                                                          63
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.           FONTGETINFO
  844.  
  845.             PROTOTYPE
  846.  
  847.             SUB FONTGETINFO (Width%, Height%)
  848.  
  849.             INPUT
  850.  
  851.             no input parameters
  852.     WEND
  853.             MOUSEEXIT
  854.             VIDEOMODESET VMODE
  855.             END
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.                                                                          86
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.           MOUSECURSORDEFAULT
  904.  
  905.             PROTOTYPE
  906.  
  907.             SUB MOUSECURSORDEFAULT ()
  908.  
  909.             INPUT
  910.  
  911.             no input parameters
  912.  
  913.             OUTPUT
  914.  
  915.             no value returned
  916.  
  917.             USAGE
  918.  
  919.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  920.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  921. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  922. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  923. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  924. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  925. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  926. $╤
  927. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  928. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  929. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  930. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  931. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  932. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  933. ░£▒
  934. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  935. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  936.       end;
  937.     end;
  938.   end;
  939.   WaitToGo;
  940. end; { UserLineStylePlay }
  941.  
  942.  
  943. procedure SayGoodbye;
  944. { Say goodbye and then exit the program }
  945. var
  946.   ViewInfo : ViewPortType;
  947. begin
  948.   MainWindow('');
  949.   GetViewSettings(ViewInfo);
  950.   SetTextStyle(TriplexFont, HorizDir, 4);
  951.   SetTextJustify(CenterText, CenterText);
  952.   with ViewInfo do
  953.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  954.   StatusLine('Press any key to quit...');
  955.   repeat until KeyPressed;
  956. end; { SayGoodbye }
  957.  
  958.  
  959. PROCEDURE SelectMode;
  960. VAR
  961.     choice1,choice2     : CHAR;
  962.    xsize,ysize            : WORD;
  963. BEGIN
  964.     (* Let's select a mode *)
  965.     ClrScr;
  966.     WriteLn('VESADEMO:');
  967.     WriteLn('1. 256 colors');
  968.     WriteLn('2. 32768 colors');
  969.     WriteLn('3. 65536 colors');
  970.     WriteLn('4. 16777216 colors');
  971.     WriteLn('Q uit');
  972.     WriteLn;
  973.     Write('Your choice: ');
  974.     REPEAT
  975.         ReadLn(choice1);
  976.       IF choice1 <> '1' THEN BEGIN
  977.           WriteLn('Sorry !');
  978.          WriteLn('This demo wasn''t written for more as 256 colors !');
  979.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  980.          WriteLn('Switching to 256 colors.');
  981.          choice1 := '1';
  982.       END;
  983.     UNTIL choice1 IN ['1'..'4','q'];
  984.     IF choice1 = 'q' THEN Halt;
  985.  
  986.     WriteLn;
  987.     WriteLn;
  988.     WriteLn('a. 320x200');
  989.     WriteLn('b. 640x480');
  990.     WriteLn('c. 800x600');
  991.     WriteLn('d. 1024x768');
  992.     WriteLn('e. 1280x1024');
  993.     WriteLn('Q uit');
  994.     WriteLn;
  995.     Write('Your choice: ');
  996.     REPEAT
  997.         ReadLn(choice2);
  998.     UNTIL choice2 IN ['a'..'e','q'];
  999.     IF choice2 = 'q' THEN Halt;
  1000.  
  1001.     CASE choice2 OF
  1002.         'a' : BEGIN
  1003.             xsize := 320;
  1004.             ysize := 200;
  1005.         END;
  1006.         'b' : BEGIN
  1007.             xsize := 640;
  1008.             ysize := 480;
  1009.         END;
  1010.         'c' : BEGIN
  1011.             xsize := 800;
  1012.             ysize := 600;
  1013.         END;
  1014.         'd' : BEGIN
  1015.             xsize := 1024;
  1016.             ysize := 768;
  1017.         END;
  1018.         'e' : BEGIN
  1019.             xsize := 1280;
  1020.             ysize := 1024;
  1021.         END;
  1022.     END;
  1023.     CASE choice1 OF
  1024.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1025.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1026.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1027.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1028.     END;
  1029.     IF mode = 0 THEN BEGIN
  1030.         WriteLn('No such mode could be found !');
  1031.         WriteLn('Switching to to 320x200.');
  1032.         ReadKey;
  1033.         mode := V320x200x256;
  1034.     END;
  1035. END;
  1036.  
  1037. begin { program body }
  1038.   SelectMode;
  1039.   Initialize;
  1040.   ReportStatus;
  1041.  
  1042. {  AspectRatioPlay; }
  1043.   FillEllipsePlay;
  1044.   SectorPlay;
  1045.   WriteModePlay;
  1046.  
  1047.   ColorPlay;
  1048.   { PalettePlay only intended to work on these drivers: }
  1049.   if (GraphDriver = EGA) or
  1050.       (GraphDriver = EGA64) or
  1051.       (GraphDriver = VGA) then
  1052.      PalettePlay;
  1053.   PutPixelPlay;
  1054. {  PutImagePlay; }
  1055.   RandBarPlay;
  1056.   BarPlay;
  1057.   Bar3DPlay;
  1058.   ArcPlay;
  1059.   CirclePlay;
  1060.   PiePlay;
  1061.   LineToPlay;
  1062.   LineRelPlay;
  1063. {  LineStylePlay; }
  1064. {  UserLineStylePlay; }
  1065.   TextDump;
  1066.   TextPlay;
  1067.   CrtModePlay;
  1068.   FillStylePlay;
  1069.   FillPatternPlay;
  1070.   PolyPlay;
  1071.   SayGoodbye;
  1072. {  CloseGraph; }
  1073.   CloseVesa;
  1074. end.
  1075. ***************************************************
  1076.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1077.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  1078. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  1079. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  1080. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  1081. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  1082.     Color := RandColor;
  1083.     SetColor(Color);
  1084.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1085.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1086.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1087.   until KeyPressed;
  1088.   WaitToGo;
  1089. end; { RandBarPlay }
  1090.  
  1091. procedure ArcPlay;
  1092. { Draw random arcs on the screen }
  1093. var
  1094.   MaxRadius : word;
  1095.   EndAngle : word;
  1096.   ArcInfo : ArcCoordsType;
  1097. begin
  1098.   MainWindow('Arc / GetArcCoords demonstration');
  1099.   StatusLine('Esc aborts or press a key');
  1100.   MaxRadius := MaxY div 10;
  1101.   repeat
  1102.     SetColor(RandColor);
  1103.     EndAngle := Random(360);
  1104.     SetLineStyle(SolidLn, 0, NormWidth);
  1105.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1106.     GetArcCoords(ArcInfo);
  1107.     with ArcInfo do
  1108.     begin
  1109.       Line(X, Y, XStart, YStart);
  1110.       Line(X, Y, Xend, Yend);
  1111.     end;
  1112.   until KeyPressed;
  1113.   WaitToGo;
  1114. end; { ArcPlay }
  1115.  
  1116. procedure PutPixelPlay;
  1117. { Demonstrate the PutPixel and GetPixel commands }
  1118. const
  1119.   Seed   = 1962; { A seed for the random number generator }
  1120.   NumPts = 2000; { The number of pixels plotted }
  1121.   Esc    = #27;
  1122. var
  1123.   I : word;
  1124.   X, Y, Color : word;
  1125.   XMax, YMax  : integer;
  1126.   ViewInfo    : ViewPortType;
  1127. begin
  1128.   MainWindow('PutPixel / GetPixel demonstration');
  1129.   StatusLine('Esc aborts or press a key...');
  1130.  
  1131.   GetViewSettings(ViewInfo);
  1132.   with ViewInfo do
  1133.   begin
  1134.     XMax := (x2-x1-1);
  1135.     YMax := (y2-y1-1);
  1136.   end;
  1137.  
  1138.   while not KeyPressed do
  1139.   begin
  1140.     { Plot random pixels }
  1141.     RandSeed := Seed;
  1142.     I := 0;
  1143.     while (not KeyPressed) and (I < NumPts) do
  1144.     begin
  1145.       Inc(I);
  1146.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1147.     end;
  1148.  
  1149.     { Erase pixels }
  1150.     RandSeed := Seed;
  1151.     I := 0;
  1152.     while (not KeyPressed) and (I < NumPts) do
  1153.     begin
  1154.       Inc(I);
  1155.       X := Random(XMax)+1;
  1156.       Y := Random(YMax)+1;
  1157.       Color := GetPixel(X, Y);
  1158.         if Color = RandColor then
  1159.           PutPixel(X, Y, 0);
  1160.      end;
  1161.   end;
  1162.   WaitToGo;
  1163. end; { PutPixelPlay }
  1164.  
  1165. procedure PutImagePlay;
  1166. { Demonstrate the GetImage and PutImage commands }
  1167.  
  1168. const
  1169.   r  = 20;
  1170.   StartX = 100;
  1171.   StartY = 50;
  1172.  
  1173. var
  1174.   CurPort : ViewPortType;
  1175.  
  1176. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1177. var
  1178.   Step : integer;
  1179. begin
  1180.   Step := Random(2*r);
  1181.   if Odd(Step) then
  1182.     Step := -Step;
  1183.   X := X + Step;
  1184.   Step := Random(r);
  1185.   if Odd(Step) then
  1186.     Step := -Step;
  1187.   Y := Y + Step;
  1188.  
  1189.   { Make saucer bounce off viewport walls }
  1190.   with CurPort do
  1191.   begin
  1192.     if (x1 + X + Width - 1 > x2) then
  1193.       X := x2-x1 - Width + 1
  1194.     else
  1195.       if (X < 0) then
  1196.         X := 0;
  1197.     if (y1 + Y + Height - 1 > y2) then
  1198.       Y := y2-y1 - Height + 1
  1199.     else
  1200.       if (Y < 0) then
  1201.         Y := 0;
  1202.   end;
  1203. end; { MoveSaucer }
  1204.  
  1205. var
  1206.   Pausetime : word;
  1207.   Saucer    : pointer;
  1208.   X, Y      : integer;
  1209.   ulx, uly  : word;
  1210.   lrx, lry  : word;
  1211.   Size      : word;
  1212.   I         : word;
  1213. begin
  1214.   ClearDevice;
  1215.   FullPort;
  1216.  
  1217.   { PaintScreen }
  1218.   ClearDevice;
  1219.   MainWindow('GetImage / PutImage Demonstration');
  1220.   StatusLine('Esc aborts or press a key...');
  1221.   GetViewSettings(CurPort);
  1222.  
  1223.   { DrawSaucer }
  1224.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1225.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1226.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1227.   Circle(StartX+10, StartY-12, 2);
  1228.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1229.   Circle(StartX-10, StartY-12, 2);
  1230.   SetFillStyle(SolidFill, MaxColor);
  1231.   FloodFill(StartX+1, StartY+4, GetColor);
  1232.  
  1233.   { ReadSaucerImage }
  1234.   ulx := StartX-(r+1);
  1235.   uly := StartY-14;
  1236.   lrx := StartX+(r+1);
  1237.   lry := StartY+(r div 3)+3;
  1238.  
  1239.   Size := ImageSize(ulx, uly, lrx, lry);
  1240.   GetMem(Saucer, Size);
  1241.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1242. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1243.  
  1244.   { Plot some "stars" }
  1245.   for I := 1 to 1000 do
  1246.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1247.   X := MaxX div 2;
  1248.   Y := MaxY div 2;
  1249.   PauseTime := 70;
  1250.  
  1251.   { Move the saucer around }
  1252.   repeat
  1253. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1254.      Delay(PauseTime);
  1255. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1256.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1257.   until KeyPressed;
  1258.   FreeMem(Saucer, size);
  1259.   WaitToGo;
  1260. end; { PutImagePlay }
  1261.  
  1262. procedure PolyPlay;
  1263. { Draw random polygons with random fill styles on the screen }
  1264. const
  1265.   MaxPts = 5;
  1266. type
  1267.   PolygonType = array[1..MaxPts] of PointType;
  1268. var
  1269.   Poly : PolygonType;
  1270.   I, Color : word;
  1271. begin
  1272.   MainWindow('FillPoly demonstration');
  1273.   StatusLine('Esc aborts or press a key...');
  1274.   repeat
  1275.     Color := RandColor;
  1276.     SetFillStyle(Random(11)+1, Color);
  1277.     SetColor(Color);
  1278.     for I := 1 to MaxPts do
  1279.       with Poly[I] do
  1280.       begin
  1281.         X := Random(MaxX);
  1282.         Y := Random(MaxY);
  1283.       end;
  1284.     FillPoly(MaxPts, Poly);
  1285.   until KeyPressed;
  1286.   WaitToGo;
  1287. end; { PolyPlay }
  1288.  
  1289. procedure FillStylePlay;
  1290. { Display all of the predefined fill styles available }
  1291. var
  1292.   Style    : word;
  1293.   Width    : word;
  1294.   Height   : word;
  1295.   X, Y     : word;
  1296.   I, J     : word;
  1297.   ViewInfo : ViewPortType;
  1298.  
  1299. procedure DrawBox(X, Y : word);
  1300. begin
  1301.   SetFillStyle(Style, MaxColor);
  1302.   with ViewInfo do
  1303.     Bar(X, Y, X+Width, Y+Height);
  1304.   Rectangle(X, Y, X+Width, Y+Height);
  1305.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1306.   Inc(Style);
  1307. end; { DrawBox }
  1308.  
  1309. begin
  1310.   MainWindow('Pre-defined fill styles');
  1311.   GetViewSettings(ViewInfo);
  1312.   with ViewInfo do
  1313.   begin
  1314.     Width := 2 * ((x2+1) div 13);
  1315.     Height := 2 * ((y2-10) div 10);
  1316.   end;
  1317.   X := Width div 2;
  1318.   Y := Height div 2;
  1319.   Style := 0;
  1320.   for J := 1 to 3 do
  1321.   begin
  1322.     for I := 1 to 4 do
  1323.     begin
  1324.       DrawBox(X, Y);
  1325.       Inc(X, (Width div 2) * 3);
  1326.     end;
  1327.     X := Width div 2;
  1328.     Inc(Y, (Height div 2) * 3);
  1329.   end;
  1330.   SetTextJustify(LeftText, TopText);
  1331.   WaitToGo;
  1332. end; { FillStylePlay }
  1333.  
  1334. procedure FillPatternPlay;
  1335. { Display some user defined fill patterns }
  1336. const
  1337.   Patterns : array[0..11] of FillPatternType = (
  1338.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1339.             OldColor which has a path of pixels of OldColor or NewColor
  1340.             with sides touching back to the seed point, (XSeed, YSeed).
  1341.             Therefore, only pixels of OldColor are modified and no other
  1342.             information is changed.
  1343.  
  1344.             SEE ALSO
  1345.  
  1346.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1347.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1348.             SETVIEW
  1349.  
  1350.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1351.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1352.             IF WHICHVGA = 0 THEN STOP
  1353.             DUMMY=RES640
  1354.             SETVIEW 100, 100, 539, 379
  1355.             FILLVIEW 10
  1356.             WHILE INKEY$ = ""
  1357.             WEND
  1358.             VIDEOMODESET VMODE
  1359.             END
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.                                                                          63
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.           FONTGETINFO
  1384.  
  1385.             PROTOTYPE
  1386.  
  1387.             SUB FONTGETINFO (Width%, Height%)
  1388.  
  1389.             INPUT
  1390.  
  1391.             no input parameters
  1392.     WEND
  1393.             MOUSEEXIT
  1394.             VIDEOMODESET VMODE
  1395.             END
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.                                                                          86
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.           MOUSECURSORDEFAULT
  1444.  
  1445.             PROTOTYPE
  1446.  
  1447.             SUB MOUSECURSORDEFAULT ()
  1448.  
  1449.             INPUT
  1450.  
  1451.             no input parameters
  1452.  
  1453.             OUTPUT
  1454.  
  1455.             no value returned
  1456.  
  1457.             USAGE
  1458.  
  1459.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1460.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  1461. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1462. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  1463. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1464. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1465. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1466. $╤
  1467. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  1468. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  1469. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1470. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1471. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  1472. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  1473. ░£▒
  1474. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  1475. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1476.       end;
  1477.     end;
  1478.   end;
  1479.   WaitToGo;
  1480. end; { UserLineStylePlay }
  1481.  
  1482.  
  1483. procedure SayGoodbye;
  1484. { Say goodbye and then exit the program }
  1485. var
  1486.   ViewInfo : ViewPortType;
  1487. begin
  1488.   MainWindow('');
  1489.   GetViewSettings(ViewInfo);
  1490.   SetTextStyle(TriplexFont, HorizDir, 4);
  1491.   SetTextJustify(CenterText, CenterText);
  1492.   with ViewInfo do
  1493.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1494.   StatusLine('Press any key to quit...');
  1495.   repeat until KeyPressed;
  1496. end; { SayGoodbye }
  1497.  
  1498.  
  1499. PROCEDURE SelectMode;
  1500. VAR
  1501.     choice1,choice2     : CHAR;
  1502.    xsize,ysize            : WORD;
  1503. BEGIN
  1504.     (* Let's select a mode *)
  1505.     ClrScr;
  1506.     WriteLn('VESADEMO:');
  1507.     WriteLn('1. 256 colors');
  1508.     WriteLn('2. 32768 colors');
  1509.     WriteLn('3. 65536 colors');
  1510.     WriteLn('4. 16777216 colors');
  1511.     WriteLn('Q uit');
  1512.     WriteLn;
  1513.     Write('Your choice: ');
  1514.     REPEAT
  1515.         ReadLn(choice1);
  1516.       IF choice1 <> '1' THEN BEGIN
  1517.           WriteLn('Sorry !');
  1518.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1519.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1520.          WriteLn('Switching to 256 colors.');
  1521.          choice1 := '1';
  1522.       END;
  1523.     UNTIL choice1 IN ['1'..'4','q'];
  1524.     IF choice1 = 'q' THEN Halt;
  1525.  
  1526.     WriteLn;
  1527.     WriteLn;
  1528.     WriteLn('a. 320x200');
  1529.     WriteLn('b. 640x480');
  1530.     WriteLn('c. 800x600');
  1531.     WriteLn('d. 1024x768');
  1532.     WriteLn('e. 1280x1024');
  1533.     WriteLn('Q uit');
  1534.     WriteLn;
  1535.     Write('Your choice: ');
  1536.     REPEAT
  1537.         ReadLn(choice2);
  1538.     UNTIL choice2 IN ['a'..'e','q'];
  1539.     IF choice2 = 'q' THEN Halt;
  1540.  
  1541.     CASE choice2 OF
  1542.         'a' : BEGIN
  1543.             xsize := 320;
  1544.             ysize := 200;
  1545.         END;
  1546.         'b' : BEGIN
  1547.             xsize := 640;
  1548.             ysize := 480;
  1549.         END;
  1550.         'c' : BEGIN
  1551.             xsize := 800;
  1552.             ysize := 600;
  1553.         END;
  1554.         'd' : BEGIN
  1555.             xsize := 1024;
  1556.             ysize := 768;
  1557.         END;
  1558.         'e' : BEGIN
  1559.             xsize := 1280;
  1560.             ysize := 1024;
  1561.         END;
  1562.     END;
  1563.     CASE choice1 OF
  1564.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1565.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1566.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1567.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1568.     END;
  1569.     IF mode = 0 THEN BEGIN
  1570.         WriteLn('No such mode could be found !');
  1571.         WriteLn('Switching to to 320x200.');
  1572.         ReadKey;
  1573.         mode := V320x200x256;
  1574.     END;
  1575. END;
  1576.  
  1577. begin { program body }
  1578.   SelectMode;
  1579.   Initialize;
  1580.   ReportStatus;
  1581.  
  1582. {  AspectRatioPlay; }
  1583.   FillEllipsePlay;
  1584.   SectorPlay;
  1585.   WriteModePlay;
  1586.  
  1587.   ColorPlay;
  1588.   { PalettePlay only intended to work on these drivers: }
  1589.   if (GraphDriver = EGA) or
  1590.       (GraphDriver = EGA64) or
  1591.       (GraphDriver = VGA) then
  1592.      PalettePlay;
  1593.   PutPixelPlay;
  1594. {  PutImagePlay; }
  1595.   RandBarPlay;
  1596.   BarPlay;
  1597.   Bar3DPlay;
  1598.   ArcPlay;
  1599.   CirclePlay;
  1600.   PiePlay;
  1601.   LineToPlay;
  1602.   LineRelPlay;
  1603. {  LineStylePlay; }
  1604. {  UserLineStylePlay; }
  1605.   TextDump;
  1606.   TextPlay;
  1607.   CrtModePlay;
  1608.   FillStylePlay;
  1609.   FillPatternPlay;
  1610.   PolyPlay;
  1611.   SayGoodbye;
  1612. {  CloseGraph; }
  1613.   CloseVesa;
  1614. end.
  1615. ***************************************************
  1616.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1617.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  1618. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  1619. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φ