Subversion Repositories svn.mios

Rev

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

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