home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
drcpas10.zip
/
SCRSAVER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-07-11
|
2KB
|
96 lines
{$A+,B-,D-,E-,F-,I+,L-,N-,O-,R-,S+,V-}
unit scrsaver;
interface
type
scrpos = 1..80;
charattr =
record
character, attribute : char;
end;
image = array[1..50,1..80] of charattr;
screen =
record
im : image;
x,y : scrpos;
ta : word;
end;
var
mono : image absolute $B000:0;
color : image absolute $B800:0;
procedure savescr;
procedure savescreen (var scr : screen);
procedure restorescreen (var scr : screen);
implementation
uses crt, keyboard, timer;
const
monochrome = 7;
var
scr : screen;
procedure savescreen (var scr : screen);
begin
with scr do
begin
ta := textattr;
x := wherex;
y := wherey;
if lastmode = monochrome then
im := mono
else
im := color;
end;
end;
procedure restorescreen (var scr : screen);
begin
with scr do
begin
textattr := ta;
gotoxy (x,y);
if lastmode = monochrome then
mono := im
else
color := im;
end;
end;
{$F+}
procedure savescr;
{$F-}
var
i : byte;
last : longint;
begin
savescreen (scr);
textcolor (lightgray);
textbackground (black);
clrscr;
gotoxy (20, 8);
write ('Press any key to restore screen');
i := 0;
last := ClockTix;
repeat
if difftix(last, ClockTix) > 36 then
begin
last := ClockTix;
gotoxy (20, i+8);
clreol;
i := (i+1) MOD 10;
gotoxy (20, i+8);
write ('Press any key to restore screen');
end;
until keypressed;
clearkeys;
restorescreen (scr);
end;
end.