Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. spvideo.h
  5. Abstract:
  6. Public header file for text setup display support.
  7. Author:
  8. Ted Miller (tedm) 29-July-1993
  9. Revision History:
  10. --*/
  11. #ifndef _SPVID_DEFN_
  12. #define _SPVID_DEFN_
  13. //
  14. // Character attributes.
  15. //
  16. #define ATT_BLACK 0
  17. #define ATT_BLUE 1
  18. #define ATT_GREEN 2
  19. #define ATT_CYAN 3
  20. #define ATT_RED 4
  21. #define ATT_MAGENTA 5
  22. #define ATT_YELLOW 6
  23. #define ATT_WHITE 7
  24. #define ATT_INTENSE 8
  25. #define ATT_FG_BLACK ATT_BLACK
  26. #define ATT_FG_BLUE ATT_BLUE
  27. #define ATT_FG_GREEN ATT_GREEN
  28. #define ATT_FG_CYAN ATT_CYAN
  29. #define ATT_FG_RED ATT_RED
  30. #define ATT_FG_MAGENTA ATT_MAGENTA
  31. #define ATT_FG_YELLOW ATT_YELLOW
  32. #define ATT_FG_WHITE ATT_WHITE
  33. #define ATT_BG_BLACK (ATT_BLACK << 4)
  34. #define ATT_BG_BLUE (ATT_BLUE << 4)
  35. #define ATT_BG_GREEN (ATT_GREEN << 4)
  36. #define ATT_BG_CYAN (ATT_CYAN << 4)
  37. #define ATT_BG_RED (ATT_RED << 4)
  38. #define ATT_BG_MAGENTA (ATT_MAGENTA << 4)
  39. #define ATT_BG_YELLOW (ATT_YELLOW << 4)
  40. #define ATT_BG_WHITE (ATT_WHITE << 4)
  41. #define ATT_FG_INTENSE ATT_INTENSE
  42. #define ATT_BG_INTENSE (ATT_INTENSE << 4)
  43. #define DEFAULT_ATTRIBUTE GetDefaultAttr()
  44. #define DEFAULT_BACKGROUND GetDefaultBackground()
  45. #define DEFAULT_STATUS_ATTRIBUTE GetDefaultStatusAttr()
  46. #define DEFAULT_STATUS_BACKGROUND GetDefaultStatusBackground()
  47. UCHAR
  48. GetDefaultAttr(
  49. void
  50. );
  51. UCHAR
  52. GetDefaultBackground(
  53. void
  54. );
  55. UCHAR
  56. GetDefaultStatusAttr(
  57. void
  58. );
  59. UCHAR
  60. GetDefaultStatusBackground(
  61. void
  62. );
  63. BOOLEAN
  64. SpvidGetModeParams(
  65. OUT PULONG XResolution,
  66. OUT PULONG YResolution,
  67. OUT PULONG BitsPerPixel,
  68. OUT PULONG VerticalRefresh,
  69. OUT PULONG InterlacedFlag
  70. );
  71. //
  72. // Display routines.
  73. //
  74. VOID
  75. SpvidInitialize0(
  76. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  77. );
  78. VOID
  79. SpvidInitialize(
  80. VOID
  81. );
  82. VOID
  83. SpvidTerminate(
  84. VOID
  85. );
  86. VOID
  87. SpvidDisplayString(
  88. IN PWSTR String,
  89. IN UCHAR Attribute,
  90. IN ULONG X,
  91. IN ULONG Y
  92. );
  93. VOID
  94. SpvidDisplayOemString(
  95. IN PSTR String,
  96. IN UCHAR Attribute,
  97. IN ULONG X,
  98. IN ULONG Y
  99. );
  100. VOID
  101. SpvidClearScreenRegion(
  102. IN ULONG X,
  103. IN ULONG Y,
  104. IN ULONG W,
  105. IN ULONG H,
  106. IN UCHAR Attribute
  107. );
  108. BOOLEAN
  109. SpvidScrollUp(
  110. IN ULONG TopLine,
  111. IN ULONG BottomLine,
  112. IN ULONG LineCount,
  113. IN UCHAR FillAttribute
  114. );
  115. NTSTATUS
  116. SpvidSwitchToTextmode(
  117. VOID
  118. );
  119. //
  120. // Structure used to contain global video vars. These are broken out
  121. // like this because they are shared with the locale/lang-specific
  122. // text setup module.
  123. //
  124. typedef struct _SP_VIDEO_VARS {
  125. //
  126. // Habdle to \device\video0
  127. //
  128. HANDLE hDisplay;
  129. //
  130. // The following are character values, and must be filled in
  131. // in the display-specific initialization routine.
  132. //
  133. ULONG ScreenWidth,ScreenHeight;
  134. //
  135. // The display-specific subsystems fill these in with information
  136. // that reflects the video mode they are using, and the video memory.
  137. //
  138. VIDEO_MEMORY_INFORMATION VideoMemoryInfo;
  139. VIDEO_MODE_INFORMATION VideoModeInfo;
  140. //
  141. // Graphics mode information (if any)
  142. //
  143. VIDEO_MODE_INFORMATION GraphicsModeInfo;
  144. //
  145. // The display routines will be doing unicode to oem translations.
  146. // We'll limit the length of a string that can be displayed at one time
  147. // to the width of the screen. Theese two vars track a buffer
  148. // we preallocate to hold translated text.
  149. //
  150. ULONG SpvCharTranslationBufferSize;
  151. PUCHAR SpvCharTranslationBuffer;
  152. //
  153. // The following table maps each possible attribute to
  154. // a corresponding bit pattern to be be placed into the
  155. // frame buffer to generate that attribute.
  156. // On palette managed displays, this table will be an
  157. // identity mapping (ie, AttributeToColorValue[i] = i)
  158. // so we can poke the attribute driectly into the
  159. // frame buffer.
  160. //
  161. ULONG AttributeToColorValue[16];
  162. //
  163. // Upgrade graphics mode
  164. //
  165. BOOLEAN UpgradeGraphicsMode;
  166. //
  167. // Background Video buffer for upgrade graphics mode
  168. //
  169. PVOID VideoBuffer;
  170. ULONG VideoBufferSize;
  171. //
  172. // Active video buffer
  173. //
  174. PVOID ActiveVideoBuffer;
  175. } SP_VIDEO_VARS, *PSP_VIDEO_VARS;
  176. extern SP_VIDEO_VARS VideoVars;
  177. //
  178. // bootfont.bin file image
  179. //
  180. extern PVOID BootFontImage;
  181. extern ULONG BootFontImageLength;
  182. #endif // ndef _SPVID_DEFN_