Subversion Repositories svn.mios

Rev

Rev 194 | Rev 360 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
44 tk 1
; $Id: setup_mb6582.asm 285 2008-04-23 20:31:07Z tk $
194 tk 2
    LIST R=DEC
44 tk 3
;
4
; Individual Setup File for MB-6582
5
;
6
 
7
 
8
    ;; BankStick Chip Select Address for "ensembles"
9
    ;; -1: only one ensemble available, stored in internal EEPROM
10
    ;; 0..7: CS# configuration of BankStick (Pin 1, 2 and 3)
11
    ;; reminder for default value 7: Pin 1, 2 and 3 have connected to +5V
12
    ;; a 32k BankStick 24LC256 is sufficient for 128 storable ensembles
13
    ;; a 64k BankStick will also work, but doesn't increase the number of available ensembles
14
#define DEFAULT_ENS_BS_CS   7
15
 
16
    ;; select default filter calibration value
17
    ;; expecting 12bit values (0..4095)
18
    ;; will be overwritten by ensemble setting - this is only used as default value for BankStick initialisation!
19
#define DEFAULT_FILTER_CALI_MIN 0
20
#define DEFAULT_FILTER_CALI_MAX 1536
21
 
22
    ;; number of visible menu items on LCD
23
    ;; use:  4 for 2x16 displays
24
    ;;       5 for 2x20 displays
25
    ;;      10 for 2x40 displays
26
#define CS_MENU_DISPLAYED_ITEMS 5
27
    ;; NOTE: if CS_MENU_DISPLAYED_ITEMS > 5, you have to adapt the DIN settings
28
    ;; in cs_menu_io_tables.inc
29
 
30
    ;; Inc/Dec buttons or rotary encoder of data entry?
31
    ;; use:  0 if rotary encoder should be used 
32
    ;;         (pins of encoder are defined in mios_tables.inc)
33
    ;;       1 if buttons should be used instead
34
#define CS_MENU_USE_INCDEC_BUTTONS 0
35
 
36
    ;; 0: J5 has no function at all (analog inputs don't need to be connected to ground)
37
    ;; 1: J5 used for analog inputs - A0..A4 control Knob#1..#5, A5..A7 are not used at all
38
    ;; 2: J5 used as digital output (pins can be added in cs_menu_io_tables.inc as "shift register #0")
136 tk 39
    ;; 3: J5 used as digital output for external switches (replacement for DEFAULT_EXT_SWITCH_DOUT, AOUT_INTERFACE_TYPE must be != 0)
44 tk 40
#define DEFAULT_J5_FUNCTION 0
41
 
42
    ;; DOUT/DIN shift register matrix:
43
    ;; define the DOUT shift register (1-16) to which the cathodes are connected (common line driver)
44
    ;; 0 disables this shift register (doesn't make much sense)
45
#define DEFAULT_SRM_CATHODES        3
46
 
47
    ;; define the DOUT shift register (1-16) to which the anodes of the modulation matrix are connected
48
    ;; 0 disables this shift register
49
#define DEFAULT_SRM_MODMATRIX_DOUT  1
50
 
51
    ;; optional LED/Button Matrix (used by MB-6582 PCB to reduce number of shift registers)
52
    ;; define the DOUT shift register (1-16) to which the anodes of the LED matrix are connected
53
    ;; 0 disables the LED matrix function - LEDs have to be connected to individual DOUT pins
54
#define DEFAULT_SRM_LEDS_DOUT       2
55
 
56
    ;; define the DIN shift register (1-16) to which the button matrix is connected
57
    ;; 0 disables the button matrix function - Buttons have to be connected to individual DIN pins
58
#define DEFAULT_SRM_BUTTONS_DIN     5
59
 
60
    ;; define the number of shift registers (1-16) in the SRIO chain (DIN/DOUT shift registers)
61
    ;; use the number of the longest chain - e.g. 4 DOUT registers, 10 DIN registers: use 10
62
    ;; 0 disables the SRIO chain
63
#define DEFAULT_SRIO_NUMBER     10
64
 
65
 
136 tk 66
    ;; define the AOUT interface which is used here:
67
    ;;   1: one MBHP_AOUT module
68
    ;;   2: up to 4 (chained) MBHP_AOUT_LC modules
69
    ;;   3: one MBHP_AOUT_NG module
70
    ;; all other values invalid!
71
#define AOUT_INTERFACE_TYPE 0
72
 
73
    ;; only relevant if one or more AOUT_LC modules are used:
74
    ;; define the resolution configuration here
75
    ;;   0: first channel 12bit, second channel 4bit
76
    ;;   1: first channel 8bit, second channel 8bit
285 tk 77
    ;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
136 tk 78
    ;; all other values invalid!
79
#define AOUT_LC_RESOLUTION_OPTION_M1 0
80
#define AOUT_LC_RESOLUTION_OPTION_M2 0
81
#define AOUT_LC_RESOLUTION_OPTION_M3 0
82
#define AOUT_LC_RESOLUTION_OPTION_M4 0
83
 
84
 
44 tk 85
    ;; the 8 external switches can be routed to a DOUT shift register:
86
    ;; 0: not used
87
    ;; 1-16: DOUT SR#1..#16
88
#define DEFAULT_EXT_SWITCH_DOUT 0
89
 
90
    ;; 0: SwinSID extensions disabled
91
    ;; 1: SwinSID extensions enabled
92
#define ENABLE_SWINSID 0
93
 
94
    ;; assign the AOUT channels for the F2A (Filter to AOUT function) here
95
    ;; we have 4 assignments for CutOff Left/Right and Resonance Left/Right
96
    ;; 0 disables an assignment
97
#define DEFAULT_F2A_CUTOFF_L_AOUT   1
98
#define DEFAULT_F2A_RESONANCE_L_AOUT    2
99
#define DEFAULT_F2A_CUTOFF_R_AOUT   3
100
#define DEFAULT_F2A_RESONANCE_R_AOUT    4
101
 
102
    ;; assign the AOUT channel for the V2A (Volume to AOUT function) here
103
    ;; we have two assignments for the left/right SID channel
104
    ;; 0 disables an assignment
105
#define DEFAULT_V2A_VOLUME_L_AOUT   5
106
#define DEFAULT_V2A_VOLUME_R_AOUT   6
107
 
108
    ;; assign the AOUT channel for the P2A (Pulsewidth to AOUT function) here
109
    ;; we have six assignments for all oscillators (left/right channel)
110
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
111
    ;; 0 disables an assignment
112
#define DEFAULT_P2A_OSC1_L_AOUT     5
113
#define DEFAULT_P2A_OSC2_L_AOUT     0
114
#define DEFAULT_P2A_OSC3_L_AOUT     0
115
#define DEFAULT_P2A_OSC1_R_AOUT     6
116
#define DEFAULT_P2A_OSC2_R_AOUT     0
117
#define DEFAULT_P2A_OSC3_R_AOUT     0
118
 
119
    ;; assign the AOUT channel for the K2A (Key to AOUT function) here
120
    ;; we have six assignments for all oscillators (left/right channel)
121
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
122
    ;; 0 disables an assignment
123
#define DEFAULT_K2A_OSC1_L_AOUT     7
124
#define DEFAULT_K2A_OSC2_L_AOUT     0
125
#define DEFAULT_K2A_OSC3_L_AOUT     0
126
#define DEFAULT_K2A_OSC1_R_AOUT     8
127
#define DEFAULT_K2A_OSC2_R_AOUT     0
128
#define DEFAULT_K2A_OSC3_R_AOUT     0
129
 
130
    ;; assign the AOUT channel for the O2A (Oscillator Frequency to AOUT function) here
131
    ;; we have six assignments for all oscillators (left/right channel)
132
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
133
    ;; note also, that with O2A enabled, the connected SIDs won't output the correct frequencies anymore
134
    ;; 0 disables an assignment
135
#define DEFAULT_O2A_OSC1_L_AOUT     7
136
#define DEFAULT_O2A_OSC2_L_AOUT     0
137
#define DEFAULT_O2A_OSC3_L_AOUT     0
138
#define DEFAULT_O2A_OSC1_R_AOUT     8
139
#define DEFAULT_O2A_OSC2_R_AOUT     0
140
#define DEFAULT_O2A_OSC3_R_AOUT     0
141
 
142
    ;; gate/slide/accent of all 6 oscillators can be forwarded to the 8 digital outputs at J5
143
    ;; note that this overlays the switch assignments of the patch structure
144
    ;; DEFAULT_J5_FUNCTION should be set to 3 if you are plannung to use this function.
145
    ;; possible values: 0..8 - 0 disables an assignment
146
 
147
    ;; (gate supported by all engines)
148
#define DEFAULT_GATE_OSC1_L_OUT     1
149
#define DEFAULT_GATE_OSC2_L_OUT     0
150
#define DEFAULT_GATE_OSC3_L_OUT     0
151
#define DEFAULT_GATE_OSC1_R_OUT     2
152
#define DEFAULT_GATE_OSC2_R_OUT     0
153
#define DEFAULT_GATE_OSC3_R_OUT     0
154
 
155
    ;; (slide flag currently only supported by bassline engine)
156
#define DEFAULT_SLIDE_OSC1_L_OUT    0
157
#define DEFAULT_SLIDE_OSC2_L_OUT    0
158
#define DEFAULT_SLIDE_OSC3_L_OUT    0
159
#define DEFAULT_SLIDE_OSC1_R_OUT    0
160
#define DEFAULT_SLIDE_OSC2_R_OUT    0
161
#define DEFAULT_SLIDE_OSC3_R_OUT    0
162
 
163
    ;; (accent flag currently only supported by bassline and drum engine)
164
#define DEFAULT_ACCENT_OSC1_L_OUT   0
165
#define DEFAULT_ACCENT_OSC2_L_OUT   0
166
#define DEFAULT_ACCENT_OSC3_L_OUT   0
167
#define DEFAULT_ACCENT_OSC1_R_OUT   0
168
#define DEFAULT_ACCENT_OSC2_R_OUT   0
169
#define DEFAULT_ACCENT_OSC3_R_OUT   0
170
 
171
 
172
    ;; sets the default display mode for the LED matrix
173
    ;;    0: shows modulation assignments after power-on
174
    ;;    1: shows modulation meters after power-on
175
    ;; the mode can be toggled by pressing two mod target buttons at the same time (e.g. O1 and O2 Pitch)
176
#define DEFAULT_LEDMATRIX_MODE  0
177
 
178
    ;; if != 0, special variations for MB6582 hardware will be selected
179
#define DEFAULT_MB6582_CS   1
180
 
181
 
182
 
183
    org 0x3082      ; never change the origin!
184
; ==========================================================================
185
;  In this table all button functions are mapped to the DIN pins
186
;
187
;  The function name can be found on the left, the shift register and pin
188
;  number on the right side.
189
;
190
;  SR/pin numbers:
191
;     SR =  1 for the first DIN shift register
192
;     SR =  2 for the second DIN shift register
193
;     ...
194
;     SR = 16 for the last DIN shift register
195
;
196
;     Pin = 0 for the D0 input pin of the shift register
197
;     Pin = 1 for the D1 input pin of the shift register
198
;     ...
199
;     Pin = 7 for the last input pin (D7) of the shift register
200
;
201
;  Set the SR and pin number to 0 if a button function should not be used
202
;  or remove the entry
203
;
204
;  Add +16 to the SR number if the button is part of the button matrix
205
;  (DEFAULT_SRM_BUTTONS_DIN must be > 0!)
206
;
207
;  The table must be terminated with DIN_ENTRY_EOT!
208
; ==========================================================================
209
 
210
DIN_ENTRY MACRO function, sr, pin
211
    dw  function, (pin + 8*(sr-1)) & 0xff
212
    ENDM
213
 
214
DIN_ENTRY_EOT MACRO
215
    dw  0x0000, 0x0000
216
    ENDM
217
 
218
CS_MENU_DIN_TABLE
219
    DIN_ENTRY   CS_MENU_BUTTON_Sel1,     16+3,   0
220
    DIN_ENTRY   CS_MENU_BUTTON_Sel2,     16+3,   1
221
    DIN_ENTRY   CS_MENU_BUTTON_Sel3,     16+3,   2
222
    DIN_ENTRY   CS_MENU_BUTTON_Sel4,     16+3,   3
223
    DIN_ENTRY   CS_MENU_BUTTON_Sel5,     16+3,   4
224
    DIN_ENTRY   CS_MENU_BUTTON_Exec,     16+5,   3
225
    DIN_ENTRY   CS_MENU_BUTTON_Shift,    16+5,   0 ; **new** Shift button
226
    ;;DIN_ENTRY CS_MENU_BUTTON_???,  16+5,   2 ; **new** Menu Encoder button
227
 
228
    DIN_ENTRY   CS_MENU_BUTTON_PageDown, 16+4,   0 ; **new** Select A button (TK: could control PageDown)
229
    ;;DIN_ENTRY CS_MENU_BUTTON_???,  16+4,   1 ; **new** Select B button
230
    ;;DIN_ENTRY CS_MENU_BUTTON_???,  16+4,   2 ; **new** Select C button
231
    DIN_ENTRY   CS_MENU_BUTTON_PageUp,   16+4,   3 ; **new** Select D button (TK: could control PageUp)
232
 
233
    DIN_ENTRY   CS_MENU_BUTTON_SID1,     16+2,   3
234
    DIN_ENTRY   CS_MENU_BUTTON_SID2,     16+2,   2
235
    DIN_ENTRY   CS_MENU_BUTTON_SID3,     16+2,   1
236
    DIN_ENTRY   CS_MENU_BUTTON_SID4,     16+2,   0
237
    DIN_ENTRY   CS_MENU_BUTTON_Sync,     16+1,   0 ; **new** Sync button
238
    DIN_ENTRY   CS_MENU_BUTTON_CC,   16+1,   1
239
    DIN_ENTRY   CS_MENU_BUTTON_Edit,     16+1,   2
240
    DIN_ENTRY   CS_MENU_BUTTON_Play,     16+1,   3 ; **new** Play button
241
 
242
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Sel,  16+8,   2
243
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Ctrl, 16+8,   7
244
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Wav,  16+8,   1
245
    DIN_ENTRY   CS_MENU_BUTTON_Osc_RS,   16+8,   3
246
 
247
    DIN_ENTRY   CS_MENU_BUTTON_Fil_Sel,  16+8,   5
248
    DIN_ENTRY   CS_MENU_BUTTON_Fil_Mod,  16+8,   6
249
    DIN_ENTRY   CS_MENU_BUTTON_Fil_ExtIn,16+3,   7 ; **new** Filter Ext In button
250
 
251
    DIN_ENTRY   CS_MENU_BUTTON_LFO_Sel,  16+3,   5
252
    DIN_ENTRY   CS_MENU_BUTTON_LFO_Wav,  16+4,   6
253
 
254
    DIN_ENTRY   CS_MENU_BUTTON_Env_Sel,  16+8,   4
255
    DIN_ENTRY   CS_MENU_BUTTON_Env_Ctrl, 16+3,   6
256
    DIN_ENTRY   CS_MENU_BUTTON_SID_LR,   16+4,   5 ; **new** SID L/R button
257
 
258
    DIN_ENTRY   CS_MENU_BUTTON_M_O1Ptch, 16+7,   0
259
    DIN_ENTRY   CS_MENU_BUTTON_M_O2Ptch, 16+7,   1
260
    DIN_ENTRY   CS_MENU_BUTTON_M_O3Ptch, 16+7,   2
261
    DIN_ENTRY   CS_MENU_BUTTON_M_O1PW,   16+7,   3
262
    DIN_ENTRY   CS_MENU_BUTTON_M_O2PW,   16+7,   4
263
    DIN_ENTRY   CS_MENU_BUTTON_M_O3PW,   16+7,   5
264
    DIN_ENTRY   CS_MENU_BUTTON_M_Filter, 16+7,   6
265
    DIN_ENTRY   CS_MENU_BUTTON_M_Vol,    16+7,   7
266
 
267
    DIN_ENTRY   CS_MENU_BUTTON_M_E1,     16+6,   0
268
    DIN_ENTRY   CS_MENU_BUTTON_M_E2,     16+6,   1
269
    DIN_ENTRY   CS_MENU_BUTTON_M_L1,     16+6,   2
270
    DIN_ENTRY   CS_MENU_BUTTON_M_L2,     16+6,   3
271
    DIN_ENTRY   CS_MENU_BUTTON_M_L3,     16+6,   4
272
    DIN_ENTRY   CS_MENU_BUTTON_M_L4,     16+6,   5
273
    DIN_ENTRY   CS_MENU_BUTTON_M_L5,     16+6,   6
274
    DIN_ENTRY   CS_MENU_BUTTON_M_L6,     16+6,   7
275
 
276
    DIN_ENTRY   CS_MENU_BUTTON_M_Mode,   16+8,   0 ; **new** matrix mode button
277
 
278
    ;; don't remove this "end-of-table" entry!
279
    DIN_ENTRY_EOT
280
 
281
 
282
; ==========================================================================
283
;  The following table defines all available DOUT pins with the appr.
284
;  register and bit which is assigned to the pin
285
;  CS_MENU_LED_Update uses this table to update all LEDs
286
; 
287
;  The register name and bit number can be found on the left, 
288
;  the shift register and pin number on the right side.
289
;
290
;  SR/pin numbers:
291
;     SR =  0 for J5 pins (note: the DEFAULT_J5_FUNCTION switch has to be set to "2" to get this working)
292
;
293
;     SR =  1 for the first DOUT shift register
294
;     SR =  2 for the second DOUT shift register
295
;     ...
296
;     SR = 16 for the last DOUT shift register
297
;
298
;     Pin = 0 for the D7 output pin of the shift register
299
;     Pin = 1 for the D6 output pin of the shift register
300
;     ...
301
;     Pin = 7 for the last output pin (D0) of the shift register
302
;
303
;  Set the SR and pin number to 0 if a LED function should not be used
304
;
305
;  Add +16 to the SR number if the LED is part of the LED matrix
306
;  (DEFAULT_SRM_LEDS_DOUT must be > 0!)
307
;
308
;  The table must be terminated with DOUT_ENTRY_EOT!
309
; ==========================================================================
310
 
311
DOUT_ENTRY MACRO reg, bit, sr, pin
312
        if sr == 0      ; J5 selected
313
        dw  reg, bit | ((pin | 0x80) << 8)
314
    else            ; SR selected
315
        dw  reg, bit | ((pin + 8*(sr-1)) << 8)
316
    endif
317
    ENDM
318
 
319
DOUT_ENTRY_EOT MACRO
320
    dw  0x0000, 0x0000
321
    ENDM
322
 
323
CS_MENU_DOUT_TABLE
324
    ;;      Register and bit            SR# Pin#      Description
325
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 0,      16+2,   0   ; SID1 LED
326
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 1,      16+2,   1   ; SID2 LED
327
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 2,      16+2,   2   ; SID3 LED
328
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 3,      16+2,   3   ; SID4 LED
329
 
330
    ;;DOUT_ENTRY    CS_MENU_MODE, 0,            16+1,   3   ; Sync LED **new**
331
    DOUT_ENTRY  CS_MENU_MODE, 1,            16+1,   2   ; CC LED
332
    DOUT_ENTRY  CS_MENU_MODE, 4,            16+1,   1   ; Edit LED
333
    DOUT_ENTRY  TMP5, 6,                16+1,   0   ; Play LED **new**
334
 
335
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 0,      16+7,   5   ; OSC1 LED
336
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 1,      16+7,   6   ; OSC2 LED
337
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 2,      16+7,   7   ; OSC3 LED
338
 
339
    DOUT_ENTRY  TMP1, 0,                16+8,   3   ; OSC Env LED
340
    DOUT_ENTRY  TMP1, 1,                16+8,   2   ; OSC Misc LED
341
    DOUT_ENTRY  TMP1, 2,                16+8,   1   ; OSC Assign LED
342
 
343
    DOUT_ENTRY  TMP1, 4,                16+6,   4   ; OSC Triangle LED
344
    DOUT_ENTRY  TMP1, 5,                16+6,   5   ; OSC Saw LED
345
    DOUT_ENTRY  TMP1, 6,                16+6,   6   ; OSC Pulse LED
346
    DOUT_ENTRY  TMP1, 7,                16+6,   7   ; OSC Noise LED
347
 
348
    DOUT_ENTRY  TMP2, 0,                16+5,   7   ; OSC Sync LED
349
    DOUT_ENTRY  TMP2, 1,                16+5,   6   ; OSC Ring LED
350
 
351
    DOUT_ENTRY  TMP3, 0,                16+4,   7   ; Filter O1 LED
352
    DOUT_ENTRY  TMP3, 1,                16+4,   6   ; Filter O2 LED
353
    DOUT_ENTRY  TMP3, 2,                16+4,   5   ; Filter O3 LED
354
    DOUT_ENTRY  TMP3, 3,                16+3,   4   ; Filter Ext LED
355
 
356
    DOUT_ENTRY  TMP3, 4,                16+3,   5   ; Filter LP LED
357
    DOUT_ENTRY  TMP3, 5,                16+3,   6   ; Filter BP LED
358
    DOUT_ENTRY  TMP3, 6,                16+3,   7   ; Filter HP LED
359
 
360
    DOUT_ENTRY  TMP2, 4,                16+5,   4   ; ENV1 LED
361
    DOUT_ENTRY  TMP2, 5,                16+5,   5   ; ENV2 LED
362
 
363
    DOUT_ENTRY  TMP2, 6,                16+7,   3   ; ENV Ctrl LED
364
    DOUT_ENTRY  TMP5, 7,                16+7,   2   ; ENV Misc LED **new**
365
    DOUT_ENTRY  TMP2, 7,                16+7,   1   ; ENV Assign LED
366
 
367
    DOUT_ENTRY  TMP4, 6,                16+6,   3   ; SID L LED **new**
368
    DOUT_ENTRY  TMP4, 7,                16+6,   2   ; SID R LED **new**
369
    ;;DOUT_ENTRY    TMP3, 6,                16+6,   1   ; **unused**
370
 
371
    DOUT_ENTRY  TMP4, 0,                16+3,   3   ; LFO1 LED
372
    DOUT_ENTRY  TMP4, 1,                16+3,   2   ; LFO2 LED
373
    DOUT_ENTRY  TMP4, 2,                16+3,   1   ; LFO3 LED
374
    DOUT_ENTRY  TMP4, 3,                16+3,   0   ; LFO4 LED
375
    DOUT_ENTRY  TMP4, 4,                16+4,   3   ; LFO5 LED
376
    DOUT_ENTRY  TMP4, 5,                16+4,   2   ; LFO6 LED
377
 
378
    DOUT_ENTRY  TMP5, 0,                16+4,   0   ; LFO Sine LED
379
    DOUT_ENTRY  TMP5, 1,                16+4,   1   ; LFO Triangle LED
380
    DOUT_ENTRY  TMP5, 2,                16+5,   3   ; LFO Saw LED
381
    DOUT_ENTRY  TMP5, 3,                16+5,   2   ; LFO Pulse LED
382
    DOUT_ENTRY  TMP5, 4,                16+5,   1   ; LFO Random LED
383
    DOUT_ENTRY  TMP5, 5,                16+5,   0   ; LFO Positive LED **new**
384
 
385
    DOUT_ENTRY  TMP2, 3,                16+8,   7   ; Mode Matrix LED **new**
386
    DOUT_ENTRY  TMP2, 2,                16+8,   6   ; Mode Meter LED **new**
387
    ;;DOUT_ENTRY    TMP2, 2,                16+8,   5   ; **unused**
388
    ;;DOUT_ENTRY    TMP2, 2,                16+8,   4   ; **unused**
389
    ;;DOUT_ENTRY    TMP2, 2,                16+7,   4   ; **unused**
390
 
391
    ;; don't remove this "end-of-table" entry!
392
    DOUT_ENTRY_EOT
393
 
394
 
395
;; --------------------------------------------------------------------------
396
;; In this table DIN pins have to be assigned to rotary encoders for the
397
;; MIOS_ENC driver 
398
;; 
399
;; up to 64 entries are provided, for MIDIbox SID 15 entries are expected
400
;; 
401
;; The table must be terminated with an ENC_EOT entry.
402
;; 
403
;; ENC_ENTRY provides following parameters
404
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
405
;;    o second parameter: number of pin; since two pins are necessary
406
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
407
;;    o the third parameter contains the encoder mode:
408
;;      either MIOS_ENC_MODE_NON_DETENTED
409
;;          or MIOS_ENC_MODE_DETENTED1
410
;;          or MIOS_ENC_MODE_DETENTED2
411
;;          or MIOS_ENC_MODE_DETENTED3
412
;;      see also http://www.midibox.org/dokuwiki/doku.php?id=encoder_types
413
;;
414
;; Configuration Examples:
415
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
416
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
417
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
418
;; --------------------------------------------------------------------------
419
    org 0x3280      ; never change the origin!
420
 
421
    ;; encoder entry structure
422
ENC_ENTRY MACRO sr, din_0, mode
423
    dw  (mode << 8) | (din_0 + 8*(sr-1))
424
    ENDM   
425
ENC_EOT MACRO
426
    dw  0xffff
427
    ENDM
428
 
429
MIOS_ENC_PIN_TABLE
430
    ;;        SR  Pin  Mode
431
#if CS_MENU_USE_INCDEC_BUTTONS == 0
432
    ENC_ENTRY  1,  6,  MIOS_ENC_MODE_DETENTED2  ; menu encoder
433
#endif
434
 
435
    ;; additional CS encoders
436
    ;;        SR  Pin  Mode
437
    ENC_ENTRY  4,  4,  MIOS_ENC_MODE_DETENTED2  ; Osc delay/transpose/assign #1
438
    ENC_ENTRY  3,  0,  MIOS_ENC_MODE_DETENTED2  ; Osc attack/finetune/assign #2
439
    ENC_ENTRY  3,  4,  MIOS_ENC_MODE_DETENTED2  ; Osc decay/portamento/assign #3
440
    ENC_ENTRY  2,  0,  MIOS_ENC_MODE_DETENTED2  ; Osc sustain/arpeggiator/assign #4
441
    ENC_ENTRY  2,  4,  MIOS_ENC_MODE_DETENTED2  ; Osc release/pulsewidth/assign #5
442
 
443
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED2  ; LFO rate
444
    ENC_ENTRY  1,  4,  MIOS_ENC_MODE_DETENTED2  ; LFO depth
445
 
446
    ENC_ENTRY  4,  2,  MIOS_ENC_MODE_DETENTED2  ; Filter CutOff
447
    ENC_ENTRY  4,  6,  MIOS_ENC_MODE_DETENTED2  ; Filter Resonance
448
 
449
    ENC_ENTRY  3,  2,  MIOS_ENC_MODE_DETENTED2  ; Env depth/assign #1
450
    ENC_ENTRY  3,  6,  MIOS_ENC_MODE_DETENTED2  ; Env attack/assign #2
451
    ENC_ENTRY  2,  2,  MIOS_ENC_MODE_DETENTED2  ; Env decay/assign #3
452
    ENC_ENTRY  2,  6,  MIOS_ENC_MODE_DETENTED2  ; Env sustain/assign #4
453
    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED2  ; Env release/assign #5
454
 
455
    ;; don't remove this "end-of-table" entry!
456
    ENC_EOT
457
 
458
 
459
;; include the rest of the application
460
#include "src/main.inc"