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