summaryrefslogtreecommitdiff
path: root/include/alsa/sound/emu10k1.h
blob: ff2113a3db5d7301ccf86b57ba808cd2704ee342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
#ifndef __SOUND_EMU10K1_H
#define __SOUND_EMU10K1_H

/*
 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
 *                   Creative Labs, Inc.
 *  Definitions for EMU10K1 (SB Live!) chips
 *
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#include <stdint.h>

/*
 * ---- FX8010 ----
 */

#define EMU10K1_CARD_CREATIVE                   0x00000000
#define EMU10K1_CARD_EMUAPS                     0x00000001

#define EMU10K1_FX8010_PCM_COUNT                8

/* instruction set */
#define iMAC0    0x00   /* R = A + (X * Y >> 31)   ; saturation */
#define iMAC1    0x01   /* R = A + (-X * Y >> 31)  ; saturation */
#define iMAC2    0x02   /* R = A + (X * Y >> 31)   ; wraparound */
#define iMAC3    0x03   /* R = A + (-X * Y >> 31)  ; wraparound */
#define iMACINT0 0x04   /* R = A + X * Y           ; saturation */
#define iMACINT1 0x05   /* R = A + X * Y           ; wraparound (31-bit) */
#define iACC3    0x06   /* R = A + X + Y           ; saturation */
#define iMACMV   0x07   /* R = A, acc += X * Y >> 31 */
#define iANDXOR  0x08   /* R = (A & X) ^ Y */
#define iTSTNEG  0x09   /* R = (A >= Y) ? X : ~X */
#define iLIMITGE 0x0a   /* R = (A >= Y) ? X : Y */
#define iLIMITLT 0x0b   /* R = (A < Y) ? X : Y */
#define iLOG     0x0c   /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
#define iEXP     0x0d   /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
#define iINTERP  0x0e   /* R = A + (X * (Y - A) >> 31)  ; saturation */
#define iSKIP    0x0f   /* R = A (cc_reg), X (count), Y (cc_test) */

/* GPRs */
#define FXBUS(x)        (0x00 + (x))    /* x = 0x00 - 0x0f */
#define EXTIN(x)        (0x10 + (x))    /* x = 0x00 - 0x0f */
#define EXTOUT(x)       (0x20 + (x))    /* x = 0x00 - 0x0f */
#define C_00000000      0x40
#define C_00000001      0x41
#define C_00000002      0x42
#define C_00000003      0x43
#define C_00000004      0x44
#define C_00000008      0x45
#define C_00000010      0x46
#define C_00000020      0x47
#define C_00000100      0x48
#define C_00010000      0x49
#define C_00080000      0x4a
#define C_10000000      0x4b
#define C_20000000      0x4c
#define C_40000000      0x4d
#define C_80000000      0x4e
#define C_7fffffff      0x4f
#define C_ffffffff      0x50
#define C_fffffffe      0x51
#define C_c0000000      0x52
#define C_4f1bbcdc      0x53
#define C_5a7ef9db      0x54
#define C_00100000      0x55            /* ?? */
#define GPR_ACCU        0x56            /* ACCUM, accumulator */
#define GPR_COND        0x57            /* CCR, condition register */
#define GPR_NOISE0      0x58            /* noise source */
#define GPR_NOISE1      0x59            /* noise source */
#define GPR_IRQ         0x5a            /* IRQ register */
#define GPR_DBAC        0x5b            /* TRAM Delay Base Address Counter */
#define GPR(x)          (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
#define ITRAM_DATA(x)   (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_DATA(x)   (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
#define ITRAM_ADDR(x)   (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_ADDR(x)   (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */

#define A_FXBUS(x)      (0x00 + (x))    /* x = 0x00 - 0x3f? */
#define A_EXTIN(x)      (0x40 + (x))    /* x = 0x00 - 0x1f? */
#define A_EXTOUT(x)     (0x60 + (x))    /* x = 0x00 - 0x1f? */
#define A_GPR(x)        (A_FXGPREGBASE + (x))

/* cc_reg constants */
#define CC_REG_NORMALIZED C_00000001
#define CC_REG_BORROW   C_00000002
#define CC_REG_MINUS    C_00000004
#define CC_REG_ZERO     C_00000008
#define CC_REG_SATURATE C_00000010
#define CC_REG_NONZERO  C_00000100