Bouncing Ball?

I don't even remember what this does, I couldn't find a compiler or a capable system try this on. I think it suppose to bounce a ball around the VGA graphics screen.

bounce.pas
  1. uses Graph,crt,vga;
  2.  
  3. const gfact=1;
  4.       ballfact=10;
  5.       modefact=1;
  6.       delayfact=1;
  7.  
  8. var
  9.  isize,x,y,xfact,yfact,vgamode:Integer;
  10.  p:pointer;
  11.  
  12. begin
  13.  setcolor(14);
  14.  circle(ballfact,ballfact,ballfact);
  15.  setfillstyle(1,10);
  16.  floodfill(ballfact,ballfact,14);
  17.  isize:=imagesize(0,0,ballfact*2,ballfact*2);
  18.  getmem(p,isize);
  19.  getimage(0,0,ballfact*2,ballfact*2,p^);
  20.  
  21.  cleardevice;
  22.  x:=1;
  23.  y:=1;
  24.  xfact:=1;
  25.  yfact:=1;
  26.  setcolor(15);
  27.  
  28.  Rectangle(0, 0, GetMaxX, GetMaxY);
  29.  line(getmaxx div 2,0,getmaxx div 2,getmaxy);
  30.  line(0,getmaxy div 2,getmaxx,getmaxy div 2);
  31.  circle(getmaxx div 2,getmaxy div 2,50);
  32.  
  33.  repeat
  34.    begin
  35.      putimage(x,y,p^,modefact);
  36.      delay(delayfact);
  37.      putimage(x,y,p^,modefact);
  38.  
  39.      x:=x+xfact;
  40.      y:=y+yfact;
  41.  
  42.      if x+(ballfact)*2>=getmaxx then
  43.        begin
  44.          xfact:=-gfact;
  45.          sound(250);
  46.          delay(25);
  47.          nosound;
  48.        end;
  49.  
  50.      if x< =0 then
  51.        begin
  52.          xfact:=gfact;
  53.          sound(250);
  54.          delay(25);
  55.          nosound;
  56.        end;
  57.  
  58.      if y+(ballfact)*2>=getmaxy then
  59.        begin
  60.          yfact:=-gfact;
  61.          sound(250);
  62.          delay(25);
  63.          nosound;
  64.        end;
  65.  
  66.      if y< =0 then
  67.        begin
  68.          yfact:=gfact;
  69.          sound(250);
  70.          delay(25);
  71.          nosound;
  72.        end;
  73.  
  74.      if(x=getmaxx div 2)or(y=getmaxy div 2)then
  75.        begin
  76.        end;
  77.  
  78.    end;
  79.  until keypressed;
  80.  
  81.  CloseGraph;
  82.  
  83. end.