diff --git a/sdk/xtdk/xtfw.h b/sdk/xtdk/xtfw.h index 87d173e..7a8e504 100644 --- a/sdk/xtdk/xtfw.h +++ b/sdk/xtdk/xtfw.h @@ -88,11 +88,12 @@ typedef struct _LOADER_GRAPHICS_INFORMATION_BLOCK BOOLEAN Initialized; EFI_GRAPHICS_PROTOCOL Protocol; PVOID Address; - UINT BufferSize; + ULONG_PTR BufferSize; UINT Width; UINT Height; UINT PixelsPerScanLine; UINT BitsPerPixel; + UINT Pitch; } LOADER_GRAPHICS_INFORMATION_BLOCK, *PLOADER_GRAPHICS_INFORMATION_BLOCK; /* Boot Loader information block */ diff --git a/xtldr/includes/blmod.h b/xtldr/includes/blmod.h index 5da7470..4138dba 100644 --- a/xtldr/includes/blmod.h +++ b/xtldr/includes/blmod.h @@ -70,14 +70,15 @@ typedef struct _XT_FRAMEBUFFER_INFORMATION PEFI_GRAPHICS_OUTPUT_PROTOCOL GOP; PEFI_UNIVERSAL_GRAPHICS_ADAPTER_PROTOCOL UGA; } Adapter; - UINT32 HorizontalResolution; - UINT32 VerticalResolution; - UINT32 BitsPerPixel; - UINT32 BytesPerPixel; - UINT32 PixelsPerScanLine; + UINT HorizontalResolution; + UINT VerticalResolution; + UINT BitsPerPixel; + UINT BytesPerPixel; + UINT PixelsPerScanLine; + UINT Pitch; EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; EFI_PHYSICAL_ADDRESS FrameBufferBase; - UINT_PTR FrameBufferSize; + ULONG_PTR FrameBufferSize; } XT_FRAMEBUFFER_INFORMATION, *PXT_FRAMEBUFFER_INFORMATION; /* EFI XT PE/COFF Image Protocol */ diff --git a/xtldr/modules/framebuf/framebuf.c b/xtldr/modules/framebuf/framebuf.c index baf6b8f..71b764f 100644 --- a/xtldr/modules/framebuf/framebuf.c +++ b/xtldr/modules/framebuf/framebuf.c @@ -68,12 +68,13 @@ FbGetDisplayInformation(OUT PLOADER_GRAPHICS_INFORMATION_BLOCK InformationBlock) { InformationBlock->Initialized = FrameBufferInfo.Initialized; InformationBlock->Protocol = FrameBufferInfo.Protocol; - InformationBlock->Address = (PVOID)(UINT_PTR)FrameBufferInfo.FrameBufferBase; + InformationBlock->Address = (PVOID)(ULONG_PTR)FrameBufferInfo.FrameBufferBase; InformationBlock->BufferSize = FrameBufferInfo.FrameBufferSize; InformationBlock->Width = FrameBufferInfo.HorizontalResolution; InformationBlock->Height = FrameBufferInfo.VerticalResolution; InformationBlock->BitsPerPixel = FrameBufferInfo.BitsPerPixel; InformationBlock->PixelsPerScanLine = FrameBufferInfo.PixelsPerScanLine; + InformationBlock->Pitch = FrameBufferInfo.Pitch; } /** @@ -122,6 +123,7 @@ FbInitializeDisplay() FrameBufferInfo.BytesPerPixel = FrameBufferInfo.BitsPerPixel >> 3; FrameBufferInfo.PixelsPerScanLine = FrameBufferInfo.Adapter.GOP->Mode->Info->PixelsPerScanLine; FrameBufferInfo.PixelFormat = FrameBufferInfo.Adapter.GOP->Mode->Info->PixelFormat; + FrameBufferInfo.Pitch = FrameBufferInfo.PixelsPerScanLine * (FrameBufferInfo.BitsPerPixel / 8); FrameBufferInfo.FrameBufferBase = FrameBufferInfo.Adapter.GOP->Mode->FrameBufferBase; FrameBufferInfo.FrameBufferSize = FrameBufferInfo.Adapter.GOP->Mode->FrameBufferSize; FrameBufferInfo.Protocol = GOP; @@ -166,6 +168,7 @@ FbInitializeDisplay() FrameBufferInfo.BytesPerPixel = 4; FrameBufferInfo.PixelsPerScanLine = FrameBufferInfo.HorizontalResolution; FrameBufferInfo.PixelFormat = PixelBlueGreenRedReserved8BitPerColor; + FrameBufferInfo.Pitch = FrameBufferInfo.PixelsPerScanLine * (FrameBufferInfo.BitsPerPixel / 8); FrameBufferInfo.FrameBufferBase = 0; FrameBufferInfo.FrameBufferSize = FrameBufferInfo.HorizontalResolution * FrameBufferInfo.VerticalResolution *