home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PAS_0593
/
PALETTE-.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-30
|
3KB
|
82 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 227 of 288
From : William Sitch 1:163/542.0 29 May 93 11:16
To : Chris Lukic 1:271/29.0
Subj : Problems working with TP60...
────────────────────────────────────────────────────────────────────────────────
Quoting [From: Chris Lukic; To: William Sitch]
CL> I'm not sure where this code came from, but I'd be willing
CL> to bet it will be great deal of help.
Unfortunately not... <grin>.. I've already written something a bit different,
but it gets the job done. Except the procedure rotatepalette.. which looks
neat...
CL> Procedure RotatePalette(var p:Paletetype;n1,n2,d:Integer);
CL>
CL> procedure rotatePalette(var p:Paletetype;n1,n2,d:integer);
CL> var q: PaleteType;
CL> begin { procedure rotatePalette }
CL> q:=p;
CL> for i:=n1 to n2 do
CL> p[i]:=q[n1+(i+d) mod (n2-n1+1)];
CL> palette(p);
CL> end; { procedure rotatePalette }
Although I can't see offhand what it really does ... <grin>... Here's my (rather
long) but nice palette fading routines...
---}
procedure workpalette (num:byte; out,nice:boolean);
const
numpal = 5;
maxcol = 255;
palinfo : array [1..numpal,0..maxcol,1..3] of byte =
** info removed **
var
i, j : byte;
regs : registers;
begin
if (out = true) then
if (nice = true) then
for i := 1 to 255 do
for j := 255 downto i do
begin
port[$3C8] := j;
port[$3C9] := palinfo[num,j-i,1] shr 2;
port[$3C9] := palinfo[num,j-i,2] shr 2;
port[$3C9] := palinfo[num,j-i,3] shr 2;
end;
end
else if (nice = false) then
for i := 1 to 255 do
begin
port[$3C8] := i;
port[$3C9] := 0;
port[$3C9] := 0;
port[$3C9] := 0;
end
else if (out = false) then
if (nice = true) then
begin
workpalette(0,true,false);
for i := 255 downto 1 do
for j := i to 255 do
begin
port[$3C8] := j;
port[$3C9] := palinfo[num,j-i,1] shr 2;
port[$3C9] := palinfo[num,j-i,2] shr 2;
port[$3C9] := palinfo[num,j-i,3] shr 2;
end;
end
else
for i := 1 to 255 do
begin
port[$3C8] := i;
port[$3C9] := palinfo[num,i,1] shr 2;
port[$3C9] := palinfo[num,i,2] shr 2;
port[$3C9] := palinfo[num,i,3] shr 2;
end;
end;