home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
h
/
htmix20.zip
/
VGACOLS.ZIP
/
VGADEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-07-14
|
2KB
|
131 lines
program VGADemo;
uses Crt,
Screen,
Keyboard,
Colors;
var List: array[0..15] of TColor;
procedure SetReds;
var i: byte;
begin
for i := 7 downto 1 do
begin
List[i].R := 3+8*i;
List[i].G := 0;
List[i].B := 0;
with List[i] do
SetDACRegister(CList[i],R,G,B);
List[7+i].R := 8*(8-i)-1;
List[7+i].G := 0;
List[7+i].B := 0;
with List[7+i] do
SetDACRegister(CList[7+i],R,G,B);
end;
end;
procedure SetGreens;
var i: byte;
begin
for i := 7 downto 1 do
begin
List[i].R := 0;
List[i].G := 3+8*i;
List[i].B := 0;
with List[i] do
SetDACRegister(CList[i],R,G,B);
List[7+i].R := 0;
List[7+i].G := 8*(8-i)-1;
List[7+i].B := 0;
with List[7+i] do
SetDACRegister(CList[7+i],R,G,B);
end;
end;
procedure SetBlues;
var i: byte;
begin
for i := 7 downto 1 do
begin
List[i].R := 0;
List[i].G := 0;
List[i].B := 3+8*i;
with List[i] do
SetDACRegister(CList[i],R,G,B);
List[7+i].R := 0;
List[7+i].G := 0;
List[7+i].B := 8*(8-i)-1;
with List[7+i] do
SetDACRegister(CList[7+i],R,G,B);
end;
end;
procedure SetWhite;
var i: byte;
begin
for i := 7 downto 1 do
begin
List[i].R := 3+8*i;
List[i].G := 3+8*i;
List[i].B := 3+8*i;
with List[i] do
SetDACRegister(CList[i],R,G,B);
List[7+i].R := 8*(8-i)-1;
List[7+i].G := 8*(8-i)-1;
List[7+i].B := 8*(8-i)-1;
with List[7+i] do
SetDACRegister(CList[7+i],R,G,B);
end;
end;
procedure VaryColors;
var i,j: byte;
t: TColor;
begin
Key := NullKey;
j := 1;
SetReds;
repeat
t := List[1];
for i := 1 to 13 do
List[i] := List[i+1];
List[14] := t;
for i := 14 downto 1 do
with List[i] do
SetDACRegister(CList[i],R,G,B);
if KeyPressed then
begin
InKey(Ch,Key);
Inc(j);
if j>4 then j:=1;
case j of
1: SetReds;
2: SetGreens;
3: SetBlues;
4: SetWhite;
end;
end;
until Key=Escape;
end;
begin
GetColorList;
if not LoadScreenFromFile('VGADEMO.SCR') then
Halt(1);
SetIntens;
SetCursor(CursorOff);
VaryColors;
Fill(25,1,1,80,White+BlackBG,' ');
GoToRC(24,1);
SetCursor(CursorUnderline);
SetColorList;
SetBlink;
end.