ReactOS 0.4.16-dev-338-g34e76ad
roslogo.c File Reference
#include "rosload.h"
Include dependency graph for roslogo.c:

Go to the source code of this file.

Functions

VOID ConvertBmpToGopBlt (IN VOID *BmpImage, IN UINTN BmpImageSize, IN OUT VOID **GopBlt, IN OUT UINTN *GopBltSize, OUT UINTN *PixelHeight, OUT UINTN *PixelWidth)
 
VOID NTAPI OslDrawLogo (VOID)
 

Variables

PBL_GRAPHICS_CONSOLE DspGraphicalConsole
 
EFI_BOOT_SERVICESEfiBS
 
EFI_SYSTEM_TABLEEfiST
 
UCHAR g_Logo []
 

Function Documentation

◆ ConvertBmpToGopBlt()

VOID ConvertBmpToGopBlt ( IN VOID BmpImage,
IN UINTN  BmpImageSize,
IN OUT VOID **  GopBlt,
IN OUT UINTN GopBltSize,
OUT UINTN PixelHeight,
OUT UINTN PixelWidth 
)

Definition at line 9715 of file roslogo.c.

9723{
9724 UINT8 *Image;
9725 UINT8 *ImageHeader;
9726 PBITMAP BmpHeader;
9729 UINT64 BltBufferSize;
9730 UINTN Height;
9731 UINTN Width;
9732 UINTN ImageIndex;
9733
9734 BmpHeader = (BITMAP *)BmpImage;
9735
9736 Image = BmpImage;
9737 Image = ((UINT8 *)BmpImage) + BmpHeader->BmpHeader.Offset;
9738 ImageHeader = Image;
9739
9740 BltBufferSize = BmpHeader->DibHeader.Width * BmpHeader->DibHeader.Height;
9741 BltBufferSize = BltBufferSize * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
9742
9743 *GopBltSize = (UINTN) BltBufferSize;
9744 *GopBlt = BlMmAllocateHeap (*GopBltSize);
9745 *PixelWidth = BmpHeader->DibHeader.Width;
9746 *PixelHeight = BmpHeader->DibHeader.Height;
9747
9748 BltBuffer = *GopBlt;
9749
9750 for (Height = 0; Height < BmpHeader->DibHeader.Height; Height++)
9751 {
9752 Blt = &BltBuffer[(BmpHeader->DibHeader.Height - Height - 1) * BmpHeader->DibHeader.Width];
9753 for (Width = 0; Width < BmpHeader->DibHeader.Width; Width++, Image++, Blt++)
9754 {
9755 Blt->Blue = *Image++;
9756 Blt->Green = *Image++;
9757 Blt->Red = *Image;
9758 }
9759
9760 ImageIndex = (UINTN) (Image - ImageHeader);
9761 if ((ImageIndex % 4) != 0) Image = Image + (4 - (ImageIndex % 4));
9762 }
9763}
unsigned long long UINT64
unsigned char UINT8
UINT32 UINTN
#define UINTN
Definition: acefi.h:114
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
Definition: heapalloc.c:569
#define for
Definition: utility.h:88
Definition: bl.h:1331
DIB_HEADER DibHeader
Definition: bl.h:1333
BMP_HEADER BmpHeader
Definition: bl.h:1332
ULONG Offset
Definition: bl.h:1312
ULONG Width
Definition: bl.h:1318
ULONG Height
Definition: bl.h:1319
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by OslDrawLogo().

◆ OslDrawLogo()

VOID NTAPI OslDrawLogo ( VOID  )

Definition at line 9767 of file roslogo.c.

9770{
9772 UINTN GopBltSize, BmpHeight, BmpWidth, CoordinateY, CoordinateX;
9773 PHYSICAL_ADDRESS GopBltPhys;
9774 EFI_GRAPHICS_OUTPUT_PROTOCOL* GraphicsOutput;
9775 EFI_STATUS EfiStatus;
9776
9777 /* Convert ReactOS Logo */
9779 sizeof(g_Logo),
9780 (PVOID*)&GopBlt,
9781 &GopBltSize,
9782 &BmpHeight,
9783 &BmpWidth);
9784
9785 CoordinateX = (DspGraphicalConsole->DisplayMode.HRes / 2) - (BmpWidth / 2);
9786 CoordinateY = (DspGraphicalConsole->DisplayMode.VRes / 2) - (BmpHeight / 2);
9787 BlMmTranslateVirtualAddress(GopBlt, &GopBltPhys);
9788 GopBlt = PhysicalAddressToPtr(GopBltPhys);
9789
9790 /* Make the screen black */
9793 0x00);
9794
9795 /* Switch to real mode */
9797
9798 /* Get the UEFI GOP Protocol */
9801 (PVOID*)&GraphicsOutput);
9802 if (EfiStatus== EFI_SUCCESS)
9803 {
9804 /* Draw the logo */
9805 GraphicsOutput->Blt(GraphicsOutput,
9806 GopBlt,
9808 0,
9809 0,
9810 CoordinateX,
9811 CoordinateY,
9812 BmpWidth,
9813 BmpHeight,
9814 BmpWidth * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
9815 }
9816
9817 /* Go back to protected mode */
9819
9820 /* Display text below the logo */
9821 EfiPrintf(L"\n\n\n\n\nReactOS UEFI OS Loader Initializing... %lx\r\n",
9822 EfiStatus);
9823 EfiStall(1000000);
9824
9825 /* Clear the screen and return */
9827}
@ EfiBltBufferToVideo
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:31
#define EFI_SUCCESS
Definition: UefiBaseType.h:120
EFI_GUID EfiGraphicsOutputProtocol
Definition: firmware.c:28
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126
VOID BlpArchSwitchContext(_In_ BL_ARCH_MODE NewMode)
Definition: arch.c:166
NTSTATUS EfiStall(_In_ ULONG StallTime)
Definition: firmware.c:1003
FORCEINLINE PVOID PhysicalAddressToPtr(_In_ PHYSICAL_ADDRESS PhysicalAddress)
Definition: bl.h:1389
@ BlProtectedMode
Definition: bl.h:238
@ BlRealMode
Definition: bl.h:239
BOOLEAN BlMmTranslateVirtualAddress(_In_ PVOID VirtualAddress, _Out_ PPHYSICAL_ADDRESS PhysicalAddress)
Definition: mm.c:525
NTSTATUS BlDisplayClearScreen(VOID)
Definition: display.c:943
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
#define L(x)
Definition: ntvdm.h:50
EFI_BOOT_SERVICES * EfiBS
Definition: firmware.c:21
EFI_SYSTEM_TABLE * EfiST
Definition: firmware.c:20
VOID ConvertBmpToGopBlt(IN VOID *BmpImage, IN UINTN BmpImageSize, IN OUT VOID **GopBlt, IN OUT UINTN *GopBltSize, OUT UINTN *PixelHeight, OUT UINTN *PixelWidth)
Definition: roslogo.c:9715
PBL_GRAPHICS_CONSOLE DspGraphicalConsole
Definition: display.c:37
UCHAR g_Logo[]
Definition: roslogo.c:18
EFI_HANDLE_PROTOCOL HandleProtocol
Definition: UefiSpec.h:1832
EFI_HANDLE ConsoleOutHandle
Definition: UefiSpec.h:1936
ULONG HRes
Definition: bl.h:1079
ULONG VRes
Definition: bl.h:1080
ULONG FrameBufferSize
Definition: bl.h:1157
PVOID FrameBuffer
Definition: bl.h:1156
BL_DISPLAY_MODE DisplayMode
Definition: bl.h:1147

Referenced by OslMain().

Variable Documentation

◆ DspGraphicalConsole

◆ EfiBS

◆ EfiST

◆ g_Logo

UCHAR g_Logo[]

Definition at line 18 of file roslogo.c.

Referenced by OslDrawLogo().