end
end {Colors};
;•————————— ——————^
Procedure SetAttribute(Page,X1,Y1,X2,Y2,Attr: Byte);
{Заменяет атрибут всех символов в прямоугольнике XI...Y2 страницы PAGE на значение Attr} var
Buf: array [1..80,1..2] of Byte;
k,j,Size: Byte;
begin
{Проверяем параметры обращения) if (Page<=MaxPage) and (Xl in [1..MaxChar])
and (Yl in [1..MaxLine]) and (X2 in [1..MaxChar]) and (Y2 in [1..MaxLine]) and (X2>X1) and (Y2>Y1) then begin
Size := (X2-X1+1)*2;
for It := Yl to Y2 do begin
MoveFromScreen(Mem[VMemory:Page*VSize+ (pred(k)*MaxChar+Xl-l)*2],Buf,Size) ;
for j := 1 to Size div 2 do Buf[j,2] := Attr;
MoveToScreen(Buf,Mem[VMemory:Page*VSize+
(pred(k)*MaxChar+Xl-l)*2],Size) end end end; {SetAttribute} _—————————————;
Function PackAttribute(Text,Back: Byte): Byte;
{Упаковывает два цвета в байт атрибута} begin
PackAttribute := (Text and $8F) or
((Back and 7) shi 4) or (Back and $80) end; {PackAttnnute} ^—————————————;
Procedure UnPackAttribute(Attr: Byte; var Text,Back: Byte);
{Распаковывает байт атрибута и возвращает два цвета} begin
Text := Attr and $8F;
Back := (Attr shr 4) and 7 end; {UnPackAttribute) /*_—____—_——^__-«—_———_---—-———-——-----—_------_*
1 Подпрограммы управления курсором 1
Procedure CursorOff;
{Отключает курсор в активной странице} begin
with Reg do begin
AH := 1; {Управление курсором} СН := $20 {Убрать курсор} end;
lntr($10,Reg);
Pages[ActivePage].CVisible := False enu {CursorOff};
/———————————————;
Procedure CursorON;
{Включает курсор в активной странице} begin