program ZOOMout;

uses crush13h,crt;

var c:char;
    a,x,y:integer;
    count:integer;
    sc:real;
    c1:word;

procedure copypage_l(y1:integer;from:word;y2:integer;too:word);
var a:integer;
begin
     for a:=y2 to y2+200 do
         begin
              if a>-1 then if a<200 then move(mem[from:320*(a-y2)],mem[too:320*a],320);
         end;
end;

procedure interlace(from1,from2:word;y2:integer;too:word);
var a:integer;
begin
     for a:=y2 to y2+200 do
         begin
              if a>-1 then if a<200 then
               if a mod 2 = 0 then move(mem[from1:320*(a-y2)],mem[too:320*a],320)
               else move(mem[from2:320*(a-y2)],mem[too:320*a],320);
         end;
end;

procedure interlace_2(from:word;y2:integer;too:word);
var a:integer;
begin
     for a:=y2 to y2+200 do
         begin
              if a>-1 then if a<200 then
               if a mod 2 = 0 then move(mem[from:320*(a-y2)],mem[too:320*a],320);
         end;
end;

procedure interlace_3(from:word;y2:integer;too:word);
var a:integer;
begin
     for a:=y2 to y2+200 do
         begin
              if a>-1 then if a<200 then
               if a mod 2 <> 0 then move(mem[from:320*(a-y2)],mem[too:320*a],320);
         end;
end;


begin
     video_mode ( $13);
     initvirt;

     cls (0,vp[1]);
     cls (0,vp[2]);
     loadpcx ('c:\ps\neopaint\pcx\claw2.pcx',vp[1]);

     sc:=0.99;

     repeat;

     sc:=sc-0.005;
     if sc<0.01 then sc:=0.99;

     for x:=0 to 319 do
     begin
     for y:=0 to 199 do
     begin
          c1:=getpixel (x,y,vp[1]);
          putpixel (round(x*sc),round(y*sc),c1,vp[2]);
     end;
     end;
     waitvbl;
     move(mem[vp[2]:0],mem[vga:0],64000);

     if keypressed=true then
        begin
             c:=readkey;
        end;
     until c=#27;

     closevirt;
     video_mode ( 03);
end.