aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-04-02 14:53:21 +0300
committerJoursoir <chat@joursoir.net>2022-04-02 14:53:21 +0300
commitaf43c61f3736605ce0f5a2bd9496b167531b5b2f (patch)
tree9039dbd9f5b855c36f0019462d9072336015fac6
parent45e788abaf9010efacee53733b449b19a43cd02c (diff)
downloadumt-af43c61f3736605ce0f5a2bd9496b167531b5b2f.tar.gz
umt-af43c61f3736605ce0f5a2bd9496b167531b5b2f.tar.bz2
umt-af43c61f3736605ce0f5a2bd9496b167531b5b2f.zip
main: work only with 4 bytes color
-rw-r--r--UefiMonitorTest/UefiMonitorTest.c5
-rw-r--r--UefiMonitorTest/UefiMonitorTest.h6
2 files changed, 6 insertions, 5 deletions
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
diff --git a/UefiMonitorTest/UefiMonitorTest.h b/UefiMonitorTest/UefiMonitorTest.h
index 1199e78..32214d6 100644
--- a/UefiMonitorTest/UefiMonitorTest.h
+++ b/UefiMonitorTest/UefiMonitorTest.h
@@ -17,13 +17,13 @@ typedef struct {
/// Base address of graphics linear frame buffer.
/// Starts from the upper left pixel.
///
- UINT8 *FrontBuffer;
+ UINT32 *FrontBuffer;
///
/// Pointer to allocated memory. Secondary linear buffer.
///
- UINT8 *BackBuffer;
+ UINT32 *BackBuffer;
///
- /// Amount of frame buffer needed to support the active mode.
+ /// Amount of frame buffer needed to support the active mode in bytes.
///
UINTN BufferSize;
///