Add SetDoNotScroll

This commit is contained in:
Alex
2023-03-26 21:16:02 +03:00
parent ab64b9f3b0
commit c6da67a7a3
3 changed files with 22 additions and 2 deletions

View File

@ -188,6 +188,9 @@ namespace Video
return;
}
if (this->Buffers[Index].DoNotScroll)
return;
if (Lines == 0)
return;
@ -201,6 +204,17 @@ namespace Video
}
}
void Display::SetDoNotScroll(bool Value, int Index)
{
if (unlikely(this->Buffers[Index].Checksum != 0xDEAD))
{
debug("Invalid buffer %d", Index);
return;
}
this->Buffers[Index].DoNotScroll = Value;
}
char Display::Print(char Char, int Index, bool WriteToUART)
{
if (unlikely(this->Buffers[Index].Checksum != 0xDEAD))
@ -302,8 +316,11 @@ namespace Video
if (this->Buffers[Index].CursorY + FontHeight >= this->Buffers[Index].Height)
{
this->Buffers[Index].CursorY -= FontHeight;
this->Scroll(Index, 1);
if (!this->Buffers[Index].DoNotScroll)
{
this->Buffers[Index].CursorY -= FontHeight;
this->Scroll(Index, 1);
}
}
switch (this->CurrentFont->GetInfo().Type)