Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
44 tk 1
; $Id: cs_menu_print.inc 1102 2012-12-30 20:39:10Z tk $
1 tk 2
;
3
; SID Control Surface Menu Parameter Print Functions
4
;
5
; ==========================================================================
6
;
7
;  Copyright 1998-2007 Thorsten Klose (tk@midibox.org)
8
;  Licensed for personal non-commercial use only.
9
;  All other rights reserved.
10
;
11
; ==========================================================================
12
 
13
; ==========================================================================
14
; ==========================================================================
15
;  refered by cs_menu_tables.inc
16
; ==========================================================================
17
; ==========================================================================
18
 
19
; ==========================================================================
20
;  All supported PRINT_* indices
21
; ==========================================================================
22
PRINT_NOP		EQU	0x00
23
 
24
PRINT_DEC8		EQU	0x01
25
PRINT_DECP1		EQU	0x02
26
PRINT_PMDEC7		EQU	0x03
27
PRINT_PMDEC8		EQU	0x04
28
PRINT_HEX12		EQU	0x05
29
PRINT_CHN		EQU	0x06
30
PRINT_BNK		EQU	0x07
31
PRINT_PAT		EQU	0x08
32
PRINT_ENS		EQU	0x09
33
PRINT_B0		EQU	0x0a
34
PRINT_B1		EQU	0x0b
35
PRINT_B2		EQU	0x0c
36
 
37
PRINT_VAR_123		EQU	0x0d
38
PRINT_VAR_SID1234	EQU	0x0e
39
PRINT_VAR_DEC		EQU	0x0f
40
PRINT_VAR_DECP1		EQU	0x10
41
PRINT_VAR_CALI		EQU	0x11
42
PRINT_VAR_LR		EQU	0x12
43
 
44
PRINT_Vx_DEC		EQU	0x13
45
PRINT_Vx_DEC4U		EQU	0x14
46
PRINT_Vx_DEC4L		EQU	0x15
47
PRINT_Vx_DECP1		EQU	0x16
362 tk 48
PRINT_Vx_DECPM3		EQU	0x17
49
PRINT_Vx_PMD		EQU	0x18
50
PRINT_Vx_GSA		EQU	0x19
1 tk 51
PRINT_Vx_HEX8		EQU	0x1a
52
PRINT_Vx_HEX12		EQU	0x1b
53
PRINT_Vx_PMDEC7		EQU	0x1c
54
PRINT_Vx_PMDEC8		EQU	0x1d
55
PRINT_Vx_WAV		EQU	0x1e
56
PRINT_Vx_S_R		EQU	0x1f
362 tk 57
PRINT_Vx_NOTE		EQU	0x20
58
PRINT_Vx_ARP_ON		EQU	0x21
59
PRINT_Vx_ARP_DIR	EQU	0x22
60
PRINT_Vx_ARP_SOR	EQU	0x23
61
PRINT_Vx_ARP_HLD	EQU	0x24
679 tk 62
PRINT_Vx_ARP_SNC_ESY	EQU	0x25
362 tk 63
PRINT_Vx_ARP_CAC	EQU	0x26
64
PRINT_Vx_ARP_GLN	EQU	0x27
65
PRINT_Vx_ARP_RNG	EQU	0x28
66
PRINT_Vx_ARP_SPD	EQU	0x29
67
PRINT_Vx_ARP_ONE	EQU	0x2a
1 tk 68
 
362 tk 69
PRINT_M_Vx_VAS		EQU	0x2b
70
PRINT_M_Vx_PHASE	EQU	0x2c
71
PRINT_M_Vx_POL		EQU	0x2d
72
PRINT_BM_Vx_LEG		EQU	0x2e
73
PRINT_M_Vx_WTO		EQU	0x2f
74
PRINT_BM_Vx_SUK		EQU	0x30
75
PRINT_M_D_Vx_ASG	EQU	0x31
1 tk 76
 
362 tk 77
PRINT_D_Vx_VAS		EQU	0x32
1 tk 78
 
362 tk 79
PRINT_Fx_CHN		EQU	0x33
80
PRINT_Fx_CUTOFF		EQU	0x34
81
PRINT_Fx_RESON		EQU	0x35
82
PRINT_Fx_KTR		EQU	0x36
83
PRINT_Fx_MOD		EQU	0x37
84
PRINT_Fx_EXT		EQU	0x38
85
PRINT_Fx_3OF		EQU	0x39
86
PRINT_Fx_FIP		EQU	0x3a
1 tk 87
 
362 tk 88
PRINT_LFOx_WAV		EQU	0x3b
89
PRINT_LFOx_RATE		EQU	0x3c
90
PRINT_LFOx_DEC		EQU	0x3d
91
PRINT_LFOx_PMDEC8	EQU	0x3e
92
PRINT_LFOx_SNC		EQU	0x3f
93
PRINT_LFOx_SNC_M	EQU	0x40
94
PRINT_LFOx_ONE		EQU	0x41
95
PRINT_LFOx_CSN		EQU	0x42
1 tk 96
 
362 tk 97
PRINT_ENVx_DEC		EQU	0x43
98
PRINT_ENVx_PMDEC8	EQU	0x44
99
PRINT_ENVx_LPB		EQU	0x45
100
PRINT_ENVx_LPE		EQU	0x46
101
PRINT_ENVx_CSN		EQU	0x47
102
PRINT_ENVx_CAS		EQU	0x48
1 tk 103
 
362 tk 104
PRINT_MODx_SRC		EQU	0x49
105
PRINT_MODx_OP		EQU	0x4a
106
PRINT_MODx_TAR		EQU	0x4b
107
PRINT_MODx_PMDEC8	EQU	0x4c
108
PRINT_MODx_INV1		EQU	0x4d
109
PRINT_MODx_INV2		EQU	0x4e
110
PRINT_MODx_Nx		EQU	0x4f
1 tk 111
 
362 tk 112
PRINT_TRGx_SRC		EQU	0x50
113
PRINT_TRGx_Nx		EQU	0x51
1 tk 114
 
362 tk 115
PRINT_CLK_BPM		EQU	0x52
116
PRINT_CLK_SLAVE		EQU	0x53
1102 tk 117
PRINT_CLK_OUT		EQU	0x54
1 tk 118
 
1102 tk 119
PRINT_KNB		EQU	0x55
120
PRINT_KNB_VALUE		EQU	0x56
121
PRINT_KNB_PAR		EQU	0x57
122
PRINT_KNB_MINMAX	EQU	0x58
1 tk 123
 
1102 tk 124
PRINT_EXT_VALUE		EQU	0x59
125
PRINT_EXT_SWITCH	EQU	0x5a
1 tk 126
 
1102 tk 127
PRINT_WTx_PAR		EQU	0x5b
128
PRINT_WTx_PAR_P1	EQU	0x5c
129
PRINT_WTx_SID		EQU	0x5d
130
PRINT_WTx_SPD		EQU	0x5e
131
PRINT_WTx_B7		EQU	0x5f
132
PRINT_WTx_POS		EQU	0x60
133
PRINT_WTx_LOP		EQU	0x61
1 tk 134
 
1102 tk 135
PRINT_WTE_POS		EQU	0x62
136
PRINT_WTE_PAR		EQU	0x63
137
PRINT_WT_VAL		EQU	0x64
138
PRINT_WT_GO		EQU	0x65
1 tk 139
 
1102 tk 140
PRINT_SEQ_POS		EQU	0x66
141
PRINT_SEQ_NUM		EQU	0x67
142
PRINT_SEQ_S16		EQU	0x68
143
PRINT_D_SEQ_ON		EQU	0x69
144
PRINT_B_SEQ_VAL		EQU	0x6a
1 tk 145
 
1102 tk 146
PRINT_D_MODEL		EQU	0x6b
1 tk 147
 
1102 tk 148
PRINT_RND_GEN		EQU	0x6c
1 tk 149
 
1102 tk 150
PRINT_SAVE_BNK		EQU	0x6d
151
PRINT_SAVE_PAT		EQU	0x6e
152
PRINT_SAVE_NAME		EQU	0x6f
153
PRINT_SAVE_ENS		EQU	0x70
1 tk 154
 
1102 tk 155
PRINT_ENSxIx_DECP1	EQU	0x71
156
PRINT_ENSxIx_CHN	EQU	0x72
157
PRINT_ENSxIx_NOTE	EQU	0x73
158
PRINT_ENSxIx_PMDEC7	EQU	0x74
159
PRINT_ENSx_X2A		EQU	0x75
160
PRINT_ENSx_RESERVED	EQU	0x76
161
PRINT_ENSx_MONO		EQU	0x77
162
PRINT_ENSx_FILLOG	EQU	0x78
163
PRINT_ENSx_DOR		EQU	0x79
164
PRINT_ENSx_SPV		EQU	0x7a
165
PRINT_ENSx_EXTINV	EQU	0x7b
1 tk 166
 
167
 
168
; ==========================================================================
169
;  The PRINT handler
170
;; IN: PRINT_xxx ID in WREG
171
; ==========================================================================
172
CS_MENU_PRINT_Handler
1102 tk 173
	JUMPTABLE_2BYTES (0x7b+1) ; entries
1 tk 174
	rgoto	CS_MENU_PRINT_NOP
175
 
176
	rgoto	CS_MENU_PRINT_DEC8
177
	rgoto	CS_MENU_PRINT_DECP1
178
	rgoto	CS_MENU_PRINT_PMDEC7
179
	rgoto	CS_MENU_PRINT_PMDEC8
180
	rgoto	CS_MENU_PRINT_HEX12
181
	rgoto	CS_MENU_PRINT_CHN
182
	rgoto	CS_MENU_PRINT_BNK
183
	rgoto	CS_MENU_PRINT_PAT
184
	rgoto	CS_MENU_PRINT_ENS
185
	rgoto	CS_MENU_PRINT_B0
186
	rgoto	CS_MENU_PRINT_B1
187
	rgoto	CS_MENU_PRINT_B2
188
 
189
	rgoto	CS_MENU_PRINT_VAR_123
190
	rgoto	CS_MENU_PRINT_VAR_SID1234
191
	rgoto	CS_MENU_PRINT_VAR_DEC
192
	rgoto	CS_MENU_PRINT_VAR_DECP1
193
	rgoto	CS_MENU_PRINT_VAR_CALI
194
	rgoto	CS_MENU_PRINT_VAR_LR
195
 
196
	rgoto	CS_MENU_PRINT_Vx_DEC
197
	rgoto	CS_MENU_PRINT_Vx_DEC4U
198
	rgoto	CS_MENU_PRINT_Vx_DEC4L
199
	rgoto	CS_MENU_PRINT_Vx_DECP1
362 tk 200
	rgoto	CS_MENU_PRINT_Vx_DECPM3
1 tk 201
	rgoto	CS_MENU_PRINT_Vx_PMD
202
	rgoto	CS_MENU_PRINT_Vx_GSA
203
	rgoto	CS_MENU_PRINT_Vx_HEX8
204
	rgoto	CS_MENU_PRINT_Vx_HEX12
205
	rgoto	CS_MENU_PRINT_Vx_PMDEC7
206
	rgoto	CS_MENU_PRINT_Vx_PMDEC8
207
	rgoto	CS_MENU_PRINT_Vx_WAV
208
	rgoto	CS_MENU_PRINT_Vx_S_R
362 tk 209
	rgoto	CS_MENU_PRINT_Vx_NOTE
1 tk 210
	rgoto	CS_MENU_PRINT_Vx_ARP_ON
211
	rgoto	CS_MENU_PRINT_Vx_ARP_DIR
212
	rgoto	CS_MENU_PRINT_Vx_ARP_SOR
213
	rgoto	CS_MENU_PRINT_Vx_ARP_HLD
679 tk 214
	rgoto	CS_MENU_PRINT_Vx_ARP_SNC_ESY
1 tk 215
	rgoto	CS_MENU_PRINT_Vx_ARP_CAC
216
	rgoto	CS_MENU_PRINT_Vx_ARP_GLN
217
	rgoto	CS_MENU_PRINT_Vx_ARP_RNG
218
	rgoto	CS_MENU_PRINT_Vx_ARP_SPD
219
	rgoto	CS_MENU_PRINT_Vx_ARP_ONE
220
 
221
	rgoto	CS_MENU_PRINT_M_Vx_VAS
222
	rgoto	CS_MENU_PRINT_M_Vx_PHASE
223
	rgoto	CS_MENU_PRINT_M_Vx_POL
228 tk 224
	rgoto	CS_MENU_PRINT_BM_Vx_LEG
1 tk 225
	rgoto	CS_MENU_PRINT_M_Vx_WTO
228 tk 226
	rgoto	CS_MENU_PRINT_BM_Vx_SUK
1 tk 227
	rgoto	CS_MENU_PRINT_M_D_Vx_ASG
228
 
229
	rgoto	CS_MENU_PRINT_D_Vx_VAS
230
 
231
	rgoto	CS_MENU_PRINT_Fx_CHN
232
	rgoto	CS_MENU_PRINT_Fx_CUTOFF
233
	rgoto	CS_MENU_PRINT_Fx_RESON
234
	rgoto	CS_MENU_PRINT_Fx_KTR
235
	rgoto	CS_MENU_PRINT_Fx_MOD
236
	rgoto	CS_MENU_PRINT_Fx_EXT
237
	rgoto	CS_MENU_PRINT_Fx_3OF
238
	rgoto	CS_MENU_PRINT_Fx_FIP
239
 
240
	rgoto	CS_MENU_PRINT_LFOx_WAV
241
	rgoto	CS_MENU_PRINT_LFOx_RATE
242
	rgoto	CS_MENU_PRINT_LFOx_DEC
243
	rgoto	CS_MENU_PRINT_LFOx_PMDEC8
244
	rgoto	CS_MENU_PRINT_LFOx_SNC
245
	rgoto	CS_MENU_PRINT_LFOx_SNC_M
246
	rgoto	CS_MENU_PRINT_LFOx_ONE
247
	rgoto	CS_MENU_PRINT_LFOx_CSN
248
 
249
	rgoto	CS_MENU_PRINT_ENVx_DEC
250
	rgoto	CS_MENU_PRINT_ENVx_PMDEC8
251
	rgoto	CS_MENU_PRINT_ENVx_LPB
252
	rgoto	CS_MENU_PRINT_ENVx_LPE
253
	rgoto	CS_MENU_PRINT_ENVx_CSN
228 tk 254
	rgoto	CS_MENU_PRINT_ENVx_CAS
1 tk 255
 
256
	rgoto	CS_MENU_PRINT_MODx_SRC
257
	rgoto	CS_MENU_PRINT_MODx_OP
258
	rgoto	CS_MENU_PRINT_MODx_TAR
259
	rgoto	CS_MENU_PRINT_MODx_PMDEC8
260
	rgoto	CS_MENU_PRINT_MODx_INV1
261
	rgoto	CS_MENU_PRINT_MODx_INV2
262
	rgoto	CS_MENU_PRINT_MODx_Nx
263
 
264
	rgoto	CS_MENU_PRINT_TRGx_SRC
265
	rgoto	CS_MENU_PRINT_TRGx_Nx
266
 
267
	rgoto	CS_MENU_PRINT_CLK_BPM
268
	rgoto	CS_MENU_PRINT_CLK_SLAVE
1102 tk 269
	rgoto	CS_MENU_PRINT_CLK_OUT
1 tk 270
 
271
	rgoto	CS_MENU_PRINT_KNB
272
	rgoto	CS_MENU_PRINT_KNB_VALUE
273
	rgoto	CS_MENU_PRINT_KNB_PAR
274
	rgoto	CS_MENU_PRINT_KNB_MINMAX
275
 
276
	rgoto	CS_MENU_PRINT_EXT_VALUE
277
	rgoto	CS_MENU_PRINT_EXT_SWITCH
278
 
279
	rgoto	CS_MENU_PRINT_WTx_PAR
280
	rgoto	CS_MENU_PRINT_WTx_PAR_P1
281
	rgoto	CS_MENU_PRINT_WTx_SID
282
	rgoto	CS_MENU_PRINT_WTx_SPD
283
	rgoto	CS_MENU_PRINT_WTx_B7
284
	rgoto	CS_MENU_PRINT_WTx_POS
285
	rgoto	CS_MENU_PRINT_WTx_LOP
286
 
287
	rgoto	CS_MENU_PRINT_WTE_POS
288
	rgoto	CS_MENU_PRINT_WTE_PAR
289
	rgoto	CS_MENU_PRINT_WT_VAL
290
	rgoto	CS_MENU_PRINT_WT_GO
291
 
292
	rgoto	CS_MENU_PRINT_SEQ_POS
293
	rgoto	CS_MENU_PRINT_SEQ_NUM
294
	rgoto	CS_MENU_PRINT_SEQ_S16
295
	rgoto	CS_MENU_PRINT_D_SEQ_ON
296
	rgoto	CS_MENU_PRINT_B_SEQ_VAL
297
 
298
	rgoto	CS_MENU_PRINT_D_MODEL
299
 
300
	rgoto	CS_MENU_PRINT_RND_GEN
301
 
302
	rgoto	CS_MENU_PRINT_SAVE_BNK
303
	rgoto	CS_MENU_PRINT_SAVE_PAT
304
	rgoto	CS_MENU_PRINT_SAVE_NAME
305
	rgoto	CS_MENU_PRINT_SAVE_ENS
306
 
307
	rgoto	CS_MENU_PRINT_ENSxIx_DECP1
308
	rgoto	CS_MENU_PRINT_ENSxIx_CHN
309
	rgoto	CS_MENU_PRINT_ENSxIx_NOTE
310
	rgoto	CS_MENU_PRINT_ENSxIx_PMDEC7
311
	rgoto	CS_MENU_PRINT_ENSx_X2A
312
	rgoto	CS_MENU_PRINT_ENSx_RESERVED
313
	rgoto	CS_MENU_PRINT_ENSx_MONO
340 tk 314
	rgoto	CS_MENU_PRINT_ENSx_FILLOG
315
	rgoto	CS_MENU_PRINT_ENSx_DOR
1 tk 316
	rgoto	CS_MENU_PRINT_ENSx_SPV
317
	rgoto	CS_MENU_PRINT_ENSx_EXTINV
318
 
319
 
320
; ==========================================================================
321
; ==========================================================================
322
; ==========================================================================
323
 
324
CS_MENU_PRINT_NOP
521 tk 325
	movlw	4
1 tk 326
	goto	SID_LCD_PrintSpaces
327
 
328
; --------------------------------------------------------------------------
329
CS_MENU_PRINT_DEC8
330
	movf	INDF0, W
331
	goto	CS_MENU_PRINT_Dec
332
 
333
; --------------------------------------------------------------------------
334
CS_MENU_PRINT_DECP1
335
	incf	INDF0, W
336
	goto	CS_MENU_PRINT_Dec
337
 
338
; --------------------------------------------------------------------------
339
CS_MENU_PRINT_PMDEC7
340
	movf	INDF0, W
341
	goto	CS_MENU_PRINT_PMDec7
342
 
343
; --------------------------------------------------------------------------
344
CS_MENU_PRINT_PMDEC8
345
	movf	INDF0, W
346
	goto	CS_MENU_PRINT_PMDec8
347
 
348
; --------------------------------------------------------------------------
349
CS_MENU_PRINT_HEX12
521 tk 350
	goto	CS_MENU_PRINT_Hex12
1 tk 351
 
352
; --------------------------------------------------------------------------
353
CS_MENU_PRINT_CHN
354
	lfsr	FSR1, CS_MENU_SID_M_CHN
355
	movf	CS_MENU_SID, W
356
	andlw	0x03
357
	addwf	FSR1L, F
358
	incf	INDF1, W
359
	andlw	0x7f		; mask out "sent" flag
360
	goto	CS_MENU_PRINT_Dec
361
 
362
; --------------------------------------------------------------------------
363
CS_MENU_PRINT_BNK
364
	movlw	' '
365
	call	CS_MENU_PRINT_Char
366
 
367
	call	CS_MENU_MS_GetSIDPatch
368
	movwf	SID_PATCH
369
	call	CS_MENU_MS_GetSIDBank
370
	movwf	SID_BANK
371
	addlw	'A'
1003 tk 372
	call	CS_MENU_PRINT_Char
1 tk 373
 
374
	;; add '*' if BankStick or Patch not available
375
	call	SID_PBANK_CheckPatchValid
376
	movlw	' '
377
	skpz
378
	movlw	'*'
1003 tk 379
	call	CS_MENU_PRINT_Char
521 tk 380
	movlw	' '
1003 tk 381
	goto	CS_MENU_PRINT_Char
1 tk 382
 
383
; --------------------------------------------------------------------------
384
CS_MENU_PRINT_PAT
385
	call	CS_MENU_MS_GetSIDPatch
386
	addlw	1
387
	goto	CS_MENU_PRINT_Dec000
388
 
389
; --------------------------------------------------------------------------
390
CS_MENU_PRINT_ENS
391
	call	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
392
	addlw	1
393
	goto	CS_MENU_PRINT_Dec000
394
 
395
; --------------------------------------------------------------------------
396
CS_MENU_PRINT_B0
397
	movlw	0
398
	goto	CS_MENU_PRINT_OnOff_INDF0
399
 
400
; --------------------------------------------------------------------------
401
CS_MENU_PRINT_B1
402
	movlw	1
403
	goto	CS_MENU_PRINT_OnOff_INDF0
404
 
405
; --------------------------------------------------------------------------
406
CS_MENU_PRINT_B2
407
	movlw	2
408
	goto	CS_MENU_PRINT_OnOff_INDF0
409
 
410
; --------------------------------------------------------------------------
411
CS_MENU_PRINT_VAR_SID1234
412
	call	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
413
	movwf	TMP1
414
	movff	MBNET_NODE_AVAIL, TMP2
415
 
416
	movlw	'-'
417
	btfsc	TMP1, 0
521 tk 418
	movlw	'1'
1 tk 419
	btfss	TMP2, 0
521 tk 420
	movlw	'*'
1 tk 421
	rcall	CS_MENU_PRINT_Char
422
	movlw	'-'
423
	btfsc	TMP1, 1
521 tk 424
	movlw	'2'
1 tk 425
	btfss	TMP2, 1
521 tk 426
	movlw	'*'
1 tk 427
	rcall	CS_MENU_PRINT_Char
428
	movlw	'-'
429
	btfsc	TMP1, 2
521 tk 430
	movlw	'3'
1 tk 431
	btfss	TMP2, 2
521 tk 432
	movlw	'*'
1 tk 433
	rcall	CS_MENU_PRINT_Char
434
	movlw	'-'
435
	btfsc	TMP1, 3
521 tk 436
	movlw	'4'
1 tk 437
	btfss	TMP2, 3
521 tk 438
	movlw	'*'
1 tk 439
	rgoto	CS_MENU_PRINT_Char
440
 
441
; --------------------------------------------------------------------------
442
CS_MENU_PRINT_VAR_123
443
	call	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
444
	goto	CS_MENU_PRINT_123
445
 
446
; --------------------------------------------------------------------------
447
CS_MENU_PRINT_VAR_DEC
448
	rcall	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
449
	goto	CS_MENU_PRINT_Dec
450
 
451
; --------------------------------------------------------------------------
452
CS_MENU_PRINT_VAR_DECP1
453
	rcall	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
454
	rgoto	CS_MENU_PRINT_DecPlus1
455
 
456
; --------------------------------------------------------------------------
457
CS_MENU_PRINT_VAR_LR
458
	rcall	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
459
	movlw	' '
460
	rcall	CS_MENU_PRINT_Char
461
	movlw	'-'
462
	btfsc	INDF0, 0
521 tk 463
	movlw	'L'
1 tk 464
	rcall	CS_MENU_PRINT_Char
465
	movlw	'-'
466
	btfsc	INDF0, 1
521 tk 467
	movlw	'R'
468
	rcall	CS_MENU_PRINT_Char
469
	movlw	' '
1 tk 470
	rgoto	CS_MENU_PRINT_Char
471
 
472
; --------------------------------------------------------------------------
473
CS_MENU_PRINT_VAR_CALI
474
	call	CS_MENU_FSR0_ENS
475
 
476
	;; add offset 4 if left SID is not selected
477
	movlw	0x00
478
	btfss	CS_MENU_SELECTED_SID_LR, 0
479
	addlw 4
480
	addwf	FSR0L, F
481
	movf	INDF0, W
482
	swapf	PREINC0, W
483
	call	MIOS_LCD_PrintHex1
484
	swapf	POSTDEC0, W
485
	andlw	0xf0
486
	movwf	PRODL
487
	swapf	INDF0, W
488
	andlw	0x0f
489
	iorwf	PRODL, W
521 tk 490
	call	MIOS_LCD_PrintHex2
491
	movlw	' '
492
	rgoto	CS_MENU_PRINT_Char
1 tk 493
 
494
; --------------------------------------------------------------------------
495
CS_MENU_PRINT_Vx_DEC
496
	rcall	CS_MENU_PRINT_GetVx
497
	rgoto	CS_MENU_PRINT_Dec
498
 
499
; --------------------------------------------------------------------------
500
CS_MENU_PRINT_Vx_DEC4U
501
	rcall	CS_MENU_PRINT_GetVx
502
	swapf	WREG, W
503
	andlw	0x0f
504
	rgoto	CS_MENU_PRINT_Dec
505
 
506
; --------------------------------------------------------------------------
507
CS_MENU_PRINT_Vx_DEC4L
508
	rcall	CS_MENU_PRINT_GetVx
509
	andlw	0x0f
510
	rgoto	CS_MENU_PRINT_Dec
511
 
512
; --------------------------------------------------------------------------
513
CS_MENU_PRINT_Vx_DECP1
514
	rcall	CS_MENU_PRINT_GetVx
515
	andlw	0x7f
516
	rgoto	CS_MENU_PRINT_DecPlus1
517
 
518
; --------------------------------------------------------------------------
362 tk 519
CS_MENU_PRINT_Vx_DECPM3
520
	rcall	CS_MENU_PRINT_GetVx
521
	andlw	0x07
522
	movwf	PRODL
523
	andlw	0x04
524
	bz	CS_MENU_PRINT_Vx_DECPM3_Pos
525
CS_MENU_PRINT_Vx_DECPM3_Neg
526
	movf	PRODL, W
527
	andlw	0x03
528
	addlw	0x80-4
529
	rgoto	CS_MENU_PRINT_PMDec8
530
CS_MENU_PRINT_Vx_DECPM3_Pos
531
	movf	PRODL, W
532
	addlw	0x80
533
	rgoto	CS_MENU_PRINT_PMDec8
534
 
535
; --------------------------------------------------------------------------
1 tk 536
CS_MENU_PRINT_Vx_PMD
537
	rcall	CS_MENU_PRINT_GetVx
538
	TABLE_ADDR CS_MENU_PRINT_PMD_Tab
539
	movlw	0
540
	btfsc	INDF0, SID_I_V_FLAGS1_PORTA_CTG
521 tk 541
	movlw	1
1 tk 542
	btfsc	INDF0, SID_I_V_FLAGS1_PORTA_GLISSANDO
521 tk 543
	movlw	2
1 tk 544
	rgoto	CS_MENU_PRINT_StringFromTable
545
CS_MENU_PRINT_PMD_Tab
546
	dw	"Nor "
547
	dw	"CTG "
548
	dw	"Gls "
549
	dw	"??? "
550
 
551
; --------------------------------------------------------------------------
552
CS_MENU_PRINT_Vx_GSA
553
	rcall	CS_MENU_PRINT_GetVx
554
 	movlw	SID_I_V_FLAGS1_GSA
555
	rgoto	CS_MENU_PRINT_OnOff_INDF0
556
 
557
; --------------------------------------------------------------------------
558
CS_MENU_PRINT_Vx_HEX8
559
	rcall	CS_MENU_PRINT_GetVx
560
	rgoto	CS_MENU_PRINT_Hex
561
 
562
; --------------------------------------------------------------------------
563
CS_MENU_PRINT_Vx_HEX12
564
	rcall	CS_MENU_PRINT_GetVx
521 tk 565
	rgoto	CS_MENU_PRINT_Hex12
1 tk 566
 
567
; --------------------------------------------------------------------------
568
CS_MENU_PRINT_Vx_PMDEC7
569
	rcall	CS_MENU_PRINT_GetVx
570
	rgoto	CS_MENU_PRINT_PMDec7
571
 
572
; --------------------------------------------------------------------------
573
CS_MENU_PRINT_Vx_PMDEC8
574
	rcall	CS_MENU_PRINT_GetVx
575
	rgoto	CS_MENU_PRINT_PMDec8
576
 
577
; --------------------------------------------------------------------------
578
CS_MENU_PRINT_Vx_WAV
579
	rcall	CS_MENU_PRINT_GetVx
580
	TABLE_ADDR CS_MENU_PRINT_Vx_WAV_Tab
581
	;; if INDF0[4], then oscillator has been switched off
582
	;; -> index 0
583
	movf	INDF0, W
805 tk 584
	andlw	0x0f
1 tk 585
	btfsc	INDF0, 4
521 tk 586
	movlw	0x00
1 tk 587
	rgoto	CS_MENU_PRINT_StringFromTable
588
 
589
; --------------------------------------------------------------------------
590
CS_MENU_PRINT_Vx_S_R
591
	rcall	CS_MENU_PRINT_GetVx
592
	TABLE_ADDR CS_MENU_PRINT_Vx_S_R_Tab
593
	;; status in INDF0[6..5]
594
	;; table allocates 4 bytes per entry
595
	;; therefore: offset = INDF0[6..5] >> 3
596
	rrf	INDF0, W
597
	swapf	WREG, W
598
	andlw	0x03
599
	rgoto	CS_MENU_PRINT_StringFromTable
600
 
601
; --------------------------------------------------------------------------
362 tk 602
CS_MENU_PRINT_Vx_NOTE
603
	rcall	CS_MENU_PRINT_GetVx
604
	skpnz
521 tk 605
	rgoto	CS_MENU_PRINT_MMM ; prints "--- "
606
	call	SID_NOTE_Print
607
	movlw	' '
608
	rgoto	CS_MENU_PRINT_Char
362 tk 609
 
610
; --------------------------------------------------------------------------
1 tk 611
CS_MENU_PRINT_Vx_ARP_ON
612
	rcall	CS_MENU_PRINT_GetVx
613
	movlw	SID_I_V_ARP_MODE_ENABLE
614
	rgoto	CS_MENU_PRINT_OnOff_INDF0
615
 
616
; --------------------------------------------------------------------------
617
CS_MENU_PRINT_Vx_ARP_DIR
618
	rcall	CS_MENU_PRINT_GetVx
619
	TABLE_ADDR CS_MENU_PRINT_Vx_ARP_DIR_Tab
620
	rrf	INDF0, W
621
	andlw	0x07
622
	rgoto	CS_MENU_PRINT_StringFromTable
623
 
624
; --------------------------------------------------------------------------
625
CS_MENU_PRINT_Vx_ARP_SOR
626
	rcall	CS_MENU_PRINT_GetVx
627
	movlw	SID_I_V_ARP_MODE_SORTED
628
	rgoto	CS_MENU_PRINT_OnOff_INDF0
629
 
630
; --------------------------------------------------------------------------
631
CS_MENU_PRINT_Vx_ARP_HLD
632
	rcall	CS_MENU_PRINT_GetVx
633
	movlw	SID_I_V_ARP_MODE_HOLD
634
	rgoto	CS_MENU_PRINT_OnOff_INDF0
635
 
636
; --------------------------------------------------------------------------
679 tk 637
CS_MENU_PRINT_Vx_ARP_SNC_ESY
1 tk 638
	rcall	CS_MENU_PRINT_GetVx
679 tk 639
	movlw	SID_I_V_ARP_MODE_DIV_SYNC ; same as SID_I_V_ARP_SPEED_DIV_EASY_CHORD
1 tk 640
	rgoto	CS_MENU_PRINT_OnOff_INDF0
641
 
642
; --------------------------------------------------------------------------
643
CS_MENU_PRINT_Vx_ARP_CAC
644
	rcall	CS_MENU_PRINT_GetVx
645
	movlw	SID_I_V_ARP_MODE_CAC
646
	rgoto	CS_MENU_PRINT_OnOff_INDF0
647
 
648
; --------------------------------------------------------------------------
649
CS_MENU_PRINT_Vx_ARP_GLN
650
	rcall	CS_MENU_PRINT_GetVx
651
	movf	INDF0, W
652
	andlw	0x1f
653
	rgoto	CS_MENU_PRINT_DecPlus1
654
 
655
; --------------------------------------------------------------------------
656
CS_MENU_PRINT_Vx_ARP_RNG
657
	rcall	CS_MENU_PRINT_GetVx
658
	swapf	INDF0, W
659
	rrf	WREG, W
660
	andlw	0x07
661
	rgoto	CS_MENU_PRINT_DecPlus1
662
 
663
; --------------------------------------------------------------------------
664
CS_MENU_PRINT_Vx_ARP_SPD
665
	rcall	CS_MENU_PRINT_GetVx
666
	movf	INDF0, W
667
	andlw	0x3f
668
	rgoto	CS_MENU_PRINT_DecPlus1
669
 
670
; --------------------------------------------------------------------------
671
CS_MENU_PRINT_Vx_ARP_ONE
672
	rcall	CS_MENU_PRINT_GetVx
673
	movlw	SID_I_V_ARP_SPEED_DIV_ONESHOT
674
	rgoto	CS_MENU_PRINT_OnOff_INDF0
675
 
676
; --------------------------------------------------------------------------
677
CS_MENU_PRINT_M_Vx_VAS
678
	rcall	CS_MENU_PRINT_GetVx
679
	TABLE_ADDR CS_MENU_PRINT_Vx_VAS_Tab
680
	movf	INDF0, W
681
	andlw	0x0f
682
	rgoto	CS_MENU_PRINT_StringFromTable
683
 
684
; --------------------------------------------------------------------------
685
CS_MENU_PRINT_M_Vx_PHASE
686
	rcall	CS_MENU_PRINT_GetVx
687
	movlw	SID_I_M_V_FLAGS2_PHASE
688
	rgoto	CS_MENU_PRINT_OnOff_INDF0
689
 
690
; --------------------------------------------------------------------------
691
CS_MENU_PRINT_M_Vx_POL
692
	rcall	CS_MENU_PRINT_GetVx
693
	movlw	SID_I_M_V_FLAGS2_POLY
694
	rgoto	CS_MENU_PRINT_OnOff_INDF0
695
 
696
; --------------------------------------------------------------------------
228 tk 697
CS_MENU_PRINT_BM_Vx_LEG
1 tk 698
	rcall	CS_MENU_PRINT_GetVx
699
	movlw	SID_I_M_V_FLAGS2_LEGATO
700
	rgoto	CS_MENU_PRINT_OnOff_INDF0
701
 
702
; --------------------------------------------------------------------------
703
CS_MENU_PRINT_M_Vx_WTO
704
	rcall	CS_MENU_PRINT_GetVx
705
	movlw	SID_I_M_V_FLAGS2_WT_ONLY
706
	rgoto	CS_MENU_PRINT_OnOff_INDF0
707
 
708
; --------------------------------------------------------------------------
228 tk 709
CS_MENU_PRINT_BM_Vx_SUK
1 tk 710
	rcall	CS_MENU_PRINT_GetVx
711
	movlw	SID_I_M_V_FLAGS2_SUS_KEY
712
	rgoto	CS_MENU_PRINT_OnOff_INDF0
713
 
714
; --------------------------------------------------------------------------
715
CS_MENU_PRINT_M_D_Vx_ASG
716
	;; special code only as notifier for assignment message - checked in cs_menu.inc
717
	rgoto	CS_MENU_PRINT_Vx_DEC
718
 
719
; --------------------------------------------------------------------------
720
CS_MENU_PRINT_D_Vx_VAS
721
	rcall	CS_MENU_PRINT_GetVx
722
	TABLE_ADDR CS_MENU_PRINT_Vx_VAS_Tab
723
	swapf	INDF0, W
724
	andlw	0x0f
725
	rgoto	CS_MENU_PRINT_StringFromTable
726
 
727
; --------------------------------------------------------------------------
728
CS_MENU_PRINT_Fx_CHN
729
	;; print selected channels
730
	TABLE_ADDR CS_MENU_PRINT_Fx_CHN_Tab
731
	call	CS_MENU_FSR0_Filter
732
	movf	INDF0, W
733
	andlw	0x07
734
	rgoto	CS_MENU_PRINT_StringFromTable
735
 
736
; --------------------------------------------------------------------------
737
CS_MENU_PRINT_Fx_CUTOFF
738
	call	CS_MENU_FSR0_Filter
521 tk 739
	rgoto	CS_MENU_PRINT_Hex12
1 tk 740
 
741
; --------------------------------------------------------------------------
742
CS_MENU_PRINT_Fx_RESON
743
	call	CS_MENU_FSR0_Filter
744
	movf	INDF0, W
745
	rgoto	CS_MENU_PRINT_Dec
746
 
747
; --------------------------------------------------------------------------
748
CS_MENU_PRINT_Fx_KTR
749
	call	CS_MENU_FSR0_Filter
750
	movf	INDF0, W
751
	rgoto	CS_MENU_PRINT_Dec
752
 
753
; --------------------------------------------------------------------------
754
CS_MENU_PRINT_Fx_MOD
755
	TABLE_ADDR CS_MENU_PRINT_Fx_MOD_Tab
756
	call	CS_MENU_FSR0_Filter
757
	swapf	INDF0, W
758
	andlw	0x07
759
	rgoto	CS_MENU_PRINT_StringFromTable
760
 
761
; --------------------------------------------------------------------------
762
CS_MENU_PRINT_Fx_EXT
763
	call	CS_MENU_FSR0_Filter
764
	movff	INDF0, MIOS_PARAMETER1
765
	movlw	3
766
	rgoto	CS_MENU_PRINT_OnOff
767
 
768
; --------------------------------------------------------------------------
769
CS_MENU_PRINT_Fx_3OF
770
CS_MENU_PRINT_Fx_FIP
771
	call	CS_MENU_FSR0_Filter
772
	movff	INDF0, MIOS_PARAMETER1
773
	movlw	7
774
	rgoto	CS_MENU_PRINT_OnOff
775
 
776
; --------------------------------------------------------------------------
777
CS_MENU_PRINT_LFOx_WAV
778
	TABLE_ADDR CS_MENU_PRINT_LFOx_WAV_Tab
779
	;; waveform stored in INDF0[6..4]
780
	;; 8 waveforms provided
781
	;; add 1, index 0 notifies "LFO Off"
782
	rcall	CS_MENU_PRINT_GetLFOx
783
	swapf	WREG, W
784
	andlw	0x0f
785
	addlw	1
786
	btfss	INDF0, 0
787
	movlw 0x00
788
	rgoto	CS_MENU_PRINT_StringFromTable
789
 
790
; --------------------------------------------------------------------------
791
CS_MENU_PRINT_LFOx_RATE
792
	rcall	CS_MENU_PRINT_GetLFOx	; FSR0 will point to SID_Ix_LFOx_RATE
793
 
794
	;; prepare TBLPTR[LH]
795
	TABLE_ADDR CS_MENU_PRINT_LFOx_RATE_Tab
796
	movlw	(SID_Ix_LFOx_MODE-SID_Ix_LFOx_RATE)
797
	BRA_IFCLR PLUSW0, SID_I_LFO_MODE_CLKSYNC, ACCESS, CS_MENU_PRINT_LFOx_RATE_Dec
1034 tk 798
	rrf	INDF0, W
799
	rrf	WREG, W
800
	rrf	WREG, W
801
	andlw	0x1f
1 tk 802
CS_MENU_PRINT_LFOx_RATE_Str
803
	rgoto	CS_MENU_PRINT_StringFromTable
804
 
805
CS_MENU_PRINT_LFOx_RATE_Dec
806
	movf	INDF0, W
807
	rgoto	CS_MENU_PRINT_Dec
808
 
809
; --------------------------------------------------------------------------
810
CS_MENU_PRINT_LFOx_DEC
811
	call	CS_MENU_PRINT_GetLFOx
812
	rgoto	CS_MENU_PRINT_Dec
813
 
814
; --------------------------------------------------------------------------
815
CS_MENU_PRINT_LFOx_PMDEC8
816
	call	CS_MENU_PRINT_GetLFOx
817
	rgoto	CS_MENU_PRINT_PMDec8
818
 
819
; --------------------------------------------------------------------------
820
CS_MENU_PRINT_LFOx_SNC
821
	;; controlled from trigger matrix (Note On Event)
822
	;; index already in CS_MENU_PARAMETER_IX, add LFO offset
823
	movf	CS_MENU_SELECTED_LFO, W
824
	addwf	CS_MENU_PARAMETER_IX, F
825
	movff	CS_MENU_SELECTED_TRG, TMP5	; store current trigger number
826
	clrf	CS_MENU_SELECTED_TRG; (Note On)
827
	rcall	CS_MENU_PRINT_TRGx_Nx
828
	movff	TMP5, CS_MENU_SELECTED_TRG	; restore old trigger number
829
	return
830
 
831
; --------------------------------------------------------------------------
832
CS_MENU_PRINT_LFOx_SNC_M
833
	rcall	CS_MENU_PRINT_GetLFOx
834
	movlw	SID_I_LFO_MODE_SYNC_M
835
	rgoto	CS_MENU_PRINT_OnOff_INDF0
836
 
837
; --------------------------------------------------------------------------
838
CS_MENU_PRINT_LFOx_ONE
839
	rcall	CS_MENU_PRINT_GetLFOx
840
	movlw	SID_I_LFO_MODE_ONESHOT
841
	rgoto	CS_MENU_PRINT_OnOff_INDF0
842
 
843
; --------------------------------------------------------------------------
844
CS_MENU_PRINT_LFOx_CSN
845
	rcall	CS_MENU_PRINT_GetLFOx
846
	movlw	SID_I_LFO_MODE_CLKSYNC
847
	rgoto	CS_MENU_PRINT_OnOff_INDF0
848
 
849
; --------------------------------------------------------------------------
850
CS_MENU_PRINT_ENVx_DEC
851
	rcall	CS_MENU_PRINT_GetENVx
852
	rgoto	CS_MENU_PRINT_Dec
853
 
854
; --------------------------------------------------------------------------
855
CS_MENU_PRINT_ENVx_PMDEC8
856
	rcall	CS_MENU_PRINT_GetENVx
857
	rgoto	CS_MENU_PRINT_PMDec8
858
 
859
; --------------------------------------------------------------------------
860
CS_MENU_PRINT_ENVx_LPB
861
	rcall	CS_MENU_PRINT_GetENVx
862
	andlw	0x07
863
	;; 	rgoto	CS_MENU_PRINT_ENVx_PrnLoop
864
 
865
CS_MENU_PRINT_ENVx_PrnLoop
866
	movwf	PRODL
867
	TABLE_ADDR CS_MENU_PRINT_ENVx_Loop_Tab
868
	movf	PRODL, W
869
	rgoto	CS_MENU_PRINT_StringFromTable
870
 
871
; --------------------------------------------------------------------------
872
CS_MENU_PRINT_ENVx_LPE
873
	rcall	CS_MENU_PRINT_GetENVx
874
	swapf	INDF0, W
875
	andlw	0x07
876
	rgoto	CS_MENU_PRINT_ENVx_PrnLoop
877
 
878
; --------------------------------------------------------------------------
879
CS_MENU_PRINT_ENVx_CSN
880
	rcall	CS_MENU_PRINT_GetENVx
881
	movlw	SID_I_ENV_MODE_CLKSYNC
882
	rgoto	CS_MENU_PRINT_OnOff_INDF0
883
 
884
; --------------------------------------------------------------------------
228 tk 885
CS_MENU_PRINT_ENVx_CAS
886
	TABLE_ADDR CS_MENU_PRINT_ENVx_CAS_Tab
887
	rcall	CS_MENU_PRINT_GetENVx
888
	swapf	INDF0, W
889
	andlw	0x07
890
	rgoto	CS_MENU_PRINT_StringFromTable
891
 
892
; --------------------------------------------------------------------------
1 tk 893
CS_MENU_PRINT_MODx_SRC
894
	TABLE_ADDR CS_MENU_PRINT_MODx_SRC_Tab
895
	rcall	CS_MENU_PRINT_GetMODx
896
	BRA_IFCLR WREG, 7, ACCESS, CS_MENU_PRINT_MODx_SRC_Norm
897
CS_MENU_PRINT_MODx_SRC_Const
898
	andlw	0x7f
899
	rgoto	CS_MENU_PRINT_Dec
900
 
901
CS_MENU_PRINT_MODx_SRC_Norm
902
	rgoto	CS_MENU_PRINT_StringFromTable
903
 
904
; --------------------------------------------------------------------------
905
CS_MENU_PRINT_MODx_OP
906
	TABLE_ADDR CS_MENU_PRINT_MODx_OP_Tab
907
	rcall	CS_MENU_PRINT_GetMODx
908
	andlw	0x0f
909
	rgoto	CS_MENU_PRINT_StringFromTable
910
 
911
; --------------------------------------------------------------------------
912
CS_MENU_PRINT_MODx_TAR
913
	TABLE_ADDR CS_MENU_PRINT_MODx_TAR_Tab
914
	rcall	CS_MENU_PRINT_GetMODx
915
	rgoto	CS_MENU_PRINT_StringFromTable
916
 
917
; --------------------------------------------------------------------------
918
CS_MENU_PRINT_MODx_INV1
919
	rcall	CS_MENU_PRINT_GetMODx
920
	movlw	6
921
	rgoto	CS_MENU_PRINT_OnOff_INDF0
922
 
923
; --------------------------------------------------------------------------
924
CS_MENU_PRINT_MODx_INV2
925
	rcall	CS_MENU_PRINT_GetMODx
926
	movlw	7
927
	rgoto	CS_MENU_PRINT_OnOff_INDF0
928
 
929
; --------------------------------------------------------------------------
930
CS_MENU_PRINT_MODx_Nx
931
	;; bit number stored in CS_MENU_PARAMETER_IX
932
 
933
	;; get pointer to modulation nodes
934
	call	CS_MENU_FSR0_MOD_TARG_L
935
 
936
	;; determine mask
937
	movf	CS_MENU_PARAMETER_IX, W
938
	call	MIOS_HLP_GetBitORMask
939
	movwf	TMP1
940
 
941
	;; print L/R depending on activated flags
942
	movf	POSTINC0, W
943
	andwf	TMP1, W
944
	movlw	'L'
945
	skpnz
946
	movlw	'-'
947
	rcall	CS_MENU_PRINT_Char
948
 
949
	movlw	'/'
950
	rcall	CS_MENU_PRINT_Char
951
 
952
	movf	POSTDEC0, W
953
	andwf	TMP1, W
954
	movlw	'R'
955
	skpnz
956
	movlw	'-'
521 tk 957
	rcall	CS_MENU_PRINT_Char
958
 
959
	movlw	' '
1 tk 960
	rgoto	CS_MENU_PRINT_Char
961
 
962
; --------------------------------------------------------------------------
963
CS_MENU_PRINT_MODx_PMDEC8
964
	rcall	CS_MENU_PRINT_GetMODx
965
	rgoto	CS_MENU_PRINT_PMDec8
966
 
967
; --------------------------------------------------------------------------
968
CS_MENU_PRINT_TRGx_SRC
969
	TABLE_ADDR CS_MENU_PRINT_TRGx_SRC_Tab
970
#if 0
904 tk 971
	clrf	FSR0H
385 tk 972
	movf	INDF0, W
1 tk 973
	rgoto	CS_MENU_PRINT_StringFromTable
974
#else
975
	;; special variation required for Page Up/Down print function (only 3 characters print)
904 tk 976
	clrf	FSR0H
385 tk 977
	rlf	INDF0, W
1 tk 978
	rlf	WREG, W
979
	andlw	0xfc
980
	TABLE_ADD_W
904 tk 981
	movlw	3
1 tk 982
	goto	MIOS_LCD_PrintPreconfString
983
#endif
984
 
985
; --------------------------------------------------------------------------
986
CS_MENU_PRINT_TRGx_Nx
987
	;; also used by CS_MENU_PRINT_LFOx_SNC
988
	;; don't overwrite TMP5 !!!
989
 
990
	;; bit number stored in CS_MENU_PARAMETER_IX
991
 
992
	;; get pointer to trigger target
993
	call	CS_MENU_FSR0_TRG
994
 
995
	;; print On/Off
996
	movf	CS_MENU_PARAMETER_IX, W
997
	rgoto	CS_MENU_PRINT_OnOff_INDF0
998
 
999
; --------------------------------------------------------------------------
1000
CS_MENU_PRINT_CLK_BPM
1001
	call	CS_MENU_FSR0_ENS
1002
	movf	INDF0, W
1003
	rgoto	CS_MENU_PRINT_Dec
1004
 
1005
; --------------------------------------------------------------------------
1006
CS_MENU_PRINT_CLK_SLAVE
1007
	TABLE_ADDR CS_MENU_PRINT_CLK_SLAVE_Tab
1008
	call	CS_MENU_FSR0_ENS
1009
	movlw	0
1010
	btfsc	INDF0, SID_ENS_CTRL1_CLK_SLAVE
521 tk 1011
	movlw	1
1 tk 1012
	btfsc	INDF0, SID_ENS_CTRL1_CLK_AUTO
521 tk 1013
	movlw	2
1 tk 1014
	rgoto	CS_MENU_PRINT_StringFromTable
1015
CS_MENU_PRINT_CLK_SLAVE_Tab
1016
	dw	"Mst."
1017
	dw	"Slv."
1018
	dw	"Auto"
1019
 
1020
; --------------------------------------------------------------------------
1102 tk 1021
CS_MENU_PRINT_CLK_OUT
1022
	call	CS_MENU_FSR0_ENS
1023
	movlw	SID_ENS_CTRL1_CLK_OUT
1024
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1025
 
1026
; --------------------------------------------------------------------------
1 tk 1027
CS_MENU_PRINT_KNB
1028
	TABLE_ADDR CS_MENU_PRINT_KNB_Tab
1029
	rcall	CS_MENU_PRINT_GetVAR	; pointer to variable in FSR0
1030
	rgoto	CS_MENU_PRINT_StringFromTable
1031
 
1032
; --------------------------------------------------------------------------
1033
CS_MENU_PRINT_KNB_VALUE
1034
	movf	CS_MENU_PARAMETER_IX, W
1035
	call	SID_KNOB_GetPtr
1036
	movlw	HIGH(SID_EDIT_BUFFER)-HIGH(SID_PATCH_BUFFER)
1037
	addwf	FSR1H, F
1038
	movlw	SID_Ix_Px_VALUE
1039
	movf	PLUSW1, W
1040
	rgoto	CS_MENU_PRINT_Dec
1041
 
1042
; --------------------------------------------------------------------------
1043
CS_MENU_PRINT_KNB_PAR
1044
	call	CS_MENU_FSR0_Knob
1045
	movf	INDF0, W
1046
	rgoto	CS_MENU_PRINT_Dec
1047
 
1048
; --------------------------------------------------------------------------
1049
CS_MENU_PRINT_KNB_MINMAX
1050
	call	CS_MENU_FSR0_Knob
1051
	movf	INDF0, W
1052
	rgoto	CS_MENU_PRINT_Dec
1053
 
1054
; --------------------------------------------------------------------------
1055
CS_MENU_PRINT_EXT_VALUE
1056
	;; convert 16bit -> 12bit
1057
	movff	POSTINC0, PRODL
1058
	movff	POSTDEC0, PRODH
1059
 
1060
	swapf	PRODH, W
1061
	call	MIOS_LCD_PrintHex1
521 tk 1062
	movf	PRODH, W
1063
	call	MIOS_LCD_PrintHex1
1 tk 1064
	swapf	PRODL, W
521 tk 1065
	call	MIOS_LCD_PrintHex1
1066
	movlw	' '
1067
	rgoto	CS_MENU_PRINT_Char
1 tk 1068
 
1069
; --------------------------------------------------------------------------
1070
CS_MENU_PRINT_EXT_SWITCH
1071
	;; change address to custom switch register
1072
	movlw	SID_Ix_CUSTOM_SW
1073
	movwf	FSR0L
1074
	;; flag number in CS_MENU_PARAMETER_IX
1075
	movf	CS_MENU_PARAMETER_IX, W
1076
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1077
 
1078
; --------------------------------------------------------------------------
1079
CS_MENU_PRINT_WTx_PAR
1080
	call	CS_MENU_FSR0_WT
1081
	movf	INDF0, W
1082
	rgoto	CS_MENU_PRINT_Dec
1083
 
1084
; --------------------------------------------------------------------------
1085
CS_MENU_PRINT_WTx_PAR_P1
1086
	call	CS_MENU_FSR0_WT
1087
	movf	INDF0, W
1088
	rgoto	CS_MENU_PRINT_DecPlus1
1089
 
1090
; --------------------------------------------------------------------------
1091
CS_MENU_PRINT_WTx_SID
1092
	call	CS_MENU_FSR0_WT
1093
	;; print L/R depending on activated flags
1094
	movlw	'-'
1095
	btfsc	INDF0, 6
521 tk 1096
	movlw	'L'
1 tk 1097
	rcall	CS_MENU_PRINT_Char
1098
 
1099
	movlw	'/'
1100
	rcall	CS_MENU_PRINT_Char
1101
 
1102
	movlw	'-'
1103
	btfsc	INDF0, 7
521 tk 1104
	movlw	'R'
1105
	rcall	CS_MENU_PRINT_Char
1106
 
1107
	movlw	' '
1 tk 1108
	rgoto	CS_MENU_PRINT_Char
1109
 
1110
; --------------------------------------------------------------------------
1111
CS_MENU_PRINT_WTx_SPD
1112
	call	CS_MENU_FSR0_WT
1113
	movf	INDF0, W
1114
	andlw	0x3f
1115
	rgoto	CS_MENU_PRINT_DecPlus1
1116
 
1117
; --------------------------------------------------------------------------
1118
CS_MENU_PRINT_WTx_B7
1119
	call	CS_MENU_FSR0_WT
1120
	movlw	7
1121
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1122
 
1123
; --------------------------------------------------------------------------
1124
CS_MENU_PRINT_WTx_POS
1125
	call	CS_MENU_FSR0_WT
1126
	movf	INDF0, W
1127
	andlw	0x7f
521 tk 1128
	rcall	CS_MENU_PRINT_WTVal
1129
	movlw	' '		; fill with space
1130
	rgoto	CS_MENU_PRINT_Char
1 tk 1131
 
1132
; --------------------------------------------------------------------------
1133
CS_MENU_PRINT_WTx_LOP
1134
	call	CS_MENU_FSR0_WT
1135
	BRA_IFSET INDF0, 7, ACCESS, CS_MENU_PRINT_WTx_LOP_One
1136
	movf	INDF0, W
1137
	andlw	0x7f
521 tk 1138
	rcall	CS_MENU_PRINT_WTVal
1139
	movlw	' '		; fill with space
1140
	rgoto	CS_MENU_PRINT_Char
1 tk 1141
CS_MENU_PRINT_WTx_LOP_One
521 tk 1142
	rgoto	CS_MENU_PRINT_MMM ; prints "--- "
1 tk 1143
 
1144
; --------------------------------------------------------------------------
1145
CS_MENU_PRINT_WTE_POS
1146
	;; value 0x00-0x1f: print decimal number
1147
	;; value >= 0x80: print "All"
1148
	rcall	CS_MENU_PRINT_GetVAR
1149
	movlw	0x7f
1150
	cpfsgt	CS_MENU_WT_POS, ACCESS
1151
	rgoto CS_MENU_PRINT_WTE_POS_Val
1152
CS_MENU_PRINT_WTE_POS_All
1153
	movlw	'A'
1154
	rcall	CS_MENU_PRINT_Char
1155
	movlw	'l'
1156
	rcall	CS_MENU_PRINT_Char
1157
	movlw	'l'
521 tk 1158
	rcall	CS_MENU_PRINT_Char
1159
	movlw	' '
1 tk 1160
	rgoto	CS_MENU_PRINT_Char
1161
 
1162
CS_MENU_PRINT_WTE_POS_Val
1163
	movf	INDF0, W
521 tk 1164
	rcall	CS_MENU_PRINT_WTVal
1165
	movlw	' '		; fill with space
1166
	rgoto	CS_MENU_PRINT_Char
1 tk 1167
 
1168
; --------------------------------------------------------------------------
1169
CS_MENU_PRINT_WTE_PAR
1003 tk 1170
	;; we have to move the code, otherwise rcalls to print functions (CS_MENU_PRINT_Handler) not working
1171
	goto	CS_MENU_PRINT_WTE_PAR_Hlp
1 tk 1172
 
1173
; --------------------------------------------------------------------------
1174
CS_MENU_PRINT_WT_VAL
1175
	movlw	'H'
1176
	btfsc	CS_STAT2, CS_STAT2_WT_DEC_VIEW
521 tk 1177
	movlw	'D'
1 tk 1178
	rcall	CS_MENU_PRINT_Char
1179
	movlw	'e'
1180
	rcall	CS_MENU_PRINT_Char
1181
	movlw	'x'
1182
	btfsc	CS_STAT2, CS_STAT2_WT_DEC_VIEW
521 tk 1183
	movlw	'c'
1184
	rcall	CS_MENU_PRINT_Char
1185
	movlw	' '
1 tk 1186
	rgoto	CS_MENU_PRINT_Char
1187
 
1188
; --------------------------------------------------------------------------
1189
CS_MENU_PRINT_WT_GO
1190
	movlw	'G'
1191
	rcall	CS_MENU_PRINT_Char
1192
	movlw	'o'
1193
	rcall	CS_MENU_PRINT_Char
1194
	movlw	'!'
521 tk 1195
	rcall	CS_MENU_PRINT_Char
1196
	movlw	' '
1 tk 1197
	rgoto	CS_MENU_PRINT_Char
1198
 
1199
; --------------------------------------------------------------------------
1200
CS_MENU_PRINT_SEQ_POS
1201
	;; value 0x00-0x0f: print decimal number+1
1202
	;; value >= 0x10: print "All"
1203
	rcall	CS_MENU_PRINT_GetVAR
1204
	movlw	0x0f
1205
	cpfsgt	CS_MENU_WT_POS, ACCESS
1206
	rgoto CS_MENU_PRINT_SEQ_POS_Val
1207
CS_MENU_PRINT_SEQ_POS_All
1208
	rgoto	CS_MENU_PRINT_WTE_POS_All
1209
 
1210
CS_MENU_PRINT_SEQ_POS_Val
1211
	movf	INDF0, W
1212
	rgoto	CS_MENU_PRINT_DecPlus1
1213
 
1214
; --------------------------------------------------------------------------
1215
CS_MENU_PRINT_SEQ_NUM
1216
	call	CS_MENU_FSR0_WT
1217
	movf	INDF0, W
1218
	andlw	0xf8
1219
	bnz	CS_MENU_PRINT_SEQ_NUM_Dis
1220
CS_MENU_PRINT_SEQ_NUM_Valid
1221
	movf	INDF0, W
1222
	rgoto	CS_MENU_PRINT_DecPlus1
1223
CS_MENU_PRINT_SEQ_NUM_Dis
1224
	movlw	' '
1225
	rcall	CS_MENU_PRINT_Char
1226
	movlw	' '
1227
	rcall	CS_MENU_PRINT_Char
1228
	movlw	'-'
521 tk 1229
	rcall	CS_MENU_PRINT_Char
1230
	movlw	' '
1 tk 1231
	rgoto	CS_MENU_PRINT_Char
1232
 
1233
; --------------------------------------------------------------------------
1234
CS_MENU_PRINT_SEQ_S16
1235
	call	CS_MENU_FSR0_WT
1236
	movlw	SID_I_V_SEQ_SYNC16
1237
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1238
 
1239
; --------------------------------------------------------------------------
1240
CS_MENU_PRINT_D_SEQ_ON
1241
	call	CS_MENU_FSR0_WT
1242
	movlw	SID_I_V_SEQ_ON
1243
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1244
 
1245
; --------------------------------------------------------------------------
1246
CS_MENU_PRINT_B_SEQ_VAL
1247
	;; determine pointer to parameter depending on CS_MENU_WT_SEQ/CS_MENU_WT_POS
1248
	call	CS_MENU_FSR0_WTPos
1249
 
1250
	;; branch depending on parameter part:
1251
	;; 0 = note, 1 = Octave, 2 = Slide/Gate, 3 = Accent, 4 = Parameter
1252
	movf	CS_MENU_PARAMETER_IX, W
1253
	bz	CS_MENU_PRINT_B_SEQ_VAL_Note
1254
	addlw	-1
1255
	bz	CS_MENU_PRINT_B_SEQ_VAL_Oct
1256
	addlw	-1
1257
	bz	CS_MENU_PRINT_B_SEQ_VAL_S_G
1258
	addlw	-1
1259
	bz	CS_MENU_PRINT_B_SEQ_VAL_Acc
1260
	rgoto	CS_MENU_PRINT_B_SEQ_VAL_Par
1261
 
1262
CS_MENU_PRINT_B_SEQ_VAL_Note
1263
	movlw	' '
1264
	rcall	CS_MENU_PRINT_Char
1265
	movf	INDF0, W
1266
	andlw	0x0f
1267
	TABLE_ADDR_MUL_W CS_MENU_PRINT_SEQ_NOTE_Tab, 2
1268
	movlw	2
521 tk 1269
	call	MIOS_LCD_PrintPreconfString
1270
	movlw	' '
1271
	rgoto	CS_MENU_PRINT_Char
1 tk 1272
 
1273
CS_MENU_PRINT_B_SEQ_VAL_Oct
1274
	TABLE_ADDR CS_MENU_PRINT_B_SEQ_VAL_Oct_Tab
1275
	swapf	INDF0, W
797 tk 1276
	andlw	0x03
1 tk 1277
	rgoto	CS_MENU_PRINT_StringFromTable
1278
CS_MENU_PRINT_B_SEQ_VAL_Oct_Tab
1279
	dw	" -  "	; mapped to 0
1280
	dw	" Up "	; mapped to 1
1281
	dw	"Dwn "	; mapped to 3
1282
	dw	"Up2 "	; mapped to 2
1283
 
1284
CS_MENU_PRINT_B_SEQ_VAL_S_G
1285
	movlw	'-'
1286
	btfsc	INDF0, 6
1287
	movlw '*'
1288
	rcall	CS_MENU_PRINT_Char
1289
 
1290
	movlw	' '
1291
	rcall	CS_MENU_PRINT_Char
1292
 
1293
	movlw	'-'
1294
	btfsc	INDF0, 7
521 tk 1295
	movlw	'*'
1296
	rcall	CS_MENU_PRINT_Char
1297
	movlw	' '
1 tk 1298
	rgoto	CS_MENU_PRINT_Char
1299
 
1300
CS_MENU_PRINT_B_SEQ_VAL_Acc
1301
	movlw	0x80		; accent flag is located in upper bank
1302
	addwf	FSR0L, F
1303
	movlw	7
1304
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1305
 
1306
CS_MENU_PRINT_B_SEQ_VAL_Par
1307
	movlw	0x80		; 7bit parameter is located in upper bank
1308
	addwf	FSR0L, F
1309
	movf	INDF0, W
1310
	andlw	0x7f
1311
	rgoto	CS_MENU_PRINT_Dec
1312
 
1313
; --------------------------------------------------------------------------
1314
CS_MENU_PRINT_D_MODEL
1315
	rcall	CS_MENU_PRINT_GetVx
1316
	movf	INDF0, W
1317
	rgoto	CS_MENU_PRINT_DModel
1318
 
1319
; --------------------------------------------------------------------------
1320
CS_MENU_PRINT_RND_GEN
1321
	movlw	'G'
1322
	rcall	CS_MENU_PRINT_Char
1323
	movlw	'e'
1324
	rcall	CS_MENU_PRINT_Char
1325
	movlw	'n'
521 tk 1326
	rcall	CS_MENU_PRINT_Char
1327
	movlw	' '
1 tk 1328
	rgoto	CS_MENU_PRINT_Char
1329
 
1330
; --------------------------------------------------------------------------
1331
CS_MENU_PRINT_SAVE_BNK
869 tk 1332
	;; flashing if second menu item selected (dirty, but the user won't see this code... ;)
1333
	;; this method has a second "advantage" (or side effect?):
1334
	;; the real bank number will be disabled for a short moment if internal patch selected
1335
	BRA_IFCLR CS_STAT, CS_STAT_MODIFY_PARAMETER, ACCESS, CS_MENU_PRINT_SAVE_BNK_NoFlash
1336
	BRA_IFCLR CS_STAT, CS_STAT_CURSOR_FLASH, ACCESS, CS_MENU_PRINT_SAVE_BNK_Flash
1337
 
1338
CS_MENU_PRINT_SAVE_BNK_NoFlash
1 tk 1339
	movff	CS_MENU_SAVE_BANK, SID_BANK
1340
	movff	CS_MENU_SAVE_PATCH, SID_PATCH
1341
	call	SID_PBANK_CheckPatchValid
869 tk 1342
	bz	CS_MENU_PRINT_SAVE_BNK_Ok
1 tk 1343
	movf	SID_BANK, W	; always allow to store in bank #0
869 tk 1344
	bz	CS_MENU_PRINT_SAVE_BNK_Ok
1 tk 1345
 
1346
CS_MENU_PRINT_SAVE_BNK_Inv
1347
	movf	CS_MENU_SAVE_BANK, W
1348
	addlw	'A'
1349
	rcall	CS_MENU_PRINT_Char
869 tk 1350
 
521 tk 1351
	movlw	'-'
1 tk 1352
	rcall	CS_MENU_PRINT_Char
1353
	movlw	'-'
1354
	rcall	CS_MENU_PRINT_Char
1355
	movlw	'-'
521 tk 1356
	rcall	CS_MENU_PRINT_Char
1357
	movlw	' '
1 tk 1358
	rgoto	CS_MENU_PRINT_Char
1359
 
869 tk 1360
CS_MENU_PRINT_SAVE_BNK_Ok
1 tk 1361
	movff	CS_MENU_SAVE_BANK, PRODL
1362
	movff	CS_MENU_SAVE_PATCH, PRODH
521 tk 1363
	call	SID_LCD_PrintPatchNumber
1364
	movlw	' '
1365
	rgoto	CS_MENU_PRINT_Char
1 tk 1366
 
869 tk 1367
 
1368
CS_MENU_PRINT_SAVE_BNK_Flash
1369
	movf	CS_MENU_SAVE_BANK, W
1370
	addlw	'A'
1371
	rcall	CS_MENU_PRINT_Char
1372
	movlw	4
1373
	goto	SID_LCD_PrintSpaces
1374
 
1375
 
1 tk 1376
; --------------------------------------------------------------------------
1377
CS_MENU_PRINT_SAVE_PAT
1378
	return			; (already print)
1379
 
1380
; --------------------------------------------------------------------------
1381
CS_MENU_PRINT_SAVE_NAME
1382
	;; (dirty but required for save menu) set cursor
1383
	movlw	0x45
1384
	call	MIOS_LCD_CursorSet
1385
 
1386
	movff	CS_MENU_SAVE_PATCH, SID_PATCH
1387
	movff	CS_MENU_SAVE_BANK, SID_BANK
1388
	goto	SID_LCD_PrintPatchEE
1389
 
1390
; --------------------------------------------------------------------------
1391
CS_MENU_PRINT_SAVE_ENS
790 tk 1392
	movf	CS_MENU_SAVE_ENS, W	; always allow to store in bank #0
1393
	bz	CS_MENU_PRINT_SAVE_ENS_Ok
1 tk 1394
	call	SID_EBANK_CheckValid
1395
	bz	CS_MENU_PRINT_SAVE_ENS_Ok
1396
 
1397
CS_MENU_PRINT_SAVE_ENS_Inv
1398
	movlw	'E'
1399
	rcall	CS_MENU_PRINT_Char
362 tk 1400
	rgoto	CS_MENU_PRINT_MMM ; prints "---"
1 tk 1401
 
1402
CS_MENU_PRINT_SAVE_ENS_Ok
1403
	movff	CS_MENU_SAVE_ENS, PRODL
1404
	goto	SID_LCD_PrintEnsembleNumberPRODL
1405
 
1406
 
1407
; --------------------------------------------------------------------------
1408
CS_MENU_PRINT_ENSxIx_DECP1
1409
	rcall	CS_MENU_PRINT_GetEnsIx
1410
	rgoto	CS_MENU_PRINT_DecPlus1
1411
 
1412
; --------------------------------------------------------------------------
1413
CS_MENU_PRINT_ENSxIx_CHN
1414
	rcall	CS_MENU_PRINT_GetEnsIx
1415
	andlw	0xf0
1416
	bnz	CS_MENU_PRINT_ENSxIx_CHN_Dis
1417
	movf	INDF0, W
1418
	rgoto	CS_MENU_PRINT_DecPlus1
1419
CS_MENU_PRINT_ENSxIx_CHN_Dis
1420
	movlw	' '
1421
	rcall	CS_MENU_PRINT_Char
1422
	movlw	'-'
1423
	rcall	CS_MENU_PRINT_Char
1424
	movlw	'-'
521 tk 1425
	rcall	CS_MENU_PRINT_Char
1426
	movlw	' '
1 tk 1427
	rgoto	CS_MENU_PRINT_Char
1428
 
1429
; --------------------------------------------------------------------------
1430
CS_MENU_PRINT_ENSxIx_NOTE
1431
	rcall	CS_MENU_PRINT_GetEnsIx
521 tk 1432
	call	SID_NOTE_Print
1433
	movlw	' '
1434
	rgoto	CS_MENU_PRINT_Char
1 tk 1435
 
1436
; --------------------------------------------------------------------------
1437
CS_MENU_PRINT_ENSxIx_PMDEC7
1438
	rcall	CS_MENU_PRINT_GetEnsIx
1439
	rgoto	CS_MENU_PRINT_PMDec7
1440
 
1441
; --------------------------------------------------------------------------
1442
CS_MENU_PRINT_ENSx_X2A
1443
	call	CS_MENU_FSR0_ENS_CTRL2
1444
	movf	CS_MENU_PARAMETER_IX, W		; contains x2A flag
1445
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1446
 
1447
; --------------------------------------------------------------------------
1448
CS_MENU_PRINT_ENSx_RESERVED
1449
	return
1450
 
1451
; --------------------------------------------------------------------------
1452
CS_MENU_PRINT_ENSx_MONO
1453
	call	CS_MENU_FSR0_ENS
1454
	movlw	SID_ENS_CTRL1_MONO
1455
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1456
 
1457
; --------------------------------------------------------------------------
340 tk 1458
CS_MENU_PRINT_ENSx_FILLOG
1459
	call	CS_MENU_FSR0_ENS
1460
	movlw	SID_ENS_CTRL1_FIL_LOG
1461
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1462
 
1463
; --------------------------------------------------------------------------
1464
CS_MENU_PRINT_ENSx_DOR
1465
	call	CS_MENU_FSR0_ENS
1466
	movlw	SID_ENS_CTRL1_DOR
1467
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1468
 
1469
; --------------------------------------------------------------------------
1 tk 1470
CS_MENU_PRINT_ENSx_SPV
1471
	call	CS_MENU_FSR0_ENS
1472
	movf	INDF0, W
1473
	andlw	0x07
1474
	bz	CS_MENU_PRINT_ENSx_SPV_Zero
653 tk 1475
	;; don't touch value if master SID not selected
1476
	movf	CS_MENU_SID, W
1 tk 1477
	movlw	' '
653 tk 1478
	skpz
1479
	movlw	'('		; (to notify, that value not selectable from slave)
521 tk 1480
	rcall	CS_MENU_PRINT_Char
653 tk 1481
 
1482
	movf	INDF0, W
1483
	andlw	0x07
1484
	call	MIOS_LCD_PrintBCD1
1485
	movf	CS_MENU_SID, W
521 tk 1486
	movlw	' '
653 tk 1487
	skpz
1488
	movlw	')'		; (to notify, that value not selectable from slave)
1489
	rcall	CS_MENU_PRINT_Char
1490
	movlw	' '
1 tk 1491
	rgoto	CS_MENU_PRINT_Char
1492
 
1493
CS_MENU_PRINT_ENSx_SPV_Zero
1494
	movlw	'o'
1495
	rcall	CS_MENU_PRINT_Char
1496
	movlw	'f'
1497
	rcall	CS_MENU_PRINT_Char
1498
	movlw	'f'
521 tk 1499
	rcall	CS_MENU_PRINT_Char
1500
	movlw	' '
1 tk 1501
	rgoto	CS_MENU_PRINT_Char
1502
 
1503
; --------------------------------------------------------------------------
1504
CS_MENU_PRINT_ENSx_EXTINV
1505
	call	CS_MENU_FSR0_ENS
1506
	movf	FSR0L, W	; (CS_MENU_PARAMETER_IX and FSR0L contain offset to bit instead of address)
1507
	andlw	0xf0
1508
	addlw	SID_ENSx_AOUT_INVERTED
1509
	movwf	FSR0L
1510
	movf	CS_MENU_PARAMETER_IX, W
1511
	rgoto	CS_MENU_PRINT_OnOff_INDF0
1512
 
1513
 
1514
; ==========================================================================
1515
; ==========================================================================
1516
;  Help Functions
1517
; ==========================================================================
1518
; ==========================================================================
1519
 
1520
; --------------------------------------------------------------------------
1521
;; get variable (value in WREG, pointer in FSR0)
1522
CS_MENU_PRINT_GetVAR
1523
	clrf	FSR0H
1524
	movf	INDF0, W
1525
	return
1526
 
1527
; --------------------------------------------------------------------------
1528
;; get ENSx_Ix variable (value in WREG, pointer in FSR0)
1529
CS_MENU_PRINT_GetEnsIx
1530
	call	CS_MENU_FSR0_ENS_Ix
1531
	movf	INDF0, W
1532
	return
1533
 
1534
; --------------------------------------------------------------------------
1535
;; get Vx variable (value in WREG, pointer in FSR0)
1536
CS_MENU_PRINT_GetVx
1537
	call	CS_MENU_FSR0_Voice
1538
	movf	INDF0, W
1539
	return
1540
 
1541
; --------------------------------------------------------------------------
1542
;; get LFOx variable (value in WREG, pointer in FSR0)
1543
CS_MENU_PRINT_GetLFOx
1544
	call	CS_MENU_FSR0_LFO
1545
	movf	INDF0, W
1546
	return
1547
 
1548
; --------------------------------------------------------------------------
1549
;; get ENVx variable (value in WREG, pointer in FSR0)
1550
CS_MENU_PRINT_GetENVx
1551
	call	CS_MENU_FSR0_ENV
1552
	movf	INDF0, W
1553
	return
1554
 
1555
; --------------------------------------------------------------------------
1556
;; get MODx variable (value in WREG, pointer in FSR0)
1557
CS_MENU_PRINT_GetMODx
1558
	call	CS_MENU_FSR0_MOD
1559
	movf	INDF0, W
1560
	return
1561
 
1562
; --------------------------------------------------------------------------
1563
;; print character
1564
CS_MENU_PRINT_Char
1565
	goto	MIOS_LCD_PrintChar
1566
 
1567
; --------------------------------------------------------------------------
1568
;; print hex value 00..FF
1569
CS_MENU_PRINT_Hex
1570
	movwf	TMP1
1571
	movlw	' '		; fill with space
1572
	rcall	CS_MENU_PRINT_Char
1573
	movf	TMP1, W
521 tk 1574
	call	MIOS_LCD_PrintHex2
1575
	movlw	' '		; fill with space
1576
	rgoto	CS_MENU_PRINT_Char
1 tk 1577
 
1578
; --------------------------------------------------------------------------
1579
;; print hex value -0x40..0x3f
1580
CS_MENU_PRINT_PMHex
1581
	movwf	TMP1
1582
	movlw	'+'		; "+" or "-"?
1583
	btfss	TMP1, 6; (if value <= 0x3f (6th bit cleared), print "-"
1584
	movlw '-'
1585
	rcall	CS_MENU_PRINT_Char
1586
 
1587
	movf	TMP1, W		; calc: 0x40-value
1588
	andlw	0x7f
1589
	sublw	0x40
1590
	btfsc	WREG, 7			; negate value if negative to get absolute value
1591
	negf	WREG, ACCESS
521 tk 1592
	call	MIOS_LCD_PrintHex2	; and print it
1593
	movlw	' '		; fill with space
1594
	rgoto	CS_MENU_PRINT_Char
1 tk 1595
 
1596
; --------------------------------------------------------------------------
521 tk 1597
;; print 12bit hex value 0x000..0xfff
1598
;; expecting pointer to value in FSR0
1599
CS_MENU_PRINT_Hex12
1600
	movf	PREINC0, W
1601
	call	MIOS_LCD_PrintHex1
1602
	movf	POSTDEC0, W
1603
	movf	INDF0, W
1604
	call	MIOS_LCD_PrintHex2
1605
	movlw	' '
1606
	rgoto	CS_MENU_PRINT_Char
1607
 
1608
; --------------------------------------------------------------------------
1 tk 1609
;; print dec value 1..128
1610
CS_MENU_PRINT_DecPlus1
1611
	addlw	1
1612
CS_MENU_PRINT_Dec
1613
;; print dec value 0..127
521 tk 1614
	call	MIOS_LCD_PrintBCD3
1615
	movlw	' '		; fill with space
1616
	rgoto	CS_MENU_PRINT_Char
1 tk 1617
 
1618
; --------------------------------------------------------------------------
1619
;; print dec value patted with 0
1620
CS_MENU_PRINT_Dec000
1621
	clrf	MIOS_PARAMETER1
1622
	call	MIOS_HLP_Dec2BCD
1623
	movf	MIOS_PARAMETER2, W
1624
	call	MIOS_LCD_PrintHex1
1625
	movf	MIOS_PARAMETER1, W
521 tk 1626
	call	MIOS_LCD_PrintHex2
1627
	movlw	' '		; fill with space
1628
	rgoto	CS_MENU_PRINT_Char
1 tk 1629
 
1630
; --------------------------------------------------------------------------
1631
;; print dec value -64..63
1632
CS_MENU_PRINT_PMDec7
1633
	movwf	TMP1
1634
	movlw	' '		; space or "-"?
1635
	btfss	TMP1, 6; (if value <= 0x3f (6th bit cleared), print "-"
1636
	movlw '-'
1637
	rcall	CS_MENU_PRINT_Char
1638
 
1639
CS_MENU_PRINT_PMDec7_WO_Sign
1640
	movf	TMP1, W		; calc: 0x40-value
1641
	sublw	0x40
1642
	btfsc	WREG, 7			; negate value if negative to get absolute value
1643
	negf	WREG, ACCESS
521 tk 1644
	call	MIOS_LCD_PrintBCD2	; and print it
1645
	movlw	' '		; fill with space
1646
	rgoto	CS_MENU_PRINT_Char
1 tk 1647
 
1648
; --------------------------------------------------------------------------
1649
;; print dec value -128..127
1650
CS_MENU_PRINT_PMDec8
1651
	BRA_IFCLR WREG, 7, ACCESS, CS_MENU_PRINT_PMDec8_Neg
1652
CS_MENU_PRINT_PMDec8_Pos
1653
	;; positive value: always 3 characters
1654
	andlw	0x7f
521 tk 1655
	call	MIOS_LCD_PrintBCD3
1656
	movlw	' '		; fill with space
1657
	rgoto	CS_MENU_PRINT_Char
1 tk 1658
 
1659
CS_MENU_PRINT_PMDec8_Neg
1660
	;; negative value: if <= -100, use special character for "-1"
1661
	sublw	0x80
1662
	movwf	TMP1
1663
	addlw	-100
1664
	bc	CS_MENU_PRINT_PMDec8_Neg_3
1665
CS_MENU_PRINT_PMDec8_Neg_2
1666
	movlw	'-'
1667
	rcall	CS_MENU_PRINT_Char
1668
	movf	TMP1, W
521 tk 1669
	call	MIOS_LCD_PrintBCD2
1670
	movlw	' '		; fill with space
1671
	rgoto	CS_MENU_PRINT_Char
1672
 
1 tk 1673
CS_MENU_PRINT_PMDec8_Neg_3
1674
	movlw	0x06		; "-1" in one character
1675
	rcall	CS_MENU_PRINT_Char
1676
	movf	TMP1, W
1677
	addlw	-100
1678
#if 0
521 tk 1679
	call	MIOS_LCD_PrintBCD2
1 tk 1680
#else
1681
	clrf	MIOS_PARAMETER1
1682
	call	MIOS_HLP_Dec2BCD
521 tk 1683
	call	MIOS_LCD_PrintHex2
1 tk 1684
#endif
521 tk 1685
	movlw	' '		; fill with space
1686
	rgoto	CS_MENU_PRINT_Char
1 tk 1687
 
1688
 
1689
; --------------------------------------------------------------------------
1690
;; bit which should be selected in WREG, byte in MIOS_PARAMETER1
1691
CS_MENU_PRINT_OnOff_INDF0
1692
	movff	INDF0, MIOS_PARAMETER1
1693
CS_MENU_PRINT_OnOff
1694
	call	MIOS_HLP_GetBitORMask
1695
	andwf	MIOS_PARAMETER1, W
1696
	bnz 	CS_MENU_PRINT_OnOff1
1697
CS_MENU_PRINT_OnOff0
1698
	movlw	' '
1699
	rcall	CS_MENU_PRINT_Char
1700
	movlw	'o'
521 tk 1701
	rgoto	CS_MENU_PRINT_OnOff_Cont
1 tk 1702
CS_MENU_PRINT_OnOff1
1703
	movlw	' '
1704
	rcall	CS_MENU_PRINT_Char
1705
	movlw	'*'
521 tk 1706
 
1707
CS_MENU_PRINT_OnOff_Cont
1 tk 1708
	rcall	CS_MENU_PRINT_Char
1709
	movlw	' '
521 tk 1710
	rcall	CS_MENU_PRINT_Char
1711
	movlw	' '
1 tk 1712
	rgoto	CS_MENU_PRINT_Char
1713
 
1714
 
1715
; --------------------------------------------------------------------------
1716
;; print string from table, offset in WREG
1717
CS_MENU_PRINT_StringFromTable
1718
	rlf	WREG, F
1719
	rlf	WREG, W
1720
	andlw	0xfc
1721
	TABLE_ADD_W
1722
	movlw	0x04
1723
	goto	MIOS_LCD_PrintPreconfString
1724
 
1725
; --------------------------------------------------------------------------
362 tk 1726
;; print "---"
1727
CS_MENU_PRINT_MMM
1728
	movlw	'-'
1729
	rcall	CS_MENU_PRINT_Char
1730
	movlw	'-'
1731
	rcall	CS_MENU_PRINT_Char
1732
	movlw	'-'
521 tk 1733
	rcall	CS_MENU_PRINT_Char
1734
	movlw	' '		; fill with space
362 tk 1735
	rgoto	CS_MENU_PRINT_Char
1736
 
1737
 
1738
; --------------------------------------------------------------------------
1 tk 1739
;; print 123 depending on TMP[2..0]
1740
CS_MENU_PRINT_123
1741
	movwf	TMP1
1742
	movlw	'-'
1743
	btfsc	TMP1, 0
521 tk 1744
	movlw	'1'
1 tk 1745
	rcall	CS_MENU_PRINT_Char
1746
	movlw	'-'
1747
	btfsc	TMP1, 1
521 tk 1748
	movlw	'2'
1 tk 1749
	rcall	CS_MENU_PRINT_Char
1750
	movlw	'-'
1751
	btfsc	TMP1, 2
521 tk 1752
	movlw	'3'
1753
	rcall	CS_MENU_PRINT_Char
1754
	movlw	' '		; fill with space
1 tk 1755
	rgoto	CS_MENU_PRINT_Char
1756
 
1757
; --------------------------------------------------------------------------
1758
;; prints the name of a drum model
1759
CS_MENU_PRINT_DModel
1760
	TABLE_ADDR_MUL_W SID_DMODEL_TABLE, 2
1761
	tblrd*+
1762
	movff	TABLAT, PRODL
1763
	tblrd*+
1764
	movff	TABLAT, TBLPTRH
1765
	movff	PRODL, TBLPTRL
1766
	movlw	0x04
1767
	goto	MIOS_LCD_PrintPreconfString
1768
 
1769
 
1770
; --------------------------------------------------------------------------
1771
;; print the 16 selected sequencer steps (called from cs_menu.inc,
1772
CS_MENU_PRINT_SeqSteps
1773
	;; pointer to 16bit entry -> FSR0
1774
	call	CS_MENU_FSR0_WTPos
1775
	;; print 16 steps
1776
	movff	POSTINC0, TMP1	; gate shift register (Step 1-8)
1777
	movff	POSTINC0, TMP3	; accent shift register (Step 1-8)
1778
	movff	POSTINC0, TMP2	; gate shift register (Step 9-16)
1779
	movff	POSTINC0, TMP4	; accent shift register (Step 9-16)
1780
	movlw	16
1781
	movwf	PRODL		; counter
1782
CS_MENU_PRINT_SeqSteps_Loop
1783
	;; coding:
1784
	;; Gate  Accent  Result
1785
	;;    0       0  Don't play note
1786
	;;    1       0  Play Note w/o accent
1787
	;;    0       1  Play Note w/ accent
1788
	;;    1       1  Play Secondary Note
1789
 
1790
	BRA_IFSET TMP1, 0, ACCESS, CS_MENU_PRINT_SeqSteps_Loop_G1
1791
CS_MENU_PRINT_SeqSteps_Loop_G0
1792
	BRA_IFSET TMP3, 0, ACCESS, CS_MENU_PRINT_SeqSteps_Loop_G0A1
1793
CS_MENU_PRINT_SeqSteps_Loop_G0A0
1794
	movlw	0xa5	; (dot)
1795
	rgoto	CS_MENU_PRINT_SeqSteps_Loop_Cont
1796
CS_MENU_PRINT_SeqSteps_Loop_G0A1
1797
	movlw	'A'
1798
	rgoto	CS_MENU_PRINT_SeqSteps_Loop_Cont
1799
 
1800
CS_MENU_PRINT_SeqSteps_Loop_G1
1801
	BRA_IFSET TMP3, 0, ACCESS, CS_MENU_PRINT_SeqSteps_Loop_G1A1
1802
CS_MENU_PRINT_SeqSteps_Loop_G1A0
1803
	movlw	'*'
1804
	rgoto	CS_MENU_PRINT_SeqSteps_Loop_Cont
1805
CS_MENU_PRINT_SeqSteps_Loop_G1A1
1806
	movlw	'S'
1807
	;; 	rgoto	CS_MENU_PRINT_SeqSteps_Loop_Cont
1808
 
1809
CS_MENU_PRINT_SeqSteps_Loop_Cont
1810
	rcall	CS_MENU_PRINT_Char
1811
	rrf	TMP2, F
1812
	rrf	TMP1, F
1813
	rrf	TMP4, F
1814
	rrf	TMP3, F
1815
	decfsz	PRODL, F
1816
	rgoto	CS_MENU_PRINT_SeqSteps_Loop
1817
 
1818
	return
1819
 
1820
 
1821
; --------------------------------------------------------------------------
1822
;; print 7bit hex/dec number depending on WT_DEC_VIEW flag
521 tk 1823
;; another difference: this function only prints 3 characters instead of 4,
1824
;; so that the caller can add a custom char behind the item if required
1 tk 1825
;; value in WREG
1826
CS_MENU_PRINT_WTVal
521 tk 1827
	BRA_IFCLR CS_STAT2, CS_STAT2_WT_DEC_VIEW, ACCESS, CS_MENU_PRINT_WTVal_Hex
1828
	goto	MIOS_LCD_PrintBCD3
1829
CS_MENU_PRINT_WTVal_Hex
1830
	movwf	TMP1
1831
	movlw	' '		; fill with space
1832
	rcall	CS_MENU_PRINT_Char
1833
	movf	TMP1, W
1834
	goto	MIOS_LCD_PrintHex2
1 tk 1835
 
1836
CS_MENU_PRINT_PMWTVal
521 tk 1837
	BRA_IFSET CS_STAT2, CS_STAT2_WT_DEC_VIEW, ACCESS, CS_MENU_PRINT_PMWTVal_Dec
1 tk 1838
	movwf	TMP1
1839
	movlw	'+'		; "+" or "-"?
1840
	btfss	TMP1, 6; (if value <= 0x3f (6th bit cleared), print "-"
1841
	movlw '-'
1842
	rcall	CS_MENU_PRINT_Char
1843
 
521 tk 1844
	movf	TMP1, W		; calc: 0x40-value
1845
	andlw	0x7f
1846
	sublw	0x40
1847
	btfsc	WREG, 7			; negate value if negative to get absolute value
1848
	negf	WREG, ACCESS
1849
	goto	MIOS_LCD_PrintHex2	; and print it
1 tk 1850
 
521 tk 1851
CS_MENU_PRINT_PMWTVal_Dec
1852
	movwf	TMP1
1853
	movlw	'+'		; "+" or "-"?
1854
	btfss	TMP1, 6; (if value <= 0x3f (6th bit cleared), print "-"
1855
	movlw	'-'
1856
	rcall	CS_MENU_PRINT_Char
1857
	movf	TMP1, W		; calc: 0x40-value
1858
	sublw	0x40
1859
	btfsc	WREG, 7			; negate value if negative to get absolute value
1860
	negf	WREG, ACCESS
1861
	call	MIOS_LCD_PrintBCD2	; and print it
1862
#if 0
1863
	movlw	' '		; fill with space
1864
	rgoto	CS_MENU_PRINT_Char
1865
#else
1866
	return			; mostly need only 3 chars
1867
#endif
1 tk 1868
 
1003 tk 1869
 
1870
 
1 tk 1871
; --------------------------------------------------------------------------
1003 tk 1872
;  Following help fuinction located here to ensure that CS_MENU_PRINT_Handler can
1873
;  work with 2byte "rgoto"'s
1874
; --------------------------------------------------------------------------
1875
CS_MENU_PRINT_WTE_PAR_Hlp
1876
	call	CS_MENU_FSR0_WTPos		; sets ZERO flag if value outside range
1877
	bnz	CS_MENU_PRINT_WTE_PAR_Ok
1878
CS_MENU_PRINT_WTE_PAR_Inv
1879
	;; extra for multi engine: if W+16 flag set, show "invalid" positions as well
1880
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
1881
	andlw	0x03
1882
	xorlw	0x03
1883
	bnz	CS_MENU_PRINT_WTE_PAR_InvDotDot
1884
	lfsr	FSR1, SID_EDIT_BUFFER + SID_Ix_M_I1_BASE + SID_Ix_M_Vx_WT_BEGIN
1885
	movf	CS_MENU_PARAMETER_IX, W
1886
	andlw	0x07
1887
	mullw	SID_Ix_M_I2_BASE - SID_Ix_M_I1_BASE
1888
	movf	PRODL, W
1889
	addwf	FSR1L, F
1890
	movf	PRODH, W
1891
	addwfc	FSR1H, F
1892
	BRA_IFSET INDF1, 7, ACCESS, CS_MENU_PRINT_WTE_PAR_Ok
1893
 
1894
CS_MENU_PRINT_WTE_PAR_InvDotDot
1895
	movlw	'.'
1896
	rcall	CS_MENU_PRINT_Char
1897
	movlw	'.'
1898
	rcall	CS_MENU_PRINT_Char
1899
	movlw	'.'
1900
	rcall	CS_MENU_PRINT_Char
1901
	rgoto	CS_MENU_PRINT_WTE_PAR_End
1902
 
1903
CS_MENU_PRINT_WTE_PAR_Ok
1904
	BRA_IFCLR INDF0, 7, ACCESS, CS_MENU_PRINT_WTE_PAR_PM
1905
CS_MENU_PRINT_WTE_PAR_Px
1906
	;; special case: if Assignment in between 0xfc..0xff: print note instead of hex/dec number
1907
 
1908
	;; get WT assignment which corresponds to displayed entry
1909
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
1910
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_PRINT_WTE_PAR_Px_DM
1911
CS_MENU_PRINT_WTE_PAR_Px_LB
1912
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_PRINT_WTE_PAR_Px_B
1913
CS_MENU_PRINT_WTE_PAR_Px_L
1914
	lfsr	FSR1, SID_EDIT_BUFFER + SID_Ix_L_WT1_BASE + SID_Ix_WTx_ASSGN
1915
	movf	CS_MENU_PARAMETER_IX, W
1916
	andlw	0x03
1917
	mullw	SID_Ix_L_WT2_BASE-SID_Ix_L_WT1_BASE
1918
	movf	PRODL, W
1919
	addwf	FSR1L, F
1920
	movf	INDF1, W
1921
	andlw	0xfc
1922
	xorlw	0xfc
1923
	rgoto	CS_MENU_PRINT_WTE_PAR_Px_FOk
1924
CS_MENU_PRINT_WTE_PAR_Px_B
1925
	rgoto	CS_MENU_PRINT_WTE_PAR_Px_L	; not implemented yet
1926
CS_MENU_PRINT_WTE_PAR_Px_DM
1927
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_PRINT_WTE_PAR_Px_M
1928
CS_MENU_PRINT_WTE_PAR_Px_D
1929
	rgoto	CS_MENU_PRINT_WTE_PAR_Px_L	; not implemented yet
1930
CS_MENU_PRINT_WTE_PAR_Px_M
1931
	;; consider W+16 (no note display if current position > begin
1932
	lfsr	FSR1, SID_EDIT_BUFFER + SID_Ix_M_I1_BASE + SID_Ix_M_Vx_WT_BEGIN
1933
	movf	CS_MENU_PARAMETER_IX, W
1934
	andlw	0x07
1935
	mullw	SID_Ix_M_I2_BASE - SID_Ix_M_I1_BASE
1936
	movf	PRODL, W
1937
	addwf	FSR1L, F
1938
	movf	PRODH, W
1939
	addwfc	FSR1H, F
1940
	BRA_IFCLR INDF1, 7, ACCESS, CS_MENU_PRINT_WTE_PAR_Px_M2
1941
 
1942
	movlw	SID_Ix_M_Vx_WT_END - SID_Ix_M_Vx_WT_BEGIN
1943
	addwf	FSR1L, F
1944
	movf	INDF1, W
1945
	andlw	0x7f
1946
	addlw	1
1947
	cpfslt	CS_MENU_WT_POS, ACCESS
1948
	rgoto	CS_MENU_PRINT_WTE_PAR_Px_Hex
1949
	movlw	SID_Ix_M_Vx_WT_BEGIN - SID_Ix_M_Vx_WT_END
1950
	addwf	FSR1L, F
1951
 
1952
CS_MENU_PRINT_WTE_PAR_Px_M2
1953
	movlw	SID_Ix_M_Vx_WT_ASSGN - SID_Ix_M_Vx_WT_BEGIN
1954
	addwf	FSR1L, F
1955
	movf	INDF1, W
1956
	andlw	0xf8
1957
	xorlw	0xf8
1958
	;; 	rgoto	CS_MENU_PRINT_WTE_PAR_Px_FOk
1959
 
1960
CS_MENU_PRINT_WTE_PAR_Px_FOk
1961
 
1962
	bnz	CS_MENU_PRINT_WTE_PAR_Px_Hex
1963
CS_MENU_PRINT_WTE_PAR_Px_Note
1964
	;; if INDF0 >= 0xfc, print Ky1...Ky4 (for arpeggiator)
1965
	movf	INDF0, W
1966
	andlw	0xfc
1967
	xorlw	0xfc
1968
	bnz	CS_MENU_PRINT_WTE_PAR_Px_NoArp
1969
CS_MENU_PRINT_WTE_PAR_Px_Arp
1970
	movlw	'K'
1971
	rcall	CS_MENU_PRINT_Char
1972
	movlw	'y'
1973
	rcall	CS_MENU_PRINT_Char
1974
	movf	INDF0, W
1975
	andlw	0x03
1976
	addlw	1
1977
	call	MIOS_LCD_PrintBCD1
1978
	rgoto	CS_MENU_PRINT_WTE_PAR_End
1979
 
1980
CS_MENU_PRINT_WTE_PAR_Px_NoArp
1981
	;; if INDF0 == 0, print "---" (for no note)
1982
	movf	INDF0, W
1983
	andlw	0x7f
1984
	bz	CS_MENU_PRINT_WTE_PAR_Px_NoN
1985
	;; if INDF0 == 1, print "+++" (for hold note)
1986
	addlw	-1
1987
	bz	CS_MENU_PRINT_WTE_PAR_Px_Hold
1988
	;; else print note name
1989
CS_MENU_PRINT_WTE_PAR_Px_NoHld
1990
	addlw	+1
1991
	call	SID_NOTE_Print
1992
	rgoto	CS_MENU_PRINT_WTE_PAR_End
1993
 
1994
CS_MENU_PRINT_WTE_PAR_Px_NoN
1995
	movlw	'-'
1996
	rgoto	CS_MENU_PRINT_WTE_PAR_Px_NoNC
1997
CS_MENU_PRINT_WTE_PAR_Px_Hold
1998
	movlw	'+'
1999
CS_MENU_PRINT_WTE_PAR_Px_NoNC
2000
	movwf	TABLAT
2001
	rcall	CS_MENU_PRINT_Char
2002
	movf	TABLAT, W
2003
	rcall	CS_MENU_PRINT_Char
2004
	movf	TABLAT, W
2005
	rcall	CS_MENU_PRINT_Char
2006
	rgoto	CS_MENU_PRINT_WTE_PAR_End
2007
 
2008
CS_MENU_PRINT_WTE_PAR_Px_Hex
2009
	movf	INDF0, W
2010
	andlw	0x7f
2011
	rcall	CS_MENU_PRINT_WTVal
2012
	rgoto	CS_MENU_PRINT_WTE_PAR_End
2013
 
2014
CS_MENU_PRINT_WTE_PAR_PM
2015
	movf	INDF0, W
2016
	rcall	CS_MENU_PRINT_PMWTVal
2017
	;; 	rgoto	CS_MENU_PRINT_WTE_PAR_End
2018
 
2019
CS_MENU_PRINT_WTE_PAR_End
2020
	;; if position matches with loop point, add '<' marker
2021
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
2022
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_PRINT_WTE_PAR_LC_DM
2023
CS_MENU_PRINT_WTE_PAR_LC_LB
2024
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_PRINT_WTE_PAR_LC_B
2025
CS_MENU_PRINT_WTE_PAR_LC_L
2026
	lfsr	FSR1, SID_EDIT_BUFFER + SID_Ix_L_WT1_BASE + SID_Ix_WTx_LOOP
2027
	movf	CS_MENU_PARAMETER_IX, W
2028
	andlw	0x03
2029
	mullw	SID_Ix_L_WT2_BASE-SID_Ix_L_WT1_BASE
2030
	rgoto	CS_MENU_PRINT_WTE_PAR_LC_FOk
2031
CS_MENU_PRINT_WTE_PAR_LC_B
2032
	rgoto	CS_MENU_PRINT_WTE_PAR_LC_L	; not implemented yet
2033
CS_MENU_PRINT_WTE_PAR_LC_DM
2034
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_PRINT_WTE_PAR_LC_M
2035
CS_MENU_PRINT_WTE_PAR_LC_D
2036
	rgoto	CS_MENU_PRINT_WTE_PAR_LC_L	; not implemented yet
2037
CS_MENU_PRINT_WTE_PAR_LC_M
2038
	lfsr	FSR1, SID_EDIT_BUFFER + SID_Ix_M_I1_BASE + SID_Ix_WTx_LOOP
2039
	movf	CS_MENU_PARAMETER_IX, W
2040
	andlw	0x07
2041
	mullw	SID_Ix_M_I2_BASE - SID_Ix_M_I1_BASE
2042
	;; 	rgoto	CS_MENU_PRINT_WTE_PAR_LC_FOk
2043
 
2044
CS_MENU_PRINT_WTE_PAR_LC_FOk
2045
	movf	PRODL, W
2046
	addwf	FSR1L, F
2047
	movf	PRODH, W
2048
	addwfc	FSR1H, F
2049
 
2050
	;; skip if oneshot flag set
2051
	btfsc	INDF1, 7
2052
	return
2053
	movf	INDF1, W
2054
	andlw	0x7f
2055
	movwf	PRODL
2056
 
2057
	movf	FSR0L, W
2058
	addlw	0-LOW(SID_Ix_WAVETABLE)
2059
	xorwf	PRODL, W
2060
	movlw	'<'
2061
	skpz
2062
	movlw	' '
2063
	rcall	CS_MENU_PRINT_Char
2064
	return
2065
 
2066
 
2067
 
2068
; --------------------------------------------------------------------------
1 tk 2069
;  Large String tables (located here to ensure that CS_MENU_PRINT_Handler can
2070
;  work with 2byte "rgoto"'s
2071
; --------------------------------------------------------------------------
340 tk 2072
CS_MENU_PRINT_Fx_MOD_Tab
2073
	dw	"--- "
2074
	dw	"L-- "
2075
	dw	"-B- "
2076
	dw	"LB- "
2077
	dw	"--H "
2078
	dw	"L-H "
2079
	dw	"-BH "
2080
	dw	"LBH "
2081
 
2082
CS_MENU_PRINT_Fx_CHN_Tab
2083
	dw	"--- "
2084
	dw	"1-- "
2085
	dw	"-2- "
2086
	dw	"12- "
2087
	dw	"--3 "
2088
	dw	"1-3 "
2089
	dw	"-23 "
2090
	dw	"123 "
2091
 
2092
CS_MENU_PRINT_Vx_WAV_Tab
2093
	dw	"off "
2094
	dw	"Tri "
2095
	dw	"Saw "
2096
	dw	"T+S "
2097
	dw	"Pul "
2098
	dw	"P+T "
2099
	dw	"P+S "
2100
	dw	"PST "
2101
	dw	"Noi "
805 tk 2102
	dw	"Ns1 "	; mixed noise waveform
2103
	dw	"Ns2 "	; mixed noise waveform
2104
	dw	"Ns3 "	; mixed noise waveform
2105
	dw	"Ns4 "	; mixed noise waveform
2106
	dw	"Ns5 "	; mixed noise waveform
2107
	dw	"Ns6 "	; mixed noise waveform
2108
	dw	"Ns7 "	; mixed noise waveform
340 tk 2109
 
2110
CS_MENU_PRINT_Vx_S_R_Tab
2111
	dw	"--- "
2112
	dw	"Syn "
2113
	dw	"Rin "
2114
	dw	"R&S "
2115
 
1 tk 2116
CS_MENU_PRINT_Vx_VAS_Tab
2117
	dw	" LR "
2118
	dw	" L- "
2119
	dw	" -R "
2120
	dw	" O1 "
2121
	dw	" O2 "
2122
	dw	" O3 "
2123
	dw	" O4 "
2124
	dw	" O5 "
2125
	dw	" O6 "
2126
 
2127
CS_MENU_PRINT_Vx_ARP_DIR_Tab
2128
	dw	"Up  "
2129
	dw	"Dwn "
2130
	dw	"U&D "
2131
	dw	"D&U "
2132
	dw	"UD2 "
2133
	dw	"DU2 "
2134
	dw	"Rnd "
2135
	dw	"r.7 "		; reserved
2136
 
2137
CS_MENU_PRINT_LFOx_WAV_Tab
2138
	dw	"off "
2139
	dw	"Sin "
2140
	dw	"Tri "
2141
	dw	"Saw "
2142
	dw	"Pul "
2143
	dw	"Ran "
2144
	dw	"PSn "
2145
	dw	"PTr "
2146
	dw	"PSw "
2147
	dw	"PPl "
2148
 
2149
CS_MENU_PRINT_LFOx_RATE_Tab
1034 tk 2150
	dw	"--- "
2151
	dw	"16b "
2152
	dw	"14b "
2153
	dw	"12b "
2154
	dw	"10b "
2155
	dw	" 9b "
2156
	dw	" 8b "
2157
	dw	" 7b "
2158
	dw	" 6b "
2159
	dw	" 5b "
2160
	dw	" 4b "
2161
	dw	"3.5b"
2162
	dw	" 3b "
2163
	dw	"2.5b"
2164
	dw	" 2b "
2165
	dw	"1.5b"
2166
	dw	" 1b "
2167
	dw	"1/2D"
2168
	dw	"1/1T"
1 tk 2169
	dw	"1/2 "
1034 tk 2170
	dw	"1/4D"
2171
	dw	"1/2T"
1 tk 2172
	dw	"1/4 "
1034 tk 2173
	dw	"1/8D"
2174
	dw	"1/4T"
1 tk 2175
	dw	"1/8 "
1034 tk 2176
	dw	"/16D"
2177
	dw	"1/8T"
2178
	dw	"/16 "
2179
	dw	"/32D"
2180
	dw	"/16T"
2181
	dw	"/32 "
1 tk 2182
 
2183
CS_MENU_PRINT_ENVx_Loop_Tab
2184
	dw	"--- "
2185
	dw	"At1 "
2186
	dw	"At2 "
2187
	dw	"De1 "
2188
	dw	"De2 "
2189
	dw	"Sus "
2190
	dw	"Re1 "
2191
	dw	"Re2 "
2192
 
228 tk 2193
CS_MENU_PRINT_ENVx_CAS_Tab
2194
	dw	"--- "
2195
	dw	"A-- "
2196
	dw	"-D- "
2197
	dw	"AD- "
2198
	dw	"--R "
2199
	dw	"A-R "
2200
	dw	"-DR "
2201
	dw	"ADR "
2202
 
1 tk 2203
CS_MENU_PRINT_MODx_SRC_Tab
2204
	dw	"--- "
2205
	dw	"EG1 "
2206
	dw	"EG2 "
2207
	dw	"LF1 "
2208
	dw	"LF2 "
2209
	dw	"LF3 "
2210
	dw	"LF4 "
2211
	dw	"LF5 "
2212
	dw	"LF6 "
2213
	dw	"MP1 "
2214
	dw	"MP2 "
2215
	dw	"MP3 "
2216
	dw	"MP4 "
2217
	dw	"MP5 "
2218
	dw	"MP6 "
2219
	dw	"MP7 "
2220
	dw	"MP8 "
2221
	dw	"MdW "
2222
	dw	"Key "
2223
	dw	"K#1 "
2224
	dw	"K#2 "
2225
	dw	"K#3 "
2226
	dw	"K#4 "
2227
	dw	"K#5 "
2228
	dw	"K#V "
2229
	dw	"K#P "
2230
	dw	"K#A "
2231
	dw	"WT1 "
2232
	dw	"WT2 "
2233
	dw	"WT3 "
2234
	dw	"WT4 "
2235
 
2236
CS_MENU_PRINT_MODx_OP_Tab
2237
	dw	"--- "
2238
	dw	"Sr1 "
2239
	dw	"Sr2 "
2240
	dw	"1+2 "
2241
	dw	"1-2 "
2242
	dw	"1*2 "
2243
	dw	"XOR "
2244
	dw	"OR  "
2245
	dw	"AND "
2246
	dw	"MIN "
2247
	dw	"MAX "
2248
	dw	"1<2 "
2249
	dw	"1>2 "
2250
	dw	"1=2 "
2251
	dw	"S&H "
2252
	dw	"r.2 "
2253
 
2254
CS_MENU_PRINT_MODx_TAR_Tab
2255
	dw	"--- "
2256
	dw	"Pt1 "
2257
	dw	"Pt2 "
2258
	dw	"Pt3 "
2259
	dw	"Pt4 "
2260
	dw	"Pt5 "
2261
	dw	"Pt6 "
2262
	dw	"PW1 "
2263
	dw	"PW2 "
2264
	dw	"PW3 "
2265
	dw	"PW4 "
2266
	dw	"PW5 "
2267
	dw	"PW6 "
2268
	dw	"Fl1 "
2269
	dw	"Fl2 "
2270
	dw	"Vl1 "
2271
	dw	"Vl2 "
2272
	dw	"LD1 "
2273
	dw	"LD2 "
2274
	dw	"LD3 "
2275
	dw	"LD4 "
2276
	dw	"LD5 "
2277
	dw	"LD6 "
2278
	dw	"LR1 "
2279
	dw	"LR2 "
2280
	dw	"LR3 "
2281
	dw	"LR4 "
2282
	dw	"LR5 "
2283
	dw	"LR6 "
2284
	dw	"Ex1 "
2285
	dw	"Ex2 "
2286
	dw	"Ex3 "
2287
	dw	"Ex4 "
2288
	dw	"Ex5 "
2289
	dw	"Ex6 "
2290
	dw	"Ex7 "
2291
	dw	"Ex8 "
2292
	dw	"WT1 "
2293
	dw	"WT2 "
2294
	dw	"WT3 "
2295
	dw	"WT4 "
2296
 
2297
CS_MENU_PRINT_TRGx_SRC_Tab
2298
	dw	"NOn "
2299
	dw	"NOf "
2300
	dw	"E1S "
2301
	dw	"E2S "
2302
	dw	"L1P "
2303
	dw	"L2P "
2304
	dw	"L3P "
2305
	dw	"L4P "
2306
	dw	"L5P "
2307
	dw	"L6P "
2308
	dw	"Clk "
248 tk 2309
	dw	"Cl6 "
2310
	dw	"C24 "
1 tk 2311
	dw	"MSt "
2312
 
2313
CS_MENU_PRINT_KNB_Tab
2314
	dw	"K#1 "
2315
	dw	"K#2 "
2316
	dw	"K#3 "
2317
	dw	"K#4 "
2318
	dw	"K#5 "
2319
	dw	"K#V "
2320
	dw	"K#P "
2321
	dw	"K#A "
2322
 
2323
CS_MENU_PRINT_SEQ_NOTE_Tab
2324
	db	"C ", "C#", "D ", "D#", "E ", "F ", "F#", "G ", "G#", "A ", "A#", "B ", "C+"