    Program testWave;
    Uses Crt, { For the keypressed function }
         Crush13h;

    Const Waves      = 4;    { Number of waves }
          SinusWaves = 1;    { Depth/size of waves }
          YStart     = 0;   { YPos of start waving }
          YEnd       = 200;  { YPos of end waving }
          base       = 360;
          raio       = 40;

    Var i: integer;

        Y      :integer;
        yy     :integer;
        line1:pointer;
        line2:pointer;
        line3:pointer;

    sintable, costable : array [0..360] of Integer;

    Begin
    video_mode ( $13);
    initvirt;

    for i := 0 to base do SinTable[i] := Round(Sin(2*Pi*i/base) * Raio);
    for i := 0 to base do CosTable[i] := Round(Cos(2*Pi*i/base) * Raio);

    Loadpcx('logo1.pcx', Vp[1]);

    Repeat
               y:=y+yy;
               if y>199 then
                  begin
                       y:=199;
                       yy:=-2;
                  end;
               if y<1 then
                  begin
                       y:=1;
                       yy:=2;
                  end;
               getimage (0,y,319,y,line1,vp[1]);
               getimage (0,y-2,319,y-2,line2,vp[1]);
               getimage (0,y+2,319,y+2,line3,vp[1]);

               putimage (0,y-1,0,line2,vga);
               putimage (0,y+1,0,line3,vga);
               putimage (0,y,0,line1,vga);
               putimage (0,y-2,0,line2,vga);
               putimage (0,y+2,0,line3,vga);
               killimage (line1);
               killimage (line2);
               killimage (line3);
               waitvbl;
               copypage (vp[1],vga,0);

    Until Keypressed;

    closevirt;
    video_mode ( 03);
    End.