annotate src/tft_outputs.asm @ 608:d866684249bd

work on 2.99 stable
author heinrichsweikamp
date Mon, 07 Jan 2019 21:13:43 +0100
parents 5ce603c29750
children b87f23fae743
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3 ; File tft_outputs.asm REFACTORED VERSION V2.99f
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Startup subroutines
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-08-07 : [mH] moving from OSTC code
heinrichsweikamp
parents:
diff changeset
11
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
12 #include "hwos.inc" ; mandatory header
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
13 #include "shared_definitions.h" ; mailbox from/to p2_deco.c
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
14 #include "tft.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
15 #include "start.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
16 #include "wait.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
17 #include "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
18 #include "convert.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
19 #include "varargs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
20 #include "math.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
21 #include "isr.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
22 #include "eeprom_rs232.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
23 #include "adc_lightsensor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
24 #include "surfmode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
25 #include "divemode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
26 #include "external_flash.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
27 #include "ghostwriter.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
28 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
29 #include "i2c.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
30 #include "colorschemes.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
31 #include "calibrate.inc"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
32 #include "gaslist.inc"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
33
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
34 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
35 #include "rx_ops.inc"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
36 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
37
0
heinrichsweikamp
parents:
diff changeset
38 extern aa_wordprocessor
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
39 extern get_first_gas_to_WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
40 extern get_first_dil_to_WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
41
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
42 extern tFirmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
43 extern tSerial
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
44 extern tTotalDives
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
45 extern tBatteryV
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
46 extern tUptime
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
47 extern tCalX,tCalY,tCalZ
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
48 extern tPPO2MIN
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
49 extern tPPO2MINCC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
50 extern tPPO2Max
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
51 extern tPPO2DECO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
52
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
53 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
54 extern tFirmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
55 ENDIF
0
heinrichsweikamp
parents:
diff changeset
56
heinrichsweikamp
parents:
diff changeset
57 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
58
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
59 tft_out CODE
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
60
0
heinrichsweikamp
parents:
diff changeset
61 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
62
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
63 global TFT_divemask_color
0
heinrichsweikamp
parents:
diff changeset
64 TFT_divemask_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
65 movlw color_green
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
66 btfsc divemode ; in divemode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
67 rcall TFT_divemask_color_dive
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
68 bra TFT_standard_color0
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
69
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
70 TFT_divemask_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
71 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
72 incf WREG
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
73 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
74 retlw color_scheme_divemode_mask1 ;0
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
75 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
76 retlw color_scheme_divemode_mask2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
77 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
78 retlw color_scheme_divemode_mask3 ;2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
79 retlw color_scheme_divemode_mask4 ;3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
80
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
81
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
82 global TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
83 TFT_memo_color: ; information, values within normal range, things without a need to react upon
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
84 movlw color_white
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
85 bra TFT_standard_color0
605
5ce603c29750 gas color coding fixed
heinrichsweikamp
parents: 604
diff changeset
86 TFT_memo_color_dive:
5ce603c29750 gas color coding fixed
heinrichsweikamp
parents: 604
diff changeset
87 retlw color_white
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
88
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
89 global TFT_advice_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
90 TFT_advice_color: ; advices to do something, but without essential need to actually do it
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
91 movlw color_green
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
92 bra TFT_standard_color0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
93 TFT_advice_color_dive:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
94 retlw color_green
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
95
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
96 global TFT_attention_color ; important things to be aware of and things that are developing towards a warning
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
97 TFT_attention_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
98 movlw color_yellow
0
heinrichsweikamp
parents:
diff changeset
99 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
100 TFT_attention_color_dive:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
101 retlw color_yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
102
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
103 global TFT_warnings_color ; important things with immediate need to react upon
0
heinrichsweikamp
parents:
diff changeset
104 TFT_warnings_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
105 movlw color_red
0
heinrichsweikamp
parents:
diff changeset
106 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
107 TFT_warnings_color_dive:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
108 retlw color_red
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
109
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
110
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
111 global TFT_disabled_color
0
heinrichsweikamp
parents:
diff changeset
112 TFT_disabled_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
113 movlw color_lightblue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
114 btfsc divemode ; in divemode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
115 rcall TFT_disabled_color_dive ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
116 bra TFT_standard_color0
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
117 TFT_disabled_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
118 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
119 incf WREG
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
120 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
121 retlw color_scheme_divemode_dis1 ; 0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
122 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
123 retlw color_scheme_divemode_dis2 ; 1
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
124 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
125 retlw color_scheme_divemode_dis3 ; 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
126 retlw color_scheme_divemode_dis4 ; 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
127
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
128
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
129 global TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
130 TFT_standard_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
131 setf WREG ; default white
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
132 btfsc divemode ; in divemode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
133 rcall TFT_standard_color_dive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
134 ;bra TFT_standard_color0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
135 TFT_standard_color0:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
136 goto TFT_set_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
137
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
138
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
139 TFT_standard_color_dive:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
140 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
141 incf WREG
0
heinrichsweikamp
parents:
diff changeset
142 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
143 retlw color_scheme_divemode_std1 ;0
0
heinrichsweikamp
parents:
diff changeset
144 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
145 retlw color_scheme_divemode_std2 ;1
0
heinrichsweikamp
parents:
diff changeset
146 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
147 retlw color_scheme_divemode_std3 ;2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
148 retlw color_scheme_divemode_std4 ;3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
149
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
150
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
151 global TFT_color_code_tank_pres_sac
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
152 TFT_color_code_tank_pres_sac: ; color-code a tank pressure or SAC rate, data in hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
153 btfss hi,int_not_avail_flag ; is the not-available flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
154 bra TFT_color_code_tank_pres_1 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
155 bcf hi,int_not_avail_flag ; YES - clear not-available flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
156 TFT_color_code_tank_pres_0: ; entry point for outdated flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
157 bcf hi,int_outdated_flag ; clear outdated flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
158 bcf hi,int_warning_flag ; clear warning flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
159 bcf hi,int_attention_flag ; clear attention flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
160 bra TFT_disabled_color ; set to disabled color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
161 TFT_color_code_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
162 btfsc hi,int_outdated_flag ; is the outdated flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
163 bra TFT_color_code_tank_pres_0 ; YES - handle alike with not-available flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
164 TFT_color_code_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
165 btfss hi,int_warning_flag ; is the warning flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
166 bra TFT_color_code_tank_pres_3 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
167 bcf hi,int_warning_flag ; YES - clear warning flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
168 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
169 bra TFT_warnings_color ; - set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
170 TFT_color_code_tank_pres_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
171 btfss hi,int_attention_flag ; is the attention flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
172 bra TFT_memo_color ; NO - set to memo color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
173 bcf hi,int_attention_flag ; YES - clear attention flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
174 bra TFT_attention_color ; - set to attention color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
175
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
176
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
177 global TFT_color_code_gaslist
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
178 TFT_color_code_gaslist: ; color-code current row in gaslist (%O2 in hi) according to current amb_pressure
0
heinrichsweikamp
parents:
diff changeset
179 ; Check very high ppO2 manually
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
180 movff amb_press_10+0,xA+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
181 movff amb_press_10+1,xA+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
182 movff hi,xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
183 clrf xB+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
184 call mult16x16 ; hi * p_amb/10
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
185 ; Check if ppO2 > 6.55 bar
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
186 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2 > 6.55 bar ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
187 bra TFT_warnings_color ; YES - warn in warning color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
188 ; Check if ppO2 > 3.30 bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
189 btfsc xC+1,7
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
190 bra TFT_warnings_color ; YES - warn in warning color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
191 ; Check for low ppO2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
192 movff xC+0,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
193 movff xC+1,sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
194 movff char_I_ppO2_min,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
195 mullw d'100' ; char_I_ppO2_min*100
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
196 movff PRODL,sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
197 movff PRODH,sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
198 call subU16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
199 btfsc neg_flag ; lower than ppO2 min?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
200 bra TFT_warnings_color ; YES - set warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
201 ; Check for high ppO2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
202 movff char_O_deco_info,WREG ; bank-safe copy of deco info vector
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
203 btfsc WREG,deco_flag ; are we in deco?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
204 bra TFT_color_code_gaslist_deco ; YES - check against ppO2 max deco only
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
205 ; NO - check against ppO2 max travel/normal and deco
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
206 ; Check for ppO2 max travel/normal
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
207 movff char_I_ppO2_max,WREG ; ppo2 max for travel/normal
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
208 mullw d'100' ; char_I_ppO2_max*100
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
209 movff PRODL,sub_b+0
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
210 movff PRODH,sub_b+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
211 infsnz sub_b+0,F ; add 1 mbar to avoid warning on equal
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
212 incf sub_b+1,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
213 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
214 btfss neg_flag ; higher than ppO2 max travel/deco?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
215 rcall TFT_attention_color ; YES - set attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
216 ; Check for ppO2 max deco
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
217 TFT_color_code_gaslist_deco:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
218 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
219 mullw d'100' ; char_I_ppO2_max_deco*100
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
220 movff PRODL,sub_b+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
221 movff PRODH,sub_b+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
222 infsnz sub_b+0,F ; add 1 mbar to avoid warning on equal
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
223 incf sub_b+1,F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
224 call subU16 ; sub_c = sub_a - sub_b
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
225 btfss neg_flag ; higher than ppO2 max deco?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
226 bra TFT_warnings_color ; YES - set warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
227 return ; NO - keep current color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
228
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
229
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
230 TFT_color_code_ceiling: ; color-code the ceiling depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
231 btfsc hi,char_invalid_flag ; is the invalid flag set? (bit 7 here)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
232 bra TFT_color_code_ceiling_1 ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
233 SAFE_2BYTE_COPY rel_pressure,sub_a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
234 movff lo,sub_b+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
235 movff hi,sub_b+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
236 call subU16 ; sub_c = sub_a - sub_b : sub_c = rel_pressure [mbar] - int_O_ceiling [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
237 btfsc neg_flag ; is ceiling > current depth?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
238 bra TFT_warnings_color ; YES - set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
239 bra TFT_memo_color ; NO - set to memo color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
240 TFT_color_code_ceiling_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
241 bcf hi,char_invalid_flag ; clear the invalid flag (bit 7 here)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
242 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
243
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
244
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
245 TFT_color_code_stop: ; color-code the stop depth: memo color if below stop depth,
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
246 ; attention color if above stop but below ceiling,
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
247 ; warning color if above stop and ceiling
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
248 ; (ceiling depth is calculated using current GF)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
249 movff char_O_deco_gas+0,WREG ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
250 btfsc WREG,char_invalid_flag ; is the invalid flag set?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
251 bra TFT_disabled_color ; YES - set to disabled color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
252 movff char_O_first_deco_depth,WREG; NO - get stop depth in m into WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
253 subwf curr_depth,W ; - compute current depth - stop depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
254 btfsc STATUS,C ; - result negative?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
255 bra TFT_memo_color ; NO - set to memo color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
256 movff int_O_ceiling+0,sub_b+0 ; YES - get ceiling depth in mbar
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
257 movff int_O_ceiling+1,sub_b+1 ; - ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
258 btfsc sub_b+1,char_invalid_flag ; - is the invalid flag set? (bit 7 here)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
259 bra TFT_warnings_color ; YES - set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
260 SAFE_2BYTE_COPY rel_pressure,sub_a ; NO - get current depth in mbar
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
261 call subU16 ; - sub_c = sub_a - sub_b : sub_c = rel_pressure [cm] - int_O_ceiling [mbar => cm]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
262 btfsc neg_flag ; - is ceiling > current depth?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
263 bra TFT_warnings_color ; YES - set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
264 bra TFT_attention_color ; NO - set to attention color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
265
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
266
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
267 TFT_color_code_depth: ; with actual depth as rel_pressure in [mbar] in hi:lo and threshold depth_warn_mbar [mbar]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
268 movff lo,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
269 movff hi,sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
270 movlw LOW depth_warn_mbar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
271 movwf sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
272 movlw HIGH depth_warn_mbar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
273 movwf sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
274 call subU16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
275 TSTOSS opt_modwarning ; 0=standard, 1=blink
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
276 bra TFT_color_code_depth_std
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
277 btfss neg_flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
278 bra TFT_color_code_depth_warn ; set to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
279 bra TFT_color_code_depth_ppO2 ; check depth against MOD and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
280 TFT_color_code_depth_std:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
281 btfss neg_flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
282 bra TFT_warnings_color ; set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
283 bra TFT_memo_color ; set to memo color and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
284 TFT_color_code_depth_ppO2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
285 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
286 decfsz WREG,F ; are we in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
287 bra TFT_color_code_depth_no_ccr ; NO - continue checking for ppO2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
288 btfss FLAG_bailout_mode ; YES - check if in bailout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
289 bra TFT_color_code_depth_outside; NO - continue checking for outside ZHL16 model
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
290 TFT_color_code_depth_no_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
291 movff int_O_breathed_ppO2+1,WREG ; get upper byte of currently breathed ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
292 btfsc WREG,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
293 bra TFT_color_code_depth_warn ; YES - animate in warning design
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
294 TFT_color_code_depth_outside:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
295 movff char_O_deco_warnings,WREG ; bank-safe copy of deco warnings
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
296 btfsc WREG,outside_warning ; are we currently outside of the ZH-L16 model?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
297 bra TFT_color_code_depth_warn ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
298 btfsc WREG,outside_attention ; are we near to outside of the ZH-L16 model?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
299 bra TFT_color_code_depth_att ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
300 bcf blinking_depth_warning ; NO - terminate warning blinking
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
301 bcf blinking_depth_attention ; - terminate attention blinking
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
302 bra TFT_memo_color ; - set memo color and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
303 TFT_color_code_depth_warn:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
304 bsf blinking_depth_warning ; activate warning blinking
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
305 bra TFT_warnings_color ; set to warning color and return...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
306 TFT_color_code_depth_att:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
307 bsf blinking_depth_attention ; activate attention blinking
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
308 bra TFT_attention_color ; set to attention color and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
309
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
310
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
311 global TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
312 TFT_color_code_cns: ; color-code CNS values (CNS in hi:lo [%])
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
313 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
314 bra TFT_color_code_cns_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
315 bcf hi,int_invalid_flag ; YES - clear invalid flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
316 bcf hi,int_warning_flag ; clear warning flag (it may be set)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
317 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
318 bra TFT_disabled_color ; set to disabled color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
319 TFT_color_code_cns_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
320 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
321 bra TFT_color_code_cns_2 ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
322 bcf hi,int_warning_flag ; YES - clear warning flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
323 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
324 bra TFT_warnings_color ; - set to warning color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
325 TFT_color_code_cns_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
326 btfss hi,int_attention_flag ; is the attention flag set?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
327 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
328 bcf hi,int_attention_flag ; YES - clear attention flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
329 bra TFT_attention_color ; - set to attention color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
330
0
heinrichsweikamp
parents:
diff changeset
331
heinrichsweikamp
parents:
diff changeset
332 TFT_color_code_gf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
333 ; with int_O_gradient_factor, the upper byte is solely used for the flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
334 ; and not for the value, thus there is no need to clear the flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
335 btfsc hi,int_invalid_flag ; is the invalid flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
336 bra TFT_disabled_color ; YES - set to disabled color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
337 btfsc hi,int_warning_flag ; NO - is the warning flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
338 bra TFT_warnings_color ; YES - set to warning color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
339 btfsc hi,int_attention_flag ; NO - is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
340 bra TFT_attention_color ; YES - set to attention color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
341 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
342
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
343
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
344 TFT_color_code_ppo2: ; color-code ppO2 values (ppO2 in hi:lo [cbar]) by its warning flags
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
345 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
346 bra TFT_color_code_ppo2_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
347 bcf hi,int_warning_flag ; YES - clear warning flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
348 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
349 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
350 bcf hi,int_low_flag ; clear low warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
351 bra TFT_warnings_color ; warn in warning color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
352 TFT_color_code_ppo2_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
353 btfss hi,int_attention_flag ; is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
354 bra TFT_color_code_ppo2_2 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
355 bcf hi,int_attention_flag ; YES - clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
356 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
357 bcf hi,int_low_flag ; clear low warning flag (it may be set)
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
358 bra TFT_attention_color ; set to attention color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
359 TFT_color_code_ppo2_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
360 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
361 bcf hi,int_low_flag ; clear low warning flag (it may be set)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
362 bra TFT_memo_color ; set to memo color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
363
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
364
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
365 TFT_color_code_ppo2_hud: ; color-code ppO2 values (ppO2 in --:lo [cbar]) by its value
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
366 movff char_O_deco_info,WREG ; get the deco info vector
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
367 btfss WREG,deco_flag ; are we in deco?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
368 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
369 movff char_I_ppO2_max_deco,WREG ; YES - load deco value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
370 bra TFT_color_code_ppo2_hud_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
371 TFT_color_code_ppo2_hud_a:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
372 movff char_I_ppO2_max,WREG ; ppO2 max while not in deco
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
373 TFT_color_code_ppo2_hud_b:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
374 cpfsgt lo ; lo > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
375 bra TFT_color_code_ppo2_hud1 ; NO - continue with checking for ppO2 low
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
376 bra TFT_warnings_color ; YES - set warning color and return
0
heinrichsweikamp
parents:
diff changeset
377 TFT_color_code_ppo2_hud1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
378 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
379 decfsz WREG,F ; now: 0=CC, 1=Gauge, 2=Apnea, 3=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
380 bra TFT_color_code_ppo2_hud_nocc; not CCR...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
381 btfsc FLAG_bailout_mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
382 bra TFT_color_code_ppo2_hud_nocc; is bailout, hence not loop mode...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
383 movff char_I_ppO2_min_loop,WREG ; ppO2 min loop mode color coding
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
384 bra TFT_color_code_ppo2_hud_cont
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
385 TFT_color_code_ppo2_hud_nocc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
386 movff char_I_ppO2_min,WREG ; PPO2 min for all other modes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
387 TFT_color_code_ppo2_hud_cont:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
388 cpfslt lo ; lo < char_I_ppO2_min?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
389 bra TFT_memo_color ; NO - set memo color and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
390 bra TFT_warnings_color ; Yes - set warning color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
391
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
392
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
393 TFT_color_code_battery: ; color-code the battery display, with battery percent in lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
394 movlw color_code_battery_low ; get warning threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
395 cpfsgt lo ; is battery percent < threshold?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
396 bra TFT_warnings_color ; YES - set to warning color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
397 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
398
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
399
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
400 global TFT_color_code_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
401 TFT_color_code_gas: ; color-code the output according to gas number (1-6) in WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
402 movwf up ; copy gas number (1-6) to up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
403 movlw color_white ; Default color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
404 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
405 movlw color_white ; color for gas 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
406 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
407 movlw color_green ; color for gas 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
408 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
409 movlw color_red ; color for gas 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
410 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
411 movlw color_yellow ; color for gas 4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
412 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
413 movlw color_cyan ; color for gas 5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
414 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
415 movlw color_pink ; color for gas 6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
416 goto TFT_set_color ; set color...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
417
0
heinrichsweikamp
parents:
diff changeset
418
heinrichsweikamp
parents:
diff changeset
419 ; ****************************************************************************
heinrichsweikamp
parents:
diff changeset
420
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
421 global TFT_show_OC_startgas_surface
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
422 TFT_show_OC_startgas_surface: ; show first gas and "OSTC2-like" active gases
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
423 ; Show first gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
424 WIN_SMALL surf_decotype_column+.1,surf_decotype_row+.30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
425 call get_first_gas_to_WREG ; get first gas (1-5) into WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
426 decf WREG,W ; 1-5 -> 0-4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
427 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
428 call gaslist_strcat_gas ; input: PRODL : gas number (0..4), Output: Text appended into buffer pointed by FSR2.
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
429 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
430 ; Show boxes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
431 WIN_TOP surf_decotype_row+.30+.25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
432 WIN_LEFT surf_decotype_boxes_left1+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
433 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
434 movff opt_gas_type+0,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
435 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
436 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
437 STRCPY_PRINT "1"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
438 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
439 bra DISP_active_gas_surfmode3 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
440 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left1, surf_decotype_boxes_left1+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
441 DISP_active_gas_surfmode3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
442 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
443 movff opt_gas_type+1,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
444 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
445 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
446 WIN_LEFT surf_decotype_boxes_left2+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
447 STRCPY_PRINT "2"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
448 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
449 bra DISP_active_gas_surfmode4 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
450 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left2, surf_decotype_boxes_left2+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
451 DISP_active_gas_surfmode4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
452 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
453 movff opt_gas_type+2,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
454 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
455 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
456 WIN_LEFT surf_decotype_boxes_left3+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
457 STRCPY_PRINT "3"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
458 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
459 bra DISP_active_gas_surfmode5 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
460 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left3, surf_decotype_boxes_left3+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
461 DISP_active_gas_surfmode5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
462 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
463 movff opt_gas_type+3,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
464 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
465 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
466 WIN_LEFT surf_decotype_boxes_left4+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
467 STRCPY_PRINT "4"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
468 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
469 bra DISP_active_gas_surfmode6 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
470 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left4, surf_decotype_boxes_left4+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
471 DISP_active_gas_surfmode6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
472 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
473 movff opt_gas_type+4,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
474 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
475 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
476 WIN_LEFT surf_decotype_boxes_left5+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
477 STRCPY_PRINT "5"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
478 rcall TFT_standard_color ; reset color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
479 decfsz hi,F ; type = 1 (First)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
480 bra DISP_active_gas_surfmode7 ; NO - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
481 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left5, surf_decotype_boxes_left5+.8 ;top, bottom, left, right
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
482 DISP_active_gas_surfmode7:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
483 return ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
484
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
485
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
486 global TFT_show_color_schemes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
487 TFT_show_color_schemes: ; update the color schemes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
488 bsf divemode ; put in divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
489 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
490 WIN_TINY .12,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
491 STRCAT_TEXT_PRINT tDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
492 WIN_TINY .62,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
493 STRCAT_TEXT_PRINT tMaxDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
494 WIN_TINY .122,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
495 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
496
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
497 ; Show some demo screen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
498
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
499 ; Depth demo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
500 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
501 WIN_MEDIUM .3,.54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
502 movlw LOW .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
503 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
504 movlw HIGH .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
505 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
506 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
507 bsf ignore_digit4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
508 output_16 ; full meters in big font
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
509 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
510 STRCAT_PRINT "" ; display full meters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
511 WIN_SMALL .25,.66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
512 movlw LOW .5172
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
513 movwf lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
514 movlw HIGH .5172
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
515 movwf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
516 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
517 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
518 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
519 bsf ignore_digit5 ; (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
520 output_16dp d'0' ; .1m in SMALL font
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
521 STRCAT_PRINT "" ; display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
522 WIN_FONT FT_SMALL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
523
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
524 ; Max. Depth demo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
525 WIN_MEDIUM .64,.54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
526 bsf ignore_digit4 ; no 0.1m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
527 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
528 movlw LOW .6349
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
529 movwf lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
530 movlw HIGH .6349
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
531 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
532 output_16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
533 STRCAT_PRINT "" ; display full meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
534 bcf leftbind
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
535 ; .1m in SMALL font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
536 WIN_SMALL .87,.66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
537 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
538 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
539 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
540 bsf ignore_digit5 ; (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
541 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
542 movlw LOW .6349
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
543 movwf lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
544 movlw HIGH .6349
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
545 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
546 output_16dp d'0'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
547 STRCAT_PRINT "" ; display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
548 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
549
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
550 ; Divetime demo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
551 movff mins,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
552 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
553 WIN_MEDIUM .103, .54
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
554 output_16_3 ; limit to 999 and display only (0-999)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
555 STRCAT_PRINT "" ; show minutes in large font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
556 WIN_SMALL .139, .66 ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
557 PUTC ':'
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
558 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
559 movff secs,lo
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
560 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
561 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
562 STRCAT_PRINT "" ; show seconds in small font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
563
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
564 bcf divemode ; don't stay in divemode
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
565 return
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
566
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
567
0
heinrichsweikamp
parents:
diff changeset
568 global TFT_divemode_mask
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
569 TFT_divemode_mask: ; displays mask in divemode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
570 bcf FLAG_TFT_divemode_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
571 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
572 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
573 STRCAT_TEXT_PRINT tDepth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
574 WIN_TINY dm_mask_maxdepth_column_nvsi,dm_mask_maxdepth_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
575 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
576 bra TFT_divemode_mask_1 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
577 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row ; YES - adopt position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
578 TFT_divemode_mask_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
579 btfsc FLAG_apnoe_mode ; in Apnea mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
580 bra TFT_divemode_mask_2 ; YES - draw max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
581 TSTOSS opt_2ndDepthDisp ; draw avg depth?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
582 bra TFT_divemode_mask_2 ; NO - draw max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
583 STRCAT_TEXT_PRINT tAvgDepth ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
584 bra TFT_divemode_mask_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
585 TFT_divemode_mask_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
586 STRCAT_TEXT_PRINT tMaxDepth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
587 TFT_divemode_mask_3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
588 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
589 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
590 bra TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
591
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
592 global TFT_divemode_mask_alternative
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
593 TFT_divemode_mask_alternative: ; alt. mask for divemode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
594 bcf FLAG_TFT_divemode_mask_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
595 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
596 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
597 STRCAT_TEXT_PRINT tDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
598 WIN_TINY dm_mask_divetime_column-.30,dm_mask_divetime_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
599 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
600 bra TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
601
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
602 global TFT_draw_gassep_line
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
603 TFT_draw_gassep_line:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
604 btfsc FLAG_apnoe_mode ; ignore in Apnoe mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
605 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
606 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
607 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
608 bra TFT_standard_color ; NO - set standard color and return
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
609
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
610 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
611
0
heinrichsweikamp
parents:
diff changeset
612 global TFT_display_velocity
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
613 TFT_display_velocity: ; with divA+0 = m/min, neg_flag_velocity: ascend=1, descend=0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
614 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
615 movlw velocity_display_threshold_1; lowest threshold for display vertical velocity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
616 subwf divA+0,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
617 btfss STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
618 bra TFT_velocity_clear ; lower then threshold. Clear text and graph (If active)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
619
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
620 ; We have something to display
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
621 bsf display_velocity ; set flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
622 ; check if descending: no warning color if descending
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
623 rcall TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
624 btfsc neg_flag_velocity ; ignore for descent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
625 rcall TFT_velocity_set_color ; set color for text and set threshold for graph
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
626
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
627 rcall TFT_velocity_disp ; show the text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
628
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
629 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
630 bra TFT_display_velocity_done ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
631
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
632 btfsc alternative_divelayout ; alternative layout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
633 bra TFT_display_velocity_done ; YES - no graph! (no room when divetime minutes is three digits)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
634
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
635 btfsc neg_flag_velocity ; ignore for descent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
636 rcall TFT_velocity_graph ; show the graph
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
637 btfss neg_flag_velocity ; ignore for descent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
638 rcall TFT_velocity_clear_graph ; clear the graph for descent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
639
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
640 TFT_display_velocity_done:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
641 bra TFT_standard_color ; and return!
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
642
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
643 TFT_speed_table:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
644 ; use a depth-dependent ascent rate warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
645 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
646 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
647 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
648 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning)
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
649 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention)
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
650
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
651 ; <xx m, warning speed, attention speed, unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
652 DB .6,.7,.5,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
653 DB .12,.8,.6,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
654 DB .18,.9,.7,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
655 DB .23,.10,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
656 DB .27,.11,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
657 DB .31,.13,.10,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
658 DB .35,.15,.12,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
659 DB .39,.17,.13,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
660 DB .44,.18,.14,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
661 DB .50,.19,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
662 DB .200,.20,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
663
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
664 TFT_velocity_set_color: ; Set color based on speed table or use static thresholds, with divA+0 = m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
665 ; check if old/new ascend logic is used
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
666 TSTOSS opt_vsitextv2 ; 0=standard, 1=dynamic
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
667 bra TFT_velocity_set_color_static ; static ascend rate limit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
668
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
669 ; point to speed table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
670 movlw LOW (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
671 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
672 movlw HIGH (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
673 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
674 movlw UPPER (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
675 movwf TBLPTRU
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
676
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
677 TFT_velocity_set_color_skip:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
678 TBLRD*+ ; 3 dummy reads
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
679 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
680 TBLRD*+
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
681 TBLRD*+ ; get speed threshold
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
682 movf curr_depth,W ; current depth in m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
683 cpfsgt TABLAT ; threshold > current depth ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
684 bra TFT_velocity_set_color_skip ; NO - loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
685
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
686 TBLRD*+ ; get warning speed threshold
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
687 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
688 movwf divA+1 ; copy for graph routine
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
689 cpfslt divA+0 ; smaller then actual value (in m/min)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
690 bra TFT_warnings_color ; set Warning color (And return)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
691 TBLRD*+ ; get attention speed threshold
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
692 movf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
693 cpfslt divA+0 ; smaller then actual value (in m/min)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
694 bra TFT_attention_color ; NO - set attention color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
695 bra TFT_memo_color ; YES - set memo color and return
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
696
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
697 TFT_velocity_set_color_static:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
698 movlw color_code_velocity_warn_high ; in m/min
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
699 movwf divA+1 ; copy for graph routine
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
700 cpfslt divA+0 ; smaller then actual value (in m/min)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
701 bra TFT_warnings_color ; set Warning color (And return)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
702 movlw color_code_velocity_attn_high ; in m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
703 cpfslt divA+0 ; smaller then actual value (in m/min)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
704 bra TFT_attention_color ; NO - set attention color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
705 bra TFT_memo_color ; YES - set memo color and return
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
706
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
707 TFT_velocity_disp:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
708 WIN_SMALL dm_velocity_text_column, dm_velocity_text_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
709 TSTOSS opt_units ; 0=Meters, 1=Feets
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
710 bra TFT_velocity_metric
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
711 ;TFT_velocity_imperial:
0
heinrichsweikamp
parents:
diff changeset
712 movff divA+0,WREG ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
713 mullw .100 ; PRODL:PRODH = mbar/min
heinrichsweikamp
parents:
diff changeset
714 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
715 movff PRODH,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
716 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
717 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
718 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
719 movlw '+'
heinrichsweikamp
parents:
diff changeset
720 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
721 bsf leftbind
heinrichsweikamp
parents:
diff changeset
722 output_16
heinrichsweikamp
parents:
diff changeset
723 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
724 STRCAT_TEXT_PRINT tVelImperial ; unit switch
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
725 return
0
heinrichsweikamp
parents:
diff changeset
726
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
727 TFT_velocity_metric:
0
heinrichsweikamp
parents:
diff changeset
728 movff divA+0,lo ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
729 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
730 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
731 movlw '+'
heinrichsweikamp
parents:
diff changeset
732 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
733 output_99
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
734 STRCAT_TEXT_PRINT tVelMetric ; unit switch
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
735 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
736
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
737 TFT_velocity_graph: ; divA+0 = m/min
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
738 ; divA+0 holding the ascend speed in m/min
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
739 movff divA+0,hi ; copy
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
740 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right -> outer frame
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
741 rcall TFT_divemask_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
742 WIN_FRAME_COLOR dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;inner frame
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
743 rcall TFT_divemask_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
744 WIN_FRAME_COLOR dm_velobar_top+.10, dm_velobar_bot-.10, dm_velobar_lft, dm_velobar_rgt ;inner frame
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
745 rcall TFT_divemask_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
746 WIN_FRAME_COLOR dm_velobar_top+.20, dm_velobar_bot-.20, dm_velobar_lft, dm_velobar_rgt ;inner frame
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
747 rcall TFT_divemask_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
748 WIN_FRAME_COLOR dm_velobar_top+.30, dm_velobar_bot-.30, dm_velobar_lft, dm_velobar_rgt ;inner frame
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
749
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
750 movff divA+1,xA+0 ; m/min for warning level (upper two blocks)
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
751 clrf xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
752 movlw .5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
753 movwf xB+0 ; threshold for color warning (5 color normal + 2 color warning)
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
754 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
755 call div16x16 ; xC = xA / xB with xA as remainder
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
756 ; xC+0 holds step size in m/min (e.g. =3 for 15m/min warning threshold)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
757 movff hi,xA+0 ; velocity in m/min
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
758 clrf xA+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
759 movff xC+0,xB+0 ; step size
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
760 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
761 call div16x16 ; xC = xA / xB with xA as remainder
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
762 ; xC+0 now holds amount of segments to show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
763 movff hi,divA+0 ; copy back for numeric output
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
764 movlw d'7'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
765 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
766 bra DISP_graph_vel_7
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
767 movlw d'6'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
768 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
769 bra DISP_graph_vel_6
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
770 movlw d'5'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
771 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
772 bra DISP_graph_vel_5
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
773 movlw d'4'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
774 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
775 bra DISP_graph_vel_4
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
776 movlw d'3'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
777 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
778 bra DISP_graph_vel_3
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
779 movlw d'2'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
780 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
781 bra DISP_graph_vel_2
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
782 movlw d'1'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
783 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
784 bra DISP_graph_vel_1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
785 bra DISP_graph_vel_0 ; should not happen...
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
786
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
787 DISP_graph_vel_7:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
788 rcall TFT_warnings_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
789 WIN_BOX_COLOR dm_velobar_top+.2, dm_velobar_top+.8, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
790 DISP_graph_vel_6:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
791 rcall TFT_warnings_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
792 WIN_BOX_COLOR dm_velobar_top+.12, dm_velobar_top+.18, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
793 DISP_graph_vel_5:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
794 rcall TFT_attention_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
795 WIN_BOX_COLOR dm_velobar_top+.22, dm_velobar_top+.28, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
796 DISP_graph_vel_4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
797 rcall TFT_standard_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
798 WIN_BOX_COLOR dm_velobar_top+.32, dm_velobar_top+.38, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
799 DISP_graph_vel_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
800 rcall TFT_standard_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
801 WIN_BOX_COLOR dm_velobar_top+.42, dm_velobar_top+.48, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
802 DISP_graph_vel_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
803 rcall TFT_standard_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
804 WIN_BOX_COLOR dm_velobar_top+.52, dm_velobar_top+.58, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
805 DISP_graph_vel_1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
806 rcall TFT_standard_color_dive ; color -> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
807 WIN_BOX_COLOR dm_velobar_top+.62, dm_velobar_top+.68, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
808 DISP_graph_vel_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
809 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
810
326
d21b172d5a7a VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents: 321
diff changeset
811
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
812 global TFT_velocity_clear
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
813 TFT_velocity_clear:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
814 btfss display_velocity ; velocity was not displayed, do not delete
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
815 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
816 bcf display_velocity ; velocity was displayed, delete velocity now
0
heinrichsweikamp
parents:
diff changeset
817 ; Clear Text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
818 WIN_BOX_BLACK dm_velocity_text_row, dm_velocity_text_bot, dm_velocity_text_column, dm_velocity_text_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
819
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
820 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
821 return ; NO - no graph to clear
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
822 TFT_velocity_clear_graph:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
823 ; Clear Graph
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
824 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
825 return
heinrichsweikamp
parents:
diff changeset
826
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
827 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
828
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
829 global TFT_clear_decoarea
0
heinrichsweikamp
parents:
diff changeset
830 TFT_clear_decoarea:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
831 WIN_BOX_BLACK dm_decostop_1st_stop_row, .239, dm_decostop_1st_stop_column, .159 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
832 return
heinrichsweikamp
parents:
diff changeset
833
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
834
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
835 global TFT_clear_divemode_menu
0
heinrichsweikamp
parents:
diff changeset
836 TFT_clear_divemode_menu:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
837 WIN_BOX_BLACK dm_menu_row-.2, dm_menu_lower, dm_menu_left, dm_menu_right ; top, bottom, left, right - starts 2 pixel higher to completely wipe away the temperature display
0
heinrichsweikamp
parents:
diff changeset
838 return
heinrichsweikamp
parents:
diff changeset
839
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
840
0
heinrichsweikamp
parents:
diff changeset
841 global TFT_display_ndl_mask
heinrichsweikamp
parents:
diff changeset
842 TFT_display_ndl_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
843 bcf FLAG_TFT_display_ndl_mask
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
844 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
845 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
846 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
847 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
848 call TFT_clear_decoarea ; NO - clear stop depth and TTS
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
849 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
850 WIN_STD dm_ndl_text_column, dm_ndl_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
851 STRCPY_TEXT_PRINT tNDL ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
852 bra TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
853
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
854
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
855 global TFT_display_tts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
856 TFT_display_tts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
857 bcf FLAG_TFT_display_tts
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
858 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
859 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
860 call TFT_memo_color ; NO - set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
861 movff int_O_ascenttime+0,lo ; - TTS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
862 movff int_O_ascenttime+1,hi ; - on 16 bits
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
863 btfss hi,int_invalid_flag ; - is the invalid flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
864 bra TFT_display_tts_1 ; - NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
865 bcf hi,int_invalid_flag ; - YES - clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
866 call TFT_disabled_color ; - switch to disabled color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
867 TFT_display_tts_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
868 WIN_MEDIUM dm_tts_value_column, dm_tts_value_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
869 output_16_3 ; display only 0...999
0
heinrichsweikamp
parents:
diff changeset
870 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
871 return
heinrichsweikamp
parents:
diff changeset
872
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
873
0
heinrichsweikamp
parents:
diff changeset
874 global TFT_display_ndl
heinrichsweikamp
parents:
diff changeset
875 TFT_display_ndl:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
876 bcf FLAG_TFT_display_ndl
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
877 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
878 return ; YES - return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
879 WIN_MEDIUM dm_ndl_value_column, dm_ndl_value_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
880 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
881 movff char_O_nullzeit,lo ; get NDL from C-code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
882 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
883 STRCAT_PRINT "'"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
884 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
885
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
886
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
887 global TFT_big_deco_alt ; the big deco
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
888 TFT_big_deco_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
889 bcf FLAG_TFT_big_deco_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
890
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
891 btfss decostop_active ; deco stop shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
892 bra TFT_big_deco_ndl_alt ; NO - show NDL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
893
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
894 ; Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
895 bcf FLAG_TFT_display_deko
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
896 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
897 WIN_STD .70,.165
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
898 STRCPY_TEXT_PRINT tTTS ; TTS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
899 rcall TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
900
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
901 ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
902 WIN_LARGE .97,.170
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
903 movff int_O_ascenttime+0,lo ; get the TTS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
904 movff int_O_ascenttime+1,hi ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
905 btfss hi,int_invalid_flag ; is the invalid flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
906 bra TFT_display_tts_alt_1 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
907 bcf hi,int_invalid_flag ; YES - clear flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
908 call TFT_disabled_color ; - switch to disabled color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
909 TFT_display_tts_alt_1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
910 output_16_3 ; display only 0...999
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
911 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
912
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
913 ; 1st Stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
914 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
915 WIN_STD .25,dm_customview_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
916 STRCPY_TEXT_PRINT tDiveSafetyStop ; "Stop"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
917
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
918 WIN_LARGE .60,.95
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
919 call TFT_color_code_stop ; color-code output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
920 movff char_O_first_deco_depth,lo ; stop depth in m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
921 rcall TFT_display_deko_output_depth ; output depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
922 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
923
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
924 ; m or ft after the stop depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
925 WIN_MEDIUM .100,.118
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
926 TSTOSS opt_units ; 0=m, 1=ft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
927 bra TFT_display_tts_alt_1_metric
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
928 STRCAT_TEXT_PRINT tFeets1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
929 bra TFT_display_tts_alt_1_com
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
930 TFT_display_tts_alt_1_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
931 STRCAT_TEXT_PRINT tMeters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
932 TFT_display_tts_alt_1_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
933 WIN_LARGE .117,.95
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
934 movff char_O_first_deco_time,lo ; get stop time in minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
935 tstfsz lo ; stop time = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
936 bra TFT_display_tts_alt_2 ; NO - print time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
937 STRCAT_PRINT ".." ; YES - special treatment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
938 bra TFT_display_tts_alt_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
939 TFT_display_tts_alt_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
940 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
941 output_99
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
942 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
943 TFT_display_tts_alt_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
944 goto TFT_standard_color ; and return...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
945
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
946
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
947 TFT_big_deco_ndl_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
948 ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
949 bcf FLAG_TFT_display_ndl
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
950 bcf decostop_active ; clear flag (again)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
951 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
952 bra TFT_big_deco_ndl_alt_1 ; YES - skip NDL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
953 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
954 WIN_STD .70,.165
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
955 STRCPY_TEXT_PRINT tNDL ; NDL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
956 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
957 WIN_LARGE .97,.170
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
958 movff char_O_nullzeit,lo ; get NDL from C-code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
959 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
960 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
961 TFT_big_deco_ndl_alt_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
962 btfsc FLAG_TFT_show_safety_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
963 bra TFT_show_safety_stop_alt ; show safety stop (and return)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
964 ; Clear any safety stop or Decostop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
965 TFT_no_more_safety_stop_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
966 WIN_BOX_BLACK dm_customview_row, .150, .0, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
967 WIN_BOX_BLACK dm_customview_row, .164, .60, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
968 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
969
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
970 TFT_show_safety_stop_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
971 bcf FLAG_TFT_show_safety_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
972 tstfsz safety_stop_countdown ; countdown at zero?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
973 bra TFT_show_safety_stop_alt2 ; NO - show stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
974 bcf show_safety_stop ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
975 btfss safety_stop_active ; displayed?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
976 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
977 bcf safety_stop_active ; YES - clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
978 bra TFT_no_more_safety_stop_alt ; - clear stop and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
979
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
980 TFT_show_safety_stop_alt2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
981 bsf safety_stop_active ; set flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
982 decf safety_stop_countdown,F ; reduce countdown
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
983
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
984 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
985 WIN_STD .50,dm_customview_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
986 STRCPY_TEXT_PRINT tDiveSafetyStop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
987 call TFT_attention_color ; show in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
988 WIN_LARGE .90,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
989 movff safety_stop_countdown,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
990 clrf hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
991 call convert_time ; converts hi:lo in seconds to mins (up:hi) and seconds (lo)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
992 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
993 movff lo,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
994 movwf lo ; exchange lo and hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
995 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
996 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
997 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
998 WIN_MEDIUM .112,.120
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
999 STRCAT_PRINT ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1000 WIN_LARGE .117,.95
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1001 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1002 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1003 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1004 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1005 WIN_FONT FT_SMALL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1006 bra TFT_display_exit_1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1007
0
heinrichsweikamp
parents:
diff changeset
1008
heinrichsweikamp
parents:
diff changeset
1009 global TFT_divemode_warning
heinrichsweikamp
parents:
diff changeset
1010 TFT_divemode_warning:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1011 bcf FLAG_TFT_divemode_warning ; clear job flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1012 bsf dive_warning_displayed ; set advice/attention/warning sign is shown flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1013 WIN_TOP dm_warning_icon_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1014 WIN_LEFT dm_warning_icon_column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1015 btfsc message_warning ; do we have a warning?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1016 bra TFT_divemode_warning_1 ; YES - show warning sign
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1017 btfsc message_attention ; NO - do we have an attention?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1018 bra TFT_divemode_warning_2 ; YES - show attention sign
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1019 bra TFT_divemode_warning_3 ; NO to both - must be an advice then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1020
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1021 dive_warning2_warning_colors: ; custom colors table for dive_warning2 icon - warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1022 db .4, 0 ; #colors, spare
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1023 dw 0x0000 ; color 0x00: outside black
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1024 dw 0xff80 ; color 0x01: triangle yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1025 dw 0xff80 ; color 0x02: excl.mark yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1026 dw 0xf800 ; color 0x03: inside red
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1027
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1028 dive_warning2_advice_colors: ; custom colors table for dive_warning2 icon - advice
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1029 db .4, 0 ; #colors, spare
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1030 dw 0x0000 ; color 0x00: outside black
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1031 dw 0xffff ; color 0x01: triangle white
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1032 dw 0xffff ; color 0x02: excl.mark white
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1033 dw 0x0780 ; color 0x03: inside green
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1034
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1035 TFT_divemode_warning_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1036 TFT_WRITE_PROM_IMAGE_CUST_COLOR dive_warning2_warning_colors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1037 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; output warning sign (with custom colors)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1038 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1039 TFT_divemode_warning_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1040 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; output attention sign (with default colors)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1041 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1042 TFT_divemode_warning_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1043 TFT_WRITE_PROM_IMAGE_CUST_COLOR dive_warning2_advice_colors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1044 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; output advice sign (with custom colors)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1045 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1046
0
heinrichsweikamp
parents:
diff changeset
1047
heinrichsweikamp
parents:
diff changeset
1048 global TFT_divemode_warning_clear
heinrichsweikamp
parents:
diff changeset
1049 TFT_divemode_warning_clear:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1050 bcf FLAG_TFT_divemode_warning_clear ; clear job flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1051 btfss dive_warning_displayed ; advice/attention/warning sign is shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1052 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1053 bcf dive_warning_displayed ; YES - clear advice/attention/warning sign and its flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1054 WIN_BOX_BLACK dm_warning_icon_row, dm_warning_icon_bot, dm_warning_icon_column, dm_warning_icon_rgt ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1055 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1056
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1057
0
heinrichsweikamp
parents:
diff changeset
1058 global TFT_display_deko_mask
heinrichsweikamp
parents:
diff changeset
1059 TFT_display_deko_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1060 bcf FLAG_TFT_display_deko_mask
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1061 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1062 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1063 rcall TFT_clear_decoarea ; clear decostop and decosum (and NDL in this case)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1064 WIN_STD dm_tts_text_column, dm_tts_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1065 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1066 STRCPY_TEXT_PRINT tTTS ; TTS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1067 bcf show_safety_stop ; clear safety stop flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1068 bra TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1069
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1070
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1071 TFT_display_deko_output_depth: ; output depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
0
heinrichsweikamp
parents:
diff changeset
1072 TSTOSS opt_units ; 0=m, 1=ft
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1073 bra TFT_display_deko_output_metric
0
heinrichsweikamp
parents:
diff changeset
1074 ;TFT_display_deko_output_imperial:
heinrichsweikamp
parents:
diff changeset
1075 movf lo,W ; lo = m
heinrichsweikamp
parents:
diff changeset
1076 mullw .100 ; PRODL:PRODH = mbar
heinrichsweikamp
parents:
diff changeset
1077 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
1078 movff PRODH,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1079 ; Convert with 334feet/100m to have 10ft, 20ft, 30ft stops...
0
heinrichsweikamp
parents:
diff changeset
1080 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
1081 movff hi,xA+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1082 movlw LOW d'334' ; 334feet/100m
0
heinrichsweikamp
parents:
diff changeset
1083 movwf xB+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1084 movlw HIGH d'334'
0
heinrichsweikamp
parents:
diff changeset
1085 movwf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1086 call mult16x16 ; xA*xB=xC (lo:hi * 328)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1087 movlw d'50' ; round up
0
heinrichsweikamp
parents:
diff changeset
1088 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
1089 movlw 0
heinrichsweikamp
parents:
diff changeset
1090 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
1091 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
1092 addwfc xC+3,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1093 movlw d'100'
0
heinrichsweikamp
parents:
diff changeset
1094 movwf xB+0
heinrichsweikamp
parents:
diff changeset
1095 clrf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1096 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
1097 movff xC+0,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1098 movff xC+1,hi ; restore lo and hi with updated value
0
heinrichsweikamp
parents:
diff changeset
1099 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1100 btfsc alternative_divelayout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1101 bsf leftbind ; left for alternative layout mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1102 bsf ignore_digit4 ; only full feet
0
heinrichsweikamp
parents:
diff changeset
1103 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1104 btfsc alternative_divelayout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1105 return ; not for alternative layout mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1106 STRCAT_TEXT tFeets1
0
heinrichsweikamp
parents:
diff changeset
1107 return
heinrichsweikamp
parents:
diff changeset
1108
heinrichsweikamp
parents:
diff changeset
1109 TFT_display_deko_output_metric:
heinrichsweikamp
parents:
diff changeset
1110 output_99
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1111 btfsc alternative_divelayout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1112 return ; not for alternative layout mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1113 STRCAT_TEXT tMeters
0
heinrichsweikamp
parents:
diff changeset
1114 PUTC ' '
heinrichsweikamp
parents:
diff changeset
1115 return
heinrichsweikamp
parents:
diff changeset
1116
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1117
0
heinrichsweikamp
parents:
diff changeset
1118 global TFT_display_deko
heinrichsweikamp
parents:
diff changeset
1119 TFT_display_deko:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1120 bcf FLAG_TFT_display_deko
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1121 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1122 return ; YES - return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1123 WIN_MEDIUM dm_decostop_1st_stop_column, dm_decostop_1st_stop_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1124 call TFT_color_code_stop ; color-code output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1125 movff char_O_first_deco_depth,lo ; stop depth in m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1126 rcall TFT_display_deko_output_depth ; output depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1127 movff char_O_first_deco_time,lo ; get stop time in minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1128 tstfsz lo ; stop time = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1129 bra TFT_display_deko_1 ; NO - print minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1130 STRCAT_PRINT " ..'" ; YES - special treatment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1131 bra TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1132 TFT_display_deko_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1133 output_99 ; output lo
0
heinrichsweikamp
parents:
diff changeset
1134 STRCAT_PRINT "'"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1135 TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1136 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1137
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1138
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1139 global TFT_decoplan_mask ; mask for deco plan
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1140 TFT_decoplan_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1141 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1142 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1143 STRCPY_TEXT_PRINT tDiveDecoplan
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1144 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1145
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1146 global TFT_decoplan ; data for deco plan - stops 2 - 7 (stop 1 is shown in the main screen)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1147 TFT_decoplan:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1148 lfsr FSR0,char_O_deco_depth ; load base address of stops table
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1149 clrf ex ; will be used for auxiliary flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1150 call TFT_memo_color ; set default output color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1151 movff char_O_deco_gas+0,lo ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1152 btfsc lo,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1153 call TFT_disabled_color ; YES - set to disabled color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1154 ; 2nd stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1155 WIN_SMALL dm_cust_dstop_2nd_stop_column, dm_cust_dstop_2nd_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1156 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1157 ; 3rd stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1158 WIN_SMALL dm_cust_dstop_3rd_stop_column, dm_cust_dstop_3rd_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1159 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1160 ; 4th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1161 bsf ex,4 ; flag we are on 4th screen position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1162 WIN_SMALL dm_cust_dstop_4th_stop_column, dm_cust_dstop_4th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1163 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1164 bcf ex,4 ; clear 4th position flag again
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1165 ; 5th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1166 WIN_SMALL dm_cust_dstop_5th_stop_column, dm_cust_dstop_5th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1167 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1168 ; 6th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1169 WIN_SMALL dm_cust_dstop_6th_stop_column, dm_cust_dstop_6th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1170 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1171 ; 7th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1172 WIN_SMALL dm_cust_dstop_7th_stop_column, dm_cust_dstop_7th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1173 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1174 bra TFT_display_exit_1 ; set standard color and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1175
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1176 TFT_decoplan_helper:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1177 btfsc ex,0 ; no more stops to show?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1178 bra TFT_decoplan_helper_1 ; YES - skip checking next entry - it will be empty, too
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1179 movff PREINC0,lo ; NO - advance pointer to get the depth of the 2nd, 3rd, 4th, ... stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1180 tstfsz lo ; is the stop depth = 0, i.e. no stop entry?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1181 bra TFT_decoplan_helper_3 ; NO - show stop data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1182 TFT_decoplan_helper_1: ; no more stop table entries
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1183 bsf ex,0 ; flag that there are no more stop table entries
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1184 btfss ex,4 ; are we on the 4th screen position?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1185 bra TFT_decoplan_helper_2 ; NO - normal handling on this position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1186 btfsc ex,1 ; YES - special handling, has any stop been shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1187 bra TFT_decoplan_helper_2 ; YES - print normal blanking
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1188 STRCPY_PRINT " ---- " ; NO - print a "no stops" indication (blanking potential previous content, too)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1189 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1190 TFT_decoplan_helper_2: ; no more stop table entries, blank potential previous content
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1191 STRCPY_PRINT " " ; wipe screen position by printing 7 spaces
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1192 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1193 TFT_decoplan_helper_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1194 rcall TFT_display_deko_output_depth ; output depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1195 movlw NUM_STOPS ; offset between arrays holding depths and durations
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1196 movff PLUSW0,lo ; get duration of the current stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1197 output_99 ; output duration to POSTINC2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1198 STRCAT_PRINT "'" ; append symbol for minutes and print to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1199 bsf ex,1 ; flag that a stop was shown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1200 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1201
0
heinrichsweikamp
parents:
diff changeset
1202
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1203 global TFT_clear_safety_stop
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1204 TFT_clear_safety_stop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1205 bcf FLAG_TFT_clear_safety_stop ; clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1206 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1207 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1208
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1209 global TFT_show_safety_stop
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1210 TFT_show_safety_stop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1211 bcf FLAG_TFT_show_safety_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1212 tstfsz safety_stop_countdown ; countdown at zero?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1213 bra TFT_show_safety_stop2 ; NO - show stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1214 bcf show_safety_stop ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1215 btfss safety_stop_active ; displayed?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1216 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1217 bcf safety_stop_active ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1218 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1219 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1220 bra TFT_clear_safety_stop ; NO - clear stop and return...
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1221 TFT_show_safety_stop2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1222 bsf safety_stop_active ; set flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1223 decf safety_stop_countdown,F ; reduce countdown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1224 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1225 return ; YES - return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1226 ;btfsc menuview
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1227 ;bra TFT_show_safety_stop3 ; no room when menuview=1...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1228 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1229 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1230 STRCPY_TEXT_PRINT tDiveSafetyStop
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1231 TFT_show_safety_stop3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1232 call TFT_attention_color ; show in yellow
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1233 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1234 movff safety_stop_countdown,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1235 clrf hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1236 call convert_time ; converts hi:lo in seconds to mins (up:hi) and seconds (lo)
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1237 movf hi,W
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1238 movff lo,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1239 movwf lo ; exchange lo and hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1240 bsf leftbind
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1241 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1242 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1243 PUTC ':'
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1244 movff hi,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1245 output_99x
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1246 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1247 WIN_FONT FT_SMALL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1248 bra TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1249
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1250
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1251 global TFT_avr_stopwatch_mask ; mask for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1252 TFT_avr_stopwatch_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1253 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1254 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1255 TSTOSS opt_2ndDepthDisp ; draw avg depth instead of max depth in main screen?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1256 bra TFT_avr_stopwatch_mask_1 ; NO - draw avg depth in custom view then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1257 STRCAT_TEXT_PRINT tMaxDepth ; YES - draw max depth in custom view then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1258 bra TFT_avr_stopwatch_mask_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1259 TFT_avr_stopwatch_mask_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1260 STRCPY_TEXT_PRINT tDiveTotalAvg
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1261 TFT_avr_stopwatch_mask_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1262 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1263 STRCPY_TEXT_PRINT tDiveStopwatch
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1264 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1265 STRCPY_TEXT_PRINT tDiveStopAvg
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1266 bra TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1267
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1268
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1269 global TFT_avr_stopwatch ; data for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1270 TFT_avr_stopwatch:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1271 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1272 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1273
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1274 ; total average depth or max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1275 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1276 TSTOSS opt_2ndDepthDisp ; draw avg depth instead of max depth in main screen?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1277 bra TFT_avr_stopwatch_01 ; NO - draw avg depth in custom view then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1278 SAFE_2BYTE_COPY max_pressure,lo ; YES - draw max depth in custom view then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1279 bra TFT_avr_stopwatch_02
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1280 TFT_avr_stopwatch_01:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1281 movff avg_rel_pressure_total+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1282 movff avg_rel_pressure_total+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1283 TFT_avr_stopwatch_02:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1284 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1285 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1286 bra TFT_update_avr_stopwatch1_metric ; 0 - metric
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1287 ;bra TFT_update_avr_stopwatch1_imp ; 1 - imperial
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1288 TFT_update_avr_stopwatch1_imp:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1289 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1290 output_16 ; yxz
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1291 STRCAT " " ; wipe out remains from last output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1292 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1293 movff WREG,buffer+.3 ; limit string length to 3 digits
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1294 bra TFT_update_avr_stopwatch2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1295 TFT_update_avr_stopwatch1_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1296 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1297 output_16dp .3 ; yxz.a
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1298 PUTC " " ; wipe out remains from last output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1299 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1300 movff WREG,buffer+.4 ; limit string length to 4 = 3 digits + 1 half-size decimal dot
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1301 TFT_update_avr_stopwatch2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1302 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1303
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1304 ; stopped average depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1305 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1306 movff avg_rel_pressure+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1307 movff avg_rel_pressure+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1308 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1309 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1310 bra TFT_update_avr_stopwatch2_metric ; 0 - metric
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1311 ;bra TFT_update_avr_stopwatch2_imp ; 1 - imperial
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1312 TFT_update_avr_stopwatch2_imp:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1313 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1314 output_16 ; yxz
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1315 STRCAT " " ; wipe out remains from last output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1316 clrf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1317 movff WREG,buffer+.3 ; limit string length to 3 digits/characters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1318 bra TFT_update_avr_stopwatch3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1319 TFT_update_avr_stopwatch2_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1320 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1321 output_16dp .3 ; yxz.a
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1322 PUTC " " ; wipe out remains from last output
589
8a7d2d8bcd33 limit string length to 4 digits/chars in average depth
heinrichsweikamp
parents: 587
diff changeset
1323 clrf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1324 movff WREG,buffer+.4 ; limit string length to 4 = 3 digits + 1 half-size decimal dot
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1325 TFT_update_avr_stopwatch3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1326 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1327
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1328 ; stopped dive time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1329 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1330 TFT_update_stopwatch: ; jump-in point for stopped dive time in compass custom view
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
1331 bsf leftbind ; print numbers without leading spaces
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1332 movff average_divesecs+0,lo ; average_divesecs is incremented outside ISR
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1333 movff average_divesecs+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1334 call convert_time ; converts hi:lo in seconds to minutes (up:hi) and seconds (lo)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1335 movlw .100 ; display layout will change if minutes become >= 100
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1336 cpfslt hi ; minutes < 100 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1337 bra TFT_update_stopwatch_2 ; NO - display hours:minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1338 ;bra TFT_update_stopwatch_1 ; YES - display minutes:seconds
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1339 TFT_update_stopwatch_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1340 movf hi,W ; exchange lo and hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1341 movff lo,hi ; ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1342 movwf lo ; ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1343 output_8 ; output minutes or hours
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1344 PUTC ':'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1345 movff hi,lo ; restore lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1346 output_99x ; output seconds or minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1347 movlw .5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1348 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1349 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1350 movff WREG,buffer+.5 ; limit to 5 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1351 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1352 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1353 TFT_update_stopwatch_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1354 movff hi,lo ; transfer minutes (low byte) to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1355 movff up,hi ; transfer minutes (high byte) to hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1356 call convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1357 bra TFT_update_stopwatch_1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1358
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1359
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1360 global TFT_CNS_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1361 TFT_CNS_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1362 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1363 WIN_TINY dm_custom_cns3_column1, dm_custom_cns3_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1364 STRCPY_TEXT_PRINT tCNSsurf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1365 WIN_TINY dm_custom_cns3_column2, dm_custom_cns3_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1366 btfsc FLAG_oc_mode ; in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1367 bra TFT_CNS_mask_1 ; YES - print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1368 btfsc FLAG_bailout_mode ; in bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1369 bra TFT_CNS_mask_1 ; YES - print fTTS label (label will be printed, but a fTTS will actually not be calculated)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1370 TSTOSS opt_calc_asc_gasvolume ; bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1371 bra TFT_CNS_mask_1 ; NO - print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1372 STRCPY_TEXT_PRINT tCNSBO ; YES - print bailout label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1373 bra TFT_CNS_mask_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1374 TFT_CNS_mask_1: ; OC or bailout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1375 STRCPY_TEXT_PRINT tCNSfTTS ; print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1376 TFT_CNS_mask_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1377 WIN_TINY dm_custom_cns3_column3, dm_custom_cns3_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1378 STRCPY_TEXT_PRINT tCNSnow
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1379 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1380
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1381
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1382 global TFT_CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1383 TFT_CNS:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1384 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1385 ; CNS at end of normal dive
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1386 WIN_STD dm_custom_cns3_column1+.3,dm_custom_cns3_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1387 movff int_O_normal_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1388 movff int_O_normal_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1389 call TFT_color_code_cns
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1390 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1391 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1392 ; fTTS / Bailout CNS, if enabled
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1393 WIN_STD dm_custom_cns3_column2+.2,dm_custom_cns3_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1394 btfsc FLAG_bailout_mode ; in bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1395 bra TFT_CNS_3 ; YES - show "---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1396 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1397 bra TFT_CNS_1 ; NO - continue checking fTTS extra time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1398 btfss FLAG_oc_mode ; YES - in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1399 bra TFT_CNS_2 ; NO - show CNS%
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1400 TFT_CNS_1: ; not in bailout, no volume calculation, and/or in OC mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1401 TSTOSS char_I_extra_time ; fTTS extra time configured?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1402 bra TFT_CNS_3 ; NO - show "---"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1403 TFT_CNS_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1404 movff int_O_alternate_CNS_fraction+0,lo ; YES - show CNS%
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1405 movff int_O_alternate_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1406 call TFT_color_code_cns
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1407 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1408 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1409 bra TFT_CNS_4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1410 TFT_CNS_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1411 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1412 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1413 TFT_CNS_4:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1414 ; current CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1415 WIN_STD dm_custom_cns3_column3+.3,dm_custom_cns3_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1416 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1417 movff int_O_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1418 call TFT_color_code_cns
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1419 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1420 STRCAT_PRINT "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1421 TFT_display_exit_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1422 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1423 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1424
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1425
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1426 global TFT_ppo2_sensors_mask ; mask for ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1427 TFT_ppo2_sensors_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1428 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1429 WIN_TINY dm_custom_hud_sensor1_column+.4,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1430 STRCPY_TEXT_PRINT tDiveHudMask1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1431 WIN_TINY dm_custom_hud_sensor2_column+.3,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1432 STRCPY_TEXT_PRINT tDiveHudMask2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1433 WIN_TINY dm_custom_hud_sensor3_column+.2,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1434 STRCPY_TEXT_PRINT tDiveHudMask3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1435 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1436
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1437
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1438 global TFT_ppo2_sensors ; data for ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1439 TFT_ppo2_sensors:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1440 ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1441 ; Definition of the output:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1442 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1443 ; sensorX use voting o2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1444 ; _calibrated _O2 _logic _ppo2 Output Color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1445 ; _ok _sensorX _sensorX _sensorX
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1446 ;-----------------------------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1447 ; 0 -/- -/- -/- "----" TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1448 ; 1 0 -/- = 0 o2_ppo2_sensorX TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1449 ; 1 0 -/- > 0 o2_ppo2_sensorX TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1450 ; 1 1 0 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud + win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1451 ; 1 1 1 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1452 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1453 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1454 ; sensor 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1455 btfsc sensor1_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1456 bra TFT_update_hud1b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1457 btfsc sensor1_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1458 bra TFT_update_hud1b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1459
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1460 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1461 WIN_STD dm_custom_hud_sensor1_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1462 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1463 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1464 bra TFT_update_hud2a ; continue with sensor 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1465 TFT_update_hud1b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1466 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1467 WIN_MEDIUM dm_custom_hud_sensor1_column,dm_custom_hud_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1468 movff o2_ppo2_sensor1,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1469 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1470 btfsc use_O2_sensor1 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1471 bra TFT_update_hud1d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1472 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1473 tstfsz o2_ppo2_sensor1 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1474 bra TFT_update_hud1c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1475 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1476 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1477 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1478 TFT_update_hud1c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1479 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1480 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1481 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1482 TFT_update_hud1d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1483 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1484 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1485 btfsc voting_logic_sensor1 ; sensor value agrees with other sensor's values?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1486 bra TFT_update_hud1e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1487 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1488 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1489 TFT_update_hud1e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1490 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1491 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1492 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1493 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1494
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1495 TFT_update_hud2a: ; sensor 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1496 btfsc sensor2_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1497 bra TFT_update_hud2b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1498 btfsc sensor2_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1499 bra TFT_update_hud2b ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1500 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1501 WIN_STD dm_custom_hud_sensor2_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1502 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1503 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1504 bra TFT_update_hud3a ; continue with sensor 3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1505 TFT_update_hud2b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1506 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1507 WIN_MEDIUM dm_custom_hud_sensor2_column,dm_custom_hud_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1508 movff o2_ppo2_sensor2,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1509 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1510 btfsc use_O2_sensor2 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1511 bra TFT_update_hud2d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1512 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1513 tstfsz o2_ppo2_sensor2 ; sensor value = 0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1514 bra TFT_update_hud2c ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1515 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1516 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1517 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1518 TFT_update_hud2c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1519 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1520 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1521 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1522 TFT_update_hud2d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1523 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1524 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1525 btfsc voting_logic_sensor2 ; sensor value agrees with other sensor's vlaues?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1526 bra TFT_update_hud2e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1527 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1528 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1529 TFT_update_hud2e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1530 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1531 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1532 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1533 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1534
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1535 TFT_update_hud3a: ; sensor 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1536 btfsc sensor3_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1537 bra TFT_update_hud3b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1538 btfsc sensor3_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1539 bra TFT_update_hud3b ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1540 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1541 WIN_STD dm_custom_hud_sensor3_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1542 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1543 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1544 bra TFT_update_hud4 ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1545 TFT_update_hud3b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1546 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1547 WIN_MEDIUM dm_custom_hud_sensor3_column,dm_custom_hud_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1548 movff o2_ppo2_sensor3,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1549 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1550 btfsc use_O2_sensor3 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1551 bra TFT_update_hud3d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1552 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1553 tstfsz o2_ppo2_sensor3 ; sensor value = 0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1554 bra TFT_update_hud3c ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1555 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1556 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1557 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1558 TFT_update_hud3c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1559 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1560 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1561 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1562 TFT_update_hud3d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1563 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1564 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1565 btfsc voting_logic_sensor3 ; sensor value agrees with other sensor's values?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1566 bra TFT_update_hud3e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1567 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1568 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1569 TFT_update_hud3e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1570 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1571 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1572 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1573 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1574
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1575 TFT_update_hud4: ; closure
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1576 bra TFT_display_exit_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1577
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1578
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1579 global TFT_surface_sensor ; update sensor data in surface mode
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1580 TFT_surface_sensor:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1581 movf hardware_flag1,W
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1582 sublw 0x11 ; 2 with BLE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1583 btfsc STATUS,Z
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1584 return ; ignore for 0x11
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1585 ; show three sensors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1586 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1587 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1588 btfsc sensor1_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1589 bra TFT_surface_sensor1 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1590 btfsc sensor1_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1591 bra TFT_surface_sensor1 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1592 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1593 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1594 bra TFT_surface_sensor2 ; skip sensor 1
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1595 TFT_surface_sensor1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1596 movff o2_ppo2_sensor1,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1597 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1598 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1599 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1600 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1601 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1602 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1603 TFT_surface_sensor2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1604 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1605 btfsc sensor2_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1606 bra TFT_surface_sensor3 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1607 btfsc sensor2_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1608 bra TFT_surface_sensor3 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1609 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1610 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1611 bra TFT_surface_sensor4 ; skip sensor 2
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1612 TFT_surface_sensor3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1613 movff o2_ppo2_sensor2,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1614 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1615 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1616 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1617 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1618 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1619 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1620 TFT_surface_sensor4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1621 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1622 btfsc sensor3_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1623 bra TFT_surface_sensor5 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1624 btfsc sensor3_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1625 bra TFT_surface_sensor5 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1626 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1627 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1628 bra TFT_surface_sensor6 ; skip sensor 3
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1629 TFT_surface_sensor5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1630 movff o2_ppo2_sensor3,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1631 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1632 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1633 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1634 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1635 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1636 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1637 TFT_surface_sensor6:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1638 TFT_display_exit_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1639 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1640 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1641
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1642
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1643 global TFT_sensor_mV
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1644 TFT_sensor_mV:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1645 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1646 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1647
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1648 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1649 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1650 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1651 STRCAT "1: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1652 rcall TFT_sensor_mV_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1653
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1654 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1655 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1656 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1657 STRCAT "2: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1658 rcall TFT_sensor_mV_helper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1659
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1660 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1661 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1662 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1663 STRCAT "3: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1664 rcall TFT_sensor_mV_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1665 bra TFT_display_exit_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1666
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1667 TFT_sensor_mV_helper:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1668 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1669 STRCAT_PRINT "mV "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1670 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1671
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1672
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1673 global TFT_sensor_surface_warning
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1674 TFT_sensor_surface_warning:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1675 call TFT_warnings_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1676 btfss sensor1_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1677 bra TFT_sensor_mV2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1678 movff opt_x_s1+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1679 movf lo,W ; when opt_x_s1 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1680 bz TFT_sensor_mV2 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1681 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor1_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1682 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1683 TFT_sensor_mV2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1684 btfss sensor2_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1685 bra TFT_sensor_mV3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1686 movff opt_x_s2+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1687 movf lo,W ; when opt_x_s2 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1688 bz TFT_sensor_mV3 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1689 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor2_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1690 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1691 TFT_sensor_mV3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1692 btfss sensor3_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1693 bra TFT_sensor_mV4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1694 movff opt_x_s3+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1695 movf lo,W ; when opt_x_s3 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1696 bz TFT_sensor_mV4 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1697 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor3_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1698 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1699 TFT_sensor_mV4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1700 bra TFT_display_exit_3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1701
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1702
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1703 global TFT_menu_calibrate
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1704 TFT_menu_calibrate: ; update mV data in calibration menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1705 btfss s8_digital ; =1: Digital I/O
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1706 bra TFT_menu_calibrate_analog ; use analog
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1707 btfss new_s8_data_available ; new data frame received?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1708 bra TFT_menu_calibrate_common ; NO - use old values...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1709 ; YES - update the values
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1710 call compute_mvolts_for_all_sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1711 bra TFT_menu_calibrate_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1712 TFT_menu_calibrate_analog:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1713 call get_analog_inputs
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1714 TFT_menu_calibrate_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1715 call TFT_attention_color ; show in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1716 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1717 WIN_SMALL surf_menu_sensor1_column,surf_menu2_sensor1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1718 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1719 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1720 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1721 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1722 WIN_SMALL surf_menu_sensor2_column,surf_menu2_sensor2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1723 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1724 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1725 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1726 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1727 WIN_SMALL surf_menu_sensor3_column,surf_menu2_sensor3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1728 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1729 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1730 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1731 STRCAT_PRINT "mV "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1732 bra TFT_display_exit_3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1733
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1734
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1735 global TFT_clock
0
heinrichsweikamp
parents:
diff changeset
1736 TFT_clock:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1737 IFDEF _ostc_logo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1738 WIN_SMALL surf_clock_column,surf_clock_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1739 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1740 WIN_SMALL surf_clock_column+.7,surf_clock_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1741 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1742 TFT_clock2: ; called from divemode clock
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1743 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1744 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1745 output_99
heinrichsweikamp
parents:
diff changeset
1746 movlw ':'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1747 btfss secs,0 ; blinking every second
0
heinrichsweikamp
parents:
diff changeset
1748 movlw ' '
heinrichsweikamp
parents:
diff changeset
1749 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
1750 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1751 output_99x
heinrichsweikamp
parents:
diff changeset
1752 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
1753 return
heinrichsweikamp
parents:
diff changeset
1754
heinrichsweikamp
parents:
diff changeset
1755 global TFT_show_time_date_menu
heinrichsweikamp
parents:
diff changeset
1756 TFT_show_time_date_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1757 call speed_fastest
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1758 WIN_SMALL .15,.30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1759 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1760 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1761 output_99
heinrichsweikamp
parents:
diff changeset
1762 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1763 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1764 output_99x
heinrichsweikamp
parents:
diff changeset
1765 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1766 movff secs,lo
heinrichsweikamp
parents:
diff changeset
1767 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1768 STRCAT " - "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1769 movff day,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1770 movff month,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1771 movff year,up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1772 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
1773 STRCAT_PRINT " "
heinrichsweikamp
parents:
diff changeset
1774 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1775
0
heinrichsweikamp
parents:
diff changeset
1776 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1777
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1778 global TFT_surface_decosettings ; show all deco settings
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1779 TFT_surface_decosettings:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1780 ; Deco Mode
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1781 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1782 WIN_SMALL surf_gaslist_column,surf_gaslist_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1783 STRCAT_PRINT "ZH-L16"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1784 movff char_I_deco_model,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1785 iorwf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1786 bnz TFT_surface_decosettings1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1787 ; Display ZH-L16 sat/desat model
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1788 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1789 lfsr FSR2,buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1790 movff char_I_desaturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1791 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1792 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1793 STRCAT "%/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1794 movff char_I_saturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1795 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1796 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1797 bra TFT_surface_decosettings2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1798 ; Display ZH-L16-GF low/high model
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1799 TFT_surface_decosettings1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1800 TEXT_SMALL surf_gaslist_column+.43,surf_gaslist_row,tZHL16GF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1801 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1802 STRCPY_TEXT tGF ; GF:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1803 movff opt_GF_low,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1804 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1805 STRCAT "/"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1806 movff opt_GF_high,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1807 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1808 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1809 TFT_surface_decosettings2: ; fTTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1810 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1811 STRCPY_TEXT tFTTSMenu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1812 movff char_I_extra_time,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1813 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1814 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1815 STRCAT_TEXT_PRINT tMinutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1816 ; Last Stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1817 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1818 STRCPY_TEXT tLastDecostopSurf
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1819 movff opt_last_stop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1820 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1821 STRCAT_TEXT_PRINT tMeters
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1822 ; Salinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1823 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1824 STRCPY_TEXT tDvSalinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1825 movff opt_salinity,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1826 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1827 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1828 STRCAT_TEXT_PRINT tPercent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1829 return
0
heinrichsweikamp
parents:
diff changeset
1830
heinrichsweikamp
parents:
diff changeset
1831 global TFT_debug_output
heinrichsweikamp
parents:
diff changeset
1832 TFT_debug_output:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1833 WIN_TINY .80,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1834 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1835 lfsr FSR2,buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1836 movff analog_sw1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1837 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1838 PUTC ","
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1839 movff analog_sw2,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1840 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1841 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1842 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1843
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1844 global TFT_divetimeout ; show timeout counter
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1845 TFT_divetimeout:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1846 call TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1847 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1848 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1849 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1850 STRCPY 0x94 ; "End of dive" symbol
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1851 movff opt_diveTimeout,WREG ; in [min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1852 mullw .60
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1853 movff PRODL,sub_a+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1854 movff PRODH,sub_a+1 ; in [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1855 movff timeout_counter1+0,sub_b+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1856 movff timeout_counter1+1,sub_b+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1857 call subU16 ; sub_c = sub_a - sub_b (with UNSIGNED values)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1858 movff sub_c+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1859 movff sub_c+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1860 call convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1861 movf hi,W
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1862 movff lo,hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1863 movwf lo ; exchange lo and hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1864 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1865 PUTC ':'
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1866 movff hi,lo
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1867 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1868 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1869 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1870 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1871 bcf win_invert
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1872 return
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1873
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1874 global TFT_display_ftts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1875 TFT_display_ftts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1876 call TFT_warning_set_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1877 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1878 return ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1879 btfsc FLAG_oc_mode ; YES - in OC mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1880 bra TFT_display_ftts_1 ; YES - print fTTS label
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1881 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1882 bra TFT_display_ftts_1 ; NO - print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1883 STRCPY "B/O" ; YES - print bailout label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1884 bra TFT_display_ftts_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1885 TFT_display_ftts_1: ; OC or CCR/pSCR but no bailout volume calculation
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1886 STRCPY "@+" ; print fTTS label
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1887 TFT_display_ftts_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1888 movff char_I_extra_time,lo ; get fTTS delay time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1889 bsf leftbind ; print with alignment to the left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1890 output_8 ; print fTTS delay time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1891 PUTC ":" ; ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1892 movff int_O_alternate_ascenttime+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1893 movff int_O_alternate_ascenttime+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1894 call TFT_memo_color ; set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1895 btfss hi,int_invalid_flag ; is the invalid flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1896 bra TFT_display_ftts_3 ; NO - keep memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1897 bcf hi,int_invalid_flag ; YES - clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1898 call TFT_disabled_color ; - switch to disabled color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1899 TFT_display_ftts_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1900 btfsc hi,int_not_yet_computed ; is the not-computed-yet flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1901 bra TFT_display_ftts_4 ; YES - show dashes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1902 movf lo,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1903 iorwf hi,W ; extra_ascenttime = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1904 bz TFT_display_ftts_5 ; YES - show "NDL"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1905 movff char_O_deco_info,up ; get deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1906 btfsc up,deco_steady ; fTTS = TTS ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1907 call TFT_advice_color ; YES - set to advice color (green)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1908 btfsc up,deco_decreasing ; fTTS < TTS ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1909 call TFT_advice_color ; YES - set to advice color (green)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1910 output_16 ; NO - show ascent time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1911 PUTC "'" ; - minutes symbol
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1912 bra TFT_display_ftts_6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1913 TFT_display_ftts_4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1914 STRCAT "---" ; "---" for not computed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1915 bra TFT_display_ftts_6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1916 TFT_display_ftts_5:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1917 STRCAT_TEXT tNDL ; "NDL"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1918 TFT_display_ftts_6:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1919 movlw dm_warning_length ; dive mode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1920 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
1921 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1922 bcf leftbind ; clear left alignment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1923 goto TFT_standard_color ; ...and return
0
heinrichsweikamp
parents:
diff changeset
1924
heinrichsweikamp
parents:
diff changeset
1925
heinrichsweikamp
parents:
diff changeset
1926 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1927
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1928 global TFT_temp_surfmode
0
heinrichsweikamp
parents:
diff changeset
1929 TFT_temp_surfmode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1930 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1931 WIN_SMALL surf_temp_column+3*8,surf_temp_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1932 TSTOSS opt_units ; 0=°C, 1=°F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1933 bra TFT_temp_surfmode_metric
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1934 STRCAT_TEXT tLogTunitF ; °F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1935 bra TFT_temp_surfmode_common
0
heinrichsweikamp
parents:
diff changeset
1936 TFT_temp_surfmode_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1937 STRCAT_TEXT tLogTunitC ; °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1938 TFT_temp_surfmode_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1939 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1940 WIN_SMALL surf_temp_column,surf_temp_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1941 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1942 bra TFT_temp_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1943
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1944
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1945 global TFT_temp_divemode
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1946 TFT_temp_divemode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1947 bcf FLAG_TFT_temp_divemode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1948 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1949 return ; YES - no update of temperature now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1950 btfsc blinking_better_gas ; blinking better gas?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1951 return ; YES - no update of temperature now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1952 btfsc blinking_better_dil ; blinking better diluent?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1953 return ; YES - no update of temperature now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1954 WIN_SMALL dm_temp_column,dm_temp_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1955 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1956 btfsc alternative_divelayout ; in alternative layout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1957 bra TFT_temp_common ; YES - proceed with temperature
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1958 movlw index_compass_dm ; NO - index of compass custom view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1959 cpfseq menupos3 ; - compass shown in custom view?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1960 bra TFT_temp_common ; NO - proceed with temperature
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1961 bra TFT_update_stopwatch ; YES - show resettable dive time instead of temperature
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1962 TFT_temp_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1963 SAFE_2BYTE_COPY temperature,lo ; get current temperature
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1964 TSTOSS opt_units ; 0=°C, 1=°F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1965 bra TFT_temp_common_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1966 call convert_celsius_to_fahrenheit ; convert value in lo:hi from celsius to fahrenheit
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1967 TFT_temp_common_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1968 rcall TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1969 btfsc neg_flag ; is the temperature negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1970 bra TFT_temp_common_2 ; YES - the minus sign has already been written
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1971 ; temp is positive, is it less than 10°C ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1972 tstfsz hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1973 bra TFT_temp_common_1a ; >25.5°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1974 movlw .100
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1975 cpfslt lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1976 bra TFT_temp_common_1a ; >10.0°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1977 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1978 output_16dp d'4' ; x.y°C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1979 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1980 bra TFT_temp_common_3 ; done
553
2e70700774b9 Display dezimal for temperatures between 10 and 0?C
heinrichsweikamp
parents: 552
diff changeset
1981 TFT_temp_common_1a:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1982 PUTC " " ; NO - write a space instead of the minus sign
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1983 TFT_temp_common_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1984 bsf ignore_digit5 ; ignore decimal (flag will be cleared by output_16)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1985 output_16_3 ; output 0-999 without decimal -> writes ' ' - 99
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1986 movff buffer+2,lo ; get output from unit position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1987 movlw " " ; load code of the space character
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1988 cpfseq lo ; is there a space sign on the unit position? (happens between +1 and -1)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1989 bra TFT_temp_common_3 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1990 movff WREG,buffer+0 ; YES - replace potential minus sign with a space (temps from -0.9° to -0.1° else would appear as '- 0')
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1991 movlw "0" ; load code of the zero character
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1992 movff WREG,buffer+2 ; replace space with a zero
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1993 TFT_temp_common_3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1994 btfss divemode ; are we in dive mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1995 bra TFT_temp_common_5 ; NO - no unit to append
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1996 TSTOSS opt_units ; YES - check unit type: 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1997 bra TFT_temp_common_4 ; go metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1998 STRCAT_TEXT tLogTunitF ; append °F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1999 bra TFT_temp_common_5
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2000 TFT_temp_common_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2001 STRCAT_TEXT tLogTunitC ; append °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2002 TFT_temp_common_5:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2003 STRCAT_PRINT "" ; output to screen
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2004 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2005
0
heinrichsweikamp
parents:
diff changeset
2006 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2007
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2008 global TFT_divemode_menu_cursor
0
heinrichsweikamp
parents:
diff changeset
2009 TFT_divemode_menu_cursor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2010 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item1_column-.8, dm_menu_item1_column-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2011 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item4_column-.8, dm_menu_item4_column-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2012 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2013
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2014 movlw dm_menu_item1_column-.8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2015 btfsc menupos1,2 ; > 3 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2016 movlw dm_menu_item4_column-.8 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2017 movwf win_leftx2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2018
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2019 movff menupos1,lo ; copy menu position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2020 movlw dm_menu_item6_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2021 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2022 movlw dm_menu_item1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2023 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2024 movlw dm_menu_item2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2025 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2026 movlw dm_menu_item3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2027 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2028 movlw dm_menu_item4_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2029 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2030 movlw dm_menu_item5_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2031 movwf win_top
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2032 movlw FT_SMALL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2033 movwf win_font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2034 STRCPY_PRINT "\xb7" ; print cursor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2035 return
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
2036
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2037
0
heinrichsweikamp
parents:
diff changeset
2038 global TFT_active_gas_divemode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2039 TFT_active_gas_divemode: ; display gas/setpoint
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2040 bcf FLAG_TFT_active_gas_divemode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2041 btfsc divemode_menu ; is the dive mode menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2042 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2043 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2044 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2045 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2046 return ; YES - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2047 btfss FLAG_oc_mode ; in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2048 bra TFT_active_setpoint ; NO - show setpoint and gas mix
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2049 bra TFT_active_gas_divemode_oc ; YES - show OC gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2050
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2051 TFT_active_setpoint_bail: ; bailout case
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2052 tstfsz menupos2 ; any option shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2053 bra TFT_active_gas_divemode_oc ; YES - do not overwrite with bailout text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2054 WIN_SMALL dm_active_dil_column, dm_active_dil_row
605
5ce603c29750 gas color coding fixed
heinrichsweikamp
parents: 604
diff changeset
2055 call TFT_attention_color ; print in yellow
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2056 STRCPY_TEXT_PRINT tDiveBailout ; "Bailout"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2057 TFT_active_gas_divemode_oc: ; common part for OC and bailout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2058 movff int_O_breathed_ppO2+0,lo ; color-code the output of the gas by the ppO2 it yields
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2059 movff int_O_breathed_ppO2+1,hi ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2060 call TFT_color_code_ppo2 ; with ppO2 [cbar] in hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2061 btfss better_gas_available ; check if a better gas is available and a gas change shall be advised
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2062 bra TFT_active_gas_print ; NO - print in normal rendering
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2063 btg blinking_better_gas ; YES - toggle blink bit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2064 btfss blinking_better_gas ; blink now?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2065 bra TFT_active_gas_print ; NO - print in normal rendering
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2066 call TFT_attention_color ; YES - blink in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2067 bsf win_invert ; set invert flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2068 TFT_active_gas_print:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2069 WIN_STD dm_active_gas_column, dm_active_gas_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2070 movff char_I_O2_ratio,lo ; lo now stores O2 in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2071 movff char_I_He_ratio,hi ; hi now stores He in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2072 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2073 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2074 bcf win_invert ; reset invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2075 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2076
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2077 ; in CCR / pSCR mode - and maybe in bailout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2078 TFT_active_setpoint: ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2079 btfsc FLAG_bailout_mode ; in bailout?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2080 bra TFT_active_setpoint_bail ; YES - show "Bailout" instead of setpoint
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2081
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2082 ; on the loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2083 movff int_O_breathed_ppO2+0,lo ; color-code the output by the ppO2 of the loop gas mixture
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2084 movff int_O_breathed_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2085 call TFT_color_code_ppo2 ; with ppO2 [cbar] in hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2086 btfss secs,0 ; timebase for blinking effect: on even second?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2087 bra TFT_active_setpoint_print ; YES - print ppO2 with normal rendering
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2088 btfsc setpoint_fallback ; NO - check if we are in fallback condition
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2089 bra TFT_active_setpoint_fallb ; YES - process fallback case
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2090 movff int_O_breathed_ppO2+1,WREG ; NO - get flags again (have been cleared in hi:lo by TFT_color_code_ppo2 meanwhile)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2091 btfss WREG,int_warning_flag ; warning flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2092 bra TFT_active_setpoint_print ; NO - ppO2 is ok, print ppO2 with normal rendering
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2093 bra TFT_active_setpoint_com ; YES - continue with blinking common part
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2094 TFT_active_setpoint_fallb: ; set up fallback case
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2095 call TFT_attention_color ; text in yellow
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2096 TFT_active_setpoint_com: ; blinking common part
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2097 bsf win_invert ; set invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2098 TFT_active_setpoint_print:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2099 WIN_STD dm_active_gas_column, dm_active_gas_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2100 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2101 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2102 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2103 STRCAT_TEXT tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2104 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2105 sublw .1 ; opt_ccr_mode = 1 (Sensor)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2106 bnz TFT_active_setpoint2_a ; NO - skip
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2107 PUTC "*" ; YES - add an astrix
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2108 TFT_active_setpoint2_a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2109 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2110 bcf win_invert ; reset invert flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2111 call TFT_memo_color ; revert to memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2112 TFT_active_setpoint_diluent: ; diluent gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2113 movff int_O_pure_ppO2+0,lo ; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2114 movff int_O_pure_ppO2+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2115 call TFT_color_code_ppo2 ; with ppO2 [cbar] in hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2116 btfss better_dil_available ; check if a better diluent is available and a diluent change shall be advised
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2117 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2118 btg blinking_better_dil ; YES - toggle blink bit...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2119 btfss blinking_better_dil ; blink now?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2120 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2121 call TFT_attention_color ; YES - print in yellow color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2122 bsf win_invert ; - set invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2123 TFT_active_setpoint_diluent_show:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2124 WIN_SMALL dm_active_dil_column, dm_active_dil_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2125 movff char_I_O2_ratio,lo ; lo now stores O2 in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2126 movff char_I_He_ratio,hi ; hi now stores He in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2127 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
0
heinrichsweikamp
parents:
diff changeset
2128 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2129 bcf win_invert ; reset invert flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2130 call TFT_memo_color ; set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2131 btfsc menuview ; is the dive options menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2132 return ; YES - do not overwrite it
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2133 WIN_TINY dm_active_dil_column+.45, dm_active_dil_row+.3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2134 btfsc FLAG_ccr_mode ; in CCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2135 bra TFT_active_setpoint_ccr ; YES - write CCR label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2136 btfsc FLAG_pscr_mode ; in pSCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2137 bra TFT_active_setpoint_pscr ; YES - write pSCR label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2138 return ; NO to both - should not happen, anyhow: done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2139 TFT_active_setpoint_ccr:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2140 STRCPY_TEXT_PRINT tDvCCR ; print "CCR"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2141 return ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2142 TFT_active_setpoint_pscr:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2143 STRCPY_TEXT_PRINT tDvPSCR ; print "PSCR"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2144 return ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2145
0
heinrichsweikamp
parents:
diff changeset
2146
heinrichsweikamp
parents:
diff changeset
2147 global TFT_display_decotype_surface
heinrichsweikamp
parents:
diff changeset
2148 TFT_display_decotype_surface:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2149 WIN_STD surf_decotype_column,surf_decotype_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2150 WIN_COLOR color_lightblue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2151 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnoe, 4=PSCR
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2152 tstfsz lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2153 bra TFT_display_decotype_surface2
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2154 TFT_display_decotype_surface0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2155 STRCAT_TEXT_PRINT tDvOC ; OC
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2156 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2157 TFT_display_decotype_surface2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2158 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2159 bra TFT_display_decotype_surface3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2160 STRCAT_TEXT_PRINT tDvCC ; CC
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2161 call TFT_standard_color
113
heinrichsweikamp
parents: 106
diff changeset
2162 WIN_TINY surf_decotype_column+.18,surf_decotype_row+.12
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2163 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor, =2: Auto SP
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2164 bra TFT_display_decotype_cc_fixed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2165 ; Sensor mode or Auto
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2166 movff opt_ccr_mode,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2167 sublw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2168 bz TFT_display_decotype_cc_auto
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2169 STRCPY_TEXT tCCRModeSensor ; sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2170 bra TFT_display_decotype_cc_common
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2171 TFT_display_decotype_cc_auto:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2172 STRCPY_TEXT tCCRModeAutoSP ; Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2173 bra TFT_display_decotype_cc_common
113
heinrichsweikamp
parents: 106
diff changeset
2174 TFT_display_decotype_cc_fixed:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2175 STRCPY_TEXT tCCRModeFixedSP ; fixed SP
113
heinrichsweikamp
parents: 106
diff changeset
2176 TFT_display_decotype_cc_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2177 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2178 movff WREG,buffer+.8 ; limit string length to 8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2179 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2180 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2181 TFT_display_decotype_surface3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2182 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2183 bra TFT_display_decotype_surface4
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2184 TFT_display_decotype_surface3_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2185 STRCAT_TEXT_PRINT tDvGauge ; Gauge
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2186 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2187 TFT_display_decotype_surface4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2188 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2189 bra TFT_display_decotype_surface5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2190 TFT_display_decotype_surface4_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2191 STRCAT_TEXT_PRINT tDvApnea ; Apnea
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2192 bra TFT_display_decotype_exit
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2193 TFT_display_decotype_surface5:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2194 STRCAT_TEXT_PRINT tDvPSCR ; pSCR
0
heinrichsweikamp
parents:
diff changeset
2195 TFT_display_decotype_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2196 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2197
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2198
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2199 global TFT_display_decotype_surface1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2200 TFT_display_decotype_surface1: ; used from logbook and from deco calculator (simulator.asm)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2201 tstfsz lo ; lo holds 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=pSCR
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2202 bra TFT_display_decotype_surface1_2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2203 bra TFT_display_decotype_surface0 ; OC
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2204 TFT_display_decotype_surface1_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2205 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2206 bra TFT_display_decotype_surface1_3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2207 STRCAT_TEXT_PRINT tDvCC ; CC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2208 bra TFT_display_decotype_exit
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2209 TFT_display_decotype_surface1_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2210 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2211 bra TFT_display_decotype_surface1_4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2212 bra TFT_display_decotype_surface3_1 ; Gauge
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2213 TFT_display_decotype_surface1_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2214 decfsz lo,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2215 bra TFT_display_decotype_surface5 ; pSCR
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2216 bra TFT_display_decotype_surface4_1 ; Apnea
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2217
0
heinrichsweikamp
parents:
diff changeset
2218 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2219
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2220 global TFT_splist_surfmode ; show setpoint list
0
heinrichsweikamp
parents:
diff changeset
2221 TFT_splist_surfmode:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2222 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2223 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2224 ;SP 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2225 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2226 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2227 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2228 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2229 ;SP 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2230 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2231 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2232 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2233 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2234 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2235 ;SP 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2236 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2237 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2238 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2239 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2240 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2241 ;SP 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2242 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2243 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2244 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2245 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2246 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2247 ;SP 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2248 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2249 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2250 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2251 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2252 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2253 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2254 return
0
heinrichsweikamp
parents:
diff changeset
2255
heinrichsweikamp
parents:
diff changeset
2256 global TFT_gaslist_surfmode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2257 TFT_gaslist_surfmode: ; displays gas list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2258 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2259 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2260 ;Gas 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2261 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2262 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2263 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2264 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2265 ;Gas 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2266 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2267 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2268 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2269 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2270 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2271 ;Gas 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2272 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2273 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2274 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2275 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2276 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2277 ;Gas 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2278 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2279 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2280 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2281 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2282 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2283 ;Gas 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2284 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2285 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2286 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2287 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2288 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2289 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2290 bcf win_invert ; clear flag for inverted output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2291 return
0
heinrichsweikamp
parents:
diff changeset
2292
heinrichsweikamp
parents:
diff changeset
2293 global TFT_dillist_surfmode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2294 TFT_dillist_surfmode: ; displays diluent list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2295 bsf FLAG_diluent_setup ; use CCR diluents...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2296 rcall TFT_gaslist_surfmode ; use OC/BAIL routine
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2297 bcf FLAG_diluent_setup ; clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2298 return
0
heinrichsweikamp
parents:
diff changeset
2299
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2300 ;==================================================================
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2301
0
heinrichsweikamp
parents:
diff changeset
2302 global TFT_depth
heinrichsweikamp
parents:
diff changeset
2303 TFT_depth:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2304 bcf FLAG_TFT_depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2305 SAFE_2BYTE_COPY rel_pressure, lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2306 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2307 call TFT_color_code_depth ; color-code the output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2308 rcall TFT_depth_blink
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2309 WIN_LARGE dm_depth_column, dm_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2310 TSTOSS opt_units ; 0=m, 1=ft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2311 bra TFT_depth_metric
0
heinrichsweikamp
parents:
diff changeset
2312 ;TFT_depth_imperial
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2313 clrf sub_a+1 ; display 0ft if lower then 30cm
0
heinrichsweikamp
parents:
diff changeset
2314 movlw d'30'
heinrichsweikamp
parents:
diff changeset
2315 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2316 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2317 movff lo,sub_b+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2318 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2319 btfss neg_flag ; depth lower then 0.4m?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2320 bra depth_less_0.3mtr_feet ; YES - show 0ft manually
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2321 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
2322 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2323 output_16 ; feet in Big font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2324 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2325 movlw .3 ; limit to three chars
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2326 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2327 STRCAT_PRINT "" ; display feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2328 bcf win_invert ; reset invert flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2329 return
126
9e856337b225 fix depth<0m display, ceiling
heinrichsweikamp
parents: 124
diff changeset
2330
0
heinrichsweikamp
parents:
diff changeset
2331 depth_less_0.3mtr_feet:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2332 STRCAT_PRINT "0 " ; manual zero
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2333 bcf win_invert ; reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2334 return
heinrichsweikamp
parents:
diff changeset
2335
heinrichsweikamp
parents:
diff changeset
2336 TFT_depth_metric:
heinrichsweikamp
parents:
diff changeset
2337 movlw .039
heinrichsweikamp
parents:
diff changeset
2338 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2339 bra depth_greater_99_84mtr
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2340
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2341 btfsc depth_greater_100m ; was depth > 100m during last call?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2342 rcall TFT_clear_depth ; YES - clear depth area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2343 bcf depth_greater_100m ; do this once only...
0
heinrichsweikamp
parents:
diff changeset
2344
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2345 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2346 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2347 bra depth_greater_99_84mtr
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2348
0
heinrichsweikamp
parents:
diff changeset
2349 movlw HIGH d'1000'
heinrichsweikamp
parents:
diff changeset
2350 movwf sub_a+1
heinrichsweikamp
parents:
diff changeset
2351 movlw LOW d'1000'
heinrichsweikamp
parents:
diff changeset
2352 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2353 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2354 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2355 incf sub_b+0,F
heinrichsweikamp
parents:
diff changeset
2356 movlw d'0'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2357 addwfc sub_b+1,F ; add 1mbar offset
0
heinrichsweikamp
parents:
diff changeset
2358 call sub16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2359 movlw ' '
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2360 btfss neg_flag ; depth lower then 10m?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2361 movwf POSTINC2 ; YES - add extra space
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2362
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2363 clrf sub_a+1
0
heinrichsweikamp
parents:
diff changeset
2364 movlw d'99'
heinrichsweikamp
parents:
diff changeset
2365 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2366 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2367 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2368 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2369 btfss neg_flag ; depth lower then 1m?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2370 bra tft_depth2 ; YES - display manual Zero
0
heinrichsweikamp
parents:
diff changeset
2371
heinrichsweikamp
parents:
diff changeset
2372 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2373 bsf ignore_digit4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2374 output_16 ; full meters in big font
0
heinrichsweikamp
parents:
diff changeset
2375 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2376 bra tft_depth3
heinrichsweikamp
parents:
diff changeset
2377
heinrichsweikamp
parents:
diff changeset
2378 tft_depth2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2379 STRCAT "0" ; manual zero
0
heinrichsweikamp
parents:
diff changeset
2380
heinrichsweikamp
parents:
diff changeset
2381 tft_depth3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2382 STRCAT_PRINT "" ; display full meters
0
heinrichsweikamp
parents:
diff changeset
2383
heinrichsweikamp
parents:
diff changeset
2384 ; .1m in MEDIUM font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2385 WIN_MEDIUM dm_depth_dm_column, dm_depth_dm_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2386
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2387 SAFE_2BYTE_COPY rel_pressure, lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2388 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2389 ;call TFT_color_code_depth ; color-code the output - not needed, furthermore: seems to cause problems if not commented out...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2390
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2391 PUTC "."
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2392 movlw HIGH d'30' ; display 0.0m if lower then 30cm
0
heinrichsweikamp
parents:
diff changeset
2393 movwf sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2394 movlw LOW d'30'
0
heinrichsweikamp
parents:
diff changeset
2395 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2396 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2397 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2398 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2399 btfss neg_flag ; depth lower then 0.3m?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2400 bra depth_less_0.3mtr ; YES - show ".0" manually
0
heinrichsweikamp
parents:
diff changeset
2401
heinrichsweikamp
parents:
diff changeset
2402 movlw d'4'
heinrichsweikamp
parents:
diff changeset
2403 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2404 bsf ignore_digit5 ; (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2405 output_16dp d'0'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2406 STRCAT_PRINT "" ; display decimeters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2407 bcf win_invert ; reset invert flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2408 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2409 return
heinrichsweikamp
parents:
diff changeset
2410
heinrichsweikamp
parents:
diff changeset
2411 depth_less_0.3mtr:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2412 STRCAT_PRINT "0" ; display 0.0m manually
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2413 bcf win_invert ; reset invert flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2414 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2415 return
heinrichsweikamp
parents:
diff changeset
2416
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2417 depth_greater_99_84mtr: ; display only in full meters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2418 btfss depth_greater_100m ; is depth > 100m already?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2419 rcall TFT_clear_depth ; NO - clear depth area and set flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2420 call TFT_color_code_depth
0
heinrichsweikamp
parents:
diff changeset
2421 ; Depth is already in hi:lo
heinrichsweikamp
parents:
diff changeset
2422 ; Show depth in Full meters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2423 ; That means ignore digit 4 and 5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2424 lfsr FSR2,buffer
0
heinrichsweikamp
parents:
diff changeset
2425 bsf ignore_digit4
heinrichsweikamp
parents:
diff changeset
2426 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2427 output_16
heinrichsweikamp
parents:
diff changeset
2428 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2429 STRCAT_PRINT "" ; display full meters only
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2430 bcf win_invert ; reset invert flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2431 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2432 return
heinrichsweikamp
parents:
diff changeset
2433
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2434 TFT_clear_depth: ; NO - clear depth area and set flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2435 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2436 bsf depth_greater_100m ; set flag
0
heinrichsweikamp
parents:
diff changeset
2437 return
heinrichsweikamp
parents:
diff changeset
2438
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2439 TFT_depth_blink:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2440 TSTOSS opt_modwarning ; 0=standard, 1=blink
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2441 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2442
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2443 ; check if previous cycle had the blinking warning or not
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2444 btfsc blinking_depth_prev ; did we have warning previously?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2445 bra TFT_depth_blink_prevwarn; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2446
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2447 ; NO - check if it's set now
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2448 btfsc blinking_depth_warning ; do we have warning set now?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2449 bra TFT_depth_blink_warn ; YES - so we have warning now but not previously
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2450 btfsc blinking_depth_attention; do we have attention set now?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2451 bra TFT_depth_blink_warn ; YES - so we have attention now but not previously
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2452
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2453 ; no warning in previous cycle, no warning now, reset all flags
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2454 bcf blinking_depth_prev ; reset previous flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2455 bcf blinking_depth_toggle ; reset toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2456 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2457 return ; all done
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2458
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2459 TFT_depth_blink_prevwarn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2460 ; ...we had warning in previous cycle, check if we still have the warning set
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2461 btfsc blinking_depth_warning ; do we still have the warning?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2462 bra TFT_depth_blink_prevwarn_1 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2463 btfss blinking_depth_attention ; do we still have the attention?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2464 bra TFT_depth_blink_prevwarn_nowarn ; NO - clear the depth area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2465 TFT_depth_blink_prevwarn_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2466 ; we still have the warning, set previous flag for next cycle...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2467 bsf blinking_depth_prev ; set prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2468 ; and set toggle and invert if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2469 btfss blinking_depth_toggle ; do we have the toggle set?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2470 bra TFT_depth_blink_set ; NO - set inverse, do color_box, set flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2471 bra TFT_depth_blink_reset ; Yes - clear inverse, do black box, reset flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2472
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2473 TFT_depth_blink_prevwarn_nowarn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2474 ; we had warning, but not now... (e.g. ascended or switched to better gas)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2475 ; reset the previous cycle flag for the next cycle...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2476 bcf blinking_depth_prev ; reset prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2477 ; clear it - just in case if we had a blinked before
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2478 bra TFT_depth_blink_reset ; clear inverse, do black box, reset flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2479
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2480 TFT_depth_blink_warn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2481 ; new blinking warning activated (had no warning in previous cycle)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2482 bsf blinking_depth_prev ; set prev flag
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2483 ;bra TFT_depth_blink_set ; set toggle and invert
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2484
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2485 TFT_depth_blink_set:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2486 ; clear the area with color
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2487 call TFT_attention_color_dive ; default background to attention color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2488 btfsc blinking_depth_warning ; in warning mode?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2489 call TFT_warnings_color_dive ; overwrite background color with warning color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2490 WIN_BOX_COLOR dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2491 bsf win_invert ;set the invert color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2492 bsf blinking_depth_toggle ; set the toggle
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2493 return ; all done
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2494
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2495 TFT_depth_blink_reset:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2496 ; clear the area with black
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2497 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2498 bcf win_invert ; reset the invert color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2499 bcf blinking_depth_toggle ; reset the toggle
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2500 call TFT_attention_color ; default to attention color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2501 btfsc blinking_depth_warning ; do we have a warning?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2502 call TFT_warnings_color ; YES - overwrite with warning color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
2503 return ; all done
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2504
0
heinrichsweikamp
parents:
diff changeset
2505 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2506
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2507 global TFT_custom_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2508 TFT_custom_text: ; show the custom text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2509 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2510 lfsr FSR0, opt_name ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2511 WIN_SMALL surf_customtext_column,surf_customtext_row1 ; 1st row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2512 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2513 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2514 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2515 lfsr FSR0, opt_name+.12 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2516 WIN_SMALL surf_customtext_column,surf_customtext_row2 ; 2nd row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2517 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2518 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2519 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2520 lfsr FSR0, opt_name+.24 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2521 WIN_SMALL surf_customtext_column,surf_customtext_row3 ; 3rd row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2522 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2523 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2524 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2525 lfsr FSR0, opt_name+.36 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2526 WIN_SMALL surf_customtext_column,surf_customtext_row4 ; 4th row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2527 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2528 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2529 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2530 lfsr FSR0, opt_name+.48 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2531 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; 5th row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2532 bra TFT_custom_text_2 ; show up to 12 chars, print and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2533
0
heinrichsweikamp
parents:
diff changeset
2534
heinrichsweikamp
parents:
diff changeset
2535 TFT_custom_text_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2536 lfsr FSR2, buffer ; destination
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2537 movlw .12
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2538 movwf lo ; length/line
0
heinrichsweikamp
parents:
diff changeset
2539 TFT_custom_text_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2540 movf POSTINC0,W ; get byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2541 bz TFT_custom_text_4 ; end if NULL
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2542 movwf POSTINC2 ; NO - copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2543 decfsz lo,F ; max length reached ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2544 bra TFT_custom_text_3 ; NO - loop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2545 setf lo ; lo=255 -> more to come
0
heinrichsweikamp
parents:
diff changeset
2546 TFT_custom_text_4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2547 clrf POSTINC2 ; mark end of string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2548 goto aa_wordprocessor ; print and return
0
heinrichsweikamp
parents:
diff changeset
2549
heinrichsweikamp
parents:
diff changeset
2550
heinrichsweikamp
parents:
diff changeset
2551 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2552
0
heinrichsweikamp
parents:
diff changeset
2553 global TFT_update_surf_press
heinrichsweikamp
parents:
diff changeset
2554 TFT_update_surf_press:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2555 WIN_SMALL surf_press_column+.8,surf_press_row
0
heinrichsweikamp
parents:
diff changeset
2556 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2557 SAFE_2BYTE_COPY amb_pressure, lo
0
heinrichsweikamp
parents:
diff changeset
2558 movff lo,sub_a+0
heinrichsweikamp
parents:
diff changeset
2559 movff hi,sub_a+1
heinrichsweikamp
parents:
diff changeset
2560 movff last_surfpressure_30min+0,sub_b+0
heinrichsweikamp
parents:
diff changeset
2561 movff last_surfpressure_30min+1,sub_b+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2562 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2563 btfsc neg_flag ; pressure lower?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2564 rcall update_surf_press2 ; YES - test threshold
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2565 tstfsz sub_c+1 ; >255 mbar difference?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2566 bra update_surf_press_common ; YES - display
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2567 movlw d'11' ; 10mbar noise suppression
0
heinrichsweikamp
parents:
diff changeset
2568 subwf sub_c+0,W
heinrichsweikamp
parents:
diff changeset
2569 btfsc STATUS,C
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2570 bra update_surf_press_common ; YES - display
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2571 SAFE_2BYTE_COPY last_surfpressure_30min, lo ; overwrite with stable value...
0
heinrichsweikamp
parents:
diff changeset
2572 update_surf_press_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2573 movff lo,int_I_pres_surface+0 ; copy displayed value to C code to have pressure displayed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2574 movff hi,int_I_pres_surface+1 ; and pressure used for desaturation & no-fly time in sync
0
heinrichsweikamp
parents:
diff changeset
2575 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2576 ; Show only 4 digits
0
heinrichsweikamp
parents:
diff changeset
2577 movff buffer+1,buffer+0
heinrichsweikamp
parents:
diff changeset
2578 movff buffer+2,buffer+1
heinrichsweikamp
parents:
diff changeset
2579 movff buffer+3,buffer+2
heinrichsweikamp
parents:
diff changeset
2580 movff buffer+4,buffer+3
heinrichsweikamp
parents:
diff changeset
2581 movlw 0x00
heinrichsweikamp
parents:
diff changeset
2582 movff WREG,buffer+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2583 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2584 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2585 WIN_SMALL surf_press_column+(4+1)*8,surf_press_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2586 STRCPY_TEXT_PRINT tMBAR ; mbar (hPa)
0
heinrichsweikamp
parents:
diff changeset
2587 return
heinrichsweikamp
parents:
diff changeset
2588
heinrichsweikamp
parents:
diff changeset
2589 update_surf_press2:
heinrichsweikamp
parents:
diff changeset
2590 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2591 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2592 movff last_surfpressure_30min+0,sub_a+0
heinrichsweikamp
parents:
diff changeset
2593 movff last_surfpressure_30min+1,sub_a+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2594 goto subU16 ; sub_c = sub_a - sub_b and return...
0
heinrichsweikamp
parents:
diff changeset
2595
heinrichsweikamp
parents:
diff changeset
2596 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2597
heinrichsweikamp
parents:
diff changeset
2598 global TFT_update_batt_voltage
heinrichsweikamp
parents:
diff changeset
2599 TFT_update_batt_voltage:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2600 movff batt_percent,lo ; get battery percent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2601 clrf hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2602 call TFT_color_code_battery ; color-code battery percent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2603 ; Setup charge indicator
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2604 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2605 bsf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2606 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2607 movlw color_yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2608 btfsc cv_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2609 movlw color_green
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2610 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2611 call TFT_set_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2612
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2613 IFDEF _ostc_logo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2614 WIN_TINY batt_percent_column,batt_percent_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2615 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2616 WIN_SMALL batt_percent_column+.2,batt_percent_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2617 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2618
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2619 output_16_3 ; display only last three digits from a 16 bit value (0-999)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2620 STRCAT_PRINT "% "
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2621 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
2622 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2623
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2624 IFDEF _ostc_logo
0
heinrichsweikamp
parents:
diff changeset
2625 WIN_TINY batt_voltage_column,batt_voltage_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2626 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2627 WIN_TINY batt_voltage_column+.15,batt_voltage_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2628 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2629
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2630 movff battery_type,lo ; =0: 1.5V, =1: 3.6V Saft, =2: LiIon 3.7V/0.8Ah, =3: LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2631 PUTC "T"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2632 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2633 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2634 PUTC ":"
0
heinrichsweikamp
parents:
diff changeset
2635 movff batt_voltage+0,lo
heinrichsweikamp
parents:
diff changeset
2636 movff batt_voltage+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2637 output_16dp .2
0
heinrichsweikamp
parents:
diff changeset
2638 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2639 PUTC 'V'
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2640 movff buffer+8,buffer+6
0
heinrichsweikamp
parents:
diff changeset
2641 movlw 0x00
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2642 movff WREG,buffer+7 ; only "x.yV"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2643 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
2644 return
heinrichsweikamp
parents:
diff changeset
2645
heinrichsweikamp
parents:
diff changeset
2646 ;update_battery_debug:
heinrichsweikamp
parents:
diff changeset
2647 ; call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2648 ; WIN_TINY .70,.0
heinrichsweikamp
parents:
diff changeset
2649 ; movff battery_gauge+5,xC+3
heinrichsweikamp
parents:
diff changeset
2650 ; movff battery_gauge+4,xC+2
heinrichsweikamp
parents:
diff changeset
2651 ; movff battery_gauge+3,xC+1
heinrichsweikamp
parents:
diff changeset
2652 ; movff battery_gauge+2,xC+0
heinrichsweikamp
parents:
diff changeset
2653 ; ; battery_gauge:6 is nAs
heinrichsweikamp
parents:
diff changeset
2654 ; ; devide through 65536
heinrichsweikamp
parents:
diff changeset
2655 ; ; devide through 152
heinrichsweikamp
parents:
diff changeset
2656 ; ; Result is 0.01Ah in xC+1:xC+0
heinrichsweikamp
parents:
diff changeset
2657 ; movlw LOW .152
heinrichsweikamp
parents:
diff changeset
2658 ; movwf xB+0
heinrichsweikamp
parents:
diff changeset
2659 ; movlw HIGH .152
heinrichsweikamp
parents:
diff changeset
2660 ; movwf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2661 ; call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
2662 ; bsf leftbind
heinrichsweikamp
parents:
diff changeset
2663 ; movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
2664 ; movff xC+1,hi
heinrichsweikamp
parents:
diff changeset
2665 ; output_16
heinrichsweikamp
parents:
diff changeset
2666 ; STRCAT_PRINT "x.01Ah"
heinrichsweikamp
parents:
diff changeset
2667 ; WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2668 ; bcf leftbind
heinrichsweikamp
parents:
diff changeset
2669 ; return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2670
0
heinrichsweikamp
parents:
diff changeset
2671 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2672
heinrichsweikamp
parents:
diff changeset
2673 global TFT_convert_signed_16bit
heinrichsweikamp
parents:
diff changeset
2674 TFT_convert_signed_16bit:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2675 bcf neg_flag ; positive temperature
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2676 btfss hi,7 ; negative temperature ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2677 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2678 ; YES - negative temperature
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2679 bsf neg_flag ; negative temperature
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2680 PUTC '-' ; display "-"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2681 comf hi ; 16 bit sign change
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2682 negf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2683 btfsc STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2684 incf hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2685 return ; done
0
heinrichsweikamp
parents:
diff changeset
2686
heinrichsweikamp
parents:
diff changeset
2687 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2688
heinrichsweikamp
parents:
diff changeset
2689 global TFT_convert_date
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2690 TFT_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2691 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2692 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2693 tstfsz EEDATA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2694 bra TFT_convert_date_1 ; opt_dateformat is 1 or 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2695 ; opt_dateformat is 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2696 ; use MMDDYY
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2697 movff lo,lo_temp ; incoming: lo = day, hi = month
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2698 movff hi,lo ; swap
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2699 movff lo_temp,hi ; now: lo = month, hi = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2700 bra TFT_convert_date_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2701
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2702 TFT_convert_date_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2703 decfsz EEDATA,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2704 bra TFT_convert_date_2 ; opt_dateformat is 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2705 ; opt_dateformat is 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2706 ; use DDMMYY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2707 TFT_convert_date_common:
0
heinrichsweikamp
parents:
diff changeset
2708 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2709 output_99x ; with lo = month or day or year
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2710 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2711 movff hi,lo ; now lo = day or month or month
0
heinrichsweikamp
parents:
diff changeset
2712 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2713 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2714 movff up,lo ; now lo = year or year or day
0
heinrichsweikamp
parents:
diff changeset
2715 output_99x
heinrichsweikamp
parents:
diff changeset
2716 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2717 return
heinrichsweikamp
parents:
diff changeset
2718
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2719 TFT_convert_date_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2720 ; opt_dateformat is 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2721 ; use YYMMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2722 movff lo,lo_temp ; incoming: lo = day, up = year
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2723 movff up,lo ; swap
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2724 movff lo_temp,up ; now : lo = year, up = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2725 bra TFT_convert_date_common
0
heinrichsweikamp
parents:
diff changeset
2726
heinrichsweikamp
parents:
diff changeset
2727 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2728
heinrichsweikamp
parents:
diff changeset
2729 global TFT_convert_date_short
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2730 TFT_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2731 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2732 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2733 tstfsz EEDATA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2734 bra TFT_convert_date_short_1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2735 ; opt_dateformat is 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2736 ; use MMDD(YY)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2737 TFT_convert_date_short_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2738 movff lo,lo_temp ; incoming: lo = day, hi = month
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2739 movff hi,lo ; swap
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2740 movff lo_temp,hi ; now: lo = month, hi = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2741 bra TFT_convert_date_short_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2742
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2743 TFT_convert_date_short_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2744 decfsz EEDATA,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2745 bra TFT_convert_date_short_0 ; opt_dateformat is 2 -> use (YY)MMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2746 ; opt_dateformat is 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2747 ; use DDMM(YY)
0
heinrichsweikamp
parents:
diff changeset
2748 TFT_convert_date_short_common:
heinrichsweikamp
parents:
diff changeset
2749 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2750 output_99x ; with lo = month or day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2751 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2752 movff hi,lo ; now lo = day or month
0
heinrichsweikamp
parents:
diff changeset
2753 output_99x
heinrichsweikamp
parents:
diff changeset
2754 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2755 return
heinrichsweikamp
parents:
diff changeset
2756
heinrichsweikamp
parents:
diff changeset
2757 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2758
heinrichsweikamp
parents:
diff changeset
2759 global TFT_date
heinrichsweikamp
parents:
diff changeset
2760 TFT_date:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2761 WIN_SMALL surf_date_column,surf_date_row ; init new wordprocessor
0
heinrichsweikamp
parents:
diff changeset
2762 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2763 movff day,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2764 movff month,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2765 movff year,up
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2766 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
2767 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2768 return
heinrichsweikamp
parents:
diff changeset
2769
heinrichsweikamp
parents:
diff changeset
2770 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2771
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2772 global TFT_max_depth_alternative
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2773 TFT_max_depth_alternative:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2774 bcf FLAG_TFT_max_depth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2775 ; The "mask"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2776 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2777 WIN_TINY dm_mask_depth_column, dm_max_alt_row-.14
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2778 btfsc FLAG_apnoe_mode ; in Apnea mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2779 bra TFT_max_depth_alternative2 ; YES - always draw max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2780 TSTOSS opt_2ndDepthDisp ; draw avg depth instead of max depth?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2781 bra TFT_max_depth_alternative2 ; NO - draw max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2782 STRCAT_TEXT_PRINT tAvgDepth ; YES - print avg depth mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2783 movff avg_rel_pressure_total+0,lo ; - get avg depth, low byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2784 movff avg_rel_pressure_total+1,hi ; - high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2785 bra TFT_max_depth_alternative3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2786 TFT_max_depth_alternative2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2787 STRCAT_TEXT_PRINT tMaxDepth ; print max depth mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2788 SAFE_2BYTE_COPY max_pressure, lo ; get max depth into hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2789 TFT_max_depth_alternative3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2790 call adjust_depth_with_salinity ; compute salinity setting into lo:hi [mbar]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2791 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2792 WIN_LARGE dm_max_alt_column,dm_max_alt_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2793 TSTOSS opt_units ; 0=m or 1=ft?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2794 bra TFT_max_depth_alt_metric ; 0 - use alternative metric version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2795 bra TFT_max_depth_imperial ; 1 - use common imperial version
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2796 TFT_max_depth_alt_metric:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2797 movff hi,sub_b+1 ; backup hi in sub_b+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2798 movff lo,sub_b+0 ; backup lo in sub_b+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2799 bsf ignore_digit4 ; no 0.1 m
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2800 output_16
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2801 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2802 WIN_MEDIUM dm_max_dm_alt_column,dm_max_alt_row+.25
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2803 bra TFT_max_depth_metric3 ; continue with normal metric version for decimal
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2804
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2805
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2806 global TFT_max_depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2807 TFT_max_depth:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2808 bcf FLAG_TFT_max_depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2809 btfsc FLAG_apnoe_mode ; in Apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2810 bra TFT_max_depth1 ; YES - different handling in Apnoe mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2811 TSTOSS opt_2ndDepthDisp ; draw avg depth instead of max depth?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2812 bra TFT_max_depth2 ; NO - show max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2813 movff avg_rel_pressure_total+0,lo ; YES - get avg depth, low byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2814 movff avg_rel_pressure_total+1,hi ; - high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2815 bra TFT_max_depth3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2816 TFT_max_depth1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2817 btfss FLAG_active_descent ; are we descending?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2818 bra TFT_max_depth2 ; NO - show normal max
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2819 SAFE_2BYTE_COPY apnoe_max_pressure,lo ; YES - get apnoe_max_pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2820 bra TFT_max_depth3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2821 TFT_max_depth2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2822 SAFE_2BYTE_COPY max_pressure,lo ; get the "normal" max depth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2823 TFT_max_depth3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2824 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2825 movlw .039 ; load encoding for 99.84 m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2826 cpfslt hi ; is depth to show > 99.84 m ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2827 bra TFT_max_depth3a ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2828 btfss max_depth_greater_100m ; NO - was depth > 100 m during last call?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2829 bra TFT_max_depth3c ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2830 bcf max_depth_greater_100m ; YES - clear flag, last depth shown now not > 100 m anymore
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2831 bra TFT_max_depth3b ; - clear depth area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2832 TFT_max_depth3a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2833 btfsc max_depth_greater_100m ; YES - was depth > 100 m during last call?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2834 bra TFT_max_depth3c ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2835 bsf max_depth_greater_100m ; NO - set flag, last depth shown now > 100 m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2836 ;bra TFT_max_depth3b ; - clear depth area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2837 TFT_max_depth3b:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2838 WIN_BOX_BLACK dm_max_depth_row, dm_max_depth_bot, dm_max_depth_column, dm_max_depth_rgt ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2839 TFT_max_depth3c:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2840 call TFT_memo_color ; set output color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2841 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2842 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2843 bra TFT_max_depth4 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2844 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row ; YES - adopt output position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2845 TFT_max_depth4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2846 TSTOSS opt_units ; 0=m or 1=ft ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2847 bra TFT_max_depth_metric ; 0 - use metric version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2848 TFT_max_depth_imperial: ; 1 - use imperial version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2849 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2850 output_16_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2851 bra TFT_max_depth_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2852 TFT_max_depth_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2853 btfss max_depth_greater_100m ; depth to show > 100 m ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2854 bra TFT_max_depth_metric0 ; NO - show meters and decimeters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2855 bsf ignore_digit4 ; YES - show full meters only, i.e. ignore digits 4 and 5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2856 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2857 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2858 bra TFT_max_depth_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2859 TFT_max_depth_metric0:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2860 movff hi,sub_b+1 ; copy hi to sub_b+1, will also be used to back-up hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2861 movff lo,sub_b+0 ; copy lo to sub_b+0, will also be used to back-up lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2862
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2863 movlw HIGH d'999'
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2864 movwf sub_a+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2865 movlw LOW d'999'
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2866 movwf sub_a+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2867 call sub16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2868 movlw ' '
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2869 btfss neg_flag ; depth lower than 10m ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2870 movwf POSTINC2 ; YES - add extra space
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2871
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2872 clrf sub_a+1
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2873 movlw d'99'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2874 movwf sub_a+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2875 call subU16 ; sub_c = sub_a - sub_b
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2876 btfss neg_flag ; depth lower than 1m ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2877 bra TFT_max_depth_metric1 ; YES - manually display a zero
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2878 bsf ignore_digit4 ; NO - no 0.1 m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2879 bsf leftbind ; - align left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2880 output_16 ; - display full meters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2881 bra TFT_max_depth_metric2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2882 TFT_max_depth_metric1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2883 STRCAT "0" ; display a zero
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2884 TFT_max_depth_metric2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2885 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2886 ; .1 m in SMALL font
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2887 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2888 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2889 bra TFT_max_depth_metric3 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2890 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row ; YES - adopt position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2891 TFT_max_depth_metric3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2892 movff sub_b+1,hi ; restore hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2893 movff sub_b+0,lo ; restore lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2894 PUTC "." ; print decimal point
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2895 movlw d'4'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2896 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2897 bsf ignore_digit5 ; no 0.01 m, flag will be cleared by output_16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2898 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2899 output_16dp d'0'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2900 TFT_max_depth_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2901 STRCAT_PRINT ""
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2902 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2903 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
2904
heinrichsweikamp
parents:
diff changeset
2905 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2906
0
heinrichsweikamp
parents:
diff changeset
2907 global TFT_divemins
heinrichsweikamp
parents:
diff changeset
2908 TFT_divemins:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2909 bcf FLAG_TFT_divemins ; clear flag
0
heinrichsweikamp
parents:
diff changeset
2910 movff divemins+0,lo
heinrichsweikamp
parents:
diff changeset
2911 movff divemins+1,hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2912
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2913 ; Already showing divemins > 99min
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2914 btfsc no_more_divesecs ; ignore seconds?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2915 bra TFT_divemins2 ; show minutes only
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2916
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2917 tstfsz hi ; hi = 0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2918 bra TFT_divemins_clr ; NO - show mins only
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2919
0
heinrichsweikamp
parents:
diff changeset
2920 movlw .99
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2921 cpfsgt lo ; bigger than 99?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2922 bra TFT_divemins1 ; NO - show mins:secs
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2923
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2924 TFT_divemins_clr:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2925 ; YES - remove second display for the rest of the dive and clear seconds
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2926 bsf no_more_divesecs ; - set flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2927 ; - clear rest of seconds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2928 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot, dm_divetime_column, dm_divetime_rgt ;top, bottom, left, right
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2929 bra TFT_divemins2 ; - show minutes only
0
heinrichsweikamp
parents:
diff changeset
2930
heinrichsweikamp
parents:
diff changeset
2931 TFT_divemins1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2932 ; Print out the minutes, up to 99 minutes, only 2 chars!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2933 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2934 WIN_MEDIUM dm_divetime_column, dm_divetime_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2935 output_99 ; displays only last two figures from a 8 bit value (0-99)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2936 STRCAT_PRINT "" ; show minutes in large font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2937
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2938 ; Print out the seconds
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2939 WIN_SMALL dm_divetime_secs_column, dm_divetime_secs_row ; left position for two sec figures
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2940 PUTC ':'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2941 movff divesecs,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2942 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2943 output_99x ; displays only last two figures from a 8 bit value with leading zero (00-99)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2944 bra TFT_divemins_exit ; and return...
0
heinrichsweikamp
parents:
diff changeset
2945
heinrichsweikamp
parents:
diff changeset
2946 TFT_divemins2:
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2947 ; Full minutes only
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2948 call TFT_memo_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2949 WIN_MEDIUM dm_divetime_minsonly_column, dm_divetime_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2950 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2951 output_16_4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2952 bra TFT_divemins_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2953
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2954
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2955 global TFT_divemins_alternative
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2956 TFT_divemins_alternative:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2957 bcf FLAG_TFT_divemins ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2958 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2959 ; Print out the minutes (0-999) in large
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2960 WIN_LARGE dm_divetime_alt_column, dm_divetime_alt_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2961 movff divemins+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2962 movff divemins+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2963 output_16_3 ; limit to 999 and display only (0-999)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2964 STRCAT_PRINT "" ; show minutes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2965 ; Print out the seconds in medium
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2966 WIN_MEDIUM dm_divetime_alt_column+.60, dm_divetime_alt_row+.25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2967 PUTC ":"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2968 movff divesecs,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2969 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2970 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2971 TFT_divemins_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2972 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2973 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2974 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
2975
heinrichsweikamp
parents:
diff changeset
2976 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2977
0
heinrichsweikamp
parents:
diff changeset
2978 global TFT_display_apnoe_surface
heinrichsweikamp
parents:
diff changeset
2979 TFT_display_apnoe_surface:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2980 btfsc menuview ; is the options menu shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2981 bra TFT_display_apnoe_surface_1 ; YES - skip title
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2982 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2983 WIN_TINY dm_apnoe_surface_time_text_col, dm_apnoe_surface_time_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2984 STRCPY_TEXT_PRINT tApnoeSurface
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2985 TFT_display_apnoe_surface_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2986 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2987 WIN_MEDIUM dm_apnoe_surface_time_column, dm_apnoe_surface_time_row
0
heinrichsweikamp
parents:
diff changeset
2988 movff apnoe_surface_mins,lo
heinrichsweikamp
parents:
diff changeset
2989 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2990 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
2991 movff apnoe_surface_secs,lo
heinrichsweikamp
parents:
diff changeset
2992 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2993 bra TFT_display_apnoe_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2994
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2995
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2996 global TFT_display_apnoe_last_max
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2997 TFT_display_apnoe_last_max:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2998 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2999 WIN_TINY dm_apnoe_last_max_depth_text_col, dm_apnoe_last_max_depth_text_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3000 STRCPY_TEXT_PRINT tApnoeMax
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3001 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3002 SAFE_2BYTE_COPY max_pressure, lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3003 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3004 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3005 bra TFT_display_apnoe_last_m_metric
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3006 TFT_display_apnoe_last_max_imp:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3007 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3008 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3009 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3010 bra TFT_max_depth_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3011 TFT_display_apnoe_last_m_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3012 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3013 bsf ignore_digit5 ; do not display 1cm depth (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3014 output_16dp d'3'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3015 bra TFT_max_depth_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3016
0
heinrichsweikamp
parents:
diff changeset
3017
heinrichsweikamp
parents:
diff changeset
3018 global TFT_display_apnoe_descent
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3019 TFT_display_apnoe_descent: ; descent divetime
0
heinrichsweikamp
parents:
diff changeset
3020 movff apnoe_mins,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3021 clrf hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3022 WIN_MEDIUM dm_divetime_apnoe_column, dm_divetime_apnoe_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3023 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3024 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3025 STRCAT_PRINT "" ; show minutes in large font
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3026 WIN_SMALL dm_divetime_apnoe_secs_column, dm_divetime_apnoe_secs_row ; left position for two sec figures
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3027 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
3028 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3029 movff apnoe_secs,lo
heinrichsweikamp
parents:
diff changeset
3030 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3031 STRCAT_PRINT "" ; show seconds in small font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3032 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3033 WIN_TINY dm_total_apnoe_text_column,dm_total_apnoe_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3034 STRCPY_TEXT_PRINT tApnoeTotal
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3035 call TFT_memo_color
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3036 movff divemins,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3037 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3038 WIN_MEDIUM dm_apnoe_total_divetime_column, dm_apnoe_total_divetime_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3039 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3040 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3041 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3042 STRCAT_PRINT "" ; show minutes in large font
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3043 WIN_SMALL dm_apnoe_total_divetime_secs_col, dm_apnoe_total_divetime_secs_row ; left position for two sec figures
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3044 PUTC ':'
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3045 bsf leftbind
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3046 movff divesecs,lo
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3047 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3048 TFT_display_apnoe_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3049 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3050 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3051 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3052
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3053
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3054 global TFT_apnoe_clear_surface
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3055 TFT_apnoe_clear_surface:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3056 ; clear surface timer (TODO: partly wipes out options menu, too)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3057 WIN_BOX_BLACK dm_apnoe_surface_time_text_row, .239, dm_apnoe_surface_time_text_col, .159 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
3058 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3059
0
heinrichsweikamp
parents:
diff changeset
3060
heinrichsweikamp
parents:
diff changeset
3061 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3062 ; append firmware version to current string, including color-coding
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3063
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3064 global TFT_cat_firmware
0
heinrichsweikamp
parents:
diff changeset
3065 TFT_cat_firmware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3066 movlw softwareversion_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3067 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3068 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3069 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3070 PUTC '.'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3071 movlw softwareversion_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3072 movwf lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3073 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3074 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3075 rcall check_expiry
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3076 btfss aux_flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3077 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3078 bsf win_invert
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3079 goto TFT_attention_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3080
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3081 ;=============================================================================
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3082 ; check if firmware is within expiry period, will return aux_flag set if not
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3083
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3084 check_expiry: ; check if it is time for a firmware update
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3085 bsf aux_flag ; set firmware as expired by default
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3086 movlw firmware_expire_year ; start with checking year
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3087 cpfsgt year ; current year > expiry year ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3088 bra check_expiry_Y ; NO - continue checks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3089 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3090 check_expiry_Y:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3091 cpfseq year ; current year = expiry year ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3092 bra check_expiry_ok ; NO - must be < then, OK whatever month & day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3093 movlw firmware_expire_month ; YES - continue checking month
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3094 cpfsgt month ; current month > expiry month ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3095 bra check_expiry_M ; NO - continue checks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3096 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3097 check_expiry_M:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3098 cpfseq month ; current month = expiry month ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3099 bra check_expiry_ok ; NO - must be < then, OK whatever day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3100 movlw firmware_expire_day ; YES - continue checking day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3101 cpfsgt day ; current day > expiry day ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3102 bra check_expiry_ok ; NO - must be <= then, OK
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3103 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3104 check_expiry_ok:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3105 bcf aux_flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3106 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3107
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3108 ;=============================================================================
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3109 ; append firmware BETA status to current string, including color-coding
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3110
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3111 global TFT_cat_beta_rel
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3112 global TFT_cat_beta_release
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3113 TFT_cat_beta_release: ; entry point for printing "Release" / "Beta #"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3114 bsf aux_flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3115 bra TFT_cat_beta_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3116 TFT_cat_beta_rel: ; entry point for printing "Rel." / "B. #"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3117 bcf aux_flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3118 TFT_cat_beta_common:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3119 IFDEF __DEBUG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3120 STRCAT "DEBUG"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3121 goto TFT_warnings_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3122 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3123 movlw softwareversion_beta ; =0: release, =1: beta 1, =2: beta 2, ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3124 movwf lo ; copy to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3125 tstfsz lo ; release version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3126 bra TFT_cat_beta_1 ; NO - must be beta version then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3127 btfss aux_flag ; YES - shall show long version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3128 bra TFT_cat_beta_2 ; NO - show short version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3129 rcall check_expiry ; YES - check expiry date
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3130 btfsc aux_flag ; - within expiry date?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3131 bra TFT_cat_beta_4 ; NO - give update cue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3132 STRCAT "Release" ; YES - print "Release"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3133 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3134 TFT_cat_beta_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3135 btfss aux_flag ; shall show long version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3136 bra TFT_cat_beta_3 ; NO - show short version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3137 STRCAT "Beta " ; YES - show long version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3138 TFT_cat_beta_1a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3139 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3140 output_8 ; print beta version number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3141 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3142 goto TFT_attention_color ; and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3143 TFT_cat_beta_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3144 STRCAT "Rel." ; short version for "Release"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3145 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3146 TFT_cat_beta_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3147 STRCAT "B." ; short version for "Beta"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3148 bra TFT_cat_beta_1a ; append beta version number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3149 TFT_cat_beta_4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3150 STRCAT "update!" ; print update cue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3151 goto TFT_attention_color ; and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3152 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3153
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3154 ;=============================================================================
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3155 ; For the Information menu: firmware version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3156
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3157 global info_menu_firmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3158 info_menu_firmware:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3159 lfsr FSR1,tFirmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3160 call strcat_text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3161 rcall TFT_cat_firmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3162 PUTC " "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3163 rcall TFT_cat_beta_rel
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3164 STRCAT_PRINT "" ; print buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3165 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3166
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3167 ;=============================================================================
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3168 ; For the Information menu: firmware version of the RX processor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3169
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3170 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3171 global info_menu_firmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3172 info_menu_firmware_rx:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3173 lfsr FSR1,tFirmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3174 call strcat_text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3175 ; bra TFT_cat_firmware_rx ;(and return)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3176 ;TFT_cat_firmware_rx:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3177 movff rx_firmware+0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3178 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3179 output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3180 PUTC '.'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3181 movff rx_firmware+1,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3182 output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3183 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3184 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3185 ENDIF
0
heinrichsweikamp
parents:
diff changeset
3186
heinrichsweikamp
parents:
diff changeset
3187 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3188 ; For the Information menu: append serial number
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3189
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3190 global info_menu_serial
0
heinrichsweikamp
parents:
diff changeset
3191 info_menu_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3192 lfsr FSR1,tSerial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3193 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3194 global TFT_cat_serial
0
heinrichsweikamp
parents:
diff changeset
3195 TFT_cat_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3196 clrf EEADRH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3197 clrf EEADR ; get serial number LOW
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3198 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3199 movff EEDATA,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3200 incf EEADR,F ; get serial number HIGH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3201 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3202 movff EEDATA,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3203
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3204 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3205 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3206 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3207 return
0
heinrichsweikamp
parents:
diff changeset
3208
heinrichsweikamp
parents:
diff changeset
3209 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3210 ; For the Information menu: append total dives
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3211
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3212 global info_menu_total_dives
0
heinrichsweikamp
parents:
diff changeset
3213 info_menu_total_dives:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3214 lfsr FSR1,tTotalDives
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3215 call strcat_text
0
heinrichsweikamp
parents:
diff changeset
3216 TFT_cat_total_dives:
heinrichsweikamp
parents:
diff changeset
3217 read_int_eeprom .2
heinrichsweikamp
parents:
diff changeset
3218 movff EEDATA,lo
heinrichsweikamp
parents:
diff changeset
3219 read_int_eeprom .3
heinrichsweikamp
parents:
diff changeset
3220 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
3221 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3222 output_16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3223 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3224 return
0
heinrichsweikamp
parents:
diff changeset
3225
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3226 ; For the Information menu: append battery voltage
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3227 global info_menu_battery_volts
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3228 info_menu_battery_volts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3229 lfsr FSR1,tBatteryV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3230 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3231 movff batt_voltage+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3232 movff batt_voltage+0,lo
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3233 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3234 output_16dp .2 ; x.xxx
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3235 STRCAT "V(T"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3236 movff battery_type,lo ; =0:1.5V, =1:3.6V Saft, =2:LiIon 3.7V/0.8Ah, =3:LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3237 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3238 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3239 PUTC ")"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3240 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3241
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3242 ; For the Information menu: append uptime
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3243 global info_menu_uptime
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3244 info_menu_uptime:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3245 lfsr FSR1,tUptime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3246 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3247 movff uptime+0,xC+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3248 movff uptime+1,xC+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3249 movff uptime+2,xC+2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3250 movff uptime+3,xC+3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3251 movlw LOW .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3252 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3253 movlw HIGH .3600
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3254 movwf xB+1 ; one day = 3600s
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3255 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3256 ;xC+0:xC+1 -> Full hours
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3257 movff xC+1,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3258 movff xC+0,xA+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3259 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3260 movlw .24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3261 movwf xB+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3262 call div16x16 ; xC = xA / xB with xA as remainder
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3263 movff xC+0,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3264 movff xC+1,hi ; full days
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3265 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3266 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3267 PUTC "d"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3268 movff xA+0,lo ; full hours
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3269 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3270 PUTC "h"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3271 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3272 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3273
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3274
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3275 global menu_cal_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3276 menu_cal_x:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3277 lfsr FSR0,compass_CX_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3278 lfsr FSR1,tCalX
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3279 bra menu_cal_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3280
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3281 global menu_cal_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3282 menu_cal_y:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3283 lfsr FSR0,compass_CY_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3284 lfsr FSR1,tCalY
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3285 bra menu_cal_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3286
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3287 global menu_cal_z
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3288 menu_cal_z:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3289 lfsr FSR0,compass_CZ_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3290 lfsr FSR1,tCalZ
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3291 menu_cal_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3292 call strcat_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3293 movff POSTINC0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3294 movff POSTINC0,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3295 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3296 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3297 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3298 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3299 return
544
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3300
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3301
0
heinrichsweikamp
parents:
diff changeset
3302 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3303 ; ppO2 menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3304
0
heinrichsweikamp
parents:
diff changeset
3305 global divesets_ppo2_min
heinrichsweikamp
parents:
diff changeset
3306 divesets_ppo2_min:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3307 lfsr FSR1,tPPO2MIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3308 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3309 movff char_I_ppO2_min,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3310 movlw ppo2_warning_low_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3311 bra divesets_ppo2_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3312
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3313 global divesets_ppo2_min_cc
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3314 divesets_ppo2_min_cc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3315 lfsr FSR1,tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3316 call strcat_text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3317 movff char_I_ppO2_min_loop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3318 movlw ppo2_warning_loop_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3319 bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3320
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3321 global divesets_ppo2_max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3322 divesets_ppo2_max:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3323 lfsr FSR1,tPPO2Max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3324 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3325 movff char_I_ppO2_max,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3326 movlw ppo2_warning_high_default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3327 bra divesets_ppo2_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3328
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3329 global divesets_ppo2_max_deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3330 divesets_ppo2_max_deco:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3331 lfsr FSR1,tPPO2DECO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3332 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3333 movff char_I_ppO2_max_deco,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3334 movlw ppo2_warning_deco_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3335 ;bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3336
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3337 divesets_ppo2_common:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3338 movwf up ; save default value
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3339 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3340 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3341 output_16dp d'3'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3342 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3343 lfsr FSR1,tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3344 call strcat_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3345 movf up,W ; default value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3346 cpfseq lo ; current value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3347 bra divesets_ppo2_common2 ; not default, add *
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3348 return ; default, done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3349 divesets_ppo2_common2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3350 PUTC "*"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3351 return ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3352
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3353 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3354
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3355 global TFT_clear_warning_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3356 TFT_clear_warning_text:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3357 btfss divemode ; in divemode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3358 bra TFT_clear_warning_text2 ; NO - setup for surface mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3359 bcf FLAG_TFT_dive_warning_text_clear ; clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3360 btfsc alternative_divelayout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3361 bra TFT_clear_warning_text_2nd_row ; in alt. mode, clear only row 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3362 WIN_BOX_BLACK dm_warning_row, dm_warning_bot, dm_warning_column, dm_warning_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3363 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3364 TFT_clear_warning_text2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3365 WIN_BOX_BLACK surf_warning1_row, surf_warning2_row+.24, surf_warning1_column, surf_warning1_column+.76 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3366 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3367
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3368 global TFT_clear_warning_text_2nd_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3369 TFT_clear_warning_text_2nd_row:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3370 btfss divemode ; in divemode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3371 bra TFT_clear_warning_text_2nd_2 ; NO - setup for surface mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3372 bcf FLAG_TFT_dive_warning_text_clr2 ; clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3373 WIN_BOX_BLACK dm_warning2_row, dm_warning2_bot, dm_warning2_column, dm_warning2_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3374 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3375 TFT_clear_warning_text_2nd_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3376 WIN_BOX_BLACK surf_warning2_row, surf_warning2_row+.24, surf_warning2_column, surf_warning2_column+.76 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3377 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3378
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3379 global TFT_fillup_with_spaces
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3380 TFT_fillup_with_spaces: ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3381 movwf lo ; save max. string length into lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3382 movf FSR2L,W ; get current string length
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3383 subwf lo,F ; lo-WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3384 btfsc STATUS,N ; longer then #lo already?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3385 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3386 tstfsz lo ; zero?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3387 bra TFT_fillup_with_spaces2 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3388 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3389 TFT_fillup_with_spaces2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3390 PUTC " " ; add one space
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3391 decfsz lo,F ; all done?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3392 bra TFT_fillup_with_spaces2 ; NO - loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3393 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3394
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3395 ;=============================================================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3396
0
heinrichsweikamp
parents:
diff changeset
3397 global TFT_desaturation_time
heinrichsweikamp
parents:
diff changeset
3398 TFT_desaturation_time:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3399 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3400 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3401 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3402 call TFT_memo_color
0
heinrichsweikamp
parents:
diff changeset
3403 STRCPY "Desat:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3404 movff int_O_desaturation_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3405 movff int_O_desaturation_time+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3406 call convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3407 ; bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3408 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3409 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3410 movwf hi ; exchange lo and hi...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3411 output_99x ; hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3412 PUTC ':'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3413 movff hi,lo ; minutes
0
heinrichsweikamp
parents:
diff changeset
3414 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3415 ; bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3416 movlw surf_warning_length ; only use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3417 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3418 ; movlw .0 ; not needed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3419 ; movff WREG,buffer+11 ; not needed
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3420 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
3421 return
heinrichsweikamp
parents:
diff changeset
3422
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3423
0
heinrichsweikamp
parents:
diff changeset
3424 global TFT_nofly_time
heinrichsweikamp
parents:
diff changeset
3425 TFT_nofly_time:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3426 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3427 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3428 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3429 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3430 movff char_I_altitude_wait,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3431 tstfsz WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3432 bra TFT_nofly_time_1
0
heinrichsweikamp
parents:
diff changeset
3433 STRCPY "NoFly:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3434 bra TFT_nofly_time_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3435 TFT_nofly_time_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3436 STRCPY "NoAlt:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3437 TFT_nofly_time_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3438 movff int_O_nofly_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3439 movff int_O_nofly_time+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3440 call convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3441 ; bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3442 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3443 movff hi,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3444 movwf hi ; exchange lo and hi...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3445 output_99x ; hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3446 PUTC ':'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3447 movff hi,lo ; minutes
0
heinrichsweikamp
parents:
diff changeset
3448 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3449 ; bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3450 movlw surf_warning_length ; only use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3451 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3452 ; movlw .0 ; not needed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3453 ; movff WREG,buffer+11 ; not needed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3454 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
3455 return
heinrichsweikamp
parents:
diff changeset
3456
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3457 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3458
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3459 global TFT_warning_agf
0
heinrichsweikamp
parents:
diff changeset
3460 TFT_warning_agf:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3461 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3462 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3463 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3464 call TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3465 STRCPY_TEXT tDiveaGF_active ; "aGF!"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3466 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3467 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3468 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3469 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3470
0
heinrichsweikamp
parents:
diff changeset
3471
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3472 global TFT_warning_fallback
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3473 TFT_warning_fallback: ; show fallback warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3474 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3475 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3476 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3477 call TFT_warnings_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3478 STRCPY_TEXT tDiveFallback ; "Fallback!"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3479 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3480 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3481 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3482 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3483
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3484
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3485 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3486
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3487 global TFT_advice_switch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3488 TFT_advice_switch:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3489 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3490 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3491 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3492 call TFT_advice_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3493 STRCPY_TEXT tswap ; "Swap Tank"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3494 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3495 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3496 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3497 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3498
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3499 global TFT_attention_transmitter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3500 TFT_attention_transmitter:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3501 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3502 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3503 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3504 call TFT_attention_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3505 STRCPY_TEXT tTransmitter ; "P.Transm."
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3506 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3507 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3508 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3509 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3510
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3511 global TFT_attention_pres_reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3512 global TFT_warning_pres_reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3513 TFT_attention_pres_reading: ; entry point for attention
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3514 call TFT_attention_color ; use attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3515 bra TFT_common_pres_reading ; continue with common code
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3516 TFT_warning_pres_reading: ; entry point for warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3517 call TFT_warnings_color ; use warnings color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3518 ;bra TFT_common_pres_reading ; continue with common code
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3519 TFT_common_pres_reading:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3520 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3521 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3522 return ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3523 STRCPY_TEXT tPressure ; "Tank Pres"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3524 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3525 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3526 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3527 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3528
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3529 global TFT_attention_sac
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3530 TFT_attention_sac:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3531 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3532 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3533 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3534 movff int_O_sac_rate+0,lo ; copy SAC rate to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3535 movff int_O_sac_rate+1,hi ; ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3536 call TFT_color_code_tank_pres_sac; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3537 STRCPY_TEXT tSAC ; "SAC", needs to be exactly 3 chars long
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3538 STRCAT ": " ; ": "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3539 output_16_3 ; print as xxx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3540 PUTC " " ; print a dummy char to have string termination at the correct place
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3541 movff buffer+.7,buffer+.8 ; move decimal digit one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3542 movlw "." ; load coding of a decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3543 movff WREG,buffer+.7 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3544 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3545 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3546
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3547 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3548
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3549
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3550 global TFT_info_deco
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3551 TFT_info_deco ; show info when decompression obligation is decreasing
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3552 rcall TFT_warning_set_window ; sets the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3553 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3554 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3555 call TFT_advice_color ; actually it is a memo, but we break the rules here and display in advice color (green)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3556 STRCPY_TEXT tDecoInfo ; write "Deco Zone"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3557 movlw dm_warning_length ; select divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3558 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3559 STRCAT_PRINT "" ; print buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3560 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3561
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3562
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3563 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3564
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3565 global TFT_info_cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3566 TFT_info_cave_mode:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3567 rcall TFT_warning_set_window ; sets the row and column for the current warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3568 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3569 return ; NO - return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3570 call TFT_memo_color ; YES - set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3571 STRCPY_TEXT tCaveMode ; write "Cave Mode"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3572 movlw dm_warning_length ; select divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3573 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3574 STRCAT_PRINT "" ; print buffer
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3575 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3576
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3577 global TFT_info_dive_turned
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3578 TFT_info_dive_turned:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3579 rcall TFT_warning_set_window ; sets the row and column for the current warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3580 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3581 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3582 call TFT_attention_color ; YES - set attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3583 STRCPY_TEXT tDiveTurned ; write "Dv.turned"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3584 movlw dm_warning_length ; select divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3585 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3586 STRCAT_PRINT "" ; print buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3587 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3588
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3589 global TFT_warn_cave_shutdown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3590 TFT_warn_cave_shutdown:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3591 rcall TFT_warning_set_window ; sets the row and column for the current warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3592 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3593 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3594 call TFT_warnings_color ; YES - set warning color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3595 STRCPY_TEXT tCaveModeShutdown ; write "X-Cave-X"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3596 movlw dm_warning_length ; select divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3597 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3598 STRCAT_PRINT "" ; print buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3599 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3600
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3601 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3602
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3603
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3604 global TFT_warning_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3605 TFT_warning_gf: ; GF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3606 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3607 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3608 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3609 movff int_O_gradient_factor+0,lo ; bank-safe copy gradient factor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3610 movff int_O_gradient_factor+1,hi ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3611 call TFT_color_code_gf ; color-code output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3612 STRCPY "GF: " ; the two spaces are on purpose to align the output with other warnings' outputs
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3613 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3614 output_8 ; print value of lo only, int_O_gradient_factor is limited to 255
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3615 PUTC "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3616 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3617 btfss divemode ; in divemode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3618 movlw surf_warning_length ; NO - use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3619 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3620 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3621 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3622 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3623 TFT_warn_att_info_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3624 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3625
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3626
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3627 global TFT_warning_mbubbles
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3628 TFT_warning_mbubbles:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3629 rcall TFT_warning_set_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3630 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3631 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3632 call TFT_attention_color ; set attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3633 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3634 btfsc WREG,mbubble_warning ; are we in the microbubbles zone right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3635 call TFT_warnings_color ; YES - reconfigure to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3636 STRCPY_TEXT tMicroBubbles
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3637 movlw dm_warning_length ; divemode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3638 btfss divemode ; in divemode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3639 movlw surf_warning_length ; NO - use surface string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3640 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3641 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3642 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3643
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3644
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3645 global TFT_warning_outside
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3646 TFT_warning_outside:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3647 rcall TFT_warning_set_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3648 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3649 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3650 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3651 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3652 btfsc WREG,outside_warning ; are we outside the ZH-L16 model right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3653 call TFT_warnings_color ; YES - reconfigure to warning color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3654 STRCPY "X-ZHL16-X"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3655 movlw dm_warning_length ; divemode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3656 btfss divemode ; in divemode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3657 movlw surf_warning_length ; NO - use surface string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3658 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3659 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3660 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3661
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3662
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3663 global TFT_warning_gas_needs_warn
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3664 global TFT_warning_gas_needs_att
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3665 TFT_warning_gas_needs_warn:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3666 rcall TFT_warning_gas_needs_war_helper
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3667 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3668 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3669 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3670 call TFT_warnings_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3671 bra TFT_warning_gas_needs_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3672 TFT_warning_gas_needs_att:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3673 rcall TFT_warning_gas_needs_att_helper
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3674 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3675 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3676 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3677 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3678 TFT_warning_gas_needs_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3679 STRCPY_TEXT tGasNeedsWarn ; "Gas Needs"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3680 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3681 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3682 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3683 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3684
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3685 TFT_warning_gas_needs_war_helper:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3686 incf message_counter,F ; increase counter
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3687 btfsc gas_needs_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3688 return ; NO - do not show the gas needs custom view again
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3689 bsf gas_needs_warning ; YES - memorize it's an old now
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3690 bra TFT_warning_gas_needs_helper_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3691 TFT_warning_gas_needs_att_helper:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3692 incf message_counter,F ; increase counter
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3693 btfsc gas_needs_attention ; is it a new attention?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3694 return ; NO - do not show the gas needs custom view again
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3695 bsf gas_needs_attention ; YES - memorize it's an old now
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3696 TFT_warning_gas_needs_helper_com:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3697 btfsc alternative_divelayout ; in alternative layout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3698 call switch_layout_to_normal ; YES - switch to normal layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3699 movlw index_gas_needs_ascent-1 ; custom view number one below gas needs view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3700 movwf menupos3 ; set custom view number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3701 bsf toggle_customview ; initiate toggle to desired custom view -> gas needs view will be shown
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3702 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3703
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3704
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3705 global TFT_warning_IBCD
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3706 TFT_warning_IBCD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3707 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3708 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3709 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3710 call TFT_attention_color ; select attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3711 STRCPY_TEXT tIBCD ; "IBCD N2He"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3712 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3713 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3714 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3715 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3716
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3717
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3718 global TFT_warning_no_BO_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3719 TFT_warning_no_BO_gas:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3720 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3721 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3722 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3723 call TFT_attention_color ; select attention color as default
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3724 STRCPY_TEXT tnoBOgas ; "B/O Gas X"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3725 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3726 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3727 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3728 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3729
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3730
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3731 global TFT_advice_gas_change
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3732 TFT_advice_gas_change:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3733 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3734 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3735 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3736 call TFT_advice_color ; set advice color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3737 STRCPY_TEXT tgaschange ; "Change?"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3738 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3739 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3740 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3741 bra TFT_warn_att_info_exit ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3742
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3743
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3744 global TFT_warning_sensor_disagree
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3745 TFT_warning_sensor_disagree: ; show sensor disagree warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3746 rcall TFT_warning_sensor_dis_helper
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3747 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3748 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3749 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3750 call TFT_warnings_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3751 STRCPY_TEXT tSensorDisagree ; "Sensors<>"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3752 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3753 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3754 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3755 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3756
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3757 TFT_warning_sensor_dis_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3758 btfsc sensor_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3759 return ; NO - do not show the gas needs custom view again
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3760 bsf sensor_warning ; YES - memorize it's an old warning now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3761 btfsc alternative_divelayout ; in alternative layout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3762 call switch_layout_to_normal ; YES - switch to normal layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3763 movlw index_ppo2_sensors-1 ; custom view number one below ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3764 movwf menupos3 ; set custom view number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3765 bsf toggle_customview ; initiate toggle to desired custom view -> ppO2 sensors
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3766 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3767
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3768 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3769
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3770 TFT_warning_set_window: ; set the row and column for the current message
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3771 ; ignore warning (now)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3772 decf message_counter,W ; -1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3773 bcf STATUS,C
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3774 btfss alternative_divelayout ; in alternative layout, do not divide...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3775 rrcf WREG,W ; (message_counter-1)/2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3776 cpfseq message_page
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3777 retlw .255 ; WREG <> 0 -> Warning window not defined
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3778 btfss divemode ; in divemode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3779 bra TFT_warning_set_window3 ; NO - setup for surface mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3780 btfss alternative_divelayout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3781 bra TFT_warning_set_window3a ; standard layout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3782 bra TFT_warning_set_window2a ; alternative layout (Only lower row used)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3783 TFT_warning_set_window3a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3784 btfss message_counter,0 ; toggle with each warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3785 bra TFT_warning_set_window2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3786 WIN_SMALL dm_warning1_column, dm_warning1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3787 bcf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3788 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3789 TFT_warning_set_window2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3790 bsf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3791 TFT_warning_set_window2a:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3792 WIN_SMALL dm_warning2_column, dm_warning2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3793 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3794 TFT_warning_set_window3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3795 btfss message_counter,0 ; toggle with each warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3796 bra TFT_warning_set_window4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3797 WIN_SMALL surf_warning1_column,surf_warning1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3798 bcf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3799 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3800 TFT_warning_set_window4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3801 WIN_SMALL surf_warning2_column,surf_warning2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3802 bsf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3803 retlw .0 ; WREG=0 -> Warning window defined
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3804
309
efb53af0d62a VSIbar #1: layout position changes
janos_kovacs <kovjanos@gmail.com>
parents: 307
diff changeset
3805
0
heinrichsweikamp
parents:
diff changeset
3806 global TFT_update_batt_percent_divemode
heinrichsweikamp
parents:
diff changeset
3807 TFT_update_batt_percent_divemode:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3808 rcall TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3809 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3810 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3811 movff batt_percent,lo ; get battery percent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3812 call TFT_color_code_battery ; color-code battery percent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3813 STRCPY "Batt:"
0
heinrichsweikamp
parents:
diff changeset
3814 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3815 output_8
heinrichsweikamp
parents:
diff changeset
3816 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3817 PUTC "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3818 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3819 btfss divemode ; in divemode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3820 movlw surf_warning_length ; NO - use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3821 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3822 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3823 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3824 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3825
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3826
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3827 global TFT_gf_factors_mask ; mask for GF factors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3828 TFT_gf_factors_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3829 call TFT_divemask_color
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3830 WIN_TINY dm_custom_gf_column1,dm_custom_gf_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3831 STRCPY_TEXT_PRINT tGFactors
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3832 WIN_TINY dm_custom_gf_column3,dm_custom_gf_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3833 STRCPY_TEXT_PRINT taGFactors
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3834 ; Show GF (static)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3835 call TFT_disabled_color ; default to disabled color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3836 btfss use_agf ; shall use alternative GF factors?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3837 call TFT_memo_color ; NO - switch to memo color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3838 WIN_STD dm_custom_gf_column1, dm_custom_gf_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3839 bsf leftbind
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3840 movff opt_GF_low,lo ; get normal GF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3841 output_8 ; print normal GF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3842 PUTC "/" ; print "/"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3843 movff opt_GF_high,lo ; get normal GF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3844 output_8 ; print normal GF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3845 STRCAT_PRINT "" ; finish output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3846 ; Show aGF (static)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3847 call TFT_memo_color ; default to memo color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3848 TSTOSS opt_enable_aGF ; are alternative GF factors enabled?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3849 bra TFT_gf_factors_mask_3 ; NO - show "---" and return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3850 ; YES - show aGF and which one is active
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3851 WIN_STD dm_custom_gf_column2, dm_custom_gf_row
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3852 btfss use_agf ; shall use aGF?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3853 bra TFT_gf_factors_mask_1 ; NO - print "<- "
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3854 STRCPY_PRINT " ->" ; YES - print " ->"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3855 bra TFT_gf_factors_mask_2 ; - continue with common part
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3856 TFT_gf_factors_mask_1:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3857 STRCPY_PRINT "<- " ; (NO) - print "<- "
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3858 TFT_gf_factors_mask_2: ; common part
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3859 btfss use_agf ; shall use aGF?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3860 call TFT_disabled_color ; NO - switch to disabled color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3861 WIN_STD dm_custom_gf_column3, dm_custom_gf_row
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3862 movff opt_aGF_low,lo ; get aGF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3863 output_8 ; print
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3864 PUTC "/" ; print "/"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3865 movff opt_aGF_high,lo ; get aGF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3866 output_8 ; print
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3867 STRCAT_PRINT "" ; finish output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3868 bra TFT_custview_exit1 ; done
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3869 TFT_gf_factors_mask_3:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3870 WIN_STD dm_custom_gf_column3+.10, dm_custom_gf_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3871 STRCPY_PRINT "---"
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3872 bra TFT_custview_exit1 ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3873
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3874
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3875 global TFT_ceiling_GF_tissue_mask ; mask for ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3876 TFT_ceiling_GF_tissue_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3877 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3878 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3879 STRCPY_TEXT_PRINT tCeiling
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3880 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3881 STRCPY_TEXT_PRINT tDiveTissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3882 ; collides with ceiling output and not really needed, too
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3883 ; WIN_TINY dm_custom_tissue_N2_column, dm_custom_tissue_N2_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3884 ; STRCPY_TEXT_PRINT tN2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3885 ; WIN_TINY dm_custom_tissue_He_column, dm_custom_tissue_He_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3886 ; STRCPY_TEXT_PRINT tHe
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3887 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3888 STRCPY_TEXT_PRINT tGFInfo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3889 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3890
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3891
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3892 global TFT_ceiling_GF_tissue ; data for ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3893 TFT_ceiling_GF_tissue:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3894 WIN_MEDIUM dm_custom_ceiling_column,dm_custom_ceiling_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3895 movff int_O_ceiling+0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3896 movff int_O_ceiling+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3897 call TFT_color_code_ceiling ; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3898 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3899 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3900 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3901 bra TFT_ceiling_tissue_cGF_m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3902 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3903 output_16 ; yxz
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3904 bra TFT_ceiling_tissue_cGF0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3905 TFT_ceiling_tissue_cGF_m:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3906 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3907 output_16dp .3 ; yxz.a
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3908 TFT_ceiling_tissue_cGF0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3909 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3910 STRCAT_PRINT " "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3911 ; Show tissue diagram
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3912 call DISP_tissue_saturation_graph; show char_O_tissue_N2_saturation and char_O_tissue_He_saturation
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
3913 ; Show current tissue supersaturation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3914 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3915 movff int_O_gradient_factor+0,lo ; gradient factor absolute, 100% = on M-line of straight Buhlmann
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3916 movff int_O_gradient_factor+1,hi ; hi byte holds flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3917 call TFT_color_code_gf ; color-code output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3918 output_8 ; need to print lo only, int_O_gradient_factor value is limited to 255
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3919 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3920 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3921 STRCAT_PRINT "%" ; % is printed in color set by TFT_color_code_gf, too
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3922 TFT_custview_exit1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3923 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3924 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3925
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3926
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3927 global TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3928 TFT_clock_batt_surfpress_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3929 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3930 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3931 STRCPY_TEXT_PRINT tTime ; "Time"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3932 WIN_TINY dm_custom_battery_column, dm_custom_battery_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3933 STRCPY_TEXT_PRINT tBattery ; "Battery"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3934 WIN_TINY dm_custom_surfpres_column+.8, dm_custom_surfpres_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3935 STRCPY_TEXT_PRINT tSurface ; "Surface"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3936 ; Show Surface Pressure (done in mask, because it's static during the dive)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3937 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3938 WIN_SMALL dm_custom_surfpres_column, dm_custom_surfpres_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3939 movff last_surfpressure_30min+0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3940 movff last_surfpressure_30min+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3941 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3942 PUTC ' '
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3943 STRCAT_TEXT_PRINT tMBAR ; mbar (hPa)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3944 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3945
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3946
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3947 global TFT_clock_batt_surfpress ; data for clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3948 TFT_clock_batt_surfpress:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3949 ; Update Clock
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3950 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3951 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3952 movff hours,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3953 output_99
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3954 PUTC ':'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3955 movff mins,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3956 output_99x
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3957 PUTC ":"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3958 movff secs,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3959 output_99x
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3960 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3961 ; Show Battery Info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3962 WIN_SMALL dm_custom_battery_column, dm_custom_battery_percent_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3963 movff batt_percent,lo ; get battery percent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3964 call TFT_color_code_battery ; color-code battery percent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3965 ; bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3966 output_8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3967 ; bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3968 STRCAT "% "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3969 movlw 0x00
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3970 movff WREG,buffer+4 ; only "xxx%"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3971 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3972 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3973 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3974 WIN_SMALL dm_custom_battery_column, dm_custom_battery_volt_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3975 movff batt_voltage+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3976 movff batt_voltage+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3977 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3978 output_16dp .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3979 PUTC 'V'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3980 movff buffer+5,buffer+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3981 movlw 0x00
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3982 movff WREG,buffer+5 ; only "x.yzV"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3983 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3984 ; Surface pressure is shown in mask because it is static
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3985 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3986
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3987
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3988 global TFT_pscr_info_mask ; mask for pSCR info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3989 TFT_pscr_info_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3990 rcall TFT_mask_ppo2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3991 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3992 WIN_TINY dm_custom_pscr_drop_column, dm_custom_pscr_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3993 STRCPY_TEXT_PRINT tPSCR_O2_drop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3994 WIN_TINY dm_custom_pscr_ratio_column, dm_custom_pscr_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3995 STRCPY_TEXT_PRINT tPSCR_lungratio
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3996 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3997
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3998 global TFT_pscr_info ; data for pSCR info
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3999 TFT_pscr_info:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4000 ;show ppO2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4001 WIN_MEDIUM dm_custom_ppo2_column,dm_custom_ppo2_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4002 movff int_O_pSCR_ppO2+0,lo ; copy pSCR ppO2 to hi:lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4003 movff int_O_pSCR_ppO2+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4004 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4005 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4006 output_16dp .3 ; x.xx bar
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4007 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4008 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4009 ; Show drop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4010 WIN_STD dm_custom_pscr_drop_column+.11,dm_custom_pscr_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4011 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4012 movff char_I_PSCR_drop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4013 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4014 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4015 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4016 ; Show lung ratio
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4017 WIN_STD dm_custom_pscr_ratio_column+.5,dm_custom_pscr_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4018 movff char_I_PSCR_lungratio,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4019 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4020 STRCPY "1/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4021 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4022 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4023 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4024
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4025
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4026 global TFT_gas_needs_ascent_mask ; mask for gas needs ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4027 TFT_gas_needs_ascent_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4028 WIN_TINY dm_custom_gas_column_title, dm_custom_gas_mask_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4029 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4030 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4031 movff char_O_deco_info,WREG ; get the deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4032 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4033 bra TFT_gas_needs_mask_ascent_1 ; NO - show as direct ascent needs
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4034 bsf gas_needs_mode_last ; YES - remember last results were for cave mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4035 STRCPY_TEXT tGasNeedsCaveMode ; - "Gas Needs Cave Mode"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4036 bra TFT_gas_needs_mask_ascent_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4037 TFT_gas_needs_mask_ascent_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4038 bcf gas_needs_mode_last ; remember last results were for direct ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4039 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4040 TFT_gas_needs_mask_ascent_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4041 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4042 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4043 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4044 STRCAT_PRINT " (bar)" ; " (bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4045 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4046
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4047
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4048 global TFT_gas_needs_ascent ; data for gas needs ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4049 TFT_gas_needs_ascent: ; LIMITATION: there is only space for 4 gases on the screen - if 5 gases have a pres_need > 0, then only the first 4 will be shown!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4050 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4051 movff char_O_deco_info,WREG ; get deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4052 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4053 bra TFT_gas_needs_ascent_1 ; NO - continue below...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4054 btfsc gas_needs_mode_last ; YES - were the last results calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4055 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4056 bra TFT_gas_needs_ascent_2 ; NO - redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4057 TFT_gas_needs_ascent_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4058 btfss gas_needs_mode_last ; NO - were the last results calculated for direct ascent?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4059 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4060 ;bra TFT_gas_needs_ascent_2 ; NO - redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4061 TFT_gas_needs_ascent_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4062 rcall TFT_gas_needs_ascent_mask ; redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4063 TFT_gas_needs_ascent_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4064 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4065 clrf up ; initialize gas index (0-4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4066 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4067 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4068 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4069 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4070 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4071 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4072 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4073 rcall TFT_gas_needs_helper
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4074 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4075
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4076 TFT_gas_needs_helper:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4077 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4078 movlw .5 ; number of gases
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4079 cpfslt up ; check if all gases have been processed
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4080 bra TFT_gas_needs_helper_1 ; YES - clear display area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4081 movf up,W ; NO - get gas number and check if need of that gas is > 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4082 rlncf WREG,W ; multiply by 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4083 incf WREG,W ; add 1 to address high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4084 lfsr FSR1,int_O_ascent_pres_need ; load base of ascent press needs
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4085 movff PLUSW1,hi ; read HIGH(int_O_ascent_pres_need[up])
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4086 btfss hi,int_is_zero ; check flag for pres_need == 0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4087 bra TFT_gas_needs_helper_2 ; NO - print gas type and pressure needed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4088 incf up,F ; YES - increment to next gas...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4089 bra TFT_gas_needs_helper ; ...and try the next gas
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4090 TFT_gas_needs_helper_1: ; no gases to show anymore, clear display area from potential remains of last invocation
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4091 STRCAT_PRINT " ---- " ; overwrite outdated stuff if screen position is not needed
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4092 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4093 TFT_gas_needs_helper_2: ; output gas type and pressure needed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4094 movf up,W ; get gas number (0-4) to WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4095 lfsr FSR1,opt_gas_O2_ratio ; read opt_gas_O2_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4096 movff PLUSW1,lo ; copy result to lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4097 lfsr FSR1,opt_gas_He_ratio ; read opt_gas_He_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4098 movff PLUSW1,hi ; copy result to hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4099 call customview_show_mix ; print "Air", "O2", "21/35", etc.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4100 PUTC ':' ; ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4101 movf up,W ; get gas number (0-4) to WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4102 rlncf WREG,W ; multiply by 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4103 lfsr FSR1,int_O_ascent_pres_need ; load base of ascent press needs (default)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4104 movff PLUSW1,lo ; read LOW(int_O_ascent_pres_need[up])
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4105 incf WREG,W ; add 1 to address high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4106 movff PLUSW1,hi ; read HIGH(int_O_ascent_pres_need[up])
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4107 btfsc hi,int_attention_flag ; check if attention flag is set (pres_need > pres_fill * threshold)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4108 call TFT_attention_color ; YES - print gas need in yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4109 btfsc hi,int_warning_flag ; check if warning flag is set (pres_need > pres_fill)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4110 call TFT_warnings_color ; YES - print gas need in red
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4111 movff int_O_ascent_pres_need+1,WREG ; get HIGH(int_O_ascent_pres_need[0]) which holds flag for invalid data
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4112 btfsc WREG,int_invalid_flag ; check if invalid data flag is set
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4113 call TFT_disabled_color ; YES - print gas need in disabled color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4114 bcf hi,int_attention_flag ; clear attention flag for attention color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4115 bcf hi,int_warning_flag ; clear warning flag for warning color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4116 bcf hi,int_invalid_flag ; clear flag for invalid data (will actually only be set with 1st gas)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4117 output_16_3 ; limit to 999 and display only (0-999)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4118 STRCAT_PRINT " " ; adds a space to overwrite any potential remains of earlier outputs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4119 incf up,F ; increment to next gas
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4120 bra TFT_custview_exit2 ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4121
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4122
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4123 global TFT_mask_ppo2 ; helper function for several custom views
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4124 TFT_mask_ppo2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4125 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4126 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4127 bra TFT_mask_ppo2a ; NO - continue checking for pSCR and OC
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4128 btfsc FLAG_bailout_mode ; in bailout?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4129 bra TFT_mask_ppo2b ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4130 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row ; tuned position for longer text (-8 = on leftmost edge of display)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4131 STRCPY_TEXT_PRINT tppO2Dil ; print "ppO2(Dil)"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4132 bra TFT_custview_exit2 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4133 TFT_mask_ppo2a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4134 btfss FLAG_pscr_mode ; in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4135 bra TFT_mask_ppo2b ; NO - continue with OC mode (or bailout)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4136 btfsc FLAG_bailout_mode ; in bailout?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4137 bra TFT_mask_ppo2b ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4138 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row ; tuned position for longer text (-8 = on leftmost edge of display)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4139 STRCPY_TEXT_PRINT tppO2Mix ; print "ppO2(Mix)"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4140 bra TFT_custview_exit2 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4141 TFT_mask_ppo2b: ; OC mode or bailout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4142 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row ; normal position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4143 STRCPY_TEXT_PRINT tppO2 ; in all other modes
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4144 bra TFT_custview_exit2 ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4145
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4146
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4147 global TFT_ppo2_ead_end_cns_mask ; mask for ppO2, END/EAD and CNS
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4148 TFT_ppo2_ead_end_cns_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4149 rcall TFT_mask_ppo2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4150 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4151 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4152 STRCPY_TEXT_PRINT tDiveEAD_END
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4153 WIN_TINY dm_custom_cns_column, dm_custom_cns_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4154 STRCPY_TEXT_PRINT tCNS2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4155 bra TFT_custview_exit2 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4156
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4157
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4158 global TFT_ppo2_ead_end_cns ; data for ppO2, END/EAD and CNS
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
4159 TFT_ppo2_ead_end_cns:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4160 ; Show ppO2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4161 WIN_MEDIUM dm_custom_ppo2_column, dm_custom_ppo2_row
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4162 movff int_O_breathed_ppO2+0,lo ; copy ppO2 of the currently breathed gas to hi:lo
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4163 movff int_O_breathed_ppO2+1,hi
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4164 call TFT_color_code_ppo2 ; color-code output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4165 bsf leftbind
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4166 output_16dp .3 ; x.xx bar
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4167 bcf leftbind
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4168 STRCAT_PRINT ""
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4169 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4170 ; Show END/EAD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4171 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4172 STRCPY_TEXT tEAD ; EAD:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4173 movff char_O_EAD,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4174 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4175 WIN_SMALL dm_custom_end_column, dm_custom_end_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4176 STRCPY_TEXT tEND ; END:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4177 movff char_O_END,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4178 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4179 ; Show CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4180 WIN_STD dm_custom_cns_column+.3, dm_custom_cns_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4181 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4182 movff int_O_CNS_fraction+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4183 call TFT_color_code_cns ; color-code CNS output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4184 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4185 output_16_3 ; displays only 0...999
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4186 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4187 STRCAT_PRINT "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4188 TFT_custview_exit2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4189 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4190 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4191 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4192 TSTOSS opt_units ; 0=Meters, 1=Feets
0
heinrichsweikamp
parents:
diff changeset
4193 bra TFT_end_ead_common_metric
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4194 TFT_end_ead_common_imperial:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4195 movf lo,W ; with lo in m
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4196 mullw .100 ; PRODL:PRODH = mbar/min
0
heinrichsweikamp
parents:
diff changeset
4197 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
4198 movff PRODH,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4199 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4200 output_16_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4201 STRCAT_TEXT tFeets
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4202 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4203 movff WREG,buffer+.8 ; limit string length to 8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4204 bra TFT_end_ead_common_exit
0
heinrichsweikamp
parents:
diff changeset
4205 TFT_end_ead_common_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4206 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4207 STRCAT_TEXT tMeters
0
heinrichsweikamp
parents:
diff changeset
4208 TFT_end_ead_common_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4209 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4210 movlw .8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4211 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4212 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4213 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4214
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4215
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4216 global TFT_sensor_check_mask ; mask for sensor check
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4217 TFT_sensor_check_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4218 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4219 WIN_TINY dm_custom_s_check_title_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4220 STRCPY_TEXT_PRINT tSensorCheck
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4221 WIN_TINY dm_custom_ppO2_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4222 STRCPY_TEXT_PRINT tppO2O2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4223 WIN_TINY dm_custom_ppDil_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4224 STRCPY_TEXT_PRINT tppO2Dil
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4225 bra TFT_sensor_check_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4226
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4227
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4228 global TFT_sensor_check ; data for sensor check
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4229 TFT_sensor_check:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4230 ; Show ppO2 of O2 in this depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4231 WIN_MEDIUM dm_custom_ppO2_column, dm_custom_s_check_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4232 movff int_O_O2_ppO2+0,lo ; copy ppO2 of pure O2 to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4233 movff int_O_O2_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4234 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4235 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4236 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4237 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4238 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4239 ; Show ppO2 of the diluent in this depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4240 WIN_MEDIUM dm_custom_ppDil_column, dm_custom_s_check_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4241 movff int_O_pure_ppO2+0,lo ; copy ppO2 of pure gas to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4242 movff int_O_pure_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4243 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4244 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4245 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4246 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4247 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4248 TFT_sensor_check_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4249 bra TFT_custview_exit2 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4250
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4251 ;=============================================================================
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4252
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4253 global TFT_surface_lastdive
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4254 TFT_surface_lastdive:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4255 call TFT_divemask_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4256 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4257 STRCAT_TEXT_PRINT tLastDive ; "Last Dive:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4258 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4259 STRCAT_TEXT_PRINT tDivetime ; "Divetime:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4260 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4261 STRCAT_TEXT_PRINT tMaxDepth ; "Max. Depth"
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4262 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4263 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4264 movff int_O_desaturation_time+0,lo ; bank-safe copies
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4265 movff int_O_desaturation_time+1,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4266 iorwf lo,W ; check if desaturation time is zero
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4267 bz TFT_surface_lastdive_1 ; YES - show last dive time
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4268 movff surface_interval+0,lo ; NO - show dive interval
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4269 movff surface_interval+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4270 call convert_time ; converts hi:lo in minutes to hours (up:hi) and minutes (lo)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4271 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4272 movff lo,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4273 movwf lo ; exchange lo and hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4274 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4275 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4276 PUTC 'h'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4277 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4278 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4279 STRCAT_PRINT "m "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4280 bra TFT_surface_lastdive_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4281 TFT_surface_lastdive_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4282 movff lastdive_time+0,xC+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4283 movff lastdive_time+1,xC+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4284 movff lastdive_time+2,xC+2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4285 movff lastdive_time+3,xC+3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4286 movlw LOW .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4287 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4288 movlw HIGH .3600
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4289 movwf xB+1 ; one day = 3600s
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4290 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4291 ;xC+0:xC+1 -> full hours
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4292 movff xC+1,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4293 movff xC+0,xA+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4294 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4295 movlw .24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4296 movwf xB+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4297 call div16x16 ; xC = xA / xB with xA as remainder
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4298 movff xC+0,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4299 movff xC+1,hi ; full days
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4300 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4301 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4302 PUTC "d"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4303 movff xA+0,lo ; full hours
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4304 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4305 STRCAT_PRINT "h "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4306 TFT_surface_lastdive_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4307 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4308 movff lastdive_duration+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4309 movff lastdive_duration+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4310 output_16 ; divetime minutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4311 PUTC ":"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4312 movff lastdive_duration+2,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4313 output_99x ; divetime seconds
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4314 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4315 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4316 movff lastdive_maxdepth+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4317 movff lastdive_maxdepth+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4318 TSTOSS opt_units ; 0=Meters, 1=Feets
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4319 bra TFT_surface_lastdive_metric
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4320 ;imperial
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4321 rcall convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4322 output_16_3 ; limit to 999 and display only (0-999)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4323 STRCAT_TEXT tFeets1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4324 bra TFT_surface_lastdive2
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4325
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4326 TFT_surface_lastdive_metric:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4327 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4328 movlw d'1' ; +1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4329 movff WREG,ignore_digits ; no 1000m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4330 output_16dp .3 ; xxx.y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4331 STRCAT_TEXT tMeters
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4332 TFT_surface_lastdive2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4333 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4334 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4335 return ; done.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4336
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4337 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4338
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4339 global TFT_surface_tissues
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4340 TFT_surface_tissues: ; show Tissue diagram in surface mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4341 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4342 STRCPY_TEXT_PRINT tN2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4343 WIN_SMALL surf_tissue_He_column,surf_tissue_He_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4344 STRCPY_TEXT_PRINT tHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4345
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4346 movlw color_deepblue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4347 call TFT_set_color ; make this configurable?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4348 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.29,.29
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4349 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.37,.37
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4350 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.45,.45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4351 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.53,.53
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4352 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.61,.61
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4353 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.69,.69
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4354 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.77,.77
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4355 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.85,.85
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4356 WIN_FRAME_STD surf_tissue_diagram_top, surf_tissue_diagram_bottom, surf_tissue_diagram_left, surf_tissue_diagram_right ; outer frame
0
heinrichsweikamp
parents:
diff changeset
4357
heinrichsweikamp
parents:
diff changeset
4358 movlw .1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4359 movwf win_height ; row bottom (0-239)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4360
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4361 ;---- Draw N2 Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4362
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4363 movlw surf_tissue_diagram_left+.4 ; start position for N2 bars
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4364 movwf win_leftx2 ; column left (0-159)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4365 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.4 ; max width for N2 bars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4366 movwf win_width
0
heinrichsweikamp
parents:
diff changeset
4367
heinrichsweikamp
parents:
diff changeset
4368 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4369 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4370 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4371 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4372 surf_tissue_saturation_graph_N2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4373 movlw surf_tissue_diagram_top+.23 ; surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4374 addwf hi,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4375 movwf win_top ; row top (0-239)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4376 rcall surf_tissue_saturation_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4377 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4378 bra surf_tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4379
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4380 ;---- Draw He Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4381
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4382 movlw surf_tissue_diagram_left+.24 ; start position for He bars (.15 without x2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4383 movwf win_leftx2 ; column left (0-159)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4384 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.24 ; max width for He bars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4385 movwf win_width
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4386
0
heinrichsweikamp
parents:
diff changeset
4387 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4388 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4389 movwf lo ; 16 tissues
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4390 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4391 surf_tissue_saturation_graph_He:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4392 movlw surf_tissue_diagram_top+.23+.57 ; surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4393 addwf hi,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4394 movwf win_top ; row top (0-239)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4395 rcall surf_tissue_saturation_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4396 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4397 bra surf_tissue_saturation_graph_He
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4398
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4399 WIN_SMALL surf_tissue_He_column+.22,surf_tissue_He_row ; position in-between tissue bars
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4400 movff int_O_CNS_fraction+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4401 movff int_O_CNS_fraction+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4402 call TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4403 STRCPY_TEXT tCNS2 ; CNS:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4404 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4405 output_16_3 ; displays only 0...999
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4406 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4407 STRCAT_PRINT "%"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4408 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
4409
heinrichsweikamp
parents:
diff changeset
4410 surf_tissue_saturation_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4411 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4412 movlw .2 ; row spacing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4413 addwf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4414 movf POSTINC2,W ; get tissue load
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4415 bcf WREG,7 ; clear flag bit for sat/desat info (not used in surface mode)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4416 rlncf WREG,W ; multiply with 2 (previously cleared bit 7 will be rotated to bit 0)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4417 incf WREG,W ; add 1 for a minimum visible bar (He-bars could be invisible else-wise)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4418 movwf up
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4419 movf win_width+0,W ; get max window width (win_width)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4420 cpfslt up ; skip if WREG < win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4421 movwf up ; crop length to win_width
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4422 ; no need to be able to draw longer bars –
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4423 ; we are at the surface and if bars would
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4424 ; even touch the max length possible here,
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4425 ; the diver would be in severe decompression
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4426 ; issues if not dead already...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4427 movff up,win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4428 clrf win_width+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4429 goto TFT_box ; and return...
0
heinrichsweikamp
parents:
diff changeset
4430
heinrichsweikamp
parents:
diff changeset
4431 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4432 ; Draw saturation graph in dive mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4433
0
heinrichsweikamp
parents:
diff changeset
4434 DISP_tissue_saturation_graph:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4435 ;---- Draw Frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4436 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4437 WIN_FRAME_COLOR16 dm_custom_tissue_diagram_top, dm_custom_tissue_diagram_bottom, dm_custom_tissue_diagram_left, .159 ; outer frame
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4438
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4439 ;---- clear area showing leading tissue number as it may not be printed over
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4440 WIN_BOX_BLACK dm_custom_tissue_diagram_top+.16, dm_custom_tissue_diagram_top+.16+.10, dm_custom_tissue_diagram_left+.32, dm_custom_tissue_diagram_left+.32+.8 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
4441
heinrichsweikamp
parents:
diff changeset
4442 movlw .1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4443 movwf win_height ; row bottom (0-239)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4444
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4445 ;---- Draw N2 Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4446
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4447 movlw dm_custom_tissue_diagram_left+.3 ; divemode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4448 movwf win_leftx2 ; column left (0-159)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4449 movlw .159-dm_custom_tissue_diagram_left-.4 ; width
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4450 movwf win_width
0
heinrichsweikamp
parents:
diff changeset
4451
heinrichsweikamp
parents:
diff changeset
4452 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4453 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4454 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4455 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4456 tissue_saturation_graph_N2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4457 movlw dm_custom_tissue_diagram_top+.3 ; divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4458 rcall tissue_saturation_graph_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4459 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4460 bra tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4461
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4462 ;---- Draw He Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4463
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4464 movlw dm_custom_tissue_diagram_left+.8 ; divemode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4465 movwf win_leftx2 ; column left (0-159)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4466 movlw .159-dm_custom_tissue_diagram_left-.14 ; width
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4467 movwf win_width
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4468
0
heinrichsweikamp
parents:
diff changeset
4469 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4470 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4471 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4472 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4473 tissue_saturation_graph_He:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4474 movlw dm_custom_tissue_diagram_top+.3+.22 ; divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4475 rcall tissue_saturation_graph_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4476 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4477 bra tissue_saturation_graph_He
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4478
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4479 ;---- Print Number of leading Tissue -------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4480
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4481 ; TODO: some flicker due to overwriting by tissue bars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4482
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4483 movff int_O_gradient_factor+0,WREG ; get current gradient factor (only low byte used for value)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4484 tstfsz WREG ; current gradient factor = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4485 bra tissue_saturation_graph_0 ; NO - print number of leading tissue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4486 movff char_O_deco_info,WREG ; YES - get deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4487 btfss WREG,deco_ceiling ; - do we have a ceiling obligation?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4488 goto TFT_standard_color ; NO - can ascent directly, don't print number, set standard color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4489 ; YES - print number of leading tissue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4490 tissue_saturation_graph_0:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4491 movff char_O_lead_number,lo ; get number of leading tissue as 0-15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4492 incf lo,F ; adjust to 1-16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4493 movlw .10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4494 cpfsgt lo ; is it > 10 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4495 bra tissue_saturation_graph_1 ; NO - will output a single digit number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4496 ; start position for a 2 digit number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4497 WIN_TINY dm_custom_tissue_diagram_left+.32,dm_custom_tissue_diagram_top+.16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4498 bra tissue_saturation_graph_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4499 tissue_saturation_graph_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4500 ; start position for a 1 digit number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4501 WIN_TINY dm_custom_tissue_diagram_left+.32+.4,dm_custom_tissue_diagram_top+.16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4502 tissue_saturation_graph_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4503 call TFT_standard_color ; set output color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4504 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4505 output_8 ; print number in leftbind, i.e. without leading zeros or spaces
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4506 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4507 STRCAT_PRINT "" ; finalize output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4508 return
0
heinrichsweikamp
parents:
diff changeset
4509
heinrichsweikamp
parents:
diff changeset
4510 tissue_saturation_graph_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4511 addwf hi,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4512 movwf win_top ; row top (0-239)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4513 movlw color_cyan ; preset color for tissues with decreasing pressure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4514 call TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4515 incf hi,F
0
heinrichsweikamp
parents:
diff changeset
4516 movf POSTINC2,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4517 btfss WREG,7 ; check if flag for increasing tissue pressure set
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4518 bra tissue_saturation_graph_loop_1 ; NO - keep color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4519 movwf up ; YES - buffer WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4520 movlw color_orange ; select color for tissues with increasing pressure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4521 call TFT_set_color ; change color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4522 movf up,W ; restore WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4523 tissue_saturation_graph_loop_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4524 bcf WREG,7 ; clear flag bit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4525 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4526 rrcf WREG ; divide by 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4527 incf WREG,W ; add a bit for a minimum visible bar
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4528 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4529 movf win_width,W ; get max window width (win_width)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4530 cpfslt up ; skip if WREG < win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4531 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4532 movff up,win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4533 clrf win_width+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4534 goto TFT_box ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4535
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4536 ;=============================================================================
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
4537
0
heinrichsweikamp
parents:
diff changeset
4538 global TFT_display_cns
heinrichsweikamp
parents:
diff changeset
4539 TFT_display_cns:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4540 call TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4541 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4542 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4543 STRCPY_TEXT tCNS ; CNS:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4544 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4545 movff int_O_CNS_fraction+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4546 call TFT_color_code_cns ; color-code CNS output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4547 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4548 output_16_3 ; displays only 0...999
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4549 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4550 PUTC "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4551 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4552 btfss divemode ; In divemode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4553 movlw surf_warning_length ; NO - use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4554 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4555 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4556 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4557 bra TFT_custview_exit3 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4558
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4559
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4560 global TFT_display_eod_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4561 TFT_display_eod_cns:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4562 call TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4563 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4564 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4565 call TFT_warnings_color ; switch to warnings (red) text color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4566 STRCPY_TEXT tCNSeod ; end-of-dive CNS warning text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4567 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4568 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
4569 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4570 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4571
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4572
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4573 global TFT_display_ppo2_warning
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4574 TFT_display_ppo2_warning: ; with ppO2 including attention/warning flags in hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4575 call TFT_warning_set_window ; set the row and column for the current message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4576 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4577 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4578 call TFT_color_code_ppo2 ; color-code output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4579 btfsc FLAG_bailout_mode ; in bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4580 bra TFT_display_diluent_2 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4581 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4582 bra TFT_display_diluent_1 ; NO - continue with pSCR or OC
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4583 STRCPY_TEXT tdil ; YES - print "Dil:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4584 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4585 TFT_display_diluent_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4586 btfss FLAG_pscr_mode ; in pSCR mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4587 bra TFT_display_diluent_2 ; NO - continue with OC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4588 STRCPY_TEXT tmix ; YES - print "Mix:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4589 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4590 TFT_display_diluent_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4591 STRCPY_TEXT tppO2 ; bailout or OC mode, print "ppO2:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4592 TFT_display_diluent_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4593 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4594 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4595 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4596 movlw dm_warning_length ; divemode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4597 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4598 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4599 TFT_custview_exit3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4600 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4601
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4602
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4603 global TFT_surf_set_bearing
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4604 TFT_surf_set_bearing:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4605 btfsc premenu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4606 return ; already shown, return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4607 bsf premenu ; set flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4608 WIN_BOX_BLACK surf_compass_bear_row,surf_warning1_row-1, surf_compass_bear_column, surf_decotype_column-.1 ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4609 WIN_SMALL surf_compass_bear_column,surf_compass_bear_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4610 WIN_COLOR color_yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4611 bsf win_invert
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4612 STRCPY_TEXT_PRINT tSetHeading ; 7 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4613 bcf win_invert
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4614 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4615
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4616 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4617
0
heinrichsweikamp
parents:
diff changeset
4618 global TFT_LogOffset_Logtitle
heinrichsweikamp
parents:
diff changeset
4619 TFT_LogOffset_Logtitle:
heinrichsweikamp
parents:
diff changeset
4620 STRCPY_TEXT tLogOffset
heinrichsweikamp
parents:
diff changeset
4621 PUTC ":"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4622 call do_logoffset_common_read ; offset into lo:hi
0
heinrichsweikamp
parents:
diff changeset
4623 bsf leftbind
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
4624 output_16_4
0
heinrichsweikamp
parents:
diff changeset
4625 bcf leftbind
heinrichsweikamp
parents:
diff changeset
4626 PUTC " "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4627 return ; no "_PRINT" here...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4628
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4629 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4630 ; RX Functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4631
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4632 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4633
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4634 global TFT_pressures_SAC_mask ; mask for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4635 TFT_pressures_SAC_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4636 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4637 ; pressure reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4638 WIN_TINY dm_custom_tankdata_pres1_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4639 movff char_I_pressure_gas+0,WREG ; =0: disabled, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4640 bcf aux_flag ; selector for disabled / need set to disabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4641 call TFT_pressures_SAC_mask_helper ; print gas composition or " ---" if disabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4642 ; pressure reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4643 WIN_TINY dm_custom_tankdata_pres2_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4644 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4645 bsf aux_flag ; selector for disabled / need set to need
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4646 call TFT_pressures_SAC_mask_helper ; print gas composition or "Need " if 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4647 ; SAC rate
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4648 WIN_TINY dm_custom_tankdata_SAC_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4649 STRCPY_TEXT tSAC ; "SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4650 STRCAT " (" ; (
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4651 STRCAT_TEXT tLitersMinute ; l/min
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4652 STRCAT_PRINT ")" ; )"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4653 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4654
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4655 TFT_pressures_SAC_mask_helper:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4656 tstfsz WREG ; pressure reading assigned?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4657 bra TFT_dive_tankdata_mask_helper_1 ; YES - print gas composition
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4658 btfsc aux_flag ; NO - check auxiliary flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4659 bra TFT_dive_tankdata_mask_helper_2 ; 1 - print "Need "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4660 STRCAT_PRINT " ---" ; 0 - print " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4661 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4662 TFT_dive_tankdata_mask_helper_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4663 decf WREG,W ; (1..10) -> (0..9)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4664 bsf short_gas_decriptions ; just "Air", "O2" or "xx/yy"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4665 call gaslist_strcat_gas_WREG ; print composition of gas/dil in WREG (0..9)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4666 bra TFT_dive_tankdata_mask_helper_3 ; finish with adding "(bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4667 TFT_dive_tankdata_mask_helper_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4668 STRCPY_TEXT tNeed ; "Need"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4669 TFT_dive_tankdata_mask_helper_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4670 STRCAT_PRINT "(bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4671 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4672
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4673
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4674 global TFT_pressures_SAC ; data for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4675 TFT_pressures_SAC:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4676 ; check mode for second reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4677 bcf aux_flag ; clear auxiliary flag by default (reading 2 is pressure)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4678 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4679 addlw .0 ; dummy operation to set status register flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4680 btfsc STATUS,Z ; gas selected = 0 (i.e. no 2nd pressure reading) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4681 bsf aux_flag ; YES - set auxiliary flag (display position of reading 2 shall show need to reading 1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4682 ; get data of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4683 movff int_IO_pressure_value+0,lo ; copy pressure 1 to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4684 movff int_IO_pressure_value+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4685 movff char_I_pressure_stat+0,ex ; copy status data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4686 ; pressure of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4687 WIN_STD dm_custom_tankdata_pres1_col+.4,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4688 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4689 ; battery status of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4690 WIN_SMALL dm_custom_hud_sensor1_column+.4+.36,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4691 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4692 ; get data for reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4693 btfsc aux_flag ; shall reading 2 show need to reading 1 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4694 bra TFT_pressures_SAC_1 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4695 movff int_IO_pressure_value+2,lo ; NO - copy pressure 2 to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4696 movff int_IO_pressure_value+3,hi ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4697 movff char_I_pressure_stat+1,ex ; - copy status data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4698 bra TFT_pressures_SAC_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4699 TFT_pressures_SAC_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4700 movff int_O_pressure_need+0,lo ; YES - copy need to pressure 1 to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4701 movff int_O_pressure_need+1,hi ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4702 clrf ex ; - set status data to 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4703 TFT_pressures_SAC_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4704 ; pressure of reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4705 WIN_STD dm_custom_tankdata_pres2_col+.2,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4706 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4707 ; battery status of reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4708 WIN_SMALL dm_custom_tankdata_pres2_col+.2+.36,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4709 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4710 ; SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4711 WIN_STD dm_custom_tankdata_SAC_col+.6,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4712 movff int_O_sac_rate+0,lo ; copy SAC rate to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4713 movff int_O_sac_rate+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4714 btfsc hi,int_not_avail_flag ; SAC rate available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4715 bra TFT_pressures_SAC_4 ; NO - print " --.-"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4716 call TFT_color_code_tank_pres_sac ; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4717 output_16_3 ; print as xxx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4718 PUTC " " ; print a dummy char to have the string termination at the correct place
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4719 movff buffer+.2,buffer+.3 ; move the decimal digit one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4720 movlw "." ; load coding of a decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4721 movff WREG,buffer+.2 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4722 movlw " " ; load coding of a space character
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4723 movff buffer+.1,up ; get the character in front of the decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4724 cpfseq up ; is it a space?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4725 bra TFT_pressures_SAC_3 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4726 movlw "0" ; YES - load coding of a zero
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4727 movff WREG,buffer+.1 ; - place a zero in front of the decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4728 TFT_pressures_SAC_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4729 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4730 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4731 TFT_pressures_SAC_4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4732 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4733 STRCAT_PRINT "--.-" ; output for no SAC data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4734 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4735
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4736 TFT_pressures_SAC_helper_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4737 btfss hi,int_not_avail_flag ; pressure available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4738 bra TFT_pressures_SAC_helper_1a ; YES - print pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4739 call TFT_disabled_color ; NO - use disabled color as default
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4740 btfsc ex,char_transmitter_lost ; - transmitter lost?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4741 call TFT_attention_color ; YES - use attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4742 STRCAT_PRINT " ---" ; - print " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4743 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4744 TFT_pressures_SAC_helper_1a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4745 btfsc hi,int_warning_flag ; out of range (signaled by warning flag)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4746 bra TFT_pressures_SAC_helper_1c ; YES - special treatment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4747 call TFT_color_code_tank_pres_sac ; NO - color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4748 bsf ignore_digit5 ; - no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4749 movf lo,W ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4750 iorwf hi,W ; - pressure value = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4751 bnz TFT_pressures_SAC_helper_1b ; NO - print value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4752 STRCPY_PRINT " 0" ; YES - print a zero manually
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4753 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4754 TFT_pressures_SAC_helper_1b:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4755 output_16 ; print hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4756 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4757 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4758 TFT_pressures_SAC_helper_1c:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4759 call TFT_color_code_tank_pres_sac ; color-code the output (clears all flags)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4760 STRCPY_PRINT ">400" ; print ">400"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4761 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4762
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4763 TFT_pressures_SAC_helper_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4764 btfss ex,char_transmitter_low_bat ; low battery flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4765 bra TFT_pressures_SAC_helper_2a ; NO - wipe out down arrow (low bat indicator)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4766 call TFT_attention_color ; YES - use attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4767 STRCPY_PRINT "\xb8" ; - print down arrow as bat low indication
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4768 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4769 TFT_pressures_SAC_helper_2a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4770 STRCPY_PRINT " " ; wipe out down arrow (low bat indicator)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4771 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4772
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4773
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4774 global TFT_menu_tank_pres
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4775 TFT_menu_tank_pres: ; imprinting function for main menu / tank setup
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4776 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4777 ; get ID
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4778 lfsr FSR1,opt_transmitter_id_1 ; load base address of opt_transmitter_id
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4779 movf gaslist_gas,W ; get current gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4780 rlncf WREG,W ; multiply by 2 because IDs are 2 byte in size
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4781 movff PLUSW1,lo ; copy opt_transmitter_id+0[gaslist_gas] to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4782 incf WREG,W ; increment index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4783 movff PLUSW1,hi ; copy opt_transmitter_id+1[gaslist_gas] to hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4784 ; show pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4785 WIN_SMALL .90, .61 ; column, row (+/- 27 per row)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4786 call get_pres_by_transmitter_id ; get pressure into hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4787 tstfsz WREG ; do we have valid tank data (WREG=0) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4788 bra TFT_menu_tank_pres_1 ; NO - transmitter not found
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4789 call TFT_color_code_tank_pres_sac ; set output color according to flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4790 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4791 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4792 bra TFT_menu_tank_pres_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4793 TFT_menu_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4794 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4795 STRCAT " ---" ; output for no pressure data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4796 TFT_menu_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4797 STRCAT_TEXT_PRINT tbar ; " bar"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4798 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4799
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4800
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4801 global TFT_surface_tank_pres
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4802 TFT_surface_tank_pres: ; show pressure reading above surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4803 WIN_SMALL surf_decotype_column+.6,surf_decotype_row+.30+.47
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4804 movff int_IO_pressure_value+0,lo ; copy pressure from 1st reading, low byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4805 movff int_IO_pressure_value+1,hi ; copy pressure from 1st reading, high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4806 btfss hi,int_not_avail_flag ; pressure reading 1 available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4807 bra TFT_surface_tank_pres_0 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4808 movff int_IO_pressure_value+2,lo ; NO - copy pressure from 2nd reading, low byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4809 movff int_IO_pressure_value+3,hi ; - copy pressure from 2nd reading, high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4810 btfsc hi,int_not_avail_flag ; - pressure reading 2 available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4811 bra TFT_surface_tank_pres_1 ; NO - show not avail message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4812 TFT_surface_tank_pres_0: ; YES - show pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4813 call TFT_color_code_tank_pres_sac ; set output color according to flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4814 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4815 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4816 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4817 bra TFT_surface_tank_pres_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4818 TFT_surface_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4819 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4820 STRCAT_PRINT " ---" ; output for no pressure data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4821 TFT_surface_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4822 WIN_SMALL surf_decotype_column+.38,surf_decotype_row+.30+.47
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4823 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4824 STRCAT_PRINT "bar" ; can not use tbar because it has a leading space
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4825 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4826
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4827
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4828 global TFT_surface_tankdata
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4829 TFT_surface_tankdata:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4830 lfsr FSR1,rx_buffer ; load base address of RX buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4831 ; bra TFT_surface_tankdata_debug ; comment in for +++ debug version +++
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4832 WIN_SMALL surf_customtext_column,surf_customtext_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4833 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4834 WIN_SMALL surf_customtext_column,surf_customtext_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4835 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4836 WIN_SMALL surf_customtext_column,surf_customtext_row3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4837 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4838 WIN_SMALL surf_customtext_column,surf_customtext_row4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4839 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4840 WIN_SMALL surf_customtext_column,surf_customtext_row5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4841 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4842 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4843
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4844 TFT_surface_tankdata_print: ; max 12 char
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4845 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4846 movff POSTINC1,hi ; ID high (+0)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4847 movff POSTINC1,lo ; ID low (+1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4848 tstfsz hi ; ID high = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4849 bra TFT_surface_tankdata_print_1 ; NO - slot in use
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4850 tstfsz lo ; ID low = 0?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4851 bra TFT_surface_tankdata_print_1 ; NO - slot in use
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4852 STRCAT_PRINT "---- " ; YES - mark as unused and clear rest of line from previous remains
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4853 movf POSTINC1,W ; - dummy read (+2) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4854 movf POSTINC1,W ; - dummy read (+3) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4855 movf POSTINC1,W ; - dummy read (+4) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4856 bra TFT_surface_tankdata_print_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4857 TFT_surface_tankdata_print_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4858 movf hi,W ; copy ID high to WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4859 output_hex ; 2 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4860 movf lo,W ; copy ID low to WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4861 output_hex ; 2 chars (4 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4862 movff POSTINC1,hi ; pressure high (+2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4863 movff POSTINC1,lo ; pressure low (+3)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4864 call TFT_color_code_tank_pres_sac ; needed to clear the status flags before output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4865 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4866 output_16 ; 4 chars (8 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4867 PUTC " " ; 1 char (9 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4868 movf POSTINC1,W ; status (+4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4869 andlw .7 ; mask out battery voltage
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4870 bnz TFT_surface_tankdata_2 ; branch if battery is not completely drained
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4871 call TFT_warnings_color ; output in red
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4872 STRCAT_PRINT "XXX" ; "XXX" for low
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4873 bra TFT_surface_tankdata_print_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4874 TFT_surface_tankdata_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4875 addlw .28 ; add offset of 2.8 Volt
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4876 movff WREG,lo ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4877 output_99 ; 2 chars (11 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4878 PUTC " " ; dummy char 1 char (12 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4879 movff buffer+.10,buffer+.11 ; move decimal digit of battery voltage one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4880 movlw "." ; decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4881 movff WREG,buffer+.10 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4882 STRCAT_PRINT "" ; print buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4883 TFT_surface_tankdata_print_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4884 movf POSTINC1,W ; dummy read (+5) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4885 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4886
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4887
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4888 ; TFT_surface_tankdata_debug: ; surface custom view debug output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4889 ; call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4890 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4891 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4892 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4893 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4894 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4895 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4896 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4897 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4898 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4899 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4900 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4901 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4902 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4903 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4904 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*7
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4905 ; rcall TFT_surface_tankdata_debug_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4906 ; return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4907
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4908 ; TFT_surface_tankdata_debug_print:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4909 ; movff POSTINC1,hi ; ID high (+0)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4910 ; movff POSTINC1,lo ; ID low (+1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4911 ; output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4912 ; PUTC ","
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4913 ; movff POSTINC1,hi ; pressure high (+2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4914 ; movff POSTINC1,lo ; pressure low (+3)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4915 ; call TFT_color_code_tank_pres_sac; needed to clear the status flags before output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4916 ; output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4917 ; PUTC ","
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4918 ; movff POSTINC1,lo ; status (+4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4919 ; output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4920 ; PUTC ","
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4921 ; movff POSTINC1,lo ; date (+5)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4922 ; output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4923 ; STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4924 ; return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4925
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4926 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4927
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4928 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4929
0
heinrichsweikamp
parents:
diff changeset
4930 global adjust_depth_with_salinity
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4931 global adjust_depth_with_salinity_log
0
heinrichsweikamp
parents:
diff changeset
4932 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4933 btfsc simulatormode_active ; do not apply salinity in simulator mode
0
heinrichsweikamp
parents:
diff changeset
4934 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4935 movff opt_salinity,WREG ; 0-5%
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4936 adjust_depth_with_salinity_log: ; computes salinity setting (FROM WREG!) into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4937 addlw d'100' ; 1.00kg/l
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4938 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4939
0
heinrichsweikamp
parents:
diff changeset
4940 movlw d'105' ; 105% ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4941 cpfslt up ; salinity upper limit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4942 return ; out of limit, do not adjust lo:hi
0
heinrichsweikamp
parents:
diff changeset
4943 movlw d'99' ; 99% ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4944 cpfsgt up ; salinity lower limit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4945 return ; out of limit, do not adjust lo:hi
0
heinrichsweikamp
parents:
diff changeset
4946
heinrichsweikamp
parents:
diff changeset
4947 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4948 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4949
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4950 movlw d'102' ; 0.98 bar / 10 meter
0
heinrichsweikamp
parents:
diff changeset
4951 movwf xB+0
heinrichsweikamp
parents:
diff changeset
4952 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4953 call mult16x16 ; xC:4 = xA:2 * xB:2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4954 movff up,xB+0 ; salinity
0
heinrichsweikamp
parents:
diff changeset
4955 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4956 call div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
0
heinrichsweikamp
parents:
diff changeset
4957 movff xC+0,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4958 movff xC+1,hi ; copy corrected values back to lo and hi
0
heinrichsweikamp
parents:
diff changeset
4959 return
heinrichsweikamp
parents:
diff changeset
4960
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4961 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4962
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4963 global convert_mbar_to_feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4964 convert_mbar_to_feet: ; convert value in hi:lo from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
4965 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4966 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4967
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4968 movlw LOW d'328' ; 328feet/100m
0
heinrichsweikamp
parents:
diff changeset
4969 movwf xB+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4970 movlw HIGH d'328'
0
heinrichsweikamp
parents:
diff changeset
4971 movwf xB+1
heinrichsweikamp
parents:
diff changeset
4972
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4973 call mult16x16 ; xA*xB=xC (lo:hi * 328)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4974
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4975 movlw d'50' ; round up
0
heinrichsweikamp
parents:
diff changeset
4976 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
4977 movlw 0
heinrichsweikamp
parents:
diff changeset
4978 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
4979 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
4980 addwfc xC+3,F
heinrichsweikamp
parents:
diff changeset
4981
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4982 movlw LOW .10000
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4983 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4984 movlw HIGH .10000
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4985 movwf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4986
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4987 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
4988
heinrichsweikamp
parents:
diff changeset
4989 movff xC+0,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4990 movff xC+1,hi ; restore lo and hi with updated value
0
heinrichsweikamp
parents:
diff changeset
4991 return
heinrichsweikamp
parents:
diff changeset
4992
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4993 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4994
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4995 global convert_celsius_to_fahrenheit ; convert value in lo:hi from Celsius to Fahrenheit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4996 convert_celsius_to_fahrenheit: ; convert value in lo:hi from Celsius to Fahrenheit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4997 movff lo,xA+0 ; temperature in 1/10 of °C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4998 movff hi,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4999
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5000 movlw LOW d'1000' ; offset °C value by 1000 to get out of any negative numbers
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5001 addwf xA+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5002 movlw HIGH d'1000'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5003 addwfc xA+1,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5004
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5005 movlw d'18' ; adjust scaling: 1°C = 1.8°F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5006 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5007 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5008
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5009 call mult16x16 ; xA*xB=xC (lo:hi * 18)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5010
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5011 movlw d'10'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5012 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5013 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5014
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5015 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5016
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5017 movlw LOW d'1480' ; adjust offset: subtract above offset of 1000 * 1.8 = 1800 now and add 320 => subtract 1480
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5018 subwf xC+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5019 movlw HIGH d'1480'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5020 subwfb xC+1,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5021
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5022 movff xC+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5023 movff xC+1,hi ; restore lo and hi with updated value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5024 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5025
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
5026 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5027
0
heinrichsweikamp
parents:
diff changeset
5028 END