Merge pull request #1635 from CosmosOS/revert-1607-vbe-multiboot-non-lfb

Revert "Implement non linear framebuffer detection for VBE multiboot"
This commit is contained in:
Quajak 2021-01-13 11:15:55 +01:00 committed by GitHub
commit af1bf68d41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,21 +81,8 @@ namespace Cosmos.HAL.Drivers
if (VBE.IsAvailable()) //VBE VESA Enabled Mulitboot Parsing
{
Global.mDebugger.SendInternal($"Creating VBE VESA driver with Mode {xres}*{yres}@{bpp}");
var ModeInfo = VBE.getModeInfo();
if ((ModeInfo.pitch / (bpp / 8)) == ModeInfo.width) //linear framebuffer detection
{
IO.LinearFrameBuffer = new MemoryBlock(VBE.getLfbOffset(), (uint)xres * yres * (uint)(bpp / 8));
lastbuffer = new ManagedMemoryBlock((uint)xres * yres * (uint)(bpp / 8));
}
else
{
uint OffScreenSize = (ModeInfo.pitch / (uint)(bpp / 8)) - ModeInfo.width;
IO.LinearFrameBuffer = new MemoryBlock(VBE.getLfbOffset(), (uint)(xres * yres * (uint)(bpp / 8)) + (OffScreenSize * yres * (uint)(bpp / 8)));
lastbuffer = new ManagedMemoryBlock((uint)(xres * yres * (uint)(bpp / 8)) + (OffScreenSize * yres * (uint)(bpp / 8)));
}
IO.LinearFrameBuffer = new MemoryBlock(VBE.getLfbOffset(), (uint)xres * yres * (uint)(bpp / 8));
lastbuffer = new ManagedMemoryBlock((uint)xres * yres * (uint)(bpp / 8));
}
else if (ISAModeAvailable()) //Bochs Graphics Adaptor ISA Mode
{