comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 124:4f9f477bb452

Rewrite display of decoplan: * Common stuff - fix clearing bottom of list, for fleecker-free updates. - fix "Wait..." topline_box while computing deco in planning - fix 'No Deco" std color and mark last page. - Allow stops up to 240' * ZHL-16c model: - 6 lines max (sim or dive) - Print exceed stops as "add: ddd'" * GF model - 6 lines in divemode, 8 in planning. - any suitable number of pages. - "more..." when not the last page displayed. - fix displaying special depth for last stop (CF#29). - fix 0-time stops: just skip display. - fix end of list when reached the deepest stop. - fix no need to buffer decoplan twice.
author JeanDo
date Sat, 01 Jan 2011 01:57:50 +0100
parents f24137eb85de
children e26f49674956
comparison
equal deleted inserted replaced
123:6a94f96e9cea 124:4f9f477bb452
339 bra divemenu_see_decoplan1 ; No, standard ZH-L16 339 bra divemenu_see_decoplan1 ; No, standard ZH-L16
340 340
341 bsf multi_gf_display ; Yes, display the multi-gf table screen 341 bsf multi_gf_display ; Yes, display the multi-gf table screen
342 bcf last_ceiling_gf_shown ; Clear flag 342 bcf last_ceiling_gf_shown ; Clear flag
343 343
344 call PLED_decoplan_gf_page1 ; Display the new screen 344 clrf decoplan_page ; Starts on page 0
345 call PLED_decoplan_gf ; Display the new screen
345 return 346 return
346 347
347 divemenu_see_decoplan1: 348 divemenu_see_decoplan1:
348 349 movff char_O_deco_status,WREG
349 movff char_O_deco_status,deco_status ; 350 tstfsz WREG ; deco_status=0 if decompression calculation done
350 tstfsz deco_status ; deco_status=0 if decompression calculation done 351 return ; calculation not yet finished!
351 return ; calculation not yet finished!
352 352
353 call PLED_decoplan ; display the Decoplan 353 call PLED_decoplan ; display the Decoplan
354 return 354 return
355 355
356 divemenu_see_decoplan2: 356 divemenu_see_decoplan2:
360 divemenu_see_decoplan2_0: 360 divemenu_see_decoplan2_0:
361 bcf display_see_deco ; clear flag 361 bcf display_see_deco ; clear flag
362 bra timeout_divemenu2 ; quit menu! 362 bra timeout_divemenu2 ; quit menu!
363 363
364 divemenu_see_decoplan2_nextgf: 364 divemenu_see_decoplan2_nextgf:
365 incf temp8,F 365 incf decoplan_page,F
366 btfsc last_ceiling_gf_shown ; last ceiling shown? 366 btfsc last_ceiling_gf_shown ; last ceiling shown?
367 bra divemenu_see_decoplan2_0 ; All done, clear and return 367 bra divemenu_see_decoplan2_0 ; All done, clear and return
368 368
369 clrf timeout_counter3 ; Clear timeout Divemode menu 369 clrf timeout_counter3 ; Clear timeout Divemode menu
370 bra timeout_divemenu3x ; Display next page 370 bra timeout_divemenu3x ; Display next page
586 586
587 timeout_divemenu: 587 timeout_divemenu:
588 btfss menubit ; is the Dive mode menu displayed? 588 btfss menubit ; is the Dive mode menu displayed?
589 return ; No 589 return ; No
590 590
591
592 btfsc display_set_simulator ; Is the Simulator Mask active? 591 btfsc display_set_simulator ; Is the Simulator Mask active?
593 bra timeout_divemenu6 ; Yes, update Simulator mask 592 bra timeout_divemenu6 ; Yes, update Simulator mask
594 593
595 btfss display_see_deco ; Is the decoplan active? 594 btfss display_see_deco ; Is the decoplan active?
596 bra timeout_divemenu1 ; No, skip updating the decoplan 595 bra timeout_divemenu1 ; No, skip updating the decoplan
597 596
598 btfsc multi_gf_display ; display the multi-gf table screen? 597 btfsc multi_gf_display ; display the multi-gf table screen?
599 bra timeout_divemenu3 ; Yes... 598 bra timeout_divemenu3 ; Yes...
600 599
601 movff char_O_deco_status,deco_status ; 600 movff char_O_deco_status,WREG
602 tstfsz deco_status ; deco_status=0 if decompression calculation done 601 tstfsz WREG ; deco_status=0 if decompression calculation done
603 bra timeout_divemenu1 ; No, skip updating the decoplan 602 bra timeout_divemenu1 ; No, skip updating the decoplan
604 603
605 call PLED_decoplan ; update the Decoplan 604 call PLED_decoplan ; update the Decoplan
606 605
607 timeout_divemenu1: 606 timeout_divemenu1:
612 timeout_divemenu2: ; quit divemode menu 611 timeout_divemenu2: ; quit divemode menu
613 ; btfss multi_gf_display ; Was the Multi-GF Table displayed? 612 ; btfss multi_gf_display ; Was the Multi-GF Table displayed?
614 ; bra timeout_divemenu2a ; No, normal OLED rebuild 613 ; bra timeout_divemenu2a ; No, normal OLED rebuild
615 614
616 ; Restore some outputs 615 ; Restore some outputs
617 clrf temp8 ; Page 0-1 of deco list 616 clrf decoplan_page ; Page 0-1 of deco list
618 call PLED_clear_divemode_menu; Clear dive mode menu 617 call PLED_clear_divemode_menu; Clear dive mode menu
619 618
620 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode 619 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
621 bra timeout_divemenu2a ; skip! 620 bra timeout_divemenu2a ; skip!
622 btfsc gauge_mode ; Ignore in Gauge mode 621 btfsc gauge_mode ; Ignore in Gauge mode
644 bcf switch_left ; and debounce switches 643 bcf switch_left ; and debounce switches
645 bcf switch_right 644 bcf switch_right
646 return 645 return
647 646
648 timeout_divemenu3: 647 timeout_divemenu3:
649 movff char_O_deco_status,deco_status ; 648 movff char_O_deco_status,WREG
650 tstfsz deco_status ; deco_status=0 if decompression calculation done 649 tstfsz WREG ; deco_status=0 if decompression calculation done
651 bra timeout_divemenu1 ; No, skip updating the decoplan 650 bra timeout_divemenu1 ; No, skip updating the decoplan
652 timeout_divemenu3x: 651 timeout_divemenu3x:
653 call PLED_decoplan_gf_page_current ; Re-Draw Current page of GF Decoplan 652 call PLED_decoplan_gf ; Re-Draw Current page of GF Decoplan
654 bra timeout_divemenu1 ; Check timeout 653 bra timeout_divemenu1 ; Check timeout
655 654
656 timeout_divemenu6: 655 timeout_divemenu6:
657 ; Update Simulator Mask 656 ; Update Simulator Mask
658 call PLED_divemode_simulator_mask; Show mask 657 call PLED_divemode_simulator_mask; Show mask