X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fvterm_termbuf.c;h=1a14f8252ab8481f45c3c477e36df1f4336ab7eb;hb=8b72370eae1a3cfa8916136fd8ffc1460e9291ba;hp=50787228063fb0910894b358c3dca53610f05050;hpb=7b64f5e7f00e445a5637e9e3289a1332a14d28e5;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/vterm_termbuf.c b/KernelLand/Kernel/drv/vterm_termbuf.c index 50787228..1a14f825 100644 --- a/KernelLand/Kernel/drv/vterm_termbuf.c +++ b/KernelLand/Kernel/drv/vterm_termbuf.c @@ -25,6 +25,7 @@ extern int Term_HandleVT100(tVTerm *Term, int Len, const char *Buf); */ void VT_int_PutString(tVTerm *Term, const Uint8 *Buffer, Uint Count) { + ENTER("pTerm pBuffer iCount", Term, Buffer, Count); // Iterate for( int ofs = 0; ofs < Count; ) { @@ -43,7 +44,9 @@ void VT_int_PutString(tVTerm *Term, const Uint8 *Buffer, Uint Count) ofs += esc_len; } // Update Screen - VT_int_UpdateScreen( Term, 1 ); + LOG("Update"); + VT_int_UpdateScreen( Term, 0 ); + LEAVE('-'); } void VT_int_PutRawString(tVTerm *Term, const Uint8 *String, size_t Bytes) @@ -76,7 +79,7 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch) { ASSERTC(wrpos->Col, <=, Term->TextWidth); VT_int_UpdateScreen( Term, 0 ); - //wrpos->Row ++; + wrpos->Row ++; wrpos->Col = 0; } @@ -121,6 +124,7 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch) case '\0': // Ignore NULL byte return; case '\n': + LOG("Newline, update @ %i", write_pos); VT_int_UpdateScreen( Term, 0 ); // Update the line before newlining wrpos->Row ++; // TODO: Force scroll? @@ -165,10 +169,13 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch) buffer[ write_pos ].Ch = Ch; buffer[ write_pos ].Colour = Term->CurColour; // Update the line before wrapping - if( (write_pos + 1) % Term->TextWidth == 0 ) + if( (write_pos + 1) % Term->TextWidth == 0 ) { + LOG("Line wrap, update @ %i", write_pos); VT_int_UpdateScreen( Term, 0 ); - write_pos ++; + // NOTE: Code at the top of PutChar handles the actual wrapping + } wrpos->Col ++; + write_pos ++; break; } @@ -176,11 +183,12 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch) HEAP_VALIDATE(); - //LEAVE('-'); + // TODO: Schedule a delayed screen update } void VT_int_ScrollText(tVTerm *Term, int Count) { + ENTER("pTerm iCount", Term, Count); tVT_Char *buf; int scroll_top, scroll_height; @@ -274,6 +282,7 @@ void VT_int_ScrollText(tVTerm *Term, int Count) *wrpos = init_wrpos; HEAP_VALIDATE(); + LEAVE('-'); } /**