Mercurial > public > hwos_code
comparison src/simulator.asm @ 292:ccb93f319e78
ADD (back) Gas Volumes display after decoplanning.
author | jDG |
---|---|
date | Sat, 30 May 2015 21:34:01 +0200 |
parents | d1117b99fd99 |
children | f97e439d711c |
comparison
equal
deleted
inserted
replaced
291:f3df4f291c90 | 292:ccb93f319e78 |
---|---|
709 | 709 |
710 deco_show_plan_3: | 710 deco_show_plan_3: |
711 btfss decoplan_last_ceiling_shown | 711 btfss decoplan_last_ceiling_shown |
712 bra deco_show_plan_1 | 712 bra deco_show_plan_1 |
713 ; All stops shown | 713 ; All stops shown |
714 | 714 |
715 return ; mH - no Gas consumption (yet) | |
716 | |
717 ;---- In OCR mode, show the gas Usage special page --------------------------- | 715 ;---- In OCR mode, show the gas Usage special page --------------------------- |
718 simulator_show_decoplan5_0: | 716 simulator_show_decoplan5_0: |
719 btfsc FLAG_ccr_mode ; =1: CCR mode (Fixed ppO2 or Sensor) active | 717 btfsc FLAG_ccr_mode ; =1: CCR mode (Fixed ppO2 or Sensor) active |
720 return ; YES: Return to simulator menu | 718 return ; YES: Return to simulator menu |
721 | 719 |
722 ; Make sure to pass first gas | 720 ; Make sure to pass first gas |
723 call get_first_gas_to_WREG ; Gets first gas (0-4) into WREG | 721 call get_first_gas_to_WREG ; Gets first gas (0-4) into WREG |
722 incf WREG,f ; gas 1..5 | |
724 movff WREG,char_I_first_gas ; Copy for compatibility | 723 movff WREG,char_I_first_gas ; Copy for compatibility |
725 | 724 |
726 ; Compute gas consumption for each tank. | 725 ; Compute gas consumption for each tank. |
727 extern deco_gas_volumes | 726 extern deco_gas_volumes |
728 call deco_gas_volumes | 727 call deco_gas_volumes |
729 movlb .1 | 728 movlb .1 |
730 | 729 |
731 ; Clear the complete stop result column: | 730 ; Clear the complete stop result column: |
732 WIN_BOX_BLACK .0, .239, .85, .159 ;top, bottom, left, right | 731 WIN_BOX_BLACK .0, .239, .85, .159 ;top, bottom, left, right |
733 | 732 |
734 movlw d'10' | 733 movlw .25 |
735 movwf waitms_temp ; Row for gas list is .10+.25 | 734 movwf waitms_temp ; Row for gas list is .25+.25 |
736 clrf wait_temp ; Gas counter | 735 clrf wait_temp ; Gas counter |
737 lfsr FSR0,int_O_gas_volumes ; Initialize indexed addressing. | 736 lfsr FSR0,int_O_gas_volumes ; Initialize indexed addressing. |
738 | 737 |
739 WIN_LEFT .90 ; Set column | 738 WIN_LEFT .80 ; Set column |
740 call TFT_standard_color | 739 call TFT_standard_color |
741 | 740 |
742 simulator_show_decoplan5_loop: | 741 simulator_show_decoplan5_loop: |
743 incf wait_temp,F ; Increment gas # | 742 incf wait_temp,F ; Increment gas # |
743 | |
744 STRCPY_TEXT tGas ; Print Gas number | |
745 bsf leftbind | |
746 movff wait_temp,lo | |
747 output_8 | |
744 | 748 |
745 movlw .25 | 749 movlw .25 |
746 addwf waitms_temp,F ; Increase row position | 750 addwf waitms_temp,F ; Increase row position |
747 movff waitms_temp,win_top ; Set Row | 751 movff waitms_temp,win_top ; Set Row |
748 | 752 |
749 movff POSTINC0,lo ; Read (16bit) result, low first, | 753 movff POSTINC0,lo ; Read (16bit) result, low first, |
750 movff POSTINC0,hi ; then high. | 754 movff POSTINC0,hi ; then high. |
751 movf lo,W ; Null ? | 755 movf lo,W ; Null ? |
752 iorwf hi,W | 756 iorwf hi,W |
753 ; bz simulator_show_decoplan5_1 ; Skip printing. mH - Test disabled | |
754 | 757 |
755 movf lo,W ; == 65535 (saturated ?) | 758 movf lo,W ; == 65535 (saturated ?) |
756 andwf hi,W | 759 andwf hi,W |
757 incf WREG | 760 incf WREG |
758 bnz simulator_show_decoplan5_2 | 761 bnz simulator_show_decoplan5_2 |
759 call TFT_attention_color | 762 call TFT_attention_color |
760 STRCPY_PRINT "= xxxx.x" | 763 STRCAT_PRINT ": xxxx.x" |
761 call TFT_standard_color | 764 call TFT_standard_color |
762 bra simulator_show_decoplan5_1 | 765 bra simulator_show_decoplan5_1 |
763 | 766 |
764 simulator_show_decoplan5_2: | 767 simulator_show_decoplan5_2: |
765 STRCPY "= " | 768 STRCAT ": " |
766 | 769 |
767 bsf leftbind | 770 bsf leftbind |
768 output_16 ; No decimal anymore. | 771 output_16 ; No decimal anymore. |
769 bcf leftbind | 772 bcf leftbind |
770 STRCAT_PRINT "" ; No unit: can be bars or litters. | 773 STRCAT_PRINT "" ; No unit: can be bars or litters. |
773 simulator_show_decoplan5_1: | 776 simulator_show_decoplan5_1: |
774 movlw d'5' ; list all five gases | 777 movlw d'5' ; list all five gases |
775 cpfseq wait_temp ; All gases shown? | 778 cpfseq wait_temp ; All gases shown? |
776 bra simulator_show_decoplan5_loop ; No | 779 bra simulator_show_decoplan5_loop ; No |
777 | 780 |
778 ; call TFT_divemask_color | 781 WIN_COLOR color_greenish |
779 ; DISPLAYTEXTH .301 ; OCR Gas Usage: | 782 WIN_SMALL .80,.25 |
780 ; call TFT_standard_color | 783 STRCPY_TEXT tGasUsage |
781 | 784 STRCAT_PRINT ":" |
782 call logbook_preloop_tasks | 785 call TFT_standard_color |
786 | |
787 call logbook_preloop_tasks | |
783 simulator_show_decoplan5_3: | 788 simulator_show_decoplan5_3: |
784 btfsc switch_right | 789 btfsc switch_right |
785 return ; Return to simulator menu | 790 return ; Return to simulator menu |
786 btfsc switch_left | 791 btfsc switch_left |
787 return ; Return to simulator menu | 792 return ; Return to simulator menu |
788 call log_screendump_and_onesecond ; Check if we need to make a screenshot and check for new second | 793 call log_screendump_and_onesecond ; Check if we need to make a screenshot and check for new second |
789 btfsc sleepmode ; Timeout? | 794 btfsc sleepmode ; Timeout? |
790 goto restart | 795 goto restart |
791 bra simulator_show_decoplan5_3 | 796 bra simulator_show_decoplan5_3 |
792 | 797 |
793 ;============================================================================= | 798 ;============================================================================= |
794 ; | 799 ; |
795 global do_demo_divemode | 800 global do_demo_divemode |
796 do_demo_divemode: | 801 do_demo_divemode: |