Update display buffer handling

This commit is contained in:
EnderIce2
2024-02-10 06:56:26 +02:00
parent 5f80e40885
commit cfd4b8d6a5
15 changed files with 431 additions and 495 deletions

View File

@ -44,19 +44,20 @@ void lsof()
while (ShowOpenFiles == 0)
CPU::Pause();
Video::ScreenBuffer *sb = Display->GetBuffer(0);
for (short i = 0; i < 500; i++)
{
for (short j = 0; j < 500; j++)
{
uint32_t *Pixel = (uint32_t *)((uintptr_t)sb->Buffer + (j * sb->Width + i) * (bInfo.Framebuffer[0].BitsPerPixel / 8));
*Pixel = 0x222222;
Video::Pixel *p = (Video::Pixel *)((uintptr_t)Display->GetBuffer +
(j * Display->GetWidth + i) *
(bInfo.Framebuffer[0].BitsPerPixel / 8));
*p = {0xFF, 0x22, 0x22, 0x22};
}
}
uint32_t tmpX, tmpY;
Display->GetBufferCursor(0, &tmpX, &tmpY);
Display->SetBufferCursor(0, 0, 0);
Display->GetBufferCursor(&tmpX, &tmpY);
Display->SetBufferCursor(0, 0);
printf("\eF02C21Open Files (%ld):\e00AAAA\n",
TaskManager->GetProcessList().size());
foreach (auto Proc in TaskManager->GetProcessList())
@ -72,9 +73,9 @@ void lsof()
printf(" %d: %s\n", fd.Descriptor,
fd.Handle->node->FullPath);
}
Display->SetBufferCursor(0, tmpX, tmpY);
Display->SetBufferCursor(tmpX, tmpY);
if (!Config.Quiet)
Display->SetBuffer(0);
Display->UpdateBuffer();
}
}

View File

@ -111,19 +111,20 @@ void TaskMgr()
CPU::Pause();
static int sanity = 0;
Video::ScreenBuffer *sb = Display->GetBuffer(0);
for (short i = 0; i < 1000; i++)
{
for (short j = 0; j < 500; j++)
{
uint32_t *Pixel = (uint32_t *)((uintptr_t)sb->Buffer + (j * sb->Width + i) * (bInfo.Framebuffer[0].BitsPerPixel / 8));
*Pixel = 0x222222;
Video::Pixel *p = (Video::Pixel *)((uintptr_t)Display->GetBuffer +
(j * Display->GetWidth + i) *
(bInfo.Framebuffer[0].BitsPerPixel / 8));
*p = {0xFF, 0x22, 0x22, 0x22};
}
}
uint32_t tmpX, tmpY;
Display->GetBufferCursor(0, &tmpX, &tmpY);
Display->SetBufferCursor(0, 0, 0);
Display->GetBufferCursor(&tmpX, &tmpY);
Display->SetBufferCursor(0, 0);
printf("\eF02C21Task Manager\n");
static uint64_t OldSystemTime = 0;
foreach (auto Proc in TaskManager->GetProcessList())
@ -176,9 +177,9 @@ void TaskMgr()
#endif
if (sanity > 1000)
sanity = 0;
Display->SetBufferCursor(0, tmpX, tmpY);
Display->SetBufferCursor(tmpX, tmpY);
if (!Config.Quiet)
Display->SetBuffer(0);
Display->UpdateBuffer();
TaskManager->Sleep(100);
}

View File

@ -29,7 +29,7 @@ void TreeFS(vfs::Node *node, int Depth)
printf("%*c %s\eFFFFFF\n", Depth, ' ', Chld->Name);
if (!Config.Quiet)
Display->SetBuffer(0);
Display->UpdateBuffer();
TaskManager->Sleep(100);
TreeFS(Chld, Depth + 1);
}