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.

614 lines
22 KiB

  1. /**************************************************************************
  2. ***************************************************************************
  3. *
  4. * Copyright (c) 1996, Cirrus Logic, Inc.
  5. * All Rights Reserved
  6. *
  7. * FILE: l2d.h
  8. *
  9. * DESCRIPTION:
  10. *
  11. * REVISION HISTORY:
  12. *
  13. * $Log: X:/log/laguna/ddraw/inc/L2D.H $
  14. *
  15. * Rev 1.2 03 Oct 1997 14:04:04 RUSSL
  16. * Added hw clip register defines
  17. *
  18. * Rev 1.1 23 Jan 1997 17:16:04 bennyn
  19. *
  20. * Changed the register naming
  21. *
  22. * Rev 1.0 25 Nov 1996 14:59:56 RUSSL
  23. * Initial revision.
  24. *
  25. * Rev 1.1 01 Nov 1996 13:02:46 RUSSL
  26. * Merge WIN95 & WINNT code for Blt32
  27. *
  28. * Rev 1.0 01 Nov 1996 09:28:32 BENNYN
  29. * Initial revision.
  30. *
  31. * Rev 1.0 25 Oct 1996 10:47:56 RUSSL
  32. * Initial revision.
  33. *
  34. ***************************************************************************
  35. ***************************************************************************/
  36. /********************************************************************************
  37. *
  38. * Module: L2D.H Header for 2D portion of the library
  39. *
  40. * Revision: 1.00
  41. *
  42. * Date: 04/10/96
  43. *
  44. * Author: Evan Leland
  45. *
  46. *********************************************************************************
  47. *
  48. * Module Description:
  49. *
  50. * This header file contais structures used in Laguna 2D
  51. * library. This header is accessible to the user?
  52. *
  53. * Note: do not change the values of these defines as some of them
  54. * are hard coded in the hardware
  55. *
  56. *********************************************************************************
  57. *
  58. * Changes:
  59. *
  60. * DATE REV DESCRIPTION OF CHANGES AUTHOR
  61. * -------- ---- ----------------------------------- -----------
  62. * 04/10/96 1.00 Original Evan Leland
  63. * -------- ---- ----------------------------------- -----------
  64. *********************************************************************************/
  65. // If WinNT 3.5 skip all the source code
  66. #if defined WINNT_VER35 // WINNT_VER35
  67. #else
  68. #ifndef _L2D_H_
  69. #define _L2D_H_
  70. //#if 0
  71. //#include "l3d.h" // 3D definitions, functions
  72. //#include "l3system.h" // low-level defs
  73. //
  74. //#define SSA_ARM 1
  75. //#define VGA_FLIP 2
  76. //
  77. //#define misc_vga_ctrl (*(BYTE *)((BYTE *) LL_State.pRegs + 0x001a))
  78. //#define vert_sync_end (*(BYTE *)((BYTE *) LL_State.pRegs + 0x0044))
  79. //#define vert_disp_end (*(BYTE *)((BYTE *) LL_State.pRegs + 0x0048))
  80. //#define vert_blnk_end (*(BYTE *)((BYTE *) LL_State.pRegs + 0x0058))
  81. //#define cur_scnln_reg (*(BYTE *)((BYTE *) LL_State.pRegs + 0x0140))
  82. //#define ssa_reg (*(WORD *)((BYTE *) LL_State.pRegs + 0x0144))
  83. //#define mb_ctrl_reg (*(BYTE *)((BYTE *) LL_State.pRegs + 0x0148))
  84. //#define pf_status_reg (*(DWORD *)((BYTE *) LL_State.pRegs + 0x4424))
  85. //#define host_3d_data_port (*(DWORD *)((BYTE *) LL_State.pRegs + 0x4800))
  86. //
  87. //typedef struct { // the following are cached:
  88. //
  89. // DWORD dwBGcolor; // background color register
  90. // DWORD dwFGcolor; // foreground color register
  91. //
  92. // BYTE bCR1B; // vga extended display controls reg
  93. // BYTE bCR1D; // vga screen start A extension reg
  94. //
  95. // int dPageFlip; // type of double buffering set
  96. //
  97. //} TSystem2D;
  98. //
  99. //typedef enum { BLT_MASTER_IO, BLT_Y15, BLT_LAGUNA1 } blt_type_t;
  100. //
  101. //// temp!
  102. //void LL_DumpRegs();
  103. //
  104. //// constructor, destructor
  105. //BOOL _InitLib_2D(LL_DeviceState *);
  106. //BOOL _CloseLib_2D();
  107. //
  108. //DWORD SetColor_8bit (LL_Color *pColor);
  109. //DWORD SetColor_16bit (LL_Color *pColor);
  110. //DWORD SetColor_15bit (LL_Color *pColor);
  111. //DWORD SetColor_32bit (LL_Color *pColor);
  112. //DWORD SetColor_Z24bit(LL_Color *pColor);
  113. //
  114. //// 2D operations using display list
  115. //DWORD *fnColorFill(DWORD *dwNext, LL_Batch *pBatch);
  116. //DWORD *fnCopyBuffer(DWORD *dwNext, LL_Batch *pBatch);
  117. //DWORD *fnSetDisplayBuffer(DWORD *dwNext, LL_Batch *pBatch);
  118. //DWORD *fnSetRenderBuffer(DWORD *dwNext, LL_Batch *pBatch);
  119. //DWORD *fnSetFGColor(DWORD *dwNext, LL_Batch *pBatch);
  120. //DWORD *fnSetBGColor(DWORD *dwNext, LL_Batch *pBatch);
  121. //DWORD *fnCopyPattern(DWORD *dwNext, LL_Batch *pBatch);
  122. //DWORD *fnMonoToColorExpand(DWORD *dwNext, LL_Batch *pBatch);
  123. //DWORD *fnTransparentBLT(DWORD *dwNext, LL_Batch *pBatch);
  124. //DWORD *fnZFill(DWORD *dwNext, LL_Batch *pBatch);
  125. //DWORD *fnResizeBLT(DWORD *dwNext, LL_Batch *pBatch);
  126. //DWORD *fnWaitForPageFlip(DWORD *dwNext, LL_Batch *pBatch);
  127. //
  128. ////
  129. //// TEMP: 5464 resize data formats
  130. ////
  131. //#define LL_RESIZE_CLUT 0x0
  132. //#define LL_RESIZE_1555 0x1
  133. //#define LL_RESIZE_565 0x2
  134. //#define LL_RESIZE_RGB 0x3
  135. //#define LL_RESIZE_ARGB 0x4
  136. //#define LL_RESIZE_YUV 0x9
  137. //
  138. //#define LL_X_INTERP 0x4
  139. //#define LL_Y_INTERP 0x8
  140. //
  141. //// blt type INTERNAL identifiers
  142. ////
  143. //
  144. //#define LL_BLT_MONO_PATTERN 2
  145. //#define LL_BLT_COLOR_PATTERN 3
  146. //
  147. //#define BLT_SRC_COPY 0
  148. //#define BLT_MONO_EXPAND 1
  149. //#define BLT_MONO_TRANSPARENCY 4
  150. //#define BLT_COLOR_TRANSPARENCY 5
  151. //#define BLT_RESIZE 6
  152. //
  153. //#define BLT_FF 0x0 // blt frame-frame
  154. //#define BLT_HF 0x1 // blt host-frame
  155. //#define BLT_FH 0x2 // blt frame-host
  156. //#define BLT_HH 0x3 // blt host-host
  157. //#endif
  158. //
  159. // 2D register (sub)set
  160. //
  161. #define COMMAND_2D 0x480
  162. //#if 0
  163. //#define CONTROL 0x402
  164. //#define BITMASK 0x5E8
  165. //#define BLTDEF 0x586
  166. //#define DRAWDEF 0x584
  167. //#define LNCNTL 0x50E // name conflicts with autoblt_regs!
  168. //#define STRETCH 0x510
  169. //#define STATUS 0x400
  170. //
  171. #define L2D_OP0_OPRDRAM 0x520
  172. //#define L2D_OP1_OPRDRAM 0x540
  173. //#define L2D_OP2_OPRDRAM 0x560
  174. #define L2D_OP0_OPMRDRAM 0x524
  175. //#define L2D_OP1_OPMRDRAM 0x544
  176. //#define L2D_OP2_OPMRDRAM 0x564
  177. //#define L2D_OP0_OPSRAM 0x528
  178. //#define L2D_OP1_OPSRAM 0x548
  179. //#define L2D_OP2_OPSRAM 0x568
  180. //#define L2D_OP1_OPMSRAM 0x54A
  181. //#define L2D_OP2_OPMSRAM 0x56A
  182. //#define L2D_OP_BGCOLOR 0x5E4
  183. //#define L2D_OP_FGCOLOR 0x5E0
  184. //#endif
  185. #define L2D_CLIPULE 0x590
  186. #define L2D_CLIPLOR 0x594
  187. #define L2D_MCLIPULE 0x598
  188. #define L2D_MCLIPLOR 0x59C
  189. #define L2D_BLTEXT_EX 0x700
  190. #define L2D_MBLTEXT_EX 0x720
  191. //#define BLTEXT_XEX 0x600
  192. #define L2D_BLTEXTR_EX 0x708
  193. #define L2D_MBLTEXTR_EX 0x728
  194. #define L2D_CLIPULE_EX 0x760
  195. #define L2D_CLIPLOR_EX 0x770
  196. #define L2D_MCLIPULE_EX 0x780
  197. #define L2D_MCLIPLOR_EX 0x790
  198. //#if 0
  199. //#define PATOFF 0x52A // name conflicts with autoblt_regs!
  200. //#define SHRINKINC 0x582 // name conflicts with autoblt_regs!
  201. //#define SRCX 0x580 // name conflicts with autoblt_regs!
  202. //#define MAJX 0x50A
  203. //#define MAJY 0x502
  204. //#define MINX 0x508
  205. //#define MINY 0x500
  206. //#define ACCUMX 0x50c
  207. //#define ACCUMY 0x504
  208. //#define ALPHA_AB 0x5e0
  209. //#define CHROMA_CTL 0x512
  210. //#define CHROMA_LOW 0x5f0
  211. //#define CHROMA_UPR 0x5f4
  212. //#define HOSTDATA 0x800
  213. //
  214. //#define OFFSET_2D 0x405
  215. //#define TIMEOUT 0x406
  216. //#define TILE_CTRL 0x407
  217. //#endif
  218. //
  219. // the same 2D registers for use with COMMAND register burst writes
  220. //
  221. #define C_MINY 0x0080
  222. #define C_MAJY 0x0081
  223. #define C_ACCUMY 0x0082
  224. #define C_MINX 0x0084
  225. #define C_MAJX 0x0085
  226. #define C_ACCUMX 0x0086
  227. #define C_LNCNTL 0x0087
  228. #define C_STRCTL 0x0088
  229. #define C_CMPCNTL 0x0089
  230. #define C_RX_0 0x0090
  231. #define C_RY_0 0x0091
  232. #define C_MRX_0 0x0092
  233. #define C_MRY_0 0x0093
  234. #define C_SRAM_0 0x0094
  235. #define C_PATOFF 0x0095
  236. #define C_RX_1 0x00a0
  237. #define C_RY_1 0x00a1
  238. #define C_MRX_1 0x00a2
  239. #define C_MRY_1 0x00a3
  240. #define C_SRAM_1 0x00a4
  241. #define C_MSRAM_1 0x00a5
  242. #define C_RX_2 0x00b0
  243. #define C_RY_2 0x00b1
  244. #define C_MRX_2 0x00b2
  245. #define C_MRY_2 0x00b3
  246. #define C_SRAM_2 0x00b4
  247. #define C_MSRAM_2 0x00b5
  248. #define C_SRCX 0x00c0
  249. #define C_SHINC 0x00c1
  250. #define C_DRWDEF 0x00c2
  251. #define C_BLTDEF 0x00c3
  252. #define C_MONOQW 0x00c4
  253. #define C_BLTX 0x0100
  254. #define C_BLTY 0x0101
  255. #define C_MBLTX 0x0110
  256. #define C_EX_BLT 0x0200
  257. #define C_EX_FBLT 0x0201
  258. #define C_EX_RBLT 0x0202
  259. #define C_EX_LINE 0x0203
  260. #define C_FG_L 0x00f0
  261. #define C_FG_H 0x00f1
  262. #define C_BG_L 0x00f2
  263. #define C_BG_H 0x00f3
  264. #define C_BITMSK_L 0x00f4
  265. #define C_BITMSK_H 0x00f5
  266. #define C_PTAG 0x00f6
  267. #define C_CHROMAL_L 0x00f8
  268. #define C_CHROMAL_H 0x00f9
  269. #define C_CHROMAU_L 0x00fa
  270. #define C_CHROMAU_H 0x00fb
  271. #define C_CLIPULE_X 0x00c8
  272. #define C_CLIPULE_Y 0x00c9
  273. #define C_CLIPLOR_X 0x00ca
  274. #define C_CLIPLOR_Y 0x00cb
  275. #define C_MCLIPULE_X 0x00cc
  276. #define C_MCLIPULE_Y 0x00cd
  277. #define C_MCLIPLOR_X 0x00ce
  278. #define C_MCLIPLOR_Y 0x00cf
  279. #define C_BLTEXT_X 0x008c
  280. #define C_BLTEXT_Y 0x008d
  281. #define C_MBLTEXT_X 0x008e
  282. #define C_MBLTEXT_Y 0x008f
  283. //
  284. // VGA registers
  285. //
  286. #define VGA_REG140 0x0140
  287. #define VGA_SCANLINE_COMPARE 0x0142
  288. #define VGA_SSA_REG 0x0144
  289. #define VGA_MB_CTRL 0x0148
  290. #define VGA_HTOTAL 0x0000
  291. #define VGA_HDISP_END 0x0004
  292. #define VGA_HBLNK_START 0x0008
  293. #define VGA_HBLNK_END 0x000C
  294. #define VGA_HSYNC_START 0x0010
  295. #define VGA_HSYNC_END 0x0014
  296. #define VGA_VTOTAL 0x0018
  297. #define VGA_VDISP_END 0x0048
  298. #define VGA_VBLNK_START 0x0054
  299. #define VGA_VBLNK_END 0x0058
  300. #define VGA_VSYNC_START 0x0040
  301. #define VGA_VSYNC_END 0x0044
  302. #define VGA_SSA_H 0x0030
  303. #define VGA_SSA_L 0x0034
  304. #define VGA_CR1B 0x006C
  305. #define VGA_CR1D 0x0074
  306. #define VGA_PAL_ADDR_READ 0x00A4
  307. #define VGA_PAL_ADDR_WRITE 0x00A8
  308. #define VGA_PIXEL_DATA 0x00AC
  309. #define VGA_CLUT_LOAD 0x009c
  310. #define VGA_CURSOR_PRESET 0x00E4
  311. #define VGA_MISC_CONTROL 0x00e6
  312. #define VGA_CURSOR_ADDR 0x00e8
  313. #define VGA_CURSOR_X 0x00e0
  314. #define VGA_CURSOR_Y 0x00e2
  315. #define VGA_PAL_STATE 0x00b0
  316. #define DTTR 0xEA
  317. #define CONTROL 0x402
  318. //
  319. // host data port: in host data device
  320. //
  321. #define HD_PORT 0x800
  322. //
  323. // 2D versions of some 3D registers shadowed in l3d.h:
  324. // Most register defines are divided by four so that they can be added correctly
  325. // to the global register file pointer, LL_State.pRegs, which is a dword pointer.
  326. // Some 2D operations need these registers defined in their full glory for use
  327. // with write_dev_regs:
  328. ///////////////////////////////////////////////////////
  329. // HostXY Unit Registers - Must use WRITE_DEV_REGS //
  330. ///////////////////////////////////////////////////////
  331. #define HXY_BASE0_ADDRESS_PTR 0x4200
  332. #define HXY_BASE0_START_XY 0x4204
  333. #define HXY_BASE0_EXTENT_XY 0x4208
  334. #define HXY_BASE1_ADDRESS_PTR 0x4210
  335. #define HXY_BASE1_OFFSET0 0x4214
  336. #define HXY_BASE1_OFFSET1 0x4218
  337. #define HXY_BASE1_LENGTH 0x421C
  338. #define HXY_HOST_CTRL 0x4240
  339. //
  340. // Laguna Format 1 instruction useful defines
  341. //
  342. #define DEV_VGAMEM 0x00000000
  343. #define DEV_VGAFB 0x00200000
  344. #define DEV_VPORT 0x00400000
  345. #define DEV_LPB 0x00600000
  346. #define DEV_MISC 0x00800000
  347. #define DEV_ENG2D 0x00A00000
  348. #define DEV_HD 0x00C00000
  349. #define DEV_FB 0x00E00000
  350. #define DEV_ROM 0x01000000
  351. #define DEV_ENG3D 0x01200000
  352. #define DEV_HOSTXY 0x01400000
  353. #define DEV_HOSTDATA 0x01600000
  354. #define F1_ADR_MASK 0x0001FFC0
  355. #define F1_CNT_MASK 0x0000003f
  356. #define F1_STL_MASK 0x04000000
  357. #define F1_ADR_SHIFT 6
  358. #define F1_STL_SHIFT 26
  359. #define F1_BEN_SHIFT 17
  360. #define F1_BEN_MASK 0x001e0000
  361. //
  362. // Laguna Format 2 instruction useful defines
  363. //
  364. #define F2_STL_SHIFT 26
  365. #define F2_ADR_SHIFT 2
  366. #define F2_STL_MASK 0x04000000
  367. #define F2_ADR_MASK 0x003ffffc
  368. #define F2_INC_MASK 0x00000001
  369. //
  370. // Laguna events for Format 4 instructions
  371. //
  372. #define EV_VBLANK 0x00000001
  373. #define EV_EVSYNC 0x00000002
  374. #define EV_LINE_COMPARE 0x00000004
  375. #define EV_BUFFER_SWITCH 0x00000008
  376. #define EV_Z_BUFFER_COMPARE 0x00000010
  377. #define EV_POLY_ENG_NOT_BUSY 0x00000020
  378. #define EV_EXEC_ENG_3D_NOT_BUSY 0x00000040
  379. #define EV_XY_ENG_NOT_BUSY 0x00000080
  380. #define EV_BLT_ENG_NOT_BUSY 0x00000100
  381. #define EV_BLT_WF_NOT_EMPTY 0x00000200
  382. #define EV_DL_READY_STATUS 0x00000400
  383. #define EV_FETCH_MODE 0x00000800
  384. //
  385. // Format 4 masks
  386. //
  387. #define F4_STL_SHIFT 26
  388. #define F4_NOT_MASK 0x01000000
  389. #define F4_STL_MASK 0x04000000
  390. #define F4_EVN_MASK 0x000007ff
  391. //
  392. // Emulator macros for building Laguna operations in display list
  393. //
  394. #define write_dev_regs(dev, ben, adr, cnt, stl) \
  395. (WRITE_DEV_REGS | \
  396. (((stl) << F1_STL_SHIFT) & F1_STL_MASK) | \
  397. (dev) | \
  398. (((ben) << F1_BEN_SHIFT) & F1_BEN_MASK) | \
  399. (((adr) << F1_ADR_SHIFT) & F1_ADR_MASK) | \
  400. ((cnt) & F1_CNT_MASK))
  401. #define read_dev_regs(dev, adr, cnt, stl) \
  402. (READ_DEV_REGS | \
  403. (((stl) << F1_STL_SHIFT) & F1_STL_MASK) | \
  404. (dev) | \
  405. (((adr) << F1_ADR_SHIFT) & F1_ADR_MASK) | \
  406. ((cnt) & F1_CNT_MASK))
  407. #define write_dest_addr(adr, inc, stl) \
  408. (WRITE_DEST_ADDR | \
  409. (((stl) << F2_STL_SHIFT) & F2_STL_MASK) | \
  410. (((adr) << F2_ADR_SHIFT) & F2_ADR_MASK) | \
  411. ((inc) & F2_INC_MASK))
  412. #define wait_3d(evn, stl) \
  413. (WAIT | \
  414. (((stl) << F4_STL_SHIFT) & F4_STL_MASK) | \
  415. ((evn) & F4_EVN_MASK))
  416. #define nwait_3d(evn, stl) \
  417. (WAIT | \
  418. (((stl) << F4_STL_SHIFT) & F4_STL_MASK) | \
  419. F4_NOT_MASK | \
  420. ((evn) & F4_EVN_MASK))
  421. // opcode common to the control instructions
  422. //
  423. #define CONTROL_OPCODE 0x68000000
  424. #define NOP_SUB_OPCODE 0x00800000
  425. #define nop_3d(stl) \
  426. (CONTROL_OPCODE | NOP_SUB_OPCODE | (stl << 26))
  427. //#if 0
  428. //// useful macros:
  429. ////
  430. //// setreg, no cache: do not cache state for this register
  431. ////
  432. //#define SETREGB_NC(reg, value) \
  433. // (*((BYTE *) ((BYTE *) LL_State.pRegs + reg)) = value)
  434. //
  435. //#define SETREGW_NC(reg, value) \
  436. // (*((WORD *) ((BYTE *) LL_State.pRegs + reg)) = value)
  437. //
  438. //#define SETREGD_NC(reg, value) \
  439. // (*((DWORD *) ((BYTE *) LL_State.pRegs + reg)) = value)
  440. //
  441. //#define SETREG_3D(reg, value) \
  442. // (*((DWORD *) (LL_State.pRegs + reg)) = value)
  443. //
  444. //// set 2d reg with cache
  445. ////
  446. //#define SETREGD_2D(offset, reg, value) \
  447. // (*((DWORD *) ((BYTE *) LL_State.pRegs + (offset))) = LL_State2D.reg = (value))
  448. //
  449. //// wait for events in coprocessor mode
  450. ////
  451. //#if 0
  452. //#define wait_and_3d(event) \
  453. // { \
  454. // DWORD status; \
  455. // while ((status = (*((DWORD *)LL_State.pRegs + PF_STATUS_3D)) & event)) {}; \
  456. // }
  457. //#else
  458. //#define wait_and_3d(event) \
  459. // { \
  460. // while ((*((DWORD *)LL_State.pRegs + PF_STATUS_3D)) & event) {}; \
  461. // }
  462. //#endif
  463. //
  464. //#define host_host(src, dst) \
  465. // ((src->dwFlags & BUFFER_IN_SYSTEM) && \
  466. // (dst->dwFlags & BUFFER_IN_SYSTEM))
  467. //
  468. //#define host_frame(src, dst) \
  469. // ((src->dwFlags & BUFFER_IN_SYSTEM) && \
  470. // !(dst->dwFlags & BUFFER_IN_SYSTEM))
  471. //
  472. //#define frame_host(src, dst) \
  473. // (!(src->dwFlags & BUFFER_IN_SYSTEM) && \
  474. // (dst->dwFlags & BUFFER_IN_SYSTEM))
  475. //
  476. //#define frame_frame(src, dst) \
  477. // (!(src->dwFlags & BUFFER_IN_SYSTEM) && \
  478. // !(dst->dwFlags & BUFFER_IN_SYSTEM))
  479. //
  480. //#define GetColor(pixel_mode, pColor, which) \
  481. // switch (pixel_mode) \
  482. // { \
  483. // case PIXEL_MODE_332: \
  484. // pColor->r = LL_State2D.which & 0xe0; \
  485. // pColor->g = (LL_State2D.which & 0x1c) << 3; \
  486. // pColor->b = (LL_State2D.which & 0x02) << 6; \
  487. // break; \
  488. // case PIXEL_MODE_555: \
  489. // pColor->r = (LL_State2D.which & 0x7c00) >> 7; \
  490. // pColor->g = (LL_State2D.which & 0x03e0) >> 2; \
  491. // pColor->b = (LL_State2D.which & 0x001f) << 3; \
  492. // break; \
  493. // case PIXEL_MODE_565: \
  494. // pColor->r = (LL_State2D.which & 0xf800) >> 8; \
  495. // pColor->g = (LL_State2D.which & 0x07e0) >> 3; \
  496. // pColor->b = (LL_State2D.which & 0x001f) << 3; \
  497. // break; \
  498. // case PIXEL_MODE_A888: \
  499. // case PIXEL_MODE_Z888: \
  500. // pColor->r = (LL_State2D.which & 0xff0000) >> 16; \
  501. // pColor->g = (LL_State2D.which & 0x00ff00) >> 8; \
  502. // pColor->b = (LL_State2D.which & 0x0000ff); \
  503. // break; \
  504. // default: \
  505. // pColor->r = 0; \
  506. // pColor->g = 0; \
  507. // pColor->b = 0; \
  508. // break; \
  509. // }
  510. //
  511. //#define blt_buf_set_bpp(pBuf, bpp) \
  512. // if (pBuf == LL_State.pBufZ) \
  513. // { \
  514. // bpp = LL_State.Control0.Z_Stride_Control ? 8 : 16; \
  515. // } \
  516. // else \
  517. // { \
  518. // bpp = LL_State.wBpp; \
  519. // }
  520. //
  521. //#define blt_buf_set_pix_mode(pBuf, pmode) \
  522. // if (pBuf == LL_State.pBufZ) \
  523. // { \
  524. // pmode = LL_State.Control0.Z_Stride_Control ? \
  525. // PIXEL_MODE_332 : PIXEL_MODE_565; \
  526. // } \
  527. // else \
  528. // { \
  529. // pmode = LL_State.Control0.Pixel_Mode; \
  530. // }
  531. //
  532. //// pixels per dword
  533. ////
  534. //#define px_per_dw(bpp) (32 / (bpp))
  535. //
  536. //// bytes per pixel ... NOTE: don't use with 1 bpp!!
  537. ////
  538. //#define by_per_px(bpp) (bpp / 8)
  539. //
  540. //#define set_color(color, _r, _g, _b) \
  541. // color.r = _r; \
  542. // color.g = _g; \
  543. // color.b = _b;
  544. //
  545. //#define set_vert(vert, _x, _y) \
  546. // vert.x = _x; \
  547. // vert.y = _y;
  548. //
  549. //#define set_rect(rect, x1, y1, x2, y2) \
  550. // rect.left = x1; \
  551. // rect.top = y1; \
  552. // rect.right = x2; \
  553. // rect.bottom = y2;
  554. //
  555. //#define print_2d_status(i) \
  556. // printf("status register %d: %04x\n", i, *(WORD *)((BYTE *)LL_State.pRegs + STATUS))
  557. //
  558. //#define get_2d_status() \
  559. // (* (WORD *) ( (BYTE *) LL_State.pRegs + STATUS ) )
  560. //#endif
  561. #endif // _L2D_H_
  562. #endif // WINNT_VER35