Subversion Repositories svn.mios

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
44 tk 1
; $Id: sid_parout.inc 44 2008-01-30 21:39:30Z tk $
1 tk 2
;
3
; MIDIbox SID
4
; Parameter Output Handling
5
;
6
; ==========================================================================
7
;
8
;  Copyright 1998-2007 Thorsten Klose (tk@midibox.org)
9
;  Licensed for personal non-commercial use only.
10
;  All other rights reserved.
11
;
12
; ==========================================================================
13
 
14
;; --------------------------------------------------------------------------
15
;; Returns a Parameter Value
16
;;  IN: index of parameter in WREG
17
;;      SID channel in MIOS_PARAMETER3[1:0] (if 0, 1 or 3, SIDL register will be returned, with 2 the SIDR register)
18
;;      Multi Patch: Instrument number in MIOS_PARAMETER3[6:4]
19
;;      Drum Patch: Instrument number in MIOS_PARAMETER3[7:4]
20
;;      MIOS_PARAMETER3[2] if 0: take from normal buffer, if 1: take from shadow buffer
21
;;  OUT: parameter value in MIOS_PARAMETER[12]
22
;;       low-byte in WREG
23
;; --------------------------------------------------------------------------
24
SID_PAROUT_Get
25
	;; get table entries
26
	movwf	PRODH		; store index in PRODH
27
	movff	SID_PATCH_BUFFER_SHADOW + SID_Ix_ENGINE, TABLAT
28
	call	SID_PAR_TABLE_GetPtr	; expecting engine in TABLAT[1:0]
29
	tblrd*+			; skip left string
30
	tblrd*+			; skip right string
31
	tblrd*+
32
	movff	TABLAT, PRODL	; mod ID -> PRODL
33
	tblrd*+
34
	movff	TABLAT, FSR1L	; low byte of target registers -> FSR1L
35
 
36
	;; preselect FSR1H
37
	movlw	HIGH(SID_PATCH_BUFFER)
38
	btfsc	MIOS_PARAMETER3, 2
39
	movlw HIGH(SID_PATCH_BUFFER_SHADOW)
40
	movwf	FSR1H
41
 
42
	;; pre-clear MIOS_PARAMETER2 (for functions which only return a 8bit value)
43
	clrf	MIOS_PARAMETER2
44
 
45
	;; jump depending on mod ID
46
	movf	PRODL, W
47
	JUMPTABLE_2BYTES 0x39+1 ; entries
48
	rgoto	SID_PAROUT_Get_NOP
49
	rgoto	SID_PAROUT_Get_7
50
	rgoto	SID_PAROUT_Get_8
51
	rgoto	SID_PAROUT_Get_PM8
52
	rgoto	SID_PAROUT_Get_4L
53
	rgoto	SID_PAROUT_Get_4U
54
	rgoto	SID_PAROUT_Get_PAR12
55
	rgoto	SID_PAROUT_Get_CUSTOM_SW
56
	rgoto	SID_PAROUT_Get_FIL4L
57
	rgoto	SID_PAROUT_Get_FIL4U
58
	rgoto	SID_PAROUT_Get_FIL12
59
	rgoto	SID_PAROUT_Get_FIL8
60
	rgoto	SID_PAROUT_Get_OSC123_PM7
61
	rgoto	SID_PAROUT_Get_OSC123_PM8
62
	rgoto	SID_PAROUT_Get_OSC123_7
63
	rgoto	SID_PAROUT_Get_OSC123_8
64
	rgoto	SID_PAROUT_Get_OSC123_12
65
	rgoto	SID_PAROUT_Get_OSC123_4L
66
	rgoto	SID_PAROUT_Get_OSC123_6L
67
	rgoto	SID_PAROUT_Get_OSC123_4U
68
	rgoto	SID_PAROUT_Get_OSC123_PB
69
	rgoto	SID_PAROUT_Get_MOD_PM8
70
	rgoto	SID_PAROUT_Get_MOD_B76
71
	rgoto	SID_PAROUT_Get_LFO_4U
72
	rgoto	SID_PAROUT_Get_LFO_PM8
73
	rgoto	SID_PAROUT_Get_LFO_8
74
	rgoto	SID_PAROUT_Get_ENV_PM8
75
	rgoto	SID_PAROUT_Get_ENV_8
76
	rgoto	SID_PAROUT_Get_WT_6
77
	rgoto	SID_PAROUT_Get_WT_7
78
	rgoto	SID_PAROUT_Get_WT_POS
79
	rgoto	SID_PAROUT_Get_NOTE
80
	rgoto	SID_PAROUT_Get_OSC_INS_PM7
81
	rgoto	SID_PAROUT_Get_OSC_INS_PM8
82
	rgoto	SID_PAROUT_Get_OSC_INS_7
83
	rgoto	SID_PAROUT_Get_OSC_INS_8
84
	rgoto	SID_PAROUT_Get_OSC_INS_12
85
	rgoto	SID_PAROUT_Get_OSC_INS_4L
86
	rgoto	SID_PAROUT_Get_OSC_INS_6L
87
	rgoto	SID_PAROUT_Get_OSC_INS_4U
88
	rgoto	SID_PAROUT_Get_OSC_INS_PB
89
	rgoto	SID_PAROUT_Get_OSC_BL_PM7
90
	rgoto	SID_PAROUT_Get_OSC_BL_PM8
91
	rgoto	SID_PAROUT_Get_OSC_BL_P8
92
	rgoto	SID_PAROUT_Get_OSC_BL_7
93
	rgoto	SID_PAROUT_Get_OSC_BL_8
94
	rgoto	SID_PAROUT_Get_OSC_BL_12
95
	rgoto	SID_PAROUT_Get_OSC_BL_4L
96
	rgoto	SID_PAROUT_Get_OSC_BL_6L
97
	rgoto	SID_PAROUT_Get_OSC_BL_4U
98
	rgoto	SID_PAROUT_Get_OSC_BL_PB
99
	rgoto	SID_PAROUT_Get_OSC_BL_FIL12
100
	rgoto	SID_PAROUT_Get_OSC_BL_FIL8
101
	rgoto	SID_PAROUT_Get_DRM_8
102
	rgoto	SID_PAROUT_Get_DRM_PM8
103
	rgoto	SID_PAROUT_Get_DRM_4U
104
	rgoto	SID_PAROUT_Get_DRM_4L
105
	rgoto	SID_PAROUT_Get_NOTE_INS
106
 
107
 
108
 
109
;; ----------------------------------------------------------
110
SID_PAROUT_SID_FIL_MACRO MACRO
111
	LOCAL	SID_PAROUT_SID_FIL_SIDR
112
	LOCAL	SID_PAROUT_SID_FIL_SIDL
113
 
114
	movf	MIOS_PARAMETER3, W
115
	andlw	0x03
116
	xorlw	0x02
117
	bnz	SID_PAROUT_SID_FIL_SIDL
118
SID_PAROUT_SID_FIL_SIDR
119
	movlw	(SID_Ix_L_S2F_BASE-SID_Ix_L_S1F_BASE)
120
	addwf	FSR1L, F
121
SID_PAROUT_SID_FIL_SIDL
122
	ENDM
123
 
124
SID_PAROUT_SID_OSC_MACRO MACRO
125
	LOCAL	SID_PAROUT_SID_OSC_SIDR
126
	LOCAL	SID_PAROUT_SID_OSC_SIDL
127
 
128
	movf	MIOS_PARAMETER3, W
129
	andlw	0x03
130
	xorlw	0x02
131
	bnz	SID_PAROUT_SID_OSC_SIDL
132
SID_PAROUT_SID_OSC_SIDR
133
	movlw	(SID_Ix_L_S2V1_BASE-SID_Ix_L_S1V1_BASE)
134
	addwf	FSR1L, F
135
SID_PAROUT_SID_OSC_SIDL
136
	ENDM
137
 
138
SID_PAROUT_SID_OSC_INS_MACRO MACRO
139
	LOCAL	SID_PAROUT_SID_OSC_INS_ALL
140
	LOCAL	SID_PAROUT_SID_OSC_INS_CUR
141
	LOCAL	SID_PAROUT_SID_OSC_INS_CUR_CONT
142
	LOCAL	SID_PAROUT_SID_OSC_INS_N
143
 
144
	movf	PRODH, W
145
	andlw	0x07
146
	bz	SID_PAROUT_SID_OSC_INS_ALL
147
	addlw	-1
148
	bz	SID_PAROUT_SID_OSC_INS_CUR
149
	rgoto	SID_PAROUT_SID_OSC_INS_N
150
SID_PAROUT_SID_OSC_INS_CUR
151
	swapf	MIOS_PARAMETER3, W
152
	andlw	0x07
153
	rgoto	SID_PAROUT_SID_OSC_INS_CUR_CONT
154
SID_PAROUT_SID_OSC_INS_N
155
	movf	PRODH, W
156
	andlw	0x07
157
	addlw	-2
158
SID_PAROUT_SID_OSC_INS_CUR_CONT
159
	mullw	(SID_Ix_M_I2_BASE-SID_Ix_M_I1_BASE)
160
	movf	PRODL, F
161
	addwf	FSR1L, F
162
	movf	PRODH, F
163
	andlw	0x07
164
	addwfc	FSR1H, F
165
SID_PAROUT_SID_OSC_INS_ALL
166
	ENDM
167
 
168
SID_PAROUT_SID_OSC_BL_MACRO MACRO
169
	LOCAL	SID_PAROUT_SID_OSC_BL_END
170
	LOCAL	SID_PAROUT_SID_OSC_BL_R
171
 
172
	;; select right channel if "current" (#1) and MIOS_PARAMETER3[4] or R (#3)
173
	BRA_IFCLR PRODH, 0, ACCESS, SID_PAROUT_SID_OSC_BL_END
174
	BRA_IFSET PRODH, 1, ACCESS, SID_PAROUT_SID_OSC_BL_R
175
	BRA_IFSET MIOS_PARAMETER3, 4, ACCESS, SID_PAROUT_SID_OSC_BL_END
176
SID_PAROUT_SID_OSC_BL_R
177
	movlw	(SID_Ix_B_S2V1_BASE-SID_Ix_B_S1V1_BASE)
178
	addwf	FSR1L, F
179
SID_PAROUT_SID_OSC_BL_END
180
	ENDM
181
 
182
SID_PAROUT_SID_OSC_BL_FIL_MACRO MACRO
183
	LOCAL	SID_PAROUT_SID_OSC_BL_FIL_END
184
	LOCAL	SID_PAROUT_SID_OSC_BL_FIL_R
185
 
186
	;; select right channel if "current" (#1) and MIOS_PARAMETER3[4] or R (#3)
187
	BRA_IFCLR PRODH, 0, ACCESS, SID_PAROUT_SID_OSC_BL_FIL_END
188
	BRA_IFSET PRODH, 1, ACCESS, SID_PAROUT_SID_OSC_BL_FIL_R
189
	BRA_IFSET MIOS_PARAMETER3, 4, ACCESS, SID_PAROUT_SID_OSC_BL_FIL_END
190
SID_PAROUT_SID_OSC_BL_FIL_R
191
	movlw	(SID_Ix_L_S2F_BASE-SID_Ix_L_S1F_BASE)
192
	addwf	FSR1L, F
193
SID_PAROUT_SID_OSC_BL_FIL_END
194
	ENDM
195
 
196
SID_PAROUT_SID_DRM_MACRO MACRO
197
	swapf	MIOS_PARAMETER3, W
198
	andlw	0x0f
199
	mullw	(SID_Ix_D_I2_BASE-SID_Ix_D_I1_BASE)
200
	movf	PRODL, W
201
	addwf	FSR1L, F
202
	ENDM
203
 
204
;; ----------------------------------------------------------
205
 
206
 
207
SID_PAROUT_Get_NOP
208
	movlw	0x00
209
SID_PAROUT_Get_End
210
	movwf	MIOS_PARAMETER1
211
	return
212
 
213
SID_PAROUT_Get_7
214
	movf	INDF1, W
215
	andlw	0x7f
216
	rgoto	SID_PAROUT_Get_End
217
 
218
SID_PAROUT_Get_8
219
	movf	INDF1, W
220
	rgoto	SID_PAROUT_Get_End
221
 
222
SID_PAROUT_Get_PAR12
223
	swapf	PREINC1, W
224
	andlw	0x0f
225
	movwf	MIOS_PARAMETER2
226
	swapf	POSTDEC1, W
227
	andlw	0xf0
228
	movwf	MIOS_PARAMETER1
229
	swapf	INDF1, W
230
	andlw	0x0f
231
	iorwf	MIOS_PARAMETER1, F
232
	movf	MIOS_PARAMETER1, W
233
	rgoto	SID_PAROUT_Get_End
234
 
235
SID_PAROUT_Get_CUSTOM_SW
236
	movf	PRODH, W
237
	call	MIOS_HLP_GetBitORMask
238
	andwf	INDF1, W
239
	skpz
240
	movlw	0x01
241
	rgoto	SID_PAROUT_Get_End
242
 
243
SID_PAROUT_Get_FIL4L
244
	SID_PAROUT_SID_FIL_MACRO	; select SIDL/SIDR filter
245
	movf	INDF1, W
246
	andlw	0x0f
247
	rgoto	SID_PAROUT_Get_End
248
 
249
SID_PAROUT_Get_FIL4U
250
	SID_PAROUT_SID_FIL_MACRO	; select SIDL/SIDR filter
251
	swapf	INDF1, W
252
	andlw	0x0f
253
	rgoto	SID_PAROUT_Get_End
254
 
255
SID_PAROUT_Get_FIL12
256
	SID_PAROUT_SID_FIL_MACRO	; select SIDL/SIDR filter
257
	movf	PREINC1, W
258
	andlw	0x0f
259
	movwf	MIOS_PARAMETER2
260
	movf	POSTDEC1, W	; (there is no PREDEC1)
261
	movf	INDF1, W
262
	rgoto	SID_PAROUT_Get_End
263
 
264
SID_PAROUT_Get_FIL8
265
	SID_PAROUT_SID_FIL_MACRO	; select SIDL/SIDR filter
266
	movf	INDF1, W
267
	rgoto	SID_PAROUT_Get_End
268
 
269
SID_PAROUT_Get_OSC123_PM7
270
SID_PAROUT_Get_OSC123_PM8
271
SID_PAROUT_Get_OSC123_7
272
SID_PAROUT_Get_OSC123_8
273
	SID_PAROUT_SID_OSC_MACRO	; select SIDL/SIDR oscillator
274
SID_PAROUT_Get_PM8
275
	movf	INDF1, W
276
	rgoto	SID_PAROUT_Get_End
277
 
278
SID_PAROUT_Get_OSC123_12
279
	SID_PAROUT_SID_OSC_MACRO	; select SIDL/SIDR oscillator
280
	movf	PREINC1, W
281
	andlw	0x0f
282
	movwf	MIOS_PARAMETER2
283
	movf	POSTDEC1, W	; (there is no PREDEC1)
284
	movf	INDF1, W
285
	rgoto	SID_PAROUT_Get_End
286
 
287
SID_PAROUT_Get_OSC123_4L
288
	SID_PAROUT_SID_OSC_MACRO	; select SIDL/SIDR oscillator
289
SID_PAROUT_Get_4L
290
	movf	INDF1, W
291
	andlw	0x0f
292
	rgoto	SID_PAROUT_Get_End
293
 
294
SID_PAROUT_Get_OSC123_6L
295
	SID_PAROUT_SID_OSC_MACRO	; select SIDL/SIDR oscillator
296
	movf	INDF1, W
297
	andlw	0x3f
298
	rgoto	SID_PAROUT_Get_End
299
 
300
SID_PAROUT_Get_OSC123_4U
301
	SID_PAROUT_SID_OSC_MACRO	; select SIDL/SIDR oscillator
302
SID_PAROUT_Get_4U
303
	swapf	INDF1, W
304
	andlw	0x0f
305
	rgoto	SID_PAROUT_Get_End
306
 
307
SID_PAROUT_Get_OSC123_PB
308
	movlw	HIGH(SIDL_V1_BASE)	; select right address range
309
	movwf	FSR1H
310
	;; SIDR only selected?
311
	movf	MIOS_PARAMETER3, W
312
	andlw	0x03
313
	xorlw	0x02
314
	bnz	SID_PAROUT_Get_OSC123_PB_SIDL
315
SID_PAROUT_Get_OSC123_PB_SIDR
316
	movlw	SIDR_V1_BASE-SIDL_V1_BASE
317
	addwf	FSR1L, F
318
SID_PAROUT_Get_OSC123_PB_SIDL
319
	movlw	SID_Vx_PITCHBENDER
320
	movf	PLUSW1, W
321
	xorlw	0x80
322
	rgoto	SID_PAROUT_Get_End
323
 
324
SID_PAROUT_Get_MOD_PM8
325
	incf	FSR1H, F	; (select upper address range)
326
	movf	INDF1, W
327
	rgoto	SID_PAROUT_Get_End
328
 
329
SID_PAROUT_Get_MOD_B76
330
	incf	FSR1H, F	; (select upper address range)
331
	swapf	INDF1, W
332
	rrf	WREG, W
333
	rrf	WREG, W
334
	andlw	0x03
335
	rgoto	SID_PAROUT_Get_End
336
 
337
SID_PAROUT_Get_LFO_4U
338
	swapf	INDF1, W
339
	andlw	0x0f
340
	rgoto	SID_PAROUT_Get_End
341
 
342
SID_PAROUT_Get_LFO_PM8
343
SID_PAROUT_Get_LFO_8
344
	movf	INDF1, W
345
	rgoto	SID_PAROUT_Get_End
346
 
347
SID_PAROUT_Get_ENV_PM8
348
SID_PAROUT_Get_ENV_8
349
	movf	INDF1, W
350
	rgoto	SID_PAROUT_Get_End
351
 
352
SID_PAROUT_Get_WT_6
353
	incf	FSR1H, F	; (select upper address range)
354
	movf	INDF1, W
355
	andlw	0x3f
356
	rgoto	SID_PAROUT_Get_End
357
 
358
SID_PAROUT_Get_WT_7
359
	incf	FSR1H, F	; (select upper address range)
360
	movf	INDF1, W
361
	andlw	0x7f
362
	rgoto	SID_PAROUT_Get_End
363
 
364
SID_PAROUT_Get_WT_POS
365
	movlw	HIGH(SID_WT1_BASE)	; select right address range
366
	movwf	FSR1H
367
	movf	INDF1, W
368
	rgoto	SID_PAROUT_Get_End
369
 
370
SID_PAROUT_Get_OSC_INS_PM7
371
SID_PAROUT_Get_OSC_INS_PM8
372
SID_PAROUT_Get_OSC_INS_7
373
SID_PAROUT_Get_OSC_INS_8
374
	SID_PAROUT_SID_OSC_INS_MACRO	; select instrument
375
	movf	INDF1, W
376
	rgoto	SID_PAROUT_Get_End
377
 
378
SID_PAROUT_Get_OSC_INS_12
379
	SID_PAROUT_SID_OSC_INS_MACRO	; select instrument
380
	movf	PREINC1, W
381
	andlw	0x0f
382
	movwf	MIOS_PARAMETER2
383
	movf	POSTDEC1, W	; (there is no PREDEC1)
384
	movf	INDF1, W
385
	rgoto	SID_PAROUT_Get_End
386
 
387
SID_PAROUT_Get_OSC_INS_4L
388
	SID_PAROUT_SID_OSC_INS_MACRO	; select instrument
389
	movf	INDF1, W
390
	andlw	0x0f
391
	rgoto	SID_PAROUT_Get_End
392
 
393
SID_PAROUT_Get_OSC_INS_6L
394
	SID_PAROUT_SID_OSC_INS_MACRO	; select instrument
395
	movf	INDF1, W
396
	andlw	0x3f
397
	rgoto	SID_PAROUT_Get_End
398
 
399
SID_PAROUT_Get_OSC_INS_4U
400
	SID_PAROUT_SID_OSC_INS_MACRO	; select instrument
401
	swapf	INDF1, W
402
	andlw	0x0f
403
	rgoto	SID_PAROUT_Get_End
404
 
405
SID_PAROUT_Get_OSC_INS_PB
406
	;; TODO
407
	movlw	HIGH(SIDL_V1_BASE)	; select right address range
408
	movwf	FSR1H
409
	;; SIDR only selected?
410
	movf	MIOS_PARAMETER3, W
411
	andlw	0x03
412
	xorlw	0x02
413
	bnz	SID_PAROUT_Get_OSC_INS_PB_SIDL
414
SID_PAROUT_Get_OSC_INS_PB_SIDR
415
	movlw	SIDR_V1_BASE-SIDL_V1_BASE
416
	addwf	FSR1L, F
417
SID_PAROUT_Get_OSC_INS_PB_SIDL
418
	movlw	SID_Vx_PITCHBENDER
419
	movf	PLUSW1, W
420
	xorlw	0x80
421
	rgoto	SID_PAROUT_Get_End
422
 
423
SID_PAROUT_Get_OSC_BL_PM7
424
SID_PAROUT_Get_OSC_BL_PM8
425
SID_PAROUT_Get_OSC_BL_7
426
SID_PAROUT_Get_OSC_BL_8
427
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
428
	movf	INDF1, W
429
	rgoto	SID_PAROUT_Get_End
430
 
431
SID_PAROUT_Get_OSC_BL_12
432
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
433
	movf	PREINC1, W
434
	andlw	0x0f
435
	movwf	MIOS_PARAMETER2
436
	movf	POSTDEC1, W	; (there is no PREDEC1)
437
	movf	INDF1, W
438
	rgoto	SID_PAROUT_Get_End
439
 
440
SID_PAROUT_Get_OSC_BL_4L
441
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
442
	movf	INDF1, W
443
	andlw	0x0f
444
	rgoto	SID_PAROUT_Get_End
445
 
446
SID_PAROUT_Get_OSC_BL_6L
447
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
448
	movf	INDF1, W
449
	andlw	0x3f
450
	rgoto	SID_PAROUT_Get_End
451
 
452
SID_PAROUT_Get_OSC_BL_4U
453
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
454
	swapf	INDF1, W
455
	andlw	0x0f
456
	rgoto	SID_PAROUT_Get_End
457
 
458
SID_PAROUT_Get_OSC_BL_P8
459
	SID_PAROUT_SID_OSC_BL_MACRO	; select bassline
460
	movf	INDF1, W
461
	addlw	-0x80
462
	btfsc	WREG, 7
463
	movlw 0x00
464
	rgoto	SID_PAROUT_Get_End
465
 
466
SID_PAROUT_Get_OSC_BL_PB
467
	;; TODO
468
	movlw	HIGH(SIDL_V1_BASE)	; select right address range
469
	movwf	FSR1H
470
	;; SIDR only selected?
471
	movf	MIOS_PARAMETER3, W
472
	andlw	0x03
473
	xorlw	0x02
474
	bnz	SID_PAROUT_Get_OSC_BL_PB_SIDL
475
SID_PAROUT_Get_OSC_BL_PB_SIDR
476
	movlw	SIDR_V1_BASE-SIDL_V1_BASE
477
	addwf	FSR1L, F
478
SID_PAROUT_Get_OSC_BL_PB_SIDL
479
	movlw	SID_Vx_PITCHBENDER
480
	movf	PLUSW1, W
481
	xorlw	0x80
482
	rgoto	SID_PAROUT_Get_End
483
 
484
SID_PAROUT_Get_OSC_BL_FIL12
485
	SID_PAROUT_SID_OSC_BL_FIL_MACRO	; select bassline
486
	movf	PREINC1, W
487
	andlw	0x0f
488
	movwf	MIOS_PARAMETER2
489
	movf	POSTDEC1, W	; (there is no PREDEC1)
490
	movf	INDF1, W
491
	rgoto	SID_PAROUT_Get_End
492
 
493
SID_PAROUT_Get_OSC_BL_FIL8
494
	SID_PAROUT_SID_OSC_BL_FIL_MACRO	; select bassline
495
	movf	PREINC1, W
496
	andlw	0x0f
497
	movwf	MIOS_PARAMETER2
498
	movf	POSTDEC1, W	; (there is no PREDEC1)
499
	movf	INDF1, W
500
	rgoto	SID_PAROUT_Get_End
501
 
502
SID_PAROUT_Get_DRM_8
503
	SID_PAROUT_SID_DRM_MACRO	; select drum
504
	rgoto	SID_PAROUT_Get_8
505
 
506
SID_PAROUT_Get_DRM_PM8
507
	SID_PAROUT_SID_DRM_MACRO	; select drum
508
	rgoto	SID_PAROUT_Get_PM8
509
 
510
SID_PAROUT_Get_DRM_4U
511
	SID_PAROUT_SID_DRM_MACRO	; select drum
512
	rgoto	SID_PAROUT_Get_4U
513
 
514
SID_PAROUT_Get_DRM_4L
515
	SID_PAROUT_SID_DRM_MACRO	; select drum
516
	rgoto	SID_PAROUT_Get_4L
517
 
518
SID_PAROUT_Get_NOTE
519
SID_PAROUT_Get_NOTE_INS		; TODO: not correct for instruments!
520
	movlw	HIGH(SIDL_V1_BASE)	; select right address range
521
	movwf	FSR1H
522
	;; SIDR only selected?
523
	movf	MIOS_PARAMETER3, W
524
	andlw	0x03
525
	xorlw	0x02
526
	bnz	SID_PAROUT_Get_NOTE_SIDL
527
SID_PAROUT_Get_NOTE_SIDR
528
	movlw	SIDR_V1_BASE-SIDL_V1_BASE
529
	addwf	FSR1L, F
530
SID_PAROUT_Get_NOTE_SIDL
531
	movlw	SID_Vx_NOTE
532
	movf	PLUSW1, W
533
	rgoto	SID_PAROUT_Get_End