home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
PHRO.ZIP
/
CREDITS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-07-21
|
4KB
|
157 lines
{ Credits Screen Source file }
{ PHRO! }
{ Phred/OTM }
{ achalfin@uceng.uc.edu }
{ DO NOT DISTRIBUTE THIS SOURCE FILE }
Unit Credits;
Interface
Procedure Creditz;
Implementation
Uses Crt;
Type
tArray = Array[0..255*255-2] of Byte;
pArray = ^tArray;
RGB = Record
r,g,b : Byte;
End;
Palette = Array[0..255] of RGB;
Var
CreditsPtr : Pointer;
PCXBuffer : pArray;
{$F+}
{$L Credits.Obj}
Procedure CreditsPCX; External;
{$F-}
Procedure Creditz;
Var
PcxSeg, PcxOfs : Word;
TOffset : Word;
RunLen, Value : Byte;
Pal1, Pal2 : Palette;
Count, Count1 : Integer;
Begin
New(PcxBuffer);
PcxSeg := Seg(CreditsPtr^);
PcxOfs := Ofs(CreditsPtr^) + 128;
TOffset := 0;
While tOffset < 64000 do
Begin
RunLen := Mem[PcxSeg:PcxOfs];
Inc(PcxOfs);
If (RunLen and $C0) = $C0
Then Begin
RunLen := RunLen And $3f;
Value := Mem[PcxSeg:PcxOfs];
Inc(PcxOfs);
End
Else Begin
Value := RunLen;
RunLen := 1;
End;
While (RunLen >= 1) and (TOffset < 64000) do
Begin
PcxBuffer^[tOffset] := Value;
TOffset:= TOffset + 1;
RunLen := RunLen - 1;
End;
End;
PcxOfs := PcxOfs + 1; { the "12" byte }
Move(Mem[PcxSeg:PcxOfs], Pal1, 768);
For Count := 0 to 255 do
Begin
Pal1[Count].r := Pal1[Count].r Div 4;
Pal1[Count].g := Pal1[Count].g Div 4;
Pal1[Count].b := Pal1[Count].b Div 4;
End;
FillChar(Pal2, 768, 0);
For Count := 0 to 255 do
Begin
Port[$3c8] := Count;
Port[$3c9] := Pal2[Count].r;
Port[$3c9] := Pal2[Count].g;
Port[$3c9] := Pal2[Count].b;
End;
Move(PcxBuffer^[0], Mem[$A000:0], 64000);
For Count := 0 to 63 do
Begin
For Count1 := 0 to 255 do
Begin
If Pal2[Count1].r < Pal1[Count1].r
Then Inc(Pal2[Count1].r);
If Pal2[Count1].r > Pal1[Count1].r
Then Dec(Pal2[Count1].r);
If Pal2[Count1].g < Pal1[Count1].g
Then Inc(Pal2[Count1].g);
If Pal2[Count1].g > Pal1[Count1].g
Then Dec(Pal2[Count1].g);
If Pal2[Count1].b < Pal1[Count1].b
Then Inc(Pal2[Count1].b);
If Pal2[Count1].b > Pal1[Count1].b
Then Dec(Pal2[Count1].b);
End;
Asm
Mov dx,$3da
@Looper:
In al,dx
And al,8
Jz @Looper
End;
For Count1 := 0 to 255 do
Begin
Port[$3c8] := Count1;
Port[$3c9] := Pal2[Count1].r;
Port[$3c9] := Pal2[Count1].g;
Port[$3c9] := Pal2[Count1].b;
End;
End;
Delay(5000);
FillChar(Pal1, 768, 0);
For Count := 0 to 63 do
Begin
For Count1 := 0 to 255 do
Begin
If Pal2[Count1].r < Pal1[Count1].r
Then Inc(Pal2[Count1].r);
If Pal2[Count1].r > Pal1[Count1].r
Then Dec(Pal2[Count1].r);
If Pal2[Count1].g < Pal1[Count1].g
Then Inc(Pal2[Count1].g);
If Pal2[Count1].g > Pal1[Count1].g
Then Dec(Pal2[Count1].g);
If Pal2[Count1].b < Pal1[Count1].b
Then Inc(Pal2[Count1].b);
If Pal2[Count1].b > Pal1[Count1].b
Then Dec(Pal2[Count1].b);
End;
Asm
Mov dx,$3da
@Looper:
In al,dx
And al,8
Jz @Looper
End;
For Count1 := 0 to 255 do
Begin
Port[$3c8] := Count1;
Port[$3c9] := Pal2[Count1].r;
Port[$3c9] := Pal2[Count1].g;
Port[$3c9] := Pal2[Count1].b;
End;
End;
Dispose(PcxBuffer);
End;
Begin
CreditsPtr := @CreditsPCX;
End.