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.

812 lines
32 KiB

  1. /******************************Module*Header**********************************\
  2. *
  3. *
  4. * Module Name: p2def.h
  5. *
  6. * Content:
  7. *
  8. * Copyright (c) 1994-1998 3Dlabs Inc. Ltd. All rights reserved.
  9. * Copyright (c) 1995-1999 Microsoft Corporation. All rights reserved.
  10. \*****************************************************************************/
  11. #ifndef _P2DEF_H
  12. #define _P2DEF_H
  13. // Texture operations
  14. #define _P2_TEXTURE_MODULATE 0
  15. #define _P2_TEXTURE_DECAL 1
  16. #define _P2_TEXTURE_SPECULAR 4
  17. #define _P2_TEXTURE_COPY 3
  18. #define _P2_TEXTURE_CLAMP 0
  19. #define _P2_TEXTURE_MIRROR 2
  20. #define _P2_TEXTURE_REPEAT 1
  21. /*-----------------------------------------------------*/
  22. /* Permedia Register Fields */
  23. /* --------------------- */
  24. /* Common */
  25. #define __PERMEDIA_ENABLE 1
  26. #define __PERMEDIA_DISABLE 0
  27. // From FBReadMode
  28. #define __PERMEDIA_PATCH 0
  29. #define __PERMEDIA_SUBPATCH 1
  30. #define __PERMEDIA_SUBPATCHPACK 2
  31. #define __PERMEDIA_8BITPIXEL 0
  32. #define __PERMEDIA_16BITPIXEL 1
  33. #define __PERMEDIA_32BITPIXEL 2
  34. #define __PERMEDIA_4BITPIXEL 3
  35. #define __PERMEDIA_24BITPIXEL 4
  36. /* Host In */
  37. #define __PERMEDIA_TAG_MODE_HOLD 0
  38. #define __PERMEDIA_TAG_MODE_INCREMENT 1
  39. #define __PERMEDIA_TAG_MODE_INDEXED 2
  40. #define __PERMEDIA_TAG_MODE_RESERVED 3
  41. /* Host out (Filter) options. */
  42. #define __PERMEDIA_FILTER_TAG 0x1
  43. #define __PERMEDIA_FILTER_DATA 0x2
  44. #define __PERMEDIA_FILTER_TAG_AND_DATA 0x3
  45. #define __PERMEDIA_STATS_COMPARE_INSIDE_REGION 0
  46. #define __PERMEDIA_STATS_COMPARE_OUTSIDE_REGION 1
  47. #define __PERMEDIA_STATS_EXCLUDE_PASSIVE_STEPS 0
  48. #define __PERMEDIA_STATS_INCLUDE_PASSIVE_STEPS 1
  49. #define __PERMEDIA_STATS_EXCLUDE_ACTIVE_STEPS 0
  50. #define __PERMEDIA_STATS_INCLUDE_ACTIVE_STEPS 1
  51. #define __PERMEDIA_STATS_TYPE_PICKING 0
  52. #define __PERMEDIA_STATS_TYPE_EXTENT 1
  53. /* Rasterization */
  54. #define __PERMEDIA_LINE_PRIMITIVE 0
  55. #define __PERMEDIA_TRAPEZOID_PRIMITIVE 1
  56. #define __PERMEDIA_POINT_PRIMITIVE 2
  57. #define __PERMEDIA_RECTANGLE_PRIMITIVE 3
  58. #define __PERMEDIA_FLAT_SHADE_MODE 0
  59. #define __PERMEDIA_GOURAUD_SHADE_MODE 1
  60. #define __PERMEDIA_FRACTION_ADJUST_NONE 0
  61. #define __PERMEDIA_FRACTION_ADJUST_TRUNC 1
  62. #define __PERMEDIA_FRACTION_ADJUST_HALF 2
  63. #define __PERMEDIA_FRACTION_ADJUST_ALMOST_HALF 3
  64. #define __PERMEDIA_START_BIAS_ZERO 0
  65. #define __PERMEDIA_START_BIAS_HALF 1
  66. #define __PERMEDIA_START_BIAS_ALMOST_HALF 2
  67. /* Scissor */
  68. /* Stipple */
  69. #define __PERMEDIA_RESET_STIPPLE_COUNTERS 0
  70. #define __PERMEDIA_LOAD_STIPPLE_COUNTERS 1
  71. /* specifies pattern size as number of address bits less 1 */
  72. #define __PERMEDIA_AREA_STIPPLE_2_PIXEL_PATTERN 0
  73. #define __PERMEDIA_AREA_STIPPLE_4_PIXEL_PATTERN 1
  74. #define __PERMEDIA_AREA_STIPPLE_8_PIXEL_PATTERN 2
  75. #define __PERMEDIA_AREA_STIPPLE_16_PIXEL_PATTERN 3
  76. #define __PERMEDIA_AREA_STIPPLE_32_PIXEL_PATTERN 4
  77. /* Chroma Test Mode */
  78. #define __PERMEDIA_CHROMA_FBSOURCE 0
  79. #define __PERMEDIA_CHROMA_FBDATA 1
  80. #define __PERMEDIA_CHROMA_INPUT_COLOR 2
  81. #define __PERMEDIA_CHROMA_OUTPUT_COLOR 3
  82. #define __PERMEDIA_CHROMA_INCLUDE 0
  83. #define __PERMEDIA_CHROMA_EXCLUDE 1
  84. /* Texture Filter Mode */
  85. #define __PERMEDIA_TEXTUREFILTER_ALPHAMAPSENSE_INCLUDE 0
  86. #define __PERMEDIA_TEXTUREFILTER_ALPHAMAPSENSE_EXCLUDE 1
  87. /* Local buffer read */
  88. #define __PERMEDIA_PPCODE0 0
  89. #define __PERMEDIA_PPCODE1 1
  90. #define __PERMEDIA_PPCODE2 2
  91. #define __PERMEDIA_PPCODE3 3
  92. #define __PERMEDIA_PPCODE4 4
  93. #define __PERMEDIA_PPCODE5 5
  94. #define __PERMEDIA_PPCODE6 6
  95. #define __PERMEDIA_PPCODE7 7
  96. #define __PERMEDIA_LBDEFAULT 0
  97. #define __PERMEDIA_LBSTENCIL 1
  98. #define __PERMEDIA_LBDEPTH 2
  99. #define __PERMEDIA_FBDEFAULT 0
  100. #define __PERMEDIA_FBCOLOR 1
  101. #define __PERMEDIA_TOP_LEFT_WINDOW_ORIGIN 0
  102. #define __PERMEDIA_BOTTOM_LEFT_WINDOW_ORIGIN 1
  103. #define __PERMEDIA_DEPTH_WIDTH_16 0
  104. #define __PERMEDIA_DEPTH_WIDTH_24 1
  105. #define __PERMEDIA_DEPTH_WIDTH_32 2
  106. #define __PERMEDIA_STENCIL_WIDTH_0 0
  107. #define __PERMEDIA_STENCIL_WIDTH_4 1
  108. #define __PERMEDIA_STENCIL_WIDTH_8 2
  109. #define __PERMEDIA_STENCIL_POSITION_16 0
  110. #define __PERMEDIA_STENCIL_POSITION_20 1
  111. #define __PERMEDIA_FRAMECOUNT_POSITION_24 2
  112. #define __PERMEDIA_FRAMECOUNT_POSITION_28 3
  113. #define __PERMEDIA_FRAMECOUNT_POSITION_32 4
  114. #define __PERMEDIA_FRAMECOUNT_POSITION_36 5
  115. #define __PERMEDIA_FRAMECOUNT_POSITION_40 6
  116. #define __PERMEDIA_GID_WIDTH_0 0
  117. #define __PERMEDIA_GID_WIDTH_4 1
  118. #define __PERMEDIA_GID_POSITION_16 0
  119. #define __PERMEDIA_GID_POSITION_20 1
  120. #define __PERMEDIA_GID_POSITION_24 2
  121. #define __PERMEDIA_GID_POSITION_28 3
  122. #define __PERMEDIA_GID_POSITION_32 4
  123. #define __PERMEDIA_GID_POSITION_36 5
  124. #define __PERMEDIA_GID_POSITION_40 6
  125. #define __PERMEDIA_GID_POSITION_44 7
  126. #define __PERMEDIA_GID_POSITION_48 8
  127. /* FBReadMode */
  128. #define __PERMEDIA_FBREAD_FBDEFAULT 0
  129. #define __PERMEDIA_FBREAD_FBCOLOR 1
  130. #define __PERMEDIA_FBREAD_ORIGINTOPLEFT 0
  131. #define __PERMEDIA_FBREAD_ORIGINBOTTOMLEFT 1
  132. #define __PERMEDIA_FBREAD_FBSOURCE_CONSTANT 0
  133. #define __PERMEDIA_FBREAD_FBSOURCE_INDEX 1
  134. #define __PERMEDIA_FBREAD_FBSOURCE_COORDINATE 2
  135. /* Pixel ownership */
  136. #define __PERMEDIA_GID_COMPARE_ALWAYS 0
  137. #define __PERMEDIA_GID_COMPARE_NEVER 1
  138. #define __PERMEDIA_GID_COMPARE_EQUAL 2
  139. #define __PERMEDIA_GID_COMPARE_NOT_EQUAL 3
  140. #define __PERMEDIA_GID_LBUPDATE_LBDATA 0
  141. #define __PERMEDIA_GID_LBUPDATE_REGISTER 1
  142. /* Stencil Test */
  143. #define __PERMEDIA_STENCIL_BUFFER_WIDTH_4 0
  144. #define __PERMEDIA_STENCIL_BUFFER_WIDTH_8 1
  145. #define __PERMEDIA_STENCIL_BUFFER_WIDTH_1 2
  146. #define __PERMEDIA_STENCIL_SOURCE_TEST_LOGIC 0
  147. #define __PERMEDIA_STENCIL_SOURCE_STENCIL_MSG 1
  148. #define __PERMEDIA_STENCIL_SOURCE_SOURCE_STENCIL 2
  149. #define __PERMEDIA_STENCIL_SOURCE_LBSOURCEDATA_MSG 3
  150. #define __PERMEDIA_STENCIL_COMPARE_MODE_NEVER 0
  151. #define __PERMEDIA_STENCIL_COMPARE_MODE_LESS 1
  152. #define __PERMEDIA_STENCIL_COMPARE_MODE_EQUAL 2
  153. #define __PERMEDIA_STENCIL_COMPARE_MODE_LESS_OR_EQUAL 3
  154. #define __PERMEDIA_STENCIL_COMPARE_MODE_GREATER 4
  155. #define __PERMEDIA_STENCIL_COMPARE_MODE_NOT_EQUAL 5
  156. #define __PERMEDIA_STENCIL_COMPARE_MODE_GREATER_OR_EQUAL 6
  157. #define __PERMEDIA_STENCIL_COMPARE_MODE_ALWAYS 7
  158. #define __PERMEDIA_STENCIL_METHOD_KEEP 0
  159. #define __PERMEDIA_STENCIL_METHOD_ZERO 1
  160. #define __PERMEDIA_STENCIL_METHOD_REPLACE 2
  161. #define __PERMEDIA_STENCIL_METHOD_INCR 3
  162. #define __PERMEDIA_STENCIL_METHOD_DECR 4
  163. #define __PERMEDIA_STENCIL_METHOD_INVERT 5
  164. /* Depth Test */
  165. #define __PERMEDIA_DEPTH_SOURCE_DDA 0
  166. #define __PERMEDIA_DEPTH_SOURCE_SOURCE_DEPTH 1
  167. #define __PERMEDIA_DEPTH_SOURCE_DEPTH_MSG 2
  168. #define __PERMEDIA_DEPTH_SOURCE_LBSOURCEDATA_MSG 3
  169. #define __PERMEDIA_DEPTH_COMPARE_MODE_NEVER 0
  170. #define __PERMEDIA_DEPTH_COMPARE_MODE_LESS 1
  171. #define __PERMEDIA_DEPTH_COMPARE_MODE_EQUAL 2
  172. #define __PERMEDIA_DEPTH_COMPARE_MODE_LESS_OR_EQUAL 3
  173. #define __PERMEDIA_DEPTH_COMPARE_MODE_GREATER 4
  174. #define __PERMEDIA_DEPTH_COMPARE_MODE_NOT_EQUAL 5
  175. #define __PERMEDIA_DEPTH_COMPARE_MODE_GREATER_OR_EQUAL 6
  176. #define __PERMEDIA_DEPTH_COMPARE_MODE_ALWAYS 7
  177. /* Local buffer write */
  178. #define __PERMEDIA_WRITEMODE_NORMAL 0
  179. #define __PERMEDIA_WRITEMODE_DOWRITE 1
  180. #define __PERMEDIA_WRITEMODE_CANCELWRITE 2
  181. #define __PERMEDIA_UPLOADDATA_NONE 0
  182. #define __PERMEDIA_UPLOADDATA_LBDEPTH 1
  183. #define __PERMEDIA_UPLOADDATA_LBSTENCIL 2
  184. /* Texture / Fog */
  185. #define __PERMEDIA_TEXTURE_FILTER_NEAREST 0
  186. #define __PERMEDIA_TEXTURE_FILTER_LINEAR2 1
  187. #define __PERMEDIA_TEXTURE_FILTER_TRILINEAR4 2
  188. #define __PERMEDIA_TEXTURE_FILTER_LINEAR4 3
  189. #define __PERMEDIA_TEXTURE_FILTER_TRILINEAR8 4
  190. /* Texture AddressMode */
  191. #define __PERMEDIA_TEXADDRESS_WRAP_CLAMP 0
  192. #define __PERMEDIA_TEXADDRESS_WRAP_REPEAT 1
  193. #define __PERMEDIA_TEXADDRESS_WRAP_MIRROR 2
  194. #define __PERMEDIA_TEXADDRESS_OPERATION_2D 0
  195. #define __PERMEDIA_TEXADDRESS_OPERATION_3D 1
  196. #define __PERMEDIA_TEXADDRESS_TEXMAP_1D 0
  197. #define __PERMEDIA_TEXADDRESS_TEXMAP_2D 1
  198. /* Texture ReadMode */
  199. #define __PERMEDIA_TEXTUREREAD_FILTER_NEAREST 0
  200. #define __PERMEDIA_TEXTUREREAD_FILTER_LINEAR 1
  201. #define __PERMEDIA_TEXTUREREAD_FILTER_NEARMIPNEAREST 2
  202. #define __PERMEDIA_TEXTUREREAD_FILTER_NEARMIPLINEAR 3
  203. #define __PERMEDIA_TEXTUREREAD_FILTER_LINEARMIPNEAREST 4
  204. #define __PERMEDIA_TEXTUREREAD_FILTER_LINEARMIPLINEAR 5
  205. #define __PERMEDIA_TEXTUREREAD_WRAP_CLAMP 0
  206. #define __PERMEDIA_TEXTUREREAD_WRAP_REPEAT 1
  207. #define __PERMEDIA_TEXTUREREAD_WRAP_MIRROR 2
  208. #define __PERMEDIA_TEXTUREREAD_TEXMAP_1D 0
  209. #define __PERMEDIA_TEXTUREREAD_TEXMAP_2D 1
  210. #define __PERMEDIA_TEXTUREREAD_FBSOURCE_NONE 0
  211. #define __PERMEDIA_TEXTUREREAD_FBSOURCE_INDEX 1
  212. #define __PERMEDIA_TEXTUREREAD_FBSOURCE_COORDINATE 2
  213. /* Texture Format */
  214. #define __PERMEDIA_TEXTUREFORMAT_LITTLE_ENDIAN 0
  215. #define __PERMEDIA_TEXTUREFORMAT_BIG_ENDIAN 1
  216. #define __PERMEDIA_TEXTUREFORMAT_COMPONENTS_RGB 2
  217. #define __PERMEDIA_TEXTUREFORMAT_COMPONENTS_RGBA 3
  218. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_TEXEL 0
  219. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_COLOR 1
  220. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_BITMASK 2
  221. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_ONECOMP_LUMA 0
  222. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_ONECOMP_ALPHA 1
  223. #define __PERMEDIA_TEXTUREFORMAT_OUTPUT_ONECOMP_INTESITY 2
  224. /* Texture Color Mode */
  225. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_ALPHA 0
  226. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_LUMA 1
  227. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_LUMA_ALPHA 2
  228. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_INTENSITY 3
  229. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_RGB 4
  230. #define __PERMEDIA_TEXCOLORMODE_BASEFORMAT_RGBA 5
  231. #define __PERMEDIA_TEXCOLORMODE_APPLICATION_MODULATE 0
  232. #define __PERMEDIA_TEXCOLORMODE_APPLICATION_DECAL 1
  233. #define __PERMEDIA_TEXCOLORMODE_APPLICATION_BLEND 2
  234. #define __PERMEDIA_TEXCOLORMODE_APPLICATION_COPY 3
  235. /* Frame buffer read */
  236. #define __PERMEDIA_FBDATA 0
  237. #define __PERMEDIA_FBCOLOR 1
  238. // Config - combined mode register for P2
  239. #define __PERMEDIA_CONFIG_FBREAD_SRC 0x00000001
  240. #define __PERMEDIA_CONFIG_FBREAD_DST 0x00000002
  241. #define __PERMEDIA_CONFIG_PACKED_DATA 0x00000004
  242. #define __PERMEDIA_CONFIG_FBWRITE 0x00000008
  243. #define __PERMEDIA_CONFIG_COLOR_DDA 0x00000010
  244. #define __PERMEDIA_CONFIG_LOGICOP(x) (0x00000020 | ((x & 0xF) << 6))
  245. /* Antialias */
  246. #define __PERMEDIA_COLOR_MODE_RGBA 0
  247. #define __PERMEDIA_COLOR_MODE_CI 1
  248. /* Alpha Blend */
  249. #define __PERMEDIA_BLEND_FUNC_ZERO 0
  250. #define __PERMEDIA_BLEND_FUNC_ONE 1
  251. #define __PERMEDIA_BLEND_FUNC_SRC_ALPHA 4
  252. #define __PERMEDIA_BLEND_FUNC_ONE_MINUS_SRC_ALPHA 5
  253. #define __PERMEDIA_BLENDOP_ONE_AND_ONE 0x11
  254. #define __PERMEDIA_BLENDOP_SRCALPHA_AND_INVSRCALPHA 0x54
  255. #define __PERMEDIA_BLENDOP_ONE_AND_INVSRCALPHA 0x51
  256. #define __PERMEDIA_BLENDOP_ONE_AND_ZERO 0x01
  257. /* Dither */
  258. #define __PERMEDIA_COLOR_FORMAT_RGBA_8888 0
  259. #define __PERMEDIA_COLOR_FORMAT_RGBA_5555 1
  260. #define __PERMEDIA_COLOR_FORMAT_RGBA_4444 2
  261. #define __PERMEDIA_COLOR_FORMAT_RGBA_4444_FRONT 3
  262. #define __PERMEDIA_COLOR_FORMAT_RGBA_4444_BACK 4
  263. #define __PERMEDIA_COLOR_FORMAT_RGB_332_FRONT 5
  264. #define __PERMEDIA_COLOR_FORMAT_RGB_332_BACK 6
  265. #define __PERMEDIA_COLOR_FORMAT_RGB_121_FRONT 7
  266. #define __PERMEDIA_COLOR_FORMAT_RGB_121_BACK 8
  267. #define __PERMEDIA_COLOR_FORMAT_CI_8 14
  268. #define __PERMEDIA_COLOR_FORMAT_CI_4 15
  269. #define __PERMEDIA_COLOR_ORDER_BGR 0
  270. #define __PERMEDIA_COLOR_ORDER_RGB 1
  271. /* Logical Ops/Write mask */
  272. #define K_LOGICOP_CLEAR 0
  273. #define K_LOGICOP_AND 1
  274. #define K_LOGICOP_AND_REVERSE 2
  275. #define K_LOGICOP_COPY 3
  276. #define K_LOGICOP_AND_INVERTED 4
  277. #define K_LOGICOP_NOOP 5
  278. #define K_LOGICOP_XOR 6
  279. #define K_LOGICOP_OR 7
  280. #define K_LOGICOP_NOR 8
  281. #define K_LOGICOP_EQUIV 9
  282. #define K_LOGICOP_INVERT 10
  283. #define K_LOGICOP_OR_REVERSE 11
  284. #define K_LOGICOP_COPY_INVERT 12
  285. #define K_LOGICOP_OR_INVERT 13
  286. #define K_LOGICOP_NAND 14
  287. #define K_LOGICOP_SET 15
  288. #define __PERMEDIA_ALL_WRITEMASKS_SET 0xFFFFFFFF
  289. /* FB Write */
  290. #define __PERMEDIA_BLOCK_WIDTH_8 0
  291. #define __PERMEDIA_BLOCK_WIDTH_16 1
  292. #define __PERMEDIA_BLOCK_WIDTH_32 2
  293. /*-----------------------------------------------------*/
  294. #define __PERMEDIA_3D_CONTEXT 1
  295. #define __PERMEDIA_2D_CONTEXT 2
  296. #define __PERMEDIA_ALPHA_FUNC_SCALE 255.0
  297. #define __PERMEDIA_MIN_SUB_SCAN_LINES 4
  298. #define __PERMEDIA_MAX_SUB_SCAN_LINES 8
  299. /* converts diameter into number of subscanlines in radius */
  300. #define __PERMEDIA_FASTEST_SMOOTH_POINT_RADIUS (__PERMEDIA_MIN_SUB_SCAN_LINES >> 1)
  301. #define __PERMEDIA_NICEST_SMOOTH_POINT_RADIUS (__PERMEDIA_MAX_SUB_SCAN_LINES >> 1)
  302. #define __PERMEDIA_POINT_TABLE_LONGS 4
  303. #define __PERMEDIA_MAX_PPC_ENTRIES 3
  304. #define __PERMEDIA_PPCODE0_SHIFT 0
  305. #define __PERMEDIA_PPCODE1_SHIFT 5
  306. #define __PERMEDIA_PPCODE2_SHIFT 6
  307. #define __PERMEDIA_PPCODE3_SHIFT 7
  308. #define __PERMEDIA_PPCODE4_SHIFT 8
  309. #define __PERMEDIA_PPCODE5_SHIFT 9
  310. #define __PERMEDIA_PPCODE6_SHIFT 10
  311. #define __PERMEDIA_PPCODE7_SHIFT 11
  312. // Tags
  313. // group 0
  314. #define __Permedia2TagStartXDom 0
  315. #define __Permedia2TagdXDom 0x1
  316. #define __Permedia2TagStartXSub 0x2
  317. #define __Permedia2TagdXSub 0x3
  318. #define __Permedia2TagStartY 0x4
  319. #define __Permedia2TagdY 0x5
  320. #define __Permedia2TagCount 0x6
  321. #define __Permedia2TagRender 0x7
  322. #define __Permedia2TagContinueNewLine 0x8
  323. #define __Permedia2TagContinueNewDom 0x9
  324. #define __Permedia2TagContinueNewSub 0xa
  325. #define __Permedia2TagContinue 0xb
  326. #define __Permedia2TagBitMaskPattern 0xd
  327. // group 1
  328. #define __Permedia2TagRasterizerMode 0x14
  329. #define __Permedia2TagYLimits 0x15
  330. #define __Permedia2TagWaitForCompletion 0x17
  331. #define __Permedia2TagXLimits 0x19
  332. #define __Permedia2TagRectangleOrigin 0x1a
  333. #define __Permedia2TagRectangleSize 0x1b
  334. //group 2
  335. #define __Permedia2TagPackedDataLimits 0x2a
  336. //group 3
  337. #define __Permedia2TagScissorMode 0x30
  338. #define __Permedia2TagScissorMinXY 0x31
  339. #define __Permedia2TagScissorMaxXY 0x32
  340. #define __Permedia2TagScreenSize 0x33
  341. #define __Permedia2TagAreaStippleMode 0x34
  342. #define __Permedia2TagWindowOrigin 0x39
  343. // group 4
  344. #define __Permedia2TagAreaStipplePattern0 0x40
  345. #define __Permedia2TagAreaStipplePattern1 0x41
  346. #define __Permedia2TagAreaStipplePattern2 0x42
  347. #define __Permedia2TagAreaStipplePattern3 0x43
  348. #define __Permedia2TagAreaStipplePattern4 0x44
  349. #define __Permedia2TagAreaStipplePattern5 0x45
  350. #define __Permedia2TagAreaStipplePattern6 0x46
  351. #define __Permedia2TagAreaStipplePattern7 0x47
  352. // group 7
  353. #define __Permedia2TagTextureAddressMode 0x70
  354. #define __Permedia2TagSStart 0x71
  355. #define __Permedia2TagdSdx 0x72
  356. #define __Permedia2TagdSdyDom 0x73
  357. #define __Permedia2TagTStart 0x74
  358. #define __Permedia2TagdTdx 0x75
  359. #define __Permedia2TagdTdyDom 0x76
  360. #define __Permedia2TagQStart 0x77
  361. #define __Permedia2TagdQdx 0x78
  362. #define __Permedia2TagdQdyDom 0x79
  363. // group 9
  364. #define __Permedia2TagTexelLUTIndex 0x98
  365. #define __Permedia2TagTexelLUTData 0x99
  366. #define __Permedia2TagTexelLUTAddress 0x9a
  367. #define __Permedia2TagTexelLUTTransfer 0x9b
  368. // group b
  369. #define __Permedia2TagTextureBaseAddress 0xb0
  370. #define __Permedia2TagTextureMapFormat 0xb1
  371. #define __Permedia2TagTextureDataFormat 0xb2
  372. // group c
  373. #define __Permedia2TagTexel0 0xc0
  374. #define __Permedia2TagTextureReadMode 0xce
  375. #define __Permedia2TagTexelLUTMode 0xcf
  376. // group d
  377. #define __Permedia2TagTextureColorMode 0xd0
  378. #define __Permedia2TagFogMode 0xd2
  379. #define __Permedia2TagFogColor 0xd3
  380. #define __Permedia2TagFStart 0xd4
  381. #define __Permedia2TagdFdx 0xd5
  382. #define __Permedia2TagdFdyDom 0xd6
  383. #define __Permedia2TagKsStart 0xd9
  384. #define __Permedia2TagdKsdx 0xda
  385. #define __Permedia2TagdKsdyDom 0xdb
  386. #define __Permedia2TagKdStart 0xdc
  387. #define __Permedia2TagdKddx 0xdd
  388. #define __Permedia2TagdKddyDom 0xde
  389. // group f
  390. #define __Permedia2TagRStart 0xf0
  391. #define __Permedia2TagdRdx 0xf1
  392. #define __Permedia2TagdRdyDom 0xf2
  393. #define __Permedia2TagGStart 0xf3
  394. #define __Permedia2TagdGdx 0xf4
  395. #define __Permedia2TagdGdyDom 0xf5
  396. #define __Permedia2TagBStart 0xf6
  397. #define __Permedia2TagdBdx 0xf7
  398. #define __Permedia2TagdBdyDom 0xf8
  399. #define __Permedia2TagAStart 0xf9
  400. #define __Permedia2TagColorDDAMode 0xfc
  401. #define __Permedia2TagConstantColor 0xfd
  402. #define __Permedia2TagColor 0xfe
  403. // group 0x10
  404. #define __Permedia2TagAlphaBlendMode 0x102
  405. #define __Permedia2TagDitherMode 0x103
  406. #define __Permedia2TagFBSoftwareWriteMask 0x104
  407. #define __Permedia2TagLogicalOpMode 0x105
  408. // undocumented reg:
  409. #define __Permedia2TagFBWriteData 0x106
  410. // group 0x11
  411. #define __Permedia2TagLBReadMode 0x110
  412. #define __Permedia2TagLBReadFormat 0x111
  413. #define __Permedia2TagLBSourceOffset 0x112
  414. #define __Permedia2TagLBData 0x113
  415. #define __Permedia2TagLBStencil 0x115
  416. #define __Permedia2TagLBDepth 0x116
  417. #define __Permedia2TagLBWindowBase 0x117
  418. #define __Permedia2TagLBWriteMode 0x118
  419. #define __Permedia2TagLBWriteFormat 0x119
  420. #define __Permedia2TagTextureData 0x11d
  421. #define __Permedia2TagTextureDownloadOffset 0x11e
  422. //group 0x13
  423. #define __Permedia2TagWindow 0x130
  424. #define __Permedia2TagStencilMode 0x131
  425. #define __Permedia2TagStencilData 0x132
  426. #define __Permedia2TagStencil 0x133
  427. #define __Permedia2TagDepthMode 0x134
  428. #define __Permedia2TagDepth 0x135
  429. #define __Permedia2TagZStartU 0x136
  430. #define __Permedia2TagZStartL 0x137
  431. #define __Permedia2TagdZdxU 0x138
  432. #define __Permedia2TagdZdxL 0x139
  433. #define __Permedia2TagdZdyDomU 0x13a
  434. #define __Permedia2TagdZdyDomL 0x13b
  435. // group 0x15
  436. #define __Permedia2TagFBReadMode 0x150
  437. #define __Permedia2TagFBSourceOffset 0x151
  438. #define __Permedia2TagFBPixelOffset 0x152
  439. #define __Permedia2TagFBColor 0x153
  440. #define __Permedia2TagFBData 0x154
  441. #define __Permedia2TagFBSourceData 0x155
  442. #define __Permedia2TagFBWindowBase 0x156
  443. #define __Permedia2TagFBWriteMode 0x157
  444. #define __Permedia2TagFBHardwareWriteMask 0x158
  445. #define __Permedia2TagFBBlockColor 0x159
  446. #define __Permedia2TagFBReadPixel 0x15a
  447. // undocumented register, but used (see packed blt)
  448. #define __Permedia2TagFBWriteConfig 0x15d
  449. // group 0x18
  450. #define __Permedia2TagFilterMode 0x180
  451. #define __Permedia2TagStatisticMode 0x181
  452. #define __Permedia2TagMinRegion 0x182
  453. #define __Permedia2TagMaxRegion 0x183
  454. #define __Permedia2TagResetPickResult 0x184
  455. #define __Permedia2TagMinHitRegion 0x185
  456. #define __Permedia2TagMaxHitRegion 0x186
  457. #define __Permedia2TagPickResult 0x187
  458. #define __Permedia2TagSync 0x188
  459. #define __Permedia2TagFBBlockColorU 0x18d
  460. #define __Permedia2TagFBBlockColorL 0x18e
  461. #define __Permedia2TagSuspendUntilFrameBlank 0x18f
  462. // group 0x1b
  463. #define __Permedia2TagFBSourceBase 0x1b0
  464. #define __Permedia2TagFBSourceDelta 0x1b1
  465. #define __Permedia2TagConfig 0x1b2
  466. // group 0x1d
  467. #define __Permedia2TagTexelLUT0 0x1d0
  468. #define __Permedia2TagTexelLUT1 0x1d1
  469. #define __Permedia2TagTexelLUT2 0x1d2
  470. #define __Permedia2TagTexelLUT3 0x1d3
  471. #define __Permedia2TagTexelLUT4 0x1d4
  472. #define __Permedia2TagTexelLUT5 0x1d5
  473. #define __Permedia2TagTexelLUT6 0x1d6
  474. #define __Permedia2TagTexelLUT7 0x1d7
  475. #define __Permedia2TagTexelLUT8 0x1d8
  476. #define __Permedia2TagTexelLUT9 0x1d9
  477. #define __Permedia2TagTexelLUT10 0x1da
  478. #define __Permedia2TagTexelLUT11 0x1db
  479. #define __Permedia2TagTexelLUT12 0x1dc
  480. #define __Permedia2TagTexelLUT13 0x1dd
  481. #define __Permedia2TagTexelLUT14 0x1de
  482. #define __Permedia2TagTexelLUT15 0x1df
  483. // group 0x1e
  484. #define __Permedia2TagYUVMode 0x1e0
  485. #define __Permedia2TagChromaUpperBound 0x1e1
  486. #define __Permedia2TagChromaLowerBound 0x1e2
  487. #define __Permedia2TagAlphaMapUpperBound 0x1e3
  488. #define __Permedia2TagAlphaMapLowerBound 0x1e4
  489. #define __Permedia2TagTextureID 0x1ee
  490. #define __Permedia2TagTexelLUTID 0x1ef
  491. // group 0x20..
  492. #define __Permedia2TagV0FixedS 0x200
  493. #define __Permedia2TagV0FixedT 0x201
  494. #define __Permedia2TagV0FixedQ 0x202
  495. #define __Permedia2TagV0FixedKs 0x203
  496. #define __Permedia2TagV0FixedKd 0x204
  497. #define __Permedia2TagV0FixedR 0x205
  498. #define __Permedia2TagV0FixedG 0x206
  499. #define __Permedia2TagV0FixedB 0x207
  500. #define __Permedia2TagV0FixedA 0x208
  501. #define __Permedia2TagV0FixedF 0x209
  502. #define __Permedia2TagV0FixedX 0x20a
  503. #define __Permedia2TagV0FixedY 0x20b
  504. #define __Permedia2TagV0FixedZ 0x20c
  505. #define __Permedia2TagV0FixedW 0x20d
  506. #define __Permedia2TagV1FixedS 0x210
  507. #define __Permedia2TagV1FixedT 0x211
  508. #define __Permedia2TagV1FixedQ 0x212
  509. #define __Permedia2TagV1FixedKs 0x213
  510. #define __Permedia2TagV1FixedKd 0x214
  511. #define __Permedia2TagV1FixedR 0x215
  512. #define __Permedia2TagV1FixedG 0x216
  513. #define __Permedia2TagV1FixedB 0x217
  514. #define __Permedia2TagV1FixedA 0x218
  515. #define __Permedia2TagV1FixedF 0x219
  516. #define __Permedia2TagV1FixedX 0x21a
  517. #define __Permedia2TagV1FixedY 0x21b
  518. #define __Permedia2TagV1FixedZ 0x21c
  519. #define __Permedia2TagV1FixedW 0x21d
  520. #define __Permedia2TagV2FixedS 0x220
  521. #define __Permedia2TagV2FixedT 0x221
  522. #define __Permedia2TagV2FixedQ 0x222
  523. #define __Permedia2TagV2FixedKs 0x223
  524. #define __Permedia2TagV2FixedKd 0x224
  525. #define __Permedia2TagV2FixedR 0x225
  526. #define __Permedia2TagV2FixedG 0x226
  527. #define __Permedia2TagV2FixedB 0x227
  528. #define __Permedia2TagV2FixedA 0x228
  529. #define __Permedia2TagV2FixedF 0x229
  530. #define __Permedia2TagV2FixedX 0x22a
  531. #define __Permedia2TagV2FixedY 0x22b
  532. #define __Permedia2TagV2FixedZ 0x22c
  533. #define __Permedia2TagV2FixedW 0x22d
  534. #define __Permedia2TagV0FloatS 0x230
  535. #define __Permedia2TagV0FloatT 0x231
  536. #define __Permedia2TagV0FloatQ 0x232
  537. #define __Permedia2TagV0FloatKs 0x233
  538. #define __Permedia2TagV0FloatKd 0x234
  539. #define __Permedia2TagV0FloatR 0x235
  540. #define __Permedia2TagV0FloatG 0x236
  541. #define __Permedia2TagV0FloatB 0x237
  542. #define __Permedia2TagV0FloatA 0x238
  543. #define __Permedia2TagV0FloatF 0x239
  544. #define __Permedia2TagV0FloatX 0x23a
  545. #define __Permedia2TagV0FloatY 0x23b
  546. #define __Permedia2TagV0FloatZ 0x23c
  547. #define __Permedia2TagV0FloatW 0x23d
  548. #define __Permedia2TagV1FloatS 0x240
  549. #define __Permedia2TagV1FloatT 0x241
  550. #define __Permedia2TagV1FloatQ 0x242
  551. #define __Permedia2TagV1FloatKs 0x243
  552. #define __Permedia2TagV1FloatKd 0x244
  553. #define __Permedia2TagV1FloatR 0x245
  554. #define __Permedia2TagV1FloatG 0x246
  555. #define __Permedia2TagV1FloatB 0x247
  556. #define __Permedia2TagV1FloatA 0x248
  557. #define __Permedia2TagV1FloatF 0x249
  558. #define __Permedia2TagV1FloatX 0x24a
  559. #define __Permedia2TagV1FloatY 0x24b
  560. #define __Permedia2TagV1FloatZ 0x24c
  561. #define __Permedia2TagV1FloatW 0x24d
  562. #define __Permedia2TagV2FloatS 0x250
  563. #define __Permedia2TagV2FloatT 0x251
  564. #define __Permedia2TagV2FloatQ 0x252
  565. #define __Permedia2TagV2FloatKs 0x253
  566. #define __Permedia2TagV2FloatKd 0x254
  567. #define __Permedia2TagV2FloatR 0x255
  568. #define __Permedia2TagV2FloatG 0x256
  569. #define __Permedia2TagV2FloatB 0x257
  570. #define __Permedia2TagV2FloatA 0x258
  571. #define __Permedia2TagV2FloatF 0x259
  572. #define __Permedia2TagV2FloatX 0x25a
  573. #define __Permedia2TagV2FloatY 0x25b
  574. #define __Permedia2TagV2FloatZ 0x25c
  575. #define __Permedia2TagV2FloatW 0x25d
  576. #define __Permedia2TagDeltaMode 0x260
  577. #define __Permedia2TagDrawTriangle 0x261
  578. #define __Permedia2TagRepeatTriangle 0x262
  579. #define __Permedia2TagDrawLine01 0x263
  580. #define __Permedia2TagDrawLine10 0x264
  581. #define __Permedia2TagRepeatLine 0x265
  582. // special define???
  583. // #define __Permedia2TagBroadcastMask 0x26f
  584. // #define __MaximumPermediaTagValue __Permedia2TagBroadcastMask
  585. #define __Permedia2TagAreaStipplePattern(i) (0x040+(i))
  586. typedef long __Permedia2Tag ;
  587. /*-----------------------------------------------------*/
  588. #define __PERMEDIA_MAX_YSAMPLES 8
  589. #define __PERMEDIA_SAMPLES 4
  590. #if __PERMEDIA_SAMPLES == 8
  591. #define __PERMEDIA_SUBSAMPLES 64
  592. #define __PERMEDIA_XSUBSAMPLES 8
  593. #define __PERMEDIA_YSUBSAMPLES 8
  594. #define __PERMEDIA_COLOR_SCALE 4
  595. #define __PERMEDIA_SAMPLENORM 0.015625
  596. #define __PERMEDIA_SPANNORM 0.125
  597. #define __PERMEDIA_XSUBPIXSCALE 8
  598. #define __PERMEDIA_XSUBPIXBITS 3
  599. #define __PERMEDIA_XSUBPIXSHIFT 3
  600. #define __PERMEDIA_XSUBPIXMASK 7
  601. #define __PERMEDIA_XFRACSHIFT 0
  602. #define __PERMEDIA_YSUBPIXSCALE __PERMEDIA_XSUBPIXSCALE
  603. #define __PERMEDIA_YSUBPIXBITS __PERMEDIA_XSUBPIXBITS
  604. #define __PERMEDIA_YSUBPIXSHIFT __PERMEDIA_XSUBPIXSHIFT
  605. #define __PERMEDIA_YSUBPIXMASK __PERMEDIA_XSUBPIXMASK
  606. #elif __PERMEDIA_SAMPLES == 4
  607. #define __PERMEDIA_SUBSAMPLES 16
  608. #define __PERMEDIA_XSUBSAMPLES 4
  609. #define __PERMEDIA_YSUBSAMPLES 4
  610. #define __PERMEDIA_COLOR_SCALE 16
  611. #define __PERMEDIA_SAMPLENORM 0.0625
  612. #define __PERMEDIA_SPANNORM 0.25
  613. #define __PERMEDIA_XSUBPIXSCALE 8
  614. #define __PERMEDIA_XSUBPIXBITS 3
  615. #define __PERMEDIA_XSUBPIXSHIFT 3
  616. #define __PERMEDIA_XSUBPIXMASK 7
  617. #define __PERMEDIA_XFRACSHIFT 1
  618. #define __PERMEDIA_YSUBPIXSCALE 4
  619. #define __PERMEDIA_YSUBPIXBITS 2
  620. #define __PERMEDIA_YSUBPIXSHIFT 2
  621. #define __PERMEDIA_YSUBPIXMASK 3
  622. #elif __PERMEDIA_SAMPLES == 2
  623. "NOT SUPPORTED YET"
  624. #else /* __PERMEDIA_SAMPLES == 1 Alias Case */
  625. #define __PERMEDIA_SUBSAMPLES 1
  626. #define __PERMEDIA_XSUBSAMPLES 1
  627. #define __PERMEDIA_YSUBSAMPLES 1
  628. #define __PERMEDIA_COLOR_SCALE 255
  629. #define __PERMEDIA_SAMPLENORM 1
  630. #define __PERMEDIA_SPANNORM 1
  631. #define __PERMEDIA_XSUBPIXSCALE 8
  632. #define __PERMEDIA_XSUBPIXBITS 3
  633. #define __PERMEDIA_XSUBPIXSHIFT 3
  634. #define __PERMEDIA_XSUBPIXMASK 7
  635. #define __PERMEDIA_XFRACSHIFT 3
  636. #define __PERMEDIA_YSUBPIXSCALE 1
  637. #define __PERMEDIA_YSUBPIXBITS 0
  638. #define __PERMEDIA_YSUBPIXSHIFT 0
  639. #define __PERMEDIA_YSUBPIXMASK ~0
  640. #endif
  641. /*-----------------------------------------------------*/
  642. #define __PERMEDIA_POS_Z_FIXED_PT_SCALE 2147483647.0 /* 2**31 - 1*/
  643. #define __PERMEDIA_NEG_Z_FIXED_PT_SCALE 1073741824.0 /* 2**30 */
  644. #define __PERMEDIA_POS_Z_FIXED_PT_SCALE_RECIP (1.0/2147483647.0)
  645. #define __PERMEDIA_NEG_Z_FIXED_PT_SCALE_RECIP (1.0/1073741824.0)
  646. #define RGB_MODE 1
  647. #define COLOR_MODE 1 /* 0=BGR, 1=RGB */
  648. #define DITHER_XOFFSET 0
  649. #define DITHER_YOFFSET 0
  650. #define DITHER_ENABLE __PERMEDIA_ENABLE
  651. #define MS_BIT_MASK 0x80000000l
  652. // Shifts to enable units
  653. // DepthMode
  654. #define __PERMEDIA_DEPTHMODE_ENABLE 0
  655. #define __PERMEDIA_DEPTHMODE_WRITEMASK 1
  656. #define __PERMEDIA_DEPTHMODE_SOURCEDEPTH 2
  657. #define __PERMEDIA_DEPTHMODE_COMPARISON 4
  658. /* sync_mode definitions for the SuspendUntilFramBlank tag */
  659. #define EXT_VIDEO_WAITFOR_FB 0
  660. #define EXT_VIDEO_IMMEDIATE 1
  661. #define VTG_FRAMEROW_WAITFOR_FB 2
  662. #define VTG_FRAMEROW_IMMEDIATE 3
  663. typedef struct PartialProductCode
  664. {
  665. ULONG cxDelta;
  666. ULONG ulPartialProducts;
  667. }
  668. PPCODE;
  669. extern const PPCODE aPartialProducts[];
  670. #define GET_PPCODE(cxTextureWidth, cxTextureDelta, pp) \
  671. { \
  672. int i = (cxTextureWidth + 31) / 32; \
  673. cxTextureDelta = aPartialProducts[i].cxDelta; \
  674. pp = aPartialProducts[i].ulPartialProducts; \
  675. }
  676. // Color component order
  677. #define INV_COLOR_MODE 0 /* 0=RGB, 1=BGR */
  678. #endif /* _P2DEF_H */