1 #ifndef SOUNDCARD_H
2 #define SOUNDCARD_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #define SNDCARD_ADLIB 1
17 #define SNDCARD_SB 2
18 #define SNDCARD_PAS 3
19
20
21
22
23
24 #define SNDCTL_CONFIGURE 0x00014252
25
26 #define SNDCTL_FM_LOAD_INSTR 0x01014252
27
28 #define SNDCTL_SEQ_SYNC 0x01044252
29 #define SNDCTL_SEQ_RESET 0x01054252
30 #define SNDCTL_SYNTH_INFO 0x01064252
31 #define SNDCTL_SEQ_TESTMIDI 0x01074252
32 #define SNDCTL_SEQ_PERCMODE 0x01084252
33
34 #define SNDCTL_DSP_SPEED 0x01114252
35 #define SNDCTL_DSP_STEREO 0x01124252
36 #define SNDCTL_DSP_GETBLKSIZE 0x01134252
37 #define SNDCTL_DSP_SYNC 0x01144252
38 #define SNDCTL_DSP_RESET 0x01154252
39 #define SNDCTL_DSP_SAMPLESIZE 0x01164252
40
41
42 #define SEQ_FMNOTEOFF 0
43 #define SEQ_FMNOTEON 1
44 #define SEQ_WAIT 2
45 #define SEQ_FMPGMCHANGE 3
46 #define SEQ_SYNCTIMER 4
47 #define SEQ_MIDIPUTC 5
48 #define SEQ_DRUMON 6
49 #define SEQ_DRUMOFF 7
50
51 typedef unsigned char sbi_instr_data[16];
52
53 struct sbi_instrument {
54 int channel;
55 sbi_instr_data operators;
56 };
57
58 struct synth_info {
59 int synth_type;
60 #define SYNTH_TYPE_FM 0
61
62 int synth_subtype;
63 #define FM_TYPE_ADLIB 0
64 #define FM_TYPE_OPL3 1
65
66 int perc_mode;
67 int nr_voices;
68 int nr_drums;
69 int instr_bank_size;
70 int dummies[20];
71 };
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 #define SOUND_BASE 0x534E4400
92
93 #define SOUND_READ 0x00000000
94 #define SOUND_WRITE 0x00000008
95
96
97
98
99
100
101
102
103
104
105 #define SOUND_MIXER 0x00
106 #define SOUND_MIXER_TYPE unsigned short int
107
108 #define SOUND_MIXER_VOLUME 0x0
109 #define SOUND_MIXER_BASS 0x1
110 #define SOUND_MIXER_TREBLE 0x2
111 #define SOUND_MIXER_MIDI 0x3
112 #define SOUND_MIXER_PCM 0x4
113 #define SOUND_MIXER_SPEAKER 0x5
114 #define SOUND_MIXER_LINE 0x6
115 #define SOUND_MIXER_MIC 0x7
116
117 #define SOUND_MIXER_READ_VOLUME (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_VOLUME )
118 #define SOUND_MIXER_READ_BASS (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_BASS )
119 #define SOUND_MIXER_READ_TREBLE (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_TREBLE )
120 #define SOUND_MIXER_READ_MIDI (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_MIDI )
121 #define SOUND_MIXER_READ_PCM (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_PCM )
122 #define SOUND_MIXER_READ_SPEAKER (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_SPEAKER)
123 #define SOUND_MIXER_READ_LINE (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_LINE )
124 #define SOUND_MIXER_READ_MIC (SOUND_BASE | SOUND_MIXER | SOUND_READ | SOUND_MIXER_MIC )
125
126 #define SOUND_MIXER_WRITE_VOLUME (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_VOLUME )
127 #define SOUND_MIXER_WRITE_BASS (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_BASS )
128 #define SOUND_MIXER_WRITE_TREBLE (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_TREBLE )
129 #define SOUND_MIXER_WRITE_MIDI (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_MIDI )
130 #define SOUND_MIXER_WRITE_PCM (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_PCM )
131 #define SOUND_MIXER_WRITE_SPEAKER (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_SPEAKER)
132 #define SOUND_MIXER_WRITE_LINE (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_LINE )
133 #define SOUND_MIXER_WRITE_MIC (SOUND_BASE | SOUND_MIXER | SOUND_WRITE | SOUND_MIXER_MIC )
134
135
136
137
138
139
140
141
142
143
144
145
146
147 #define SOUND_PCM 0x10
148 #define SOUND_PCM_TYPE unsigned short int
149
150 #define SOUND_RATE 0x0
151 #define SOUND_CHANNELS 0x1
152 #define SOUND_BITS 0x2
153 #define SOUND_FILTER 0x3
154
155 #define SOUND_PCM_READ_RATE (SOUND_BASE | SOUND_PCM | SOUND_READ | SOUND_RATE )
156 #define SOUND_PCM_READ_CHANNELS (SOUND_BASE | SOUND_PCM | SOUND_READ | SOUND_CHANNELS)
157 #define SOUND_PCM_READ_BITS (SOUND_BASE | SOUND_PCM | SOUND_READ | SOUND_BITS )
158 #define SOUND_PCM_READ_FILTER (SOUND_BASE | SOUND_PCM | SOUND_READ | SOUND_FILTER )
159
160 #define SOUND_PCM_WRITE_RATE (SOUND_BASE | SOUND_PCM | SOUND_WRITE | SOUND_RATE )
161 #define SOUND_PCM_WRITE_CHANNELS (SOUND_BASE | SOUND_PCM | SOUND_WRITE | SOUND_CHANNELS)
162 #define SOUND_PCM_WRITE_BITS (SOUND_BASE | SOUND_PCM | SOUND_WRITE | SOUND_BITS )
163 #define SOUND_PCM_WRITE_FILTER (SOUND_BASE | SOUND_PCM | SOUND_WRITE | SOUND_FILTER )
164
165
166
167
168
169
170 typedef unsigned char BYTE;
171 typedef unsigned char FLAG;
172 struct stereo_vol
173 {
174 BYTE l;
175 BYTE r;
176 };
177 #define MIXER_IOCTL_SET_LEVELS 0x02014252
178 #define MIXER_IOCTL_SET_PARAMS 0x02024252
179 #define MIXER_IOCTL_READ_LEVELS 0x02034252
180 #define MIXER_IOCTL_READ_PARAMS 0x02044252
181 #define MIXER_IOCTL_RESET 0x02054252
182
183
184
185
186 struct sb_mixer_levels
187 {
188 struct stereo_vol master;
189 struct stereo_vol voc;
190 struct stereo_vol fm;
191 struct stereo_vol line;
192 struct stereo_vol cd;
193 BYTE mic;
194 };
195
196
197
198
199 struct sb_mixer_params
200 {
201 BYTE record_source;
202 FLAG hifreq_filter;
203 FLAG filter_input;
204 FLAG filter_output;
205 FLAG dsp_stereo;
206 };
207
208 #define SRC_MIC 1
209 #define SRC_CD 3
210 #define SRC_LINE 7
211
212
213
214
215
216
217
218
219 struct soundcard_config
220 {
221 int config_command;
222 #define SNDCONF_RESET 0
223 #define SNDCONF_START 1
224 #define SNDCONF_SETCARD 2
225
226 int cardtype;
227 int card_subtype;
228
229 int config_parms[100];
230 };
231
232 extern long soundcard_init(long mem_start);
233
234 #endif