program pixel_depth;

uses crt,crush13h;

var c:char;
    a,x,y,z:integer;

begin
     video_mode ( $13);
     initvirt;

     x:=160;
     y:=100;
     z:=60;

     for a:=0 to 6 do setcolor (10+a,10*a,10*a,10*a);

     repeat
     cls (0,vp[1]);
     putpixel (x div z *6,y div z *6,10+z div 10,vp[1]);
     if keypressed=true then
     begin
        c:=readkey;
        if c=#75 then if x>1 then x:=x-1;
        if c=#77 then if x<318 then x:=x+1;
        if c=#80 then if y<118 then y:=y+1;
        if c=#72 then if y>1 then y:=y-1;
        if c='+' then if z>10 then z:=z-10;
        if c='-' then if z<50 then z:=z+10;
     end;
     move(mem[vp[1]:0],mem[vga:0],64000);
     until c=#27;


     closevirt;
     video_mode ( 03);
end.