]> 4ch.mooo.com Git - 16.git/blob - 16/PCGPE10/SBPRO.TXT
modified: 16/modex16/pcxtest.exe
[16.git] / 16 / PCGPE10 / SBPRO.TXT
1 \r
2                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
3                   ³ Programming the SoundBlaster Pro ³\r
4                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
5 \r
6                   Written for the PC-GPE by Mark Feldman\r
7               e-mail address : u914097@student.canberra.edu.au\r
8                                myndale@cairo.anu.edu.au\r
9 \r
10              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
11              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
12              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
13              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
14 \r
15 \r
16 ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
17 ³ Disclaimer ³\r
18 ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
19 \r
20 I assume no responsibility whatsoever for any effect that this file, the\r
21 information contained therein or the use thereof has on you, your sanity,\r
22 computer, spouse, children, pets or anything else related to you or your\r
23 existance. No warranty is provided nor implied with this information.\r
24 \r
25 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
26 ³ Introduction ³\r
27 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
28 \r
29 I still own a SoundBlaster 1.0 (don't laugh) so I haven't been able to\r
30 test any of the information in this file, ie don't take any of this as\r
31 fact.\r
32 \r
33 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
34 ³ Stereo Sound ³\r
35 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
36 \r
37 Generating stereo FM sound on the SB Pro is similar to the way it's done\r
38 on the SB 1.x, you just use different ports for the left and right channels.\r
39 The file ADLIB.TXT has more information on this.\r
40 \r
41 Generating stereo sounds with the DSP is similar to the mono method, but you\r
42 send *two* bytes for every sample. The first one goes to the left channel\r
43 and the second one goes to the right. You also need to reset the mixer chip\r
44 and tell the soundblaster you want to play a stereo sound (see below). This\r
45 has the advantage in that you can store the info for both channels in a\r
46 single data block and transfer it by still using only one DMA channel. The\r
47 WAV file format actually stores it's audio waveform data like this (see the\r
48 PC-GPE file WAV.TXT).\r
49 \r
50 \r
51   Left channel bytes\r
52 \r
53   0       1       2       3       4       5       6\r
54 ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ\r
55 ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ³   ........\r
56 ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ\r
57       0       1       2       3       4       5       6\r
58 \r
59   Right channel bytes\r
60 \r
61 To play the sound the SoundBlaster Pro is set for stereo output and the DMA\r
62 chip is programmed to send this chunk as is.\r
63 \r
64 \r
65 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
66 ³ The CT 1345 Mixer Chip ³\r
67 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
68 \r
69 \r
70 You access the mixer registers the same way you access the regular SB\r
71 registers, but Port 2x4h is the index port and 2x5h is the data read/write\r
72 port, where x = 2 for base address jumper setting 220h\r
73             x = 3 for base address jumper setting 230h\r
74             x = 4 for base address jumper setting 240h\r
75 \r
76 So setting a mixer register to a given value can be accomplished with the\r
77 following procedure:\r
78 \r
79 { base = 220h, 230 or 240h }\r
80 procedure SetMixerReg(base : word; index, value : byte);\r
81 begin\r
82   Port[base + 4] := index;\r
83   Port[base + 5] := value;\r
84 end;\r
85 \r
86 \r
87 You can also read a register's current value:\r
88 \r
89 function GetMixerReg(base : word; index : byte) : byte;\r
90 begin\r
91   Port[base + 4] := index;\r
92   GetMixerReg := Port[base + 5];\r
93 end;\r
94 \r
95 \r
96 \r
97 \r
98 \r
99 The Data Reset register is used to reset the mixer chip. Set this register to\r
100 0 before changing any of the other mixer registers.\r
101 \r
102               Index = 00h\r
103               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
104               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
105               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
106                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
107                               ³\r
108                           Data Reset\r
109 \r
110 \r
111 \r
112 \r
113 The Input register selects the SB Pro sound input source and filter type.\r
114 \r
115               Index = 0Ch\r
116               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
117               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
118               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
119                         ÀÄÄÄÂÄÄÄÙ   ÀÄÂÄÙ\r
120                             ³         ³\r
121                 ÚÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄ¿ ÚÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
122                 ³ In Filter       ³ ³ ADC Source        ³\r
123                 ³ 000 - Low       ³ ³ 00 - Microphone 1 ³\r
124                 ³ 001 - High      ³ ³ 01 - CD           ³\r
125                 ³ 010 - No Filter ³ ³ 10 - Microphone 2 ³\r
126                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ 11 - Line In      ³\r
127                                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
128 \r
129 \r
130 \r
131 The Output register determines whether to output sound in stereo or mono, in\r
132 stereo two bytes must be sent for each sample, the first one goes to the left\r
133 channel and the next one goes to the right. This register allows you to\r
134 bypass the output filter.\r
135 \r
136               Index = 0Eh\r
137               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
138               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
139               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
140                         ³               ³\r
141            ÚÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÁÄÄÄÄÄÄÄÄÄ¿\r
142            ³ DNFI                  ³ ³ VSTC       ³\r
143            ³ 0 - Use O/P Filter    ³ ³ 0 - Mono   ³\r
144            ³ 1 - Bypass O/P Filter ³ ³ 1 - Stereo ³\r
145            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
146 \r
147 \r
148 The Master Volume register allows you to set the master volume of each\r
149 channel:\r
150 \r
151               Index = 22h\r
152               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
153               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
154               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
155                 ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
156                       ³               ³\r
157              ÚÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ¿\r
158              ³ Master Volume ³³ Master Volume ³\r
159              ³     Left      ³³     Right     ³\r
160              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
161 \r
162 \r
163 The Voice Volume register allows you to set the volume of each channel for\r
164 DSP output:\r
165 \r
166               Index = 04h\r
167               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
168               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
169               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
170                 ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
171                       ³               ³\r
172               ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄÁÄÄÄÄÄÄ¿\r
173               ³ Voice Volume ³³ Voice Volume ³\r
174               ³     Left     ³³     Right    ³\r
175               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
176 \r
177                  Voice Volume    Voice Volume\r
178                     Left            Right\r
179 \r
180 \r
181 The FM Volume register allows you to set the volume of each channel for\r
182 FM wave synthesis:\r
183 \r
184 \r
185 \r
186               Index = 26h\r
187               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
188               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
189               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
190                 ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
191                       ³               ³\r
192                 ÚÄÄÄÄÄÁÄÄÄÄÄ¿   ÚÄÄÄÄÄÁÄÄÄÄÄ¿\r
193                 ³ FM Volume ³   ³ FM Volume ³\r
194                 ³   Left    ³   ³   Right   ³\r
195                 ÀÄÄÄÄÄÄÄÄÄÄÄÙ   ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
196 \r
197 \r
198 The CD Volume register allows you to set the volume of each channel for\r
199 CD output:\r
200 \r
201               Index = 28h\r
202               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
203               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
204               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
205                 ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
206                       ³               ³\r
207                 ÚÄÄÄÄÄÁÄÄÄÄÄ¿   ÚÄÄÄÄÄÁÄÄÄÄÄ¿\r
208                 ³ CD Volume ³   ³ CD Volume ³\r
209                 ³   Left    ³   ³   Right   ³\r
210                 ÀÄÄÄÄÄÄÄÄÄÄÄÙ   ÀÄÄÄÄÄÄÄÄÄÄÄÙ\r
211 \r
212 \r
213 The Line Volume register allows you to set the volume of each channel for\r
214 line in channel:\r
215 \r
216 \r
217               Index = 2Eh\r
218               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
219               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
220               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
221                 ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
222                       ³               ³\r
223                ÚÄÄÄÄÄÄÁÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÁÄÄÄÄÄÄ¿\r
224                ³ Line Volume ³ ³ Line Volume ³\r
225                ³    Left     ³ ³    Right    ³\r
226                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
227 \r
228 The Mic Mixing register allows you to set the input volume for the\r
229 microphone:\r
230 \r
231               Index = 0Ah\r
232               ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
233               ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
234               ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
235                                     ÀÄÄÄÂÄÄÄÙ\r
236                                         ³\r
237                                  ÚÄÄÄÄÄÄÁÄÄÄÄÄ¿\r
238                                  ³ Mic Mixing ³\r
239                                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
240 \r
241 ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
242 ³ References ³\r
243 ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
244 \r
245 Title : The SoundBlaster Developpers Kit\r
246 Publishers : Creative Labs Inc\r
247              Creative Technology PTE LTD\r
248 \r
249 Title : Sound Blaster - The Official Book\r
250 Authors : Richard Heimlich, David M. Golden, Ivan Luk, Peter M. Ridge\r
251 Publishers : Osborne/McGraw Hill\r
252 ISBN : 0-07-881907-5\r
253 \r
254 Some of the information in this file was either obtained from or verified\r
255 by the source code in a public domain library called SOUNDX by Peter\r
256 Sprenger. I haven't tried using his library yet (I don't have a C compiler\r
257 at the moment) but it looks very well done and contains numerous sound card\r
258 detection routines. Says Peter : "It would be nice, that when you make\r
259 something commercial with my routines, that you send me a copy of your\r
260 project or send me some bucks, just enough for pizza and coke to support my\r
261 night programming sessions. If you send me nothing, ok. But USE the stuff,\r
262 if you can need it!". Heh...a REAL programmer!\r
263 \r
264 ftp site: ftp.uwp.edu\r
265 directory: /pub/msdos/demos/programming/game-dev/source\r
266 filename: soundx.zip\r
267 \r