Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

433 lines
9.8 KiB

  1. /*****************************************************************************
  2. *
  3. * file name: defbind.h
  4. *
  5. ******************************************************************************/
  6. #ifdef __HC303__
  7. #ifdef __ANSI_C__
  8. #define _REGS REGS
  9. /*** Configuration for compatibility with ASM ***/
  10. #pragma Off(Args_in_regs_for_locals);
  11. #else
  12. /*** Configuration for compatibility with ASM ***/
  13. pragma Off(Args_in_regs_for_locals);
  14. #endif /* __ANSI_C__ */
  15. #endif /* __HC303__ */
  16. #ifdef __HC173__
  17. #ifdef __ANSI_C__
  18. #define _REGS REGS
  19. /*** Optimizations turned off ***/
  20. #pragma Off(Optimize_xjmp);
  21. #pragma Off(Optimize_fp);
  22. #pragma Off(Auto_reg_alloc);
  23. #pragma Off(Postpone_arg_pops);
  24. #else
  25. /*** Optimizations turned off ***/
  26. pragma Off(Optimize_xjmp);
  27. pragma Off(Optimize_fp);
  28. pragma Off(Auto_reg_alloc);
  29. pragma Off(Postpone_arg_pops);
  30. #endif /* __ANSI_C__ */
  31. #endif /* __HC173__ */
  32. #ifdef HIGHC162
  33. #define _itoa itoa
  34. #define _strnicmp strnicmp
  35. #define _REGS REGS
  36. #define _int86 int86
  37. #define _inp inp
  38. #define _outp outp
  39. #define _stat stat
  40. #ifdef SCRAP
  41. struct WORDREGS {
  42. unsigned int ax;
  43. unsigned int bx;
  44. unsigned int cx;
  45. unsigned int dx;
  46. unsigned int si;
  47. unsigned int di;
  48. unsigned int cflag;
  49. };
  50. struct BYTEREGS {
  51. unsigned char al, ah, xax[sizeof(int)-2];
  52. unsigned char bl, bh, xbx[sizeof(int)-2];
  53. unsigned char cl, ch, xcx[sizeof(int)-2];
  54. unsigned char dl, dh, xdx[sizeof(int)-2];
  55. };
  56. union REGS {
  57. struct WORDREGS x;
  58. struct BYTEREGS h;
  59. struct BYTEREGS l;
  60. };
  61. struct SREGS {
  62. unsigned short int es;
  63. unsigned short int cs;
  64. unsigned short int ss;
  65. unsigned short int ds;
  66. };
  67. #endif
  68. typedef unsigned int size_t;
  69. extern char * itoa(int, char *, int);
  70. extern int strnicmp(const char *__s1, const char *__s2, size_t __n);
  71. /* extern int int86(int ,union REGS *, union REGS *); */
  72. extern int inp(unsigned int);
  73. extern int outp(unsigned int ,int );
  74. extern stat(char *, struct stat *);
  75. #endif
  76. #ifdef __WATCOMC__
  77. #define _itoa itoa
  78. #define _strnicmp strnicmp
  79. #define _REGS REGS
  80. #define _int86 int386
  81. #define _inp inp
  82. #define _outp outp
  83. #define _stat stat
  84. #define _Far _far
  85. #endif
  86. #ifdef __MICROSOFTC600__
  87. #define _itoa itoa
  88. #define _strnicmp strnicmp
  89. #define _REGS REGS
  90. #define _int86 int86
  91. #define _inp inp
  92. #define _outp outp
  93. #define _stat stat
  94. #define _Far far
  95. #endif
  96. #ifdef WINDOWS
  97. #define _itoa itoa
  98. #define _strnicmp strnicmp
  99. #define _int86 int86
  100. #define _inp inp
  101. #define _outp outp
  102. #define _stat stat
  103. #define _REGS REGS
  104. #define HANDLE word
  105. #define WORD word
  106. typedef char _Far *LPSTR;
  107. #endif
  108. #ifdef OS2
  109. #define _itoa itoa
  110. #define _strnicmp strnicmp
  111. #define HANDLE word
  112. #define WORD word
  113. #endif
  114. #ifdef WINDOWS_NT
  115. #define _REGS REGS
  116. struct EXTDREGS {
  117. unsigned long reax;
  118. unsigned long rebx;
  119. unsigned long recx;
  120. unsigned long redx;
  121. unsigned long resi;
  122. unsigned long redi;
  123. unsigned long recflag;
  124. };
  125. struct WORDREGS {
  126. unsigned short ax;
  127. unsigned short axh;
  128. unsigned short bx;
  129. unsigned short bxh;
  130. unsigned short cx;
  131. unsigned short cxh;
  132. unsigned short dx;
  133. unsigned short dxh;
  134. unsigned short si;
  135. unsigned short sih;
  136. unsigned short di;
  137. unsigned short dih;
  138. unsigned short cflag;
  139. unsigned short cflagh;
  140. };
  141. struct BYTEREGS {
  142. unsigned char al, ah, xax[sizeof(long)-2];
  143. unsigned char bl, bh, xbx[sizeof(long)-2];
  144. unsigned char cl, ch, xcx[sizeof(long)-2];
  145. unsigned char dl, dh, xdx[sizeof(long)-2];
  146. };
  147. union REGS {
  148. struct EXTDREGS e;
  149. struct WORDREGS x;
  150. struct BYTEREGS h;
  151. };
  152. #endif /* #ifdef WINDOWS_NT */
  153. /* RAMDAC type definition */
  154. /*** BEN a revoir ***/
  155. #define BT482 0
  156. #define BT484 90
  157. #define BT485 2
  158. #define SIERRA 92
  159. #define CHAMELEON 93
  160. #define VIEWPOINT 1
  161. #define TVP3026 9
  162. #define PX2085 7
  163. #define TITAN_ID 0xA2681700
  164. #define NB_BOARD_MAX 7
  165. #define NB_CRTC_PARAM 34
  166. #define BINDING_REV 1
  167. #define TITAN_CHIP 0
  168. #define ATLAS_CHIP 1
  169. #define ATHENA_CHIP 2
  170. /* Buffer between the binding and CADDI (400 dword) */
  171. #define BUF_BIND_SIZE 400
  172. #define BLOCK_SIZE 262144 /* 1M of memory (value in dword) */
  173. #define MOUSE_PORT 1
  174. // also in caddi.h
  175. #define CHAR_S 1
  176. #define SHORT_S 2
  177. #define LONG_S 4
  178. #define FLOAT_S 4
  179. #define UINTPTR_S (sizeof(UINT_PTR))
  180. /*** MGA PRODUCT ID ***/
  181. #define MGA_ULT_1M 1
  182. #define MGA_ULT_2M 2
  183. #define MGA_IMP_3M 3
  184. #define MGA_IMP_3M_Z 4
  185. #define MGA_PRO_4M5 5
  186. #define MGA_PRO_4M5_Z 6
  187. #define MGA_PCI_2M 7
  188. #define MGA_PCI_4M 8
  189. /*******************************************************/
  190. /*** DEFINITIONS FOR MGA.INF ***/
  191. #define VERSION_NUMBER 102
  192. #define BIT8 0
  193. #define BIT16 1
  194. #define BITNARROW16 2
  195. #define MONITOR_NA -1
  196. #define MONITOR_NI 0
  197. #define MONITOR_I 1
  198. #define NUMBER_BOARD_MAX 7
  199. #define NUMBER_OF_RES 8
  200. #define NUMBER_OF_ZOOM 3
  201. #define RES640 0
  202. #define RES800 1
  203. #define RES1024 2
  204. #define RES1152 3
  205. #define RES1280 4
  206. #define RES1600 5
  207. #define RESNTSC 6
  208. #define RESPAL 7
  209. /* DISPLAY SUPPORT */
  210. # define DISP_SUPPORT_I 0x01 /* interlace */
  211. # define DISP_SUPPORT_NA 0xa0 /* monitor limited */
  212. # define DISP_SUPPORT_HWL 0xc0 /* hardware limited */
  213. # define DISP_NOT_SUPPORT 0x80
  214. typedef struct
  215. {
  216. word FbPitch;
  217. byte DispType;
  218. byte NumOffScr;
  219. OffScrData *pOffScr; /* pointer to off screen area information */
  220. }HwModeInterlace;
  221. #ifdef __HIGHC__
  222. /** USE packed (i.e. non aligned struct members)
  223. *** because in mvtovid.c we access the struct
  224. *** as an array. Highc1.73 do not aligned members
  225. *** by default but Highc3.03 DO !!!!!!
  226. **/
  227. typedef _packed struct{
  228. char name[26];
  229. unsigned long valeur;
  230. }vid;
  231. #else
  232. typedef struct{
  233. char name[26];
  234. unsigned long valeur;
  235. }vid;
  236. #endif
  237. /*******************************************************/
  238. /* VGA REGISTERS */
  239. #define VGA_SEQ_CLOCKING_MODE 0x1
  240. #define VGA_CRTC_INDEX 0x3d4
  241. #define VGA_CRTC_DATA 0x3d5
  242. #define VGA_HORIZONTAL_DISPLAY_ENABLE_END 0x01
  243. #define VGA_START_ADDRESS_LOW 0x0d
  244. #define VGA_START_ADDRESS_HIGH 0x0c
  245. #define VGA_AUXILIARY_INDEX 0x3de
  246. #define VGA_AUXILIARY_DATA 0x3df
  247. #define VGA_VERTICAL_RETRACE_END 0x11
  248. #define VGA_CPU_PAGE_SELECT 0x09
  249. #define VGA_CRTC_EXTENDED_ADDRESS 0x0a
  250. #define VGA_32K_VIDEO_RAM_PAGE_SELECT 0x0c
  251. #define VGA_INTERLACE_SUPPORT_REGISTER 0x0d
  252. typedef struct
  253. {
  254. char IdString[32]; /* "Matrox MGA Setup file" */
  255. short Revision; /* .inf file revision */
  256. short BoardPtr[NUMBER_BOARD_MAX]; /* offset of board wrt start of file */
  257. /* -1 = board not there */
  258. }header;
  259. typedef struct
  260. {
  261. dword MapAddress; /* board address */
  262. short BitOperation8_16; /* BIT8, BIT16, BITNARROW16 */
  263. char DmaEnable; /* 0 = enable ; 1 = disable */
  264. char DmaChannel; /* channel number. 0 = disabled */
  265. char DmaType; /* 0 = ISA, 1 = B, 2 = C */
  266. char DmaXferWidth; /* 0 = 16, 1 = 32 */
  267. char MonitorName[64]; /* as in MONITORM.DAT file */
  268. short MonitorSupport[NUMBER_OF_RES]; /* NA, NI, I */
  269. short NumVidparm; /* up to 24 vidparm structures */
  270. }general_info;
  271. /* vidparm VideoParam[]; */
  272. typedef struct
  273. {
  274. long PixClock;
  275. short HDisp;
  276. short HFPorch;
  277. short HSync;
  278. short HBPorch;
  279. short HOvscan;
  280. short VDisp;
  281. short VFPorch;
  282. short VSync;
  283. short VBPorch;
  284. short VOvscan;
  285. short OvscanEnable;
  286. short InterlaceEnable;
  287. short HsyncPol; /* 0 : Negative 1 : Positive */
  288. short VsyncPol; /* 0 : Negative 1 : Positive */
  289. }Vidset;
  290. typedef struct
  291. {
  292. short Resolution; /* RES640, RES800 ... RESPAL */
  293. short PixWidth; /* 8, 16, 32 */
  294. Vidset VidsetPar[NUMBER_OF_ZOOM]; /* for zoom X1, X2, X4 */
  295. }Vidparm;
  296. typedef struct {
  297. dword length;
  298. dword hw_diagnostic_result;
  299. dword sw_diagnostic_result;
  300. dword shell_id;
  301. dword shell_id_extension;
  302. dword shell_version;
  303. dword shell_version_extension;
  304. dword shell_start_address;
  305. dword shell_end_address;
  306. dword comm_req_type;
  307. dword comm_req_base_addr_offset;
  308. dword comm_req_length;
  309. dword comm_req_wrptr_addr_offset;
  310. dword comm_req_rdptr_addr_offset;
  311. dword comm_inq_type;
  312. dword comm_inq_base_addr_offset;
  313. dword comm_inq_length;
  314. dword comm_inq_wrptr_addr_offset;
  315. dword comm_inq_rdptr_addr_offset;
  316. dword size_rc;
  317. dword size_light_type_0;
  318. dword size_light_type_1;
  319. dword size_light_type_2;
  320. dword size_light_type_3;
  321. dword size_light_type_4;
  322. dword high_resolution_visible_width;
  323. dword high_resolution_visible_height;
  324. dword ntsc_underscan_visible_width;
  325. dword ntsc_underscan_visible_height;
  326. dword pal_underscan_visible_width;
  327. dword pal_underscan_visible_height;
  328. dword ntsc_overscan_visible_width;
  329. dword ntsc_overscan_visible_height;
  330. dword pal_overscan_visible_width;
  331. dword pal_overscan_visible_height;
  332. byte *end_string;
  333. } SYSPARMS;
  334.