Don’t know where (and how) to put that in the WIKI.
Put here are the differences :
First the internal variables for the new states and leds…
ap_defines.h
;; free: 0x69-0x6e
CS_MENU_SELECTED_ROW EQU 0x069
TMP6 EQU 0x06a
CS_MENU_SELECTED_MATRIXROW EQU 0x06b ;; finally not used
TMP7 EQU 0x06c
then to light the right leds : cs_menu_leds.inc (no need to keep the TMP1-5[*] little functions)…
;; clear temporary registers which hold some LED flags which are not saved anywhere else
;; (see also CS_MENU_DOUT_TABLE)
;; this quick & dirty method saves some memory...
;; TMP6[0..7]
movf CS_MENU_SELECTED_ROW, W
call MIOS_HLP_GetBitORMask
movwf TMP6
;; TMP7[0..7]
lfsr FSR1, CS_MENU_MATRIX_BEGIN ; pointer for LEDs: FSR1
movf CS_MENU_SELECTED_MOD, W
movf PLUSW1, W
movwf TMP7
then a quick hack to have a dec button function in cs_menu.inc (mostly a copy of ButtonInc)…
CS_MENU_ButtonDec
;; save WREG
movwf TMP5
;; save menu settings so that we can jump back to the current menu later
movff CS_MENU, SAVED_CS_MENU
movff CS_MENU_CURSOR_POS, SAVED_CS_MENU_CURSOR_POS
movff CS_MENU_PAGE_OFFSET, SAVED_CS_MENU_PAGE_OFFSET
;; change to menu
movwf CS_MENU
rcall CS_MENU_Page_Init
;; set new page offset and cursor pos
movff MIOS_PARAMETER1, CS_MENU_CURSOR_POS
movff MIOS_PARAMETER2, CS_MENU_PAGE_OFFSET
;; select parameter
call CS_MENU_EXEC_SelPar
;; decrement the parameter value, if max value reached, reset value
movlw 0x00
IFNEQ CS_MENU_PARAMETER_L, ACCESS, goto CS_MENU_ButtonDec1
movff CS_MENU_PARAMETER_MAX_L, CS_MENU_PARAMETER_L
incf CS_MENU_PARAMETER_L
CS_MENU_ButtonDec1
decf CS_MENU_PARAMETER_L
rcall CS_MENU_ParameterUpdate ; update parameter
call CS_MENU_EXEC_Hlp_ChangeMenu ; deselect parameter
;; change back to old parameter if we were already in the menu before
movf SAVED_CS_MENU, W
xorwf TMP5, W
bnz CS_MENU_ButtonIncDec_End
movff SAVED_CS_MENU, CS_MENU
rcall CS_MENU_Page_Init
movff SAVED_CS_MENU_PAGE_OFFSET, CS_MENU_PAGE_OFFSET
movff SAVED_CS_MENU_CURSOR_POS, CS_MENU_CURSOR_POS
goto CS_MENU_ButtonIncDec_End
in cs_menu_enc.inc i replaced the old CS_MENU_ENC_CS_Handler, CS_MENU_ENC_CS_Osc, CS_MENU_ENC_CS_LFO, CS_MENU_ENC_CS_Filter and CS_MENU_ENC_CS_Env by: (I’m proud of this one… ;D)
CS_MENU_ENC_CS_Handler
;; move incrementer to MIOS_PARAMETER3
movff MIOS_PARAMETER2, MIOS_PARAMETER3
movf CS_MENU_SELECTED_ROW, W
mullw 5
movf PRODL, W
addwf MIOS_PARAMETER1, W
Then, you must have 5 lines for each part in cs_menu_enc_table.in. (3 lines to add for filter and LFO and a new set of 5 lines for User…) You also have to switch the order to fit the Control surface rows : OSC, ENV, Filter, LFO, User in my case. cs_menu_io_tables.inc… (don’t look at the SR/pin number… :-[)
DIN_ENTRY CS_MENU_BUTTON_Exec, 4, 6
DIN_ENTRY CS_MENU_BUTTON_Sel5, 3, 3
DIN_ENTRY CS_MENU_BUTTON_Sel4, 3, 0
DIN_ENTRY CS_MENU_BUTTON_Sel3, 3, 1
DIN_ENTRY CS_MENU_BUTTON_Sel2, 3, 2
DIN_ENTRY CS_MENU_BUTTON_Sel1, 3, 6
DIN_ENTRY CS_MENU_BUTTON_General1, 1, 5
DIN_ENTRY CS_MENU_BUTTON_General2, 1, 4
DIN_ENTRY CS_MENU_BUTTON_General3, 3, 7
DIN_ENTRY CS_MENU_BUTTON_Link, 0, 0
DIN_ENTRY CS_MENU_BUTTON_CC, 1, 2
DIN_ENTRY CS_MENU_BUTTON_Edit, 1, 3
DIN_ENTRY CS_MENU_BUTTON_Row_Dec, 1, 7
DIN_ENTRY CS_MENU_BUTTON_Row_Inc, 1, 6
DIN_ENTRY CS_MENU_BUTTON_MatrixRow_Dec, 1, 1
DIN_ENTRY CS_MENU_BUTTON_MatrixRow_Inc, 1, 0
DIN_ENTRY CS_MENU_BUTTON_M_E1, 2, 0
DIN_ENTRY CS_MENU_BUTTON_M_E2, 2, 1
DIN_ENTRY CS_MENU_BUTTON_M_L1, 2, 2
DIN_ENTRY CS_MENU_BUTTON_M_L2, 2, 3
DIN_ENTRY CS_MENU_BUTTON_M_L3, 2, 7
DIN_ENTRY CS_MENU_BUTTON_M_L4, 2, 6
DIN_ENTRY CS_MENU_BUTTON_M_L5, 2, 5
DIN_ENTRY CS_MENU_BUTTON_M_L6, 2, 4
and
CS_MENU_DOUT_TABLE
;; Register and bit SR# Pin# Description
DOUT_ENTRY CS_MENU_MODE, CS_MENU_MODE_CC, 0, 1 ; CC LED
DOUT_ENTRY CS_MENU_MODE, CS_MENU_MODE_EDIT_FLASHED,0, 2 ; Edit LED
;; TMP6 : main control matrix row
DOUT_ENTRY TMP6, 0, 2, 0
DOUT_ENTRY TMP6, 1, 2, 1
DOUT_ENTRY TMP6, 2, 2, 2
DOUT_ENTRY TMP6, 3, 2, 3
DOUT_ENTRY TMP6, 4, 2, 4
DOUT_ENTRY TMP6, 5, 2, 5
DOUT_ENTRY TMP6, 6, 2, 6
DOUT_ENTRY TMP6, 7, 2, 7
;; TMP7 : modulation leds of selected row
DOUT_ENTRY TMP7, 0, 1, 0
DOUT_ENTRY TMP7, 1, 1, 1
DOUT_ENTRY TMP7, 2, 1, 2
DOUT_ENTRY TMP7, 3, 1, 3
DOUT_ENTRY TMP7, 4, 1, 4
DOUT_ENTRY TMP7, 5, 1, 5
DOUT_ENTRY TMP7, 6, 1, 6
DOUT_ENTRY TMP7, 7, 1, 7
;;
I have many modifications in cs_menu_buttons.inc… (All useless buttons removed) The interesting part are :
CS_MENU_BUTTON_Row_Inc
;; do nothing if button has been depressed
IFSET MIOS_PARAMETER2, 0, return
movlw 0x06
IFLEQ CS_MENU_SELECTED_ROW, ACCESS, goto CS_MENU_BUTTON_Row_Inc_DoIt
clrf CS_MENU_SELECTED_ROW
goto CS_MENU_BUTTON_Row_ChangeMenu
CS_MENU_BUTTON_Row_Inc_DoIt
incf CS_MENU_SELECTED_ROW, F
goto CS_MENU_BUTTON_Row_ChangeMenu
CS_MENU_BUTTON_Row_Dec
;; do nothing if button has been depressed
IFSET MIOS_PARAMETER2, 0, return
movlw 0x01
IFGEQ CS_MENU_SELECTED_ROW, ACCESS, goto CS_MENU_BUTTON_Row_Dec_DoIt
movlw 0x07
movwf CS_MENU_SELECTED_ROW
goto CS_MENU_BUTTON_Row_ChangeMenu
CS_MENU_BUTTON_Row_Dec_DoIt
decf CS_MENU_SELECTED_ROW, F
goto CS_MENU_BUTTON_Row_ChangeMenu
CS_MENU_BUTTON_Row_ChangeMenu
;; update TMP6 for easy menu switching
movf CS_MENU_SELECTED_ROW, W
call MIOS_HLP_GetBitORMask
movwf TMP6
;; menu display
movlw 0x00 ; cursor pos
movwf MIOS_PARAMETER1
movlw 0x00 ; page offset
movwf MIOS_PARAMETER2
movlw CS_MENU_FIL ; menu structure
IFSET TMP6, 0, movlw CS_MENU_OSC
IFSET TMP6, 1, movlw CS_MENU_OSC
IFSET TMP6, 2, movlw CS_MENU_OSC
IFSET TMP6, 3, movlw CS_MENU_ENV
IFSET TMP6, 4, movlw CS_MENU_ENV
IFSET TMP6, 5, movlw CS_MENU_FIL
IFSET TMP6, 6, movlw CS_MENU_LFO
IFSET TMP6, 7, goto CS_MENU_BUTTON_DisplayUpdateReq
goto CS_MENU_BUTTON_Hlp_MenuChangeOk
CS_MENU_BUTTON_MatrixRow_Inc
;; do nothing if button has been depressed
IFSET MIOS_PARAMETER2, 0, return
;; just show menu if not already on the LCD
movlw CS_MENU_MOD
IFNEQ CS_MENU, ACCESS, rgoto CS_MENU_BUTTON_Hlp_MenuChangeOk
movlw 0x00 ; cursor pos
movwf MIOS_PARAMETER1
movlw 0x00 ; page offset
movwf MIOS_PARAMETER2
movlw CS_MENU_MOD ; menu structure
goto CS_MENU_ButtonInc
CS_MENU_BUTTON_MatrixRow_Dec
;; do nothing if button has been depressed
IFSET MIOS_PARAMETER2, 0, return
;; just show menu if not already on the LCD
movlw CS_MENU_MOD
IFNEQ CS_MENU, ACCESS, rgoto CS_MENU_BUTTON_Hlp_MenuChangeOk
movlw 0x00 ; cursor pos
movwf MIOS_PARAMETER1
movlw 0x00 ; page offset
movwf MIOS_PARAMETER2
movlw CS_MENU_MOD ; menu structure
goto CS_MENU_ButtonDec
;; ------------------------------------------------------------------
CS_MENU_BUTTON_General1
IFSET MIOS_PARAMETER2, 0, return
IFSET TMP6, 0, rgoto CS_MENU_BUTTON_Osc_Sel
;; IFSET TMP6, 1, rgoto
;; IFSET TMP6, 2, rgoto
IFSET TMP6, 3, rgoto CS_MENU_BUTTON_Env_Sel
;; IFSET TMP6, 4, rgoto
IFSET TMP6, 5, rgoto CS_MENU_BUTTON_Fil_Sel
IFSET TMP6, 6, rgoto CS_MENU_BUTTON_LFO_Sel
;; IFSET TMP6, 7, rgoto
return
CS_MENU_BUTTON_General2
IFSET MIOS_PARAMETER2, 0, return
IFSET TMP6, 0, rgoto CS_MENU_BUTTON_Osc_Wav
;; IFSET TMP6, 1, rgoto
;; IFSET TMP6, 2, rgoto
IFSET TMP6, 3, rgoto CS_MENU_BUTTON_Env_Curve
;; IFSET TMP6, 4, rgoto
IFSET TMP6, 5, rgoto CS_MENU_BUTTON_Fil_Mod
IFSET TMP6, 6, rgoto CS_MENU_BUTTON_LFO_Wav
;; IFSET TMP6, 7, rgoto
return
CS_MENU_BUTTON_General3
IFSET MIOS_PARAMETER2, 0, return
IFSET TMP6, 0, rgoto CS_MENU_BUTTON_Osc_RS
;; IFSET TMP6, 1, rgoto
;; IFSET TMP6, 2, rgoto
;; IFSET TMP6, 3, rgoto
;; IFSET TMP6, 4, rgoto
;; IFSET TMP6, 5, rgoto
;; IFSET TMP6, 6, rgoto
;; IFSET TMP6, 7, rgoto
return
I also replaced in this file the 2 last lines of CS_MENU_BUTTON_Chg_Ex_Cont and CS_MENU_BUTTON_Chg_Lx_Cont by “return” because i didn’t want the modulation toggle button to change the menu…
in mios_tables just put the 5 encoders and their SR/pins…
I think that’s it.
Hope this made a readable message…
At least i will be able to read it again in the futur if i didn’t remember the mods i made… 
Regards,
Xavier
UPDATE : current control surface design.