4 http://www.cae.wisc.edu/~brodskye/sb16doc/sb16doc.html
10 VOID
SetOutputSampleRate(ULONG BasePort
, ULONG SampleRate
)
12 // This only works for DSP v4.xx ONLY - need a workaround!
13 DPRINT("Setting output sample rate\n");
16 // if (! WaitToSend(BasePort))
19 SB_WRITE_BYTE(BasePort
, SB_SET_OUTPUT_RATE
);
20 SB_WRITE_BYTE(BasePort
, SampleRate
/ 256); // high
21 SB_WRITE_BYTE(BasePort
, SampleRate
% 256); // low
25 VOID
EnableSpeaker(ULONG BasePort
, BOOLEAN SpeakerOn
)
27 DPRINT("Setting speaker status %d\n", SpeakerOn
);
29 // if (! WaitForWrite(BasePort))
32 SB_WRITE_BYTE(BasePort
, SpeakerOn
? SB_ENABLE_SPEAKER
: SB_DISABLE_SPEAKER
);
36 BOOLEAN
IsSpeakerEnabled(ULONG BasePort
)
38 DPRINT("Obtaining speaker status\n");
40 // if (! WaitToSend(BasePort))
43 SB_WRITE_BYTE(BasePort
, SB_GET_SPEAKER_STATUS
);
44 if (! WaitToReceive(BasePort
))
47 return SB_READ_DATA(BasePort
) == 0xff;
51 VOID
BeginPlayback(ULONG BasePort
, ULONG BitDepth
, ULONG Channels
, ULONG BlockSize
)
53 DPRINT("BeginPlayback(%d, %d, %d, %d)\n", BasePort
, BitDepth
, Channels
, BlockSize
);
57 // case 8 : Command = 0xc0; break;
58 // case 16 : Command = 0xb0; break; // Make sure we support it
59 // default : Command = 0xc0;
62 DPRINT("Initiating playback\n");
65 SB_WRITE_BYTE(BasePort
, 0xc6);
66 SB_WRITE_BYTE(BasePort
, 0); // mode - TEMPORARY
67 SB_WRITE_BYTE(BasePort
, BlockSize
% 256);
68 SB_WRITE_BYTE(BasePort
, BlockSize
/ 256);