home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / utils / disp187b / drvsrc / genoa.asm < prev    next >
Encoding:
Assembly Source File  |  1991-06-22  |  5.5 KB  |  208 lines

  1. indVesaMode(xsize,ysize,24);
  2.     END;
  3.     IF mode = 0 THEN BEGIN
  4.         WriteLn('No such mode could be found !');
  5.         WriteLn('Switching to to 320x200.');
  6.         ReadKey;
  7.         mode := V320x200x256;
  8.     END;
  9. END;
  10.  
  11. begin { program body }
  12.   SelectMode;
  13.   Initialize;
  14.   ReportStatus;
  15.  
  16. {  AspectRatioPlay; }
  17.   FillEllipsePlay;
  18.   SectorPlay;
  19.   WriteModePlay;
  20.  
  21.   ColorPlay;
  22.   { PalettePlay only intended to work on these drivers: }
  23.   if (GraphDriver = EGA) or
  24.       (GraphDriver = EGA64) or
  25.       (GraphDriver = VGA) then
  26.      PalettePlay;
  27.   PutPixelPlay;
  28. {  PutImagePlay; }
  29.   RandBarPlay;
  30.   BarPlay;
  31.   Bar3DPlay;
  32.   ArcPlay;
  33.   CirclePlay;
  34.   PiePlay;
  35.   LineToPlay;
  36.   LineRelPlay;
  37. {  LineStylePlay; }
  38. {  UserLineStylePlay; }
  39.   TextDump;
  40.   TextPlay;
  41.   CrtModePlay;
  42.   FillStylePlay;
  43.   FillPatternPlay;
  44.   PolyPlay;
  45.   SayGoodbye;
  46. {  CloseGraph; }
  47.   CloseVesa;
  48. end.
  49. ***************************************************
  50.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  51.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬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·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₧Ñ
  52. 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
  53. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  54.     Color := RandColor;
  55.     SetColor(Color);
  56.     SetFillStyle(Random(CloseDotFill)+1, Color);
  57.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  58.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  59.   until KeyPressed;
  60.   WaitToGo;
  61. end; { RandBarPlay }
  62.  
  63. procedure ArcPlay;
  64. { Draw random arcs on the screen }
  65. var
  66.   MaxRadius : word;
  67.   EndAngle : word;
  68.   ArcInfo : ArcCoordsType;
  69. begin
  70.   MainWindow('Arc / GetArcCoords demonstration');
  71.   StatusLine('Esc aborts or press a key');
  72.   MaxRadius := MaxY div 10;
  73.   repeat
  74.     SetColor(RandColor);
  75.     EndAngle := Random(360);
  76.     SetLineStyle(SolidLn, 0, NormWidth);
  77.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  78.     GetArcCoords(ArcInfo);
  79.     with ArcInfo do
  80.     begin
  81.       Line(X, Y, XStart, YStart);
  82.       Line(X, Y, Xend, Yend);
  83.     end;
  84.   until KeyPressed;
  85.   WaitToGo;
  86. end; { ArcPlay }
  87.  
  88. procedure PutPixelPlay;
  89. { Demonstrate the PutPixel and GetPixel commands }
  90. const
  91.   Seed   = 1962; { A seed for the random number generator }
  92.   NumPts = 2000; { The number of pixels plotted }
  93.   Esc    = #27;
  94. var
  95.   I : word;
  96.   X, Y, Color : word;
  97.   XMax, YMax  : integer;
  98.   ViewInfo    : ViewPortType;
  99. begin
  100.   MainWindow('PutPixel / GetPixel demonstration');
  101.   StatusLine('Esc aborts or press a key...');
  102.  
  103.   GetViewSettings(ViewInfo);
  104.   with ViewInfo do
  105.   begin
  106.     XMax := (x2-x1-1);
  107.     YMax := (y2-y1-1);
  108.   end;
  109.  
  110.   while not KeyPressed do
  111.   begin
  112.     { Plot random pixels }
  113.     RandSeed := Seed;
  114.     I := 0;
  115.     while (not KeyPressed) and (I < NumPts) do
  116.     begin
  117.       Inc(I);
  118.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  119.     end;
  120.  
  121.     { Erase pixels }
  122.     RandSeed := Seed;
  123.     I := 0;
  124.     while (not KeyPressed) and (I < NumPts) do
  125.     begin
  126.       Inc(I);
  127.       X := Random(XMax)+1;
  128.       Y := Random(YMax)+1;
  129.       Color := GetPixel(X, Y);
  130.         if Color = RandColor then
  131.           PutPixel(X, Y, 0);
  132.      end;
  133.   end;
  134.   WaitToGo;
  135. end; { PutPixelPlay }
  136.  
  137. procedure PutImagePlay;
  138. { Demonstrate the GetImage and PutImage commands }
  139.  
  140. const
  141.   r  = 20;
  142.   StartX = 100;
  143.   StartY = 50;
  144.  
  145. var
  146.   CurPort : ViewPortType;
  147.  
  148. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  149. var
  150.   Step : integer;
  151. begin
  152.   Step := Random(2*r);
  153.   if Odd(Step) then
  154.     Step := -Step;
  155.   X := X + Step;
  156.   Step := Random(r);
  157.   if Odd(Step) then
  158.     Step := -Step;
  159.   Y := Y + Step;
  160.  
  161.   { Make saucer bounce off viewport walls }
  162.   with CurPort do
  163.   begin
  164.     if (x1 + X + Width - 1 > x2) then
  165.       X := x2-x1 - Width + 1
  166.     else
  167.       if (X < 0) then
  168.         X := 0;
  169.     if (y1 + Y + Height - 1 > y2) then
  170.       Y := y2-y1 - Height + 1
  171.     else
  172.       if (Y < 0) then
  173.         Y := 0;
  174.   end;
  175. end; { MoveSaucer }
  176.  
  177. var
  178.   Pausetime : word;
  179.   Saucer    : pointer;
  180.   X, Y      : integer;
  181.   ulx, uly  : word;
  182.   lrx, lry  : word;
  183.   Size      : word;
  184.   I         : word;
  185. begin
  186.   ClearDevice;
  187.   FullPort;
  188.  
  189.   { PaintScreen }
  190.   ClearDevice;
  191.   MainWindow('GetImage / PutImage Demonstration');
  192.   StatusLine('Esc aborts or press a key...');
  193.   GetViewSettings(CurPort);
  194.  
  195.   { DrawSaucer }
  196.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  197.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  198.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  199.   Circle(StartX+10, StartY-12, 2);
  200.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  201.   Circle(StartX-10, StartY-12, 2);
  202.   SetFillStyle(SolidFill, MaxColor);
  203.   FloodFill(StartX+1, StartY+4, GetColor);
  204.  
  205.   { ReadSaucerImage }
  206.   ulx := StartX-(r+1);
  207.   uly := StartY-14;
  208.   lrx := StartX+(