Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
828 tk 1
; $Id: setup_sammich_sid.asm 1102 2012-12-30 20:39:10Z tk $
2
    LIST R=DEC
3
;
866 nils 4
; Prepared Setup File for sammichSID 
828 tk 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_DIN_TABLE below
28
 
29
    ;; number of LCD lines (supported: 2 for 2x* LCDs and 4 for 4x* LCDs)
30
#define DEFAULT_LCD_LINES 2
31
 
32
    ;; LCD line -> cursor offsets
33
#define DEFAULT_LCD_LINE_Y0 0x00
34
#define DEFAULT_LCD_LINE_Y1 0x40
35
#define DEFAULT_LCD_LINE_Y2 0x14
36
#define DEFAULT_LCD_LINE_Y3 0x54
37
 
38
    ;; 1: LCD cursor will be set to current parameter position (clashes with bar graph which is enabled with DEFAULT_LCD_LINES >= 4)
39
    ;; 0: disable this feature
40
#define DEFAULT_LCD_PRINT_CURSOR 0
41
 
42
    ;; Inc/Dec buttons or rotary encoder of data entry?
43
    ;; use:  0 if rotary encoder should be used 
44
    ;;         (pins of encoder are defined in MIOS_ENC_PIN_TABLE in this file)
45
    ;;       1 if buttons should be used instead
46
#define CS_MENU_USE_INCDEC_BUTTONS 0
47
 
48
    ;; 0: J5 has no function at all (analog inputs don't need to be connected to ground)
49
    ;; 1: J5 used for analog inputs - A0..A4 control Knob#1..#5, A5..A7 are not used at all
50
    ;; 2: J5 used as digital output (pins can be added in CS_MENU_DOUT_TABLE as "shift register #0")
51
    ;; 3: J5 used as digital output for external switches (replacement for DEFAULT_EXT_SWITCH_DOUT, AOUT_INTERFACE_TYPE must be != 0)
52
#define DEFAULT_J5_FUNCTION 0
53
 
54
    ;; DOUT/DIN shift register matrix:
55
    ;; define the DOUT shift register (1-16) to which the cathodes are connected (common line driver)
56
    ;; 0 disables this shift register (doesn't make much sense)
835 tk 57
#define DEFAULT_SRM_CATHODES        1
828 tk 58
 
59
    ;; define the DOUT shift register (1-16) to which the anodes of the modulation matrix are connected
60
    ;; 0 disables this shift register
835 tk 61
#define DEFAULT_SRM_MODMATRIX_DOUT  2
828 tk 62
 
63
    ;; optional LED/Button Matrix (used by "Wilba's Board" to reduce number of shift registers)
64
    ;; define the DOUT shift register (1-16) to which the anodes of the LED matrix are connected
65
    ;; 0 disables the LED matrix function - LEDs have to be connected to individual DOUT pins
66
#define DEFAULT_SRM_LEDS_DOUT       0
67
 
68
    ;; define the DIN shift register (1-16) to which the button matrix is connected
69
    ;; 0 disables the button matrix function - Buttons have to be connected to individual DIN pins
70
#define DEFAULT_SRM_BUTTONS_DIN     0
71
 
72
    ;; define the number of shift registers (1-16) in the SRIO chain (DIN/DOUT shift registers)
73
    ;; use the number of the longest chain - e.g. 4 DOUT registers, 10 DIN registers: use 10
74
    ;; 0 disables the SRIO chain
835 tk 75
#define DEFAULT_SRIO_NUMBER     2
828 tk 76
 
77
 
78
    ;; define the AOUT interface which is used here:
79
    ;;   1: one MBHP_AOUT module
80
    ;;   2: up to 4 (chained) MBHP_AOUT_LC modules
81
    ;;   3: one MBHP_AOUT_NG module
82
    ;; all other values invalid!
83
#define AOUT_INTERFACE_TYPE 0
84
 
85
    ;; only relevant if one or more AOUT_LC modules are used:
86
    ;; define the resolution configuration here
87
    ;;   0: first channel 12bit, second channel 4bit
88
    ;;   1: first channel 8bit, second channel 8bit
89
    ;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
90
    ;; all other values invalid!
91
#define AOUT_LC_RESOLUTION_OPTION_M1 0
92
#define AOUT_LC_RESOLUTION_OPTION_M2 0
93
#define AOUT_LC_RESOLUTION_OPTION_M3 0
94
#define AOUT_LC_RESOLUTION_OPTION_M4 0
95
 
96
 
97
    ;; the 8 external switches can be routed to a DOUT shift register:
98
    ;; 0: not used
99
    ;; 1-16: DOUT SR#1..#16
100
#define DEFAULT_EXT_SWITCH_DOUT 0
101
 
102
    ;; 0: SwinSID extensions disabled
103
    ;; 1: SwinSID extensions enabled
104
#define DEFAULT_ENABLE_SWINSID 0
105
 
106
    ;; 0: only waveform 0-8 selectable
107
    ;; 1: waveform 0-15 selectable (e.g. for selecting additional SwinSID Waveforms)
108
#define DEFAULT_ENABLE_UPPER_WAVEFORMS 0
109
 
110
    ;; assign the AOUT channels for the F2A (Filter to AOUT function) here
111
    ;; we have 4 assignments for CutOff Left/Right and Resonance Left/Right
112
    ;; 0 disables an assignment
113
#define DEFAULT_F2A_CUTOFF_L_AOUT   1
114
#define DEFAULT_F2A_RESONANCE_L_AOUT    2
115
#define DEFAULT_F2A_CUTOFF_R_AOUT   3
116
#define DEFAULT_F2A_RESONANCE_R_AOUT    4
117
 
118
    ;; assign the AOUT channel for the V2A (Volume to AOUT function) here
119
    ;; we have two assignments for the left/right SID channel
120
    ;; 0 disables an assignment
121
#define DEFAULT_V2A_VOLUME_L_AOUT   5
122
#define DEFAULT_V2A_VOLUME_R_AOUT   6
123
 
124
    ;; assign the AOUT channel for the P2A (Pulsewidth to AOUT function) here
125
    ;; we have six assignments for all oscillators (left/right channel)
126
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
127
    ;; 0 disables an assignment
128
#define DEFAULT_P2A_OSC1_L_AOUT     5
129
#define DEFAULT_P2A_OSC2_L_AOUT     0
130
#define DEFAULT_P2A_OSC3_L_AOUT     0
131
#define DEFAULT_P2A_OSC1_R_AOUT     6
132
#define DEFAULT_P2A_OSC2_R_AOUT     0
133
#define DEFAULT_P2A_OSC3_R_AOUT     0
134
 
135
    ;; assign the AOUT channel for the K2A (Key to AOUT function) here
136
    ;; we have six assignments for all oscillators (left/right channel)
137
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
138
    ;; 0 disables an assignment
139
#define DEFAULT_K2A_OSC1_L_AOUT     7
140
#define DEFAULT_K2A_OSC2_L_AOUT     0
141
#define DEFAULT_K2A_OSC3_L_AOUT     0
142
#define DEFAULT_K2A_OSC1_R_AOUT     8
143
#define DEFAULT_K2A_OSC2_R_AOUT     0
144
#define DEFAULT_K2A_OSC3_R_AOUT     0
145
 
146
    ;; assign the AOUT channel for the O2A (Oscillator Frequency to AOUT function) here
147
    ;; we have six assignments for all oscillators (left/right channel)
148
    ;; note that there is a channel conflict between other *2A functions - adaption for your setup required!
149
    ;; note also, that with O2A enabled, the connected SIDs won't output the correct frequencies anymore
150
    ;; 0 disables an assignment
151
#define DEFAULT_O2A_OSC1_L_AOUT     7
152
#define DEFAULT_O2A_OSC2_L_AOUT     0
153
#define DEFAULT_O2A_OSC3_L_AOUT     0
154
#define DEFAULT_O2A_OSC1_R_AOUT     8
155
#define DEFAULT_O2A_OSC2_R_AOUT     0
156
#define DEFAULT_O2A_OSC3_R_AOUT     0
157
 
990 tk 158
    ;; gate/slide/accent of all 6 oscillators + filter flags can be forwarded to the 8 digital outputs at J5
828 tk 159
    ;; note that this overlays the switch assignments of the patch structure
160
    ;; DEFAULT_J5_FUNCTION should be set to 3 if you are plannung to use this function.
161
    ;; possible values: 0..8 - 0 disables an assignment
162
 
163
    ;; (gate supported by all engines)
164
#define DEFAULT_GATE_OSC1_L_OUT     1
165
#define DEFAULT_GATE_OSC2_L_OUT     0
166
#define DEFAULT_GATE_OSC3_L_OUT     0
167
#define DEFAULT_GATE_OSC1_R_OUT     2
168
#define DEFAULT_GATE_OSC2_R_OUT     0
169
#define DEFAULT_GATE_OSC3_R_OUT     0
170
 
171
    ;; (slide flag currently only supported by bassline engine)
172
#define DEFAULT_SLIDE_OSC1_L_OUT    0
173
#define DEFAULT_SLIDE_OSC2_L_OUT    0
174
#define DEFAULT_SLIDE_OSC3_L_OUT    0
175
#define DEFAULT_SLIDE_OSC1_R_OUT    0
176
#define DEFAULT_SLIDE_OSC2_R_OUT    0
177
#define DEFAULT_SLIDE_OSC3_R_OUT    0
178
 
179
    ;; (accent flag currently only supported by bassline and drum engine)
180
#define DEFAULT_ACCENT_OSC1_L_OUT   0
181
#define DEFAULT_ACCENT_OSC2_L_OUT   0
182
#define DEFAULT_ACCENT_OSC3_L_OUT   0
183
#define DEFAULT_ACCENT_OSC1_R_OUT   0
184
#define DEFAULT_ACCENT_OSC2_R_OUT   0
185
#define DEFAULT_ACCENT_OSC3_R_OUT   0
186
 
990 tk 187
    ;; filter flags supported by all engines
188
#define DEFAULT_FILTER_LP_L_OUT     0
189
#define DEFAULT_FILTER_BP_L_OUT     0
190
#define DEFAULT_FILTER_HP_L_OUT     0
828 tk 191
 
990 tk 192
#define DEFAULT_FILTER_LP_R_OUT     0
193
#define DEFAULT_FILTER_BP_R_OUT     0
194
#define DEFAULT_FILTER_HP_R_OUT     0
195
 
196
#define DEFAULT_FILTER_O1_L_OUT     0
197
#define DEFAULT_FILTER_O2_L_OUT     0
198
#define DEFAULT_FILTER_O3_L_OUT     0
199
#define DEFAULT_FILTER_EXTIN_L_OUT  0
200
 
201
#define DEFAULT_FILTER_O1_R_OUT     0
202
#define DEFAULT_FILTER_O2_R_OUT     0
203
#define DEFAULT_FILTER_O3_R_OUT     0
204
#define DEFAULT_FILTER_EXTIN_R_OUT  0
205
 
206
    ;; selected waveform supported by all engines
207
#define DEFAULT_WAVE_O1_L_TRI       0
208
#define DEFAULT_WAVE_O1_L_SAW       0
209
#define DEFAULT_WAVE_O1_L_PULSE     0
210
#define DEFAULT_WAVE_O1_L_NOISE     0
211
 
212
#define DEFAULT_WAVE_O2_L_TRI       0
213
#define DEFAULT_WAVE_O2_L_SAW       0
214
#define DEFAULT_WAVE_O2_L_PULSE     0
215
#define DEFAULT_WAVE_O2_L_NOISE     0
216
 
217
#define DEFAULT_WAVE_O3_L_TRI       0
218
#define DEFAULT_WAVE_O3_L_SAW       0
219
#define DEFAULT_WAVE_O3_L_PULSE     0
220
#define DEFAULT_WAVE_O3_L_NOISE     0
221
 
222
#define DEFAULT_WAVE_O1_R_TRI       0
223
#define DEFAULT_WAVE_O1_R_SAW       0
224
#define DEFAULT_WAVE_O1_R_PULSE     0
225
#define DEFAULT_WAVE_O1_R_NOISE     0
226
 
227
#define DEFAULT_WAVE_O2_R_TRI       0
228
#define DEFAULT_WAVE_O2_R_SAW       0
229
#define DEFAULT_WAVE_O2_R_PULSE     0
230
#define DEFAULT_WAVE_O2_R_NOISE     0
231
 
232
#define DEFAULT_WAVE_O3_R_TRI       0
233
#define DEFAULT_WAVE_O3_R_SAW       0
234
#define DEFAULT_WAVE_O3_R_PULSE     0
235
#define DEFAULT_WAVE_O3_R_NOISE     0
236
 
237
 
828 tk 238
    ;; sets the default display mode for the LED matrix
239
    ;;    0: shows modulation assignments after power-on
240
    ;;    1: shows modulation meters after power-on
241
    ;; mode 0/1 can be toggled by pressing two mod target buttons at the same time (e.g. O1 and O2 Pitch)
242
    ;; or by using a dedicated button (-> CS_MENU_BUTTON_M_Mode)
835 tk 243
#define DEFAULT_LEDMATRIX_MODE  1
828 tk 244
 
245
    ;; if != 0, special variations for MB6582 hardware will be selected
246
#define DEFAULT_MB6582_CS   0
247
 
835 tk 248
    ;; if != 0, special variations for sammichSID hardware will be selected
249
#define DEFAULT_SAMMICHSID_CS   1
250
 
828 tk 251
    ;; if != 0, EDIT button won't store patch
252
    ;; actually this doesn't really make sense - but this function could be useful if you
253
    ;; want to demonstrate your MBSID to friends and ensure, that they won't unintentionally
254
    ;; overwrite your patches
255
#define DEFAULT_DISABLE_EDIT_STORE_FUNCTION 0
256
 
934 tk 257
    ;; this switch enables the CC#32 filter for programs which send this CC always
258
    ;; together with CC#0 on bank changes
259
#define DEFAULT_CC32_FILTER 0
828 tk 260
 
934 tk 261
 
828 tk 262
    org 0x3082      ; never change the origin!
263
; ==========================================================================
264
;  In this table all button functions are mapped to the DIN pins
265
;
266
;  The function name can be found on the left, the shift register and pin
267
;  number on the right side.
268
;
269
;  SR/pin numbers:
270
;     SR =  1 for the first DIN shift register
271
;     SR =  2 for the second DIN shift register
272
;     ...
273
;     SR = 16 for the last DIN shift register
274
;
275
;     Pin = 0 for the D0 input pin of the shift register
276
;     Pin = 1 for the D1 input pin of the shift register
277
;     ...
278
;     Pin = 7 for the last input pin (D7) of the shift register
279
;
280
;  Set the SR and pin number to 0 if a button function should not be used
281
;  or remove the entry
282
;
283
;  Add +16 to the SR number if the button is part of the button matrix
284
;  (DEFAULT_SRM_BUTTONS_DIN must be > 0!)
285
;
286
;  The table must be terminated with DIN_ENTRY_EOT!
287
; ==========================================================================
288
 
289
DIN_ENTRY MACRO function, sr, pin
290
    dw  function, (pin + 8*(sr-1)) & 0xff
291
    ENDM
292
 
293
DIN_ENTRY_EOT MACRO
294
    dw  0x0000, 0x0000
295
    ENDM
296
 
297
CS_MENU_DIN_TABLE
298
    ;;      Function name       SR# Pin#
835 tk 299
    DIN_ENTRY   CS_MENU_BUTTON_Dec,  0,  0  ; only valid if rotary encoder not assigned to these pins
300
    DIN_ENTRY   CS_MENU_BUTTON_Inc,  0,  0  ; (see MIOS_ENC_PIN_TABLE) and CS_MENU_USE_INCDEC_BUTTONS == 1
301
    DIN_ENTRY   CS_MENU_BUTTON_Exec,     2,  0
302
    DIN_ENTRY   CS_MENU_BUTTON_Sel1,     1,  4
303
    DIN_ENTRY   CS_MENU_BUTTON_Sel2,     1,  5
304
    DIN_ENTRY   CS_MENU_BUTTON_Sel3,     1,  6
305
    DIN_ENTRY   CS_MENU_BUTTON_Sel4,     1,  7
306
    DIN_ENTRY   CS_MENU_BUTTON_Sel5,     1,  0
828 tk 307
    DIN_ENTRY   CS_MENU_BUTTON_Sel6,     0,  0  ; define this if CS_MENU_DISPLAYED_ITEMS > 5
308
    DIN_ENTRY   CS_MENU_BUTTON_Sel7,     0,  0  ; define this if CS_MENU_DISPLAYED_ITEMS > 5
309
    DIN_ENTRY   CS_MENU_BUTTON_Sel8,     0,  0  ; define this if CS_MENU_DISPLAYED_ITEMS > 5
310
    DIN_ENTRY   CS_MENU_BUTTON_Sel9,     0,  0  ; define this if CS_MENU_DISPLAYED_ITEMS > 5
311
    DIN_ENTRY   CS_MENU_BUTTON_Sel10,    0,  0  ; define this if CS_MENU_DISPLAYED_ITEMS > 5
312
 
835 tk 313
    DIN_ENTRY   CS_MENU_BUTTON_SID1,     0,      0
314
    DIN_ENTRY   CS_MENU_BUTTON_SID2,     0,      0
315
    DIN_ENTRY   CS_MENU_BUTTON_SID3,     0,      0
316
    DIN_ENTRY   CS_MENU_BUTTON_SID4,     0,      0
317
    DIN_ENTRY   CS_MENU_BUTTON_Shift,    2,  2  ; was: link button
318
    DIN_ENTRY   CS_MENU_BUTTON_CC_PageUp, 2,     1  ; combined CC/PageUp -- CC actived together with shift button (no error)
319
    DIN_ENTRY   CS_MENU_BUTTON_Edit_PageDown, 2, 3  ; combined Edit/PageDown -- Edit actived together with shift button (no error)
828 tk 320
 
835 tk 321
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Sel,  0,  0
322
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Ctrl, 0,  0
323
    DIN_ENTRY   CS_MENU_BUTTON_Osc_Wav,  0,  0
324
    DIN_ENTRY   CS_MENU_BUTTON_Osc_RS,   0,  0
828 tk 325
 
835 tk 326
    DIN_ENTRY   CS_MENU_BUTTON_LFO_Sel,  0,  0
327
    DIN_ENTRY   CS_MENU_BUTTON_LFO_Wav,  0,  0
828 tk 328
 
835 tk 329
    DIN_ENTRY   CS_MENU_BUTTON_Env_Sel,  0,  0
330
    DIN_ENTRY   CS_MENU_BUTTON_Env_Ctrl, 0,  0
828 tk 331
 
835 tk 332
    DIN_ENTRY   CS_MENU_BUTTON_Fil_Sel,  0,  0
333
    DIN_ENTRY   CS_MENU_BUTTON_Fil_Mod,  0,  0
828 tk 334
 
835 tk 335
    DIN_ENTRY   CS_MENU_BUTTON_M_O1Ptch, 0,  0
336
    DIN_ENTRY   CS_MENU_BUTTON_M_O2Ptch, 0,  0
337
    DIN_ENTRY   CS_MENU_BUTTON_M_O3Ptch, 0,  0
338
    DIN_ENTRY   CS_MENU_BUTTON_M_O1PW,   0,  0
339
    DIN_ENTRY   CS_MENU_BUTTON_M_O2PW,   0,  0
340
    DIN_ENTRY   CS_MENU_BUTTON_M_O3PW,   0,  0
341
    DIN_ENTRY   CS_MENU_BUTTON_M_Filter, 0,  0
342
    DIN_ENTRY   CS_MENU_BUTTON_M_E1,     0,  0
343
    DIN_ENTRY   CS_MENU_BUTTON_M_E2,     0,  0
344
    DIN_ENTRY   CS_MENU_BUTTON_M_L1,     0,  0
345
    DIN_ENTRY   CS_MENU_BUTTON_M_L2,     0,  0
346
    DIN_ENTRY   CS_MENU_BUTTON_M_L3,     0,  0
347
    DIN_ENTRY   CS_MENU_BUTTON_M_L4,     0,  0
348
    DIN_ENTRY   CS_MENU_BUTTON_M_L5,     0,  0
349
    DIN_ENTRY   CS_MENU_BUTTON_M_L6,     0,  0
828 tk 350
 
351
    ;; new for MBSID V2 (additional ***optional*** buttons)
352
    ;; don't worry, you still have full access to all functions w/o these buttons!
353
    ;; note that you could also re-arrange the pin assignments if required (e.g. if you don't like a certain button function)
835 tk 354
    DIN_ENTRY   CS_MENU_BUTTON_M_Vol,    0,  0  ; matrix: button below M_Filter
355
    DIN_ENTRY   CS_MENU_BUTTON_Play,     1,  3  ; direct access to play function
869 tk 356
    DIN_ENTRY   CS_MENU_BUTTON_SID_LR,   0,  0  ; direct access to L/R toggling
866 nils 357
    DIN_ENTRY   CS_MENU_BUTTON_M_Mode,   0,  0  ; direct access to meter on/off function
835 tk 358
    DIN_ENTRY   CS_MENU_BUTTON_Fil_ExtIn, 0, 0  ; direct access to Filter ExtIn Flag
359
    DIN_ENTRY   CS_MENU_BUTTON_Sync,     0,  0  ; jumps to ENS->CLK menu
869 tk 360
    DIN_ENTRY   CS_MENU_BUTTON_Arp,  1,  1  ; enables/disables the arpeggiator of *all* oscillators
361
    DIN_ENTRY   CS_MENU_BUTTON_Knob,     1,      2  ; changes to knob menu
828 tk 362
 
835 tk 363
    ;; sammichSID buttons (SR#, Pin#) are F1=1,3 F2=1,2 F3=1,1
364
 
828 tk 365
    ;; don't remove this "end-of-table" entry!
366
    DIN_ENTRY_EOT
367
 
368
 
369
; ==========================================================================
370
;  The following table defines all available DOUT pins with the appr.
371
;  register and bit which is assigned to the pin
372
;  CS_MENU_LED_Update uses this table to update all LEDs
373
; 
374
;  The register name and bit number can be found on the left, 
375
;  the shift register and pin number on the right side.
376
;
377
;  SR/pin numbers:
378
;     SR =  0 for J5 pins (note: the DEFAULT_J5_FUNCTION switch has to be set to "2" to get this working)
379
;
380
;     SR =  1 for the first DOUT shift register
381
;     SR =  2 for the second DOUT shift register
382
;     ...
383
;     SR = 16 for the last DOUT shift register
384
;
385
;     Pin = 0 for the D7 output pin of the shift register
386
;     Pin = 1 for the D6 output pin of the shift register
387
;     ...
388
;     Pin = 7 for the last output pin (D0) of the shift register
389
;
390
;  Set the SR and pin number to 0 if a LED function should not be used
391
;
392
;  Add +16 to the SR number if the LED is part of the LED matrix
393
;  (DEFAULT_SRM_LEDS_DOUT must be > 0!)
394
;
395
;  The table must be terminated with DOUT_ENTRY_EOT!
396
; ==========================================================================
397
 
398
DOUT_ENTRY MACRO reg, bit, sr, pin
399
        if sr == 0      ; J5 selected
400
        dw  reg, bit | ((pin | 0x80) << 8)
401
    else            ; SR selected
402
        dw  reg, bit | ((pin + 8*(sr-1)) << 8)
403
    endif
404
    ENDM
405
 
406
DOUT_ENTRY_EOT MACRO
407
    dw  0x0000, 0x0000
408
    ENDM
409
 
410
CS_MENU_DOUT_TABLE
411
    ;;      Register and bit            SR# Pin#      Description
835 tk 412
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 0,      0,  0   ; SID1 LED (Note: Pin #0 is the D7 output of first SR)
413
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 1,      0,  0   ; SID2 LED
414
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 2,      0,  0   ; SID3 LED
415
    DOUT_ENTRY  CS_MENU_SELECTED_SID_FLAGS, 3,      0,  0   ; SID4 LED
828 tk 416
 
835 tk 417
    DOUT_ENTRY  CS_MENU_MODE, 0,            0,  0   ; Shift LED
418
    DOUT_ENTRY  CS_MENU_MODE, 1,            0,  0   ; CC LED
419
    DOUT_ENTRY  CS_MENU_MODE, 4,            0,  0   ; Edit LED
828 tk 420
 
835 tk 421
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 0,      0,  0   ; OSC1 LED
422
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 1,      0,  0   ; OSC2 LED
423
    DOUT_ENTRY  CS_MENU_SELECTED_OSC_FLAGS, 2,      0,  0   ; OSC3 LED
828 tk 424
 
835 tk 425
    DOUT_ENTRY  TMP1, 0,                0,  0   ; OSC Env LED
426
    DOUT_ENTRY  TMP1, 1,                0,  0   ; OSC Misc LED
427
    DOUT_ENTRY  TMP1, 2,                0,  0   ; OSC Assign LED
828 tk 428
 
835 tk 429
    DOUT_ENTRY  TMP1, 4,                0,  0   ; OSC Triangle LED
430
    DOUT_ENTRY  TMP1, 5,                0,  0   ; OSC Saw LED
431
    DOUT_ENTRY  TMP1, 6,                0,  0   ; OSC Pulse LED
432
    DOUT_ENTRY  TMP1, 7,                0,  0   ; OSC Noise LED
828 tk 433
 
835 tk 434
    DOUT_ENTRY  TMP2, 0,                0,  0   ; OSC Sync LED
435
    DOUT_ENTRY  TMP2, 1,                0,  0   ; OSC Ring LED
828 tk 436
 
835 tk 437
    DOUT_ENTRY  TMP3, 0,                0,  0   ; Filter O1 LED
438
    DOUT_ENTRY  TMP3, 1,                0,  0   ; Filter O2 LED
439
    DOUT_ENTRY  TMP3, 2,                0,  0   ; Filter O3 LED
440
    DOUT_ENTRY  TMP3, 3,                0,  0   ; Filter Ext LED
828 tk 441
 
835 tk 442
    DOUT_ENTRY  TMP3, 4,                0,  0   ; Filter LP LED
443
    DOUT_ENTRY  TMP3, 5,                0,  0   ; Filter BP LED
444
    DOUT_ENTRY  TMP3, 6,                0,  0   ; Filter HP LED
445
    DOUT_ENTRY  TMP3, 7,                0,  0   ; Filter 3O LED
828 tk 446
 
835 tk 447
    DOUT_ENTRY  TMP2, 4,                0,  0   ; ENV1 LED
448
    DOUT_ENTRY  TMP2, 5,                0,  0   ; ENV2 LED
828 tk 449
 
835 tk 450
    DOUT_ENTRY  TMP2, 6,                0,  0   ; ENV Ctrl LED
451
    DOUT_ENTRY  TMP2, 7,                0,  0   ; ENV Assign LED
828 tk 452
 
835 tk 453
    DOUT_ENTRY  TMP4, 0,                0,  0   ; LFO1 LED
454
    DOUT_ENTRY  TMP4, 1,                0,  0   ; LFO2 LED
455
    DOUT_ENTRY  TMP4, 2,                0,  0   ; LFO3 LED
456
    DOUT_ENTRY  TMP4, 3,                0,  0   ; LFO4 LED
457
    DOUT_ENTRY  TMP4, 4,                0,  0   ; LFO5 LED
458
    DOUT_ENTRY  TMP4, 5,                0,  0   ; LFO6 LED
828 tk 459
 
835 tk 460
    DOUT_ENTRY  TMP5, 0,                0,  0   ; LFO Sine LED
461
    DOUT_ENTRY  TMP5, 1,                0,  0   ; LFO Triangle LED
462
    DOUT_ENTRY  TMP5, 2,                0,  0   ; LFO Saw LED
463
    DOUT_ENTRY  TMP5, 3,                0,  0   ; LFO Pulse LED
464
    DOUT_ENTRY  TMP5, 4,                0,  0   ; LFO Random LED
828 tk 465
 
466
 
467
    ;; additional LED functions which could be added:
468
    ;; o Play LED (TMP5, 6)
469
    ;; o Mode Meter LED (TMP2, 2)
470
    ;; o Mode Matrix LED (TMP2, 3)
471
    ;; o SID L LED (TMP4, 6)
472
    ;; o SID R LED (TMP4, 7)
473
    ;; o LFO Positive LED (TMP5, 5)
474
 
475
    ;; don't remove this "end-of-table" entry!
476
    DOUT_ENTRY_EOT
477
 
478
 
479
;; --------------------------------------------------------------------------
480
;; In this table DIN pins have to be assigned to rotary encoders for the
481
;; MIOS_ENC driver 
482
;; 
483
;; up to 64 entries are provided, for MIDIbox SID 15 entries are expected
484
;; 
485
;; The table must be terminated with an ENC_EOT entry.
486
;; 
487
;; ENC_ENTRY provides following parameters
488
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
489
;;    o second parameter: number of pin; since two pins are necessary
490
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
491
;;    o the third parameter contains the encoder mode:
492
;;      either MIOS_ENC_MODE_NON_DETENTED
493
;;          or MIOS_ENC_MODE_DETENTED1
494
;;          or MIOS_ENC_MODE_DETENTED2
495
;;          or MIOS_ENC_MODE_DETENTED3
496
;;      see also http://www.midibox.org/dokuwiki/doku.php?id=encoder_types
497
;;
498
;; Configuration Examples:
499
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
500
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
501
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
502
;; --------------------------------------------------------------------------
503
    org 0x3280      ; never change the origin!
504
 
505
    ;; encoder entry structure
506
ENC_ENTRY MACRO sr, din_0, mode
507
    dw  (mode << 8) | (din_0 + 8*(sr-1))
508
    ENDM   
509
ENC_EOT MACRO
510
    dw  0xffff
511
    ENDM
512
 
513
MIOS_ENC_PIN_TABLE
514
    ;;        SR  Pin  Mode
515
#if CS_MENU_USE_INCDEC_BUTTONS == 0
1102 tk 516
    ENC_ENTRY  2,  4,  MIOS_ENC_MODE_DETENTED3  ; menu encoder
828 tk 517
#endif
518
 
519
    ;; additional CS encoders
520
    ;;        SR  Pin  Mode
1102 tk 521
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc delay/transpose/assign #1
522
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc attack/finetune/assign #2
523
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc decay/portamento/assign #3
524
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc sustain/release/assign #4
525
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc release/pulsewidth/assign #5
828 tk 526
 
1102 tk 527
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; LFO rate
528
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; LFO depth
828 tk 529
 
1102 tk 530
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Filter CutOff
531
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Filter Resonance
828 tk 532
 
1102 tk 533
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Env depth/assign #1
534
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Env attack/assign #2
535
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Env decay/assign #3
536
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Env sustain/assign #4
537
    ENC_ENTRY  16,  0,  MIOS_ENC_MODE_DETENTED3 ; Env release/assign #5
828 tk 538
 
539
    ;; don't remove this "end-of-table" entry!
540
    ENC_EOT
541
 
542
 
543
;; include the rest of the application
544
#include "src/main.inc"