layering_the_ui
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | layering_the_ui [2008/04/14 14:27] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This is a raw version of the HowTo - don't let that scare you though :D | ||
+ | =============================================================================== | ||
+ | FILE: app_defines.h | ||
+ | =============================================================================== | ||
+ | |||
+ | * find a free spot in the ram like | ||
+ | |||
+ | ;; free: 0x6d..0x79 | ||
+ | |||
+ | * add the variable to store the layer | ||
+ | |||
+ | CS_MENU_LAYER EQU 0x06d ; | ||
+ | |||
+ | * and possibly change the comment to match the new situation | ||
+ | |||
+ | ;; free: 0x6e..0x79 | ||
+ | |||
+ | =============================================================================== | ||
+ | FILE: setup_*.asm: | ||
+ | =============================================================================== | ||
+ | * in the CS_MENU_DIN_TABLE add the new buttons (SR + Pin might not match) | ||
+ | |||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer1, | ||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer2, | ||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer3, | ||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer4, | ||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer5, | ||
+ | DIN_ENTRY CS_MENU_BUTTON_Layer6, | ||
+ | |||
+ | * in the CS_MENU_DOUT_TABLE add the layer LEDs (SR + Pin might not match) | ||
+ | |||
+ | DOUT_ENTRY TMP3, | ||
+ | DOUT_ENTRY TMP3, | ||
+ | DOUT_ENTRY TMP3, | ||
+ | DOUT_ENTRY TMP3, | ||
+ | DOUT_ENTRY TMP3, | ||
+ | DOUT_ENTRY TMP3, | ||
+ | |||
+ | =============================================================================== | ||
+ | FILE: cs_menu_buttons.inc: | ||
+ | =============================================================================== | ||
+ | * after | ||
+ | |||
+ | ;; -------------------------------------------------------------------------- | ||
+ | ;; the button functions are defined here | ||
+ | ;; -------------------------------------------------------------------------- | ||
+ | |||
+ | * add the button handlers for the layer buttons | ||
+ | |||
+ | CS_MENU_BUTTON_Layer1 | ||
+ | CS_MENU_BUTTON_Layer2 | ||
+ | CS_MENU_BUTTON_Layer3 | ||
+ | CS_MENU_BUTTON_Layer4 | ||
+ | CS_MENU_BUTTON_Layer5 | ||
+ | CS_MENU_BUTTON_Layer6 | ||
+ | |||
+ | * now it should compile and run, but not do anything ;-) | ||
+ | * each of those " | ||
+ | |||
+ | * For example, the " | ||
+ | |||
+ | CS_MENU_BUTTON_Layer2 ;; OSC 1 Layer | ||
+ | ;; do nothing if button has been depressed | ||
+ | btfsc MIOS_PARAMETER2, | ||
+ | return ;; | ||
+ | ;; open the menu | ||
+ | call CS_MENU_GetMenuID_OSC ;; | ||
+ | call CS_MENU_BUTTON_Hlp_MenuChangeOk ;; | ||
+ | ;; store the active layer | ||
+ | movlw 0x02 ;; | ||
+ | movwf CS_MENU_LAYER ;; | ||
+ | return ;; | ||
+ | |||
+ | * if you only use the predefined menus, this is all there is to do for each layer. | ||
+ | * I added a special menu for Filter and LFO, this requires some more work: | ||
+ | |||
+ | =============================================================================== | ||
+ | FILE: cs_menu_tables.inc: | ||
+ | =============================================================================== | ||
+ | * in CS_MENU_TABLES_IDS add another row like this: | ||
+ | |||
+ | db CS_MENU_L_FL, | ||
+ | |||
+ | * CS_MENU_L_FL is the new [F]ilter+[L]fo menu | ||
+ | * in CS_MENU_TABLES_L add a new row like this: | ||
+ | |||
+ | CS_MENU_T_ENTRY CS_MENU_TABLE_L_FL, | ||
+ | |||
+ | * right after that table there' | ||
+ | |||
+ | CS_MENU_L_FL EQU 0x0f | ||
+ | |||
+ | * now we want to add the menu to the menu structure. To do so you need to find CS_MENU_TABLE_L_ROOT, | ||
+ | * I wanted to have the new menu between the LFO and Envelope menus, so I put it between those two: | ||
+ | |||
+ | CS_MENU_ENTRY CS_MENU_L_LFO, | ||
+ | CS_MENU_ENTRY CS_MENU_L_ENV, | ||
+ | |||
+ | * resulting in this: | ||
+ | |||
+ | CS_MENU_ENTRY CS_MENU_L_LFO, | ||
+ | CS_MENU_ENTRY CS_MENU_L_FL, | ||
+ | CS_MENU_ENTRY CS_MENU_L_ENV, | ||
+ | |||
+ | * note that you can change the order of the menu items as you wish. | ||
+ | * Now we're still missing the actual menu :D | ||
+ | * At the end of the file insert something like this: | ||
+ | |||
+ | ; ========================================================================== | ||
+ | ; The combined FIL/LFO menu | ||
+ | ; | ||
+ | |||
+ | | ||
+ | CS_MENU_TABLE_L_FL | ||
+ | db (CS_MENU_TABLE_L_FL_End-CS_MENU_TABLE_L_FL)/ | ||
+ | |||
+ | ;; Register (00=dummy) | ||
+ | CS_MENU_ENTRY SID_Ix_L_Fx_CUTOFF_L, | ||
+ | CS_MENU_ENTRY SID_Ix_L_Fx_RESONANCE, | ||
+ | CS_MENU_ENTRY 0x00, | ||
+ | CS_MENU_ENTRY SID_Ix_LFOx_RATE, | ||
+ | CS_MENU_ENTRY SID_Ix_LFOx_DEPTH, | ||
+ | CS_MENU_TABLE_L_FL_End | ||
+ | |||
+ | * this menu page has 5 entries, the third one being an empty dummy entry | ||
+ | * Now the menu is done :-) | ||
+ | * to make one layer button open this menu all we need to do is change the handler above to call this page | ||
+ | * in this case that would look like this: | ||
+ | |||
+ | CS_MENU_BUTTON_Layer5 ;; FILTER/LFO LAYER | ||
+ | ;; do nothing if button has been depressed | ||
+ | btfsc MIOS_PARAMETER2, | ||
+ | return | ||
+ | movlw 0x10 | ||
+ | movwf CS_MENU_LAYER | ||
+ | call CS_MENU_GetMenuID_FL ; | ||
+ | goto CS_MENU_BUTTON_Hlp_MenuChange | ||
+ | return | ||
+ | |||
+ | === One last thing to edit === | ||
+ | The CS_MENU_GetMenuID_FL function, which returns the ID of the menu page needs to be defined. This should be done in cs_menu.inc in the section titled | ||
+ | < | ||
+ | ;; This function returns the CS_MENU_x_xxx ID depending on selected engine | ||
+ | ;; --------------------------------------------------------------------------</ | ||
+ | which is around line 2056. |
layering_the_ui.txt · Last modified: 2008/04/14 14:27 by 127.0.0.1