From af43c61f3736605ce0f5a2bd9496b167531b5b2f Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sat, 2 Apr 2022 14:53:21 +0300 Subject: main: work only with 4 bytes color --- UefiMonitorTest/UefiMonitorTest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'UefiMonitorTest/UefiMonitorTest.c') diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c index 763a263..8d67c83 100644 --- a/UefiMonitorTest/UefiMonitorTest.c +++ b/UefiMonitorTest/UefiMonitorTest.c @@ -114,9 +114,10 @@ PrepareGraphicsInfo ( )); ParseGraphicsPixelFormat (BitMask, &PixelWidth, PixelShl, PixelShr); + ASSERT (PixelWidth == 4); Graphics->Gop = Gop; - Graphics->FrontBuffer = (UINT8 *)Gop->Mode->FrameBufferBase; + Graphics->FrontBuffer = (UINT32 *)Gop->Mode->FrameBufferBase; Graphics->BufferSize = Gop->Mode->FrameBufferSize; Graphics->BackBuffer = AllocateCopyPool (Graphics->BufferSize, Graphics->FrontBuffer); ASSERT (Graphics->BackBuffer != NULL); @@ -126,7 +127,7 @@ PrepareGraphicsInfo ( CopyMem (Graphics->PixelShl, PixelShl, sizeof (PixelShl)); CopyMem (Graphics->PixelShr, PixelShr, sizeof (PixelShr)); Graphics->PixelWidth = PixelWidth; - Graphics->Pitch = Graphics->PixelWidth * Gop->Mode->Info->PixelsPerScanLine; + Graphics->Pitch = Gop->Mode->Info->PixelsPerScanLine; } STATIC -- cgit v1.2.3-18-g5258