]> 4ch.mooo.com Git - 16.git/blob - 16/PCGPE10/GAMEBLST.TXT
modified: 16/modex16/scroll.c
[16.git] / 16 / PCGPE10 / GAMEBLST.TXT
1 \r
2                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
3                ³ Programming the GameBlaster Sound Card ³\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 The GameBlaster sound card (also known as the CMS) is now pretty much\r
30 obsolete, well I haven't seen any apart from the one I own. The card was\r
31 developped by Creative Labs, the same people who designed the SoundBlaster.\r
32 You can still buy the CMS chips to place inside your SoundBlaster 1.0 and\r
33 2.0 cards to make them compatible, but believe me, it isn't worth it. The\r
34 only reason I'm writing this file is because the GameBlaster chips are really\r
35 easy to program (due to the fact that it can't do anything) so this should be\r
36 of use to those of you who already own one.\r
37 \r
38 I have no idea how to detect the presence of the CMS chips in a SoundBlaster,\r
39 trying to write to it's registers while the chips were not installed made\r
40 my machine hang.\r
41 \r
42 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
43 ³ General Programming Info ³\r
44 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
45 \r
46 The GameBlaster has 12 channels. Each channel can produce either a single\r
47 sine wave of a given frequency and magnitude (in stereo), or noise.\r
48 \r
49 The GameBlaster is programmed through 4 ports as follows:\r
50 \r
51     For voices 1 to 6\r
52         Write 2x1 with register address\r
53         Write 2x0 with data to register\r
54 \r
55     For voices 7 to 12\r
56         Write 2x3 with register address\r
57         Write 2x2 with data to register\r
58 \r
59 The x value depends on the jumper setting on your card, x = 1 for 210h, x =\r
60 2 for 220h etc...\r
61 \r
62 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
63 ³ Reseting the GameBlaster ³\r
64 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
65 \r
66 First you have to reset the GameBlaster and enable all voices. This is done\r
67 by setting register 1Ch, which is laid out as follows:\r
68 \r
69                       ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
70                       ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
71                       ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
72                                                 ³   ³\r
73 Sound Enable for all channels ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ   ³\r
74   0 all channels disabled                           ³\r
75   1 all channels enabled                            ³\r
76                                                     ³\r
77 Reset signal to all generators ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
78   0 all generators enabled\r
79   1 all generators reset and synchronized\r
80 \r
81 The following Pascal code will reset and enable the card (assuming jumper\r
82 setting is for 220h) :\r
83 \r
84   Port[$221] := $1C;\r
85   Port[$220] := $02; { Reset voices }\r
86   Port[$221] := $15;\r
87   Port[$220] := $00; { Disable noise * }\r
88   Port[$221] := $1C;\r
89   Port[$220] := $01; { Enable voices }\r
90 \r
91 * Noise is discussed in the next section\r
92 \r
93 \r
94 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
95 ³ Enabling Voice Frequency ³\r
96 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
97 \r
98 To hear a frequency from a voice you must set the appropriate bit in\r
99 register 14h:\r
100 \r
101        ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
102        ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
103        ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
104                  ³   ³   ³   ³   ³   ³\r
105                  ³   ³   ³   ³   ³   ÀÄÄ Frequency enable 1/7\r
106                  ³   ³   ³   ³   ÀÄÄÄÄÄÄ Frequency enable 2/8\r
107                  ³   ³   ³   ÀÄÄÄÄÄÄÄÄÄÄ Frequency enable 3/9\r
108                  ³   ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 4/10\r
109                  ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 5/11\r
110                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Frequency enable 6/12\r
111 \r
112 Note that for each bit in the above table two voice numbers are given. If\r
113 ports 2x1 and 2x0 are used then the first voice is modified. If ports 2x3\r
114 and 2x2 are used then the second voice is modified.\r
115 \r
116 Setting a bit to 1 enables the voice. Clearing it to 0 disables the voice.\r
117 \r
118 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
119 ³ Setting a Voice Volume ³\r
120 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
121 \r
122 Each voice can have a volume between 0 and 15 on both left and right\r
123 channels. The amplitude registers are laid out as follows:\r
124 \r
125                       ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
126                       ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
127                       ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
128                         ÀÄÄÄÄÄÂÄÄÄÄÄÙ   ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
129                               ³               ³\r
130  Right channel volume ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄÄÄ Left channel volume\r
131 \r
132 \r
133 To set a channel volume you write the register address to the appropriate\r
134 Register Address port and write the volume byte to the Data To Register\r
135 port. The register address map for amplitudes is as follows:\r
136 \r
137                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
138                    ³ Register Address     Voice ³\r
139                    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
140                    ³       00h             1/7  ³\r
141                    ³       01h             2/8  ³\r
142                    ³       02h             3/9  ³\r
143                    ³       03h             4/10 ³\r
144                    ³       04h             5/11 ³\r
145                    ³       05h             6/12 ³\r
146                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
147 \r
148 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
149 ³ Setting a Voice Frequency ³\r
150 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
151 \r
152 Setting a voice frequency is similar to setting the volume, one byte is\r
153 written to the appropriate register. The frequency register map is as\r
154 follows:\r
155 \r
156                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
157                    ³ Register Address     Voice ³\r
158                    ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
159                    ³       08h             1/7  ³\r
160                    ³       09h             2/8  ³\r
161                    ³       0Ah             3/9  ³\r
162                    ³       0Bh             4/10 ³\r
163                    ³       0Ch             5/11 ³\r
164                    ³       0Dh             6/12 ³\r
165                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
166 \r
167 The following table is a list of the bytes you write for each note:\r
168 \r
169 \r
170                          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
171                          ³ Note   Value ³\r
172                          ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
173                          ³  A        3  ³\r
174                          ³  A#      31  ³\r
175                          ³  B       58  ³\r
176                          ³  C       83  ³\r
177                          ³  C#     107  ³\r
178                          ³  D      130  ³\r
179                          ³  D#     151  ³\r
180                          ³  E      172  ³\r
181                          ³  F      191  ³\r
182                          ³  F#     209  ³\r
183                          ³  G      226  ³\r
184                          ³  G#     242  ³\r
185                          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
186 \r
187 This is the first octave available. The C frequency in this octave is\r
188 55 Hz.\r
189 \r
190 To get tones in higher octaves you need to set the octave register for a \r
191 voice. Each octave register stores the octave number for two voices. The\r
192 octave registers are laid out as follows:\r
193 \r
194                       ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
195                       ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
196                       ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
197                             ÀÄÄÄÂÄÄÄÙ       ÀÄÄÄÂÄÄÄÙ\r
198                                 ³               ³\r
199         Octave Number 2 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Octave number 1\r
200 \r
201 The octave register address map is as follows:\r
202 \r
203                     ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
204                     ³ Register Address     Voices      ³\r
205                     ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
206                     ³     10h              2;1 / 8;7   ³\r
207                     ³     11h              4;3 / 10;9  ³\r
208                     ³     12h              6;5 / 12;11 ³\r
209                     ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
210 \r
211 ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
212 ³ Noise ³\r
213 ÀÄÄÄÄÄÄÄÙ\r
214 \r
215 There are 4 noise generators, each noise genrator can be connected up to\r
216 any of three voices:\r
217 \r
218                           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
219                           ³   Noise              ³\r
220                           ³  Generator   Voices  ³\r
221                           ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
222                           ³   1           1,2,3  ³\r
223                           ³   2           4,5,6  ³\r
224                           ³   3           7,8,9  ³\r
225                           ³   4         10,11,12 ³\r
226                           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
227 \r
228 \r
229 The noise generators are controlled via two registers:\r
230 \r
231 Register 16h at ports 2x1 and 2x0 :\r
232 \r
233                    ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
234                    ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
235                    ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
236                              ÀÄÂÄÙ           ÀÄÂÄÙ\r
237                                ³               ³\r
238            Noise Gen 2 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Noise Gen 1\r
239 \r
240 Register 16h at ports 2x3 and 2x2 :\r
241 \r
242                    ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
243                    ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
244                    ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
245                              ÀÄÂÄÙ           ÀÄÂÄÙ\r
246                                ³               ³\r
247            Noise Gen 4 ÄÄÄÄÄÄÄÄÙ               ÀÄÄÄÄÄÄ Noise Gen 3\r
248 \r
249 Each generator has two bits associated with it which control the noise\r
250 generator rate:\r
251 \r
252                        ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
253                        ³ Nn1 Nn0    Frequency ³\r
254                        ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
255                        ³ 0   0     28.0 kHz   ³\r
256                        ³ 0   1     14.0 kHz   ³\r
257                        ³ 1   0      6.8 kHz   ³\r
258                        ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
259 \r
260 A voice can be connected to it's noise generator by setting the appropriate\r
261 bit in register 15h:\r
262 \r
263                 ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
264                 ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
265                 ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
266                           ³   ³   ³   ³   ³   ³\r
267                           ³   ³   ³   ³   ³   ÀÄÄ Noice enable 1/7\r
268                           ³   ³   ³   ³   ÀÄÄÄÄÄÄ Noice enable 2/8\r
269                           ³   ³   ³   ÀÄÄÄÄÄÄÄÄÄÄ Noice enable 3/9\r
270                           ³   ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 4/10\r
271                           ³   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 5/11\r
272                           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Noice enable 6/12\r
273 \r
274 Setting a bit to 1 enables the voice. Clearing it to 0 disables the voice.\r
275 \r