Subversion Repositories svn.mios

Rev

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