Mercurial > public > hwos_code
comparison src/simulator.asm @ 208:53771bd3d567
NEW: Show plan parameters in decoplan result page
author | heinrichsweikamp |
---|---|
date | Sun, 07 Dec 2014 12:47:19 +0100 |
parents | 3bbfac29ba3e |
children | 31088352ee32 |
comparison
equal
deleted
inserted
replaced
207:f5d909e03f52 | 208:53771bd3d567 |
---|---|
29 extern deco_calc_hauptroutine | 29 extern deco_calc_hauptroutine |
30 extern deco_calc_tissue | 30 extern deco_calc_tissue |
31 extern deco_calc_CNS_fraction | 31 extern deco_calc_CNS_fraction |
32 extern deco_calc_CNS_planning | 32 extern deco_calc_CNS_planning |
33 extern deco_pull_tissues_from_vault | 33 extern deco_pull_tissues_from_vault |
34 extern TFT_display_decotype_surface1 | |
34 | 35 |
35 extern log_screendump_and_onesecond, logbook_preloop_tasks | 36 extern log_screendump_and_onesecond, logbook_preloop_tasks |
37 extern do_planner_menu | |
36 | 38 |
37 ;---- Private temp variables ------------------------------------------------- | 39 ;---- Private temp variables ------------------------------------------------- |
38 CBLOCK tmp+0x10 ; Reserved space for wordprocessor and convert | 40 CBLOCK tmp+0x10 ; Reserved space for wordprocessor and convert |
39 decoplan_index ; within each page | 41 decoplan_index ; within each page |
40 decoplan_gindex ; global index | 42 decoplan_gindex ; global index |
45 ENDC | 47 ENDC |
46 #define decoplan_last_ceiling_shown decoplan_flags,0 | 48 #define decoplan_last_ceiling_shown decoplan_flags,0 |
47 | 49 |
48 ;---- Demo decoplanner ------------------------------------------------------- | 50 ;---- Demo decoplanner ------------------------------------------------------- |
49 global do_demo_planner | 51 global do_demo_planner |
50 extern do_planner_menu | |
51 | 52 |
52 do_demo_planner: | 53 do_demo_planner: |
53 call speed_fastest | 54 btfsc FLAG_gauge_mode ; =1: In Gauge mode |
55 goto do_planner_menu | |
56 btfsc FLAG_apnoe_mode ; =1: In Apnea mode | |
57 goto do_planner_menu | |
54 ; call deco_reset ; TODO: remove reset all Decodata | 58 ; call deco_reset ; TODO: remove reset all Decodata |
55 call deco_planer | 59 rcall deco_planer |
56 call deco_show_plan | 60 rcall deco_show_plan |
57 bcf switch_right | |
58 bcf switch_left | |
59 goto do_planner_menu | 61 goto do_planner_menu |
60 | 62 |
61 ;============================================================================= | 63 ;============================================================================= |
62 ; Pass all parameters to the C code | 64 ; Pass all parameters to the C code |
63 ; | 65 ; |
587 | 589 |
588 ; Display the message "more..." | 590 ; Display the message "more..." |
589 rcall deco_plan_show_clear_bottom ; Clear from next line | 591 rcall deco_plan_show_clear_bottom ; Clear from next line |
590 | 592 |
591 call TFT_standard_color | 593 call TFT_standard_color |
592 TEXT_SMALL .85, .240-.25, tMore | 594 TEXT_SMALL .88, .220, tMore |
593 return | 595 return |
594 | 596 |
595 deco_plan_show_99: | 597 deco_plan_show_99: |
596 bsf decoplan_last_ceiling_shown ; Nothing more in table to display. | 598 bsf decoplan_last_ceiling_shown ; Nothing more in table to display. |
597 rcall deco_plan_show_clear_bottom ; Clear from next line | 599 rcall deco_plan_show_clear_bottom ; Clear from next line |
605 clrf decoplan_page | 607 clrf decoplan_page |
606 call TFT_ClearScreen | 608 call TFT_ClearScreen |
607 WIN_COLOR color_greenish | 609 WIN_COLOR color_greenish |
608 TEXT_SMALL .1,.1, tDivePlan | 610 TEXT_SMALL .1,.1, tDivePlan |
609 call TFT_standard_color | 611 call TFT_standard_color |
610 WIN_LEFT .0 | 612 |
613 ; Show plan parameters | |
614 WIN_SMALL .0,.25 | |
615 STRCPY "Int:" | |
616 movff char_I_dive_interval,lo | |
617 bsf leftbind | |
618 output_8 | |
619 STRCAT_PRINT "'" | |
620 WIN_SMALL .0,.50 | |
621 STRCPY_TEXT tBtTm_short | |
622 movff char_I_bottom_time,lo | |
623 bsf leftbind | |
624 output_8 | |
625 STRCAT_PRINT "'" | |
626 WIN_SMALL .0,.75 | |
627 STRCPY_TEXT tDepth | |
628 PUTC ":" | |
629 movff char_I_bottom_depth,lo | |
630 bsf leftbind | |
631 output_8 | |
632 STRCAT_PRINT "m" | |
633 | |
634 ; Show deco mode | |
635 WIN_TOP .155 | |
636 lfsr FSR2,buffer | |
637 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnea | |
638 call TFT_display_decotype_surface1 | |
611 | 639 |
612 ;---- Display model | 640 ;---- Display model |
613 movff char_I_deco_model,WREG | 641 movff char_I_deco_model,WREG |
614 iorwf WREG | 642 iorwf WREG |
615 bnz deco_show_plan_m1 | 643 bnz deco_show_plan_m1 |
616 | 644 |
617 ; Display ZH-L16 sat/desat model. | 645 ; Display ZH-L16 sat/desat model. |
618 TEXT_SMALL .0,.40, tZHL16 | 646 TEXT_SMALL .0,.130, tZHL16 |
619 WIN_TOP .65 | 647 WIN_SMALL .14,.155 |
620 lfsr FSR2,buffer | 648 PUTC "," |
621 movff char_I_desaturation_multiplier,lo | 649 movff char_I_desaturation_multiplier,lo |
622 bsf leftbind | |
623 output_8 | 650 output_8 |
624 STRCAT "%/" | 651 STRCAT "%/" |
625 movff char_I_saturation_multiplier,lo | 652 movff char_I_saturation_multiplier,lo |
626 output_8 | 653 output_8 |
627 STRCAT_PRINT "%" | |
628 bra deco_show_plan_m2 | 654 bra deco_show_plan_m2 |
629 | 655 |
630 ; Display ZH-L16-GF low/high model. | 656 ; Display ZH-L16-GF low/high model. |
631 deco_show_plan_m1: | 657 deco_show_plan_m1: |
632 TEXT_SMALL .0,.40, tZHL16GF | 658 TEXT_SMALL .0,.130, tZHL16GF |
633 WIN_TOP .65 | 659 WIN_SMALL .14,.155 |
634 lfsr FSR2,buffer | 660 PUTC "," |
635 movff char_I_GF_Low_percentage,lo | 661 movff char_I_GF_Low_percentage,lo |
636 output_99x | 662 output_99x |
637 STRCAT "%/" | 663 STRCAT "%/" |
638 movff char_I_GF_High_percentage,lo | 664 movff char_I_GF_High_percentage,lo |
639 output_99x | 665 output_99x |
666 deco_show_plan_m2: | |
640 STRCAT_PRINT "%" | 667 STRCAT_PRINT "%" |
641 ;bra deco_show_plan_m2 | 668 |
642 | |
643 deco_show_plan_m2: | |
644 ; Show deco mode | |
645 extern TFT_display_decotype_surface1 | |
646 WIN_TOP .90 | |
647 lfsr FSR2,buffer | |
648 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnea | |
649 call TFT_display_decotype_surface1 | |
650 | |
651 ;---- Display TTS result | 669 ;---- Display TTS result |
652 WIN_TOP .165 | 670 WIN_SMALL .0,.180 |
653 STRCPY_TEXT tTTS | 671 STRCPY_TEXT tTTS |
654 STRCAT ": " | 672 STRCAT ": " |
655 | 673 |
656 movff int_O_ascenttime+0,lo | 674 movff int_O_ascenttime+0,lo |
657 movff int_O_ascenttime+1,hi | 675 movff int_O_ascenttime+1,hi |
658 bsf leftbind | 676 bsf leftbind |
659 output_16 | 677 output_16 |
660 STRCAT_PRINT "'" | 678 STRCAT_PRINT "'" |
661 | 679 |
662 ;---- Display CNS result | 680 ;---- Display CNS result |
663 WIN_TOP .190 | 681 WIN_TOP .205 |
664 STRCPY_TEXT tCNS | 682 STRCPY_TEXT tCNS |
665 STRCAT ": " | 683 STRCAT ": " |
666 movff int_O_CNS_fraction+0,lo | 684 movff int_O_CNS_fraction+0,lo |
667 movff int_O_CNS_fraction+1,hi | 685 movff int_O_CNS_fraction+1,hi |
668 output_16_3 | 686 output_16_3 |
672 output_16_3 | 690 output_16_3 |
673 STRCAT_PRINT "%" | 691 STRCAT_PRINT "%" |
674 | 692 |
675 ;---- Loop through pages | 693 ;---- Loop through pages |
676 deco_show_plan_1: | 694 deco_show_plan_1: |
677 call speed_normal | |
678 rcall deco_show_plan_page | 695 rcall deco_show_plan_page |
679 incf decoplan_page,F | 696 incf decoplan_page,F |
680 | 697 |
681 call logbook_preloop_tasks | 698 call logbook_preloop_tasks |
682 deco_show_plan_2: | 699 deco_show_plan_2: |
683 btfsc switch_right | 700 btfsc switch_right |
684 bra deco_show_plan_3 | 701 bra deco_show_plan_3 |
685 btfsc switch_left | 702 btfsc switch_left |
686 bra deco_show_plan_4 | 703 return ; Return to simulator menu |
687 call log_screendump_and_onesecond ; Check if we need to make a screenshot and check for new second | 704 call log_screendump_and_onesecond ; Check if we need to make a screenshot and check for new second |
688 btfsc sleepmode ; Timeout? | 705 btfsc sleepmode ; Timeout? |
689 goto restart | 706 goto restart |
690 bra deco_show_plan_2 | 707 bra deco_show_plan_2 |
691 | 708 |
692 deco_show_plan_3: | 709 deco_show_plan_3: |
693 btfss decoplan_last_ceiling_shown | 710 btfss decoplan_last_ceiling_shown |
694 bra deco_show_plan_1 | 711 bra deco_show_plan_1 |
695 | 712 return ; Return to simulator menu |
696 deco_show_plan_4: | |
697 call speed_normal ; Display in fast mode. | |
698 return | |
699 | 713 |
700 ;============================================================================= | 714 ;============================================================================= |
701 ; | 715 ; |
702 global do_demo_divemode | 716 global do_demo_divemode |
703 do_demo_divemode: | 717 do_demo_divemode: |