Improvements to FrameBuffer support
All checks were successful
Builds / ExectOS (i686) (push) Successful in 35s
Builds / ExectOS (amd64) (push) Successful in 37s

This commit is contained in:
Rafal Kupiec 2024-03-09 15:07:33 +01:00
parent 475561b038
commit a4c22ab5e8
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ typedef struct _CPPORT
typedef struct _HAL_FRAMEBUFFER_DATA typedef struct _HAL_FRAMEBUFFER_DATA
{ {
BOOLEAN Initialized; BOOLEAN Initialized;
PULONG Address; PVOID Address;
ULONG_PTR BufferSize; ULONG_PTR BufferSize;
UINT Width; UINT Width;
UINT Height; UINT Height;

View File

@ -42,7 +42,7 @@ XtGetDisplayInformation(OUT PLOADER_GRAPHICS_INFORMATION_BLOCK InformationBlock,
{ {
InformationBlock->Initialized = FrameBufferInfo->Initialized; InformationBlock->Initialized = FrameBufferInfo->Initialized;
InformationBlock->Protocol = FrameBufferInfo->Protocol; InformationBlock->Protocol = FrameBufferInfo->Protocol;
InformationBlock->Address = (PVOID)(ULONG_PTR)FrameBufferInfo->FrameBufferBase; InformationBlock->Address = (PVOID)FrameBufferInfo->FrameBufferBase;
InformationBlock->BufferSize = FrameBufferInfo->FrameBufferSize; InformationBlock->BufferSize = FrameBufferInfo->FrameBufferSize;
InformationBlock->Width = FrameBufferInfo->Width; InformationBlock->Width = FrameBufferInfo->Width;
InformationBlock->Height = FrameBufferInfo->Height; InformationBlock->Height = FrameBufferInfo->Height;

View File

@ -71,10 +71,10 @@ HlDrawPixel(IN ULONG PositionX,
} }
/* Calculate the index of the pixel in the frame buffer memory using the provided x and y coordinates */ /* Calculate the index of the pixel in the frame buffer memory using the provided x and y coordinates */
FrameBufferIndex = PositionY * HlpFrameBufferData.PixelsPerScanLine + PositionX; FrameBufferIndex = 4 * HlpFrameBufferData.PixelsPerScanLine * PositionY + 4 * PositionX;
/* Set the color of the pixel by writing to the corresponding memory location */ /* Set the color of the pixel by writing to the corresponding memory location */
HlpFrameBufferData.Address[FrameBufferIndex] = Color; *((PUINT)(HlpFrameBufferData.Address + FrameBufferIndex)) = Color;
} }
/** /**
@ -104,7 +104,7 @@ HlInitializeFrameBuffer(VOID)
} }
/* Save framebuffer information and mark display as initialized */ /* Save framebuffer information and mark display as initialized */
HlpFrameBufferData.Address = (PULONG)KeInitializationBlock->LoaderInformation.FrameBuffer.Address; HlpFrameBufferData.Address = KeInitializationBlock->LoaderInformation.FrameBuffer.Address;
HlpFrameBufferData.Width = KeInitializationBlock->LoaderInformation.FrameBuffer.Width; HlpFrameBufferData.Width = KeInitializationBlock->LoaderInformation.FrameBuffer.Width;
HlpFrameBufferData.Height = KeInitializationBlock->LoaderInformation.FrameBuffer.Height; HlpFrameBufferData.Height = KeInitializationBlock->LoaderInformation.FrameBuffer.Height;
HlpFrameBufferData.BitsPerPixel = KeInitializationBlock->LoaderInformation.FrameBuffer.BitsPerPixel; HlpFrameBufferData.BitsPerPixel = KeInitializationBlock->LoaderInformation.FrameBuffer.BitsPerPixel;