From: John Hodge Date: Wed, 23 Sep 2009 08:18:15 +0000 (+0800) Subject: Fixed VTerm Clear to use current colour instead of black X-Git-Tag: rel0.06~529 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=13a05c3f0ca748e82e573d4fb20cad7d54226b67;p=tpg%2Facess2.git Fixed VTerm Clear to use current colour instead of black --- diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index 20ba90e5..6ed0cdd5 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -356,6 +356,21 @@ void VT_int_PutString(tVTerm *Term, Uint8 *Buffer, Uint Count) } } +/** + * \fn void VT_int_ClearLine(tVTerm *Term, int Num) + * \brief Clears a line in a virtual terminal + */ +void VT_int_ClearLine(tVTerm *Term, int Num) +{ + int i; + memset(Term->Text, 0, Term->Width*Term->Height*VT_SCROLLBACK*sizeof(tVT_Char)); + for( i = Term->Width; i++; ) + { + Term->Text[ Num*Term->Width + i ].Ch = 0; + Term->Text[ Num*Term->Width + i ].Colour = Term->CurColour; + } +} + /** * \fn int VT_int_ParseEscape(tVTerm *Term, char *Buffer) * \brief Parses a VT100 Escape code @@ -394,11 +409,17 @@ int VT_int_ParseEscape(tVTerm *Term, char *Buffer) //Clear By Line case 'J': // Clear Screen - if(args[0] == 2) { - memset(Term->Text, 0, Term->Width*Term->Height*VT_SCROLLBACK*sizeof(tVT_Char)); + switch(args[0]) + { + case 2: + { + int i = Term->Height * VT_SCROLLBACK;; + while( i-- ) VT_int_ClearLine(Term, i); Term->WritePos = 0; Term->ViewPos = 0; VT_int_UpdateScreen(Term, 1); + } + break; } break; // Set Font flags