Subversion Repositories svn.mios

Rev

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

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