Browse Source

* several bugs fixed

pierre 25 years ago
parent
commit
a63d58d57a
1 changed files with 19 additions and 10 deletions
  1. 19 10
      rtl/linux/crt.pp

+ 19 - 10
rtl/linux/crt.pp

@@ -248,8 +248,8 @@ begin
   Hstr:='';
   Hstr:='';
   Fg:=Attr and $f;
   Fg:=Attr and $f;
   Bg:=Attr shr 4;
   Bg:=Attr shr 4;
-  OFg:=Attr and $f;
-  OBg:=Attr shr 4;
+  OFg:=OAttr and $f;
+  OBg:=OAttr shr 4;
   if (OFg<>7) or (Fg=7) or ((OFg>7) and (Fg<8)) or ((OBg>7) and (Bg<8)) then
   if (OFg<>7) or (Fg=7) or ((OFg>7) and (Fg<8)) or ((OBg>7) and (Bg<8)) then
    begin
    begin
      hstr:='0';
      hstr:='0';
@@ -463,10 +463,10 @@ procedure ttyColor(a:longint);
   Set Attribute to A, only output if not the last attribute is set
   Set Attribute to A, only output if not the last attribute is set
 }
 }
 begin
 begin
-  if a<>TextAttr then
+  if a<>OldTextAttr then
    begin
    begin
      if not OutputRedir then
      if not OutputRedir then
-      ttySendStr(Attr2Ansi(a,TextAttr));
+      ttySendStr(Attr2Ansi(a,OldTextAttr));
      TextAttr:=a;
      TextAttr:=a;
      OldTextAttr:=a;
      OldTextAttr:=a;
    end;
    end;
@@ -622,8 +622,13 @@ Procedure TextColor(Color: Byte);
 {
 {
   Switch foregroundcolor
   Switch foregroundcolor
 }
 }
+  var AddBlink : byte;
 Begin
 Begin
-  ttyColor((Color and $8f) or (TextAttr and $70));
+  If (Color>15) Then
+    AddBlink:=Blink
+  else
+    AddBlink:=0;
+  ttyColor((Color and $f) or (TextAttr and $70) or AddBlink);
 End;
 End;
 
 
 
 
@@ -633,7 +638,8 @@ Procedure TextBackground(Color: Byte);
   Switch backgroundcolor
   Switch backgroundcolor
 }
 }
 Begin
 Begin
-  TextAttr:=((Color shl 4) and ($f0 and not Blink)) or (TextAttr and ($0f OR Blink) );
+  TextAttr:=((Color shl 4) and ($f0 and not Blink)) or (TextAttr and ($0f OR Blink));
+  ttyColor(TextAttr);
 End;
 End;
 
 
 
 
@@ -1232,7 +1238,7 @@ begin
             'H' : begin {No other way :( Coz First Para=Y}
             'H' : begin {No other way :( Coz First Para=Y}
                     y:=AnsiPara(AnsiCode);
                     y:=AnsiPara(AnsiCode);
                     x:=AnsiPara(AnsiCode);
                     x:=AnsiPara(AnsiCode);
-                    GotoXY(y,x);
+                    GotoXY(x,y);
                   end;
                   end;
             'J' : if AnsiPara(AnsiCode)=2 then
             'J' : if AnsiPara(AnsiCode)=2 then
                    ClrScr;
                    ClrScr;
@@ -1573,7 +1579,7 @@ Begin
 { Are we redirected to a file ? }
 { Are we redirected to a file ? }
  OutputRedir:= not IsAtty(TextRec(Output).Handle);
  OutputRedir:= not IsAtty(TextRec(Output).Handle);
 { does the input come from another console or from a file? }
 { does the input come from another console or from a file? }
- InputRedir := 
+ InputRedir :=
    not IsAtty(TextRec(Input).Handle) or
    not IsAtty(TextRec(Input).Handle) or
    (not OutputRedir and
    (not OutputRedir and
     (TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
     (TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
@@ -1604,7 +1610,10 @@ Begin
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.23  2000-04-07 13:26:27  jonas
+  Revision 1.24  2000-04-14 12:15:31  pierre
+   * several bugs fixed
+
+  Revision 1.23  2000/04/07 13:26:27  jonas
     * fix for web bug 917
     * fix for web bug 917
     * also do not mirror input if input is another TTY than output or if
     * also do not mirror input if input is another TTY than output or if
       input is redirected
       input is redirected
@@ -1627,4 +1636,4 @@ End.
   Revision 1.17  1999/09/07 07:38:09  michael
   Revision 1.17  1999/09/07 07:38:09  michael
   + Applied readkey patch from Deekoo L
   + Applied readkey patch from Deekoo L
 
 
-}
+}