Mercurial > public > hwos_code
comparison src/menu_processor.asm @ 560:b7eb98dbd800
bump to 2.96beta (REFACTORED VERSION)
author | heinrichsweikamp |
---|---|
date | Wed, 31 Jan 2018 19:39:37 +0100 |
parents | 33941d158069 |
children | b455b31ce022 |
comparison
equal
deleted
inserted
replaced
559:9cb967d844f0 | 560:b7eb98dbd800 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File menu_processor.asm | 3 ; File menu_processor.asm REFACTORED VERSION V2.91 |
4 ; | 4 ; |
5 ; Routines to handle all hwOS graphic/text menus. | 5 ; Routines to handle all hwOS graphic/text menus. |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
79 VARARGS_GET8 menu_center ; Vertical position | 79 VARARGS_GET8 menu_center ; Vertical position |
80 movff TBLPTRL, menu_block+0 ; Save base address for menu_read_item | 80 movff TBLPTRL, menu_block+0 ; Save base address for menu_read_item |
81 movff TBLPTRH, menu_block+1 | 81 movff TBLPTRH, menu_block+1 |
82 movff TBLPTRU, menu_block+2 | 82 movff TBLPTRU, menu_block+2 |
83 | 83 |
84 extern TFT_clear_divemode_menu | |
85 btfss divemode ; In divemode? | 84 btfss divemode ; In divemode? |
86 bra menu_processor0 ; No | 85 bra menu_processor0 ; No |
87 | 86 |
87 ; Required for menus with less entries then the calling menu but not so nice when setting up gas 6.... mH | |
88 extern TFT_clear_divemode_menu | |
88 movlw .1 | 89 movlw .1 |
89 cpfsgt menupos ; only if menupos=1... | 90 cpfsgt menupos ; only if menupos=1... |
90 call TFT_clear_divemode_menu ; ... Clear the menu! | 91 call TFT_clear_divemode_menu ; ... Clear the menu! |
91 | 92 |
92 ; Draw one frame around the divemode menu | 93 ; Draw one frame around the divemode menu |
125 call TFT_cat_serial | 126 call TFT_cat_serial |
126 STRCAT " v" | 127 STRCAT " v" |
127 call TFT_cat_firmware | 128 call TFT_cat_firmware |
128 STRCAT_PRINT "" | 129 STRCAT_PRINT "" |
129 call TFT_standard_color | 130 call TFT_standard_color |
130 bcf win_invert | 131 bcf win_invert |
131 return | 132 return |
132 | 133 |
133 ;============================================================================= | 134 ;============================================================================= |
134 ; (re-)draw menu title. | 135 ; (re-)draw menu title. |
135 ; | 136 ; |
352 call get_battery_voltage ; gets battery voltage | 353 call get_battery_voltage ; gets battery voltage |
353 | 354 |
354 btfsc settime_setdate ; In the Set Time or Set Date menu? | 355 btfsc settime_setdate ; In the Set Time or Set Date menu? |
355 call TFT_show_time_date_menu ; Yes, update clock | 356 call TFT_show_time_date_menu ; Yes, update clock |
356 | 357 |
357 btfsc menu_show_sensors ; In the "Sensors" menu? | 358 ; DELETE - menu has been deleted ## memory |
358 call TFT_menu_hud ; Yes, update HUD data | 359 ; btfsc menu_show_sensors ; In the "Sensors" menu? |
360 ; call TFT_menu_hud ; Yes, update HUD data | |
359 | 361 |
360 bcf onesecupdate ; one second updates done | 362 bcf onesecupdate ; one second updates done |
361 | 363 |
362 menu_line_loop2: | 364 menu_line_loop2: |
363 btfsc sleepmode ; Timeout? | 365 btfsc sleepmode ; Timeout? |
364 goto restart ; Yes, back to surfacemode | 366 goto restart ; Yes, back to surfacemode |
365 btfsc divemode | 367 btfsc divemode |
366 goto restart ; Enter Divemode if required | 368 goto restart ; Enter Divemode if required |
367 | 369 |
368 btfsc enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) | 370 btfsc enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) |
369 bra menu_line_loop3 | 371 bra menu_line_loop3 |
370 btfsc vusb_in ; USB plugged in? | 372 btfsc vusb_in ; USB plugged in? |
371 call comm_mode ; Start COMM mode | 373 call comm_mode ; Start COMM mode |
372 bra menu_line_loop4 | 374 bra menu_line_loop4 |
373 menu_line_loop3: | 375 menu_line_loop3: |
374 btfss vusb_in ; USB (still) plugged in? | 376 btfss vusb_in ; USB (still) plugged in? |
375 bcf enable_screen_dumps ; No, clear flag | 377 bcf enable_screen_dumps ; No, clear flag |
376 call rs232_get_byte | 378 call rs232_get_byte |
377 btfsc rs232_recieve_overflow | 379 btfsc rs232_recieve_overflow |
378 bra menu_line_loop4 | 380 bra menu_line_loop4 |
379 movlw "l" | 381 movlw "l" |
380 cpfseq RCREG1 | 382 cpfseq RCREG1 |
381 bra menu_line_loop4 | 383 bra menu_line_loop4 |
382 call TFT_dump_screen ; Dump the screen contents | 384 call TFT_dump_screen ; Dump the screen contents |
383 menu_line_loop4: | 385 menu_line_loop4: |
384 | 386 |
385 bra menu_line_loop | 387 bra menu_line_loop |
386 | 388 |
387 ;---- Move to menu's next line | 389 ;---- Move to menu's next line |
443 movlw dm_menu_item1_row | 445 movlw dm_menu_item1_row |
444 movff WREG,win_top | 446 movff WREG,win_top |
445 movlw dm_menu_item1_column | 447 movlw dm_menu_item1_column |
446 movff WREG,win_leftx2 | 448 movff WREG,win_leftx2 |
447 clrf start_item | 449 clrf start_item |
448 movff item_max,menupos4 ; Copy item_max for divemode cursor routine | 450 movff item_max,menupos4 ; Copy item_max for divemode cursor routine |
449 bra menu_draw_lines_2 | 451 bra menu_draw_lines_2 |
450 | 452 |
451 menu_draw_lines: | 453 menu_draw_lines: |
452 btfsc divemode ; in divemode? | 454 btfsc divemode ; in divemode? |
453 bra menu_draw_lines_divemode ; Yes | 455 bra menu_draw_lines_divemode; Yes |
454 | 456 |
455 btfsc menu_flags,0 ; Dynamic title ? | 457 btfsc menu_flags,0 ; Dynamic title ? |
456 rcall menu_processor_title ; YES: redraw it then. | 458 rcall menu_processor_title ; YES: redraw it then. |
457 | 459 |
458 MENU_LINE_FONT MENU_LEFT, 0 ; Init start position/font | 460 MENU_LINE_FONT MENU_LEFT, 0 ; Init start position/font |
475 | 477 |
476 menu_draw_lines_2: | 478 menu_draw_lines_2: |
477 movff start_item, menu_item | 479 movff start_item, menu_item |
478 | 480 |
479 menu_draw_lines_1: | 481 menu_draw_lines_1: |
480 call TFT_standard_color ; Restore color after disabled lines. | 482 call TFT_standard_color ; Restore color after disabled lines. |
481 | 483 |
482 movf menu_item,W | 484 movf menu_item,W |
483 rcall menu_read_item | 485 rcall menu_read_item |
484 | 486 |
485 movf value_type,W ; Switch on data type | 487 movf value_type,W ; Switch on data type |