comparison src/simulator.asm @ 640:8c1f1f334275

3.13 release
author heinrichsweikamp
date Thu, 29 Oct 2020 09:29:15 +0100
parents 9a64914a8fca
children 75e90cd0c2c3
comparison
equal deleted inserted replaced
639:0ff82370991d 640:8c1f1f334275
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File simulator.asm * combined next generation V3.09.5 3 ; File simulator.asm * combined next generation V3.11.1
4 ; 4 ;
5 ; Deco Calculator 5 ; Deco Calculator
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
58 58
59 ;---- Private local Flags ---------------------------------------------------- 59 ;---- Private local Flags ----------------------------------------------------
60 60
61 #define decoplan_abort decoplan_flags,0 ; =1: deco calculations were aborted 61 #define decoplan_abort decoplan_flags,0 ; =1: deco calculations were aborted
62 #define decoplan_last_stop_shown decoplan_flags,1 ; =1: last deco stop is shown 62 #define decoplan_last_stop_shown decoplan_flags,1 ; =1: last deco stop is shown
63 #define decoplan_pressures_shown decoplan_flags,2 ; =1: show gas volumes in bar as per tank sizes 63 #define decoplan_show_pressures decoplan_flags,2 ; =1: show bar, =0: show liters
64 #define decoplan_overflow decoplan_flags,3 ; =1: result > 999 64 #define decoplan_overflow decoplan_flags,3 ; =1: result > 999
65 #define decoplan_toggleflag decoplan_flags,4 ; used to show calculation progress 65 #define decoplan_toggleflag decoplan_flags,4 ; used to show calculation progress
66 ; decoplan_flags,5 ; --- unused 66 ; decoplan_flags,5 ; --- unused
67 ; decoplan_flags,6 ; --- unused 67 ; decoplan_flags,6 ; --- unused
68 ; decoplan_flags,7 ; --- unused 68 ; decoplan_flags,7 ; --- unused
682 FONT_COLOR_MEMO ; back to standard color 682 FONT_COLOR_MEMO ; back to standard color
683 683
684 ; loop through deco plan pages 684 ; loop through deco plan pages
685 deco_results_1: 685 deco_results_1:
686 clrf decoplan_page ; start from first page 686 clrf decoplan_page ; start from first page
687 bcf decoplan_pressures_shown ; when showing the gas needs, start with volumes (liter) 687 bcf decoplan_show_pressures ; start with showing volumes (liter)
688 deco_results_1a: 688 deco_results_1a:
689 WIN_BOX_BLACK .0, .239, .80, .159 ; clear the complete right part of the result column (top, bottom, left, right) 689 WIN_BOX_BLACK .0, .239, .80, .159 ; clear the complete right part of the result column (top, bottom, left, right)
690 rcall deco_results_page ; show a results page 690 rcall deco_results_page ; show a results page
691 incf decoplan_page,F ; increment results page number 691 incf decoplan_page,F ; increment results page number
692 call reset_timeout_surfmode ; reset timeout 692 call reset_timeout_surfmode ; reset timeout
756 movff POSTINC0,lo ; read gas volume low byte 756 movff POSTINC0,lo ; read gas volume low byte
757 movff POSTINC0,hi ; high byte 757 movff POSTINC0,hi ; high byte
758 758
759 bcf decoplan_overflow ; no overflow in gas needs by default 759 bcf decoplan_overflow ; no overflow in gas needs by default
760 760
761 btfss decoplan_pressures_shown ; results in bar? 761 btfss decoplan_show_pressures ; shall show pressures?
762 bra deco_results_gas_volumes_2 ; NO - liter 762 bra deco_results_gas_volumes_2 ; NO - volume in liter
763 ;bra deco_results_gas_volumes_1 ; YES - bar 763 ;bra deco_results_gas_volumes_1 ; YES - pressure in bar
764 764
765 ; output of gas needs in bar 765 ; output of gas needs in bar
766 deco_results_gas_volumes_1: 766 deco_results_gas_volumes_1:
767 btfsc hi,int_high_flag ; overflow in result? 767 btfsc hi,int_high_flag ; overflow in result?
768 bsf decoplan_overflow ; YES - remember it 768 bsf decoplan_overflow ; YES - remember it
772 bcf hi,int_warning_flag ; clear flag for gas needs above available amount 772 bcf hi,int_warning_flag ; clear flag for gas needs above available amount
773 bcf hi,int_attention_flag ; clear flag for gas needs close to available amount 773 bcf hi,int_attention_flag ; clear flag for gas needs close to available amount
774 bcf hi,int_invalid_flag ; clear flag for invalid data 774 bcf hi,int_invalid_flag ; clear flag for invalid data
775 bcf hi,int_is_zero ; clear flag for zero 775 bcf hi,int_is_zero ; clear flag for zero
776 776
777 ; common part for liter and bar
777 deco_results_gas_volumes_2: 778 deco_results_gas_volumes_2:
778 PUTC ":" ; print ":" 779 PUTC ":" ; print ":"
779 output_9999 ; print volume or bar (0-9999) 780 output_9999 ; print volume or bar (0-9999)
780 movlw '>' ; load coding of ">" sign into WREG 781 movlw '>' ; load coding of ">" sign into WREG
781 btfsc decoplan_overflow ; overflow in pressure value? 782 btfsc decoplan_overflow ; overflow in pressure value?
790 bra deco_results_gas_loop ; NO - loop 791 bra deco_results_gas_loop ; NO - loop
791 792
792 FONT_COLOR color_greenish ; set color 793 FONT_COLOR color_greenish ; set color
793 TEXT_SMALL .80,.01,tGasUsage ; "Gas Usage" 794 TEXT_SMALL .80,.01,tGasUsage ; "Gas Usage"
794 795
795 btfsc decoplan_pressures_shown ; results shown in bar? 796 btfsc decoplan_show_pressures ; showing pressures in bar?
796 bra deco_results_gas_volumes_4 ; YES 797 bra deco_results_gas_volumes_4b ; YES - bar
797 TEXT_SMALL .120,.25,tLiterLong ; NO - in Liter then 798 ;bra deco_results_gas_volumes_4a ; NO - liter
798 bra deco_results_gas_volumes_5 ; - continue with initialization of housekeeping 799
799 800 deco_results_gas_volumes_4a:
800 deco_results_gas_volumes_4: 801 TEXT_SMALL .120,.25,tLiterLong ; print "Liter"
801 TEXT_SMALL .120,.25,tbar ; " bar" (with leading space) 802 bra deco_results_gas_volumes_5 ; continue with initialization of housekeeping
803
804 deco_results_gas_volumes_4b:
805 TEXT_SMALL .120,.25,tbar ; print " bar" (with leading space)
806 ;bra deco_results_gas_volumes_5 ; continue with initialization of housekeeping
802 807
803 deco_results_gas_volumes_5: 808 deco_results_gas_volumes_5:
804 call reset_timeout_surfmode ; reset timeout 809 call reset_timeout_surfmode ; reset timeout
805 bcf switch_right ; clear left-over right button event 810 bcf switch_right ; clear left-over right button event
806 bcf switch_left ; clear left-over left button event 811 bcf switch_left ; clear left-over left button event
817 btfss decoplan_abort ; shall abort? 822 btfss decoplan_abort ; shall abort?
818 bra deco_results_gas_volumes_6 ; NO - loop 823 bra deco_results_gas_volumes_6 ; NO - loop
819 return ; YES 824 return ; YES
820 825
821 deco_results_gas_volumes_7: 826 deco_results_gas_volumes_7:
822 btfsc decoplan_pressures_shown ; results shown in bar? 827 btfsc decoplan_show_pressures ; showing pressures in bar?
823 bra deco_results_1 ; YES - show deco stops again 828 bra deco_results_1 ; YES - restart with deco stops again
824 bsf decoplan_pressures_shown ; NO - but now 829 bsf decoplan_show_pressures ; NO - but now
825 lfsr FSR0,int_O_gas_need_pres ; - set base address of gas needs in bar 830 lfsr FSR0,int_O_gas_need_pres ; - set base address of gas needs in bar
826 bra deco_results_gas_common ; - re-run gas needs output in pressure mode 831 bra deco_results_gas_common ; - re-run gas needs output in pressure mode
827 832
828 ;----------------------------------------------------------------------------- 833 ;-----------------------------------------------------------------------------
829 834