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.

73 lines
3.4 KiB

  1. #ifndef WINDOWS_NT
  2. #define VGA_ATTRIB_ADDR 0x3c0
  3. #define VGA_ATTRIB_WRITE 0x3c0
  4. #define VGA_ATTRIB_READ 0x3c1
  5. #define VGA_MISC 0x3c2
  6. #define VGA_SEQ_ADDR 0x3c4
  7. #define VGA_SEQ_DATA 0x3c5
  8. #define VGA_FEAT 0x3da
  9. #define VGA_GRAPHIC_ADDR 0x3ce
  10. #define VGA_GRAPHIC_DATA 0x3cf
  11. #define VGA_CRT_ADDR 0x3d4
  12. #define VGA_CRT_DATA 0x3d5
  13. #define VGA_AUX_ADDR 0x3de
  14. #define VGA_AUX_DATA 0x3df
  15. #else
  16. #define VGA_ATTRIB_ADDR (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c0 - 0x3c0))
  17. #define VGA_ATTRIB_WRITE (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c0 - 0x3c0))
  18. #define VGA_ATTRIB_READ (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c1 - 0x3c0))
  19. #define VGA_MISC (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c2 - 0x3c0))
  20. #define VGA_SEQ_ADDR (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c4 - 0x3c0))
  21. #define VGA_SEQ_DATA (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3c5 - 0x3c0))
  22. #define VGA_FEAT (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[3]) + (0x3da - 0x3d4))
  23. #define VGA_GRAPHIC_ADDR (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3ce - 0x3c0))
  24. #define VGA_GRAPHIC_DATA (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[2]) + (0x3cf - 0x3c0))
  25. #define VGA_CRT_ADDR (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[3]) + (0x3d4 - 0x3d4))
  26. #define VGA_CRT_DATA (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[3]) + (0x3d5 - 0x3d4))
  27. #define VGA_AUX_ADDR (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[4]) + (0x3de - 0x3de))
  28. #define VGA_AUX_DATA (PVOID) ((ULONG)(((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[4]) + (0x3df - 0x3df))
  29. #define ADDR_EQUIP_LO (PUCHAR) ((((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[6]))
  30. #define ADDR_CRT_MODE (PUCHAR) ((((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[7]))
  31. #define ADDR_MAX_ROW (PUCHAR) ((((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[8]))
  32. #define VGA_RAM (PUCHAR) ((((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[10]))
  33. #define VGA_MEM (PUCHAR) ((((PMGA_DEVICE_EXTENSION)pMgaDeviceExtension)->MappedAddress[11]))
  34. #endif
  35. typedef struct
  36. {
  37. byte featureCtl; /* 0x3da */
  38. byte seqData[4]; /* 0x3c5 */
  39. byte mor; /* 0x3c2 */
  40. byte crtcData[0x19]; /* 0x3d4 */
  41. byte attrData[0x14]; /* 0x3c0 */
  42. byte graphicsCtl[9]; /* 0x3ce */
  43. byte auxilaryReg[15]; /* 0x3de */
  44. word crtcBasePort;
  45. byte latchData[4];
  46. } VideoHardware;
  47. typedef struct
  48. {
  49. int addrEquipementLow;
  50. byte EquipementLow;
  51. int addrCRTMode;
  52. byte CRTMode[0x1e];
  53. int addrMaxRow;
  54. byte MaxRow[7];
  55. int addrSavePtr;
  56. byte SavePtr[4];
  57. } VideoData;
  58. extern void setupVgaHw(void);
  59. extern void setupVgaData(void);
  60. extern void loadFont16(void);
  61. extern void setupVga(void);