Windows NT 4.0 source code leak
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.

319 lines
9.6 KiB

4 years ago
  1. //==========================================================================
  2. //
  3. // Definitions from findpas.h (card searching)
  4. //
  5. // 01-28-93 KJB First.
  6. // 03-19-93 JAP Implemented condition build FAR and NEAR pointers
  7. //==========================================================================
  8. typedef struct {
  9. USHORT wBoardRev;
  10. USHORT wChipRev;
  11. union
  12. {
  13. struct /* Our PAS_16 gives */
  14. {
  15. unsigned long CDInterfaceType:2; /* 3 */
  16. unsigned long EnhancedSCSI:1; /* 0 - not enhanced SCSI*/
  17. unsigned long DAC16:1; /* 1 DAC16 */
  18. unsigned long OPL_3:1; /* 1 OPL3 */
  19. unsigned long Mixer_508:1; /* 1 Mixer 508 */
  20. unsigned long DualDAC:1; /* 1 Dual DAC */
  21. unsigned long MPU401:1; /* 0 NO mpu401 */
  22. unsigned long Slot16:1; /* 1 - slot 16 */
  23. unsigned long MCA:1; /* 0 - not MCA */
  24. unsigned long CDPC:1; /* 0 - not CDPC */
  25. unsigned long SoundBlaster:1; /* 1 - sound blaster */
  26. unsigned long SCSI_IO_16:1; /* 1 - ? */
  27. unsigned long reserved:2;
  28. unsigned long Did_HW_Init:1; /* 0 - ? */
  29. unsigned long unused:16;
  30. } CapsBits;
  31. ULONG dwCaps;
  32. } Caps;
  33. ULONG ProPort;
  34. UCHAR ProDMA;
  35. UCHAR ProIRQ;
  36. USHORT SBPort;
  37. UCHAR SBDMA;
  38. UCHAR SBIRQ;
  39. USHORT MPUPort;
  40. UCHAR MPUIRQ;
  41. UCHAR CDIRQ;
  42. ULONG TranslateCode;
  43. UCHAR ReservedB1;
  44. UCHAR ReservedB2;
  45. PUCHAR PROBase;
  46. } FOUNDINFO, FARP PFOUNDINFO;
  47. // these version numbers are found in 0B8Bh
  48. #define PAS_VERSION_1 0x000 // original
  49. #define PAS_PLUS 0x001 // Pro Audio Spectrum Plus with SCSI
  50. #define PAS_SIXTEEN 0x001 // Pro Audio Spectrum 16 with SCSI
  51. #define PAS_STUDIO 0x003
  52. #define PAS_CDPC 0x007 // CDPC 05/06/92 mmq
  53. #define BOARD_REV_MASK 07
  54. #define CHIP_REV_B 0x002
  55. #define CHIP_REV_D 0x004
  56. #define NO_PAS_INSTALLED 0x000 // can't find board
  57. // CD interface type definitions
  58. #define NO_INTERFACE 0
  59. #define MITSUMI_TYPE 1
  60. #define SONY_TYPE 2
  61. #define SCSI_TYPE 3
  62. #define SCSI_TYPE 3
  63. // sound definitions
  64. #define SOUND_DEF_DMACHANNEL 1 // DMA channel no
  65. #define SOUND_DEF_INT 7
  66. #define SOUND_DEF_PORT 0x220
  67. //==========================================================================
  68. //
  69. // Definitions from pasdef.h
  70. //
  71. //==========================================================================
  72. //
  73. // THESE DEFINITIONS FOR CAPABILITIES FILED
  74. //
  75. #define DEFAULT_BASE 0x388 // default base I/O address of Pro AudioSpectrum
  76. //// THESE ARE BASE REGISTER ATES
  77. //
  78. // Used only during initialization
  79. //
  80. #define PCM_CONTROL 0x0f8a //
  81. #define ENHANCED_SCSI_DETECT_REG 0x7f89 //
  82. #define SYSTEM_CONFIG_1 0x8388 //
  83. #define SYSTEM_CONFIG_2 0x8389 //
  84. #define SYSTEM_CONFIG_3 0x838a //
  85. #define SYSTEM_CONFIG_4 0x838b //
  86. #define IO_PORT_CONFIG_1 0xf388 //
  87. #define IO_PORT_CONFIG_2 0xf389 //
  88. #define IO_PORT_CONFIG_3 0xf38a //
  89. #define COMPATIBLE_REGISTER_ENABLE 0xf788 // SB and MPU emulation
  90. #define EMULATION_ADDRESS_POINTER 0xf789 // D0-D3 is SB; D4-D7 is MPU
  91. #define EMULATION_INTERRUPT_POINTER 0xfb8a // MPU and SB IRQ and SB DMA settings
  92. #define CHIP_REV 0xff88 // MV101 chip revision number
  93. #define MASTER_MODE_READ 0xff8b // aka Master Address Pointer
  94. //
  95. // Used for volume setting
  96. //
  97. #define MIXER_508_REG 0x078b // Mixer 508 1 port
  98. #define SERIAL_MIXER 0x0b88 // for Pas 1 and Pas 8
  99. #define FEATURE_ENABLE 0x0b88 // for Pas 16 boards only
  100. #define INTERRUPT_ENABLE 0x0b89 //
  101. #define FILTER_REGISTER 0x0b8a //
  102. #define INTERRUPT_CTRL_REG 0x0b8b //
  103. //
  104. // Only one of each of these
  105. //
  106. #define PAS_2_WAKE_UP_REG 0x9a01 // aka Master Address Pointer
  107. //
  108. // Not used here
  109. //
  110. #define TIMEOUT_COUNTER 0x4388 //
  111. #define TIMEOUT_STATUS 0x4389 //
  112. #define WAIT_STATE 0xbf88 //
  113. #define PRESCALE_DIVIDER 0xbf8A //
  114. #define SLAVE_MODE_READ 0xef8b // bits D0-D1
  115. #define READ_PAS(pGDI, port) \
  116. READ_PORT_UCHAR((PUCHAR)((port) ^ (pGDI->TranslateCode)))
  117. #define WRITE_PAS(pGDI, port, data) \
  118. WRITE_PORT_UCHAR((PUCHAR)((port) ^ (pGDI->TranslateCode)), (UCHAR)(data))
  119. // useful bit definitions
  120. #define D0 (1<<0)
  121. #define D1 (1<<1)
  122. #define D2 (1<<2)
  123. #define D3 (1<<3)
  124. #define D4 (1<<4)
  125. #define D5 (1<<5)
  126. #define D6 (1<<6)
  127. #define D7 (1<<7)
  128. //// BIT FIELDS FOR COMPATIBLE_REGISTER_ENABLE
  129. #define MPU_ENABLE_BIT D0
  130. #define SB_ENABLE_BIT D1
  131. #define SB_IRQ_ENABLE_BIT D2 // read only
  132. //// BIT FIELDS FOR FEATURE_ENABLE (0xb88)
  133. #define PCM_FEATURE_ENABLE D0
  134. #define FM_FEATURE_ENABLE D1
  135. #define MIXER_FEATURE_ENABLE D2
  136. #define SB_FEATURE_ENABLE D4
  137. /// BIT FIELDS FOR PCM CONTROL
  138. #define PCM_STEREO D0+D3
  139. #define PCM_DAC D4
  140. #define PCM_MONO D5
  141. #define PCM_ENGINE D6
  142. #define PCM_DRQ D7
  143. /// BIT FIELDS FOR SYSTEM CONFIG 3
  144. #define C3_ENHANCED_TIMER D0
  145. #define C3_SB_CLOCK_EMUL D1 // don't set! see Brian Colvin
  146. #define C3_VCO_INVERT D2
  147. #define C3_INVERT_BCLK D3
  148. #define C3_SYNC_PULSE D4
  149. #define C3_PSEUDO_PCM_STEREO D5
  150. /// BIT FIELDS FOR INTERRUPT ENABLE
  151. #define INT_LEFT_FM D0
  152. #define INT_RIGHT_FM D1
  153. #define INT_SB D1
  154. #define INT_SAMPLE_RATE D2
  155. #define INT_SAMPLE_BUFFER D3
  156. #define INT_MIDI D4
  157. /// BIT FIELDS FOR COMPATIBLE REGISTER ENABLE
  158. #define COMPAT_MPU D0
  159. #define COMPAT_SB D1
  160. /// IRQ POINTER VALUES FOR EMULATION INTERRUPT POINTER
  161. #define EMUL_IRQ_NONE 0
  162. #define EMUL_IRQ_2 1
  163. #define EMUL_IRQ_3 2
  164. #define EMUL_IRQ_5 3
  165. #define EMUL_IRQ_7 4
  166. #define EMUL_IRQ_10 5
  167. #define EMUL_IRQ_11 6
  168. #define EMUL_IRQ_12 7
  169. /// DMA POINTER VALUES FOR EMULATION DMA POINTER
  170. #define EMUL_DMA_NONE 0
  171. #define EMUL_DMA_1 1
  172. #define EMUL_DMA_2 2
  173. #define EMUL_DMA_3 3
  174. /// BIT VALUES FOR FILTER REGISTER
  175. #define FILTER_NOMUTE D5
  176. #define MIXCROSSCAPS_NORMAL_STEREO 0 // Left->Left, Right->Right
  177. #define MIXCROSSCAPS_RIGHT_TO_BOTH 1 // Right->Left, Right->Right
  178. #define MIXCROSSCAPS_LEFT_TO_BOTH 2 // Left->Left, Left->Right
  179. #define MIXCROSSCAPS_REVERSE_STEREO 4 // Left->Right, Right->Left
  180. #define MIXCROSSCAPS_RIGHT_TO_LEFT 8 // Right->Left, Right->Right
  181. #define MIXCROSSCAPS_LEFT_TO_RIGHT 0x10 // Left->Left, Left->Right
  182. #define OUT_AMPLIFIER 0
  183. #define OUT_PCM 1
  184. #define _LEFT 1
  185. #define _RIGHT 2
  186. #define _BASS 0
  187. #define _TREBLE 1
  188. #define MV_508_ADDRESS D7
  189. #define MV_508_INPUT D4
  190. #define MV_508_SWAP D6
  191. #define MV_508_BASS (D0+D1)
  192. #define MV_508_TREBLE (D2)
  193. #define MV_508_EQMODE (D2+D0)
  194. #define MV_508_LOUDNESS D2
  195. #define MV_508_ENHANCE (D1+D0)
  196. /// DEFINES FOR SERIAL MIXER
  197. #define NATIONAL_SELECTMUTE_REG 0x40
  198. #define NATIONAL_LOUD_ENH_REG 0x41
  199. #define NATIONAL_BASS_REG 0x42
  200. #define NATIONAL_TREB_REG 0x43
  201. #define NATIONAL_LEFT_VOL_REG 0x44
  202. #define NATIONAL_RIGHT_VOL_REG 0x45
  203. #define NATIONAL_MODESELECT_REG 0x46
  204. #define NATIONAL_COMMAND D7
  205. #define NATIONAL_LOUDNESS D0
  206. #define NATIONAL_ENHANCE D1
  207. #define SERIAL_MIX_LEVEL D0
  208. #define SERIAL_MIX_CLOCK D1
  209. #define SERIAL_MIX_STROBE D2
  210. #define SERIAL_MIX_MASTER D4
  211. #define SERIAL_MIX_REALSOUND D6
  212. #define SERIAL_MIX_DUALFM D7
  213. // FILTER_REGISTER
  214. #define fFIdatabits 0x1f // 00011111B filter select and decode field bits
  215. #define fFImutebits D5 // filter mute field bit
  216. #define fFIpcmbits (D7+D6) // 11000000B filter sample rate field bits
  217. #define bFImute D5 // filter mute bit
  218. #define bFIsrate D6 // filter sample rate timer mask
  219. #define bFIsbuff D7 // filter sample buffer counter mask
  220. #define FILTERMAX 6 // six possible settings
  221. #define FILTER_MUTE 0 // mute - goes to PC speaker
  222. #define FILTER_LEVEL_1 1 // 20hz to 2.9khz
  223. #define FILTER_LEVEL_2 2 // 20hz to 5.9khz
  224. #define FILTER_LEVEL_3 3 // 20hz to 8.9khz
  225. #define FILTER_LEVEL_4 4 // 20hz to 11.9khz
  226. #define FILTER_LEVEL_5 5 // 20hz to 15.9khz
  227. #define FILTER_LEVEL_6 6 // 20hz to 17.8khz
  228. /// SLAVE_MODE_READ BITS
  229. #define SLAVE_MODE_OPL3 D2
  230. #define SLAVE_MODE_16 D3
  231. #define PASX_IN(pFI, port) \
  232. ScsiPortReadPortUchar(pFI->PROBase + ( (port) ^ pFI->TranslateCode) )
  233. #define PASX_OUT(pFI, port, data) \
  234. ScsiPortWritePortUchar(pFI->PROBase + ((port) ^ pFI->TranslateCode), (UCHAR)(data))
  235. #define WRITE_PORT_UCHAR ScsiPortWritePortUchar
  236. #define READ_PORT_UCHAR ScsiPortReadPortUchar
  237. //
  238. // Exported routines
  239. //
  240. int FindPasHardware(PFOUNDINFO pFoundInfo);
  241. void InitProHardware(PFOUNDINFO pFI);