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.

635 lines
21 KiB

  1. /*++
  2. Copyright (c) 1992-1996 Microsoft Corporation
  3. Copyright (c) 1993 Western Digital Corporation
  4. Module Name:
  5. wdvga.h
  6. Abstract:
  7. This module contains the definitions for the code that implements the
  8. WDVGA device driver.
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #ifndef NO_INT10_MODE_SET
  14. #define INT10_MODE_SET 1
  15. #endif
  16. //
  17. // Do full save and restore.
  18. //
  19. // #define EXTENDED_REGISTER_SAVE_RESTORE 1
  20. //
  21. // Define type of WD boards
  22. //
  23. typedef ULONG BOARD_TYPE;
  24. #define WD90C00 0x00000001
  25. #define WD90C30 0x00000002
  26. #define SPEEDSTAR30 0x00000004
  27. #define WD90C31 0x00000008
  28. #define SPEEDSTAR31 0x00000010
  29. #define WD90C24A 0x00000020
  30. #define OTHER 0x80000000
  31. #define ALL (WD90C00 | WD90C30 | SPEEDSTAR30 | WD90C31 | SPEEDSTAR31 | WD90C24A)
  32. #define NOT_WD90C24A (ALL & ~WD90C24A)
  33. #define MONITOR 0x01
  34. #define IBM_F8515 0x02
  35. #define IBM_F8532 0x04
  36. #define TOSHIBA_DSTNC 0x08
  37. #define STN_MONO_LCD 0x10
  38. #define UNKNOWN_LCD 0x20
  39. //
  40. // Base address of VGA memory range. Also used as base address of VGA
  41. // memory when loading a font, which is done with the VGA mapped at A0000.
  42. //
  43. #define MEM_VGA 0xA0000
  44. #define MEM_VGA_SIZE 0x20000
  45. //
  46. // Port definitions for filling the ACCSES_RANGES structure in the miniport
  47. // information, defines the range of I/O ports the VGA spans.
  48. // There is a break in the IO ports - a few ports are used for the parallel
  49. // port. Those cannot be defined in the ACCESS_RANGE, but are still mapped
  50. // so all VGA ports are in one address range.
  51. //
  52. #define VGA_BASE_IO_PORT 0x000003B0
  53. #define VGA_START_BREAK_PORT 0x000003BB
  54. #define VGA_END_BREAK_PORT 0x000003C0
  55. #define VGA_MAX_IO_PORT 0x000003DF
  56. #define WD_EXT_PORT_START 0x000023C0
  57. #define WD_EXT_PORT_END 0x000023C7
  58. //
  59. // VGA port-related definitions.
  60. //
  61. //
  62. // VGA register definitions
  63. //
  64. // ports in monochrome mode
  65. #define CRTC_ADDRESS_PORT_MONO 0x0004 // CRT Controller Address and
  66. #define CRTC_DATA_PORT_MONO 0x0005 // Data registers in mono mode
  67. #define FEAT_CTRL_WRITE_PORT_MONO 0x000A // Feature Control write port
  68. // in mono mode
  69. #define INPUT_STATUS_1_MONO 0x000A // Input Status 1 register read
  70. // port in mono mode
  71. #define ATT_INITIALIZE_PORT_MONO INPUT_STATUS_1_MONO
  72. // Register to read to reset
  73. // Attribute Controller index/data
  74. #define ATT_ADDRESS_PORT 0x0010 // Attribute Controller Address and
  75. #define ATT_DATA_WRITE_PORT 0x0010 // Data registers share one port
  76. // for writes, but only Address is
  77. // readable at 0x3C0
  78. #define ATT_DATA_READ_PORT 0x0011 // Attribute Controller Data reg is
  79. // readable here
  80. #define MISC_OUTPUT_REG_WRITE_PORT 0x0012 // Miscellaneous Output reg write
  81. // port
  82. #define INPUT_STATUS_0_PORT 0x0012 // Input Status 0 register read
  83. // port
  84. #define VIDEO_SUBSYSTEM_ENABLE_PORT 0x0013 // Bit 0 enables/disables the
  85. // entire VGA subsystem
  86. #define SEQ_ADDRESS_PORT 0x0014 // Sequence Controller Address and
  87. #define SEQ_DATA_PORT 0x0015 // Data registers
  88. #define DAC_PIXEL_MASK_PORT 0x0016 // DAC pixel mask reg
  89. #define DAC_ADDRESS_READ_PORT 0x0017 // DAC register read index reg,
  90. // write-only
  91. #define DAC_STATE_PORT 0x0017 // DAC state (read/write),
  92. // read-only
  93. #define DAC_ADDRESS_WRITE_PORT 0x0018 // DAC register write index reg
  94. #define DAC_DATA_REG_PORT 0x0019 // DAC data transfer reg
  95. #define FEAT_CTRL_READ_PORT 0x001A // Feature Control read port
  96. #define MISC_OUTPUT_REG_READ_PORT 0x001C // Miscellaneous Output reg read
  97. // port
  98. #define GRAPH_ADDRESS_PORT 0x001E // Graphics Controller Address
  99. #define GRAPH_DATA_PORT 0x001F // and Data registers
  100. #define CRTC_ADDRESS_PORT_COLOR 0x0024 // CRT Controller Address and
  101. #define CRTC_DATA_PORT_COLOR 0x0025 // Data registers in color mode
  102. #define FEAT_CTRL_WRITE_PORT_COLOR 0x002A // Feature Control write port
  103. #define INPUT_STATUS_1_COLOR 0x002A // Input Status 1 register read
  104. // port in color mode
  105. #define ATT_INITIALIZE_PORT_COLOR INPUT_STATUS_1_COLOR
  106. // Register to read to reset
  107. // Attribute Controller index/data
  108. // toggle in color mode
  109. //
  110. // Offsets in HardwareStateHeader->PortValue[] of save areas for non-indexed
  111. // VGA registers.
  112. //
  113. #define CRTC_ADDRESS_MONO_OFFSET 0x04
  114. #define FEAT_CTRL_WRITE_MONO_OFFSET 0x0A
  115. #define ATT_ADDRESS_OFFSET 0x10
  116. #define MISC_OUTPUT_REG_WRITE_OFFSET 0x12
  117. #define VIDEO_SUBSYSTEM_ENABLE_OFFSET 0x13
  118. #define SEQ_ADDRESS_OFFSET 0x14
  119. #define DAC_PIXEL_MASK_OFFSET 0x16
  120. #define DAC_STATE_OFFSET 0x17
  121. #define DAC_ADDRESS_WRITE_OFFSET 0x18
  122. #define GRAPH_ADDRESS_OFFSET 0x1E
  123. #define CRTC_ADDRESS_COLOR_OFFSET 0x24
  124. #define FEAT_CTRL_WRITE_COLOR_OFFSET 0x2A
  125. //
  126. // VGA indexed register indexes.
  127. //
  128. #define IND_CURSOR_START 0x0A // index in CRTC of the Cursor Start
  129. #define IND_CURSOR_END 0x0B // and End registers
  130. #define IND_CURSOR_HIGH_LOC 0x0E // index in CRTC of the Cursor Location
  131. #define IND_CURSOR_LOW_LOC 0x0F // High and Low Registers
  132. #define IND_VSYNC_END 0x11 // index in CRTC of the Vertical Sync
  133. // End register, which has the bit
  134. // that protects/unprotects CRTC
  135. // index registers 0-7
  136. #define IND_SET_RESET_ENABLE 0x01 // index of Set/Reset Enable reg in GC
  137. #define IND_DATA_ROTATE 0x03 // index of Data Rotate reg in GC
  138. #define IND_READ_MAP 0x04 // index of Read Map reg in Graph Ctlr
  139. #define IND_GRAPH_MODE 0x05 // index of Mode reg in Graph Ctlr
  140. #define IND_GRAPH_MISC 0x06 // index of Misc reg in Graph Ctlr
  141. #define IND_BIT_MASK 0x08 // index of Bit Mask reg in Graph Ctlr
  142. #define IND_SYNC_RESET 0x00 // index of Sync Reset reg in Seq
  143. #define IND_MAP_MASK 0x02 // index of Map Mask in Sequencer
  144. #define IND_MEMORY_MODE 0x04 // index of Memory Mode reg in Seq
  145. #define IND_CRTC_PROTECT 0x11 // index of reg containing regs 0-7 in
  146. // CRTC
  147. #define START_SYNC_RESET_VALUE 0x01 // value for Sync Reset reg to start
  148. // synchronous reset
  149. #define END_SYNC_RESET_VALUE 0x03 // value for Sync Reset reg to end
  150. // synchronous reset
  151. //
  152. // Values for Attribute Controller Index register to turn video off
  153. // and on, by setting bit 5 to 0 (off) or 1 (on).
  154. //
  155. #define VIDEO_DISABLE 0
  156. #define VIDEO_ENABLE 0x20
  157. //
  158. // Value written to the Read Map register when identifying the existence of
  159. // a VGA in VgaInitialize. This value must be different from the final test
  160. // value written to the Bit Mask in that routine.
  161. //
  162. #define READ_MAP_TEST_SETTING 0x03
  163. //
  164. // Masks to keep only the significant bits of the Graphics Controller and
  165. // Sequencer Address registers. Masking is necessary because some VGAs, such
  166. // as S3-based ones, don't return unused bits set to 0, and some SVGAs use
  167. // these bits if extensions are enabled.
  168. //
  169. #define GRAPH_ADDR_MASK 0x0F
  170. #define SEQ_ADDR_MASK 0x07
  171. //
  172. // Mask used to toggle Chain4 bit in the Sequencer's Memory Mode register.
  173. //
  174. #define CHAIN4_MASK 0x08
  175. //
  176. // Default text mode setting for various registers, used to restore their
  177. // states if VGA detection fails after they've been modified.
  178. //
  179. #define MEMORY_MODE_TEXT_DEFAULT 0x02
  180. #define BIT_MASK_DEFAULT 0xFF
  181. #define READ_MAP_DEFAULT 0x00
  182. //
  183. // Palette-related info.
  184. //
  185. //
  186. // Highest valid DAC color register index.
  187. //
  188. #define VIDEO_MAX_COLOR_REGISTER 0xFF
  189. //
  190. // Highest valid palette register index
  191. //
  192. #define VIDEO_MAX_PALETTE_REGISTER 0x0F
  193. //
  194. // Indices for type of memory mapping; used in ModesVGA[], must match
  195. // MemoryMap[].
  196. //
  197. typedef enum _VIDEO_MEMORY_MAP {
  198. MemMap_Mono,
  199. MemMap_CGA,
  200. MemMap_VGA
  201. } VIDEO_MEMORY_MAP, *PVIDEO_MEMORY_MAP;
  202. //
  203. // Memory map table definition
  204. //
  205. typedef struct {
  206. ULONG MaxSize; // Maximum addressable size of memory.
  207. ULONG Start; // Start address of mode.
  208. } MEMORYMAPS;
  209. //
  210. // For a mode, the type of banking supported. Controls the information
  211. // returned in VIDEO_BANK_SELECT. PlanarHCBanking includes NormalBanking.
  212. //
  213. typedef enum _BANK_TYPE {
  214. NoBanking = 0,
  215. NormalBanking,
  216. PlanarHCBanking
  217. } BANK_TYPE, *PBANK_TYPE;
  218. #define LCD_ENABLE 1
  219. #define LCD_DISABLE 4
  220. #define CRT_ENABLE 2
  221. #define CRT_DISABLE 0
  222. #define NO_SVGA_BIOS 0
  223. #define LIMITED_SVGA_BIOS 1
  224. #define FULL_SVGA_BIOS 2
  225. //
  226. // Structure used to describe each video mode in ModesVGA[].
  227. //
  228. typedef struct {
  229. USHORT fbType; // color or monochrome, text or graphics, via
  230. // VIDEO_MODE_COLOR and VIDEO_MODE_GRAPHICS
  231. USHORT numPlanes; // # of video memory planes
  232. USHORT bitsPerPlane; // # of bits of color in each plane
  233. SHORT col; // # of text columns across screen with default font
  234. SHORT row; // # of text rows down screen with default font
  235. USHORT hres; // # of pixels across screen
  236. USHORT vres; // # of scan lines down screen
  237. USHORT wbytes; // # of bytes from start of one scan line to start of next
  238. ULONG sbytes; // total size of addressable display memory in bytes
  239. ULONG Frequency; // Vertical Frequency
  240. ULONG Interlaced; // Determines if the mode is interlaced or not
  241. BANK_TYPE banktype; // NoBanking, NormalBanking, PlanarHCBanking
  242. VIDEO_MEMORY_MAP MemMap; // index from VIDEO_MEMORY_MAP of memory
  243. // mapping used by this mode
  244. ULONG LCDtype; // LCD types to be supported by this mode
  245. BOOLEAN ValidMode; //Determines which modes are valid.
  246. #ifdef INT10_MODE_SET
  247. UCHAR FrequencyMask; // value used to mask the mode frequency
  248. UCHAR FrequencySetting; // value used to set the mode frequency
  249. ULONG Int10ModeNumber; // Mode number via Int 10
  250. PUSHORT ModeTable;
  251. #endif
  252. PUSHORT CmdStrings; // pointer to array of register-setting commands
  253. } VIDEOMODE, *PVIDEOMODE;
  254. //
  255. // Mode into which to put the VGA before starting a VDM, so it's a plain
  256. // vanilla VGA. (This is the mode's index in ModesVGA[], currently standard
  257. // 80x25 text mode.)
  258. //
  259. #define DEFAULT_MODE 0
  260. //
  261. // Info for the validator functions.
  262. //
  263. //
  264. // Number of each type of indexed register in a standard VGA, used by
  265. // validator and state save/restore functions.
  266. //
  267. // Note: VDMs currently only support basic VGAs only.
  268. //
  269. #define VGA_NUM_SEQUENCER_PORTS 5
  270. #define VGA_NUM_CRTC_PORTS 25
  271. #define VGA_NUM_GRAPH_CONT_PORTS 9
  272. #define VGA_NUM_ATTRIB_CONT_PORTS 21
  273. #define VGA_NUM_DAC_ENTRIES 256
  274. #ifdef EXTENDED_REGISTER_SAVE_RESTORE
  275. //
  276. // Indices to start save/restore in extension registers:
  277. // For both chip types
  278. #define WD_GRAPH_EXT_START 0x09
  279. #define WD_GRAPH_EXT_END 0x0E
  280. #define WD_SEQUENCER_EXT_START 0x07
  281. #define WD_SEQUENCER_EXT_END 0x09
  282. #define WD_SEQUENCER_1_EXT_START 0x10
  283. #define WD_SEQUENCER_1_EXT_END 0x14
  284. #define WD_CRTC_EXT_START 0x2A
  285. #define WD_CRTC_EXT_END 0x30
  286. #define WD_CRTC_1_EXT_START 0x3E
  287. #define WD_CRTC_1_EXT_END 0x3E
  288. //
  289. // Number of extended regs for both chip types.
  290. //
  291. #define WD_NUM_GRAPH_EXT_PORTS (WD_GRAPH_EXT_END - WD_GRAPH_EXT_START + 1)
  292. #define WD_NUM_SEQUENCER_EXT_PORTS (WD_SEQUENCER_EXT_END - WD_SEQUENCER_EXT_START + 1) + \
  293. (WD_SEQUENCER_1_EXT_END - WD_SEQUENCER_1_EXT_START + 1)
  294. #define WD_NUM_CRTC_EXT_PORTS (WD_CRTC_EXT_END - WD_CRTC_EXT_START + 1) + \
  295. (WD_CRTC_1_EXT_END - WD_CRTC_1_EXT_START + 1)
  296. //
  297. // set values for save/restore area based on largest value for a chipset.
  298. //
  299. #define EXT_NUM_GRAPH_CONT_PORTS WD_NUM_GRAPH_EXT_PORTS
  300. #define EXT_NUM_SEQUENCER_PORTS WD_NUM_SEQUENCER_EXT_PORTS
  301. #define EXT_NUM_CRTC_PORTS WD_NUM_CRTC_EXT_PORTS
  302. #define EXT_NUM_ATTRIB_CONT_PORTS 0
  303. #define EXT_NUM_DAC_ENTRIES 0
  304. #else
  305. #define EXT_NUM_GRAPH_CONT_PORTS 0
  306. #define EXT_NUM_SEQUENCER_PORTS 0
  307. #define EXT_NUM_CRTC_PORTS 0
  308. #define EXT_NUM_ATTRIB_CONT_PORTS 0
  309. #define EXT_NUM_DAC_ENTRIES 0
  310. #endif
  311. //
  312. // Info used by the Validator functions and save/restore code.
  313. // Structure used to trap register accesses that must be done atomically.
  314. //
  315. #define VGA_MAX_VALIDATOR_DATA 100
  316. #define VGA_VALIDATOR_UCHAR_ACCESS 1
  317. #define VGA_VALIDATOR_USHORT_ACCESS 2
  318. #define VGA_VALIDATOR_ULONG_ACCESS 3
  319. typedef struct _VGA_VALIDATOR_DATA {
  320. ULONG Port;
  321. UCHAR AccessType;
  322. ULONG Data;
  323. } VGA_VALIDATOR_DATA, *PVGA_VALIDATOR_DATA;
  324. //
  325. // Info for the save and restore state functions.
  326. //
  327. //
  328. // Number of bytes to save in each plane.
  329. //
  330. #define VGA_PLANE_SIZE 0x10000
  331. //
  332. // These constants determine the offsets within the
  333. // VIDEO_HARDWARE_STATE_HEADER structure that are used to save and
  334. // restore the VGA's state.
  335. //
  336. #define VGA_HARDWARE_STATE_SIZE sizeof(VIDEO_HARDWARE_STATE_HEADER)
  337. #define VGA_BASIC_SEQUENCER_OFFSET (VGA_HARDWARE_STATE_SIZE + 0)
  338. #define VGA_BASIC_CRTC_OFFSET (VGA_BASIC_SEQUENCER_OFFSET + \
  339. VGA_NUM_SEQUENCER_PORTS)
  340. #define VGA_BASIC_GRAPH_CONT_OFFSET (VGA_BASIC_CRTC_OFFSET + \
  341. VGA_NUM_CRTC_PORTS)
  342. #define VGA_BASIC_ATTRIB_CONT_OFFSET (VGA_BASIC_GRAPH_CONT_OFFSET + \
  343. VGA_NUM_GRAPH_CONT_PORTS)
  344. #define VGA_BASIC_DAC_OFFSET (VGA_BASIC_ATTRIB_CONT_OFFSET + \
  345. VGA_NUM_ATTRIB_CONT_PORTS)
  346. #define VGA_BASIC_LATCHES_OFFSET (VGA_BASIC_DAC_OFFSET + \
  347. (3 * VGA_NUM_DAC_ENTRIES))
  348. #define VGA_EXT_SEQUENCER_OFFSET (VGA_BASIC_LATCHES_OFFSET + 4)
  349. #define VGA_EXT_CRTC_OFFSET (VGA_EXT_SEQUENCER_OFFSET + \
  350. EXT_NUM_SEQUENCER_PORTS)
  351. #define VGA_EXT_GRAPH_CONT_OFFSET (VGA_EXT_CRTC_OFFSET + \
  352. EXT_NUM_CRTC_PORTS)
  353. #define VGA_EXT_ATTRIB_CONT_OFFSET (VGA_EXT_GRAPH_CONT_OFFSET + \
  354. EXT_NUM_GRAPH_CONT_PORTS)
  355. #define VGA_EXT_DAC_OFFSET (VGA_EXT_ATTRIB_CONT_OFFSET + \
  356. EXT_NUM_ATTRIB_CONT_PORTS)
  357. #define VGA_VALIDATOR_OFFSET (VGA_EXT_DAC_OFFSET + 4 * EXT_NUM_DAC_ENTRIES)
  358. #define VGA_VALIDATOR_AREA_SIZE sizeof (ULONG) + (VGA_MAX_VALIDATOR_DATA * \
  359. sizeof (VGA_VALIDATOR_DATA)) + \
  360. sizeof (ULONG) + \
  361. sizeof (ULONG) + \
  362. sizeof (PVIDEO_ACCESS_RANGE)
  363. #define VGA_MISC_DATA_AREA_OFFSET VGA_VALIDATOR_OFFSET + VGA_VALIDATOR_AREA_SIZE
  364. #define VGA_MISC_DATA_AREA_SIZE 0
  365. #define VGA_PLANE_0_OFFSET VGA_MISC_DATA_AREA_OFFSET + VGA_MISC_DATA_AREA_SIZE
  366. #define VGA_PLANE_1_OFFSET VGA_PLANE_0_OFFSET + VGA_PLANE_SIZE
  367. #define VGA_PLANE_2_OFFSET VGA_PLANE_1_OFFSET + VGA_PLANE_SIZE
  368. #define VGA_PLANE_3_OFFSET VGA_PLANE_2_OFFSET + VGA_PLANE_SIZE
  369. //
  370. // Space needed to store all state data.
  371. //
  372. #define VGA_TOTAL_STATE_SIZE VGA_PLANE_3_OFFSET + VGA_PLANE_SIZE
  373. //
  374. // Device extension for the driver object. This data is only used
  375. // locally, so this structure can be added to as needed.
  376. //
  377. typedef struct _HW_DEVICE_EXTENSION {
  378. PHYSICAL_ADDRESS PhysicalVideoMemoryBase; // physical memory address and
  379. PHYSICAL_ADDRESS PhysicalFrameBase; // physical memory address and
  380. ULONG PhysicalVideoMemoryLength; // length of display memory
  381. ULONG PhysicalFrameLength; // length of display memory for
  382. // the current mode.
  383. PUCHAR IOAddress; // base I/O address of VGA ports
  384. PVOID VideoMemoryAddress; // base virtual memory address of VGA memory
  385. ULONG AdapterMemorySize; // size, in bytes, of the memory on the
  386. // board.
  387. ULONG ModeIndex; // index of current mode in ModesVGA[]
  388. ULONG NumAvailableModes; // number of valid modes on this device
  389. PVIDEOMODE CurrentMode; // pointer to VIDEOMODE structure for
  390. // current mode
  391. USHORT FontPelColumns; // Width of the font in pels
  392. USHORT FontPelRows; // height of the font in pels
  393. VIDEO_CURSOR_POSITION CursorPosition; // current cursor position
  394. UCHAR CursorEnable; // whether cursor is enabled or not
  395. UCHAR CursorTopScanLine; // Cursor Start register setting (top scan)
  396. UCHAR CursorBottomScanLine; // Cursor End register setting (bottom scan)
  397. UCHAR BoardID; // Used to identify different boards
  398. // supported.
  399. UCHAR DisplayType; // type of attached LCD display
  400. ULONG SVGABios; // Indicates range of SVGA support
  401. BOOLEAN IsIBM; // True if this is an IBM machine
  402. ULONG ExtendedRegisters; // Determines if extended registers have
  403. // been claimed.
  404. //
  405. // These 4 fields must be at the end of the device extension and must be
  406. // kept in this order since this data will be copied to and from the save
  407. // state buffer that is passed to and from the VDM.
  408. //
  409. ULONG TrappedValidatorCount; // number of entries in the Trapped
  410. // validator data Array.
  411. VGA_VALIDATOR_DATA TrappedValidatorData[VGA_MAX_VALIDATOR_DATA];
  412. // Data trapped by the validator routines
  413. // but not yet played back into the VGA
  414. // register.
  415. ULONG SequencerAddressValue; // Determines if the Sequencer Address Port
  416. // is currently selecting the SyncReset data
  417. // register.
  418. ULONG CurrentNumVdmAccessRanges; // Number of access ranges in
  419. // the access range array pointed
  420. // to by the next field
  421. PVIDEO_ACCESS_RANGE CurrentVdmAccessRange; // Access range currently
  422. // associated to the VDM
  423. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  424. //
  425. // Function prototypes.
  426. //
  427. //
  428. // Entry points for the VGA validator. Used in VgaEmulatorAccessEntries[].
  429. //
  430. VP_STATUS
  431. VgaValidatorUcharEntry (
  432. ULONG Context,
  433. ULONG Port,
  434. UCHAR AccessMode,
  435. PUCHAR Data
  436. );
  437. VP_STATUS
  438. VgaValidatorUshortEntry (
  439. ULONG Context,
  440. ULONG Port,
  441. UCHAR AccessMode,
  442. PUSHORT Data
  443. );
  444. VP_STATUS
  445. VgaValidatorUlongEntry (
  446. ULONG Context,
  447. ULONG Port,
  448. UCHAR AccessMode,
  449. PULONG Data
  450. );
  451. BOOLEAN
  452. VgaPlaybackValidatorData (
  453. PVOID Context
  454. );
  455. extern USHORT m640[];
  456. extern USHORT Reset[];
  457. //
  458. // Bank switch code start and end labels, define in HARDWARE.ASM
  459. //
  460. extern UCHAR BankSwitchStart;
  461. extern UCHAR BankSwitchEnd;
  462. //
  463. // Vga init scripts for font loading
  464. //
  465. extern USHORT EnableA000Data[];
  466. extern USHORT DisableA000Color[];
  467. extern MEMORYMAPS MemoryMaps[];
  468. extern VIDEOMODE ModesVGA[];
  469. extern ULONG NumVideoModes;
  470. //
  471. // Defines used to determine the number of access ranges which are
  472. // Verified. Stored in HwDeviceExtension->ExtendedRegisters
  473. //
  474. #define EXTENDED_AND_FLAT_PANEL_REGISTERS 2
  475. #define EXTENDED_REGISTERS 1
  476. #define NO_EXTENDED_REGISTERS 0
  477. #define NUM_IBM_ACCESS_RANGES 7
  478. #define NUM_ALL_ACCESS_RANGES 6
  479. #define NUM_WD_ACCESS_RANGES 4
  480. #define NUM_VGA_ACCESS_RANGES 3
  481. extern VIDEO_ACCESS_RANGE VgaAccessRange[];
  482. #define VGA_NUM_EMULATOR_ACCESS_ENTRIES 6
  483. extern EMULATOR_ACCESS_ENTRY VgaEmulatorAccessEntries[];
  484. #define NUM_MINIMAL_VGA_VALIDATOR_ACCESS_RANGE 4
  485. extern VIDEO_ACCESS_RANGE MinimalVgaValidatorAccessRange[];
  486. #define NUM_FULL_VGA_VALIDATOR_ACCESS_RANGE 2
  487. extern VIDEO_ACCESS_RANGE FullVgaValidatorAccessRange[];
  488. //
  489. // Prototypes for IBM SMAPI routines
  490. //
  491. void LCDInit(void);
  492. void LCDDisplay(int);
  493. int LCDIsMonitorPresent(void);
  494. BOOLEAN
  495. ExternalMonitorPresent(
  496. PHW_DEVICE_EXTENSION HwDeviceExtension
  497. );