procedure draw_ground_auto;
var auto:word;
begin
  Set_Sprite(bx_old,by_old-1,16,16,groundseg,0);
end;

procedure get_ground_auto;
var auto:word;
begin
 Get_Sprite(ballx,bally-1,16,16,groundseg,0);
end;

procedure Mix_BallGround;
var z:word;
    b1,b2:byte;
begin
  for z:=0 to 255 do
  begin
    b1:=mem[groundseg:z];
    b2:=mem[ballseg:z];
    if (b2=0) or (b1 > MAXfarbe) then
         mem[ballspriteseg:z]:=b1
       else
         mem[ballspriteseg:z]:=b2;
  end;
end;

procedure draw_ball_auto;
var auto:word;
begin
  Mix_BallGround;
  Set_Sprite(ballx,bally-1,16,16,ballspriteseg,0);
end;

