mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Add SetDoNotScroll
This commit is contained in:
parent
ab64b9f3b0
commit
c6da67a7a3
@ -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))
|
||||
@ -301,10 +315,13 @@ namespace Video
|
||||
}
|
||||
|
||||
if (this->Buffers[Index].CursorY + FontHeight >= this->Buffers[Index].Height)
|
||||
{
|
||||
if (!this->Buffers[Index].DoNotScroll)
|
||||
{
|
||||
this->Buffers[Index].CursorY -= FontHeight;
|
||||
this->Scroll(Index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
switch (this->CurrentFont->GetInfo().Type)
|
||||
{
|
||||
|
@ -224,6 +224,7 @@ EXTERNC NIF void Main(BootInfo *Info)
|
||||
{
|
||||
Display->CreateBuffer(0, 0, 1);
|
||||
|
||||
Display->SetDoNotScroll(true, 1);
|
||||
Video::ScreenBuffer *buf = Display->GetBuffer(1);
|
||||
Video::FontInfo fi = Display->GetCurrentFont()->GetInfo();
|
||||
Display->SetBufferCursor(1, 0, buf->Height - fi.Height);
|
||||
|
@ -84,6 +84,7 @@ namespace Video
|
||||
uint32_t Color;
|
||||
uint32_t CursorX, CursorY;
|
||||
char Brightness;
|
||||
bool DoNotScroll;
|
||||
long Checksum;
|
||||
};
|
||||
|
||||
@ -135,6 +136,7 @@ namespace Video
|
||||
void SetPixel(uint32_t X, uint32_t Y, uint32_t Color, int Index);
|
||||
uint32_t GetPixel(uint32_t X, uint32_t Y, int Index);
|
||||
void Scroll(int Index, int Lines);
|
||||
void SetDoNotScroll(bool Value, int Index);
|
||||
|
||||
char Print(char Char, int Index, bool WriteToUART = false);
|
||||
void DrawString(const char *String, uint32_t X, uint32_t Y, int Index, bool WriteToUART = false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user