home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
screen
/
wnbrag
/
winbrag.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-01-28
|
4KB
|
114 lines
program New_win_com;
var wincom : file;
newwincom : file;
splashscreen : file;
splashscreenName : string[64];
WinComName : string[64];
Buff : array [1..$11e0] of byte;
NumRead,
NumWritten : word;
actual : integer;
CrapOut : boolean;
begin
CrapOut := false;
writeln('WinBrag v0.10 : Written by Paul Delys, 73500,2777');
writeln(' Create your own Windows 3.0 Brag Screen');
writeln;
writeln(' Read Startup.txt by Mike Mezaros (75500,655) for');
writeln(' the gory details, history, and inspiration for this');
writeln(' simple program. Thanks and credit also belong to');
writeln(' Charles Kistler (72137,775), the developer (or');
writeln(' discoverer!) of the working algorithm.');
writeln;
if paramcount = 0 then begin
writeln('Usage: WINBRAG [RLE filename]');
writeln;
writeln(' [RLE Filename] is the RLE file you want to');
writeln(' use as your startup screen for Windows 3.0.');
writeln;
writeln(' WIN.COM must be in the current directory.');
writeln(' NEWWIN.COM is created and should be used as your');
writeln(' new Windows startup file. NEWWIN.COM may be renamed');
writeln(' or copied to any other filename (including WIN.COM).');
Writeln(' NEWWIN.COM should be in your Windows directory when');
writeln(' you try to run Windows.');
end;
{---get rle file name }
if paramcount < 1 then begin
writeln;
write('Enter name of RLE file to use: ');
readln(splashscreenname);
end else
splashscreenname := paramstr(1);
if splashscreenname = '' then CrapOut := true;
{---set up splash screen file }
if not CrapOut then begin
assign(splashscreen,splashscreenname);
{$I-} reset(splashscreen,1) {$I+};
Actual := IOResult;
if Actual <> 0 then begin
writeln('File ',splashscreenname,' not found.');
CrapOut := True;
end;
if (not CrapOut) and (FileSize(SplashScreen) > $ffff-$11e0) then begin
Writeln('File ',splashscreenname,' is to large to use as a brag screen.');
Write( 'The maximum size RLE file that may be used is ');
writeln($ffff-$11e0-1,' bytes.');
CrapOut := true;
end;
end;
{---set up win.com }
wincomname := 'win.com';
assign(wincom,wincomname);
{$I-} reset(wincom,1) {$I+} ;
Actual := IOResult;
if Actual <> 0 then begin
writeln(WinComName,' not found.');
writeln('Make sure ',wincomname,' is in the current directory.');
CrapOut := true;
end;
{--- set up new win.com file }
assign(newwincom,'newwin.com');
{$I-} rewrite(newwincom,1) {$I+};
actual := IOResult;
if actual <> 0 then begin
writeln('NEWWIN.COM not created.');
CrapOut := true;
end;
if not CrapOut then begin
blockread(wincom,buff,$11e0,NumRead);
blockwrite(newwincom,buff,NumRead,NumWritten);
repeat
BlockRead(SplashScreen,Buff,$11e0,NumRead);
BlockWrite(NewWinCom,buff,NumRead,NumWritten);
until (NumRead=0) or (NumRead<>NumWritten);
if paramcount > 0 then begin
writeln;
writeln('NEWWIN.COM is ready to use.');
end;
end;
{$I-} close(newwincom) {$I+}; actual := IOResult;
{$I-} close(splashscreen) {$I+}; actual := IOResult;
{$I-} close(wincom) {$I+}; actual := IOResult;
end.