From d9cb4352b5ea020ba9e05440247f32f24ad3180a Mon Sep 17 00:00:00 2001 From: Freeman Date: Tue, 9 Jun 2020 22:05:24 +0300 Subject: [PATCH] =?UTF-8?q?CRT.TextAttribute=20=E2=86=92=20TextAttr,=20for?= =?UTF-8?q?=20compatibility=20to=20original=20CRT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/CRT.pas | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Lib/CRT.pas b/Lib/CRT.pas index 8f0e998..a6ba8a4 100644 --- a/Lib/CRT.pas +++ b/Lib/CRT.pas @@ -42,8 +42,9 @@ function WhereY: Integer; function WhereXY: TCursorXY; function NormVideo: LongWord; // reset text attributes -function TextAttribute: Byte; overload; -function TextAttribute(Color, Background: Byte): LongWord; overload; +function TextAttr: Byte; overload; +function TextAttr(Attr: Byte): LongWord; overload; +function TextAttr(Color, Background: Byte): LongWord; overload; function TextBackground: Byte; overload; function TextBackground(Color: Byte): LongWord; overload; function TextColor: Byte; overload; @@ -126,12 +127,17 @@ begin Result := SetFlags(GetFlags and $300 or $07); end; -function TextAttribute: Byte; +function TextAttr: Byte; begin Result := GetFlags and $FF; end; -function TextAttribute(Color, Background: Byte): LongWord; +function TextAttr(Attr: Byte): LongWord; +begin + Result := SetFlags(GetFlags and $300 or Attr); +end; + +function TextAttr(Color, Background: Byte): LongWord; begin Result := SetFlags(GetFlags and $300 or Color and $0F or Background and $0F shl 4); end;