Uses GFx3,Effe34p,Sea6,Burn,crt;

Var
w,Image : Word;
m1,m2   : longint;




function malloc (s : word):Word;
var
ptemp:pointer;

Begin
Getmem (Ptemp,s);
malloc:=Seg(Ptemp^);
End;


Procedure GrayScale;
var c,r,g,b:byte;
begin

 for c:=1 to 255 do
  begin
   getpal(c,r,g,b);
   r:=r+g+b;
   pal(c,r div 3,r div 3,r div 3);
  end;
end;


Begin

m1:=memavail;
SETMCGA;

image:=malloc ($ffff);
(*
{**************************** Credit Scroller *************************}
sea6.init;
w:=0;
repeat
sea6.nextframe;
inc (w);
until w>400;
sea6.deinit;
{***************************** Credit Scroller ***********************}


{******************************** EFFE 34P ****************************}
Effe34p.Init;
lpcx ('bmap1.pcx',image);

w:=0;
repeat
effe34p.nextframe (image,sega000);
inc (w);
until w>150;

Effe34p.DeInit;
{**********************************************************************}

*)
{************************         BURN          ***********************}
lpcx ('desfinal.pcx',image);
GrayScale;
Burn.Init (1);
         {^^^ = method

           1  = ellipsoid
           2  = random
           3  = random circular
           4  = nuts
           5  = reverse
           6  = reverse + rnd}

{clip top, bottom}
for w:=0 to 319 do Begin
                    mem[image:w]:=0;
                    mem[image:63999-w]:=0;
                   End;

w:=0;
repeat
burn.burnit (image,sega000);
waitretrace;
inc (w);
Until w>300;
Burn.DeInit;
{**********************************************************************}
m2:=memavail;

freemem (ptr(image,0),$ffff);

textmode (co80);
writeln ('memory loss:', m1-m2,' bytes');
End.
