bpp is not always 4!

This commit is contained in:
valentinbreiz 2020-12-24 03:22:25 +01:00
parent 2f2cd626e3
commit 32ee02c6d4

View file

@ -84,7 +84,7 @@ namespace Cosmos.HAL.Drivers
var ModeInfo = VBE.getModeInfo();
if ((ModeInfo.pitch / 4) == ModeInfo.width) //linear framebuffer detection
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));