comparison src/menu_processor.asm @ 646:5b7fe7777425

3.16 release
author heinrichs weikamp
date Thu, 14 Oct 2021 12:03:24 +0200
parents 8c1f1f334275
children 75e90cd0c2c3
comparison
equal deleted inserted replaced
642:a9a0188091e4 646:5b7fe7777425
67 clrf STKPTR ; never return from here 67 clrf STKPTR ; never return from here
68 68
69 VARARGS_GET8 menu_item_count ; get number of items 69 VARARGS_GET8 menu_item_count ; get number of items
70 VARARGS_GET8 menu_vertical_start ; get vertical start position of 1st menu item 70 VARARGS_GET8 menu_vertical_start ; get vertical start position of 1st menu item
71 71
72 movf menu_vertical_start,W ; excite flags, vertical start = 0, i.e. no menu title text? 72 ; movf menu_vertical_start,W ; excite flags, vertical start = 0, i.e. no menu title text?
73 bz menu_processor_no_title ; YES - skip reading menu title text address 73 ; bz menu_processor_no_title ; YES - skip reading menu title text address
74 74 ;
75 VARARGS_GET16 menu_title_addr ; get address of menu title text 75 VARARGS_GET16 menu_title_addr ; get address of menu title text
76 76
77 menu_processor_no_title: 77 ;menu_processor_no_title:
78 78
79 movff TBLPTRL, menu_item_data_start+0 ; store base address of menu items for menu_read_menu_item_data 79 movff TBLPTRL, menu_item_data_start+0 ; store base address of menu items for menu_read_menu_item_data
80 movff TBLPTRH, menu_item_data_start+1 ; ... 80 movff TBLPTRH, menu_item_data_start+1 ; ...
81 movff TBLPTRU, menu_item_data_start+2 ; ... 81 movff TBLPTRU, menu_item_data_start+2 ; ...
82 82
89 call TFT_clear_divemode_menu ; YES - clear the menu 89 call TFT_clear_divemode_menu ; YES - clear the menu
90 90
91 ; draw a frame around the dive mode menu 91 ; draw a frame around the dive mode menu
92 movf pallet_color_mask,W ; get mask color into WREG 92 movf pallet_color_mask,W ; get mask color into WREG
93 WIN_FRAME_COLOR dm_menu_row, dm_menu_lower, dm_menu_left ,dm_menu_right ; top, bottom, left, right 93 WIN_FRAME_COLOR dm_menu_row, dm_menu_lower, dm_menu_left ,dm_menu_right ; top, bottom, left, right
94 bra menu_processor_menu_body ; the dive mode menu has no menu title and footer 94
95 btfss alt_layout_active ; big menu selected?
96 bra menu_processor_menu_body ; No, the normal dive mode menu has no title and footer
97
98 ; draw menu title
99 WIN_BOX_BLACK dm_menu_row+.2,dm_menu_row+.26,dm_menu_left+.2,dm_menu_right-.2 ; clear menu title area
100 WIN_SMALL .2, dm_menu_row+.2 ; set menu title font and position
101 FONT_COLOR color_greenish ; set menu title font color
102 movff menu_title_addr+0,FSR1L ; point to multi-lingual menu title text
103 movff menu_title_addr+1,FSR1H ; ...
104 call strcpy_text_FSR ; copy translated text into the buffer
105 movf FSR2L,W ; get title text length
106 mullw .7 ; compute title length in pixels_x2
107 bcf STATUS,C ; divide by 2
108 rrcf PRODL ; ...
109 movf PRODL,W ; get result into WREG
110 sublw .80 ; compute 80 (screen center position) - half title width in pixel_x2
111 movwf win_leftx2 ; set result as horizontal start position
112 movlw MAX_LINE_LENGTH_TITLE ; load max allowed length of a menu title
113 movwf FSR2L ; set buffer pointer to end of max length
114 clrf INDF2 ; terminate string at max length
115 PRINT ; output menu title
116
117 bra menu_processor_menu_body ; the dive mode menu has no footer
95 118
96 menu_processor_menu_title: 119 menu_processor_menu_title:
97 ; prepare screen 120 ; prepare screen
98 btfsc screen_type3 ; screen type 3 ? 121 btfsc screen_type3 ; screen type 3 ?
99 bra menu_processor_menu_title1 ; YES - screen type 3 has no backlight 122 bra menu_processor_menu_title1 ; YES - screen type 3 has no backlight
346 btfss alt_layout_active ; big menu selected? 369 btfss alt_layout_active ; big menu selected?
347 bra menu_draw_lines_divemode_small ; NO 370 bra menu_draw_lines_divemode_small ; NO
348 ;bra menu_draw_lines_divemode_big ; YES 371 ;bra menu_draw_lines_divemode_big ; YES
349 372
350 menu_draw_lines_divemode_big: 373 menu_draw_lines_divemode_big:
351 WIN_STD dm_menu_item1_column+.16,dm_menu_item1_row+.22 374 WIN_STD dm_menu_item1_column+.16,dm_menu_item1_row+.28
352 decf menu_pos_cur,W ; get selected item as 0..5 into WREG 375 decf menu_pos_cur,W ; get selected item as 0..5 into WREG
353 movwf menu_item_start ; set first item to draw = selected item 376 movwf menu_item_start ; set first item to draw = selected item
354 bra menu_draw_menu_items_common ; continue with common part 377 bra menu_draw_menu_items_common ; continue with common part
355 378
356 ENDIF ; _big_divemenu 379 ENDIF ; _big_divemenu
521 btfss alt_layout_active ; big menu selected? 544 btfss alt_layout_active ; big menu selected?
522 bra menu_draw_cursor_dive_small ; NO 545 bra menu_draw_cursor_dive_small ; NO
523 ;bra menu_draw_cursor_dive_big ; YES 546 ;bra menu_draw_cursor_dive_big ; YES
524 547
525 menu_draw_cursor_dive_big: 548 menu_draw_cursor_dive_big:
526 WIN_STD dm_menu_item1_column,dm_menu_item1_row+.20 549 WIN_STD dm_menu_item1_column,dm_menu_item1_row+.26
527 bra menu_draw_cursor_common ; print cursor 550 bra menu_draw_cursor_common ; print cursor
528 ENDIF ; _big_divemenu 551 ENDIF ; _big_divemenu
529 552
530 menu_draw_cursor_dive_small: 553 menu_draw_cursor_dive_small:
531 ; clear cursor areas 554 ; clear cursor areas