1 #ifndef _BOOTVID_PCH_ 2 #define _BOOTVID_PCH_ 3 4 #include <ntifs.h> 5 #include <ndk/halfuncs.h> 6 #include <drivers/bootvid/bootvid.h> 7 8 /* Arch specific includes */ 9 #if defined(_M_IX86) || defined(_M_AMD64) 10 #if defined(SARCH_PC98) 11 #include "i386/pc98/pc98.h" 12 #elif defined(SARCH_XBOX) 13 #include "i386/xbox/xbox.h" 14 #else 15 #include "i386/pc/vga.h" 16 #include "i386/pc/pc.h" 17 #endif 18 #elif defined(_M_ARM) 19 #include "arm/arm.h" 20 #else 21 #error Unknown architecture 22 #endif 23 24 /* Define if FontData has upside down characters */ 25 #undef CHAR_GEN_UPSIDE_DOWN 26 27 #define BOOTCHAR_HEIGHT 13 28 #define BOOTCHAR_WIDTH 8 // Each character line is encoded in a UCHAR. 29 30 /* Bitmap Header */ 31 typedef struct tagBITMAPINFOHEADER 32 { 33 ULONG biSize; 34 LONG biWidth; 35 LONG biHeight; 36 USHORT biPlanes; 37 USHORT biBitCount; 38 ULONG biCompression; 39 ULONG biSizeImage; 40 LONG biXPelsPerMeter; 41 LONG biYPelsPerMeter; 42 ULONG biClrUsed; 43 ULONG biClrImportant; 44 } BITMAPINFOHEADER, *PBITMAPINFOHEADER; 45 46 /* Supported bitmap compression formats */ 47 #define BI_RGB 0 48 #define BI_RLE4 2 49 50 typedef ULONG RGBQUAD; 51 52 /* 53 * Globals 54 */ 55 extern UCHAR VidpTextColor; 56 extern ULONG VidpCurrentX; 57 extern ULONG VidpCurrentY; 58 extern ULONG VidpScrollRegion[4]; 59 extern UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT]; 60 extern const RGBQUAD VidpDefaultPalette[BV_MAX_COLORS]; 61 62 #define RGB(r, g, b) ((RGBQUAD)(((UCHAR)(b) | ((USHORT)((UCHAR)(g))<<8)) | (((ULONG)(UCHAR)(r))<<16))) 63 64 #define GetRValue(quad) ((UCHAR)(((quad)>>16) & 0xFF)) 65 #define GetGValue(quad) ((UCHAR)(((quad)>>8) & 0xFF)) 66 #define GetBValue(quad) ((UCHAR)((quad) & 0xFF)) 67 68 #define InitializePalette() InitPaletteWithTable((PULONG)VidpDefaultPalette, BV_MAX_COLORS) 69 70 #ifdef CHAR_GEN_UPSIDE_DOWN 71 # define GetFontPtr(_Char) &VidpFontData[_Char * BOOTCHAR_HEIGHT] + BOOTCHAR_HEIGHT - 1; 72 # define FONT_PTR_DELTA (-1) 73 #else 74 # define GetFontPtr(_Char) &VidpFontData[_Char * BOOTCHAR_HEIGHT]; 75 # define FONT_PTR_DELTA (1) 76 #endif 77 78 #endif /* _BOOTVID_PCH_ */ 79