home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
PINBSRC.ZIP
/
MSK
/
GRABMSK.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-02-02
|
2KB
|
116 lines
{ converts .VGA 2 .MSK
Needs BGI265.BGI!
}
program SPRITE_GRABBLER;
uses graph,dos,crt,printer;
TYPE ByteArray = array[0..64000] of byte;
var name:string[80];
datei:file;
datei1,datei2,datei3,datei4:file of byte;
zeiger:word;
platz1:pointer;
kill:byte;
groesse:word;
platz:^Bytearray;
treiber, modus:integer;
Palette: file of byte;
Color: Word;
x,y,x1,y1:integer;
z,z1:word;
pixel:string;
pixe:word;
code:integer;
lag:file;
ok:boolean;
ch:char;
red,green,blue:byte;
result:integer;
begin
write('Dateiname:');
readln(name);
kill:=0;
result := installuserdriver( 'BGI256', nil);
modus:=0;
initgraph(result,modus,'');
assign(datei,name+'.VGA');
reset(datei,1);
groesse:=imagesize(0,0,319,199);
getmem(platz1,groesse);
blockread(datei,platz1^,groesse);
close(datei);
putimage(0,0,platz1^,0);
x1:=160;
y1:=136;
x:=160+56;
y:=136+47;
{}
{ x1:=80;
y1:=136;
x:=80+56;
y:=136+47;{}
ok:=false;
setwritemode(xorput);
rectangle(x1,y1,x,y);
repeat
repeat
until KeyPressed;
setwritemode(xorput);
rectangle(x1,y1,x,y);
ch:=readkey;
if ch='8' then y:=y-4;
if ch='2' then y:=y+4;
if ch='4' then x:=x-8;
if ch='6' then x:=x+8;
if ch='5' then ok:=true;
if ch='s' then y1:=y1-4;
if ch='x' then y1:=y1+4;
if ch='y' then x1:=x1-8;
if ch='c' then x1:=x1+8;
if x<0 then x:=0;
if y<0 then y:=0;
if x>319 then x:=319;
if y>199 then y:=199;
{ x1:=x-32;
y1:=y-74;}
rectangle(x1,y1,x,y);
until ok;
rectangle(x1,y1,x,y);
{ assign(lag,'larry11.SPR');
rewrite(lag,1);}
groesse:=imagesize(x1,y1,x,y);
getmem(platz,groesse);
getimage(x1,y1,x,y,platz^);
putimage(x1,y1,platz^,copyput);
write(lst,name,' ',(x-x1));
write(lst,' ',(y-y1+1));
writeln(lst,' X:',x1,'-',x,' Y:',y1,'-',y);
assign(datei1,name+'_r.msk');
rewrite(datei1);
groesse:=0;
for z:=x1+1 to x do
begin
for z1:=y1 to y do
begin
write(datei1,mem[$a000:z1*320+z]);
mem[$a000:z1*320+z]:=255;
inc(groesse);
end;
end;
close(datei1);
closegraph;
writeln(groesse div 4);
{ blockwrite(lag,platz^,groesse);}
{close(lag);}
end.