Leaked source code of windows server 2003
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.

499 lines
21 KiB

  1. /******************************Module*Header**********************************\
  2. *
  3. * *******************
  4. * * GDI SAMPLE CODE *
  5. * *******************
  6. *
  7. * Module Name: tvp4020.h
  8. *
  9. * This module contains the hardware pointer support for the display driver.
  10. * We also have support for color space double buffering using the RAMDAC pixel
  11. * read mask.
  12. *
  13. * Copyright (c) 1994-1998 3Dlabs Inc. Ltd. All rights reserved.
  14. * Copyright (c) 1995-1999 Microsoft Corporation. All rights reserved.
  15. *
  16. \*****************************************************************************/
  17. #define ADbgpf
  18. //
  19. // TI TVP4020 RAMDAC definitions
  20. // This set of registers resides at &(pCtrlRegs->ExternalVideo)
  21. //
  22. typedef struct _tvp4020_regs
  23. {
  24. //
  25. // register addresses
  26. //
  27. RAMDAC_REG pciAddrWr; // 0x00 - palette/cursor RAM write address,
  28. // Index Register
  29. RAMDAC_REG palData; // 0x01 - palette RAM data
  30. RAMDAC_REG pixelMask; // 0x02 - pixel read mask
  31. RAMDAC_REG pciAddrRd; // 0x03 - palette/cursor RAM read address
  32. RAMDAC_REG curColAddr; // 0x04 - cursor color address
  33. RAMDAC_REG curColData; // 0x05 - cursor color data
  34. RAMDAC_REG Reserved1; // 0x06 - reserved
  35. RAMDAC_REG Reserved2; // 0x07 - reserved
  36. RAMDAC_REG Reserved3; // 0x08 - reserved
  37. RAMDAC_REG Reserved4; // 0x09 - reserved
  38. RAMDAC_REG indexData; // 0x0A - indexed data
  39. RAMDAC_REG curRAMData; // 0x0B - cursor RAM data
  40. RAMDAC_REG cursorXLow; // 0x0C - cursor position X low byte
  41. RAMDAC_REG cursorXHigh; // 0x0D - cursor position X high byte
  42. RAMDAC_REG cursorYLow; // 0x0E - cursor position Y low byte
  43. RAMDAC_REG cursorYHigh; // 0x0F - cursor position Y high byte
  44. } TVP4020RAMDAC, *pTVP4020RAMDAC;
  45. //
  46. // structure containing the mapped addresses for each of the TVP4020 registers.
  47. // We need this since some chips like the Alpha cannot be accessed by simply
  48. // writing to the memory mapped register. So instead we set up the following
  49. // struct of memory addresses at init time and use these instead. All these
  50. // addresses must be passed to WRITE/READ_FAST_ULONG.
  51. // We also keep software copies of various registers in here so we can turn
  52. // on and off individual bits more easily.
  53. //
  54. typedef struct _tvp4020_data
  55. {
  56. //
  57. // Register addresses
  58. //
  59. UINT_PTR pciAddrRd; // loads internal register for palette reads
  60. UINT_PTR palData; // read/write to get/set palette data
  61. UINT_PTR pixelMask; // mask to AND with input pixel data
  62. UINT_PTR pciAddrWr; // Palettte/Index/Cursor Write address register
  63. UINT_PTR curRAMData; // read/write to get/set cursor shape data
  64. UINT_PTR indexData; // read/write to get/set control/cursor data
  65. UINT_PTR curAddrRd; // loads internal register for cursor reads
  66. UINT_PTR curAddrWr; // loads internal register for cursor writes
  67. UINT_PTR curData; // read/write to get/set cursor color data
  68. UINT_PTR curColAddr; // cursor color address
  69. UINT_PTR curColData; // cursor color data
  70. UINT_PTR cursorXLow; // Cursor's X position low byte
  71. UINT_PTR cursorXHigh; // Cursor's X position high byte
  72. UINT_PTR cursorYLow; // Cursor's Y position low byte
  73. UINT_PTR cursorYHigh; // Cursor's Y position high byte
  74. // RAMDAC state info
  75. ULONG cursorControlOff;
  76. // cursor disabled
  77. ULONG cursorControlCurrent;
  78. // disabled 32/64 mode cursor
  79. } TVP4020Data, *pTVP4020Data;
  80. //
  81. // Macro declared by any function wishing to use the P2 internal RAMDAC . MUST
  82. // be declared after PERMEDIA_DECL.
  83. //
  84. #define TVP4020_DECL_VARS pTVP4020Data pTVP4020info
  85. #define TVP4020_DECL_INIT pTVP4020info = (pTVP4020Data)ppdev->pvPointerData
  86. #define TVP4020_DECL \
  87. TVP4020_DECL_VARS; \
  88. TVP4020_DECL_INIT
  89. //
  90. // Use the following macros as the address to pass to the WRITE_4020REG_ULONG
  91. // function
  92. //
  93. // Palette Access
  94. //
  95. #define __TVP4020_PAL_WR_ADDR (pTVP4020info->pciAddrWr)
  96. #define __TVP4020_PAL_RD_ADDR (pTVP4020info->pciAddrRd)
  97. #define __TVP4020_PAL_DATA (pTVP4020info->palData)
  98. //
  99. // Pixel mask
  100. //
  101. #define __TVP4020_PIXEL_MASK (pTVP4020info->pixelMask)
  102. //
  103. // Access to the indexed registers
  104. //
  105. #define __TVP4020_INDEX_ADDR (pTVP4020info->pciAddrWr)
  106. #define __TVP4020_INDEX_DATA (pTVP4020info->indexData)
  107. //
  108. // Access to the Cursor
  109. //
  110. #define __TVP4020_CUR_RAM_WR_ADDR (pTVP4020info->pciAddrWr)
  111. #define __TVP4020_CUR_RAM_RD_ADDR (pTVP4020info->pciAddrRd)
  112. #define __TVP4020_CUR_RAM_DATA (pTVP4020info->curRAMData)
  113. #define __TVP4020_CUR_COL_ADDR (pTVP4020info->curColAddr)
  114. #define __TVP4020_CUR_COL_DATA (pTVP4020info->curColData)
  115. //
  116. // Cursor position control
  117. //
  118. #define __TVP4020_CUR_X_LSB (pTVP4020info->cursorXLow)
  119. #define __TVP4020_CUR_X_MSB (pTVP4020info->cursorXHigh)
  120. #define __TVP4020_CUR_Y_LSB (pTVP4020info->cursorYLow)
  121. #define __TVP4020_CUR_Y_MSB (pTVP4020info->cursorYHigh)
  122. //
  123. //----------------------Values for some direct registers---------------------
  124. //
  125. /*****************************************************************************/
  126. /* DIRECT REGISTER - CURSOR POSITION CONTROL */
  127. /*****************************************************************************/
  128. // ** TVP4020_CUR_X_LSB
  129. // ** TVP4020_CUR_X_MSB
  130. // ** TVP4020_CUR_Y_LSB
  131. // ** TVP4020_CUR_Y_MSB
  132. // Default - undefined
  133. // Values written into those registers represent the BOTTOM-RIGHT corner
  134. // of the cursor. If 0 is in X or Y position - the cursor is off the screen
  135. // Only 12 bits are used, giving the range from 0 to 4095 ( 0x0000 - 0x0FFF)
  136. // The size of the cursor is (64,64) (0x40, 0x40)
  137. //
  138. #define TVP4020_CURSOR_OFFSCREEN 0x00 // Cursor offscreen
  139. /*****************************************************************************/
  140. /* DIRECT REGISTER - CURSOR COLORS */
  141. /*****************************************************************************/
  142. #define TVP4020_CURSOR_COLOR0 0x01
  143. #define TVP4020_CURSOR_COLOR1 0x02
  144. #define TVP4020_CURSOR_COLOR2 0x03
  145. /*****************************************************************************/
  146. /* INDIRECT REGISTER - CURSOR CONTROL */
  147. /*****************************************************************************/
  148. #define __TVP4020_CURSOR_CONTROL 0x06 // Indirect cursor control -
  149. // Default - 0x00
  150. #define TVP4020_CURSOR_SIZE_32 (0 << 6)// 32x32 cursor
  151. #define TVP4020_CURSOR_SIZE_MASK (1 << 6)// Mask
  152. #define TVP4020_CURSOR_32_SEL(i) ((i) << 4)// one of 4 32x32 cursors
  153. // changed to << 4
  154. #define TVP4020_CURSOR_32_MASK (0x03 << 4) // Mask
  155. #define TVP4020_CURSOR_RAM_ADDRESS(x) (((x) & 0x03) << 2)
  156. // High bits of cursor RAM
  157. // address
  158. #define TVP4020_CURSOR_RAM_MASK ((0x03) << 2)
  159. // Mask for high bits of
  160. // cursor RAM address
  161. // Added constants for cursor mode
  162. #define TVP4020_CURSOR_OFF 0x00 // Cursor off
  163. #define TVP4020_CURSOR_COLOR 0x01 // 2-bits select color
  164. #define TVP4020_CURSOR_XGA 0x02 // 2-bits select XOR
  165. #define TVP4020_CURSOR_XWIN 0x03 // 2-bits select transparency/color
  166. #define TVP4020_CURSOR_MASK 0x03 // Mask
  167. /*****************************************************************************/
  168. /* INDIRECT REGISTER - COLOR MODE REGISTER */
  169. /*****************************************************************************/
  170. #define __TVP4020_COLOR_MODE 0x18 // Color Mode Register
  171. // Default - 0x00
  172. #define TVP4020_TRUE_COLOR_ENABLE (1 << 7)// True Color data accesses LUT
  173. #define TVP4020_TRUE_COLOR_DISABLE (0 << 7)// Non true color accesses LUT
  174. #define TVP4020_RGB_MODE (1 << 5)// RGB mode Swapped 0/1 (0=BGR, 1=RGB)
  175. #define TVP4020_BGR_MODE (0 << 5)// BGR mode
  176. #define TVP4020_VGA_SELECT (0 << 4)// select VGA mode
  177. #define TVP4020_GRAPHICS_SELECT (1 << 4)// select graphics modes
  178. #define TVP4020_PIXEL_MODE_CI8 (0 << 0)// pseudo color or VGA mode
  179. #define TVP4020_PIXEL_MODE_332 (1 << 0)// 332 true color
  180. #define TVP4020_PIXEL_MODE_2320 (2 << 0)// 232 off
  181. #define TVP4020_PIXEL_MODE_2321 (3 << 0)//
  182. #define TVP4020_PIXEL_MODE_5551 (4 << 0)//
  183. #define TVP4020_PIXEL_MODE_4444 (5 << 0)//
  184. #define TVP4020_PIXEL_MODE_565 (6 << 0)//
  185. #define TVP4020_PIXEL_MODE_8888 (8 << 0)//
  186. #define TVP4020_PIXEL_MODE_PACKED (9 << 0)// 24 bit packed
  187. /********************************************************************************/
  188. /* INDIRECT REGISTER - MODE CONTROL REGISTER */
  189. /********************************************************************************/
  190. #define __TVP4020_MODE_CONTROL 0x19 // Mode control
  191. // Default - 0x00
  192. #define TVP4020_PRIMARY_INPUT (0 << 4)// Primary input throuh palette
  193. #define TVP4020_SECONDARY_INPUT (1 << 4)// Secondary input throuh palette
  194. #define TVP4020_5551_DBL_BUFFER (1 << 2)// Enable 5551 dbl buffer
  195. #define TVP4020_5551_PACKED (0 << 2)// Packed 555 mode
  196. #define TVP4020_ENABLE_STATIC_DBL_BUFFER (1 << 1)// Static dbl buffer enabled
  197. #define TVP4020_DISABLE_STATIC_DBL_BUFFER (1 << 1)// Static dbl buffer disabled
  198. #define TVP4020_SELECT_FRONT_MODE (0 << 0)// Front mode
  199. #define TVP4020_SELECT_BACK_MODE (1 << 0)// Back mode
  200. /*****************************************************************************/
  201. /* INDIRECT REGISTER - PALETTE PAGE */
  202. /*****************************************************************************/
  203. #define __TVP4020_PALETTE_PAGE 0x1C //
  204. // Default - 0x00
  205. /*****************************************************************************/
  206. /* INDIRECT REGISTER - MISC CONTROL */
  207. /*****************************************************************************/
  208. #define __TVP4020_MISC_CONTROL 0x1E //
  209. // Default - 0x00
  210. #define TVP4020_SYNC_ENABLE (1 << 5)// Output SYNC info onto IOG
  211. #define TVP4020_SYNC_DISABLE (0 << 5)// No SYNC IOG output
  212. #define TVP4020_PEDESTAL_0 (0 << 4)// 0 IRE blanking pedestal
  213. #define TVP4020_PEDESTAL_75 (1 << 4)// 7.5 IRE blanking pedestal
  214. #define TVP4020_VSYNC_INVERT (1 << 3)// invert VSYNC output polarity
  215. #define TVP4020_VSYNC_NORMAL (0 << 3)// normal VSYNC output polarity
  216. #define TVP4020_HSYNC_INVERT (1 << 2)// invert HSYNC output polarity
  217. #define TVP4020_HSYNC_NORMAL (0 << 3)// normal HSYNC output polarity
  218. #define TVP4020_DAC_8BIT (1 << 1)// DAC is in 8-bit mode
  219. #define TVP4020_DAC_6BIT (0 << 1)// DAC is in 6-bit mode
  220. #define TVP4020_DAC_POWER_ON (0 << 0)// Turn DAC Power on
  221. #define TVP4020_DAC_POWER_OFF (1 << 0)// Turn DAC Power off
  222. /*****************************************************************************/
  223. /* INDIRECT REGISTER - COLOR KEY CONTROL */
  224. /*****************************************************************************/
  225. #define __TVP4020_CK_CONTROL 0x40 //
  226. // Default - 0x00
  227. /*****************************************************************************/
  228. /* INDIRECT REGISTER - COLOR KEY OVERLAY */
  229. /*****************************************************************************/
  230. #define __TVP4020_CK_OVR_REG 0x41 //
  231. // Default - 0x00
  232. /*****************************************************************************/
  233. /* INDIRECT REGISTER - COLOR KEY RED */
  234. /*****************************************************************************/
  235. #define __TVP4020_CK_RED_REG 0x42 //
  236. // Default - 0x00
  237. /*****************************************************************************/
  238. /* INDIRECT REGISTER - COLOR KEY GREEN */
  239. /*****************************************************************************/
  240. #define __TVP4020_CK_GREEN_REG 0x43 //
  241. // Default - 0x00
  242. /*****************************************************************************/
  243. /* INDIRECT REGISTER - COLOR KEY BLUE */
  244. /*****************************************************************************/
  245. #define __TVP4020_CK_BLUE_REG 0x44 //
  246. // Default - 0x00
  247. /*****************************************************************************/
  248. /* INDIRECT REGISTER - PIXEL CLOCK PLL */
  249. /*****************************************************************************/
  250. #define __TVP4020_PIXCLK_REG_A1 0x20
  251. #define __TVP4020_PIXCLK_REG_A2 0x21
  252. #define __TVP4020_PIXCLK_REG_A3 0x22
  253. #define __TVP4020_PIXCLK_REG_B1 0x23
  254. #define __TVP4020_PIXCLK_REG_B2 0x24
  255. #define __TVP4020_PIXCLK_REG_B3 0x25
  256. #define __TVP4020_PIXCLK_REG_C1 0x26
  257. #define __TVP4020_PIXCLK_REG_C2 0x27
  258. #define __TVP4020_PIXCLK_REG_C3 0x28
  259. #define __TVP4020_PIXCLK_STATUS 0x29
  260. /*****************************************************************************/
  261. /* INDIRECT REGISTER - MEMORU CLOCK PLL */
  262. /*****************************************************************************/
  263. #define __TVP4020_MEMCLK_REG_1 0x30
  264. #define __TVP4020_MEMCLK_REG_2 0x31
  265. #define __TVP4020_MEMCLK_REG_3 0x32
  266. #define __TVP4020_MEMCLK_STATUS 0x33
  267. //
  268. // generic read/write routines for 3026 registers
  269. //
  270. #define WRITE_4020REG_ULONG(r, d) \
  271. { \
  272. WRITE_REGISTER_ULONG((PULONG)(r), (d)); \
  273. MEMORY_BARRIER(); \
  274. }
  275. #define READ_4020REG_ULONG(r) READ_REGISTER_ULONG((PULONG)(r))
  276. // macro to load a given data value into an internal TVP4020 register.
  277. //
  278. #define TVP4020_SET_INDEX_REG(index) \
  279. { \
  280. ADbgpf(("*(0x%X) <-- 0x%X\n", __TVP4020_INDEX_ADDR, (index) & 0xff)); \
  281. WRITE_4020REG_ULONG(__TVP4020_INDEX_ADDR, (ULONG)((index) & 0xff)); \
  282. }
  283. #define TVP4020_WRITE_INDEX_REG(index, data) \
  284. { \
  285. TVP4020_SET_INDEX_REG(index); \
  286. ADbgpf(("*(0x%X) <-- 0x%X\n", __TVP4020_INDEX_DATA, (data) & 0xff)); \
  287. WRITE_4020REG_ULONG(__TVP4020_INDEX_DATA, (ULONG)((data) & 0xff)); \
  288. }
  289. #define TVP4020_READ_INDEX_REG(index, data) \
  290. { \
  291. TVP4020_SET_INDEX_REG(index); \
  292. data = READ_4020REG_ULONG(__TVP4020_INDEX_DATA) & 0xff; \
  293. ADbgpf(("0x%X <-- *(0x%X)\n", data, __TVP4020_INDEX_DATA)); \
  294. }
  295. //
  296. // For compatibility with TVP3026
  297. //
  298. //#define TVP4020_LOAD_CURSOR_CTRL(data) \
  299. //{ \
  300. // volatile LONG __temp; \
  301. // TVP4020_READ_INDEX_REG(__TVP4020_CURSOR_CONTROL, __temp); \
  302. // __temp &= ~(0x03) ; \
  303. // __temp |= ((data) & 0x03) ; \
  304. // TVP4020_WRITE_INDEX_REG(__TVP4020_CURSOR_CONTROL, __temp); \
  305. //}
  306. //
  307. // Macros to write a given RGB triplet into cursors 0, 1 and 2
  308. //
  309. #define TVP4020_SET_CURSOR_COLOR0(red, green, blue) \
  310. { \
  311. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_ADDR, (ULONG)(TVP4020_CURSOR_COLOR0)); \
  312. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(red)); \
  313. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(green)); \
  314. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(blue)); \
  315. }
  316. #define TVP4020_SET_CURSOR_COLOR1(red, green, blue) \
  317. { \
  318. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_ADDR, (ULONG)(TVP4020_CURSOR_COLOR1)); \
  319. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(red)); \
  320. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(green)); \
  321. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(blue)); \
  322. }
  323. #define TVP4020_SET_CURSOR_COLOR2(red, green, blue) \
  324. { \
  325. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_ADDR, (ULONG)(TVP4020_CURSOR_COLOR2)); \
  326. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(red)); \
  327. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(green)); \
  328. WRITE_4020REG_ULONG(__TVP4020_CUR_COL_DATA, (ULONG)(blue)); \
  329. }
  330. //
  331. // Macros to load a given RGB triple into the TVP4020 palette. Send the starting
  332. // index and then send RGB triples. Auto-increment is turned on.
  333. // Use TVP4020_PALETTE_START and multiple TVP4020_LOAD_PALETTE calls to load
  334. // a contiguous set of entries. Use TVP4020_LOAD_PALETTE_INDEX to load a set
  335. // of sparse entries.
  336. //
  337. #define TVP4020_PALETTE_START_WR(index) \
  338. { \
  339. WRITE_4020REG_ULONG(__TVP4020_PAL_WR_ADDR, (ULONG)(index)); \
  340. }
  341. #define TVP4020_PALETTE_START_RD(index) \
  342. { \
  343. WRITE_4020REG_ULONG(__TVP4020_PAL_RD_ADDR, (ULONG)(index)); \
  344. }
  345. #define TVP4020_LOAD_PALETTE(red, green, blue) \
  346. { \
  347. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(red)); \
  348. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(green)); \
  349. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(blue)); \
  350. }
  351. #define TVP4020_LOAD_PALETTE_INDEX(index, red, green, blue) \
  352. { \
  353. WRITE_4020REG_ULONG(__TVP4020_PAL_WR_ADDR, (ULONG)(index)); \
  354. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(red)); \
  355. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(green)); \
  356. WRITE_4020REG_ULONG(__TVP4020_PAL_DATA, (ULONG)(blue)); \
  357. }
  358. //
  359. // Macro to read back a given RGB triple from the TVP4020 palette. Use after
  360. // a call to TVP4020_PALETTE_START_RD
  361. //
  362. #define TVP4020_READ_PALETTE(red, green, blue) \
  363. { \
  364. red = (UCHAR)(READ_4020_ULONG(__TVP4020_PAL_DATA) & 0xff); \
  365. green = (UCHAR)(READ_4020_ULONG(__TVP4020_PAL_DATA) & 0xff); \
  366. blue = (UCHAR)(READ_4020_ULONG(__TVP4020_PAL_DATA) & 0xff); \
  367. }
  368. //
  369. // Macros to set/get the pixel read mask. The mask is 8 bits wide and gets
  370. // replicated across all bytes that make up a pixel.
  371. //
  372. #define TVP4020_SET_PIXEL_READMASK(mask) \
  373. { \
  374. WRITE_4020REG_ULONG(__TVP4020_PIXEL_MASK, (ULONG)(mask)); \
  375. }
  376. #define TVP4020_READ_PIXEL_READMASK(mask) \
  377. { \
  378. mask = READ_4020_ULONG(__TVP4020_PIXEL_MASK) & 0xff; \
  379. }
  380. //
  381. // Macros to load values into the cursor array
  382. //
  383. #define CURSOR_PLANE0_OFFSET 0
  384. #define CURSOR_PLANE1_OFFSET 0x200
  385. #define TVP4020_CURSOR_ARRAY_START(offset) \
  386. { \
  387. volatile LONG __temp; \
  388. TVP4020_READ_INDEX_REG(__TVP4020_CURSOR_CONTROL, __temp); \
  389. __temp &= ~TVP4020_CURSOR_RAM_MASK ; \
  390. __temp |= TVP4020_CURSOR_RAM_ADDRESS((offset)>> 8) ; \
  391. TVP4020_WRITE_INDEX_REG(__TVP4020_CURSOR_CONTROL, __temp); \
  392. WRITE_4020REG_ULONG(__TVP4020_CUR_RAM_WR_ADDR, (ULONG)((offset)& 0xff)); \
  393. }
  394. //
  395. // Changed to __TVP4020_CUR_RAM_DATA
  396. //
  397. #define TVP4020_LOAD_CURSOR_ARRAY(data) \
  398. { \
  399. WRITE_4020REG_ULONG(__TVP4020_CUR_RAM_DATA, (ULONG)(data)); \
  400. }
  401. //
  402. // Changed to __TVP4020_CUR_RAM_DATA
  403. //
  404. #define TVP4020_READ_CURSOR_ARRAY(data) \
  405. { \
  406. data = READ_4020REG_ULONG(__TVP4020_CUR_RAM_DATA) & 0xff; \
  407. }
  408. //
  409. // Macro to move the cursor
  410. //
  411. #define TVP4020_MOVE_CURSOR(x, y) \
  412. { \
  413. WRITE_4020REG_ULONG(__TVP4020_CUR_X_LSB, (ULONG)((x) & 0xff)); \
  414. WRITE_4020REG_ULONG(__TVP4020_CUR_X_MSB, (ULONG)((x) >> 8)); \
  415. WRITE_4020REG_ULONG(__TVP4020_CUR_Y_LSB, (ULONG)((y) & 0xff)); \
  416. WRITE_4020REG_ULONG(__TVP4020_CUR_Y_MSB, (ULONG)((y) >> 8)); \
  417. }
  418. //
  419. // Exported functions from pointer.c. Anything which is TVP4020 specific goes
  420. // in this file as well as real pointer stuff.
  421. //
  422. extern BOOL bTVP4020CheckCSBuffering(PPDev);
  423. extern BOOL bTVP4020SwapCSBuffers(PPDev, LONG);