home *** CD-ROM | disk | FTP | other *** search
/ TopWare 18: Liquid / Image.iso / liquid / top1175 / lbench2.pas < prev    next >
Pascal/Delphi Source File  |  1994-04-03  |  44KB  |  1,281 lines

  1. {$M 16384,0,250000}
  2.  
  3. (*
  4.       Library Benchmark v2.02
  5.       (c) 1993,1994 Kevin Gliner
  6.       All Rights Reserved
  7.       Last Update:   4/ 4/94
  8.  
  9.       This program is freeware.  Permission is granted to distribute it
  10.       freely so long as the contents (LBENCH2.EXE, LBENCH2.PAS, LBENCH2.DOC)
  11.       remain together, intact, and unmodified.
  12. *)
  13.  
  14. program LibraryBench;
  15.  
  16. uses crt,
  17.      dos,
  18.  
  19.      {Metagraphics Units}
  20.      metawin1,
  21.      metawin2,
  22.  
  23.      {Genus Units}
  24.      gx_tp,
  25.      gr_tp,
  26.      fx_tp,
  27.  
  28.      {Fastgraph Units}
  29.      fgmain,
  30.      fgmisc,
  31.      fgpcx,
  32.      fgbitmap,
  33.      fgpr,
  34.      fgsvga;
  35.  
  36. const
  37.      BufMax                 = 3000;
  38.  
  39.      MaxTimes               = 150;
  40.      MaxLibraries           = 3;
  41.  
  42.      Genus                  = 1;
  43.      Fastgraph              = 2;
  44.      Metagraphics           = 3;
  45.  
  46.      LibraryBenchmarkVersionString = 'Library Benchmark v2.02';
  47.      CopyrightString               = '(c) 1993,1994 Kevin Gliner';
  48.      RightsString                  = 'All Rights Reserved';
  49.      LastUpdateString              = 'Last Update:  4/ 4/94';
  50.      GenusVersionString            = 'Genus GX Kernel v2.00, GX Effects v2.02, GX Graphics v2.00';
  51.      FastgraphVersionString        = 'Fastgraph v3.03';
  52.      MetagraphicsVersionString     = 'Metagraphics MetaWINDOW-DOS v4.3D';
  53.  
  54.      Mode320x200x256        = 1;
  55.      Mode640x480x16         = 2;
  56.      Mode640x480x256        = 3;
  57.  
  58. type
  59.     BufferType            = array[0..64012] of byte;
  60.     BufferPtr             = ^BufferType;
  61.  
  62. var
  63.    {Fastgraph Variables}
  64.    FGBufferPtr              :BufferPtr;
  65.    FGImagePtr               :pointer;
  66.    FastgraphChipSet         :integer;
  67.    New_Mode                 :integer;
  68.    Old_Mode                 :integer;
  69.  
  70.    {Genus Variables}
  71.    GenusBuffer              :GXHEADER;
  72.    GenusTransparentBuffer   :GXHEADER;
  73.    GenusImage               :FXIMAGE;
  74.    Buffer                   :array[1..BufMax] of byte;
  75.    PCXType                  :integer;
  76.    GenusChipset             :integer;
  77.    VesaInfo                 :GXVESAINFO;
  78.  
  79.    {Metagraphics Variables}
  80.    MetagraphicsChipset      :integer;
  81.    Rectangle                :Rect;
  82.    MWBuffer                 :BufferPtr;
  83.    MWMask                   :BufferPtr;
  84.    MWMode                   :integer;
  85.  
  86.    rc                       :integer;
  87.    c                        :char;
  88.    x,y                      :word;
  89.  
  90.    Color                    :byte;
  91.  
  92.    Time                     :array[1..MaxLibraries,1..MaxTimes] of longint;
  93.  
  94.    RandomPoints             :array[1..10000,1..2] of byte;
  95.  
  96. procedure Error(LibraryNum,rc,Location:integer);
  97. begin
  98.      case LibraryNum of
  99.           Genus:begin
  100.                gxSetMode(gxText);
  101.                writeln('Genus Error ',rc,' at ',Location);
  102.           end;
  103.           Fastgraph:begin
  104.                fg_setmode(Old_Mode);
  105.                fg_reset;
  106.                writeln('Fastgraph Error ',rc,' at ',Location);
  107.           end;
  108.           Metagraphics:begin
  109.                SetDisplay(TextPg0);
  110.                StopGraphics;
  111.                rc:=QueryError;
  112.                writeln('Metagraphics Error ',rc,' at ',Location);
  113.           end;
  114.      end;
  115.      halt;
  116. end;{Error}
  117.  
  118. procedure ClearScreen(LibraryNum:integer);
  119. begin
  120.      case LibraryNum of
  121.           Genus:begin
  122.               rc:=gxClearDisplay(0,0);
  123.           end;
  124.           Fastgraph:begin
  125.               fg_Erase;
  126.           end;
  127.           Metagraphics:begin
  128.               SetRect(Rectangle,0,0,320,200);
  129.               FillRect(Rectangle,0);
  130.           end;
  131.      end;
  132. end;{ClearScreen}
  133.  
  134. procedure TestLibrary(LibraryNum,ModeNum:integer);
  135. var x,y:word;
  136.  
  137. {-----------------------------------------------------------------------}
  138.  
  139. procedure StraightBlit(LibraryNum,XCoor,YCoor,Width,Height,Iterations,TimeSlot:integer);
  140. var w,h:integer;
  141.     x:word;
  142. begin
  143.      w:=Width-1;
  144.      h:=Height-1;
  145.  
  146.      case LibraryNum of
  147.           Genus:begin
  148.                 w:=XCoor + w;
  149.                 h:=YCoor + h;
  150.                 rc:=gxBeginTimer(gxHighRes);
  151.                 for x:=1 to Iterations do begin
  152.                     rc:=gxVirtualDisplay(GenusBuffer,0,0,XCoor,YCoor,w,h,0);
  153.                 end;
  154.                 Time[Genus,TimeSlot]:=gxGetTime;
  155.           end;
  156.           Fastgraph:begin
  157.                 w:=XCoor + w;
  158.                 h:=YCoor + h;
  159.                 rc:=gxBeginTimer(gxHighRes);
  160.                 for x:=1 to Iterations do begin
  161.                     fg_putblock(FGBufferPtr,XCoor,w,YCoor,h);
  162.                 end;
  163.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  164.           end;
  165.           Metagraphics:begin
  166.                 SetRect(Rectangle,XCoor,YCoor,XCoor+w,YCoor+h);
  167.                 ReadImage(Rectangle,MWBuffer);
  168.                 if ModeNum = Mode640x480x16 then begin
  169.                    for x:=12 to 64012 do MWBuffer^[x]:=x div 256;
  170.                 end
  171.                 else begin
  172.                    for x:=12 to 64012 do MWBuffer^[x]:=x mod 16;
  173.                 end;
  174.  
  175.                 rc:=gxBeginTimer(gxHighRes);
  176.                 for x:=1 to Iterations do begin
  177.                     WriteImage(Rectangle,MWBuffer);
  178.                 end;
  179.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  180.           end;
  181.      end;
  182.  
  183. end;{StraightBlit}
  184.  
  185. procedure TransparentBlitTypical(LibraryNum,XCoor,YCoor,Width,Height,Iterations,TimeSlot:integer);
  186. var w2,w,h:integer;
  187.     x:word;
  188.     OnScreen,OffScreen:grafPortPtr;
  189.     XParRegion:RegionPtr;
  190.     Rectangle:rect;
  191. begin
  192.      w:=Width-1;
  193.      h:=Height-1;
  194.  
  195.      case LibraryNum of
  196.           Genus:begin
  197.                 rc:=gxCreateVirtual(gxCMM,GenusTransparentBuffer,PCXType,Width,Height);
  198.  
  199.                 rc:=gxClearVirtual(GenusTransparentBuffer,0);
  200.                 rc:=grSetActiveVirtual(GenusTransparentBuffer);
  201.                 rc:=grSetVirtual(gxTRUE);
  202.                 rc:=grSetFillStyle(grFSOLID,15,grOPAQUE);
  203.                 rc:=grDrawRect(Width div 4,0,w - (Width div 4),h,grFILL);
  204.                 rc:=grSetFillStyle(grFSOLID,14,grOPAQUE);
  205.                 rc:=grDrawRect(Width div 4,0,w - (Width div 4),h,grOUTLINE);
  206.                 rc:=grSetVirtual(gxFALSE);
  207.                 rc:=fxSetKeyColor(0);
  208.                 rc:=fxCreateImage(GenusImage,GenusTransparentBuffer,gxCMM);
  209.  
  210.                 rc:=gxClearDisplay(0,0);
  211.                 rc:=grSetFillStyle(grFSOLID,5,grOPAQUE);
  212.                 rc:=grDrawRect(XCoor,YCoor,XCoor + w,YCoor + h,grFILL);
  213.                 rc:=grSetFillStyle(grFSOLID,7,grOPAQUE);
  214.                 rc:=grDrawRect(XCoor,YCoor,XCoor + w,YCoor + h,grOUTLINE);
  215.                 rc:=gxBeginTimer(gxHighRes);
  216.  
  217.                 for x:=1 to Iterations do begin
  218.                     rc:=fxPutImage(GenusImage,XCoor,0,0);
  219.                 end;
  220.                 Time[Genus,TimeSlot]:=gxGetTime;
  221.  
  222.                 rc:=fxDestroyImage(GenusImage);
  223.                 rc:=gxDestroyVirtual(GenusTransparentBuffer);
  224.           end;
  225.           Fastgraph:begin
  226.  
  227.                 FGImagePtr:=FGBufferPtr;
  228.                 if ModeNum = Mode640x480x16 then begin
  229.                    w2:=(Width div 2);if (Width mod 2) = 1 then w2:=w2+1;
  230.                 end
  231.                 else w2:=Width;
  232.  
  233.                 fg_Erase;
  234.  
  235.                 fg_SetColor(15);
  236.                 fg_Rect(XCoor + (Width div 4),XCoor+w-(Width div 4),YCoor,YCoor+h);
  237.                 fg_SetColor(14);
  238.                 fg_Box(XCoor + (Width div 4),XCoor+w-(Width div 4),YCoor,YCoor+h);
  239.  
  240.                 fg_Move(XCoor,YCoor + h);
  241.                 fg_GetImage(FGImagePtr^,w2,Height);
  242.  
  243.                 fg_Erase;
  244.  
  245.                 fg_SetColor(5);
  246.                 fg_Rect(XCoor,XCoor+w,YCoor,YCoor+h);
  247.                 fg_SetColor(6);
  248.                 fg_Box(XCoor,XCoor+w,YCoor,YCoor+h);
  249.  
  250.                 rc:=gxBeginTimer(gxHighRes);
  251.                 for x:=1 to Iterations do begin
  252.                     fg_DrwImage(FGImagePtr^,w2,Height);
  253.                 end;
  254.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  255.  
  256.           end;
  257.           Metagraphics:begin
  258.  
  259.                 (*
  260.                 GetPort( OnScreen );
  261.                 OffScreen := CreateBitmap( cMEMORY, Width, Height );
  262.                 SetPort( OffScreen );
  263.                 EraseRect( Offscreen^.portRect );
  264.                 SetRect( Rectangle, Width div 4, 0, w - (Width div 4), h );
  265.                 PenColor( 15 );
  266.                 FillRect( Rectangle, 1);
  267.                 PenColor( 14 );
  268.                 FrameRect( Rectangle );
  269.                 XParRegion := CreateRegion( NULL, 0);
  270.  
  271.                 SetPort( OnScreen );
  272.                     ClipRegion ( XParRegion );
  273.  
  274.                 gxBeginTimer( gxHighRes );
  275.                     for x:=1 to Iterations do begin
  276.                     CopyBlit( OffScreen, OnScreen, Rectangle, Rectangle );
  277.                     end;
  278.                 Time[Metagraphics,TimeSlot] := gxGetTime;
  279.  
  280.                 DestroyRegion( XParRegion );
  281.                 DestroyBitmap( OffScreen );
  282.                 *)
  283.  
  284.                 Time[Metagraphics,TimeSlot] := 0;
  285.           end;
  286.      end;
  287.  
  288. end;{TransparentBlitTypical}
  289.  
  290. procedure TransparentBlitWorst(LibraryNum,XCoor,YCoor,Width,Height,Iterations,TimeSlot:integer);
  291. var w2,w,h:integer;
  292.     x:word;
  293. begin
  294.      w:=Width-1;
  295.      h:=Height-1;
  296.  
  297.      case LibraryNum of
  298.           Genus:begin
  299.                 rc:=gxCreateVirtual(gxCMM,GenusTransparentBuffer,PCXType,Width,Height);
  300.  
  301.                 rc:=gxClearVirtual(GenusTransparentBuffer,0);
  302.                 rc:=grSetActiveVirtual(GenusTransparentBuffer);
  303.                 rc:=grSetVirtual(gxTRUE);
  304.                 rc:=grSetColor(15);
  305.                 x:=0;
  306.                 while x<=w do begin
  307.                       rc:=grMoveTo(x,0);
  308.                       rc:=grLineTo(x,h - 1);
  309.                       x:=x+2;
  310.                 end;
  311.                 rc:=grSetVirtual(gxFALSE);
  312.                 rc:=fxSetKeyColor(0);
  313.                 rc:=fxCreateImage(GenusImage,GenusTransparentBuffer,gxCMM);
  314.  
  315.                 rc:=gxClearDisplay(0,0);
  316.                 rc:=grSetFillStyle(grFSOLID,7,grOPAQUE);
  317.                 rc:=grDrawRect(XCoor,YCoor,XCoor + w,YCoor + h,grOUTLINE);
  318.                 rc:=gxBeginTimer(gxHighRes);
  319.  
  320.                 for x:=1 to Iterations do begin
  321.                     rc:=fxPutImage(GenusImage,XCoor,0,0);
  322.                 end;
  323.                 Time[Genus,TimeSlot]:=gxGetTime;
  324.  
  325.                 rc:=fxDestroyImage(GenusImage);
  326.                 rc:=gxDestroyVirtual(GenusTransparentBuffer);
  327.           end;
  328.           Fastgraph:begin
  329.  
  330.                 FGImagePtr:=FGBufferPtr;
  331.                 if ModeNum = Mode640x480x16 then begin
  332.                    w2:=(Width div 2);if (Width mod 2) = 1 then w2:=w2+1;
  333.                 end
  334.                 else w2:=Width;
  335.  
  336.                 fg_Erase;
  337.  
  338.                 fg_SetColor(15);
  339.                 x:=0;
  340.                 while x<=w do begin
  341.                       fg_Move(x,0);
  342.                       fg_Draw(x,h - 1);
  343.                       x:=x+2;
  344.                 end;
  345.  
  346.                 fg_Move(XCoor,YCoor + h);
  347.                 fg_GetImage(FGImagePtr^,w2,Height);
  348.  
  349.                 fg_Erase;
  350.  
  351.                 fg_SetColor(5);
  352.                 fg_Rect(XCoor,XCoor+w,YCoor,YCoor+h);
  353.                 fg_SetColor(6);
  354.                 fg_Box(XCoor,XCoor+w,YCoor,YCoor+h);
  355.  
  356.                 rc:=gxBeginTimer(gxHighRes);
  357.                 for x:=1 to Iterations do begin
  358.                     fg_DrwImage(FGImagePtr^,w2,Height);
  359.                 end;
  360.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  361.  
  362.           end;
  363.           Metagraphics:begin
  364.                 (*
  365.                 *)
  366.                 Time[Metagraphics,TimeSlot]:=0;
  367.           end;
  368.      end;
  369.  
  370. end;{TransparentBlitWorst}
  371.  
  372. procedure EmptyRectangle(LibraryNum,XCoor,YCoor,Width,Height,Iterations,TimeSlot:integer);
  373. var w,h:integer;
  374.     x:word;
  375. begin
  376.      w:=Width-1;
  377.      h:=Height-1;
  378.  
  379.      case LibraryNum of
  380.           Genus:begin
  381.                 rc:=grSetColor(Color);
  382.  
  383.                 w:=XCoor + w;
  384.                 h:=YCoor + h;
  385.                 rc:=gxBeginTimer(gxHighRes);
  386.                 for x:=1 to Iterations do begin
  387.                     rc:=grDrawRect(XCoor,YCoor,w,h,grOUTLINE);
  388.                 end;
  389.                 Time[Genus,TimeSlot]:=gxGetTime;
  390.           end;
  391.           Fastgraph:begin
  392.                 fg_SetColor(Color);
  393.  
  394.                 w:=XCoor + w;
  395.                 h:=YCoor + h;
  396.                 rc:=gxBeginTimer(gxHighRes);
  397.                 for x:=1 to Iterations do begin
  398.                     fg_Box(XCoor,w,YCoor,h);
  399.                 end;
  400.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  401.           end;
  402.           Metagraphics:begin
  403.                 PenColor(Color);
  404.                 SetRect(Rectangle,XCoor,YCoor,XCoor+w,YCoor+h);
  405.  
  406.                 rc:=gxBeginTimer(gxHighRes);
  407.                 for x:=1 to Iterations do begin
  408.                     FrameRect(Rectangle);
  409.                 end;
  410.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  411.           end;
  412.      end;
  413.  
  414.      Color:=Color+1;
  415.      if Color > 15 then Color:=1;
  416.  
  417. end;{EmptyRectangle}
  418.  
  419. procedure FillRectangle(LibraryNum,XCoor,YCoor,Width,Height,Iterations,TimeSlot:integer);
  420. var w,h:integer;
  421.     x:word;
  422. begin
  423.      w:=Width-1;
  424.      h:=Height-1;
  425.  
  426.      case LibraryNum of
  427.           Genus:begin
  428.                 rc:=grSetFillStyle(grFSOLID,Color,grOPAQUE);
  429.  
  430.                 w:=XCoor + w;
  431.                 h:=YCoor + h;
  432.                 rc:=gxBeginTimer(gxHighRes);
  433.                 for x:=1 to Iterations do begin
  434.                     rc:=grDrawRect(XCoor,YCoor,w,h,grFILL);
  435.                 end;
  436.                 Time[Genus,TimeSlot]:=gxGetTime;
  437.           end;
  438.           Fastgraph:begin
  439.                 fg_SetColor(Color);
  440.  
  441.                 w:=XCoor + w;
  442.                 h:=YCoor + h;
  443.                 rc:=gxBeginTimer(gxHighRes);
  444.                 for x:=1 to Iterations do begin
  445.                     fg_Rect(XCoor,w,YCoor,h);
  446.                 end;
  447.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  448.           end;
  449.           Metagraphics:begin
  450.                 PenColor(Color);
  451.                 SetRect(Rectangle,XCoor,YCoor,XCoor+w+1,YCoor+h+1);
  452.  
  453.                 rc:=gxBeginTimer(gxHighRes);
  454.                 for x:=1 to Iterations do begin
  455.                     FillRect(Rectangle,1);
  456.                 end;
  457.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  458.           end;
  459.      end;
  460.  
  461.      Color:=Color+1;
  462.      if Color > 15 then Color:=1;
  463.  
  464. end;{FillRectangle}
  465.  
  466. procedure VerticalLine(LibraryNum,XCoor,YCoor,Length,Iterations,TimeSlot:integer);
  467. var l,Iteration2:integer;
  468.     x:word;
  469. begin
  470.      Iteration2:=Iterations div 2;
  471.      l:=Length-1;
  472.  
  473.      case LibraryNum of
  474.           Genus:begin
  475.                 rc:=grSetColor(Color);
  476.                 rc:=grMoveTo(XCoor,YCoor);
  477.  
  478.                 l:=YCoor+l;
  479.                 rc:=gxBeginTimer(gxHighRes);
  480.                 for x:=1 to Iteration2 do begin
  481.                     rc:=grLineTo(XCoor,l);
  482.                     rc:=grLineTo(XCoor,YCoor);
  483.                 end;
  484.                 Time[Genus,TimeSlot]:=gxGetTime;
  485.           end;
  486.           Fastgraph:begin
  487.                 fg_SetColor(Color);
  488.                 fg_Move(XCoor,YCoor);
  489.  
  490.                 l:=YCoor+l;
  491.                 rc:=gxBeginTimer(gxHighRes);
  492.                 for x:=1 to Iteration2 do begin
  493.                     fg_Draw(XCoor,l);
  494.                     fg_Draw(XCoor,YCoor);
  495.                 end;
  496.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  497.           end;
  498.           Metagraphics:begin
  499.                 PenColor(Color);
  500.                 MoveTo(XCoor,YCoor);
  501.  
  502.                 l:=YCoor+l;
  503.                 rc:=gxBeginTimer(gxHighRes);
  504.                 for x:=1 to Iteration2 do begin
  505.                     LineTo(XCoor,l);
  506.                     LineTo(XCoor,YCoor);
  507.                 end;
  508.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  509.           end;
  510.      end;
  511.  
  512.      Color:=Color+1;
  513.      if Color > 15 then Color:=1;
  514.  
  515. end;{VerticalLine}
  516.  
  517. procedure HorizontalLine(LibraryNum,XCoor,YCoor,Length,Iterations,TimeSlot:integer);
  518. var l,Iteration2:integer;
  519.     x:word;
  520. begin
  521.      Iteration2:=Iterations div 2;
  522.      l:=Length-1;
  523.  
  524.      case LibraryNum of
  525.           Genus:begin
  526.                 rc:=grSetColor(Color);
  527.                 rc:=grMoveTo(XCoor,YCoor);
  528.  
  529.                 l:=XCoor+l;
  530.                 rc:=gxBeginTimer(gxHighRes);
  531.                 for x:=1 to Iteration2 do begin
  532.                     rc:=grLineTo(l,YCoor);
  533.                     rc:=grLineTo(XCoor,YCoor);
  534.                 end;
  535.                 Time[Genus,TimeSlot]:=gxGetTime;
  536.           end;
  537.           Fastgraph:begin
  538.                 fg_SetColor(Color);
  539.                 fg_Move(XCoor,YCoor);
  540.  
  541.                 l:=XCoor+l;
  542.                 rc:=gxBeginTimer(gxHighRes);
  543.                 for x:=1 to Iteration2 do begin
  544.                     fg_Draw(l,YCoor);
  545.                     fg_Draw(XCoor,YCoor);
  546.                 end;
  547.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  548.           end;
  549.           Metagraphics:begin
  550.                 PenColor(Color);
  551.                 MoveTo(XCoor,YCoor);
  552.  
  553.                 l:=XCoor+l;
  554.                 rc:=gxBeginTimer(gxHighRes);
  555.                 for x:=1 to Iteration2 do begin
  556.                     LineTo(l,YCoor);
  557.                     LineTo(XCoor,YCoor);
  558.                 end;
  559.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  560.           end;
  561.      end;
  562.  
  563.      Color:=Color+1;
  564.      if Color > 15 then Color:=1;
  565.  
  566. end;{HorizontalLine}
  567.  
  568. procedure DiagonalLine(LibraryNum,Length,Iterations,TimeSlot:integer);
  569. var l,l2,Iteration2:integer;
  570.     x:word;
  571. begin
  572.      Iteration2:=Iterations div 2;
  573.      l:=Length-1;
  574.      l2:=Length div 2;
  575.  
  576.      case LibraryNum of
  577.           Genus:begin
  578.                 rc:=grSetColor(Color);
  579.                 rc:=grMoveTo(0,0);
  580.  
  581.                 rc:=gxBeginTimer(gxHighRes);
  582.                 for x:=1 to Iteration2 do begin
  583.                     rc:=grLineTo(l,l2);
  584.                     rc:=grLineTo(0,0);
  585.                 end;
  586.                 Time[Genus,TimeSlot]:=gxGetTime;
  587.           end;
  588.           Fastgraph:begin
  589.                 fg_SetColor(Color);
  590.                 fg_Move(0,0);
  591.  
  592.                 rc:=gxBeginTimer(gxHighRes);
  593.                 for x:=1 to Iteration2 do begin
  594.                     fg_Draw(l,l2);
  595.                     fg_Draw(0,0);
  596.                 end;
  597.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  598.           end;
  599.           Metagraphics:begin
  600.                 PenColor(Color);
  601.                 MoveTo(0,0);
  602.  
  603.                 rc:=gxBeginTimer(gxHighRes);
  604.                 for x:=1 to Iteration2 do begin
  605.                     LineTo(l,l2);
  606.                     LineTo(0,0);
  607.                 end;
  608.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  609.           end;
  610.      end;
  611.  
  612.      Color:=Color+1;
  613.      if Color > 15 then Color:=1;
  614.  
  615. end;{DiagonalLine}
  616.  
  617. procedure MultipleLine(LibraryNum,Length,Iterations,TimeSlot:integer);
  618. var a,l,Iteration2:integer;
  619.     x:word;
  620. begin
  621.      Iteration2:=Iterations div 2;
  622.      l:=Length-1;
  623.  
  624.      case LibraryNum of
  625.           Genus:begin
  626.                 rc:=grSetColor(Color);
  627.                 rc:=grMoveTo(0,0);
  628.  
  629.                 rc:=gxBeginTimer(gxHighRes);
  630.                 for x:=1 to Iteration2 do begin
  631.                     for a:=0 to l do begin
  632.                         rc:=grLineTo(l,a);
  633.                         rc:=grLineTo(0,0);
  634.                     end;
  635.                     for a:=0 to l do begin
  636.                         rc:=grLineTo(a,l);
  637.                         rc:=grLineTo(0,0);
  638.                     end;
  639.                 end;
  640.                 Time[Genus,TimeSlot]:=gxGetTime;
  641.           end;
  642.           Fastgraph:begin
  643.                 fg_SetColor(Color);
  644.                 fg_Move(0,0);
  645.  
  646.                 rc:=gxBeginTimer(gxHighRes);
  647.                 for x:=1 to Iteration2 do begin
  648.                     for a:=0 to l do begin
  649.                         fg_Draw(l,a);
  650.                         fg_Draw(0,0);
  651.                     end;
  652.                     for a:=0 to l do begin
  653.                         fg_Draw(a,l);
  654.                         fg_Draw(0,0);
  655.                     end;
  656.                 end;
  657.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  658.           end;
  659.           Metagraphics:begin
  660.                 PenColor(Color);
  661.                 MoveTo(0,0);
  662.  
  663.                 rc:=gxBeginTimer(gxHighRes);
  664.                 for x:=1 to Iteration2 do begin
  665.                     for a:=0 to l do begin
  666.                         LineTo(l,a);
  667.                         LineTo(0,0);
  668.                     end;
  669.                     for a:=0 to l do begin
  670.                         LineTo(a,l);
  671.                         LineTo(0,0);
  672.                     end;
  673.                 end;
  674.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  675.           end;
  676.      end;
  677.  
  678.      Color:=Color+1;
  679.      if Color > 15 then Color:=1;
  680.  
  681. end;{MultipleLine}
  682.  
  683. procedure SinglePixel(LibraryNum,Iterations,TimeSlot:integer);
  684. var l:integer;
  685.     x:word;
  686. begin
  687.      case LibraryNum of
  688.           Genus:begin
  689.                 rc:=grSetColor(Color);
  690.  
  691.                 rc:=gxBeginTimer(gxHighRes);
  692.                 for x:=1 to Iterations do begin
  693.                     rc:=grPutPixel(RandomPoints[x,1],RandomPoints[x,2],Color);
  694.                 end;
  695.                 Time[Genus,TimeSlot]:=gxGetTime;
  696.           end;
  697.           Fastgraph:begin
  698.                 fg_SetColor(Color);
  699.  
  700.                 rc:=gxBeginTimer(gxHighRes);
  701.                 for x:=1 to Iterations do begin
  702.                     fg_Point(RandomPoints[x,1],RandomPoints[x,2]);
  703.                 end;
  704.                 Time[Fastgraph,TimeSlot]:=gxGetTime;
  705.           end;
  706.           Metagraphics:begin
  707.                 PenColor(Color);
  708.  
  709.                 rc:=gxBeginTimer(gxHighRes);
  710.                 for x:=1 to Iterations do begin
  711.                     SetPixel(RandomPoints[x,1],RandomPoints[x,2]);
  712.                 end;
  713.                 Time[Metagraphics,TimeSlot]:=gxGetTime;
  714.           end;
  715.      end;
  716.  
  717.      Color:=Color+1;
  718.      if Color > 15 then Color:=1;
  719.  
  720. end;{SinglePixel}
  721.  
  722. {-------------------------------------------------------------------------}
  723.  
  724. begin
  725.  
  726.      {initialize graphics kernel and mode}
  727.      case LibraryNum of
  728.           Genus:begin
  729.                 case ModeNum of
  730.                      Mode320x200x256:begin
  731.                           PcxType:=gxVGA_13;
  732.                      end;
  733.                      Mode640x480x16 :begin
  734.                           PcxType:=gxVGA_12;
  735.                      end;
  736.                      Mode640x480x256:begin
  737.                           GenusChipSet:=0;
  738.                           if GenusChipSet = 0 then begin
  739.                              if (gxVESAInstalled(VesaInfo) = gxSUCCESS) then begin
  740.                                 GenusChipSet := chipVESA;
  741.                              end
  742.                              else begin
  743.                                   writeln(output,'Genus unable to set VESA SVGA mode');
  744.                                   halt;
  745.                              end;
  746.                           end;
  747.                           gxSetChipSet(GenusChipSet);
  748.                           PcxType:=gxVESA_101;
  749.                      end;
  750.                 end;
  751.                 gxSetBuffer(@Buffer,BufMax);
  752.                 gxSetDisplay(PcxType);
  753.                 rc:=gxSetMode(gxGraphics);
  754.                 if rc<>0 then begin
  755.                    writeln(output,'rc = ',rc);
  756.                    halt;
  757.                 end;
  758.  
  759.                 rc:=gxCreateVirtual(gxCMM,GenusBuffer,PCXtype,320,200);
  760.                 if rc<>0 then Error(LibraryNum,rc,1);
  761.  
  762.                 rc:=grSetActiveVirtual(GenusBuffer);
  763.                 rc:=grSetVirtual(gxTRUE);
  764.                 for Color:=0 to 9 do begin
  765.                     rc:=grSetFillStyle(grFSOLID,Color+1,grOPAQUE);
  766.                     rc:=grDrawRect(0,(Color*20),319,(Color*20)+19,grFILL);
  767.                 end;
  768.                 rc:=grSetVirtual(gxFALSE);
  769.  
  770.                 rc:=gxModeCheck(gxFALSE);
  771.                 rc:=gxRetraceCheck(gxFALSE);
  772.           end;
  773.           Fastgraph:begin
  774.                 case ModeNum of
  775.                      Mode320x200x256:begin
  776.                           New_Mode:=19;
  777.                      end;
  778.                      Mode640x480x16 :begin
  779.                           New_Mode:=18;
  780.                      end;
  781.                      Mode640x480x256:begin
  782.                           New_Mode:=25;
  783.                           FastgraphChipSet:=fg_SVGAInit(1);
  784.                           if FastgraphChipSet<>1 then begin
  785.                              writeln(output,'Fastgraph unable to set VESA SVGA mode');
  786.                              halt;
  787.                           end;
  788.                      end;
  789.                 end;
  790.  
  791.                 Old_Mode:=fg_GetMode;
  792.                 fg_SetMode(New_Mode);
  793.  
  794.                 getmem(FGBufferPtr,sizeof(FGBufferPtr^));
  795.                 if ModeNum = Mode640x480x16 then begin
  796.                    for x:=0 to 63999 do FGBufferPtr^[x]:=x div 256;
  797.                 end
  798.                 else begin
  799.                    for x:=0 to 63999 do FGBufferPtr^[x]:=x mod 16;
  800.                 end;
  801.  
  802.                 fg_WaitVR(0);
  803.           end;
  804.           MetaGraphics:begin
  805.                 case ModeNum of
  806.                      Mode320x200x256:begin
  807.                          MWMode:=VGA320x200X;
  808.                      end;
  809.                      Mode640x480x16 :begin
  810.                          MWMode:=VGA640x480;
  811.                      end;
  812.                      Mode640x480x256:begin
  813.                          MWMode:=VESA640x480X;
  814.                      end;
  815.                 end;
  816.                 rc:=InitGraphics(MWMode);
  817.                 if rc<>0 then begin
  818.                    {rc:=QueryError;}
  819.                    writeln(output,'MetaWINDOWS unable to set VESA SVGA mode');
  820.                    writeln(output,'rc = ',rc);
  821.                    halt;
  822.                 end;
  823.                 SetDisplay(GrafPg0);
  824.  
  825.                 getmem(MWBuffer,sizeof(MWBuffer^));
  826.                 getmem(MWMask,sizeof(MWMask^));
  827.  
  828.           end;
  829.      end;
  830.  
  831.      {byte-aligned}
  832.      StraightBlit(LibraryNum,0,0,  8,  8,1000,  7);
  833.      StraightBlit(LibraryNum,0,0, 16, 16,1000,  6);
  834.      StraightBlit(LibraryNum,0,0, 32, 32, 100,  5);
  835.      StraightBlit(LibraryNum,0,0, 64, 64, 100,  4);
  836.      StraightBlit(LibraryNum,0,0,128,128,  10,  3);
  837.      StraightBlit(LibraryNum,0,0,256,128,  10,  2);
  838.      StraightBlit(LibraryNum,0,0,320,200,  10,  1);
  839.  
  840.      ClearScreen(LibraryNum);
  841.  
  842.      {non-byte-aligned}
  843.      StraightBlit(LibraryNum,1,1,  7,  7,1000, 13);
  844.      StraightBlit(LibraryNum,1,1, 15, 15,1000, 12);
  845.      StraightBlit(LibraryNum,1,1, 31, 31, 100, 11);
  846.      StraightBlit(LibraryNum,1,1, 63, 63, 100, 10);
  847.      StraightBlit(LibraryNum,1,1,127,127,  10,  9);
  848.      StraightBlit(LibraryNum,1,1,255,127,  10,  8);
  849.  
  850.      ClearScreen(LibraryNum);
  851.  
  852.      {byte-aligned}
  853.      TransparentBlitTypical(LibraryNum,0,0,  8,  8,1000, 20);
  854.      TransparentBlitTypical(LibraryNum,0,0, 16, 16,1000, 19);
  855.      TransparentBlitTypical(LibraryNum,0,0, 32, 32, 100, 18);
  856.      TransparentBlitTypical(LibraryNum,0,0, 64, 64, 100, 17);
  857.      TransparentBlitTypical(LibraryNum,0,0,128,128,  10, 16);
  858.      TransparentBlitTypical(LibraryNum,0,0,256,128,  10, 15);
  859.      TransparentBlitTypical(LibraryNum,0,0,320,200,  10, 14);
  860.  
  861.      ClearScreen(LibraryNum);
  862.  
  863.      {non-byte-aligned}
  864.      TransparentBlitTypical(LibraryNum,1,1,  7,  7,1000, 26);
  865.      TransparentBlitTypical(LibraryNum,1,1, 15, 15,1000, 25);
  866.      TransparentBlitTypical(LibraryNum,1,1, 31, 31, 100, 24);
  867.      TransparentBlitTypical(LibraryNum,1,1, 63, 63, 100, 23);
  868.      TransparentBlitTypical(LibraryNum,1,1,127,127,  10, 22);
  869.      TransparentBlitTypical(LibraryNum,1,1,255,127,  10, 21);
  870.  
  871.      ClearScreen(LibraryNum);
  872.  
  873.      {byte-aligned}
  874.      TransparentBlitWorst(LibraryNum,0,0,  8,  8,1000,120);
  875.      TransparentBlitWorst(LibraryNum,0,0, 16, 16,1000,119);
  876.      TransparentBlitWorst(LibraryNum,0,0, 32, 32, 100,118);
  877.      TransparentBlitWorst(LibraryNum,0,0, 64, 64, 100,117);
  878.      TransparentBlitWorst(LibraryNum,0,0,128,128,  10,116);
  879.      TransparentBlitWorst(LibraryNum,0,0,256,128,  10,115);
  880.      TransparentBlitWorst(LibraryNum,0,0,320,200,  10,114);
  881.  
  882.      ClearScreen(LibraryNum);
  883.  
  884.      {non-byte-aligned}
  885.      TransparentBlitWorst(LibraryNum,1,1,  7,  7,1000,126);
  886.      TransparentBlitWorst(LibraryNum,1,1, 15, 15,1000,125);
  887.      TransparentBlitWorst(LibraryNum,1,1, 31, 31, 100,124);
  888.      TransparentBlitWorst(LibraryNum,1,1, 63, 63, 100,123);
  889.      TransparentBlitWorst(LibraryNum,1,1,127,127,  10,122);
  890.      TransparentBlitWorst(LibraryNum,1,1,255,127,  10,121);
  891.  
  892.      ClearScreen(LibraryNum);
  893.  
  894.      {byte-aligned}
  895.      EmptyRectangle(LibraryNum,0,0,320,200, 100, 27);
  896.      EmptyRectangle(LibraryNum,0,0,256,128, 100, 28);
  897.      EmptyRectangle(LibraryNum,0,0,128,128, 100, 29);
  898.      EmptyRectangle(LibraryNum,0,0, 64, 64, 100, 30);
  899.      EmptyRectangle(LibraryNum,0,0, 32, 32,1000, 31);
  900.      EmptyRectangle(LibraryNum,0,0, 16, 16,1000, 32);
  901.      EmptyRectangle(LibraryNum,0,0,  8,  8,1000, 33);
  902.  
  903.      ClearScreen(LibraryNum);
  904.  
  905.      {non-byte-aligned}
  906.      EmptyRectangle(LibraryNum,1,1,255,127, 100, 34);
  907.      EmptyRectangle(LibraryNum,1,1,127,127, 100, 35);
  908.      EmptyRectangle(LibraryNum,1,1, 63, 63, 100, 36);
  909.      EmptyRectangle(LibraryNum,1,1, 31, 31,1000, 37);
  910.      EmptyRectangle(LibraryNum,1,1, 15, 15,1000, 38);
  911.      EmptyRectangle(LibraryNum,1,1,  7,  7,1000, 39);
  912.  
  913.      ClearScreen(LibraryNum);
  914.  
  915.      {byte-aligned}
  916.      FillRectangle(LibraryNum,0,0,320,200, 100, 40);
  917.      FillRectangle(LibraryNum,0,0,256,128, 100, 41);
  918.      FillRectangle(LibraryNum,0,0,128,128, 100, 42);
  919.      FillRectangle(LibraryNum,0,0, 64, 64, 100, 43);
  920.      FillRectangle(LibraryNum,0,0, 32, 32,1000, 44);
  921.      FillRectangle(LibraryNum,0,0, 16, 16,1000, 45);
  922.      FillRectangle(LibraryNum,0,0,  8,  8,1000, 46);
  923.  
  924.      ClearScreen(LibraryNum);
  925.  
  926.      {non-byte-aligned}
  927.      FillRectangle(LibraryNum,1,1,255,125, 100, 47);
  928.      FillRectangle(LibraryNum,1,1,127,127, 100, 48);
  929.      FillRectangle(LibraryNum,1,1, 63, 63, 100, 49);
  930.      FillRectangle(LibraryNum,1,1, 31, 31,1000, 50);
  931.      FillRectangle(LibraryNum,1,1, 15, 15,1000, 51);
  932.      FillRectangle(LibraryNum,1,1,  7,  7,1000, 52);
  933.  
  934.      ClearScreen(LibraryNum);
  935.  
  936.      {byte-aligned}
  937.      VerticalLine(LibraryNum,0,0,200, 1000, 53);
  938.      VerticalLine(LibraryNum,0,0,128, 1000, 54);
  939.      VerticalLine(LibraryNum,0,0, 64, 1000, 55);
  940.      VerticalLine(LibraryNum,0,0, 32, 1000, 56);
  941.      VerticalLine(LibraryNum,0,0, 16,10000, 57);
  942.      VerticalLine(LibraryNum,0,0,  8,10000, 58);
  943.  
  944.      ClearScreen(LibraryNum);
  945.  
  946.      {non-byte-aligned}
  947.      VerticalLine(LibraryNum,1,1,199, 1000, 59);
  948.      VerticalLine(LibraryNum,1,1,127, 1000, 60);
  949.      VerticalLine(LibraryNum,1,1, 63, 1000, 61);
  950.      VerticalLine(LibraryNum,1,1, 31, 1000, 62);
  951.      VerticalLine(LibraryNum,1,1, 15,10000, 63);
  952.      VerticalLine(LibraryNum,1,1,  7,10000, 64);
  953.  
  954.      ClearScreen(LibraryNum);
  955.  
  956.      {byte-aligned}
  957.      HorizontalLine(LibraryNum,0,0,200, 1000, 65);
  958.      HorizontalLine(LibraryNum,0,0,128, 1000, 66);
  959.      HorizontalLine(LibraryNum,0,0, 64, 1000, 67);
  960.      HorizontalLine(LibraryNum,0,0, 32, 1000, 68);
  961.      HorizontalLine(LibraryNum,0,0, 16,10000, 69);
  962.      HorizontalLine(LibraryNum,0,0,  8,10000, 70);
  963.  
  964.      ClearScreen(LibraryNum);
  965.  
  966.      {non-byte-aligned}
  967.      HorizontalLine(LibraryNum,2,2,199, 1000, 71);
  968.      HorizontalLine(LibraryNum,2,2,127, 1000, 72);
  969.      HorizontalLine(LibraryNum,2,2, 63, 1000, 73);
  970.      HorizontalLine(LibraryNum,2,2, 31, 1000, 74);
  971.      HorizontalLine(LibraryNum,2,2, 15,10000, 75);
  972.      HorizontalLine(LibraryNum,2,2,  7,10000, 76);
  973.  
  974.      ClearScreen(LibraryNum);
  975.  
  976.      DiagonalLine(LibraryNum,200, 1000, 77);
  977.      DiagonalLine(LibraryNum,128, 1000, 78);
  978.      DiagonalLine(LibraryNum, 64, 1000, 79);
  979.      DiagonalLine(LibraryNum, 32, 1000, 80);
  980.      DiagonalLine(LibraryNum, 16,10000, 81);
  981.      DiagonalLine(LibraryNum,  8,10000, 82);
  982.  
  983.      ClearScreen(LibraryNum);
  984.  
  985.      MultipleLine(LibraryNum,200, 10, 83);
  986.      MultipleLine(LibraryNum,128, 10, 84);
  987.      MultipleLine(LibraryNum, 64, 10, 85);
  988.      MultipleLine(LibraryNum, 32,100, 86);
  989.      MultipleLine(LibraryNum, 16,100, 87);
  990.      MultipleLine(LibraryNum,  8,100, 88);
  991.  
  992.      ClearScreen(LibraryNum);
  993.  
  994.      SinglePixel(LibraryNum,10000, 89);
  995.  
  996.      {shutdown graphics kernel and reset to text mode}
  997.      case LibraryNum of
  998.           Genus:begin
  999.                 rc:=gxDestroyVirtual(GenusBuffer);
  1000.                 rc:=gxSetMode(gxText);
  1001.           end;
  1002.           Fastgraph:begin
  1003.                 freemem(FGBufferPtr,sizeof(FGBufferPtr^));
  1004.                 fg_SetMode(Old_Mode);
  1005.                 fg_reset;
  1006.           end;
  1007.           Metagraphics:begin
  1008.                 freemem(MWBuffer,sizeof(MWBuffer^));
  1009.                 freemem(MWMask,sizeof(MWMask^));
  1010.                 SetDisplay(TextPg0);
  1011.                 StopGraphics;
  1012.           end;
  1013.      end;
  1014.  
  1015. end;{TestLibrary}
  1016.  
  1017. procedure WriteResults(ModeNum:integer);
  1018. var ResultFile:text;
  1019.     ModeString:string[40];
  1020.  
  1021.   procedure WriteResultLine(LineText:string;Iterations,TimeSlot:integer);
  1022.   begin
  1023.        write(ResultFile,LineText,', ',Iterations:5,' times     ');
  1024.        write(ResultFile,Time[Genus,TimeSlot]:5,'ms         ');
  1025.        write(ResultFile,Time[Fastgraph,TimeSlot]:5,'ms          ');
  1026.        writeln(ResultFile,Time[Metagraphics,Timeslot]:5,'ms');
  1027.   end;{WriteResultLine}
  1028.  
  1029. begin
  1030.  
  1031.      case ModeNum of
  1032.           Mode320x200x256:begin
  1033.                writeln(output,'Writing 320x200x256 results to LBENCH_A.DAT');
  1034.                assign(ResultFile,'lbench_a.dat');
  1035.                ModeString:='Mode 320x200x256';
  1036.           end;
  1037.           Mode640x480x16 :begin
  1038.                writeln(output,'Writing 640x480x16 results to LBENCH_B.DAT');
  1039.                assign(ResultFile,'lbench_b.dat');
  1040.                ModeString:='Mode 640x480x16';
  1041.           end;
  1042.           Mode640x480x256:begin
  1043.                writeln(output,'Writing 640x480x256 results to LBENCH_C.DAT');
  1044.                assign(ResultFile,'lbench_c.dat');
  1045.                ModeString:='Mode 640x480x256';
  1046.           end;
  1047.      end;
  1048.      rewrite(ResultFile);
  1049.  
  1050.      writeln(ResultFile,LibraryBenchmarkVersionString);
  1051.      writeln(ResultFile,CopyrightString);
  1052.      writeln(ResultFile,RightsString);
  1053.      writeln(ResultFile,LastUpdateString);
  1054.      writeln(ResultFile);
  1055.      writeln(ResultFile,GenusVersionString);
  1056.      writeln(ResultFile,FastgraphVersionString);
  1057.      writeln(resultFile,MetagraphicsVersionString);
  1058.      writeln(ResultFile);
  1059.      writeln(ResultFile,ModeString);
  1060.      writeln(ResultFile);
  1061.  
  1062.      writeln(ResultFile);
  1063.      writeln(ResultFile);
  1064.      writeln(ResultFile,'Straight Blit                Genus       Fastgraph       Metagraphics');
  1065.      writeln(ResultFile);
  1066.      writeln(ResultFile,'Byte-Aligned');
  1067.      WriteResultLine('320 x 200',  10,  1);
  1068.      WriteResultLine('256 x 128',  10,  2);
  1069.      WriteResultLine('128 x 128',  10,  3);
  1070.      WriteResultLine(' 64 x  64', 100,  4);
  1071.      WriteResultLine(' 32 x  32', 100,  5);
  1072.      WriteResultLine(' 16 x  16',1000,  6);
  1073.      WriteResultLine('  8 x   8',1000,  7);
  1074.      writeln(ResultFile,'Non-Byte-Aligned');
  1075.      WriteResultLine('255 x 127',  10,  8);
  1076.      WriteResultLine('127 x 127',  10,  9);
  1077.      WriteResultLine(' 63 x  63', 100, 10);
  1078.      WriteResultLine(' 31 x  31', 100, 11);
  1079.      WriteResultLine(' 15 x  15',1000, 12);
  1080.      WriteResultLine('  7 x   7',1000, 13);
  1081.  
  1082.      writeln(ResultFile);
  1083.      writeln(ResultFile);
  1084.      writeln(ResultFile,'Transparent Blit             Genus       Fastgraph       Metagraphics*');
  1085.      writeln(ResultFile,'Typical Case');
  1086.      writeln(ResultFile);
  1087.      writeln(ResultFile,'Byte-Aligned');
  1088.      WriteResultLine('320 x 200',  10, 14);
  1089.      WriteResultLine('256 x 128',  10, 15);
  1090.      WriteResultLine('128 x 128',  10, 16);
  1091.      WriteResultLine(' 64 x  64', 100, 17);
  1092.      WriteResultLine(' 32 x  32', 100, 18);
  1093.      WriteResultLine(' 16 x  16',1000, 19);
  1094.      WriteResultLine('  8 x   8',1000, 20);
  1095.      writeln(ResultFile,'Non-Byte-Aligned');
  1096.      WriteResultLine('255 x 127',  10, 21);
  1097.      WriteResultLine('127 x 127',  10, 22);
  1098.      WriteResultLine(' 63 x  63', 100, 23);
  1099.      WriteResultLine(' 31 x  31', 100, 24);
  1100.      WriteResultLine(' 15 x  15',1000, 25);
  1101.      WriteResultLine('  7 x   7',1000, 26);
  1102.      writeln(ResultFile);
  1103.      writeln(ResultFile,'* pending');
  1104.  
  1105.      writeln(ResultFile);
  1106.      writeln(ResultFile);
  1107.      writeln(ResultFile,'Transparent Blit             Genus       Fastgraph       Metagraphics*');
  1108.      writeln(ResultFile,'Worst Case');
  1109.      writeln(ResultFile);
  1110.      writeln(ResultFile,'Byte-Aligned');
  1111.      WriteResultLine('320 x 200',  10,114);
  1112.      WriteResultLine('256 x 128',  10,115);
  1113.      WriteResultLine('128 x 128',  10,116);
  1114.      WriteResultLine(' 64 x  64', 100,117);
  1115.      WriteResultLine(' 32 x  32', 100,118);
  1116.      WriteResultLine(' 16 x  16',1000,119);
  1117.      WriteResultLine('  8 x   8',1000,120);
  1118.      writeln(ResultFile,'Non-Byte-Aligned');
  1119.      WriteResultLine('255 x 127',  10,121);
  1120.      WriteResultLine('127 x 127',  10,122);
  1121.      WriteResultLine(' 63 x  63', 100,123);
  1122.      WriteResultLine(' 31 x  31', 100,124);
  1123.      WriteResultLine(' 15 x  15',1000,125);
  1124.      WriteResultLine('  7 x   7',1000,126);
  1125.      writeln(ResultFile);
  1126.      writeln(ResultFile,'* pending');
  1127.  
  1128.      writeln(ResultFile);
  1129.      writeln(ResultFile);
  1130.      writeln(ResultFile,'Rectangles, Unfilled         Genus       Fastgraph       Metagraphics');
  1131.      writeln(ResultFile);
  1132.      writeln(ResultFile,'Byte-Aligned');
  1133.      WriteResultLine('320 x 200', 100, 27);
  1134.      WriteResultLine('256 x 128', 100, 28);
  1135.      WriteResultLine('128 x 128', 100, 29);
  1136.      WriteResultLine(' 64 x  64', 100, 30);
  1137.      WriteResultLine(' 32 x  32',1000, 31);
  1138.      WriteResultLine(' 16 x  16',1000, 32);
  1139.      WriteResultLine('  8 x   8',1000, 33);
  1140.      writeln(ResultFile,'Non-Byte-Aligned');
  1141.      WriteResultLine('255 x 127', 100, 34);
  1142.      WriteResultLine('127 x 127', 100, 35);
  1143.      WriteResultLine(' 63 x  63', 100, 36);
  1144.      WriteResultLine(' 31 x  31',1000, 37);
  1145.      WriteResultLine(' 15 x  15',1000, 38);
  1146.      WriteResultLine('  7 x   7',1000, 39);
  1147.  
  1148.      writeln(ResultFile);
  1149.      writeln(ResultFile);
  1150.      writeln(ResultFile,'Rectangles, Filled           Genus       Fastgraph       Metagraphics');
  1151.      writeln(ResultFile);
  1152.      writeln(ResultFile,'Byte-Aligned');
  1153.      WriteResultLine('320 x 200', 100, 40);
  1154.      WriteResultLine('256 x 128', 100, 41);
  1155.      WriteResultLine('128 x 128', 100, 42);
  1156.      WriteResultLine(' 64 x  64', 100, 43);
  1157.      WriteResultLine(' 32 x  32',1000, 44);
  1158.      WriteResultLine(' 16 x  16',1000, 45);
  1159.      WriteResultLine('  8 x   8',1000, 46);
  1160.      writeln(ResultFile,'Non-Byte-Aligned');
  1161.      WriteResultLine('255 x 127', 100, 47);
  1162.      WriteResultLine('127 x 127', 100, 48);
  1163.      WriteResultLine(' 63 x  63', 100, 49);
  1164.      WriteResultLine(' 31 x  31',1000, 50);
  1165.      WriteResultLine(' 15 x  15',1000, 51);
  1166.      WriteResultLine('  7 x   7',1000, 52);
  1167.  
  1168.      writeln(ResultFile);
  1169.      writeln(ResultFile);
  1170.      writeln(ResultFile,'Vertical Lines               Genus       Fastgraph       Metagraphics');
  1171.      writeln(ResultFile);
  1172.      writeln(ResultFile,'Byte-Aligned');
  1173.      WriteResultLine('200 high ', 1000, 53);
  1174.      WriteResultLine('128 high ', 1000, 54);
  1175.      WriteResultLine(' 64 high ', 1000, 55);
  1176.      WriteResultLine(' 32 high ', 1000, 56);
  1177.      WriteResultLine(' 16 high ',10000, 57);
  1178.      WriteResultLine('  8 high ',10000, 58);
  1179.      writeln(ResultFile,'Non-Byte-Aligned');
  1180.      WriteResultLine('199 high ', 1000, 59);
  1181.      WriteResultLine('127 high ', 1000, 60);
  1182.      WriteResultLine(' 63 high ', 1000, 61);
  1183.      WriteResultLine(' 31 high ', 1000, 62);
  1184.      WriteResultLine(' 15 high ',10000, 63);
  1185.      WriteResultLine('  7 high ',10000, 64);
  1186.  
  1187.      writeln(ResultFile);
  1188.      writeln(ResultFile);
  1189.      writeln(ResultFile,'Horizontal Lines             Genus       Fastgraph       Metagraphics');
  1190.      writeln(ResultFile);
  1191.      writeln(ResultFile,'Byte-Aligned');
  1192.      WriteResultLine('200 wide ', 1000, 65);
  1193.      WriteResultLine('128 wide ', 1000, 66);
  1194.      WriteResultLine(' 64 wide ', 1000, 67);
  1195.      WriteResultLine(' 32 wide ', 1000, 68);
  1196.      WriteResultLine(' 16 wide ',10000, 69);
  1197.      WriteResultLine('  8 wide ',10000, 70);
  1198.      writeln(ResultFile,'Non-Byte-Aligned');
  1199.      WriteResultLine('199 wide ', 1000, 71);
  1200.      WriteResultLine('127 wide ', 1000, 72);
  1201.      WriteResultLine(' 63 wide ', 1000, 73);
  1202.      WriteResultLine(' 31 wide ', 1000, 74);
  1203.      WriteResultLine(' 15 wide ',10000, 75);
  1204.      WriteResultLine('  7 wide ',10000, 76);
  1205.  
  1206.      writeln(ResultFile);
  1207.      writeln(ResultFile);
  1208.      writeln(ResultFile,'Diagonal Lines               Genus       Fastgraph       Metagraphics');
  1209.      writeln(ResultFile);
  1210.      WriteResultLine('200 x 100', 1000, 77);
  1211.      WriteResultLine('128 x  64', 1000, 78);
  1212.      WriteResultLine(' 64 x  32', 1000, 79);
  1213.      WriteResultLine(' 32 x  16', 1000, 80);
  1214.      WriteResultLine(' 16 x   8',10000, 81);
  1215.      WriteResultLine('  8 x   4',10000, 82);
  1216.  
  1217.      writeln(ResultFile);
  1218.      writeln(ResultFile);
  1219.      writeln(ResultFile,'Multiple Line Test           Genus       Fastgraph       Metagraphics');
  1220.      writeln(ResultFile);
  1221.      WriteResultLine('200 x 100',   10, 83);
  1222.      WriteResultLine('128 x  64',   10, 84);
  1223.      WriteResultLine(' 64 x  32',   10, 85);
  1224.      WriteResultLine(' 32 x  16',  100, 86);
  1225.      WriteResultLine(' 16 x   8',  100, 87);
  1226.      WriteResultLine('  8 x   4',  100, 88);
  1227.  
  1228.      writeln(ResultFile);
  1229.      writeln(ResultFile);
  1230.      writeln(ResultFile,'Single Pixel                 Genus       Fastgraph       Metagraphics');
  1231.      writeln(ResultFile);
  1232.      WriteResultLine('Random   ',10000,89);
  1233.  
  1234.      close(ResultFile);
  1235.  
  1236.      writeln(output);
  1237.      writeln(output,'Done!');
  1238.      writeln(output);
  1239.  
  1240. end;{WriteResults}
  1241.  
  1242. begin
  1243.      clrscr;
  1244.      writeln(output,LibraryBenchmarkVersionString);
  1245.      writeln(output,CopyrightString);
  1246.      writeln(output,RightsString);
  1247.      writeln(output,LastUpdateString);
  1248.      writeln;
  1249.      writeln(output,GenusVersionString);
  1250.      writeln(output,FastgraphVersionString);
  1251.      writeln(output,MetagraphicsVersionString);
  1252.      writeln;
  1253.      writeln('Press any key to begin...');
  1254.  
  1255.      c:=readkey;
  1256.  
  1257.      Color:=1;
  1258.  
  1259.      for x:=1 to 10000 do begin
  1260.          RandomPoints[x,1]:=random(300);
  1261.          RandomPoints[x,2]:=random(190);
  1262.      end;
  1263.  
  1264.      for x:=1 to MaxLibraries do for y:=1 to MaxTimes do Time[x,y]:=0;
  1265.  
  1266.      TestLibrary(Genus,Mode320x200x256);
  1267.      TestLibrary(Fastgraph,Mode320x200x256);
  1268.      TestLibrary(Metagraphics,Mode320x200x256);
  1269.      WriteResults(Mode320x200x256);
  1270.  
  1271.      TestLibrary(Genus,Mode640x480x16 );
  1272.      TestLibrary(Fastgraph,Mode640x480x16 );
  1273.      TestLibrary(Metagraphics,Mode640x480x16 );
  1274.      WriteResults(Mode640x480x16);
  1275.  
  1276.      TestLibrary(Genus,Mode640x480x256);
  1277.      TestLibrary(Fastgraph,Mode640x480x256);
  1278.      TestLibrary(Metagraphics,Mode640x480x256);
  1279.      WriteResults(Mode640x480x256);
  1280.  
  1281. end.