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.

95 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1993, 1994 Weitek Corporation
  3. Module Name:
  4. p91dac.h
  5. Abstract:
  6. This module contains ramdac definitions specific to the Weitek P9100.
  7. Environment:
  8. Kernel mode
  9. Revision History may be found at the end of this file.
  10. --*/
  11. //
  12. // P9100 relocatable memory mapped BT485 register definitions.
  13. //
  14. // Note: An extra 2 byte offset is added to the register offset in order
  15. // to align the offset on the byte of the Dword which contains the
  16. // DAC data.
  17. //
  18. #define P9100_RAMWRITE 0x00000200 + 2
  19. #define P9100_PALETDATA 0x00000204 + 2
  20. #define P9100_PIXELMASK 0x00000208 + 2
  21. #define P9100_RAMREAD 0x0000020C + 2
  22. #define P9100_COLORWRITE 0x00000210 + 2
  23. #define P9100_COLORDATA 0x00000214 + 2
  24. #define P9100_COMREG0 0x00000218 + 2
  25. #define P9100_COLORREAD 0x0000021C + 2
  26. #define P9100_COMREG1 0x00000220 + 2
  27. #define P9100_COMREG2 0x00000224 + 2
  28. #define P9100_COMREG3 0x00000228 + 2
  29. #define P9100_STATREG 0x00000228 + 2
  30. #define P9100_CURSORDATA 0x0000022C + 2
  31. #define P9100_CURSORX0 0x00000230 + 2
  32. #define P9100_CURSORX1 0x00000234 + 2
  33. #define P9100_CURSORY0 0x00000238 + 2
  34. #define P9100_CURSORY1 0x0000023C + 2
  35. //
  36. // P9100 relocatable memory mapped IBM 525 register definitions.
  37. //
  38. // Note: An extra 2 byte offset is added to the register offset in order
  39. // to align the offset on the byte of the Dword which contains the
  40. // DAC data.
  41. //
  42. #define P9100_IBM525_PAL_WRITE 0x00000200 + 2
  43. #define P9100_IBM525_PAL_DATA 0x00000204 + 2
  44. #define P9100_IBM525_PEL_MASK 0x00000208 + 2
  45. #define P9100_IBM525_PAL_READ 0x0000020C + 2
  46. #define P9100_IBM525_INDEX_LOW 0x00000210 + 2
  47. #define P9100_IBM525_INDEX_HIGH 0x00000214 + 2
  48. #define P9100_IBM525_INDEX_DATA 0x00000218 + 2
  49. #define P9100_IBM525_INDEX_CTL 0x0000021C + 2
  50. typedef union {
  51. ULONG ul;
  52. USHORT aw[2];
  53. UCHAR aj[4];
  54. } UWB ;
  55. #define IBM525_WR_DAC(index, data) \
  56. { \
  57. ULONG ulIndex; \
  58. UWB uwb; \
  59. \
  60. uwb.aj[0] = (UCHAR) data; \
  61. uwb.aj[1] = uwb.aj[0]; \
  62. uwb.aw[1] = uwb.aw[0]; \
  63. \
  64. ulIndex = index & ~0x3; \
  65. \
  66. P9_WR_REG(ulIndex, uwb.ul); \
  67. }
  68. #define IBM525_RD_DAC(index, val) \
  69. { \
  70. ULONG ulIndex; \
  71. UWB uwb; \
  72. \
  73. ulIndex = index & ~0x3; \
  74. \
  75. uwb.ul = P9_RD_REG(ulIndex); \
  76. \
  77. uwb.aj[3] = uwb.aj[2]; \
  78. uwb.aw[0] = uwb.aw[1]; \
  79. \
  80. val = uwb.aj[0]; \
  81. }