Subversion Repositories svn.mios

Rev

Rev 806 | Rev 880 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 806 Rev 869
Line 1... Line 1...
1
; $Id: cs_menu_buttons.inc 806 2009-08-29 21:19:54Z tk $
1
; $Id: cs_menu_buttons.inc 869 2009-12-08 21:52:43Z tk $
2
;
2
;
3
; SID Control Surface Button Handler
3
; SID Control Surface Button Handler
4
;
4
;
5
; ==========================================================================
5
; ==========================================================================
6
;
6
;
Line 512... Line 512...
512
	;; do nothing if button has been depressed
512
	;; do nothing if button has been depressed
513
	btfsc	MIOS_PARAMETER2, 0
513
	btfsc	MIOS_PARAMETER2, 0
514
	return
514
	return
515
	;; exit with message if SID player mode enabled and SID1 selected
515
	;; exit with message if SID player mode enabled and SID1 selected
516
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
516
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
517

-
 
518
	;; only change to OSC page if not already selected
-
 
519
	call	CS_MENU_GetMenuID_OSC
-
 
520
	xorwf	CS_MENU, W
-
 
521
	bnz	CS_MENU_BUTTON_Osc_Sel_End
-
 
522
-
 
523
	;; otherwise increment oscillator
517

524
518
	;; branch depending on engine
525
	;; branch depending on engine
519
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
526
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
520
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_BUTTON_Osc_Sel_DM
527
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_BUTTON_Osc_Sel_DM
521
CS_MENU_BUTTON_Osc_Sel_LB
528
CS_MENU_BUTTON_Osc_Sel_LB
Line 530... Line 537...
530
	movf	TABLAT, W
537
	movf	TABLAT, W
531
	movwf	CS_MENU_SELECTED_OSC
538
	movwf	CS_MENU_SELECTED_OSC
532
539
533
	;; update OSC flags
540
	;; update OSC flags
534
	call	CS_MENU_Hlp_UpdateOSCFlags
541
	call	CS_MENU_Hlp_UpdateOSCFlags
535

-
 
536
	;; change to OSC page
-
 
537
	call	CS_MENU_GetMenuID_OSC
-
 
538
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
542
	rgoto	CS_MENU_BUTTON_Osc_Sel_End
539
543
540
544
541
	;; maps current OSC selection flags to next CS_MENU_SELECTED_OSC (and not flags!)
545
	;; maps current OSC selection flags to next CS_MENU_SELECTED_OSC (and not flags!)
542
CS_MENU_BUTTON_Osc_Sel_Next_Tab
546
CS_MENU_BUTTON_Osc_Sel_Next_Tab
543
	;; from 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07   ; FLAGS
547
	;; from 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07   ; FLAGS
Line 551... Line 555...
551
	addlw	1
555
	addlw	1
552
	movwf	CS_MENU_SELECTED_SID_LR
556
	movwf	CS_MENU_SELECTED_SID_LR
553
557
554
	movlw	0x01
558
	movlw	0x01
555
	movwf	CS_MENU_SELECTED_OSC_FLAGS
559
	movwf	CS_MENU_SELECTED_OSC_FLAGS
-
 
560
	rgoto	CS_MENU_BUTTON_Osc_Sel_End
556
561
557
	;; branch depending on selected OSC Control Layer
-
 
558
	movf	CS_MENU_SELECTED_OSC_CTRL, W
-
 
559
	bz	CS_MENU_BUTTON_Osc_Sel_B_0
-
 
560
	addlw	-1
-
 
561
	bz	CS_MENU_BUTTON_Osc_Sel_B_1
-
 
562
	rgoto	CS_MENU_BUTTON_Osc_Sel_B_2
-
 
563
-
 
564
CS_MENU_BUTTON_Osc_Sel_B_0
-
 
565
CS_MENU_BUTTON_Osc_Sel_B_1
-
 
566
	;; change to OSC page
-
 
567
	call	CS_MENU_GetMenuID_OSC
-
 
568
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
-
 
569
-
 
570
CS_MENU_BUTTON_Osc_Sel_B_2
-
 
571
	;; change to Knobs page
-
 
572
	call	CS_MENU_GetMenuID_KNB
-
 
573
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
-
 
574
562
575
CS_MENU_BUTTON_Osc_Sel_DM
563
CS_MENU_BUTTON_Osc_Sel_DM
576
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_BUTTON_Osc_Sel_M
564
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_BUTTON_Osc_Sel_M
577
565
578
CS_MENU_BUTTON_Osc_Sel_D
566
CS_MENU_BUTTON_Osc_Sel_D
579
	;; always select OSC1 (flag not really used by CS, we are working with instruments)
567
	;; always select OSC1 (flag not really used by CS, we are working with instruments)
580
	movlw	0x01
568
	movlw	0x01
581
	movwf	CS_MENU_SELECTED_OSC_FLAGS
569
	movwf	CS_MENU_SELECTED_OSC_FLAGS
582
	;; change to OSC page
-
 
583
	call	CS_MENU_GetMenuID_OSC
-
 
584
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
570
	rgoto	CS_MENU_BUTTON_Osc_Sel_End
585
571
586
CS_MENU_BUTTON_Osc_Sel_M
572
CS_MENU_BUTTON_Osc_Sel_M
587
	;; always select OSC1 (flag not really used by CS, we are working with instruments)
573
	;; always select OSC1 (flag not really used by CS, we are working with instruments)
588
	movlw	0x01
574
	movlw	0x01
589
	movwf	CS_MENU_SELECTED_OSC_FLAGS
575
	movwf	CS_MENU_SELECTED_OSC_FLAGS
-
 
576
	rgoto	CS_MENU_BUTTON_Osc_Sel_End
-
 
577
-
 
578
-
 
579
CS_MENU_BUTTON_Osc_Sel_End
590
	;; change to OSC page
580
	;; change to OSC page
591
	call	CS_MENU_GetMenuID_OSC
581
	call	CS_MENU_GetMenuID_OSC
592
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
582
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
593
583
594
584
Line 687... Line 677...
687
	;; ------------------------------------------------------------------
677
	;; ------------------------------------------------------------------
688
CS_MENU_BUTTON_LFO_Sel
678
CS_MENU_BUTTON_LFO_Sel
689
	;; do nothing if button has been depressed
679
	;; do nothing if button has been depressed
690
	btfsc	MIOS_PARAMETER2, 0
680
	btfsc	MIOS_PARAMETER2, 0
691
	return
681
	return
-
 
682
	;; exit with message if SID player mode enabled and SID1 selected
-
 
683
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
684

-
 
685
	;; only change to LFO page if not already selected
-
 
686
	call	CS_MENU_GetMenuID_LFO
-
 
687
	xorwf	CS_MENU, W
-
 
688
	bz	CS_MENU_BUTTON_LFO_Sel_Inc
-
 
689
	call	CS_MENU_GetMenuID_LFO
-
 
690
	goto	CS_MENU_EXEC_Hlp_ChangeMenu
-
 
691
	
-
 
692

692
	;; else increment LFO setting
693
	;; otherwise increment LFO
-
 
694
CS_MENU_BUTTON_LFO_Sel_Inc
693
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
695
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
694
	andlw	0x03
696
	andlw	0x03
695
	movlw	0x00		; cursor pos Lead is 0
697
	movlw	0x00		; cursor pos Lead is 0
696
	skpz
698
	skpz
697
	movlw	0x01		; cursor pos Bassline/Drum/Multi is 1
699
	movlw	0x01		; cursor pos Bassline/Drum/Multi is 1
Line 725... Line 727...
725
	;; do nothing if button has been depressed
727
	;; do nothing if button has been depressed
726
	btfsc	MIOS_PARAMETER2, 0
728
	btfsc	MIOS_PARAMETER2, 0
727
	return
729
	return
728
	;; exit with message if SID player mode enabled and SID1 selected
730
	;; exit with message if SID player mode enabled and SID1 selected
729
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
731
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
732

-
 
733
	;; only change to ENV page if not already selected
-
 
734
	call	CS_MENU_GetMenuID_ENV
-
 
735
	xorwf	CS_MENU, W
-
 
736
	bnz	CS_MENU_BUTTON_Env_Sel_End
-
 
737
-
 
738
	;; otherwise increment envelope
730

739
731
	;; branch depending on engine
740
	;; branch depending on engine
732
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
741
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
733
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_BUTTON_Env_Sel_DM
742
	BRA_IFSET WREG, 1, ACCESS, CS_MENU_BUTTON_Env_Sel_DM
734
CS_MENU_BUTTON_Env_Sel_LB
743
CS_MENU_BUTTON_Env_Sel_LB
Line 748... Line 757...
748
	incf	CS_MENU_SELECTED_SID_LR, W
757
	incf	CS_MENU_SELECTED_SID_LR, W
749
	andlw	0x03
758
	andlw	0x03
750
	skpnz
759
	skpnz
751
	addlw	1
760
	addlw	1
752
	movwf	CS_MENU_SELECTED_SID_LR
761
	movwf	CS_MENU_SELECTED_SID_LR
753
-
 
754
	;; change to ENV page
-
 
755
	call	CS_MENU_GetMenuID_ENV
-
 
756
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
762
 	rgoto	CS_MENU_BUTTON_Env_Sel_End
757
763
758
CS_MENU_BUTTON_Env_Sel_DM
764
CS_MENU_BUTTON_Env_Sel_DM
759
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_BUTTON_Env_Sel_M
765
	BRA_IFSET WREG, 0, ACCESS, CS_MENU_BUTTON_Env_Sel_M
760
766
761
CS_MENU_BUTTON_Env_Sel_D
767
CS_MENU_BUTTON_Env_Sel_D
762
	;; only change to ENV page (one ENV only)
-
 
763
	call	CS_MENU_GetMenuID_ENV
-
 
764
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
768
	;; 	rgoto	CS_MENU_BUTTON_Env_Sel_End
765
769
766
CS_MENU_BUTTON_Env_Sel_M
770
CS_MENU_BUTTON_Env_Sel_M
767
	;; only change to ENV page (one ENV only)
771
	;; 	rgoto	CS_MENU_BUTTON_Env_Sel_End
-
 
772
-
 
773
CS_MENU_BUTTON_Env_Sel_End
768
	call	CS_MENU_GetMenuID_ENV
774
	call	CS_MENU_GetMenuID_ENV
769
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
775
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
770
776
771
777
772
	;; ------------------------------------------------------------------
778
	;; ------------------------------------------------------------------
Line 836... Line 842...
836
	;; do nothing if button has been depressed
842
	;; do nothing if button has been depressed
837
	btfsc	MIOS_PARAMETER2, 0
843
	btfsc	MIOS_PARAMETER2, 0
838
	return
844
	return
839
	;; exit with message if SID player mode enabled and SID1 selected
845
	;; exit with message if SID player mode enabled and SID1 selected
840
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
846
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
847

-
 
848
	;; only change to FIL page if not already selected
-
 
849
	call	CS_MENU_GetMenuID_FIL
-
 
850
	xorwf	CS_MENU, W
-
 
851
	bz	CS_MENU_BUTTON_FIL_Sel_Inc
-
 
852
	call	CS_MENU_GetMenuID_FIL
-
 
853
	goto	CS_MENU_EXEC_Hlp_ChangeMenu
-
 
854
841
	;; else increment Filter setting
855
	;; else increment Filter setting
-
 
856
CS_MENU_BUTTON_FIL_Sel_Inc
842
	movlw	0x00		; cursor pos
857
	movlw	0x01		; cursor pos
843
	movwf	MIOS_PARAMETER1
858
	movwf	MIOS_PARAMETER1
844
	movlw	0x00		; page offset
859
	movlw	0x00		; page offset
845
	movwf	MIOS_PARAMETER2
860
	movwf	MIOS_PARAMETER2
846
	call	CS_MENU_GetMenuID_FIL	; menu page
861
	call	CS_MENU_GetMenuID_FIL	; menu page
847
	goto	CS_MENU_ButtonInc
862
	goto	CS_MENU_ButtonInc
Line 851... Line 866...
851
	;; do nothing if button has been depressed
866
	;; do nothing if button has been depressed
852
	btfsc	MIOS_PARAMETER2, 0
867
	btfsc	MIOS_PARAMETER2, 0
853
	return
868
	return
854
	;; exit with message if SID player mode enabled and SID1 selected
869
	;; exit with message if SID player mode enabled and SID1 selected
855
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
870
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
871

-
 
872
	;; only change to FIL page if not already selected
-
 
873
	call	CS_MENU_GetMenuID_FIL
-
 
874
	xorwf	CS_MENU, W
-
 
875
	bz	CS_MENU_BUTTON_FIL_Mod_Inc
-
 
876
	call	CS_MENU_GetMenuID_FIL
-
 
877
	goto	CS_MENU_EXEC_Hlp_ChangeMenu
-
 
878
-
 
879
CS_MENU_BUTTON_FIL_Mod_Inc
856
	;; else increment Filter setting
880
	;; else increment Filter setting
857
	movlw	0x03		; cursor pos
881
	movlw	0x04		; cursor pos
858
	movwf	MIOS_PARAMETER1
882
	movwf	MIOS_PARAMETER1
859
	movlw	0x00		; page offset
883
	movlw	0x00		; page offset
860
	movwf	MIOS_PARAMETER2
884
	movwf	MIOS_PARAMETER2
861
	call	CS_MENU_GetMenuID_FIL	; menu page
885
	call	CS_MENU_GetMenuID_FIL	; menu page
862
	goto	CS_MENU_ButtonInc
886
	goto	CS_MENU_ButtonInc
Line 866... Line 890...
866
	;; do nothing if button has been depressed
890
	;; do nothing if button has been depressed
867
	btfsc	MIOS_PARAMETER2, 0
891
	btfsc	MIOS_PARAMETER2, 0
868
	return
892
	return
869
	;; exit with message if SID player mode enabled and SID1 selected
893
	;; exit with message if SID player mode enabled and SID1 selected
870
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
894
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
895

871
	;; else increment Filter setting
896
	;; else increment Filter setting
872
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
897
	movff	SID_EDIT_BUFFER + SID_Ix_ENGINE, WREG
873
	andlw	0x02		; different cursor pos in drum and multi mode (bit #1 of engine mode set)
898
	andlw	0x02		; different cursor pos in drum and multi mode (bit #1 of engine mode set)
874
	xorlw	0x02
899
	xorlw	0x02
875

900

876
	movlw	0x04		; cursor pos drum and multi
901
	movlw	0x05		; cursor pos drum and multi
877
	skpz
902
	skpz
878
	movlw	0x05		; cursor pos lead/bassline mode
903
	movlw	0x06		; cursor pos lead/bassline mode
879
	movwf	MIOS_PARAMETER1
904
	movwf	MIOS_PARAMETER1
880

905

881
	movlw	0x00		; page offset drum and multi
906
	movlw	0x01		; page offset drum and multi
882
	skpz
907
	skpz
883
	movlw	0x01		; page offset lead/bassline mode
908
	movlw	0x02		; page offset lead/bassline mode
884
	movwf	MIOS_PARAMETER2
909
	movwf	MIOS_PARAMETER2
885
	call	CS_MENU_GetMenuID_FIL	; menu page
910
	call	CS_MENU_GetMenuID_FIL	; menu page
886
	goto	CS_MENU_ButtonInc
911
	goto	CS_MENU_ButtonInc
887

912

888
913
Line 969... Line 994...
969
	bsf	INDF0, SID_I_V_ARP_MODE_ENABLE
994
	bsf	INDF0, SID_I_V_ARP_MODE_ENABLE
970
995
971
	;; send parameter
996
	;; send parameter
972
	goto	CS_MENU_MS_SendParameter
997
	goto	CS_MENU_MS_SendParameter
973

998

-
 
999
-
 
1000
	;; ------------------------------------------------------------------
-
 
1001
CS_MENU_BUTTON_Knob
-
 
1002
	;; do nothing if button has been depressed
-
 
1003
	btfsc	MIOS_PARAMETER2, 0
-
 
1004
	return
-
 
1005
	;; exit with message if SID player mode enabled and SID1 selected
-
 
1006
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
-
 
1007
	;; change to Knobs page
-
 
1008
	call	CS_MENU_GetMenuID_KNB
-
 
1009
	rgoto	CS_MENU_BUTTON_Hlp_MenuChange
974
1010
975
	;; ------------------------------------------------------------------
1011
	;; ------------------------------------------------------------------
976
CS_MENU_BUTTON_PageUp
1012
CS_MENU_BUTTON_PageUp
977
	;; exit with message if SID player mode enabled and SID1 selected
1013
	;; exit with message if SID player mode enabled and SID1 selected
978
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg
1014
	BRA_IFSET SID_STAT, SID_STAT_SIDPLAYER_CS_DISABLE, ACCESS, CS_MENU_BUTTON_SP_IgnoreMsg