Subversion Repositories svn.mios

Rev

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

Rev Author Line No. Line
44 tk 1
; $Id: cs_menu_matrix.inc 869 2009-12-08 21:52:43Z tk $
1 tk 2
;
3
; SID Control Surface Modulation Matrix Handler
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
;;  Initialises the Button matrix handler (called from cs_menu.inc)
15
;; --------------------------------------------------------------------------
16
CS_MENU_MATRIX_Init
17
 
18
#if DEFAULT_SRM_BUTTONS_DIN
19
	lfsr	FSR0, BM_ROW0_VALUES	; will be set to 0xff
20
	lfsr	FSR1, BM_ROW0_CHANGED	; will be set to 0x00
21
	clrf	PRODL			; init loop counter
22
CS_MENU_MATRIX_Init_Loop
23
	setf	POSTINC0
24
	clrf	POSTINC1
25
	incf	PRODL, F
26
	BRA_IFCLR PRODL, 3, ACCESS, CS_MENU_MATRIX_Init_Loop	; loop 8 times
27
#endif
28
 
29
	return
30
 
31
 
32
;; --------------------------------------------------------------------------
33
;;  This function drives the modulation matrix (8*7 LEDs)
34
;;  it's called periodically every SR update cycle
35
;;  by sid_srio.inc, USER_SR_Service_Prepare
36
;;
37
;;  Note that this is an interrupt service routine! Use FSR2 instead of FSR0
38
;;  and IRQ_TMPx instead of TMPx -- and make the routine as fast as possible!
39
;; --------------------------------------------------------------------------
40
CS_MENU_MATRIX_Handler
41
	;; increment line counter, wrap at 8 (0, 1, 2, ... 7, 0, 1, 2, ...)
42
	incf	CS_MENU_MATRIX_CTR, W
43
	andlw	0x07
44
	movwf	CS_MENU_MATRIX_CTR
45
 
46
	;; on overrun, increment flash counter
47
	skpnz
48
	incf	CS_MENU_MATRIX_FLASH_CTR, F
49
 
50
	;; get shift register pattern for the common line drivers
51
	;; this selects the column (E1, E2, L1, ... L6)
52
	movf	CS_MENU_MATRIX_CTR, W
53
	call	MIOS_HLP_GetBitORMask
54
#if DEFAULT_MB6582_CS
55
#if DEFAULT_SRM_CATHODES
56
	movwf	MIOS_PARAMETER1
57
	movlw	(DEFAULT_SRM_CATHODES-1) & 0xf
58
	call	MIOS_DOUT_SRSet
59
#endif
835 tk 60
#endif
61
#if DEFAULT_SAMMICHSID_CS
62
#if DEFAULT_SRM_CATHODES
63
	xorlw	0xff
64
	movwf	MIOS_PARAMETER1
65
	movlw	(DEFAULT_SRM_CATHODES-1) & 0xf
66
	call	MIOS_DOUT_SRSet
67
#endif
68
#endif
69
#if !DEFAULT_MB6582_CS && !DEFAULT_SAMMICHSID_CS
1 tk 70
#if DEFAULT_SRM_MODMATRIX_DOUT
71
	movwf	MIOS_PARAMETER1
72
	movlw	(DEFAULT_SRM_MODMATRIX_DOUT-1) & 0xf
73
	call	MIOS_DOUT_SRSet
74
#endif
75
#endif
76
 
77
	;; now determine the pattern for the LED anodes
869 tk 78
	movf	CS_MENU_REINIT_CFG_CTR, W
79
	bz	CS_MENU_MATRIX_Handler_NoStartup
80
CS_MENU_MATRIX_Handler_Startup
81
	;; christmas lights:
82
	;; show a (somehow) random pattern
83
	movf	CS_MENU_MATRIX_CTR, W ; matrix counter
84
#if DEFAULT_SAMMICHSID_CS
85
	rcall	CS_MENU_MATRIX_SammichSID_Column_Remap ; remap so that it looks better on a sammichSID
86
	xorwf	TMR3L, W	; timer3 is MIOS_TIMER -- only for sammichSID
87
#endif
88
	xorwf	TMR2, W		; timer2 outputs the 1 MHz clock to the SID
89
	xorwf	CS_MENU_REINIT_CFG_CTR, W ; xor with running startup counter
90
	call	MIOS_HLP_GetBitORMask ; show only one LED per update cycle
91
	movwf	MIOS_PARAMETER1
92
	rgoto	CS_MENU_MATRIX_Handler_StartupCn
93
CS_MENU_MATRIX_Handler_NoStartup
94
 
1 tk 95
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_MATRIX_Handler_SP ; always used in SID player mode
96
	BRA_IFCLR CS_STAT2, CS_STAT2_LEVEL_METERS, ACCESS, CS_MENU_MATRIX_Handler_NoSP	; optionally used in normal mode
97
CS_MENU_MATRIX_Handler_SP
98
	;; show animated level meters, e.g. triggered by gates
99
 
100
	;; meter matrix array used as counter array
101
	lfsr	FSR1, METER_VALUES0
102
	movf	CS_MENU_MATRIX_CTR, W
103
#if DEFAULT_MB6582_CS
104
	sublw	0x07		; invert order of columns (0=right, 7=left)
105
#endif
835 tk 106
#if DEFAULT_SAMMICHSID_CS
107
	rcall	CS_MENU_MATRIX_SammichSID_Column_Remap
108
#endif
1 tk 109
	addwf	FSR1L, F
110
 
111
	movf	INDF1, W
112
	skpz
113
	decf	INDF1, F
828 tk 114
#if 1
115
	;; TK: make VU meters a bit faster
116
	skpz
117
	decf	INDF1, F
118
#endif
1 tk 119
 
120
	;; don't show pattern once counter is zero
121
	movf	INDF1, W	; (ensure that WREG is 0 on branch to SP_Dis)
122
	bz	CS_MENU_MATRIX_Handler_SP_Dis
123
 
124
	;; show pattern depending on counter value
125
	TABLE_ADDR CS_MENU_MATRIX_LEVEL_METER_TABLE
126
	rrf	INDF1, W
127
	rrf	WREG, W
128
	rrf	WREG, W
129
	andlw	0x07
130
	TABLE_ADD_W
131
	tblrd*+
132
	movf	TABLAT, W
133
CS_MENU_MATRIX_Handler_SP_Dis
835 tk 134
#if !DEFAULT_MB6582_CS && !DEFAULT_SAMMICHSID_CS
1 tk 135
	xorlw	0xff
136
#endif
137
	rgoto	CS_MENU_MATRIX_Handler_SP_Cont
138
 
139
CS_MENU_MATRIX_Handler_NoSP
140
	;; this selects the row (O1 Pitch, O2 Pitch, ... Filter)
141
	BRA_IFSET CS_MENU_MODE, CS_MENU_MODE_MATRIX_METER_DISP, ACCESS, CS_MENU_MATRIX_Handler_Meters
142
CS_MENU_MATRIX_Handler_Nodes
143
	lfsr	FSR1, CS_MENU_MATRIX_BEGIN
144
	rgoto	CS_MENU_MATRIX_Handler_Cont
145
CS_MENU_MATRIX_Handler_Meters
146
	lfsr	FSR1, METER_VALUES0
147
 
148
CS_MENU_MATRIX_Handler_Cont
149
 
150
	movf	CS_MENU_MATRIX_CTR, W			; add row number to pointer
151
#if DEFAULT_MB6582_CS
152
	sublw	0x07					; invert order of columns (0=right, 7=left)
153
	movf	PLUSW1, W
835 tk 154
#endif
155
#if DEFAULT_SAMMICHSID_CS
156
	rcall	CS_MENU_MATRIX_SammichSID_Column_Remap
157
	movf	PLUSW1, W
158
#endif
159
#if !DEFAULT_MB6582_CS && !DEFAULT_SAMMICHSID_CS
1 tk 160
	comf	PLUSW1, W
161
#endif
162
CS_MENU_MATRIX_Handler_SP_Cont
163
	movwf	MIOS_PARAMETER1
164
 
165
	;; flash the currently selected row/column
166
	movf	CS_MENU_MATRIX_FLASH_CTR, W; every 8th cycle: invert column
167
	andlw	0x38
168
	bnz	CS_MENU_MATRIX_Handler_NoFlash
169
CS_MENU_MATRIX_Handler_Flash
170
	;; note: row/column need to be swapped when sinkdrivers are used
171
	movf	CS_MENU_MATRIX_SELECTED_COL, W
172
	xorwf	MIOS_PARAMETER1, F
173
 
174
	movf	CS_MENU_MATRIX_CTR, W
175
#if DEFAULT_MB6582_CS
176
	sublw	0x07					; invert order of columns (0=right, 7=left)
177
#endif
835 tk 178
#if DEFAULT_SAMMICHSID_CS
179
	rcall	CS_MENU_MATRIX_SammichSID_Column_Remap
180
#endif
1 tk 181
	call	MIOS_HLP_GetBitORMask
182
	andwf	CS_MENU_MATRIX_SELECTED_ROW, W
183
	skpz
184
	comf	MIOS_PARAMETER1, F
185
CS_MENU_MATRIX_Handler_NoFlash
869 tk 186
CS_MENU_MATRIX_Handler_StartupCn
1 tk 187
 
188
#if DEFAULT_MB6582_CS
189
#if DEFAULT_SRM_MODMATRIX_DOUT
190
	movlw	(DEFAULT_SRM_MODMATRIX_DOUT-1) & 0xf
191
	call	MIOS_DOUT_SRSet
192
#endif
835 tk 193
#endif
194
#if DEFAULT_SAMMICHSID_CS
1 tk 195
#if DEFAULT_SRM_CATHODES
835 tk 196
	movlw	(DEFAULT_SRM_MODMATRIX_DOUT-1) & 0xf
197
	call	MIOS_DOUT_SRSet
198
#endif
199
#endif
200
#if !DEFAULT_MB6582_CS && !DEFAULT_SAMMICHSID_CS
201
#if DEFAULT_SRM_CATHODES
1 tk 202
	movlw	(DEFAULT_SRM_CATHODES-1) & 0xf
203
	call	MIOS_DOUT_SRSet
204
#endif
205
#endif
206
 
207
#if DEFAULT_SRM_LEDS_DOUT
208
	;; optional LED matrix
209
	lfsr	FSR2, LM_ROW0_VALUES
210
	movf	CS_MENU_MATRIX_CTR, W
211
	movff	PLUSW2, MIOS_PARAMETER1
212
	movlw	(DEFAULT_SRM_LEDS_DOUT-1) & 0xf
213
	call	MIOS_DOUT_SRSet
214
#endif
215
 
216
	;; thats all!
217
	return
218
 
219
 
220
 
221
#if DEFAULT_SRM_LEDS_DOUT
222
;; --------------------------------------------------------------------------
223
;;  LED Matrix: set a pin - parameter interface like for MIOS_DOUT_PinSet
224
;;     - WREG contains the LED number (0-63, 64-127 will be mirrored!)
225
;;     - MIOS_PARAMETER1 contains the LED value (0 or 1)
226
;; --------------------------------------------------------------------------
227
CS_MENU_MATRIX_PinSet
228
	;; branch depending on LED value
229
	lfsr	FSR1, LM_ROW0_VALUES
230
	BRA_IFSET MIOS_PARAMETER1, 0, ACCESS, CS_MENU_MATRIX_PinSet1
231
	rgoto	CS_MENU_MATRIX_PinSet0
232
 
233
CS_MENU_MATRIX_PinSet1
234
	movwf	MIOS_PARAMETER1		; temporary store value in MIOS_PARAMETER1
235
	rlf	WREG, F
236
	swapf	WREG, W
237
	andlw	0x07			; 8 SRs maximum, >=8 will be mirrored
238
	addwf	FSR1L, F
239
 
240
	movf	MIOS_PARAMETER1, W
241
	call	MIOS_HLP_GetBitORMask
242
	iorwf	INDF1, F
243
	return
244
 
245
CS_MENU_MATRIX_PinSet0
246
	movwf	MIOS_PARAMETER1		; temporary store value in MIOS_PARAMETER1
247
	rlf	WREG, F
248
	swapf	WREG, W
249
	andlw	0x07			; 8 SRs maximum, >=8 will be mirrored
250
	addwf	FSR1L, F
251
 
252
	movf	MIOS_PARAMETER1, W
253
	call	MIOS_HLP_GetBitANDMask
254
	andwf	INDF1, F
255
	return
256
#endif
257
 
258
#if DEFAULT_SRM_BUTTONS_DIN
259
;; --------------------------------------------------------------------------
260
;;  Button Matrix: this function gets the DIN values of the selected column
261
;;  It should be called from USER_SR_Service_Finish
262
;; --------------------------------------------------------------------------
263
CS_MENU_MATRIX_GetRowIRQ
264
	;; since the row line of the buttons is identical to the row line of the LEDs,
265
	;; we can derive the button row offset from CS_MENU_MATRIX_CTR
266
 
267
	;; store row offset in IRQ_TMP1
268
	decf	CS_MENU_MATRIX_CTR, W
269
	andlw	0x07
270
	movwf	IRQ_TMP1
271
 
272
	;; determine changes and save new value in ROWx_VALUE depending on selected column
273
	movlw	(DEFAULT_SRM_BUTTONS_DIN-1) & 0xf
274
	call	MIOS_DIN_SRGet	; result in MIOS_PARAMETER1
275
 
276
	;; ---[ BEGIN DIRTY CODE ]---
277
	movlw	0x10		; clear the MIOS_SR_DIN_CHANGED_x register to avoid, that USER_DIN_NotifyToggle
278
	addwf	FSR1L, F	; will be called - we have our own toggle handler
279
	clrf	INDF1		; Direct accesses to MIOS registers are normaly not allowed, I do this here since
280
				; I know that the register address offset of the DIN_CHANGED_x register will
281
				; never be changed in future
282
				; REMINDER for later MIOS versions: provide a function to access the DIN_CHANGED_x register
283
	;; ---[ END DIRTY CODE ]---
284
 
285
	;; backup old values in IRQ_TMP2
286
	;; store new values in BM_ROW0_VALUES + IRQ_TMP1
287
	lfsr	FSR1, BM_ROW0_VALUES
288
	movf	IRQ_TMP1, W
289
	movff	PLUSW1, IRQ_TMP2
290
	movff	MIOS_PARAMETER1, PLUSW1
291
 
292
	;; old value in IRQ_TMP2
293
	;; new value in MIOS_PARAMETER1
294
	;; select ROWx_CHANGED register
295
	lfsr	FSR1, BM_ROW0_CHANGED
296
	movf	IRQ_TMP1, W
297
	addwf	FSR1L, F
298
 
299
	;; changes are: IRQ_TMP2 xor MIOS_PARAMETER1
300
	movf	IRQ_TMP2, W
301
	xorwf	MIOS_PARAMETER1, W
302
 
303
	;; OR the result to the already notified changes (if they have not been zeroed by CS_MENU_MATRIX_MHandler)
304
	iorwf	INDF1, F
305
 
306
	return
307
 
308
 
309
;; --------------------------------------------------------------------------
310
;;  Button Matrix: this function should be called from USER_Tick (in the
311
;;  main program) to determine for button changes. Events (change from 0->1 or
312
;;  from 1->0) will be notified to the CS_MENU_BUTTON_Handler function
313
;; --------------------------------------------------------------------------
314
CS_MENU_MATRIX_BHandler
315
	SET_BSR	SRM_COL_CTR
316
	clrf	SRM_COL_CTR, BANKED
317
CS_MENU_MATRIX_BHandler_Loop
318
	;; get address to ROWx[LR]_CHANGED register
319
	lfsr	FSR1, BM_ROW0_CHANGED
320
	movf	SRM_COL_CTR, W, BANKED
321
	addwf	FSR1L, F
322
 
323
	;; skip individual checks if register is zero
324
	movf	INDF1, W
325
	bz	CS_MENU_MATRIX_BHandler_LoopNext
326
 
327
	;; check which bits are set
328
	btfsc	INDF1, 0		; fastest solution...
329
	rcall	CS_MENU_MATRIX_BNotify_Pin0
330
	btfsc	INDF1, 1
331
	rcall	CS_MENU_MATRIX_BNotify_Pin1
332
	btfsc	INDF1, 2
333
	rcall	CS_MENU_MATRIX_BNotify_Pin2
334
	btfsc	INDF1, 3
335
	rcall	CS_MENU_MATRIX_BNotify_Pin3
336
	btfsc	INDF1, 4
337
	rcall	CS_MENU_MATRIX_BNotify_Pin4
338
	btfsc	INDF1, 5
339
	rcall	CS_MENU_MATRIX_BNotify_Pin5
340
	btfsc	INDF1, 6
341
	rcall	CS_MENU_MATRIX_BNotify_Pin6
342
	btfsc	INDF1, 7
343
	rcall	CS_MENU_MATRIX_BNotify_Pin7
344
 
345
CS_MENU_MATRIX_BHandler_LoopNext
346
	;; increment until last column has been reached
347
	incf	SRM_COL_CTR, F, BANKED
348
	movlw	0x08-1		; (8 columns)
349
	cpfsgt	SRM_COL_CTR, BANKED
350
	rgoto CS_MENU_MATRIX_BHandler_Loop
351
	return
352
 
353
	;; ---
354
 
355
CS_MENU_MATRIX_BNotify_Pin0
356
	bcf	INDF1, 0			; clear "changed" flag
357
	movlw	0x00
358
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
359
CS_MENU_MATRIX_BNotify_Pin1
360
	bcf	INDF1, 1			; clear "changed" flag
361
	movlw	0x01
362
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
363
CS_MENU_MATRIX_BNotify_Pin2
364
	bcf	INDF1, 2			; clear "changed" flag
365
	movlw	0x02
366
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
367
CS_MENU_MATRIX_BNotify_Pin3
368
	bcf	INDF1, 3			; clear "changed" flag
369
	movlw	0x03
370
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
371
CS_MENU_MATRIX_BNotify_Pin4
372
	bcf	INDF1, 4			; clear "changed" flag
373
	movlw	0x04
374
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
375
CS_MENU_MATRIX_BNotify_Pin5
376
	bcf	INDF1, 5			; clear "changed" flag
377
	movlw	0x05
378
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
379
CS_MENU_MATRIX_BNotify_Pin6
380
	bcf	INDF1, 6			; clear "changed" flag
381
	movlw	0x06
382
	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
383
CS_MENU_MATRIX_BNotify_Pin7
384
	bcf	INDF1, 7			; clear "changed" flag
385
	movlw	0x07
386
	;; 	rgoto	CS_MENU_MATRIX_BNotify_Pin_Cont
387
CS_MENU_MATRIX_BNotify_Pin_Cont
388
	;; store pin number in MIOS_PARAMETER1
389
	movwf	MIOS_PARAMETER1
390
	swapf	SRM_COL_CTR, W, BANKED
391
	rrf	WREG, W
392
	andlw	0x38
393
	iorlw	0x80		; add 128, so that the button handler "knows" that this is a button of the matrix
394
	iorwf	MIOS_PARAMETER1, F
395
 
396
	;; store pin value in MIOS_PARAMETER2
397
	lfsr	FSR1, BM_ROW0_VALUES
398
	movf	SRM_COL_CTR, W, BANKED
399
	addwf	FSR1L, F
400
	movf	MIOS_PARAMETER1, W
401
	call	MIOS_HLP_GetBitORMask
402
	andwf	INDF1, W
403
	skpz
404
	movlw	0x01
405
	movwf	MIOS_PARAMETER2
406
 
407
	;; call "normal" menu button handler
408
	call	CS_MENU_BUTTON_Handler
409
 
410
	;; fix BSR and FSR1, they propably have been overwritten by the GP_BUTTON handler
411
	lfsr	FSR1, BM_ROW0_CHANGED
412
	SET_BSR	SRM_COL_CTR
413
	movf	SRM_COL_CTR, W, BANKED
414
	addwf	FSR1L, F
415
	return
416
#endif
417
 
418
 
419
;; --------------------------------------------------------------------------
420
;;  This function sets a meter value (directly called from SID sound engine)
421
;;  IN: meter number (0-7) in WREG
422
;;      signed meter value in MIOS_PARAMETER1
423
;; --------------------------------------------------------------------------
424
CS_MENU_MATRIX_MeterSet
425
	;; calc pointer to meter
426
	lfsr	FSR1, METER_VALUES0
427
	addwf	FSR1L, F	; (index in WREG)
428
 
429
	;; all LEDs off if value around 0
430
	movlw	0x80
431
	addwf	MIOS_PARAMETER1, F
432
	movf	MIOS_PARAMETER1, W
433
	andlw	0xf0
434
	xorlw	0x80
435
	bnz	CS_MENU_MATRIX_MeterSet_Not0
436
CS_MENU_MATRIX_MeterSet_0
437
	clrf	INDF1
438
	return
439
 
440
CS_MENU_MATRIX_MeterSet_Not0
441
	swapf	MIOS_PARAMETER1, W
442
#if 0
443
	rrf	WREG, W
444
#else
445
	;; display range 0x4..0xb, saturate if abs. value is greater
446
	BRA_IFCLR WREG, 3, ACCESS, CS_MENU_MATRIX_MeterSet_Neg
447
CS_MENU_MATRIX_MeterSet_Pos
448
	btfsc	WREG, 2
449
	movlw 0x07
450
	iorlw	0x04
451
	rgoto	CS_MENU_MATRIX_MeterSet_Cont
452
CS_MENU_MATRIX_MeterSet_Neg
453
	btfss	WREG, 2
454
	movlw 0x00
455
	andlw	0x03
456
	;; 	rgoto	CS_MENU_MATRIX_MeterSet_Cont
457
CS_MENU_MATRIX_MeterSet_Cont
458
#endif
459
	andlw	0x07
460
	addlw	LOW(CS_MENU_MATRIX_PATTERN_TABLE)
461
	movwf	TBLPTRL
462
	clrf	TBLPTRH
463
	movlw	HIGH(CS_MENU_MATRIX_PATTERN_TABLE)
464
	addwfc	TBLPTRH, F
465
	clrf	TBLPTRU
466
	movlw	UPPER(CS_MENU_MATRIX_PATTERN_TABLE)
467
	addwfc	TBLPTRU, F
468
	tblrd*+
469
	movff	TABLAT, INDF1
470
	return
471
 
806 tk 472
;; --------------------------------------------------------------------------
473
;;  Special variation to display a linear value (used in bassline mode)
474
;;  IN: meter number (0-7) in WREG
475
;;      high-byte of linear frequency (SID_Vx_LINEAR_FRQ_H) in MIOS_PARAMETER1
476
;; --------------------------------------------------------------------------
477
CS_MENU_MATRIX_MeterLinearSet
478
	;; calc pointer to meter
479
	lfsr	FSR1, METER_VALUES0
480
	addwf	FSR1L, F	; (index in WREG)
481
	swapf	MIOS_PARAMETER1, W
482
	rrf	WREG, W
483
	andlw	0x07
484
	addlw	LOW(CS_MENU_MATRIX_LIN_PATTERN_TABLE)
485
	movwf	TBLPTRL
486
	clrf	TBLPTRH
487
	movlw	HIGH(CS_MENU_MATRIX_LIN_PATTERN_TABLE)
488
	addwfc	TBLPTRH, F
489
	clrf	TBLPTRU
490
	movlw	UPPER(CS_MENU_MATRIX_LIN_PATTERN_TABLE)
491
	addwfc	TBLPTRU, F
492
	tblrd*+
493
	movff	TABLAT, INDF1
494
	return
495
 
496
 
1 tk 497
CS_MENU_MATRIX_PATTERN_TABLE	; (used to display meter values)
498
	db	b'01111000', b'00111000'
499
	db	b'00011000', b'00001000'
500
	db	b'00001000', b'00001100'
501
	db	b'00001110', b'00001111'
502
 
806 tk 503
CS_MENU_MATRIX_LIN_PATTERN_TABLE ; (used to display meter values)
504
	db	b'10000000', b'01000000'
505
	db	b'00100000', b'00010000'
506
	db	b'00001000', b'00000100'
507
	db	b'00000010', b'00000001'
508
 
1 tk 509
CS_MENU_MATRIX_LEVEL_METER_TABLE ; (used in meter level mode)
510
	db	b'10000000', b'11000000'
511
	db	b'11100000', b'11110000'
512
	db	b'11111000', b'11111100'
513
	db	b'11111110', b'11111111'
514
 
835 tk 515
;; --------------------------------------------------------------------------
516
;;  Remap sammichSID 6x8 LED matrix "row" to normal 8x8 LED matrix "column"
517
;;  IN: LED "column", though actually horizontal row of LEDs (0-7) in WREG
518
;;  OUT: column reference to use, i.e. into METER_VALUES array (0-7) in WREG
519
;;
520
;;  sammichSID "column" addressing (i.e. common cathodes connected to DOUT pins)
521
;;
522
;;  1 ooooooo oooooooo 0
523
;;  3 ooooooo oooooooo 2
524
;;  5 ooooooo oooooooo 4
525
;;
526
;; --------------------------------------------------------------------------
527
CS_MENU_MATRIX_SammichSID_Column_Remap
860 wilba 528
	andlw	0x07	; 0x07 masks 8 entries
835 tk 529
	JUMPTABLE_2BYTES_UNSECURE
530
	retlw	0x04	; 0 -> col 4 (L3)
531
	retlw	0x01	; 1 -> col 1 (E2)
532
	retlw	0x05	; 2 -> col 5 (L4)
533
	retlw	0x02	; 3 -> col 2 (L1)
534
	retlw	0x06	; 4 -> col 6 (L4)
535
	retlw	0x03	; 5 -> col 3 (L2)
536
	retlw	0x00	; 6 -> col 0 (E1) **unused**
537
	retlw	0x07	; 7 -> col 7 (L6) **unused**
538