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.

1155 lines
48 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: driver.h
  3. *
  4. * Contains prototypes for the display driver.
  5. *
  6. * Copyright (c) 1992-1995 Microsoft Corporation
  7. \**************************************************************************/
  8. //////////////////////////////////////////////////////////////////////
  9. // Put all the conditional-compile constants here. There had better
  10. // not be many!
  11. // Multi-board support can be enabled by setting this to 1:
  12. #define MULTI_BOARDS 0
  13. // This is the maximum number of boards we'll support in a single
  14. // virtual driver:
  15. #if MULTI_BOARDS
  16. #define MAX_BOARDS 16
  17. #define IBOARD(ppdev) ((ppdev)->iBoard)
  18. #else
  19. #define MAX_BOARDS 1
  20. #define IBOARD(ppdev) 0
  21. #endif
  22. //////////////////////////////////////////////////////////////////////
  23. // Miscellaneous shared stuff
  24. #define DLL_NAME L"ati" // Name of the DLL in UNICODE
  25. #define STANDARD_DEBUG_PREFIX "ATI: " // All debug output is prefixed
  26. // by this string
  27. #define ALLOC_TAG ' ITA' // Four byte tag used for tracking
  28. // memory allocations (characters
  29. // are in reverse order)
  30. #define CLIP_LIMIT 50 // We'll be taking 800 bytes of stack space
  31. #define DRIVER_EXTRA_SIZE 0 // Size of the DriverExtra information in the
  32. // DEVMODE structure
  33. #define TMP_BUFFER_SIZE 8192 // Size in bytes of 'pvTmpBuffer'. Has to
  34. // be at least enough to store an entire
  35. // scan line (i.e., 6400 for 1600x1200x32).
  36. #define ROUND8(x) (((x)+7)&~7)
  37. typedef struct _CLIPENUM {
  38. LONG c;
  39. RECTL arcl[CLIP_LIMIT]; // Space for enumerating complex clipping
  40. } CLIPENUM; /* ce, pce */
  41. typedef struct _PDEV PDEV; // Handy forward declaration
  42. // Basic Mach types:
  43. typedef enum {
  44. MACH_IO_32, // Mach8 or Mach32
  45. MACH_MM_32, // Mach32 capable of memory-mapped I/O
  46. MACH_MM_64, // Mach64
  47. } MACHTYPE;
  48. // Specific ASIC types:
  49. typedef enum {
  50. ASIC_38800_1, // Mach8
  51. ASIC_68800_3, // Mach32
  52. ASIC_68800_6, // Mach32
  53. ASIC_68800AX, // Mach32
  54. ASIC_88800GX, // Mach64
  55. ASIC_COUNT
  56. } ASIC;
  57. // Frame buffer aperture types:
  58. typedef enum {
  59. APERTURE_NONE,
  60. APERTURE_FULL,
  61. APERTURE_PAGE_SINGLE,
  62. APERTURE_PAGE_DOUBLE,
  63. APERTURE_COUNT
  64. } APERTURE;
  65. // NOTE: Must be kept in sync with miniport version of the structure!
  66. #include "atint.h"
  67. #if TARGET_BUILD > 351
  68. #define AtiDeviceIoControl(handle,controlCode,inBuffer,inBufferSize,outBuffer,outBufferSize,bytesReturned) \
  69. (!EngDeviceIoControl(handle,controlCode,inBuffer,inBufferSize,outBuffer,outBufferSize,bytesReturned))
  70. #define AtiAllocMem(a,b,allocSize) EngAllocMem((b),allocSize,ALLOC_TAG)
  71. #define AtiFreeMem(ptr) EngFreeMem(ptr)
  72. #else
  73. #define AtiDeviceIoControl(handle,controlCode,inBuffer,inBufferSize,outBuffer,outBufferSize,bytesReturned) \
  74. DeviceIoControl(handle,controlCode,inBuffer,inBufferSize,outBuffer,outBufferSize,bytesReturned,NULL)
  75. #define AtiAllocMem(a,b,allocSize) LocalAlloc((a),allocSize)
  76. #define AtiFreeMem(ptr) LocalFree(ptr)
  77. #endif
  78. VOID vSetClipping(PDEV*, RECTL*);
  79. VOID vResetClipping(PDEV*);
  80. //////////////////////////////////////////////////////////////////////
  81. // Text stuff
  82. #define GLYPH_CACHE_CX 64 // Maximal width of glyphs that we'll consider
  83. // caching
  84. #define GLYPH_CACHE_CY 64 // Maximum height of glyphs that we'll consider
  85. // caching
  86. #define GLYPH_ALLOC_SIZE 8100
  87. // Do all cached glyph memory allocations
  88. // in 8k chunks
  89. #define HGLYPH_SENTINEL ((ULONG) -1)
  90. // GDI will never give us a glyph with a
  91. // handle value of 0xffffffff, so we can
  92. // use this as a sentinel for the end of
  93. // our linked lists
  94. #define GLYPH_HASH_SIZE 256
  95. #define GLYPH_HASH_FUNC(x) ((x) & (GLYPH_HASH_SIZE - 1))
  96. typedef struct _CACHEDGLYPH CACHEDGLYPH;
  97. typedef struct _CACHEDGLYPH
  98. {
  99. CACHEDGLYPH* pcgNext; // Points to next glyph that was assigned
  100. // to the same hash table bucket
  101. HGLYPH hg; // Handles in the bucket-list are kept in
  102. // increasing order
  103. POINTL ptlOrigin; // Origin of glyph bits
  104. // Device specific fields below here:
  105. LONG cx; // Width of the glyph
  106. LONG cy; // Height of the glyph
  107. LONG cxy; // Height and width encoded
  108. LONG cw; // Number of words in glyph
  109. LONG cd; // Number of dwords in glyph
  110. // Glyph bits follow here:
  111. ULONG ad[1]; // Start of glyph bits
  112. } CACHEDGLYPH; /* cg, pcg */
  113. typedef struct _GLYPHALLOC GLYPHALLOC;
  114. typedef struct _GLYPHALLOC
  115. {
  116. GLYPHALLOC* pgaNext; // Points to next glyph structure that
  117. // was allocated for this font
  118. CACHEDGLYPH acg[1]; // This array is a bit misleading, because
  119. // the CACHEDGLYPH structures are actually
  120. // variable sized
  121. } GLYPHAALLOC; /* ga, pga */
  122. typedef struct _CACHEDFONT
  123. {
  124. GLYPHALLOC* pgaChain; // Points to start of allocated memory list
  125. CACHEDGLYPH* pcgNew; // Points to where in the current glyph
  126. // allocation structure a new glyph should
  127. // be placed
  128. LONG cjAlloc; // Bytes remaining in current glyph allocation
  129. // structure
  130. CACHEDGLYPH cgSentinel; // Sentinel entry of the end of our bucket
  131. // lists, with a handle of HGLYPH_SENTINEL
  132. CACHEDGLYPH* apcg[GLYPH_HASH_SIZE];
  133. // Hash table for glyphs
  134. } CACHEDFONT; /* cf, pcf */
  135. BOOL bEnableText(PDEV*);
  136. VOID vDisableText(PDEV*);
  137. VOID vAssertModeText(PDEV*, BOOL);
  138. /////////////////////////////////////////////////////////////////////
  139. // for overlay support
  140. #if TARGET_BUILD > 351
  141. // new stuff from overlay.c
  142. #define UPDATEOVERLAY 0x01L
  143. #define SETOVERLAYPOSITION 0x02L
  144. #define DOUBLE_PITCH 0x04L
  145. #define OVERLAY_ALLOCATED 0x08L
  146. #define OVERLAY_VISIBLE 0x10L
  147. #define CRTC_INTERLACE_EN 0x00000002L
  148. #define CRTC_VLINE_CRNT_VLINE 0x04
  149. #define CLOCK_CNTL 0x24
  150. #define DD_RESERVED_DIFFERENTPIXELFORMAT 0x0001
  151. typedef struct tagOVERLAYINFO16
  152. {
  153. DWORD dwFlags;
  154. RECTL rSrc;
  155. RECTL rDst;
  156. RECTL rOverlay;
  157. DWORD dwBuf0Start;
  158. LONG lBuf0Pitch;
  159. DWORD dwBuf1Start;
  160. LONG lBuf1Pitch;
  161. DWORD dwOverlayKeyCntl;
  162. DWORD dwHInc;
  163. DWORD dwVInc;
  164. }
  165. OVERLAYINFO16;
  166. /*****************************************************************************
  167. VT - GT Registers
  168. *****************************************************************************/
  169. #define DD_OVERLAY_Y_X 0x00
  170. #define DD_OVERLAY_Y_X_END 0x01
  171. #define DD_OVERLAY_VIDEO_KEY_CLR 0x02
  172. #define DD_OVERLAY_VIDEO_KEY_MSK 0x03
  173. #define DD_OVERLAY_GRAPHICS_KEY_CLR 0x04
  174. #define DD_OVERLAY_GRAPHICS_KEY_MSK 0x05
  175. #define DD_OVERLAY_KEY_CNTL 0x06
  176. #define DD_OVERLAY_SCALE_INC 0x08
  177. #define DD_OVERLAY_SCALE_CNTL 0x09
  178. #define DD_SCALER_HEIGHT_WIDTH 0x0A
  179. #define DD_OVERLAY_TEST 0x0B
  180. #define DD_SCALER_THRESHOLD 0x0C
  181. #define DD_SCALER_BUF0_OFFSET 0x0D
  182. #define DD_SCALER_BUF1_OFFSET 0x0E
  183. #define DD_SCALER_BUF_PITCH 0x0F
  184. #define DD_VIDEO_FORMAT 0x12
  185. #define DD_VIDEO_CONFIG 0x13
  186. #define DD_CAPTURE_CONFIG 0x14
  187. #define DD_TRIG_CNTL 0x15
  188. #define DD_VMC_CONFIG 0x18
  189. #define DD_BUF0_OFFSET 0x20
  190. #define DD_BUF0_PITCH 0x23
  191. #define DD_BUF1_OFFSET 0x26
  192. #define DD_BUF1_PITCH 0x29
  193. // for RAGE III
  194. #define DD_SCALER_COLOUR_CNTL 0x54
  195. #define DD_SCALER_H_COEFF0 0x55
  196. #define DD_SCALER_H_COEFF1 0x56
  197. #define DD_SCALER_H_COEFF2 0x57
  198. #define DD_SCALER_H_COEFF3 0x58
  199. #define DD_SCALER_H_COEFF4 0x59
  200. /*****************************************************************************/
  201. // stuff from overlay.c
  202. #define MAKE_FOURCC( ch0, ch1, ch2, ch3 ) \
  203. ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
  204. ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  205. #define FOURCC_YUY2 MAKE_FOURCC('Y','U','Y','2')
  206. #define FOURCC_UYVY MAKE_FOURCC('U','Y','V','Y')
  207. #define FOURCC_YVYU MAKE_FOURCC('Y','V','Y','U')
  208. // end overlay support
  209. #endif
  210. //////////////////////////////////////////////////////////////////////
  211. // Dither stuff
  212. // Describes a single colour tetrahedron vertex for dithering:
  213. typedef struct _VERTEX_DATA {
  214. ULONG ulCount; // Number of pixels in this vertex
  215. ULONG ulVertex; // Vertex number
  216. } VERTEX_DATA; /* vd, pv */
  217. VERTEX_DATA* vComputeSubspaces(ULONG, VERTEX_DATA*);
  218. VOID vDitherColor(ULONG*, VERTEX_DATA*, VERTEX_DATA*, ULONG);
  219. //////////////////////////////////////////////////////////////////////
  220. // Brush stuff
  221. #define TOTAL_BRUSH_COUNT 8 // We'll keep room for 8 brushes in our
  222. // Mach64 off-screen brush cache.
  223. // Must be a power of two.
  224. #define TOTAL_BRUSH_SIZE 64 // We'll only ever handle 8x8 patterns,
  225. // and this is the number of pels
  226. #define RBRUSH_2COLOR 1 // For RBRUSH flags
  227. typedef struct _BRUSHENTRY BRUSHENTRY;
  228. typedef union _RBRUSH_COLOR RBRUSH_COLOR;
  229. typedef VOID (FNFILL)(PDEV*, LONG, RECTL*, ULONG, RBRUSH_COLOR, POINTL*);
  230. typedef struct _RBRUSH {
  231. FLONG fl; // Type flags
  232. ULONG ulForeColor; // Foreground colour if 1bpp
  233. ULONG ulBackColor; // Background colour if 1bpp
  234. POINTL ptlBrush; // Monochrome brush's alignment
  235. FNFILL* pfnFillPat; // Fill routine to be called for this brush
  236. BRUSHENTRY* apbe[MAX_BOARDS];// Points to brush-entry that keeps track
  237. // of the cached off-screen brush bits
  238. ULONG aulPattern[1]; // Open-ended array for keeping copy of the
  239. // Don't put anything // actual pattern bits in case the brush
  240. // after here, or // origin changes, or someone else steals
  241. // you'll be sorry! // our brush entry (declared as a ULONG
  242. // for proper dword alignment)
  243. } RBRUSH; /* rb, prb */
  244. typedef struct _BRUSHENTRY {
  245. RBRUSH* prbVerify; // We never dereference this pointer to
  246. // find a brush realization; it is only
  247. // ever used in a compare to verify
  248. // that for a given realized brush, our
  249. // off-screen brush entry is still valid.
  250. LONG x; // x-position of cached pattern
  251. LONG y; // y-position of cached pattern
  252. ULONG ulOffsetPitch; // Packed offset and pitch of cached brush
  253. // in off-screen memory on the Mach64
  254. } BRUSHENTRY; /* be, pbe */
  255. typedef union _RBRUSH_COLOR {
  256. RBRUSH* prb;
  257. ULONG iSolidColor;
  258. } RBRUSH_COLOR; /* rbc, prbc */
  259. BOOL bEnableBrushCache(PDEV*);
  260. VOID vDisableBrushCache(PDEV*);
  261. VOID vAssertModeBrushCache(PDEV*, BOOL);
  262. //////////////////////////////////////////////////////////////////////
  263. // Stretch stuff
  264. typedef struct _STR_BLT {
  265. PDEV* ppdev;
  266. PBYTE pjSrcScan;
  267. LONG lDeltaSrc;
  268. LONG XSrcStart;
  269. PBYTE pjDstScan;
  270. LONG lDeltaDst;
  271. LONG XDstStart;
  272. LONG XDstEnd;
  273. LONG YDstStart;
  274. LONG YDstCount;
  275. ULONG ulXDstToSrcIntCeil;
  276. ULONG ulXDstToSrcFracCeil;
  277. ULONG ulYDstToSrcIntCeil;
  278. ULONG ulYDstToSrcFracCeil;
  279. ULONG ulXFracAccumulator;
  280. ULONG ulYFracAccumulator;
  281. } STR_BLT;
  282. typedef VOID (*PFN_DIRSTRETCH)(STR_BLT*);
  283. typedef BOOL (FN_STRETCHDIB)(PDEV*, VOID*, LONG, RECTL*, VOID*, LONG, RECTL*, RECTL*);
  284. VOID vDirectStretch8Narrow(STR_BLT*);
  285. VOID vM64DirectStretch8(STR_BLT*);
  286. VOID vM64DirectStretch16(STR_BLT*);
  287. VOID vM64DirectStretch32(STR_BLT*);
  288. VOID vM32DirectStretch8(STR_BLT*);
  289. VOID vM32DirectStretch16(STR_BLT*);
  290. VOID vI32DirectStretch8(STR_BLT*);
  291. VOID vI32DirectStretch16(STR_BLT*);
  292. FN_STRETCHDIB bM64StretchDIB;
  293. FN_STRETCHDIB bM32StretchDIB;
  294. FN_STRETCHDIB bI32StretchDIB;
  295. /////////////////////////////////////////////////////////////////////////
  296. // Heap stuff
  297. typedef enum {
  298. OH_FREE = 0, // The off-screen allocation is available for use
  299. OH_DISCARDABLE, // The allocation is occupied by a discardable bitmap
  300. // that may be moved out of off-screen memory
  301. OH_PERMANENT, // The allocation is occupied by a permanent bitmap
  302. // that cannot be moved out of off-screen memory
  303. } OHSTATE;
  304. typedef struct _DSURF DSURF;
  305. typedef struct _OH OH;
  306. typedef struct _OH
  307. {
  308. OHSTATE ohState; // State of off-screen allocation
  309. LONG x; // x-coordinate of left edge of allocation
  310. LONG y; // y-coordinate of top edge of allocation
  311. LONG cx; // Width in pixels of allocation
  312. LONG cy; // Height in pixels of allocation
  313. LONG cxReserved; // Dimensions of original reserved rectangle;
  314. LONG cyReserved; // zero if rectangle is not 'reserved'
  315. OH* pohNext; // When OH_FREE or OH_RESERVE, points to the next
  316. // free node, in ascending cxcy value. This is
  317. // kept as a circular doubly-linked list with a
  318. // sentinel at the end.
  319. // When OH_DISCARDABLE, points to the next most
  320. // recently created allocation. This is kept as
  321. // a circular doubly-linked list.
  322. OH* pohPrev; // Opposite of 'pohNext'
  323. ULONG cxcy; // Width and height in a dword for searching
  324. OH* pohLeft; // Adjacent allocation when in-use or available
  325. OH* pohUp;
  326. OH* pohRight;
  327. OH* pohDown;
  328. DSURF* pdsurf; // Points to our DSURF structure
  329. VOID* pvScan0; // Points to start of first scan-line
  330. }; /* oh, poh */
  331. // This is the smallest structure used for memory allocations:
  332. typedef struct _OHALLOC OHALLOC;
  333. typedef struct _OHALLOC
  334. {
  335. OHALLOC* pohaNext;
  336. OH aoh[1];
  337. } OHALLOC; /* oha, poha */
  338. typedef struct _HEAP
  339. {
  340. LONG cxMax; // Largest possible free space by area
  341. LONG cyMax;
  342. OH ohFree; // Head of the free list, containing those
  343. // rectangles in off-screen memory that are
  344. // available for use. pohNext points to
  345. // hte smallest available rectangle, and pohPrev
  346. // points to the largest available rectangle,
  347. // sorted by cxcy.
  348. OH ohDiscardable; // Head of the discardable list that contains all
  349. // bitmaps located in offscreen memory that
  350. // are eligible to be tossed out of the heap.
  351. // It is kept in order of creation: pohNext
  352. // points to the most recently created; pohPrev
  353. // points to the least recently created.
  354. OH ohPermanent; // List of permanently allocated rectangles
  355. OH* pohFreeList; // List of OH node data structures available
  356. OHALLOC* pohaChain; // Chain of allocations
  357. } HEAP; /* heap, pheap */
  358. typedef enum {
  359. DT_SCREEN, // Surface is kept in screen memory
  360. DT_DIB // Surface is kept as a DIB
  361. } DSURFTYPE; /* dt, pdt */
  362. typedef struct _DSURF
  363. {
  364. DSURFTYPE dt; // DSURF status (whether off-screen or in a DIB)
  365. SIZEL sizl; // Size of the original bitmap (could be smaller
  366. // than poh->sizl)
  367. PDEV* ppdev; // Need this for deleting the bitmap
  368. union {
  369. OH* poh; // If DT_SCREEN, points to off-screen heap node
  370. SURFOBJ* pso; // If DT_DIB, points to locked GDI surface
  371. };
  372. // The following are used for DT_DIB only...
  373. ULONG cBlt; // Counts down the number of blts necessary at
  374. // the current uniqueness before we'll consider
  375. // putting the DIB back into off-screen memory
  376. ULONG iUniq; // Tells us whether there have been any heap
  377. // 'free's since the last time we looked at
  378. // this DIB
  379. } DSURF; /* dsurf, pdsurf */
  380. // GDI expects dword alignment for any bitmaps on which it is expected
  381. // to draw. Since we occasionally ask GDI to draw directly on our off-
  382. // screen bitmaps, this means that any off-screen bitmaps must be dword
  383. // aligned in the frame buffer. We enforce this merely by ensuring that
  384. // all off-screen bitmaps are four-pel aligned (we may waste a couple of
  385. // pixels at the higher colour depths):
  386. #define HEAP_X_ALIGNMENT 4
  387. // Number of blts necessary before we'll consider putting a DIB DFB back
  388. // into off-screen memory:
  389. #define HEAP_COUNT_DOWN 6
  390. // Flags for 'pohAllocate':
  391. typedef enum {
  392. FLOH_ONLY_IF_ROOM = 0x0001, // Don't kick stuff out of off-
  393. // screen memory to make room
  394. FLOH_MAKE_PERMANENT = 0x0002, // Allocate a permanent entry
  395. FLOH_RESERVE = 0x0004, // Allocate an off-screen entry,
  396. // but let it be used by discardable
  397. // bitmaps until it's needed
  398. } FLOH;
  399. // Publicly callable heap APIs:
  400. OH* pohAllocate(PDEV*, POINTL*, LONG, LONG, FLOH);
  401. BOOL bOhCommit(PDEV*, OH*, BOOL);
  402. OH* pohFree(PDEV*, OH*);
  403. OH* pohMoveOffscreenDfbToDib(PDEV*, OH*);
  404. BOOL bMoveDibToOffscreenDfbIfRoom(PDEV*, DSURF*);
  405. BOOL bMoveAllDfbsFromOffscreenToDibs(PDEV* ppdev);
  406. BOOL bEnableOffscreenHeap(PDEV*);
  407. VOID vDisableOffscreenHeap(PDEV*);
  408. BOOL bAssertModeOffscreenHeap(PDEV*, BOOL);
  409. /////////////////////////////////////////////////////////////////////////
  410. // Bank manager stuff
  411. #define BANK_DATA_SIZE 80 // Number of bytes to allocate for the
  412. // miniport down-loaded bank code working
  413. // space
  414. typedef struct _BANK
  415. {
  416. // Private data:
  417. RECTL rclDraw; // Rectangle describing the remaining undrawn
  418. // portion of the drawing operation
  419. RECTL rclSaveBounds; // Saved from original CLIPOBJ for restoration
  420. BYTE iSaveDComplexity; // Saved from original CLIPOBJ for restoration
  421. BYTE fjSaveOptions; // Saved from original CLIPOBJ for restoration
  422. LONG iBank; // Current bank
  423. PDEV* ppdev; // Saved copy
  424. // Public data:
  425. SURFOBJ* pso; // Surface wrapped around the bank. Has to be
  426. // passed as the surface in any banked call-
  427. // back.
  428. CLIPOBJ* pco; // Clip object that is the intersection of the
  429. // original clip object with the bounds of the
  430. // current bank. Has to be passed as the clip
  431. // object in any banked call-back.
  432. } BANK; /* bnk, pbnk */
  433. // Note: BANK_MODE is duplicated in i386\strucs.inc!
  434. typedef enum {
  435. BANK_OFF = 0, // We've finished using the memory aperture
  436. BANK_ON, // We're about to use the memory aperture
  437. BANK_ON_NO_WAIT, // We're about to use the memory aperture, and are
  438. // doing our own hardware synchronization
  439. BANK_DISABLE, // We're about to enter full-screen; shut down banking
  440. BANK_ENABLE, // We've exited full-screen; re-enable banking
  441. } BANK_MODE; /* bankm, pbankm */
  442. typedef struct _BANKDATA {
  443. ULONG ulDumb; // !!!!!!!!
  444. } BANKDATA; /* bd, pbd */
  445. typedef VOID (FNBANKMAP)(PDEV*, BANKDATA*, LONG);
  446. typedef VOID (FNBANKSELECTMODE)(PDEV*, BANKDATA*, BANK_MODE);
  447. typedef VOID (FNBANKINITIALIZE)(PDEV*, BANKDATA*);
  448. typedef BOOL (FNBANKCOMPUTE)(PDEV*, RECTL*, RECTL*, LONG*, LONG*);
  449. VOID vBankStart(PDEV*, RECTL*, CLIPOBJ*, BANK*);
  450. BOOL bBankEnum(BANK*);
  451. FNBANKCOMPUTE bBankComputeNonPower2;
  452. FNBANKCOMPUTE bBankComputePower2;
  453. BOOL bEnableBanking(PDEV*);
  454. VOID vDisableBanking(PDEV*);
  455. VOID vAssertModeBanking(PDEV*, BOOL);
  456. /////////////////////////////////////////////////////////////////////////
  457. // Pointer stuff
  458. #define MONO_POINTER_UP 0x0001
  459. #define NO_HARDWARE_CURSOR 0x0002
  460. #define CURSOR_CY 64
  461. #define CURSOR_CX 64
  462. typedef struct _CUROBJ
  463. {
  464. POINTL ptlHotSpot; // Pointer hot spot
  465. SIZEL szlPointer; // Extent of the pointer
  466. POINTL ptlLastPosition; // Last position of pointer
  467. POINTL ptlLastOffset; // Last offset from 0,0 within cursor
  468. ULONG flPointer; // Pointer specific flags.
  469. ULONG mono_offset; // Hardware cursor offset
  470. POINTL hwCursor;
  471. } CUROBJ, *PCUROBJ;
  472. BOOL bEnablePointer(PDEV*);
  473. VOID vDisablePointer(PDEV*);
  474. VOID vAssertModePointer(PDEV*, BOOL);
  475. /////////////////////////////////////////////////////////////////////////
  476. // Palette stuff
  477. BOOL bEnablePalette(PDEV*);
  478. VOID vDisablePalette(PDEV*);
  479. VOID vAssertModePalette(PDEV*, BOOL);
  480. BOOL bInitializePalette(PDEV*, DEVINFO*);
  481. VOID vUninitializePalette(PDEV*);
  482. #define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256))
  483. #define REDSHIFT ((ppdev->flRed & 1)? 0:((ppdev->flRed & 0x100)? 8:16))
  484. #define GREENSHIFT ((ppdev->flGreen & 1)? 0:((ppdev->flGreen & 0x100)? 8:16))
  485. #define BLUESHIFT ((ppdev->flBlue & 1)? 0:((ppdev->flBlue & 0x100)? 8:16))
  486. //////////////////////////////////////////////////////////////////////
  487. // Low-level blt function prototypes
  488. typedef VOID (FNXFER)(PDEV*, LONG, RECTL*, ULONG, SURFOBJ*, POINTL*,
  489. RECTL*, XLATEOBJ*);
  490. typedef VOID (FNCOPY)(PDEV*, LONG, RECTL*, ULONG, POINTL*, RECTL*);
  491. typedef BOOL (FNTEXTOUT)(PDEV*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*,
  492. BRUSHOBJ*, BRUSHOBJ*);
  493. typedef VOID (FNLINETOTRIVIAL)(PDEV*, LONG, LONG, LONG, LONG, ULONG, MIX, RECTL*);
  494. typedef VOID (FNPATREALIZE)(PDEV*, RBRUSH*);
  495. FNFILL vI32FillPatColor;
  496. FNFILL vI32FillPatMonochrome;
  497. FNFILL vI32FillSolid;
  498. FNXFER vI32Xfer1bpp;
  499. FNXFER vI32Xfer4bpp;
  500. FNXFER vI32Xfer8bpp;
  501. FNXFER vI32XferNative;
  502. FNCOPY vI32CopyBlt;
  503. FNLINETOTRIVIAL vI32LineToTrivial;
  504. FNTEXTOUT bI32TextOut;
  505. FNFILL vM32FillPatColor;
  506. FNFILL vM32FillPatMonochrome;
  507. FNFILL vM32FillSolid;
  508. FNXFER vM32Xfer1bpp;
  509. FNXFER vM32Xfer4bpp;
  510. FNXFER vM32Xfer8bpp;
  511. FNXFER vM32XferNative;
  512. FNCOPY vM32CopyBlt;
  513. FNLINETOTRIVIAL vM32LineToTrivial;
  514. FNTEXTOUT bM32TextOut;
  515. FNFILL vM64FillPatColor;
  516. FNFILL vM64FillPatMonochrome;
  517. FNFILL vM64FillSolid;
  518. FNXFER vM64Xfer1bpp;
  519. FNXFER vM64Xfer4bpp;
  520. FNXFER vM64Xfer8bpp;
  521. FNXFER vM64XferNative;
  522. FNCOPY vM64CopyBlt;
  523. FNCOPY vM64CopyBlt_VTA4;
  524. FNLINETOTRIVIAL vM64LineToTrivial;
  525. FNTEXTOUT bM64TextOut;
  526. FNPATREALIZE vM64PatColorRealize;
  527. FNFILL vM64FillPatColor24;
  528. FNFILL vM64FillPatMonochrome24;
  529. FNFILL vM64FillSolid24;
  530. FNXFER vM64XferNative24;
  531. FNCOPY vM64CopyBlt24;
  532. FNCOPY vM64CopyBlt24_VTA4;
  533. FNLINETOTRIVIAL vM64LineToTrivial24;
  534. FNTEXTOUT bM64TextOut24;
  535. typedef VOID (FNXFERBITS)(PDEV*, SURFOBJ*, RECTL*, POINTL*);
  536. FNXFERBITS vPutBits;
  537. FNXFERBITS vGetBits;
  538. FNXFERBITS vI32PutBits;
  539. FNXFERBITS vI32GetBits;
  540. //////////////////////////////////////////////////////////////////////
  541. // Low-level hardware cursor function prototypes
  542. typedef VOID (FNSETCURSOROFFSET)(PDEV*);
  543. typedef VOID (FNUPDATECURSOROFFSET)(PDEV*,LONG,LONG,LONG);
  544. typedef VOID (FNUPDATECURSORPOSITION)(PDEV*,LONG,LONG);
  545. typedef VOID (FNCURSOROFF)(PDEV*);
  546. typedef VOID (FNCURSORON)(PDEV*,LONG);
  547. typedef VOID (FNPOINTERBLIT)(PDEV*,LONG,LONG,LONG,LONG,BYTE*,LONG);
  548. FNSETCURSOROFFSET vM64SetCursorOffset;
  549. FNUPDATECURSOROFFSET vM64UpdateCursorOffset;
  550. FNUPDATECURSORPOSITION vM64UpdateCursorPosition;
  551. FNCURSOROFF vM64CursorOff;
  552. FNCURSORON vM64CursorOn;
  553. FNSETCURSOROFFSET vM64SetCursorOffset_TVP;
  554. FNUPDATECURSOROFFSET vM64UpdateCursorOffset_TVP;
  555. FNUPDATECURSORPOSITION vM64UpdateCursorPosition_TVP;
  556. FNCURSOROFF vM64CursorOff_TVP;
  557. FNCURSORON vM64CursorOn_TVP;
  558. FNSETCURSOROFFSET vM64SetCursorOffset_IBM514;
  559. FNUPDATECURSOROFFSET vM64UpdateCursorOffset_IBM514;
  560. FNUPDATECURSORPOSITION vM64UpdateCursorPosition_IBM514;
  561. FNCURSOROFF vM64CursorOff_IBM514;
  562. FNCURSORON vM64CursorOn_IBM514;
  563. FNUPDATECURSOROFFSET vM64UpdateCursorOffset_CT;
  564. FNCURSOROFF vM64CursorOff_CT;
  565. FNCURSORON vM64CursorOn_CT;
  566. FNPOINTERBLIT vM64PointerBlit;
  567. FNPOINTERBLIT vM64PointerBlit_TVP;
  568. FNPOINTERBLIT vM64PointerBlit_IBM514;
  569. FNSETCURSOROFFSET vI32SetCursorOffset;
  570. FNUPDATECURSOROFFSET vI32UpdateCursorOffset;
  571. FNUPDATECURSORPOSITION vI32UpdateCursorPosition;
  572. FNCURSOROFF vI32CursorOff;
  573. FNCURSORON vI32CursorOn;
  574. FNPOINTERBLIT vI32PointerBlit;
  575. FNPOINTERBLIT vPointerBlitLFB;
  576. #if TARGET_BUILD > 351
  577. ///////////////////////////////////////////////////////////////////////
  578. // DirectDraw stuff
  579. typedef struct _FLIPRECORD
  580. {
  581. FLATPTR fpFlipFrom;
  582. LONGLONG liFlipTime;
  583. LONGLONG liFlipDuration;
  584. DWORD wFlipScanLine;
  585. BOOL bHaveEverCrossedVBlank;
  586. BOOL bWasEverInDisplay;
  587. BOOL bFlipFlag;
  588. WORD wstartOfVBlank;// only used in MACH32
  589. } FLIPRECORD;
  590. typedef FLIPRECORD *LPFLIPRECORD;
  591. #define ROUND_UP_TO_64K(x) (((ULONG)(x) + 0x10000 - 1) & ~(0x10000 - 1))
  592. #define ROUND_DOWN_TO_64K(x) (((ULONG)(x) & 0xFFFF0000 ))
  593. BOOL bEnableDirectDraw(PDEV*);
  594. VOID vDisableDirectDraw(PDEV*);
  595. VOID vAssertModeDirectDraw(PDEV*, BOOL);
  596. #endif
  597. ////////////////////////////////////////////////////////////////////////
  598. // Capabilities flags
  599. typedef enum {
  600. CAPS_MONOCHROME_PATTERNS = 1, // Hardware has 8x8 monochrome pattern
  601. // capability in this mode
  602. CAPS_COLOR_PATTERNS = 2, // Capable of colour patterns. I.e.,
  603. // running at 8bpp on Mach32, and
  604. // a brush cache has been allocated
  605. // on the Mach64
  606. CAPS_LINEAR_FRAMEBUFFER = 4, // Frame buffer is mapped linearly
  607. } CAPS;
  608. // DIRECT_ACCESS returns TRUE if there is any sort of aperture that
  609. // can be directly accessed:
  610. #define DIRECT_ACCESS(ppdev) (ppdev->iAperture != APERTURE_NONE)
  611. ////////////////////////////////////////////////////////////////////////
  612. // The Physical Device data structure
  613. typedef struct _PDEV
  614. {
  615. #ifdef OGLMCD //start OGLMCD support
  616. DWORD dwSize; // size of PDEV structure; used by atimcd.dll
  617. // All the OpenGL MCD support in the PDEV must be at the begining of the structure
  618. // because atimcd.dll and ati.dll don't have to be in sync, but any additions to PDEV
  619. // that can affect the MCD used field's offset in the structure will break the MCD
  620. // new fields for MCDOGL containing revision no.
  621. BYTE MCDMajorRev;
  622. BYTE MCDMinorRev;
  623. ////////// This is only for OGL MCD support
  624. //functions pointers to ALLOC and FREE functions from heap.c
  625. // CJ PFN pohAllocate;
  626. // CJ PFN pohFree;
  627. OH* (*pohAllocate)(PDEV*, POINTL*, LONG, LONG, FLOH);
  628. OH* (*pohFree)(PDEV*, OH*);
  629. ULONG iUniqueness; // display uniqueness for tracking
  630. // resolution changes
  631. LONG cDoubleBufferRef; // Reference count for current number
  632. // of RC's that have active double-
  633. // buffers
  634. OH* pohBackBuffer; // Our 2-d heap allocation structure
  635. // for the back-buffer
  636. ULONG ulBackBuffer; // Byte offset in the frame buffer
  637. // to the start of the back-buffer
  638. LONG cZBufferRef; // Reference count for current number
  639. // of RC's that have active z-buffers
  640. // (which, on Athenta, is all RC's)
  641. OH* pohZBuffer; // Our 2-d heap allocation structure
  642. // for the z-buffer
  643. ULONG ulFrontZBuffer; // Byte offset in the frame buffer
  644. // to the start of the front z-buffer
  645. // (the MGA sometimes has to have
  646. // separate z-buffers for front and
  647. // back)
  648. ULONG ulBackZBuffer; // Byte offset in the frame buffer
  649. // to the start of the back z-buffer
  650. HANDLE hMCD; // Handle to MCD engine dll
  651. MCDENGESCFILTERFUNC pMCDFilterFunc; // MCD engine filter function
  652. HANDLE hMCD_ATI; // Handle to ATI MCD driver dll
  653. PFN pMCDrvGetEntryPoints; // ATI MCD function for filling supported functions index
  654. #endif // end OGLMCD
  655. LONG xOffset; // Pixel offset from (0, 0) to current
  656. LONG yOffset; // DFB located in off-screen memory
  657. BYTE* pjMmBase; // Start of memory mapped I/O
  658. BYTE* VideoRamBase; // fixup for pjMmBase so that vDisableHardware can free it
  659. UCHAR* pjIoBase; // Start of I/O space (NULL on x86)
  660. BYTE* pjScreen; // Points to base screen address
  661. LONG lDelta; // Distance from one scan to the next.
  662. LONG cPelSize; // 0 if 8bpp, 1 if 16bpp, 2 if 32bpp
  663. LONG cjPelSize; // 1 if 8bpp, 2 if 16bpp, 3 if 24bpp,
  664. // 4 if 32bpp
  665. ULONG iBitmapFormat; // BMF_8BPP or BMF_16BPP or BMF_32BPP
  666. // (our current colour depth)
  667. LONG iBoard; // Logical multi-board identifier
  668. // (zero by default)
  669. // Important data for accessing the frame buffer.
  670. VOID* pvBankData; // Points to aulBankData[0]
  671. FNBANKSELECTMODE* pfnBankSelectMode; // Routine to enable or disable
  672. // direct frame buffer access
  673. BANK_MODE bankmOnOverlapped; // BANK_ON or BANK_ON_NO_WAIT,
  674. // depending on whether card
  675. // can handle simulataneous
  676. // frame buffer and accelerator
  677. // access
  678. // -------------------------------------------------------------------
  679. // NOTE: Changes up to here in the PDEV structure must be reflected in
  680. // i386\strucs.inc (assuming you're on an x86, of course)!
  681. ASIC iAsic; // Specific Mach ASIC type
  682. APERTURE iAperture; // Aperture type
  683. ULONG ulTearOffset; // For uneven scans in 1152 or 1280 in 24bpp, and 1600 in 16bpp (mach64 only)
  684. ULONG ulVramOffset; // ulTearOffset / 8
  685. ULONG ulScreenOffsetAndPitch; // Screen offset and pitch for primary
  686. // display
  687. ULONG ulMonoPixelWidth; // Default value of DP_PIX_WID register
  688. ULONG SetGuiEngineDefault; // new feature for Rage II+ and above
  689. CAPS flCaps; // Capabilities flags
  690. BOOL bEnabled; // In graphics mode (not full-screen)
  691. HANDLE hDriver; // Handle to \Device\Screen
  692. HDEV hdevEng; // Engine's handle to PDEV
  693. HSURF hsurfScreen; // Engine's handle to screen surface
  694. DSURF* pdsurfScreen; // Our private DSURF for the screen
  695. HSURF hsurfPunt; // Just for 24bpp mach32 with linear aperture
  696. LONG cxScreen; // Visible screen width
  697. LONG cyScreen; // Visible screen height
  698. LONG cxMemory; // Width of Video RAM
  699. LONG cyMemory; // Height of Video RAM
  700. LONG cBitsPerPel; // Bits per pel (8, 15, 16, 24 or 32)
  701. ULONG ulMode; // Mode the mini-port driver is in.
  702. FLONG flHooks; // What we're hooking from GDI
  703. ULONG ulWhite; // 0xff if 8bpp, 0xffff if 16bpp,
  704. // 0xffffffff if 32bpp
  705. VOID* pvTmpBuffer; // General purpose temporary buffer,
  706. // TMP_BUFFER_SIZE bytes in size
  707. // (Remember to synchronize if you
  708. // use this for device bitmaps or
  709. // async pointers)
  710. MACHTYPE iMachType; // Type of I/O to do based on Mach type
  711. ULONG FeatureFlags; // ENH_VERSION_NT FeatureFlags
  712. ATI_MODE_INFO *pModeInfo; // ATI-specific mode information (see ATINT.H)
  713. ////////// Context stuff
  714. BYTE *pjContextBase;
  715. ULONG ulContextCeiling; // Keep track of available contexts
  716. ULONG iDefContext; // Used to initialize graphics operations
  717. ////////// Low-level blt function pointers:
  718. FNFILL* pfnFillSolid;
  719. FNFILL* pfnFillPatColor;
  720. FNFILL* pfnFillPatMonochrome;
  721. FNXFER* pfnXfer1bpp;
  722. FNXFER* pfnXfer4bpp;
  723. FNXFER* pfnXfer8bpp;
  724. FNXFER* pfnXferNative;
  725. FNCOPY* pfnCopyBlt;
  726. FNTEXTOUT* pfnTextOut;
  727. FNLINETOTRIVIAL* pfnLineToTrivial;
  728. FNXFERBITS* pfnGetBits;
  729. FNXFERBITS* pfnPutBits;
  730. ////////// Palette stuff:
  731. PALETTEENTRY* pPal; // The palette if palette managed
  732. HPALETTE hpalDefault; // GDI handle to the default palette.
  733. FLONG flRed; // Red mask for 16/32bpp bitfields
  734. FLONG flGreen; // Green mask for 16/32bpp bitfields
  735. FLONG flBlue; // Blue mask for 16/32bpp bitfields
  736. ULONG cPaletteShift; // number of bits the 8-8-8 palette must
  737. // be shifted by to fit in the hardware
  738. // palette.
  739. ////////// Heap stuff:
  740. HEAP heap; // All our off-screen heap data
  741. ULONG iHeapUniq; // Incremented every time room is freed
  742. // in the off-screen heap
  743. SURFOBJ* psoPunt; // Wrapper surface for having GDI draw
  744. // on off-screen bitmaps
  745. SURFOBJ* psoPunt2; // Another one for off-screen to off-
  746. // screen blts
  747. OH* pohScreen; // Off-screen heap structure for the
  748. // visible screen
  749. ////////// Banking stuff:
  750. LONG cjBank; // Size of a bank, in bytes
  751. LONG cPower2ScansPerBank; // Used by 'bBankComputePower2'
  752. LONG cPower2BankSizeInBytes; // Used by 'bBankComputePower2'
  753. CLIPOBJ* pcoBank; // Clip object for banked call backs
  754. SURFOBJ* psoBank; // Surface object for banked call backs
  755. ULONG aulBankData[BANK_DATA_SIZE / 4];
  756. // Private work area for downloaded
  757. // miniport banking code
  758. FNBANKMAP* pfnBankMap;
  759. FNBANKCOMPUTE* pfnBankCompute;
  760. ////////// Pointer stuff:
  761. CUROBJ pointer1; // pointer double-buffering
  762. CUROBJ pointer2; // pointer double-buffering
  763. CUROBJ *ppointer;
  764. BOOL bAltPtrActive;
  765. FNSETCURSOROFFSET* pfnSetCursorOffset;
  766. FNUPDATECURSOROFFSET* pfnUpdateCursorOffset;
  767. FNUPDATECURSORPOSITION* pfnUpdateCursorPosition;
  768. FNCURSOROFF* pfnCursorOff;
  769. FNCURSORON* pfnCursorOn;
  770. FNPOINTERBLIT* pfnPointerBlit;
  771. ////////// Brush stuff:
  772. LONG iBrushCache; // Index for next brush to be allcoated
  773. BRUSHENTRY abe[TOTAL_BRUSH_COUNT]; // Keeps track of off-screen brush
  774. // cache
  775. ////////// Text stuff:
  776. SURFOBJ* psoText; // 1bpp surface to which we will have
  777. // GDI draw our glyphs for us
  778. ////////// Stretch stuff:
  779. FN_STRETCHDIB* pfnStretchDIB;
  780. BYTE* pjMmBase_Ext; // Start of memory mapped I/O
  781. ////////// Palindrome stuff:
  782. #if PAL_SUPPORT
  783. //structure specific for pal support
  784. PPDEV_PAL_NT pal_str;
  785. #endif // PALINDROME_SUPPORT
  786. ////////// Palindrome and Overlay common stuff:
  787. DWORD semph_overlay; // this semaphore is used for allocating the overlay resource:
  788. // = 0 ; resource free
  789. // = 1 ; in use by DDraw
  790. // = 2 ; in use by Palindrome
  791. #if TARGET_BUILD > 351
  792. ////////// DirectDraw stuff:
  793. BOOL bPassVBlank; // flag used for detecting the VBlank hang on GX cards on high speed multiprocessors machines
  794. FLIPRECORD flipRecord; // Used to track VBlank status
  795. OH* pohDirectDraw; // Off-screen heap allocation for use
  796. // by DirectDraw
  797. // STUFF FOR OVERLAY SUPPORT
  798. // this must be in ppdev
  799. OVERLAYINFO16 OverlayInfo16;
  800. // the following variables maybe should be in ppdev
  801. DWORD OverlayWidth,OverlayHeight; //the last updated overlay's width and height
  802. DWORD OverlayScalingDown;
  803. FLATPTR fpVisibleOverlay; // Frame buffer offset to currently
  804. // visible overlay; will be zero if
  805. // no overlay is visible
  806. DWORD dwOverlayFlipOffset; // Overlay flip offset
  807. // END STUFF FOR OVERLAY SUPP
  808. #endif
  809. } PDEV;
  810. /////////////////////////////////////////////////////////////////////////
  811. // Miscellaneous prototypes:
  812. BOOL bIntersect(RECTL*, RECTL*, RECTL*);
  813. LONG cIntersect(RECTL*, RECTL*, LONG);
  814. DWORD getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION*, DWORD*);
  815. BOOL bInitializeModeFields(PDEV*, GDIINFO*, DEVINFO*, DEVMODEW*);
  816. BOOL bFastFill(PDEV*, LONG, POINTFIX*, ULONG, ULONG, RBRUSH*, POINTL*, RECTL*);
  817. BOOL bEnableHardware(PDEV*);
  818. VOID vDisableHardware(PDEV*);
  819. BOOL bAssertModeHardware(PDEV*, BOOL);
  820. extern BYTE gaRop3FromMix[];
  821. extern ULONG gaul32HwMixFromMix[];
  822. extern ULONG gaul64HwMixFromMix[];
  823. extern ULONG gaul32HwMixFromRop2[];
  824. extern ULONG gaul64HwMixFromRop2[];
  825. /////////////////////////////////////////////////////////////////////////
  826. // The x86 C compiler insists on making a divide and modulus operation
  827. // into two DIVs, when it can in fact be done in one. So we use this
  828. // macro.
  829. //
  830. // Note: QUOTIENT_REMAINDER implicitly takes unsigned arguments.
  831. #if defined(_X86_)
  832. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  833. { \
  834. __asm mov eax, ulNumerator \
  835. __asm sub edx, edx \
  836. __asm div ulDenominator \
  837. __asm mov ulQuotient, eax \
  838. __asm mov ulRemainder, edx \
  839. }
  840. #else
  841. #define QUOTIENT_REMAINDER(ulNumerator, ulDenominator, ulQuotient, ulRemainder) \
  842. { \
  843. ulQuotient = (ULONG) ulNumerator / (ULONG) ulDenominator; \
  844. ulRemainder = (ULONG) ulNumerator % (ULONG) ulDenominator; \
  845. }
  846. #endif
  847. /////////////////////////////////////////////////////////////////////////
  848. // OVERLAP - Returns TRUE if the same-size lower-right exclusive
  849. // rectangles defined by 'pptl' and 'prcl' overlap:
  850. #define OVERLAP(prcl, pptl) \
  851. (((prcl)->right > (pptl)->x) && \
  852. ((prcl)->bottom > (pptl)->y) && \
  853. ((prcl)->left < ((pptl)->x + (prcl)->right - (prcl)->left)) && \
  854. ((prcl)->top < ((pptl)->y + (prcl)->bottom - (prcl)->top)))
  855. /////////////////////////////////////////////////////////////////////////
  856. // SWAP - Swaps the value of two variables, using a temporary variable
  857. #define SWAP(a, b, tmp) { (tmp) = (a); (a) = (b); (b) = (tmp); }
  858. //////////////////////////////////////////////////////////////////////
  859. // These Mul prototypes are thunks for multi-board support:
  860. ULONG MulGetModes(HANDLE, ULONG, DEVMODEW*);
  861. DHPDEV MulEnablePDEV(DEVMODEW*, PWSTR, ULONG, HSURF*, ULONG, ULONG*,
  862. ULONG, DEVINFO*, HDEV, PWSTR, HANDLE);
  863. VOID MulCompletePDEV(DHPDEV, HDEV);
  864. HSURF MulEnableSurface(DHPDEV);
  865. BOOL MulStrokePath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*,
  866. POINTL*, LINEATTRS*, MIX);
  867. BOOL MulFillPath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*,
  868. MIX, FLONG);
  869. BOOL MulBitBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  870. RECTL*, POINTL*, POINTL*, BRUSHOBJ*, POINTL*, ROP4);
  871. VOID MulDisablePDEV(DHPDEV);
  872. VOID MulDisableSurface(DHPDEV);
  873. BOOL MulAssertMode(DHPDEV, BOOL);
  874. VOID MulMovePointer(SURFOBJ*, LONG, LONG, RECTL*);
  875. ULONG MulSetPointerShape(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, LONG,
  876. LONG, LONG, LONG, RECTL*, FLONG);
  877. ULONG MulDitherColor(DHPDEV, ULONG, ULONG, ULONG*);
  878. BOOL MulSetPalette(DHPDEV, PALOBJ*, FLONG, ULONG, ULONG);
  879. BOOL MulCopyBits(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*);
  880. BOOL MulTextOut(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, RECTL*,
  881. BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX);
  882. VOID MulDestroyFont(FONTOBJ*);
  883. BOOL MulPaint(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX);
  884. BOOL MulRealizeBrush(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*,
  885. ULONG);
  886. HBITMAP MulCreateDeviceBitmap(DHPDEV, SIZEL, ULONG);
  887. VOID MulDeleteDeviceBitmap(DHSURF);
  888. BOOL MulStretchBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  889. COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*,
  890. ULONG);
  891. // These Dbg prototypes are thunks for debugging:
  892. VOID DbgDisableDriver(VOID);
  893. ULONG DbgGetModes(HANDLE, ULONG, DEVMODEW*);
  894. DHPDEV DbgEnablePDEV(DEVMODEW*, PWSTR, ULONG, HSURF*, ULONG, ULONG*,
  895. ULONG, DEVINFO*, HDEV, PWSTR, HANDLE);
  896. VOID DbgCompletePDEV(DHPDEV, HDEV);
  897. HSURF DbgEnableSurface(DHPDEV);
  898. BOOL DbgLineTo(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, LONG, LONG, LONG, LONG,
  899. RECTL*, MIX);
  900. BOOL DbgStrokePath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*,
  901. POINTL*, LINEATTRS*, MIX);
  902. BOOL DbgFillPath(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*,
  903. MIX, FLONG);
  904. BOOL DbgBitBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  905. RECTL*, POINTL*, POINTL*, BRUSHOBJ*, POINTL*, ROP4);
  906. VOID DbgDisablePDEV(DHPDEV);
  907. VOID DbgDisableSurface(DHPDEV);
  908. #if TARGET_BUILD > 351
  909. BOOL DbgAssertMode(DHPDEV, BOOL);
  910. #else
  911. VOID DbgAssertMode(DHPDEV, BOOL);
  912. #endif
  913. VOID DbgMovePointer(SURFOBJ*, LONG, LONG, RECTL*);
  914. ULONG DbgSetPointerShape(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, LONG,
  915. LONG, LONG, LONG, RECTL*, FLONG);
  916. ULONG DbgDitherColor(DHPDEV, ULONG, ULONG, ULONG*);
  917. BOOL DbgSetPalette(DHPDEV, PALOBJ*, FLONG, ULONG, ULONG);
  918. BOOL DbgCopyBits(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*);
  919. BOOL DbgTextOut(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, RECTL*,
  920. BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX);
  921. VOID DbgDestroyFont(FONTOBJ*);
  922. BOOL DbgPaint(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX);
  923. BOOL DbgRealizeBrush(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*,
  924. ULONG);
  925. HBITMAP DbgCreateDeviceBitmap(DHPDEV, SIZEL, ULONG);
  926. VOID DbgDeleteDeviceBitmap(DHSURF);
  927. BOOL DbgStretchBlt(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*,
  928. COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*,
  929. ULONG);
  930. ULONG DbgEscape(SURFOBJ*, ULONG, ULONG, VOID*, ULONG, VOID*);
  931.