#include <debug.h>
#include <ntddk.h>
Go to the source code of this file.
|
#define | SB_WAVE_IN_DEVICE_NAME L"\\Device\\SBWaveIn" |
|
#define | SB_WAVE_OUT_DEVICE_NAME L"\\Device\\SBWaveOut" |
|
#define | SB_AUX_DEVICE_NAME L"\\Device\\SBAux" |
|
#define | SB_MIXER_DEVICE_NAME L"\\Device\\SBMixer" |
|
#define | DEFAULT_PORT 0x220 |
|
#define | DEFAULT_IRQ 5 |
|
#define | DEFAULT_DMA 1 |
|
#define | DEFAULT_BUFFER_SIZE 65535 |
|
#define | SB_TIMEOUT 1000000 |
|
#define | SB_DSP_READY 0xaa |
|
#define | SbWrite(sbdevice, subport, data) WRITE_PORT_UCHAR((PUCHAR) sbdevice->port + subport, data) |
|
#define | SbRead(sbdevice, subport) READ_PORT_UCHAR((PUCHAR) sbdevice->port + subport) |
|
#define | SbWriteReset(sbdevice, data) SbWrite(sbdevice, SB_RESET_PORT, data) |
|
#define | SbWriteDataWithoutWait(sbdevice, data) SbWrite(sbdevice, SB_WRITE_DATA_PORT, data) |
|
#define | SbReadDataWithoutWait(sbdevice) SbRead(sbdevice, SB_READ_DATA_PORT) |
|
#define | SbGetWriteStatus(sbdevice) SbRead(sbdevice, SB_WRITE_STATUS_PORT) |
|
#define | SbGetReadStatus(sbdevice) SbRead(sbdevice, SB_READ_STATUS_PORT) |
|
#define | WaitToWrite(sbdevice) WaitForReady(sbdevice, SB_WRITE_STATUS_PORT) |
|
#define | WaitToRead(sbdevice) WaitForReady(sbdevice, SB_READ_STATUS_PORT) |
|
|
enum | {
NotDetected
, SoundBlaster
, SoundBlasterPro
, SoundBlaster2
,
SoundBlasterPro2
, SoundBlasterProMCV
, SoundBlaster16
} |
|
enum | {
SB_RESET_PORT = 0x06
, SB_READ_DATA_PORT = 0x0a
, SB_WRITE_DATA_PORT = 0x0c
, SB_WRITE_STATUS_PORT = 0x0c
,
SB_READ_STATUS_PORT = 0x0e
} |
|
enum | {
SbAutoInitDmaOutput = 0x1c
, SbAutoInitDmaInput = 0x2c
, SbSetOutputRate = 0x41
, SbSetInputRate = 0x42
,
SbSetBlockSize = 0x48
, SbPauseDac = 0x80
, SbPauseDmaOutput = 0xd0
, SbEnableSpeaker = 0xd1
,
SbDisableSpeaker = 0xd3
, SbGetSpeakerStatus = 0xd8
, SbGetDspVersion = 0xe1
} |
|
◆ DEFAULT_BUFFER_SIZE
#define DEFAULT_BUFFER_SIZE 65535 |
◆ DEFAULT_DMA
◆ DEFAULT_IRQ
◆ DEFAULT_PORT
◆ SB_AUX_DEVICE_NAME
#define SB_AUX_DEVICE_NAME L"\\Device\\SBAux" |
◆ SB_DSP_READY
◆ SB_MIXER_DEVICE_NAME
#define SB_MIXER_DEVICE_NAME L"\\Device\\SBMixer" |
◆ SB_TIMEOUT
◆ SB_WAVE_IN_DEVICE_NAME
#define SB_WAVE_IN_DEVICE_NAME L"\\Device\\SBWaveIn" |
◆ SB_WAVE_OUT_DEVICE_NAME
#define SB_WAVE_OUT_DEVICE_NAME L"\\Device\\SBWaveOut" |
◆ SbGetReadStatus
◆ SbGetWriteStatus
◆ SbRead
◆ SbReadDataWithoutWait
◆ SbWrite
◆ SbWriteDataWithoutWait
◆ SbWriteReset
◆ WaitToRead
◆ WaitToWrite
◆ PREGISTRY_CALLBACK_ROUTINE
◆ PSOUND_BLASTER_PARAMETERS
◆ REGISTRY_CALLBACK_ROUTINE
◆ SOUND_BLASTER_PARAMETERS
◆ anonymous enum
Enumerator |
---|
NotDetected | |
SoundBlaster | |
SoundBlasterPro | |
SoundBlaster2 | |
SoundBlasterPro2 | |
SoundBlasterProMCV | |
SoundBlaster16 | |
Definition at line 21 of file sndblst.h.
◆ anonymous enum
Enumerator |
---|
SB_RESET_PORT | |
SB_READ_DATA_PORT | |
SB_WRITE_DATA_PORT | |
SB_WRITE_STATUS_PORT | |
SB_READ_STATUS_PORT | |
Definition at line 32 of file sndblst.h.
◆ anonymous enum
Enumerator |
---|
SbAutoInitDmaOutput | |
SbAutoInitDmaInput | |
SbSetOutputRate | |
SbSetInputRate | |
SbSetBlockSize | |
SbPauseDac | |
SbPauseDmaOutput | |
SbEnableSpeaker | |
SbDisableSpeaker | |
SbGetSpeakerStatus | |
SbGetDspVersion | |
Definition at line 41 of file sndblst.h.
◆ DisableSpeaker()
Definition at line 167 of file control.c.
169{
170 DPRINT(
"Disabling speaker\n");
171
173}
◆ EnableIrq()
Definition at line 27 of file interrupt.c.
29{
35
37 0,
40 &irq_level,
42
44
50 irq_level,
51 irq_level,
56
59
61}
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
#define STATUS_DEVICE_CONFIGURATION_ERROR
#define STATUS_INVALID_PARAMETER
_In_ PDEVICE_OBJECT DeviceObject
◆ EnableSpeaker()
◆ GetSoundBlasterModel()
Definition at line 95 of file control.c.
97{
98 UCHAR MajorVer, MinorVer;
99
100 DPRINT(
"Querying DSP version\n");
101
104
107
109 {
111 {
112 DPRINT(
"Version %d.%d\n", MajorVer, MinorVer);
113
114 SBDevice->
dsp_version = (MajorVer * 256) + MinorVer;
115
118 else if ( ( SBDevice->
dsp_version & 0xFF00 ) == 0x0200 )
120 else if ( ( SBDevice->
dsp_version & 0xFF00 ) == 0x0300 )
124
126 }
127 }
128
130}
#define WaitToRead(sbdevice)
◆ IsSampleRateCompatible()
◆ ResetSoundBlaster()
Definition at line 59 of file control.c.
61{
64
68
69 DPRINT(
"Waiting for SB to acknowledge our reset request\n");
70
72 {
73 DPRINT(
"Didn't get an ACK :(\n");
75 }
76
78
80 {
83 }
84
85 if ( ! acked )
86 {
87 DPRINT(
"Didn't get an ACK :(\n");
89 }
90
92}
#define SbWriteReset(sbdevice, data)
#define SbReadDataWithoutWait(sbdevice)
Referenced by InitializeSoundBlaster().
◆ SetOutputSampleRate()
◆ StartSoundOutput()
Definition at line 176 of file control.c.
181{
182 DPRINT(
"Initializing output with %d channels at %d bits/sample\n", Channels, BitDepth);
183
185
186 if ( ( Channels < 1 ) || ( Channels > 2 ) )
188
189 if ( ( BitDepth != 8 ) && ( BitDepth != 16 ) )
191
192 switch ( BitDepth )
193 {
194 case 8 :
command = 0xc6;
break;
195 case 16 :
command = 0xb6;
break;
196 };
197
198 switch ( Channels )
199 {
200 case 1 :
mode = 0x00;
break;
201 case 2 :
mode = 0x20;
break;
202 }
203#if 0
204 first_byte = (BitDepth == 16) ? 0xb6 : 0xc6;
205 second_byte = (Channels == 1) ? 0x20 : 0x00;
206#endif
207
209 {
210
211 }
212
213
218
219 DPRINT(
"Finished programming the DSP\n");
220
222}
◆ WaitForReady()
Definition at line 12 of file control.c.
15{
18
19 while ( ( ! ready ) && (
timeout > 0 ) )
20 {
23
25 }
26
28}
#define SbRead(sbdevice, subport)