Красивая демонстрационная заставка, напоминающая картинку
в калейдоскопе.
1k
{> Cut here. FileName= COS.PAS }
{Plasma Caleidoscope Demo [320x200x256]
by Alexey Monastyrenko <aamonster@mail.ru>
11 Mar 1998
}
procedure SetPalette;
var N:Integer;
begin
Port[$3C8] := 0;
for N := 0 to 256*3-1 do
Port[$3C9] := Round(Sqr(Sin(N*21167.0{PI*257/3/256}))*63);
end; {of SetPalette}
procedure VIDMode(Mode : Byte);assembler;
asm mov ah,$00; mov al,mode; int 10h; end;
type TScr = array[0..199,0..319] of Byte;
type TScr_ = array[0..63999] of Byte;
var Scr: TScr absolute $A000:$0000;
var Scr_: TScr_ absolute Scr;
var Scr_2: TScr_;
label M1;
var SinTable:array[Byte] of Integer;
I,J,Q:Integer;
X,Y,Z,Z0,ZC,DZDX,DZDY,A:Word;
begin
for I:=0 to 255 do SinTable[I]:=Round(Sin(I*2*PI/256)*64);
VIDMode($13);
SetPalette;
for J:=0 to 1000 do begin
FillChar(Scr_2,64000,0);
for Q:=0 to 4 do begin
Z0:=J*1000;
DZDX:=Round(2000*Cos(Q*2*PI/5+J/100));
DZDY:=Round(2400*Sin(Q*2*PI/5+J/100));
Z0:=Z0-100*DZDY-160*DZDX;
A:=0;
for Y:=0 to 199 do begin
Z:=Z0;
Inc(Z0,DZDY);
for X:=0 to 319 do begin
Inc(Scr_2[A],SinTable[Hi(Z)]);
Inc(Z,DZDX);
Inc(A);
end;
end;
end;
Scr_:=Scr_2;
if Port[$60]<128 then Break;
end;
asm mov ah,0;
int 16h
end; {readkey}
asm mov ah,0;
int 16h
end; {readkey}
VIDMode($3);
end.