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.

660 lines
22 KiB

  1. //*************************************************************************
  2. //** **
  3. //** AMACH1.H **
  4. //** **
  5. //** Copyright (c) 1993, 1995 ATI Technologies Inc. **
  6. //*************************************************************************
  7. //
  8. // Supplemental definitions and data structures which are independent
  9. // of the ATI accelerator family being used. Mach 8/Mach32 specific
  10. // definitions and structures are in AMACH.H, while Mach 64 specific
  11. // definitions and structures are in AMACHCX.H.
  12. //
  13. // Created the 68800.inc file which includes equates, macros, etc
  14. // from the following include files:
  15. // 8514vesa.inc, vga1regs.inc, m32regs.inc, 8514.inc
  16. //
  17. // supplement structures and values to the 68800 Family.
  18. //
  19. // This is a "C" only file and is NOT derived from any Assembler INC files.
  20. /********************** PolyTron RCS Utilities
  21. $Revision: 1.14 $
  22. $Date: 23 Apr 1996 17:15:20 $
  23. $Author: RWolff $
  24. $Log: S:/source/wnt/ms11/miniport/archive/amach1.h_v $
  25. *
  26. * Rev 1.14 23 Apr 1996 17:15:20 RWolff
  27. * Added new memory types (used by ?T) to memory type enumeration.
  28. *
  29. * Rev 1.13 22 Dec 1995 14:51:10 RWolff
  30. * Added support for Mach 64 GT internal DAC.
  31. *
  32. * Rev 1.12 08 Sep 1995 16:36:00 RWolff
  33. * Added support for AT&T 408 DAC (STG1703 equivalent).
  34. *
  35. * Rev 1.11 28 Jul 1995 14:39:24 RWolff
  36. * Added support for the Mach 64 VT (CT equivalent with video overlay).
  37. *
  38. * Rev 1.10 30 Jan 1995 11:56:54 RWOLFF
  39. * Added support for CT internal DAC.
  40. *
  41. * Rev 1.9 18 Jan 1995 15:38:02 RWOLFF
  42. * Added Chrontel CH8398 to DAC type enumeration.
  43. *
  44. * Rev 1.8 23 Dec 1994 10:48:40 ASHANMUG
  45. * ALPHA/Chrontel-DAC
  46. *
  47. * Rev 1.7 18 Nov 1994 11:49:16 RWOLFF
  48. * Added new DAC type DAC_STG1703. This DAC is equivalent to the STG1702,
  49. * but has its own clock generator. The STG1702/1703 in native mode are
  50. * programmed differently in 24BPP than when they are strapped for
  51. * STG1700 emulation.
  52. *
  53. * Rev 1.6 14 Sep 1994 15:25:54 RWOLFF
  54. * Added "most desirable colour ordering" field to query structure,
  55. * changed RGB<depth>_<order> definitions from enumeration to flags
  56. * that can be used in this field.
  57. *
  58. * Rev 1.5 31 Aug 1994 16:09:02 RWOLFF
  59. * Added support for TVP3026 DAC and 1152x864, removed dead code.
  60. *
  61. * Rev 1.4 19 Aug 1994 17:03:30 RWOLFF
  62. * Added support for Graphics Wonder, SC15026 DAC, and pixel clock
  63. * generator independence.
  64. *
  65. * Rev 1.3 20 May 1994 13:56:42 RWOLFF
  66. * Ajith's change: added field for bus type reported by NT to
  67. * the query structure.
  68. *
  69. * Rev 1.2 12 May 1994 11:15:04 RWOLFF
  70. * Removed redundant definition, added refresh rate to mode table structure.
  71. *
  72. * Rev 1.1 04 May 1994 19:22:58 RWOLFF
  73. * Fix for block write test corrupting the screen when running display applet
  74. *
  75. * Rev 1.0 31 Jan 1994 11:26:48 RWOLFF
  76. * Initial revision.
  77. *
  78. * Rev 1.5 14 Jan 1994 15:17:00 RWOLFF
  79. * Added flag for 1600x1200 mode.
  80. *
  81. * Rev 1.4 15 Dec 1993 15:24:34 RWOLFF
  82. * Added support for SC15021 DAC.
  83. *
  84. * Rev 1.3 30 Nov 1993 18:08:58 RWOLFF
  85. * Renamed definition for Mach 64.
  86. *
  87. * Rev 1.2 05 Nov 1993 13:21:10 RWOLFF
  88. * Added new DAC types and memory sizes.
  89. *
  90. * Rev 1.1 08 Oct 1993 10:59:28 RWOLFF
  91. * Added colour ordering field to mode table.
  92. *
  93. * Rev 1.0 03 Sep 1993 14:26:18 RWOLFF
  94. * Initial revision.
  95. End of PolyTron RCS section *****************/
  96. #ifndef BYTE
  97. typedef unsigned char BYTE;
  98. #endif /* BYTE */
  99. #ifndef WORD
  100. typedef unsigned short WORD;
  101. #endif /* WORD */
  102. #ifndef DWORD
  103. typedef unsigned long DWORD;
  104. #endif /* DWORD */
  105. #ifndef UCHAR
  106. typedef unsigned char UCHAR; /* At least 8 bits, unsigned */
  107. #endif /* UCHAR */
  108. #ifndef BOOL
  109. typedef int BOOL; /* Most efficient Boolean,
  110. compare against zero only! */
  111. #endif /* BOOL */
  112. #ifndef VOID
  113. #define VOID void
  114. #endif /* VOID */
  115. #ifndef PVOID
  116. typedef void *PVOID; /* Generic untyped pointer */
  117. #endif /* PVOID */
  118. // the eeprom i/o port bits are in different locations depending upon
  119. // what bus and what class of accelerator. This does NOT cover VGA class.
  120. struct st_eeprom_data {
  121. WORD iop_out; // I/O port for output
  122. WORD iop_in; // I/O port for input
  123. WORD clock; // clock bit to send data
  124. WORD select; // select eeprom
  125. WORD chipselect; // chip select
  126. WORD addr_size; // Address size (fudge for VGA style)
  127. WORD data_out;
  128. WORD data_in;
  129. VOID (*EEcmd)(); // function to write command to eeprom
  130. WORD (*EEread)(short); // function to read eeprom
  131. };
  132. //-----------------------------------------------------------------------
  133. struct st_crt_mach8_table { // CRT Parameter Tables 11 Words long
  134. WORD control; // NOT in table, is 7,8,9, or 10
  135. WORD info; // VGA or 8514 parm format, clock etc.
  136. BYTE vmode_sel_2;
  137. BYTE vmode_sel_1;
  138. BYTE vmode_sel_4;
  139. BYTE vmode_sel_3;
  140. BYTE h_disp;
  141. BYTE h_total;
  142. BYTE h_sync_wid;
  143. BYTE h_sync_strt;
  144. WORD v_total;
  145. WORD v_disp;
  146. WORD v_sync_strt;
  147. BYTE disp_cntl;
  148. BYTE v_sync_wid;
  149. WORD clock_sel;
  150. WORD resvd;
  151. };
  152. // EEprom layout for the 8514/Ultra adapters. 64 words by 16 bits = 1K size
  153. struct st_ee_8514Ultra {
  154. WORD page_3_2;
  155. WORD page_2_0;
  156. WORD monitor;
  157. WORD vfifo;
  158. WORD clock;
  159. WORD shadow;
  160. WORD display_cntl; // shadow sets 1,2
  161. WORD v_sync_width; // shadow sets 1,2
  162. WORD v_sync_strt2;
  163. WORD v_sync_strt1;
  164. WORD v_display2;
  165. WORD v_display1;
  166. WORD v_total2;
  167. WORD v_total1;
  168. WORD h_sync_width; // shadow sets 1,2
  169. WORD h_sync_strt;
  170. WORD h_display;
  171. WORD h_total;
  172. WORD crc;
  173. // Updated 8514/Ultra adds 800 and 1280 resolutions
  174. WORD ext_vfifo; // 800 and 1280 resolutions
  175. WORD ext_clock;
  176. WORD ext_shadow;
  177. WORD ext_display;
  178. WORD ext_v_sync_width;
  179. WORD v_sync_strt_800;
  180. WORD v_display_800;
  181. WORD v_total_800;
  182. WORD ext_h_sync_width; // shadow sets for 800 and 1280
  183. WORD ext_h_sync_strt;
  184. WORD ext_h_display;
  185. WORD ext_h_total;
  186. WORD custom_mode;
  187. WORD monitor_name[17]; // words 32-48
  188. WORD v_sync_strt_1280; // word 49
  189. WORD v_display_1280; // word 50
  190. WORD v_total_1280; // word 51
  191. };
  192. //-----------------------------------------------------------------------
  193. // EEprom layout for the Graphics Ultra adapters. 64 words by 16 bits = 1K size
  194. // This is the brute forcing of the VGA Wonder and the 8514 chips
  195. // both residing on the same board.
  196. struct st_ee_GraphicsUltra {
  197. WORD eeprom_counter;
  198. WORD mouse;
  199. WORD powerup_mode;
  200. WORD resvd1[2]; // word 3,4
  201. WORD monitor;
  202. WORD resvd2; // word 6
  203. WORD hz640_72;
  204. WORD hz800; // word 8
  205. WORD hz1024;
  206. WORD hz1280;
  207. WORD resvd3[2]; // word 11,12
  208. struct st_crt_mach8_table r640; // CRT parm Table 0 - 640x480 mode
  209. struct st_crt_mach8_table r800; // CRT parm Table 1 - 640x480 mode
  210. struct st_crt_mach8_table r1024; // CRT parm Table 2 - 640x480 mode
  211. struct st_crt_mach8_table r1280; // Table 3 - 1280 OR 132 column text mode
  212. };
  213. //-----------------------------------------------------------------------
  214. // EEprom layout for the 68800 adapters. 128 words by 16 bits = 2K size
  215. struct st_crt_mach32_table { // CRT Parameter Tables 15 Words long
  216. WORD info; // VGA or 8514 parm format, clock etc.
  217. BYTE vmode_sel_2;
  218. BYTE vmode_sel_1;
  219. BYTE vmode_sel_4;
  220. BYTE vmode_sel_3;
  221. BYTE h_disp;
  222. BYTE h_total;
  223. BYTE h_sync_wid;
  224. BYTE h_sync_strt;
  225. WORD v_total;
  226. WORD v_disp;
  227. WORD v_sync_strt;
  228. BYTE disp_cntl;
  229. BYTE v_sync_wid;
  230. WORD clock_sel; // same as st_crt_mach8 to here.
  231. WORD mode_size; // word 10
  232. WORD horz_ovscan;
  233. WORD vert_ovscan;
  234. WORD ov_col_blue; // word 13
  235. WORD ov_col_grn_red; // word 14
  236. };
  237. struct st_ee_68800 {
  238. WORD eeprom_counter;
  239. WORD mouse;
  240. WORD powerup_mode;
  241. WORD ee_rev; // word 3
  242. WORD cm_indices; // word 4
  243. WORD monitor;
  244. WORD aperture; // word 6
  245. WORD hz640_72;
  246. WORD hz800; // word 8
  247. WORD hz1024;
  248. WORD hz1280;
  249. WORD hz1150; // word 11
  250. WORD resvd3; // word 12
  251. // example crt tables, there are many for each resolution
  252. // struct st_crt_mach32_table r640; // CRT parm Table 0 - 640x480 mode
  253. // struct st_crt_mach32_table r800; // CRT parm Table 1 - 640x480 mode
  254. // struct st_crt_mach32_table r1024; // CRT parm Table 2 - 640x480 mode
  255. // struct st_crt_mach32_table r1280; // Table 3 - 1280 OR 132 column text mode
  256. };
  257. //-----------------------------------------------------------------------
  258. //--------------- as defined in \68800\test\services.asm
  259. #define QUERY_GET_SIZE 0 // return query structure size (varying modes)
  260. #define QUERY_LONG 1 // return query structure filled in
  261. #define QUERY_SHORT 2 // return short query
  262. struct query_structure {
  263. short q_sizeof_struct; // size of structure in bytes (including mode tables)
  264. UCHAR q_structure_rev; // structure revision number
  265. UCHAR q_number_modes; // total number of installed modes
  266. short q_mode_offset; // offset to 1st mode table
  267. UCHAR q_sizeof_mode; // size of mode table in bytes
  268. UCHAR q_asic_rev; // gate array revision number
  269. UCHAR q_status_flags; // status flags
  270. UCHAR q_VGA_type; // VGA type (enabled or disabled for now)
  271. UCHAR q_VGA_boundary; // VGA boundary
  272. UCHAR q_memory_size; // total memory size (VGA + accelerator)
  273. UCHAR q_DAC_type; // DAC type
  274. UCHAR q_memory_type; // memory type
  275. UCHAR q_bus_type; // bus type
  276. UCHAR q_monitor_alias; // monitor alias and monitor alias enable
  277. short q_shadow_1; // shadow set 1 state
  278. short q_shadow_2; // shadow set 2 state
  279. short q_aperture_addr; // aperture address
  280. UCHAR q_aperture_cfg; // aperture size
  281. UCHAR q_mouse_cfg; // mouse configuration
  282. UCHAR q_reserved;
  283. short q_desire_x; // selected screen resolution X value
  284. short q_desire_y;
  285. short q_pix_depth; // selected bits per pixel
  286. BYTE *q_bios; // Base address of the BIOS
  287. BOOL q_eeprom; // TRUE if eeprom present
  288. BOOL q_ext_bios_fcn; // TRUE if ATI Extended BIOS fcns present
  289. BOOL q_ignore1280; // TRUE if ignore 1280 table in Mach8 cards
  290. BOOL q_m32_aper_calc; // TRUE if mach32 aperture addr needs Extra Bits.
  291. BOOL q_GraphicsWonder; /* TRUE if this is a Graphics Wonder (restricted Mach 32) */
  292. short q_screen_pitch; // Pixels per display line
  293. UCHAR q_BlockWrite; /* Whether or not block write mode is available */
  294. ULONG q_system_bus_type; // bus type reported by NT
  295. USHORT q_HiColourSupport; /* Colour orders supported for non-paletted modes */
  296. };
  297. // Matches BIOS mode table query function up to and including m_overscan_gr
  298. struct st_mode_table {
  299. short m_x_size; // horizontal screen resolution
  300. short m_y_size; // vertical screen resolution
  301. UCHAR m_pixel_depth; // maximum pixel depth
  302. UCHAR m_status_flags; // status flags
  303. // bit 0: if set, non-linear Y addressing
  304. // bit 1: if set, MUX mode
  305. // bit 2: if set, PCLK/2
  306. short m_reserved;
  307. UCHAR m_vfifo_16; // 16 bpp vfifo depth
  308. UCHAR m_vfifo_24; // 24 bpp vfifo depth
  309. short m_clock_select; // clock select
  310. UCHAR m_h_total; // horizontal total
  311. UCHAR m_h_disp; // horizontal displayed
  312. UCHAR m_h_sync_strt; // horizontal sync start
  313. UCHAR m_disp_cntl; // display control
  314. UCHAR m_h_sync_wid; // horizontal sync width
  315. UCHAR m_v_sync_wid; // vertical sync width
  316. short m_v_total; // vertical total
  317. short m_v_disp; // vertical displayed
  318. short m_v_sync_strt; // vertical sync start
  319. short m_h_overscan; // horizontal overscan configuration
  320. short m_v_overscan; // vertical overscan configuration
  321. short m_overscan_8b; // overscan color for 8 bit and blue
  322. short m_overscan_gr; // overscan color green and red
  323. short enabled; // what frequency is enabled (eeprom 7,8,9,10 or 11)
  324. short control; // clock and control values (CRT table 0)
  325. ULONG ClockFreq; /* Clock frequency (in Hertz) */
  326. short m_screen_pitch; // pixels per display line
  327. WORD ColourDepthInfo; /* Information about colour depth being used */
  328. short Refresh; /* Refresh rate, in hertz */
  329. };
  330. /*
  331. * Masks and flags for the m_clock_select field.
  332. * All the flags will be stripped out when the field
  333. * is ANDed with CLOCK_SEL_STRIP.
  334. */
  335. #define CLOCK_SEL_STRIP 0xFF83 /* AND to remove clock selector/divisor */
  336. #define CLOCK_SEL_MUX 0x0004 /* Use mux mode (2x 8bit pixels in 16 bit path) */
  337. #define CLOCK_SEL_DIVIDED 0x0008 /* Clock frequency for mux mode already divided by 2 */
  338. /*
  339. * Flags to put in query_structure.q_HiColourSupport to show that
  340. * the corresponding colour order is supported.
  341. */
  342. #define RGB16_555 0x0001
  343. #define RGB16_565 0x0002
  344. #define RGB16_655 0x0004
  345. #define RGB16_664 0x0008
  346. #define RGB24_RGB 0x0010
  347. #define RGB24_BGR 0x0020
  348. #define RGB32_RGBx 0x0040
  349. #define RGB32_xRGB 0x0080
  350. #define RGB32_BGRx 0x0100
  351. #define RGB32_xBGR 0x0200
  352. //----- Video Memory details
  353. enum {
  354. VMEM_DRAM_256Kx4 = 0,
  355. VMEM_VRAM_256Kx4_SER512,
  356. VMEM_VRAM_256Kx4_SER256, /* 68800-3 only */
  357. VMEM_DRAM_256Kx16,
  358. VMEM_DRAM_256Kx4_GRAP, /* This and following types on 68800-6 only */
  359. VMEM_VRAM_256Kx4_SPLIT512,
  360. VMEM_VRAM_256Kx16_SPLIT256,
  361. VMEM_GENERIC_DRAM, /* This and following types are for Mach 64 ?T only */
  362. VMEM_EDO_DRAM,
  363. VMEM_BRRAM,
  364. VMEM_SDRAM
  365. };
  366. #define VMEM_VRAM_256Kx16_SER256 VMEM_VRAM_256Kx4_SER256 /* 68800-6 only */
  367. //----- BUS types matches the 68800 CONFIG_STATUS_1.BUS_TYPE
  368. enum { BUS_ISA_16,
  369. BUS_EISA,
  370. BUS_MC_16,
  371. BUS_MC_32,
  372. BUS_LB_386SX,
  373. BUS_LB_386DX,
  374. BUS_LB_486,
  375. BUS_PCI,
  376. BUS_ISA_8
  377. };
  378. //----- RAM DAC details, matches CONFIG_STATUS_1.DACTYPE field
  379. enum { DAC_ATI_68830,
  380. DAC_SIERRA,
  381. DAC_TI34075,
  382. DAC_BT47x,
  383. DAC_BT48x,
  384. DAC_ATI_68860,
  385. DAC_STG1700,
  386. DAC_SC15021,
  387. /*
  388. * DAC types below are for cases where incompatible DAC types
  389. * report the same code in CONFIG_STATUS_1. Since the DAC type
  390. * field is 3 bits and can't grow (bits immediately above and
  391. * below are already assigned), DAC types 8 and above will
  392. * not conflict with reported DAC types but are still legal
  393. * in the query structure's DAC type field (8 bit unsigned integer).
  394. */
  395. DAC_ATT491,
  396. DAC_ATT498,
  397. DAC_SC15026,
  398. /*
  399. * DAC types below are not used on 8514/A-compatible accelerators.
  400. * Subsequent additions must be made AFTER DAC_SC15026.
  401. */
  402. DAC_TVP3026,
  403. DAC_IBM514,
  404. /*
  405. * This DAC is more advanced than the STG1700.
  406. */
  407. DAC_STG1702,
  408. /*
  409. * DAC is equivalent to STG1702, but it has its own clock
  410. * generator which is programmed differently from the one
  411. * normally used on the Mach 64.
  412. */
  413. DAC_STG1703,
  414. /*
  415. * DAC with equivalent capabilities to STG1703, but not a
  416. * drop-in replacement.
  417. */
  418. DAC_CH8398,
  419. /*
  420. * Yet another DAC which is equivalent to STG1703 but which
  421. * is not a drop-in replacement.
  422. */
  423. DAC_ATT408,
  424. /*
  425. * Internal DAC on Mach 64 CT ASIC.
  426. */
  427. DAC_INTERNAL_CT,
  428. /*
  429. * Internal DAC on Mach 64 GT ASIC. This is a CT equivalent
  430. * with built-in multimedia and games functionality.
  431. */
  432. DAC_INTERNAL_GT,
  433. /*
  434. * Internal DAC on Mach 64 VT ASIC. This is a CT equivalent
  435. * with built-in video overlay circuitry.
  436. */
  437. DAC_INTERNAL_VT,
  438. /*
  439. * Size definition for arrays indexed by DAC type (assumes enumerated
  440. * types are zero-based). This must be the LAST entry in the
  441. * DAC type enumeration.
  442. */
  443. HOW_MANY_DACs
  444. };
  445. /*
  446. * Size definition for 8514/A-compatible accelerator arrays indexed by
  447. * DAC type.
  448. */
  449. #define MAX_OLD_DAC DAC_TVP3026
  450. /*
  451. * Possible knowledge states for block write capability.
  452. */
  453. enum {BLOCK_WRITE_UNKNOWN,
  454. BLOCK_WRITE_NO,
  455. BLOCK_WRITE_YES
  456. };
  457. //Monitor Descriptions are in IBM style
  458. #define MONITOR_ID_8514 0x000A
  459. #define MONITOR_ID_8515 0x000B
  460. #define MONITOR_ID_VGA8503 0x000D
  461. #define MONITOR_ID_VGA8513 0x000E
  462. #define MONITOR_ID_VGA8512 0x000E
  463. #define MONITOR_ID_8604 0x0009
  464. #define MONITOR_ID_8507 0x0009
  465. #define MONITOR_ID_NOMON 0x000F
  466. /*
  467. * Give identifiers for the different ATI 8514 Products,
  468. * as used in the ModelNumber field of the HW_DEVICE_EXTENSION
  469. * structure and returned by Mach8_detect().
  470. */
  471. enum { _8514_ULTRA = 1,
  472. GRAPHICS_ULTRA,
  473. MACH32_ULTRA,
  474. MACH64_ULTRA,
  475. IBM_VGA,
  476. WONDER,
  477. IBM_8514,
  478. IBM_XGA,
  479. NO_ATI_ACCEL // No ATI accelerator available
  480. };
  481. /*
  482. * Number of ATI 8514 products available.
  483. */
  484. #define HOW_MANY_8514_PRODS (NO_ATI_ACCEL - _8514_ULTRA) + 1
  485. /*
  486. * Amount of Video RAM installed. The q_memory_size
  487. * field of the query_structure uses these definitions
  488. * rather than holding a count of the number of bytes.
  489. */
  490. enum { VRAM_256k=1,
  491. VRAM_512k,
  492. VRAM_768k,
  493. VRAM_1mb,
  494. VRAM_1_25mb,
  495. VRAM_1_50mb,
  496. VRAM_2mb=8,
  497. VRAM_4mb=16,
  498. VRAM_6mb=24,
  499. VRAM_8mb=32,
  500. VRAM_12mb=48,
  501. VRAM_16mb=64
  502. };
  503. /*
  504. * Define bits for resolutions. The q_status_flags field
  505. * of the query_structure uses these.
  506. */
  507. #define VRES_640x480 0x0001
  508. #define VRES_800x600 0x0002
  509. #define VRES_1024x768 0x0004
  510. #define VRES_1280x1024 0x0008
  511. #define VRES_ALT_1 0x0010 /* Usually 1152x900, 1120x750 */
  512. #define VRES_1152x864 VRES_ALT_1
  513. #define VRES_RESERVED_6 0x0020
  514. #define VRES_RESERVED_7 0x0040
  515. #define VRES_RESERVED_8 0x0080
  516. #define VRES_1600x1200 VRES_ALT_1
  517. /*
  518. * Predefined Video Resolution Modes
  519. */
  520. enum { VRES_UNDEFINED,
  521. VRES_640x480x4,
  522. VRES_640x480x8,
  523. VRES_640x480x16,
  524. VRES_640x480x24,
  525. VRES_640x480x32,
  526. VRES_800x600x4,
  527. VRES_800x600x8,
  528. VRES_800x600x16,
  529. VRES_800x600x24,
  530. VRES_800x600x32,
  531. VRES_1024x768x4,
  532. VRES_1024x768x8,
  533. VRES_1024x768x16,
  534. VRES_1024x768x24,
  535. VRES_1024x768x32,
  536. VRES_1280x1024x4,
  537. VRES_1280x1024x8,
  538. VRES_1280x1024x16,
  539. VRES_1280x1024x24,
  540. VRES_1280x1024x32,
  541. VRES_ALTERNATEx4,
  542. VRES_ALTERNATEx8,
  543. VRES_ALTERNATEx16,
  544. VRES_ALTERNATEx24,
  545. VRES_ALTERNATEx32
  546. };
  547. /*
  548. * Number of predefined video resolution modes.
  549. */
  550. #define HOW_MANY_RES_MODES (VRES_ALTERNATEx32 - VRES_UNDEFINED) + 1
  551. /*
  552. * Numbers used in memory calculations.
  553. */
  554. #define ONE_MEG 1048576L
  555. #define HALF_MEG 524288L
  556. #define QUARTER_MEG 262144L
  557. /*
  558. * Definitions with an underscore in their name will read or write
  559. * a portion of a larger register other than the least significant
  560. * byte or word. Due to limitations in the Lio<function> routines,
  561. * it is not possible to do this by calling (for example) LioInp(port+1).
  562. *
  563. * _HBLW Access the high byte of the low word (16 and 32 bit registers)
  564. * _LBHW Access the low byte of the high word (32 bit registers only)
  565. * _HBHW Access the high byte of the high word (32 bit registers only)
  566. * _HW Access the high word (32 bit registers only)
  567. */
  568. #define INP(port) LioInp(port, 0)
  569. #define INP_HBLW(port) LioInp(port, 1)
  570. #define INP_LBHW(port) LioInp(port, 2)
  571. #define INP_HBHW(port) LioInp(port, 3)
  572. #define INPW(port) LioInpw(port, 0)
  573. #define INPW_HW(port) LioInpw(port, 2)
  574. #define INPD(port) LioInpd(port)
  575. #define OUTP(port, val) LioOutp(port, val, 0)
  576. #define OUTP_HBLW(port, val) LioOutp(port, val, 1)
  577. #define OUTP_LBHW(port, val) LioOutp(port, val, 2)
  578. #define OUTP_HBHW(port, val) LioOutp(port, val, 3)
  579. #define OUTPW(port, val) LioOutpw(port, val, 0)
  580. #define OUTPW_HW(port, val) LioOutpw(port, val, 2)
  581. #define OUTPD(port, val) LioOutpd(port, val)
  582. //********************** end of AMACH1.H ****************************