uses Crt,VenomGFX,FNfont2,Lacrt;
const prumer = 30;
      rameno = 200;

var c:char;
    x,y,i:longint;
    k,l,m:dword;
    s:string[3];
begin
s:=ParamStr(1);
{if (s<>'dbl') and (s<>'buf') then
   begin
   writeln('Usage: FLIPTEST <dbl|buf>');
   Halt;
   end;                                }
pagging_mode:=PAG_BUF;
init_graph(Find_mode(800,600));
init_mouse(vga);
mouseshow;
Init_pagging(0);
i:=0;
x:=vgb.breite div 2;
y:=vgb.hoehe div 2;
k:=MemL[Seg0040:$6c];
l:=0;
m:=0;
NastavVystup(@vgb);
repeat
FilledCircle(vgb,x+round(rameno*cosin[i]),y+round(rameno*sinus[i]),prumer,64000,64000);
LineSmooth(vgb,vgb.breite div 2,vgb.hoehe div 2,mouse.x,mouse.y,65530,180);
LineSmooth(vgb,400,300,500,300,65530,180);
Bar(vgb,0,0,20,20,440);
print_fn(0,16,mystr(m),fn_vga16);

inc(l);
if MemL[Seg0040:$6c]>k+1 then
   begin
   k:=MemL[Seg0040:$6c];
   m:=l;
   l:=0;
   end;

Flip_page;
{repeat until timer_passed;timer_passed:=false;}
inc(i,1);
if i>360 then i:=i-360;
if keypressed then
   begin
   c:=readkey;
   if c=' ' then
      begin
      while keypressed do readkey;
      repeat until keypressed;
      while keypressed do readkey;
      end;
   end;
until c=#27;
Kill_graph;
end.
