program testtmap;
uses crt,gfx3,m3d6;
var l1:integer;
    Counter:integer;
    virscr3,virscr4 : VirtPtr;                     { Our first Virtual screen }
    vaddr3,vaddr4  : word;                        { The segment of our virtual screen}




begin
  setupvirtual;
  setmcga;
  GetMem (VirScr2,64000);
  vaddr2 := seg (virscr2^);

  GetMem (VirScr3,64000);
  vaddr3 := seg (virscr3^);

  GetMem (VirScr4,64000);
  vaddr4 := seg (virscr4^);

  setup('rock.euv');
{    lpcx('remap2.pcx',vaddr2);
  lpcx('bmap3.pcx',vaddr3);
  lpcx('remap3.pcx',vaddr4);}
  lpcx('bmap1.pcx',vaddr);
  lpcx('remap3.pcx',vaddr4);

  setupmap(vaddr);



{  setuppal;}
  l1:=0;
  zoff:=-300;

  d:=2;
  RANDOMIZE;
  Counter:=0;
{  ad1:=0;
  ad2:=20;
  ad3:=30;}
  ambient:=-50;

  repeat
    l1:=(l1+2) mod (360);

    rotatepoints2(l1,l1,0);
    cls(vaddr,0);
    showbump(vaddr,vaddr2);
    asmsh(vaddr3,vaddr,vaddr2);
    phongit(vaddr3,vaddr4);


    cls(vaddr2,0);
    flip(vaddr3 ,SEGA000);

  until keypressed;
  shut;
  shutdown;
  shutmap;
    FreeMem (VirScr2,64000);
    FreeMem (VirScr3,64000);
    FreeMem (VirScr4,64000);
end.

