{> Cut here. FileName= COL.PAS }
var i,k:byte;
Const j :byte = 0;
dj:ShortInt = 1;
procedure vertical_retrace; assembler;
asm
mov dx,$3da;@1:in al,dx;test al,8;jz @1;
@2:in al,dx;test al,8;jnz @2
end;
procedure wait_line;assembler;
asm
mov dx,$3da;@1:in al,dx;test al,1;jnz @1;
@2:in al,dx;test al,1;jz @2
end;
procedure set_color(c,r,g,b:byte);assembler;
Asm
mov dx,3C8h;mov al,c;out dx,al;inc dx;mov al,r;
out dx,al;mov al,g;out dx,al;mov al,b;out dx,al
end;
begin
Repeat
Vertical_Retrace;
asm cli end;
for k:=0 to j do wait_line;
For i:=0 to 7 do
begin
wait_line;
set_color(0,0,0,i*8);
end;
For i:=7 downto 0 do
begin
wait_line;
set_color(0,0,0,i*8);
end;
asm sti end;
inc(j,dj);
if (j>220)or(j<1) then dj:=-dj;
Until Port[$60]=1;
end.
|