Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/outputs.asm @ 778:43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
author | heinrichsweikamp |
---|---|
date | Wed, 07 May 2014 14:58:03 +0200 |
parents | 5d6da9ddde27 |
children | d2b7d78b0019 |
rev | line source |
---|---|
0 | 1 |
2 ; OSTC - diving computer code | |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
4 | |
5 ; This program is free software: you can redistribute it and/or modify | |
6 ; it under the terms of the GNU General Public License as published by | |
7 ; the Free Software Foundation, either version 3 of the License, or | |
8 ; (at your option) any later version. | |
9 | |
10 ; This program is distributed in the hope that it will be useful, | |
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ; GNU General Public License for more details. | |
14 | |
15 ; You should have received a copy of the GNU General Public License | |
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ; routines for display outputs | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; written: 15/01/05 | |
124 | 22 ; |
23 ; History: | |
24 ; 2008-06-06 [MH] last updated | |
25 ; 2010-12-31 [jDG] Multi-page display for GF decoplan | |
128 | 26 ; 2011-01-04 [jDG] Saturation graphs in customview divemode |
124 | 27 ; |
0 | 28 ; known bugs: |
29 ; ToDo: More comments | |
30 | |
681 | 31 global DISP_divemask_color |
32 DISP_divemask_color: | |
25 | 33 GETCUSTOM8 d'36' ; Divemask output color |
681 | 34 bra DISP_standard_color_0 |
35 | |
36 global DISP_warnings_color | |
37 DISP_warnings_color: | |
25 | 38 GETCUSTOM8 d'37' ; Warnings output color |
681 | 39 bra DISP_standard_color_0 |
40 | |
41 global DISP_standard_color | |
42 DISP_standard_color: | |
29 | 43 GETCUSTOM8 d'35' ; Standard output color |
681 | 44 DISP_standard_color_0: ; Common entry point |
45 movwf DISPLAY1_temp ; copy | |
29 | 46 movlw d'0' |
681 | 47 cpfseq DISPLAY1_temp |
48 bra DISP_standard_color_1 | |
49 bra DISP_standard_color2 | |
50 DISP_standard_color_1: | |
29 | 51 movlw d'4' |
681 | 52 cpfseq DISPLAY1_temp |
53 bra DISP_standard_color_2 | |
54 bra DISP_standard_color2 | |
55 DISP_standard_color_2: | |
29 | 56 movlw d'8' |
681 | 57 cpfseq DISPLAY1_temp |
58 bra DISP_standard_color_3 | |
59 bra DISP_standard_color2 | |
60 DISP_standard_color_3: | |
29 | 61 movlw d'192' |
681 | 62 cpfseq DISPLAY1_temp |
63 bra DISP_standard_color_4 | |
64 bra DISP_standard_color2 | |
65 DISP_standard_color_4: | |
29 | 66 movlw d'196' |
681 | 67 cpfseq DISPLAY1_temp |
68 bra DISP_standard_color_5 | |
69 bra DISP_standard_color2 | |
70 DISP_standard_color_5: | |
29 | 71 movlw d'200' |
681 | 72 cpfseq DISPLAY1_temp |
73 bra DISP_standard_color_6 | |
74 bra DISP_standard_color2 | |
75 DISP_standard_color_6: | |
76 movf DISPLAY1_temp,W ; Color should be OK... | |
77 call DISP_set_color | |
29 | 78 return |
681 | 79 DISP_standard_color2: |
77 | 80 movlw 0xFF ; Force full white. |
681 | 81 call DISP_set_color |
25 | 82 return |
3 | 83 |
681 | 84 DISP_color_code macro color_code_temp |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
85 movlw color_code_temp |
681 | 86 call DISP_color_code1 |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
87 endm |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
88 |
681 | 89 DISP_color_code1: ; Color-codes the output, if required |
142 | 90 dcfsnz WREG |
681 | 91 bra DISP_color_code_depth ; CF43 [mbar], 16Bit |
142 | 92 dcfsnz WREG |
681 | 93 bra DISP_color_code_cns ; CF44 [%] |
142 | 94 dcfsnz WREG |
681 | 95 bra DISP_color_code_gf ; CF45 [%] |
142 | 96 dcfsnz WREG |
681 | 97 bra DISP_color_code_ppo2 ; CF46 [cbar] |
142 | 98 dcfsnz WREG |
681 | 99 bra DISP_color_code_velocity ; CF47 [m/min] |
142 | 100 dcfsnz WREG |
681 | 101 bra DISP_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling |
142 | 102 dcfsnz WREG |
681 | 103 bra DISP_color_code_gaslist ; Color-code current row in Gaslist (%O2 in "EEDATA") |
104 | |
105 | |
106 DISP_color_code_gaslist: ; %O2 in "EEDATA" | |
74 | 107 ; Check very high ppO2 manually |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
108 SAFE_2BYTE_COPY amb_pressure,xA |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
109 movlw d'10' |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
110 movwf xB+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
111 clrf xB+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
112 call div16x16 ; xC=p_amb/10 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
113 movff xC+0,xA+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
114 movff xC+1,xA+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
115 movff EEDATA,xB+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
116 clrf xB+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
117 call mult16x16 ; EEDATA * p_amb/10 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
118 |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
119 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
681 | 120 bra DISP_color_code_gaslist1 ; Yes, warn in warning color |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
121 ; Check if ppO2>3,30bar |
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
122 btfsc xC+1,7 |
681 | 123 bra DISP_color_code_gaslist1 ; Yes, warn in warning color |
74 | 124 |
125 movff xC+0,sub_a+0 | |
126 movff xC+1,sub_a+1 | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
127 GETCUSTOM8 d'46' ; color-code ppO2 warning [cbar] |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
128 mullw d'100' ; ppo2_warning_high*100 |
74 | 129 movff PRODL,sub_b+0 |
130 movff PRODH,sub_b+1 | |
131 call sub16 ; sub_c = sub_a - sub_b | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
132 btfss neg_flag |
681 | 133 bra DISP_color_code_gaslist1; too high -> Warning Color! |
134 call DISP_standard_color | |
74 | 135 return |
136 | |
681 | 137 DISP_color_code_gaslist1: |
138 call DISP_warnings_color | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
139 return |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
140 |
681 | 141 DISP_color_code_ceiling: |
69 | 142 GETCUSTOM8 d'40' ; =1: Warn at all? |
143 movwf lo | |
144 movlw d'1' | |
145 cpfseq lo ; =1? | |
681 | 146 bra DISP_color_code_ceiling1 ; No, Set to default color |
69 | 147 |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
148 SAFE_2BYTE_COPY rel_pressure, lo |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
149 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
296 | 150 movff hi,xA+1 |
151 movff lo,xA+0 | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
152 movff char_O_first_deco_depth,lo ; Ceiling in m |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
153 decf lo,F ; -1 |
69 | 154 movlw LOW d'100' |
155 movwf xB+0 | |
156 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m | |
157 call div16x16 ; xA/xB=xC with xA as remainder | |
158 movf xC+0,W ; Depth in m | |
159 subwf lo,W | |
160 btfsc STATUS,C | |
681 | 161 bra DISP_color_code_ceiling2 ; Set to warning color |
162 DISP_color_code_ceiling1: | |
163 call DISP_standard_color | |
69 | 164 return |
681 | 165 DISP_color_code_ceiling2: |
166 call DISP_warnings_color | |
69 | 167 return |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
168 |
681 | 169 DISP_color_code_depth: |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
170 movff hi,hi_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
171 movff lo,lo_temp |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
172 SAFE_2BYTE_COPY rel_pressure, lo |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
173 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
174 movff lo,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
175 movff hi,sub_a+1 |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
176 GETCUSTOM15 d'43' ; Depth warn [mbar] |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
177 movff lo,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
178 movff hi,sub_b+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
179 call sub16 ; sub_c = sub_a - sub_b |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
180 btfss neg_flag |
681 | 181 bra DISP_color_code_depth2; Set to warning color |
182 call DISP_standard_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
183 movff hi_temp,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
184 movff lo_temp,lo ; Restore hi, lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
185 return |
681 | 186 DISP_color_code_depth2: |
187 call DISP_warnings_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
188 movff hi_temp,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
189 movff lo_temp,lo ; Restore hi, lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
190 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
191 |
681 | 192 DISP_color_code_cns: |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
193 movff char_O_CNS_fraction,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
194 GETCUSTOM8 d'44' ; CNS Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
195 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
196 btfsc STATUS,C |
681 | 197 bra DISP_color_code_cns2 ; Set to warning color |
198 call DISP_standard_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
199 return |
681 | 200 DISP_color_code_cns2: |
201 call DISP_warnings_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
202 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
203 |
681 | 204 DISP_color_code_gf: |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
205 movff char_O_gradient_factor,lo ; gradient factor |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
206 GETCUSTOM8 d'45' ; GF Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
207 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
208 btfsc STATUS,C |
681 | 209 bra DISP_color_code_gf2 ; Set to warning color |
210 call DISP_standard_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
211 return |
681 | 212 DISP_color_code_gf2: |
213 call DISP_warnings_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
214 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
215 |
681 | 216 DISP_color_code_ppo2: |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
217 ; Check if ppO2>6,55bar |
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
218 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
681 | 219 bra DISP_color_code_ppo22 ; Yes, warn in warning color |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
220 ; Check if ppO2>3,30bar |
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
221 btfsc xC+1,7 |
681 | 222 bra DISP_color_code_ppo22 ; Yes, warn in warning color |
74 | 223 |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
224 movff xC+0,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
225 movff xC+1,sub_a+1 |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
226 GETCUSTOM8 d'46' ; color-code ppO2 warning [cbar] |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
227 mullw d'100' |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
228 movff PRODL,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
229 movff PRODH,sub_b+1 |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
230 call sub16 ; sub_c = sub_a - sub_b |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
231 btfss neg_flag |
681 | 232 bra DISP_color_code_ppo22; Set to warning color |
233 call DISP_standard_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
234 return |
681 | 235 DISP_color_code_ppo22: |
236 call DISP_warnings_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
237 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
238 |
681 | 239 DISP_color_code_velocity: |
47 | 240 btfss neg_flag ; Ignore for ascend! |
681 | 241 bra DISP_color_code_velocity1 ; Skip check! |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
242 movff divA+0,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
243 GETCUSTOM8 d'47' ; Velocity warn [m/min] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
244 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
245 btfsc STATUS,C |
681 | 246 bra DISP_color_code_velocity2 ; Set to warning color |
247 DISP_color_code_velocity1: | |
248 call DISP_standard_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
249 return |
681 | 250 DISP_color_code_velocity2: |
251 call DISP_warnings_color | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
252 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
253 |
142 | 254 ostc_debug macro value |
255 movlw value | |
0 | 256 call ostc_debug1 |
257 endm | |
258 | |
259 ostc_debug1: | |
260 movff debug_char+4,debug_char+5 ; Save for background debugger | |
261 movff debug_char+3,debug_char+4 | |
262 movff debug_char+2,debug_char+3 | |
263 movff debug_char+1,debug_char+2 | |
264 movff debug_char+0,debug_char+1 | |
142 | 265 movff WREG,debug_char+0 |
0 | 266 |
267 btfss debug_mode ; Are we in debugmode? | |
268 return ; No, return! | |
269 | |
256 | 270 WIN_TOP .192 |
0 | 271 WIN_LEFT .100 |
272 WIN_FONT FT_SMALL | |
273 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 274 call DISP_standard_color |
0 | 275 lfsr FSR2,letter |
276 movf debug_char+0,W | |
277 movwf POSTINC2 | |
278 movf debug_char+1,W | |
279 movwf POSTINC2 | |
280 movf debug_char+2,W | |
281 movwf POSTINC2 | |
282 movf debug_char+3,W | |
283 movwf POSTINC2 | |
284 movf debug_char+4,W | |
285 movwf POSTINC2 | |
286 movf debug_char+5,W | |
287 movwf POSTINC2 | |
123 | 288 |
289 STRCAT_PRINT " " | |
0 | 290 return |
291 | |
235 | 292 ;============================================================================= |
293 ; BlueScreen function. | |
294 ; | |
681 | 295 DISP_resetdebugger: |
296 global DISP_resetdebugger | |
235 | 297 global temp10 |
298 | |
299 movlb 1 ; For C-code calls | |
720 | 300 call DISPLAY_boot ; DISP boot |
681 | 301 call DISP_standard_color |
47 | 302 WIN_INVERT .0 ; Init new Wordprocessor |
0 | 303 |
304 DISPLAYTEXT .133 | |
305 DISPLAYTEXT .134 | |
306 DISPLAYTEXT .135 | |
307 DISPLAYTEXT .136 ; Display Debug intro | |
308 | |
309 WIN_TOP .100 | |
310 WIN_LEFT .10 | |
235 | 311 |
0 | 312 lfsr FSR2,letter |
235 | 313 movff temp10+0,lo ; Code-stack point at crash time. |
314 movff temp10+1,hi ; Code-stack point at crash time. | |
315 output_16 | |
119 | 316 movlw ' ' |
317 movwf POSTINC2 | |
0 | 318 movf debug_char+0,W |
319 movwf POSTINC2 | |
320 movf debug_char+1,W | |
321 movwf POSTINC2 | |
322 movf debug_char+2,W | |
323 movwf POSTINC2 | |
324 movf debug_char+3,W | |
325 movwf POSTINC2 | |
326 movf debug_char+4,W | |
327 movwf POSTINC2 | |
328 movf debug_char+5,W | |
329 movwf POSTINC2 | |
123 | 330 STRCAT ". " |
0 | 331 movff flag1,lo |
332 output_8 | |
123 | 333 PUTC ' ' |
0 | 334 movff flag2,lo |
335 output_8 | |
336 call word_processor | |
337 | |
338 WIN_TOP .125 | |
339 | |
340 lfsr FSR2,letter | |
341 movff flag3,lo | |
342 output_8 | |
123 | 343 PUTC ' ' |
0 | 344 movff flag4,lo |
345 output_8 | |
123 | 346 PUTC ' ' |
0 | 347 movff flag5,lo |
348 output_8 | |
123 | 349 PUTC ' ' |
0 | 350 movff flag6,lo |
351 output_8 | |
123 | 352 PUTC ' ' |
0 | 353 movff flag7,lo |
354 output_8 | |
355 call word_processor | |
356 | |
357 WIN_TOP .150 | |
358 | |
359 lfsr FSR2,letter | |
360 movff flag8,lo | |
361 output_8 | |
123 | 362 PUTC ' ' |
0 | 363 movff flag9,lo |
364 output_8 | |
123 | 365 PUTC ' ' |
0 | 366 movff flag10,lo |
367 output_8 | |
123 | 368 PUTC ' ' |
0 | 369 movff flag11,lo |
370 output_8 | |
123 | 371 PUTC ' ' |
0 | 372 movff flag12,lo |
373 output_8 | |
374 call word_processor | |
375 | |
576 | 376 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
681 | 377 DISP_resetdebugger_loop: |
235 | 378 bcf LED_blue ; Blink blue led every seconds.. |
379 btfss secs,0 | |
380 bsf LED_blue | |
381 | |
0 | 382 btfss switch_left |
681 | 383 bra DISP_resetdebugger_loop ; Loop |
235 | 384 |
385 bcf LED_blue | |
576 | 386 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 387 return |
388 | |
681 | 389 DISP_divemode_mask: ; Displays mask in Dive-Mode |
390 call DISP_divemask_color ; Set Color for Divemode mask | |
75 | 391 DISPLAYTEXTH .267 ; Max. |
0 | 392 DISPLAYTEXT .86 ; Divetime |
393 DISPLAYTEXT .87 ; Depth | |
681 | 394 call DISP_standard_color |
0 | 395 return |
396 | |
681 | 397 DISP_clear_customview_divemode: |
204 | 398 WIN_BOX_BLACK .168, .239, .90, .159 ;top, bottom, left, right |
87 | 399 return |
400 | |
681 | 401 DISP_clear_customview_surfmode: |
204 | 402 WIN_BOX_BLACK .25, .121, .82, .159 ;top, bottom, left, right |
107 | 403 return |
404 | |
681 | 405 DISP_clear_decoarea: |
204 | 406 WIN_BOX_BLACK .54, .168, .90, .159 ;top, bottom, left, right |
0 | 407 return |
408 | |
681 | 409 DISP_display_ndl_mask: |
619 | 410 ; Clears Gradient Factor |
411 movlw d'8' | |
412 movwf temp1 | |
413 WIN_TOP .145 | |
414 WIN_LEFT .0 | |
681 | 415 call DISP_display_clear_common_y1 |
619 | 416 |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
417 btfsc menubit ; Divemode menu active? |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
418 return ; Yes, return |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
419 |
0 | 420 ; Clear Dekostop and Dekosum |
681 | 421 rcall DISP_clear_decoarea |
422 call DISP_divemask_color ; Set Color for Divemode mask | |
0 | 423 DISPLAYTEXT d'84' ; NoStop |
681 | 424 call DISP_standard_color |
0 | 425 return |
426 | |
681 | 427 DISP_display_ndl: |
619 | 428 GETCUSTOM8 d'66' ; Always show GF? |
429 decfsz WREG,F ; WREG=1? | |
681 | 430 bra DISP_display_ndl2 ; No |
431 rcall DISP_display_gf ; Show GF (If GF > CF08) | |
432 | |
433 DISP_display_ndl2: | |
87 | 434 btfsc menubit ; Divemode menu active? |
435 return ; Yes, return | |
0 | 436 |
437 ostc_debug 'z' ; Sends debug-information to screen if debugmode active | |
438 | |
87 | 439 WIN_TOP .136 |
682 | 440 WIN_LEFT .118 |
0 | 441 WIN_FONT FT_MEDIUM |
442 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 443 call DISP_standard_color |
3 | 444 |
0 | 445 lfsr FSR2,letter |
446 movff char_O_nullzeit,lo ; NDL in minutes | |
447 output_8 | |
123 | 448 STRCAT_PRINT "'" |
0 | 449 WIN_FONT FT_SMALL |
450 return | |
451 | |
681 | 452 DISP_display_deko_mask: |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
453 btfsc menubit ; Divemode menu active? |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
454 return ; Yes, return |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
455 |
681 | 456 rcall DISP_clear_decoarea |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
457 ; total deco time word |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
458 bcf show_safety_stop ; Clear safety stop flag |
681 | 459 call DISP_divemask_color ; Set Color for Divemode mask |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
460 DISPLAYTEXT d'85' ; TTS |
280 | 461 DISPLAYTEXT d'82' ; DEKOSTOP |
681 | 462 call DISP_standard_color |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
463 return |
0 | 464 |
681 | 465 DISP_display_deko: |
0 | 466 btfsc menubit ; Divemode menu active? |
681 | 467 bra DISP_display_deko1 ; Yes, do not display deco, only GF (if required) |
0 | 468 |
469 ostc_debug 'y' ; Sends debug-information to screen if debugmode active | |
87 | 470 WIN_TOP .80 |
517 | 471 WIN_LEFT .94 |
0 | 472 WIN_FONT FT_MEDIUM |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
473 WIN_INVERT .0 ; Init new Wordprocessor |
571
7f5419d4157d
timeout for 2nd page of Gas Setup, ceiling allingment
heinrichsweikamp
parents:
559
diff
changeset
|
474 bcf leftbind |
681 | 475 DISP_color_code warn_ceiling ; Color-code Output |
665
259e4c1bf3c2
grey-out TTS and ceiling after gas change (until new plan is ready)
heinrichsweikamp
parents:
657
diff
changeset
|
476 btfsc decoplan_invalid ; The decoplan needs to updated... |
681 | 477 call DISP_grey ; .. so set the color to grey |
0 | 478 lfsr FSR2,letter |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
479 movff char_O_first_deco_depth,lo ; Ceiling in m |
0 | 480 output_99 |
446 | 481 PUTC TXT_METER_C |
517 | 482 movff char_O_first_deco_time,lo ; length of first stop in m |
0 | 483 output_99 |
123 | 484 STRCAT_PRINT "'" |
0 | 485 WIN_FONT FT_SMALL |
517 | 486 |
0 | 487 ostc_debug 'x' ; Sends debug-information to screen if debugmode active |
488 | |
87 | 489 WIN_TOP .136 |
168 | 490 WIN_LEFT .140 - 6*7 - 4 ; let space for sign + 5 digits + ' |
0 | 491 WIN_FONT FT_MEDIUM |
168 | 492 WIN_INVERT .0 ; Init new Wordprocessor |
493 | |
681 | 494 call DISP_standard_color |
665
259e4c1bf3c2
grey-out TTS and ceiling after gas change (until new plan is ready)
heinrichsweikamp
parents:
657
diff
changeset
|
495 btfsc decoplan_invalid ; The decoplan needs to updated... |
681 | 496 call DISP_grey ; .. so set the color to grey |
0 | 497 lfsr FSR2,letter |
180 | 498 movff int_O_ascenttime+0,lo ; TTS |
168 | 499 movff int_O_ascenttime+1,hi ; on 16bits |
500 output_16 | |
123 | 501 STRCAT_PRINT "'" |
681 | 502 call DISP_standard_color |
503 | |
504 DISP_display_deko1: | |
505 rcall DISP_display_gf ; Show GF (If GF > CF08) | |
619 | 506 return ; Done. |
507 | |
681 | 508 DISP_display_gf: |
619 | 509 movff char_O_gradient_factor,lo ; gradient factor |
510 GETCUSTOM8 d'8' ; threshold for display | |
511 cpfslt lo ; show value? | |
681 | 512 bra DISP_display_deko2 ; Yes |
0 | 513 ; No |
619 | 514 ; Clears Gradient Factor |
515 movlw d'8' | |
516 movwf temp1 | |
517 WIN_TOP .145 | |
518 WIN_LEFT .0 | |
681 | 519 call DISP_display_clear_common_y1 |
619 | 520 return |
0 | 521 |
681 | 522 DISP_display_deko2: |
0 | 523 ostc_debug 'w' ; Sends debug-information to screen if debugmode active |
524 ;GF | |
525 WIN_TOP .145 | |
526 WIN_LEFT .0 | |
527 WIN_FONT FT_SMALL | |
681 | 528 DISP_color_code warn_gf ; Color-code Output |
123 | 529 |
446 | 530 STRCPY TXT_GF3 |
0 | 531 movff char_O_gradient_factor,lo ; gradient factor |
532 output_8 | |
123 | 533 STRCAT_PRINT "% " |
681 | 534 call DISP_standard_color |
0 | 535 return |
536 | |
681 | 537 DISP_show_safety_stop: |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
538 tstfsz safety_stop_countdown ; Countdown at zero? |
681 | 539 bra DISP_show_safety_stop2 ; No, show stop |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
540 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
541 bcf show_safety_stop ; Clear flag |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
542 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
543 btfsc safety_stop_active ; Displayed? |
681 | 544 rcall DISP_clear_decoarea ; Yes, Clear stop |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
545 bcf safety_stop_active ; Clear flag |
681 | 546 bra DISP_display_ndl_mask ; Show NDL again |
547 | |
548 DISP_show_safety_stop2: | |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
549 btfsc safety_stop_active ; Displayed? |
681 | 550 bra DISP_show_safety_stop3 ; Yes. |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
551 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
552 bsf safety_stop_active ; Set flag |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
553 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
554 btfsc menubit ; Divemode menu active? |
681 | 555 bra DISP_show_safety_stop3 ; Yes, do not display now but countdown |
556 | |
557 call DISP_divemask_color ; Set Color for Divemode mask | |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
558 DISPLAYTEXT d'227' ; Safety stop |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
559 |
681 | 560 DISP_show_safety_stop3: |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
561 decf safety_stop_countdown,F ; Reduce countdown |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
562 btfsc menubit ; Divemode menu active? |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
563 return ; Yes, do not show |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
564 movff safety_stop_countdown,lo |
681 | 565 call DISP_standard_color |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
566 WIN_TOP .80 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
567 WIN_LEFT .104 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
568 WIN_FONT FT_MEDIUM |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
569 WIN_INVERT .0 ; Init new Wordprocessor |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
570 lfsr FSR2,letter |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
571 clrf hi |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
572 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo) |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
573 movf hi,W |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
574 movff lo,hi |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
575 movwf lo ; exchange lo and hi |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
576 output_99 |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
577 PUTC ':' |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
578 movff hi,lo |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
579 output_99x |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
580 STRCAT_PRINT "" |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
581 WIN_FONT FT_SMALL |
681 | 582 call DISP_standard_color |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
583 return |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
592
diff
changeset
|
584 |
199 | 585 ;============================================================================= |
586 ; Update simulator menu with time/depth | |
587 ; Note: because translations might change a bit the string length, we reprint | |
588 ; that part of the mask to be sure the numbers fit in the right places. | |
681 | 589 DISP_simulator_data: |
199 | 590 WIN_LEFT .20 |
0 | 591 WIN_FONT FT_SMALL |
681 | 592 call DISP_standard_color |
369 | 593 |
594 ;---- Updates interval line ---------------------------------------------- | |
595 WIN_TOP .35 | |
596 lfsr FSR2,letter | |
370 | 597 OUTPUTTEXTH .307 ; Interval: |
369 | 598 |
599 movff char_I_dive_interval,lo | |
600 movf lo,W | |
681 | 601 bnz DISP_simulator_data_1 |
370 | 602 OUTPUTTEXTH .308 ; Now |
369 | 603 clrf POSTINC2 ; End buffer. |
681 | 604 bra DISP_simulator_data_2 |
605 | |
606 DISP_simulator_data_1: | |
0 | 607 bsf leftbind |
608 output_8 | |
446 | 609 STRCAT TXT_0MIN5 |
369 | 610 |
681 | 611 DISP_simulator_data_2: |
369 | 612 call word_processor |
613 | |
614 ;---- Updates bottom time line ------------------------------------------- | |
615 WIN_TOP .95 | |
616 lfsr FSR2,letter | |
617 OUTPUTTEXTH .277 ; Bottom Time: | |
618 | |
430 | 619 movff sim_btm_time,lo |
369 | 620 bsf leftbind |
621 output_8 | |
446 | 622 STRCAT_PRINT TXT_MIN4 |
0 | 623 |
369 | 624 ;---- Updates depth line ------------------------------------------------- |
625 WIN_TOP .125 | |
0 | 626 lfsr FSR2,letter |
199 | 627 OUTPUTTEXTH .278 ; Max. Depth: |
628 | |
430 | 629 movff sim_btm_depth,lo |
0 | 630 bsf leftbind |
631 output_8 | |
446 | 632 STRCAT_PRINT TXT_METER3 |
369 | 633 |
0 | 634 bcf leftbind |
635 return | |
636 | |
199 | 637 ;============================================================================= |
638 | |
681 | 639 DISP_divemode_timeout2: |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
640 WIN_TOP .54 |
689 | 641 WIN_LEFT .110 |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
642 WIN_FONT FT_SMALL |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
643 WIN_INVERT .1 |
681 | 644 call DISP_warnings_color |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
645 STRCPY 0x94 ; "End of dive" icon |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
646 movff timeout_counter, lo |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
647 movff timeout_counter2, hi |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
648 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
649 movf hi,W |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
650 movff lo,hi |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
651 movwf lo ; exchange lo and hi |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
652 output_99x |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
653 PUTC ':' |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
654 movff hi,lo |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
655 output_99x |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
656 STRCAT_PRINT " " |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
657 bsf timeout_display ; Set Flag |
681 | 658 call DISP_standard_color |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
659 WIN_INVERT .0 |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
660 return |
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
661 |
681 | 662 DISP_divemode_timeout: |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
663 WIN_TOP .54 |
689 | 664 WIN_LEFT .110 |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
665 WIN_FONT FT_SMALL |
681 | 666 call DISP_standard_color |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
667 STRCPY 0x94 ; "End of dive" icon |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
668 GETCUSTOM15 d'2' ; diveloop_timeout |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
669 movff lo,sub_a+0 |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
670 movff hi,sub_a+1 |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
671 movff timeout_counter, sub_b+0 |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
672 movff timeout_counter2, sub_b+1 ; Divemode timeout |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
673 call sub16 ; sub_c = sub_a - sub_b |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
674 movff sub_c+0,lo |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
675 movff sub_c+1,hi |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
676 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
677 movf hi,W |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
678 movff lo,hi |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
679 movwf lo ; exchange lo and hi |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
680 output_99x |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
681 PUTC ':' |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
682 movff hi,lo |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
683 output_99x |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
684 STRCAT_PRINT " " |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
685 bsf timeout_display ; Set Flag |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
686 return |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
687 |
681 | 688 DISP_divemode_timeout_clear: |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
689 btfsc dekostop_active ; Is a deco stop displayed? |
681 | 690 call DISP_display_deko_mask ; Yes, redraw mask |
572
80a1d2d5a9ee
timeout display when deco stops are violated
heinrichsweikamp
parents:
571
diff
changeset
|
691 |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
692 WIN_TOP .54 |
739
96d32c0cf206
BUGFIX: Clear end-of-dive countdown properly when descending again
heinrichsweikamp
parents:
734
diff
changeset
|
693 WIN_LEFT .110 |
408
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
694 movlw d'6' |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
695 movwf temp1 |
3e0192f6c241
NEW: End-of-Dive countdown displayed after surfacing
heinrichsweikamp
parents:
406
diff
changeset
|
696 bcf timeout_display ; Clear flag |
681 | 697 bra DISP_display_clear_common_y1 |
698 | |
699 DISP_display_velocity_graph_clr: | |
497
06db5dd9149f
show numeric _and_ graphic velocity, move desat, nofly and interval into isr
heinrichsweikamp
parents:
492
diff
changeset
|
700 WIN_BOX_BLACK .20, .90, .65, .75 ; Clear graphic display |
681 | 701 bra DISP_display_velocity ; Continue with normal output |
702 | |
703 DISP_display_velocity_graphical: | |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
704 btfss neg_flag |
681 | 705 bra DISP_display_velocity_graph_clr |
706 bsf DISP_velocity_display | |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
707 ; divA+0 holding the ascend speed in m/min |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
708 movff divA+0,hi ; Copy |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
709 WIN_BOX_BLACK .20, .90, .65, .75 ; Clear graphic display |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
710 GETCUSTOM8 d'36' ; Divemode mask |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
711 WIN_FRAME_COLOR .20, .90, .65, .75 ; Outer frame |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
712 GETCUSTOM8 d'36' ; Divemode mask |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
713 WIN_FRAME_COLOR .20+.10, .90-.10, .65, .75 ; Inner frames |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
714 GETCUSTOM8 d'36' ; Divemode mask |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
715 WIN_FRAME_COLOR .20+.20, .90-.20, .65, .75 ; |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
716 GETCUSTOM8 d'36' ; Divemode mask |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
717 WIN_FRAME_COLOR .20+.30, .90-.30, .65, .75 ; |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
718 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
719 GETCUSTOM8 d'47' ; color_warn_celocity_mmin |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
720 movwf xA+0 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
721 clrf xA+1 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
722 movlw .5 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
723 movwf xB+0 ; Threshold for color warning (5 color normal + 2 color warning) |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
724 clrf xB+1 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
725 call div16x16 ;xA/xB=xC with xA as remainder |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
726 ; xC+0 holds stepsize in m/min (e.g. =3 for 15m/min warning treshold) |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
727 movff hi,xA+0 ; Velocity in m/min |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
728 clrf xA+1 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
729 movff xC+0,xB+0 ; Step size |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
730 clrf xB+1 |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
731 call div16x16 ;xA/xB=xC with xA as remainder |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
732 ; xC+0 now holds amount of segments to show |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
733 |
497
06db5dd9149f
show numeric _and_ graphic velocity, move desat, nofly and interval into isr
heinrichsweikamp
parents:
492
diff
changeset
|
734 movff hi,divA+0 ; Copy back for numeric output |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
735 movlw d'7' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
736 cpfslt xC+0 |
681 | 737 bra DISP_graph_vel_7 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
738 movlw d'6' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
739 cpfslt xC+0 |
681 | 740 bra DISP_graph_vel_6 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
741 movlw d'5' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
742 cpfslt xC+0 |
681 | 743 bra DISP_graph_vel_5 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
744 movlw d'4' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
745 cpfslt xC+0 |
681 | 746 bra DISP_graph_vel_4 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
747 movlw d'3' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
748 cpfslt xC+0 |
681 | 749 bra DISP_graph_vel_3 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
750 movlw d'2' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
751 cpfslt xC+0 |
681 | 752 bra DISP_graph_vel_2 |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
753 movlw d'1' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
754 cpfslt xC+0 |
681 | 755 bra DISP_graph_vel_1 |
756 bra DISP_graph_vel_0 ; Should not happen... | |
757 | |
758 DISP_graph_vel_7: | |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
759 GETCUSTOM8 d'37' ; Color warning |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
760 WIN_BOX_COLOR .22, .22+.6, .67, .73 ; Fill box |
681 | 761 DISP_graph_vel_6: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
762 GETCUSTOM8 d'37' ; Color warning |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
763 WIN_BOX_COLOR .32, .32+.6, .67, .73 ; Fill box |
681 | 764 DISP_graph_vel_5: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
765 WIN_BOX_STD .42, .42+.6, .67, .73 ; Fill box |
681 | 766 DISP_graph_vel_4: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
767 WIN_BOX_STD .52, .52+.6, .67, .73 ; Fill box |
681 | 768 DISP_graph_vel_3: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
769 WIN_BOX_STD .62, .62+.6, .67, .73 ; Fill box |
681 | 770 DISP_graph_vel_2: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
771 WIN_BOX_STD .72, .72+.6, .67, .73 ; Fill box |
681 | 772 DISP_graph_vel_1: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
773 WIN_BOX_STD .82, .82+.6, .67, .73 ; Fill box |
681 | 774 DISP_graph_vel_0: |
775 | |
776 DISP_display_velocity: | |
0 | 777 ostc_debug 'v' ; Sends debug-information to screen if debugmode active |
778 WIN_TOP .90 | |
779 WIN_LEFT .0 | |
780 WIN_FONT FT_SMALL | |
681 | 781 DISP_color_code warn_velocity ; Color code output |
0 | 782 lfsr FSR2,letter |
783 movlw '-' | |
784 btfsc neg_flag | |
785 movlw '+' | |
786 movwf POSTINC2 | |
787 movff divA+0,lo | |
788 output_99 | |
789 OUTPUTTEXT d'83' ; m/min | |
517 | 790 call word_processor |
681 | 791 call DISP_standard_color |
792 bsf DISP_velocity_display | |
0 | 793 return |
794 | |
681 | 795 DISP_display_velocity_clear: |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
796 GETCUSTOM8 d'60' ; use graphic velocity (=1)? |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
797 movwf lo |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
798 movlw d'1' |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
799 cpfseq lo ; =1? |
681 | 800 bra DISP_display_velocity_clear1 ; No, clear text display |
492
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
801 WIN_BOX_BLACK .20, .90, .65, .75 ; Clear graphic display |
19b9e19ea4da
+CHANGE: Velocity display updated every second
heinrichsweikamp
parents:
479
diff
changeset
|
802 |
681 | 803 DISP_display_velocity_clear1: |
517 | 804 movlw d'8' |
0 | 805 movwf temp1 |
806 WIN_TOP .90 | |
807 WIN_LEFT .0 | |
681 | 808 bcf DISP_velocity_display |
809 bra DISP_display_clear_common_y1 | |
810 | |
811 DISP_display_wait_clear: | |
204 | 812 WIN_BOX_BLACK .0, .25, .0, .159 ;top, bottom, left, right |
813 return | |
0 | 814 |
681 | 815 DISP_display_clear_common_y2: ; Clears with y-scale=2 |
0 | 816 WIN_FONT FT_MEDIUM |
681 | 817 bra DISP_display_clear_common1 |
818 | |
819 DISP_display_clear_common_y1: ; Clears with y-scale=1 | |
0 | 820 WIN_FONT FT_SMALL |
681 | 821 DISP_display_clear_common1: |
0 | 822 lfsr FSR2,letter |
681 | 823 DISP_display_clear_common2: |
123 | 824 PUTC ' ' |
0 | 825 decfsz temp1,F |
681 | 826 bra DISP_display_clear_common2 |
0 | 827 call word_processor |
828 WIN_FONT FT_SMALL | |
829 return | |
830 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
831 |
681 | 832 DISP_diveclock: |
833 call DISP_divemask_color ; Set Color for Divemode mask | |
778
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
834 DISPLAYTEXT d'255' ; Time: |
681 | 835 call DISP_standard_color |
836 | |
837 DISP_diveclock2: | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
838 WIN_TOP .192 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
839 WIN_LEFT .123 |
63 | 840 WIN_FONT FT_SMALL |
841 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 842 call DISP_standard_color |
63 | 843 lfsr FSR2,letter |
844 movff hours,lo | |
845 output_99x | |
123 | 846 PUTC ':' |
63 | 847 movff mins,lo |
848 output_99x | |
849 call word_processor | |
778
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
850 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
851 DISP_diveclock3: ; Update end of divetime only |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
852 WIN_TOP .216 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
853 WIN_LEFT .116 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
854 WIN_FONT FT_SMALL |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
855 WIN_INVERT .0 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
856 call DISP_standard_color |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
857 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
858 btfss dekostop_active ; Already in nodeco mode ? |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
859 bra DISP_diveclock4 ; No, overwrite with some spaces |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
860 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
861 STRCPY 0x94 ; "End of dive" icon |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
862 movff hours,WREG |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
863 mullw .60 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
864 movf mins,W |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
865 addwf PRODL |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
866 movlw .0 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
867 addwfc PRODH |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
868 movff PRODL, lo |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
869 movff PRODH, hi |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
870 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
871 ; Add TTS |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
872 movff int_O_ascenttime+0,WREG ; TTS |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
873 addwf lo,F |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
874 movff int_O_ascenttime+1,WREG ; TTS is 16bits |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
875 addwfc hi,F |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
876 |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
877 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
878 movf hi,W |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
879 movff lo,hi |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
880 movwf lo ; exchange lo and hi |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
881 output_99x |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
882 PUTC ':' |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
883 movff hi,lo |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
884 output_99x |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
885 STRCAT_PRINT "" |
63 | 886 return |
887 | |
778
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
888 DISP_diveclock4: |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
889 STRCPY_PRINT " " |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
890 return |
43ef5a003df7
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
772
diff
changeset
|
891 |
681 | 892 DISP_clock: |
0 | 893 ostc_debug 'c' |
894 WIN_TOP .50 | |
56 | 895 WIN_LEFT .1 |
0 | 896 WIN_FONT FT_SMALL |
897 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 898 call DISP_standard_color |
0 | 899 lfsr FSR2,letter |
900 movff hours,lo | |
901 output_99x | |
123 | 902 PUTC ':' |
0 | 903 movff mins,lo |
904 output_99x | |
123 | 905 PUTC ':' |
0 | 906 movff secs,lo |
907 output_99x | |
683 | 908 STRCAT_PRINT "" |
0 | 909 return |
910 | |
681 | 911 DISP_interval: |
111 | 912 WIN_TOP .75 |
913 WIN_LEFT .90 | |
914 WIN_FONT FT_SMALL | |
915 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 916 call DISP_standard_color |
111 | 917 lfsr FSR2,letter |
918 | |
919 movff surface_interval+0,lo | |
920 movff surface_interval+1,hi | |
921 call convert_time ; lo=mins, hi=hours | |
922 | |
923 movf hi,W | |
924 movff lo,hi | |
925 movwf lo ; exchange lo and hi | |
926 output_99x | |
123 | 927 PUTC ':' |
111 | 928 movff hi,lo |
929 output_99x | |
123 | 930 STRCAT_PRINT " " |
111 | 931 return |
932 | |
759 | 933 |
934 DISP_show_deco_gas: ; Show the next decogas | |
935 WIN_LEFT .90 | |
936 WIN_FONT FT_SMALL | |
937 WIN_INVERT .0 ; Init new Wordprocessor | |
938 call DISP_divemask_color ; Set Color for Divemode mask | |
939 DISPLAYTEXTH .270 ; Decogas | |
940 | |
941 DISP_show_deco_gas1: | |
942 WIN_LEFT .90 | |
943 WIN_FONT FT_SMALL | |
944 WIN_INVERT .0 ; Init new Wordprocessor | |
945 call DISP_standard_color | |
946 WIN_TOP .192 | |
947 movff char_O_deco_gas+0,lo | |
948 tstfsz lo ; =0? | |
949 bra $+4 ; No | |
950 bra DISP_show_deco_gas2 | |
951 incf lo,F ;+1 | |
952 STRCPY TXT_GAS1 ; "G" | |
953 bsf leftbind | |
954 output_8 | |
955 STRCAT TXT_AT4 ; " at " | |
956 movlw .27 ; 28=Gas 1 | |
957 addwf lo,W | |
958 movwf EEADR | |
959 clrf EEADRH ; Get Change depth | |
960 call read_eeprom | |
961 movff EEDATA,lo | |
962 tstfsz lo ; =0? | |
963 bra $+4 ; No | |
964 bra DISP_show_deco_gas2 | |
965 output_8 ; Change depth | |
966 bcf leftbind | |
967 STRCAT "m " | |
968 clrf WREG | |
768
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
969 movff WREG,letter+.9 ; Limit to 9 chars |
759 | 970 STRCAT_PRINT "" |
971 | |
972 WIN_TOP .216 | |
973 movff char_O_deco_gas+1,lo | |
974 tstfsz lo ; =0? | |
975 bra $+4 ; No | |
976 bra DISP_show_deco_gas3 | |
977 incf lo,F ;+1 | |
978 STRCPY TXT_GAS1 ; "G" | |
979 bsf leftbind | |
980 output_8 | |
981 STRCAT TXT_AT4 ; " at " | |
982 movlw .27 ; 28=Gas 1 | |
983 addwf lo,W | |
984 movwf EEADR | |
985 clrf EEADRH ; Get Change depth | |
986 call read_eeprom | |
987 movff EEDATA,lo | |
988 tstfsz lo ; =0? | |
989 bra $+4 ; No | |
990 bra DISP_show_deco_gas3 | |
991 output_8 ; Change depth | |
992 bcf leftbind | |
993 STRCAT "m " | |
994 clrf WREG | |
768
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
995 movff WREG,letter+.9 ; Limit to 9 chars |
759 | 996 STRCAT_PRINT "" |
997 return | |
998 | |
999 DISP_show_deco_gas2: | |
1000 WIN_BOX_BLACK .192, .239, .90, .159 ;top, bottom, left, right | |
1001 return | |
1002 | |
1003 DISP_show_deco_gas3: | |
1004 WIN_BOX_BLACK .216, .239, .90, .159 ;top, bottom, left, right | |
1005 return | |
1006 | |
681 | 1007 DISP_show_gf_customview: |
666 | 1008 WIN_LEFT .93 |
1009 WIN_FONT FT_SMALL | |
1010 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1011 call DISP_divemask_color ; Set Color for Divemode mask |
666 | 1012 DISPLAYTEXTH .268 ;"Gradient Factors" |
1013 | |
1014 GETCUSTOM8 d'64' ; Set to grey | |
681 | 1015 call DISP_set_color |
666 | 1016 btfss use_aGF |
681 | 1017 call DISP_standard_color |
666 | 1018 |
1019 WIN_TOP .192 | |
1020 STRCPY TXT_GF3 ; "GF:" | |
1021 GETCUSTOM8 d'32' ; GF_lo | |
1022 movwf lo | |
1023 bsf leftbind | |
1024 output_8 | |
1025 STRCAT "/" | |
1026 GETCUSTOM8 d'33' ; GF_hi | |
1027 movwf lo | |
1028 output_8 | |
1029 STRCAT_PRINT "" | |
1030 | |
1031 GETCUSTOM8 d'64' ; Set to grey | |
681 | 1032 call DISP_set_color |
666 | 1033 btfsc use_aGF |
681 | 1034 call DISP_standard_color |
666 | 1035 |
1036 WIN_TOP .216 | |
1037 STRCPY TXT_aGF4 ; "aGF:" | |
1038 GETCUSTOM8 d'67' ; aGF_lo | |
1039 movwf lo | |
1040 bsf leftbind | |
1041 output_8 | |
1042 STRCAT "/" | |
1043 GETCUSTOM8 d'68' ; aGF_hi | |
1044 movwf lo | |
1045 output_8 | |
1046 STRCAT_PRINT "" | |
1047 bcf leftbind | |
1048 | |
681 | 1049 call DISP_standard_color |
666 | 1050 return |
111 | 1051 |
681 | 1052 DISP_show_cf11_cf12_cf29:; Display saturations/desaturation multiplier and last deco in the customview field |
111 | 1053 WIN_TOP .25 |
1054 WIN_LEFT .90 | |
1055 WIN_FONT FT_SMALL | |
1056 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1057 call DISP_standard_color |
446 | 1058 STRCPY TXT_BSAT5 |
123 | 1059 |
111 | 1060 GETCUSTOM8 d'11' |
1061 movwf lo | |
1062 bsf leftbind | |
1063 output_8 | |
123 | 1064 STRCAT_PRINT "%" |
111 | 1065 |
1066 WIN_TOP .50 | |
446 | 1067 STRCPY TXT_BDES5 |
123 | 1068 |
111 | 1069 GETCUSTOM8 d'12' |
1070 movwf lo | |
1071 bsf leftbind | |
1072 output_8 | |
123 | 1073 STRCAT_PRINT "%" |
111 | 1074 |
681 | 1075 DISP_show_cf11_cf12_cf29_2: |
111 | 1076 WIN_TOP .75 |
446 | 1077 STRCPY TXT_LAST5 |
111 | 1078 GETCUSTOM8 d'29' |
1079 movwf lo | |
1080 bsf leftbind | |
1081 output_8 | |
446 | 1082 STRCAT_PRINT TXT_METER1 |
123 | 1083 |
111 | 1084 bcf leftbind |
1085 return | |
1086 | |
681 | 1087 DISP_show_cf32_cf33_cf62_cf63: ; Display GF_LOW, GF_HIGH, pSCR ratio and drop in the customview field |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1088 WIN_TOP .25 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1089 WIN_LEFT .90 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1090 WIN_FONT FT_SMALL |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1091 WIN_INVERT .0 ; Init new Wordprocessor |
681 | 1092 call DISP_standard_color |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1093 GETCUSTOM8 d'32' ; GF_lo |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1094 movwf lo |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1095 STRCPY TXT_GFLO6 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1096 bsf leftbind |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1097 output_8 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1098 STRCAT_PRINT "%" |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1099 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1100 WIN_TOP .50 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1101 GETCUSTOM8 d'33' ; GF_hi |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1102 movwf lo |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1103 STRCPY TXT_GFHI6 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1104 bsf leftbind |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1105 output_8 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1106 STRCAT_PRINT "%" |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1107 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1108 WIN_TOP .75 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1109 lfsr FSR2,letter |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1110 GETCUSTOM8 d'62' ; O2 Drop in percent |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1111 movwf lo |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1112 bsf leftbind |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1113 output_8 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1114 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1115 STRCAT "% 1/" |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1116 GETCUSTOM8 d'63' ; Counter lung ratio in 1/X |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1117 movwf lo |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1118 output_8 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1119 bcf leftbind |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1120 STRCAT_PRINT "" |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1121 return |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1122 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1123 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
1124 |
681 | 1125 DISP_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field |
111 | 1126 WIN_TOP .25 |
1127 WIN_LEFT .90 | |
1128 WIN_FONT FT_SMALL | |
1129 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1130 call DISP_standard_color |
180 | 1131 GETCUSTOM8 d'32' ; GF_lo |
111 | 1132 movwf lo |
123 | 1133 |
446 | 1134 STRCPY TXT_GFLO6 |
111 | 1135 bsf leftbind |
1136 output_8 | |
123 | 1137 STRCAT_PRINT "%" |
111 | 1138 |
1139 WIN_TOP .50 | |
180 | 1140 GETCUSTOM8 d'33' ; GF_hi |
111 | 1141 movwf lo |
446 | 1142 STRCPY TXT_GFHI6 |
111 | 1143 bsf leftbind |
1144 output_8 | |
123 | 1145 STRCAT_PRINT "%" |
111 | 1146 |
681 | 1147 bra DISP_show_cf11_cf12_cf29_2 ; Display CF29 in the third row and RETURN |
1148 | |
1149 | |
1150 DISP_logbook_cursor: | |
1151 | |
1152 DISP_menu_cursor: | |
204 | 1153 WIN_BOX_BLACK .35, .239, .0, .16 ;top, bottom, left, right |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
1154 |
0 | 1155 WIN_LEFT .0 |
1156 WIN_FONT FT_SMALL | |
1157 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1158 call DISP_standard_color |
3 | 1159 |
0 | 1160 movff menupos,temp1 |
1161 dcfsnz temp1,F | |
1162 movlw d'35' | |
1163 dcfsnz temp1,F | |
1164 movlw d'65' | |
1165 dcfsnz temp1,F | |
1166 movlw d'95' | |
1167 dcfsnz temp1,F | |
1168 movlw d'125' | |
1169 dcfsnz temp1,F | |
1170 movlw d'155' | |
1171 dcfsnz temp1,F | |
1172 movlw d'185' | |
1173 | |
1174 movff WREG,win_top | |
123 | 1175 STRCPY_PRINT "\xB7" |
0 | 1176 return |
1177 | |
681 | 1178 DISP_menu_mask: |
717 | 1179 call DISP_divemask_color |
0 | 1180 DISPLAYTEXT .5 ; Menu: |
717 | 1181 call DISP_standard_color |
0 | 1182 DISPLAYTEXT .6 ; Logbook |
1183 DISPLAYTEXT .7 ; Gas Setup | |
1184 DISPLAYTEXT .9 ; Reset all | |
1185 DISPLAYTEXT .10 ; Setup... | |
1186 DISPLAYTEXT .142 ; More... | |
1187 DISPLAYTEXT .11 ; Exit | |
624 | 1188 |
1189 ; Write OSTC serial in Main Menu | |
1190 WIN_TOP .215 | |
1191 WIN_LEFT .47 | |
1192 GETCUSTOM8 d'64' ; Write header in blue when | |
681 | 1193 call DISP_set_color ; compiled in DEBUG mode... |
624 | 1194 lfsr FSR2,letter |
1195 OUTPUTTEXTH d'262' ; "OSTC " | |
1196 clrf EEADRH | |
1197 clrf EEADR ; Get Serial number LOW | |
1198 call read_eeprom ; read byte | |
1199 movff EEDATA,lo | |
1200 incf EEADR,F ; Get Serial number HIGH | |
1201 call read_eeprom ; read byte | |
1202 movff EEDATA,hi | |
1203 bsf leftbind | |
1204 output_16 | |
1205 call word_processor | |
681 | 1206 call DISP_standard_color |
0 | 1207 return |
1208 | |
681 | 1209 DISP_setup_menu_mask: |
717 | 1210 call DISP_divemask_color |
0 | 1211 DISPLAYTEXT .98 ; Setup Menu: |
717 | 1212 call DISP_standard_color |
0 | 1213 DISPLAYTEXT .99 ; Custom FunctionsI |
1214 DISPLAYTEXT .153 ; Custom FunctionsII | |
574 | 1215 DISPLAYTEXTH .295 ; Custom FunctionsIII |
0 | 1216 DISPLAYTEXT .100 ; Decotype: |
1217 DISPLAYTEXT .142 ; More... | |
1218 DISPLAYTEXT .11 ; Exit | |
1219 return | |
1220 | |
681 | 1221 DISP_ccr_setup_menu_mask: |
717 | 1222 call DISP_divemask_color |
639 | 1223 DISPLAYTEXT .111 ; CCR Setup Menu |
717 | 1224 call DISP_standard_color |
639 | 1225 DISPLAYTEXT .229 ; Diluent Setup |
1226 DISPLAYTEXT .230 ; Setpoint Setup | |
1227 DISPLAYTEXT .11 ; Exit | |
1228 return | |
1229 | |
1230 | |
681 | 1231 DISP_more_setup_menu_mask: |
717 | 1232 call DISP_divemask_color |
0 | 1233 DISPLAYTEXTH .258 ; Setup Menu 2: |
717 | 1234 call DISP_standard_color |
0 | 1235 DISPLAYTEXTH .257 ; Date format: |
1236 DISPLAYTEXT .129 ; Debug: | |
12 | 1237 DISPLAYTEXT .187 ; Show License |
574 | 1238 DISPLAYTEXTH .276 ; Salinity: |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
498
diff
changeset
|
1239 DISPLAYTEXTH .280 ; Brightness: |
0 | 1240 DISPLAYTEXT .11 ; Exit |
1241 return | |
1242 | |
681 | 1243 DISP_more_menu_mask: |
717 | 1244 call DISP_divemask_color |
0 | 1245 DISPLAYTEXT .144 ; Menu 2: |
717 | 1246 call DISP_standard_color |
0 | 1247 DISPLAYTEXT .8 ; Set Time |
747 | 1248 DISPLAYTEXT .110 ; CCR Setup Menu |
0 | 1249 DISPLAYTEXT .113 ; Battery Info |
1250 DISPLAYTEXT .247 ; Simulator | |
125 | 1251 DISPLAYTEXTH .287 ; Altimeter |
0 | 1252 DISPLAYTEXT .11 ; Exit |
1253 return | |
1254 | |
681 | 1255 DISP_reset_menu_mask: |
717 | 1256 call DISP_divemask_color |
0 | 1257 DISPLAYTEXT .28 ; Reset Menu |
717 | 1258 call DISP_standard_color |
0 | 1259 DISPLAYTEXT .21 ; Cancel Reset |
1260 DISPLAYTEXT .245 ; Reset CF,Gases & Deco | |
1261 DISPLAYTEXTH .284 ; Reset Logbook | |
1262 DISPLAYTEXTH .285 ; Reboot OSTC | |
1263 DISPLAYTEXTH .286 ; Reset Decodata | |
1264 DISPLAYTEXT .11 ; Exit | |
1265 return | |
1266 | |
681 | 1267 DISP_simulator_mask: |
717 | 1268 call DISP_divemask_color |
0 | 1269 DISPLAYTEXT .248 ; OSTC Simulator |
717 | 1270 call DISP_standard_color |
370 | 1271 DISPLAYTEXTH .307 ; Interval: |
369 | 1272 DISPLAYTEXT .249 ; Start Dive |
1273 DISPLAYTEXTH .277 ; Bottom Time: | |
1274 DISPLAYTEXTH .278 ; Max. Depth: | |
1275 DISPLAYTEXTH .279 ; Calculate Deco | |
1276 DISPLAYTEXT .11 ; Exit | |
0 | 1277 return |
1278 | |
681 | 1279 DISP_temp_surfmode: |
0 | 1280 ostc_debug 'e' |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1281 SAFE_2BYTE_COPY temperature, last_temperature |
0 | 1282 WIN_TOP .100 |
56 | 1283 WIN_LEFT .1 |
0 | 1284 WIN_FONT FT_SMALL |
340
ecbbbd423e86
BUGFIX save negativ temperatures in logbook (bbbug #6)
JeanDo
parents:
339
diff
changeset
|
1285 WIN_INVERT .0 ; Init new Wordprocessor |
681 | 1286 call DISP_standard_color |
3 | 1287 |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1288 movff last_temperature+1,hi |
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1289 movff last_temperature+0,lo |
0 | 1290 lfsr FSR2,letter |
681 | 1291 call DISP_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
0 | 1292 movlw d'3' |
1293 movwf ignore_digits | |
1294 bsf leftbind ; left orientated output | |
1295 output_16dp d'2' | |
1296 bcf leftbind | |
123 | 1297 STRCAT_PRINT "°C " |
0 | 1298 return |
1299 | |
681 | 1300 DISP_temp_divemode: |
0 | 1301 ostc_debug 'u' ; Sends debug-information to screen if debugmode active |
1302 | |
1303 ; temperature | |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1304 SAFE_2BYTE_COPY temperature, last_temperature |
0 | 1305 |
1306 WIN_TOP .216 | |
75 | 1307 WIN_LEFT .50 |
0 | 1308 WIN_FONT FT_SMALL |
1309 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1310 call DISP_standard_color |
3 | 1311 |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1312 movff last_temperature+1,hi |
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1313 movff last_temperature+0,lo |
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1314 |
0 | 1315 lfsr FSR2,letter |
681 | 1316 call DISP_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
0 | 1317 movlw d'3' |
1318 movwf ignore_digits | |
1319 bsf leftbind ; left orientated output | |
1320 output_16dp d'2' | |
1321 bcf leftbind | |
135
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
1322 STRCAT "° " |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
1323 clrf WREG ; Allow up to 5 chars to avoid |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
1324 movff WREG,letter+5 ; collision with sat graphs |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
1325 call word_processor |
0 | 1326 return |
1327 | |
681 | 1328 DISP_show_ppO2: ; Show ppO2 (ppO2 stored in xC) |
0 | 1329 ostc_debug 't' ; Sends debug-information to screen if debugmode active |
462 | 1330 WIN_TOP .117 |
0 | 1331 WIN_LEFT .0 |
1332 WIN_FONT FT_SMALL | |
681 | 1333 DISP_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
446 | 1334 STRCPY TXT_PPO2_5 |
74 | 1335 |
1336 ; Check very high ppO2 manually | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
1337 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
681 | 1338 bra DISP_show_ppO2_3 ; Yes, display fixed Value! |
74 | 1339 |
0 | 1340 movff xC+0,lo |
1341 movff xC+1,hi | |
1342 bsf ignore_digit4 | |
1343 output_16dp d'1' | |
1344 bcf ignore_digit4 | |
681 | 1345 DISP_show_ppO2_2: |
123 | 1346 STRCAT_PRINT " " |
681 | 1347 call DISP_standard_color |
0 | 1348 return |
1349 | |
681 | 1350 DISP_show_ppO2_3: |
123 | 1351 STRCAT ">6.6" |
681 | 1352 bra DISP_show_ppO2_2 |
1353 | |
1354 DISP_show_ppO2_clear: ; Clear ppO2 | |
0 | 1355 movlw d'10' |
1356 movwf temp1 | |
462 | 1357 WIN_TOP .117 |
0 | 1358 WIN_LEFT .0 |
681 | 1359 call DISP_display_clear_common_y1 |
0 | 1360 return |
1361 | |
681 | 1362 DISP_active_gas_clear: ; clears active gas! |
0 | 1363 WIN_TOP .192 |
75 | 1364 WIN_LEFT .50 |
0 | 1365 movlw d'5' |
1366 movwf temp1 | |
681 | 1367 bra DISP_display_clear_common_y1; also returns! |
1368 | |
1369 DISP_active_gas_divemode: ; Displays current gas (e.g. 40/20) if a) He>0 or b) O2>Custom9 | |
0 | 1370 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode |
1371 return | |
1372 | |
25 | 1373 WIN_INVERT .0 ; Init new Wordprocessor |
681 | 1374 call DISP_active_gas_divemode_show ; Show gas (Non-Inverted in all cases) |
25 | 1375 |
1376 btfss better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | |
1377 return ; Done. | |
1378 | |
1379 ; Check if Gas Output should blink when a better gas is available... | |
1380 GETCUSTOM8 d'42' ; =1 if gas should blink | |
1381 movwf lo | |
1382 movlw d'1' | |
1383 cpfseq lo ; =1? | |
1384 return ; No, Done. | |
1385 | |
1386 btg blinking_better_gas ; Toggle blink bit... | |
1387 btfss blinking_better_gas ; blink now? | |
1388 return ; No, Done. | |
403 | 1389 movlw color_yellow ; Blink in yellow |
681 | 1390 call DISP_set_color |
25 | 1391 WIN_INVERT .1 ; Init new Wordprocessor |
681 | 1392 call DISP_active_gas_divemode_show1 ; Show gas (Non-Inverted in all cases) |
25 | 1393 WIN_INVERT .0 ; Init new Wordprocessor |
681 | 1394 call DISP_standard_color |
25 | 1395 return ; Done. |
1396 | |
681 | 1397 DISP_active_gas_divemode_show: |
1398 call DISP_standard_color | |
1399 DISP_active_gas_divemode_show1: | |
0 | 1400 ostc_debug 's' ; Sends debug-information to screen if debugmode active |
1401 ; gas | |
1402 WIN_TOP .192 | |
75 | 1403 WIN_LEFT .50 |
0 | 1404 WIN_FONT FT_SMALL |
3 | 1405 |
0 | 1406 movlw d'100' ; 100% in the tank |
1407 movff char_I_N2_ratio,lo ; minus N2 | |
1408 bsf STATUS,C ; set borrow bit | |
1409 subfwb lo,W | |
1410 movff char_I_He_ratio,lo ; minus He | |
1411 bsf STATUS,C ; set borrow bit | |
1412 subfwb lo,F ; =% O2 | |
1413 GETCUSTOM8 d'9' ; get oxygen treshold | |
1414 movff char_I_He_ratio,hi ; He ratio | |
1415 cpfsgt lo | |
681 | 1416 bra DISP_active_gas_divemode2 ; Check He |
1417 bra DISP_active_gas_divemode3 ; Skip He check, display gas | |
0 | 1418 |
681 | 1419 DISP_active_gas_divemode2: |
0 | 1420 tstfsz hi ; He = 0 % |
681 | 1421 bra DISP_active_gas_divemode3 ; display gas |
1422 | |
1423 call DISP_warnings_color ; O2 below treshold, He=0 : Bad stuff ! | |
1424 bra DISP_active_gas_divemode4 | |
1425 | |
1426 DISP_active_gas_divemode3: | |
0 | 1427 movlw d'21' |
1428 cpfseq lo ; Air? (O2=21%) | |
681 | 1429 bra DISP_active_gas_divemode4 ; No! |
0 | 1430 tstfsz hi ; Air? (He=0%) |
681 | 1431 bra DISP_active_gas_divemode4 ; No! |
0 | 1432 |
1433 ; Yes, display "Air" instead of 21/0 | |
1434 lfsr FSR2,letter | |
136 | 1435 OUTPUTTEXTH d'264' ;"Air " |
143 | 1436 PUTC ' ' |
1437 clrf WREG ; Allow up to 5 chars to avoid | |
1438 movff WREG,letter+5 ; collision with sat graphs | |
1439 bcf leftbind | |
1440 call word_processor | |
681 | 1441 DISP_active_better_gas: |
152 | 1442 WIN_TOP .192 |
157 | 1443 WIN_LEFT .43 |
152 | 1444 WIN_FONT FT_SMALL |
1445 lfsr FSR2,letter | |
143 | 1446 movlw ' ' |
8 | 1447 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
1448 movlw '*' | |
1449 movwf POSTINC2 | |
0 | 1450 call word_processor |
25 | 1451 return |
0 | 1452 |
681 | 1453 DISP_active_gas_divemode4: |
0 | 1454 lfsr FSR2,letter |
1455 bsf leftbind ; left orientated output | |
1456 output_8 ; O2 ratio is still in "lo" | |
123 | 1457 PUTC '/' |
0 | 1458 movff char_I_He_ratio,lo ; copy He ratio into lo |
1459 output_8 | |
143 | 1460 PUTC ' ' |
1461 clrf WREG ; Allow up to 5 chars to avoid | |
1462 movff WREG,letter+5 ; collision with sat graphs | |
1463 bcf leftbind | |
1464 call word_processor | |
681 | 1465 rcall DISP_active_better_gas ; show *, if required |
1466 call DISP_standard_color ; Back to normal (if O2<21 and He=0) | |
143 | 1467 return |
1468 | |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1469 ;----------------------------------------------------------------------------- |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1470 ; Set color to grey when gas is inactive |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1471 ; Inputs: WREG : gas# (0..4) |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1472 ; Trashes: lo |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1473 ; New v1.44se |
681 | 1474 DISP_grey_inactive_gas: |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1475 movwf lo ; copy gas number 0-4 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1476 incf lo,F ; 1-5 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1477 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1478 read_int_eeprom d'33' ; Get First gas (1-5) |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1479 movf EEDATA,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1480 subwf lo,W ; Compare with current |
681 | 1481 bz DISP_white_gas ; First is always on. |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1482 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1483 movlw .28-1 ; Depth for gas# is at idx+28 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1484 addwf lo,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1485 movwf EEADR ; address in EEPROM. |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1486 call read_eeprom ; Read depth |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1487 clrf WREG |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1488 cpfsgt EEDATA ; is depth > 0 ? |
681 | 1489 bra DISP_grey_gas |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1490 |
287 | 1491 clrf EEADRH ; Lower page of EEPROM. |
1492 read_int_eeprom d'27' ; read flag register | |
681 | 1493 DISP_grey_inactive_gas1: |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1494 rrcf EEDATA ; roll flags into carry |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1495 decfsz lo,F ; max. 5 times... |
681 | 1496 bra DISP_grey_inactive_gas1 |
1497 bnc DISP_grey_gas ; test carry | |
1498 | |
1499 DISP_white_gas: | |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1500 GETCUSTOM8 d'35' ;movlw color_white |
681 | 1501 goto DISP_set_color ; grey out inactive gases! |
665
259e4c1bf3c2
grey-out TTS and ceiling after gas change (until new plan is ready)
heinrichsweikamp
parents:
657
diff
changeset
|
1502 ; return |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1503 |
681 | 1504 DISP_grey_gas: |
1505 DISP_grey: | |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
1506 GETCUSTOM8 d'64' ;movlw color_grey |
681 | 1507 goto DISP_set_color ; grey out inactive gases! |
665
259e4c1bf3c2
grey-out TTS and ceiling after gas change (until new plan is ready)
heinrichsweikamp
parents:
657
diff
changeset
|
1508 ; return |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1509 |
758
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1510 DISP_bailoutgas: ; Show the first bailout gas |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1511 WIN_TOP .25 |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1512 WIN_LEFT .90 |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1513 WIN_FONT FT_SMALL |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1514 WIN_INVERT .0 ; Init new Wordprocessor |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1515 call DISP_standard_color |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1516 lfsr FSR2,letter |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1517 OUTPUTTEXT .137 ; Bailout |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1518 call word_processor |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1519 WIN_TOP .50 |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1520 WIN_LEFT .90 |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1521 read_int_eeprom d'33' ; Read start gas (1-5) |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1522 movff EEDATA,hi ; Store start gas |
758
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1523 bsf leftbind |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1524 lfsr FSR2,letter |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1525 STRCPY TXT_GAS1 |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1526 movff hi,lo ; copy gas number |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1527 output_8 ; display gas number |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1528 STRCAT ": " |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1529 movlw .4 |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1530 mulwf hi ; 1-5 |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1531 movf PRODL,W |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1532 addlw .2 ; Gas #x: %O2 - Set address in internal EEPROM |
758
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1533 movwf EEADR |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1534 call read_eeprom ; get byte (stored in EEDATA) |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1535 movff EEDATA,lo ; copy to lo |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1536 output_8 ; outputs into Postinc2! |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1537 PUTC '/' |
771 | 1538 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
758
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1539 call read_eeprom ; get byte (stored in EEDATA) |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1540 movff EEDATA,lo ; copy to lo |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1541 output_8 ; outputs into Postinc2! |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1542 bcf leftbind |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1543 call word_processor |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1544 return |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1545 |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1546 DISP_bailoutlist: ; Show the bailout list: |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1547 bra DISP_pre_dive_screen2 |
3096294bb06e
Show the bailout list in surfacemode (CC Modes)
heinrichsweikamp
parents:
756
diff
changeset
|
1548 |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1549 ;----------------------------------------------------------------------------- |
123 | 1550 ; Display Pre-Dive Screen |
1551 | |
681 | 1552 DISP_pre_dive_screen: |
13 | 1553 ; List active gases/Setpoints |
1554 | |
1555 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
681 | 1556 bra DISP_pre_dive_screen3 ; Yes, display SetPoint/Sensor result list |
1557 | |
1558 DISP_pre_dive_screen2: | |
13 | 1559 ostc_debug 'm' ; Sends debug-information to screen if debugmode active |
1560 | |
1561 WIN_LEFT .90 | |
1562 WIN_FONT FT_SMALL | |
1563 bsf leftbind | |
1564 movlw d'2' | |
1565 movwf wait_temp ; here: stores eeprom address for gas list | |
1566 movlw d'0' | |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1567 movwf waitms_temp ; here: stores row for gas list |
13 | 1568 clrf hi ; here: Gas counter |
1569 | |
681 | 1570 DISP_pre_dive_screen2_loop: |
13 | 1571 incf hi,F ; Increase Gas |
1572 movlw d'4' | |
1573 addwf wait_temp,F ; Increase eeprom address for gas list | |
1574 | |
446 | 1575 STRCPY TXT_GAS1 |
13 | 1576 movff hi,lo ; copy gas number |
1577 output_8 ; display gas number | |
123 | 1578 STRCAT ": " |
13 | 1579 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
1580 call read_eeprom ; get byte (stored in EEDATA) | |
1581 movff EEDATA,lo ; copy to lo | |
1582 output_8 ; outputs into Postinc2! | |
123 | 1583 PUTC '/' |
13 | 1584 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
1585 call read_eeprom ; get byte (stored in EEDATA) | |
1586 movff EEDATA,lo ; copy to lo | |
1587 output_8 ; outputs into Postinc2! | |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1588 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1589 decf hi,W ; Gas # in 0..4 |
681 | 1590 call DISP_grey_inactive_gas |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1591 |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1592 read_int_eeprom d'33' ; Read start gas (1-5) |
13 | 1593 movf EEDATA,W |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1594 cpfseq hi ; Current Gas the start gas? |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1595 bra DISP_pre_dive_screen2a ; Yes |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1596 bra DISP_pre_dive_screen2b ; No |
681 | 1597 |
1598 DISP_pre_dive_screen2a: | |
13 | 1599 movlw d'25' |
1600 addwf waitms_temp,F ; Increase row | |
1601 WIN_LEFT .90 | |
1602 movff waitms_temp,win_top ; Set Row | |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1603 call word_processor ; Display gas |
13 | 1604 |
681 | 1605 DISP_pre_dive_screen2b: |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1606 movlw d'5' ; list all four (remaining) gases |
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1607 cpfseq hi ; All gases shown? |
681 | 1608 bra DISP_pre_dive_screen2_loop ; No |
13 | 1609 |
765
aac1379d6983
BUGFIX: Show bailout list if first bailout gas <> gas
heinrichsweikamp
parents:
762
diff
changeset
|
1610 return ; No, return (OC mode) |
13 | 1611 |
681 | 1612 DISP_pre_dive_screen3: |
13 | 1613 WIN_LEFT .90 |
1614 WIN_FONT FT_SMALL | |
1615 bsf leftbind | |
681 | 1616 call DISP_standard_color |
13 | 1617 |
1618 ; list three SP in Gaslist | |
1619 movlw d'35' ; 36 = current SP position in EEPROM | |
1620 movwf wait_temp ; here: stores eeprom address for gas list | |
1621 movlw d'0' | |
1622 movwf waitms_temp ; here: stores row for gas list | |
164 | 1623 clrf apnoe_mins ; here: SP counter |
13 | 1624 |
681 | 1625 DISP_pre_dive_screen3_loop: |
13 | 1626 incf wait_temp,F ; EEPROM address |
164 | 1627 incf apnoe_mins,F ; Increase SP |
13 | 1628 |
1629 movlw d'25' | |
1630 addwf waitms_temp,F ; Increase row | |
1631 WIN_LEFT .90 | |
1632 movff waitms_temp,win_top ; Set Row | |
1633 | |
446 | 1634 STRCPY TXT_SP2 |
164 | 1635 movff apnoe_mins,lo ; copy gas number |
1636 output_8 ; display gas number | |
123 | 1637 STRCAT ": " |
164 | 1638 movff wait_temp, EEADR ; SP #hi position |
1639 call read_eeprom ; get byte (stored in EEDATA) | |
1640 movff EEDATA,lo ; copy to lo | |
13 | 1641 clrf hi |
164 | 1642 output_16dp d'3' ; outputs into Postinc2! |
13 | 1643 call word_processor |
1644 | |
164 | 1645 movlw d'3' ; list all three SP |
1646 cpfseq apnoe_mins ; All gases shown? | |
681 | 1647 bra DISP_pre_dive_screen3_loop ;no |
13 | 1648 |
655
8c01edcf57fc
Allow any diluent to be "First gas" in CCR modes
heinrichsweikamp
parents:
654
diff
changeset
|
1649 |
8c01edcf57fc
Allow any diluent to be "First gas" in CCR modes
heinrichsweikamp
parents:
654
diff
changeset
|
1650 call get_first_diluent ; Read first diluent into lo(O2) and hi(He) |
19 | 1651 WIN_LEFT .90 |
1652 WIN_TOP .100 | |
446 | 1653 STRCPY TXT_DIL4 |
19 | 1654 output_8 ; O2 Ratio |
123 | 1655 PUTC '/' |
19 | 1656 movff hi,lo |
1657 output_8 ; He Ratio | |
1658 call word_processor | |
1659 | |
13 | 1660 bcf leftbind |
1661 return ; Return (CC Mode) | |
1662 | |
681 | 1663 DISP_active_gas_surfmode: ; Displays start gas/SP 1 |
0 | 1664 ostc_debug 'q' ; Sends debug-information to screen if debugmode active |
1665 | |
1666 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
1667 return ; Yes, return | |
1668 | |
1669 btfsc gauge_mode ; In Gauge mode? | |
1670 return ; Yes, return | |
1671 | |
1672 btfss FLAG_const_ppO2_mode ; are we in const. ppO2 mode? | |
681 | 1673 bra DISP_active_gas_surfmode2 ; No, display gases |
0 | 1674 |
1675 ; In CC Mode | |
1676 WIN_TOP .135 | |
1677 WIN_LEFT .90 | |
1678 WIN_FONT FT_SMALL | |
1679 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1680 call DISP_standard_color |
3 | 1681 |
772
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1682 lfsr FSR2,letter |
0 | 1683 read_int_eeprom d'36' |
1684 movff EEDATA,lo ; copy to lo | |
1685 clrf hi | |
1686 output_16dp d'3' ; outputs into Postinc2! | |
772
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1687 STRCAT_PRINT TXT_BAR3 |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1688 |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1689 bsf leftbind |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1690 call get_first_diluent ; Read first diluent into lo(O2) and hi(He) |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1691 WIN_TOP .160 |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1692 WIN_LEFT .104 |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1693 lfsr FSR2,letter |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1694 output_8 ; O2 Ratio |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1695 PUTC '/' |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1696 movff hi,lo |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1697 output_8 ; He Ratio |
5d6da9ddde27
NEW: Show First Diluent (CCR Mode) permantely in surface mode
heinrichsweikamp
parents:
771
diff
changeset
|
1698 STRCAT_PRINT "" |
0 | 1699 bcf leftbind |
607 | 1700 return ; Done. |
0 | 1701 |
681 | 1702 DISP_active_gas_surfmode2: |
692 | 1703 clrf EEADRH ; Select EEPROM lower page. |
1704 read_int_eeprom d'33' ; Get First gas (1-5) | |
1705 movff EEDATA,hi ; into register hi | |
1706 | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1707 WIN_TOP .175 |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1708 WIN_FONT FT_SMALL |
692 | 1709 WIN_INVERT .0 ; Init new Wordprocessor |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1710 movlw .0 |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1711 call DISP_grey_inactive_gas ; Sets Greyvalue for inactive gases |
690 | 1712 WIN_LEFT .115 |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1713 STRCPY_PRINT "1" |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1714 movlw .1 |
692 | 1715 cpfseq hi ; Is "first gas"? |
1716 bra DISP_active_gas_surfmode3 ; No, skip box | |
1717 WIN_FRAME_STD .174, .196, .114, .122 ;top, bottom, left, right | |
1718 DISP_active_gas_surfmode3: | |
1719 movlw .1 | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1720 call DISP_grey_inactive_gas ; Sets Greyvalue for inactive gases |
690 | 1721 WIN_LEFT .124 |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1722 STRCPY_PRINT "2" |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1723 movlw .2 |
692 | 1724 cpfseq hi ; Is "first gas"? |
1725 bra DISP_active_gas_surfmode4 ; No, skip box | |
1726 WIN_FRAME_STD .174, .196, .123, .131 ;top, bottom, left, right | |
1727 DISP_active_gas_surfmode4: | |
1728 movlw .2 | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1729 call DISP_grey_inactive_gas ; Sets Greyvalue for inactive gases |
690 | 1730 WIN_LEFT .133 |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1731 STRCPY_PRINT "3" |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1732 movlw .3 |
692 | 1733 cpfseq hi ; Is "first gas"? |
1734 bra DISP_active_gas_surfmode5 ; No, skip box | |
1735 WIN_FRAME_STD .174, .196, .132, .140 ;top, bottom, left, right | |
1736 DISP_active_gas_surfmode5: | |
1737 movlw .3 | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1738 call DISP_grey_inactive_gas ; Sets Greyvalue for inactive gases |
690 | 1739 WIN_LEFT .142 |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1740 STRCPY_PRINT "4" |
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1741 movlw .4 |
692 | 1742 cpfseq hi ; Is "first gas"? |
1743 bra DISP_active_gas_surfmode6 ; No, skip box | |
1744 WIN_FRAME_STD .174, .196, .141, .149 ;top, bottom, left, right | |
1745 DISP_active_gas_surfmode6: | |
1746 movlw .4 | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1747 call DISP_grey_inactive_gas ; Sets Greyvalue for inactive gases |
690 | 1748 WIN_LEFT .151 |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1749 STRCPY_PRINT "5" |
692 | 1750 movlw .5 |
1751 cpfseq hi ; Is "first gas"? | |
1752 bra DISP_active_gas_surfmode7 ; No, skip box | |
1753 WIN_FRAME_STD .174, .196, .150, .158 ;top, bottom, left, right | |
1754 DISP_active_gas_surfmode7: | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
1755 |
0 | 1756 WIN_TOP .130 |
1757 WIN_LEFT .100 | |
1758 WIN_FONT FT_MEDIUM | |
681 | 1759 call DISP_standard_color |
3 | 1760 |
0 | 1761 read_int_eeprom d'33' ; Read byte (stored in EEDATA) |
1762 movff EEDATA,active_gas ; Read start gas (1-5) | |
1763 | |
1764 decf active_gas,W ; Gas 0-4 | |
1765 mullw d'4' | |
1766 movf PRODL,W | |
1767 addlw d'7' ; = address for He ratio | |
1768 movwf EEADR | |
1769 call read_eeprom ; Read He ratio | |
1770 movff EEDATA,char_I_He_ratio ; And copy into hold register | |
1771 | |
1772 decf active_gas,W ; Gas 0-4 | |
1773 mullw d'4' | |
1774 movf PRODL,W | |
1775 addlw d'6' ; = address for O2 ratio | |
1776 movwf EEADR | |
1777 call read_eeprom ; Read O2 ratio | |
1778 movff EEDATA, char_I_O2_ratio ; O2 ratio | |
1779 movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
1780 bsf STATUS,C ; Borrow bit | |
1781 movlw d'100' ; 100% | |
1782 subfwb wait_temp,W ; minus He | |
1783 bsf STATUS,C ; Borrow bit | |
1784 subfwb EEDATA,F ; minus O2 | |
1785 movff EEDATA, char_I_N2_ratio ; = N2! | |
1786 | |
1787 movlw d'100' ; 100% in the tank | |
1788 movff char_I_N2_ratio,lo ; minus N2 | |
1789 bsf STATUS,C ; set borrow bit | |
1790 subfwb lo,W | |
1791 movff char_I_He_ratio,lo ; minus He | |
1792 bsf STATUS,C ; set borrow bit | |
1793 subfwb lo,F ; =% O2 | |
1794 | |
1795 movff char_I_He_ratio,hi ; Copy into Bank1 register | |
1796 | |
1797 movlw d'21' | |
607 | 1798 cpfseq lo ; Air? (O2=21%) |
692 | 1799 bra DISP_active_gas_surfmode8 ; No! |
0 | 1800 tstfsz hi ; Air? (He=0%) |
692 | 1801 bra DISP_active_gas_surfmode8 ; No! |
0 | 1802 |
1803 ; Yes, display "Air" instead of 21/0 | |
1804 DISPLAYTEXTH d'265' ;"Air ", y-scale=2 | |
607 | 1805 return ; Done. |
0 | 1806 |
692 | 1807 DISP_active_gas_surfmode8: |
0 | 1808 lfsr FSR2,letter |
1809 bsf leftbind ; left orientated output | |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
77
diff
changeset
|
1810 output_99 ; O2 ratio is still in "lo" |
607 | 1811 movff char_I_He_ratio,lo ; copy He ratio into lo |
1812 tstfsz lo ; He>0? | |
692 | 1813 bra DISP_active_gas_surfmode9 ; Yes. |
1814 bra DISP_active_gas_surfmode10 ; No, skip He | |
1815 DISP_active_gas_surfmode9: | |
123 | 1816 PUTC '/' |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
77
diff
changeset
|
1817 output_99 |
692 | 1818 DISP_active_gas_surfmode10: |
0 | 1819 bcf leftbind |
1820 call word_processor | |
607 | 1821 |
681 | 1822 rcall DISP_mainscreen_show_nx |
607 | 1823 tstfsz lo ; He>0? |
681 | 1824 rcall DISP_mainscreen_show_tx ; Yes |
607 | 1825 return ; Done. |
1826 | |
681 | 1827 DISP_mainscreen_show_tx: |
607 | 1828 WIN_LEFT .85 |
1829 WIN_FONT FT_SMALL | |
1830 WIN_INVERT .0 ; Init new Wordprocessor | |
1831 WIN_TOP .127 | |
1832 | |
1833 STRCPY_PRINT TXT_TX1 | |
1834 WIN_TOP .148 | |
1835 STRCPY_PRINT TXT_TX2 | |
0 | 1836 return |
681 | 1837 DISP_mainscreen_show_nx: |
607 | 1838 WIN_LEFT .85 |
1839 WIN_TOP .127 | |
1840 WIN_FONT FT_SMALL | |
1841 WIN_INVERT .0 ; Init new Wordprocessor | |
1842 | |
1843 STRCPY_PRINT TXT_NX1 | |
1844 WIN_TOP .148 | |
1845 STRCPY_PRINT TXT_NX2 | |
1846 return | |
1847 | |
0 | 1848 |
681 | 1849 DISP_confirmbox: |
204 | 1850 WIN_BOX_BLACK .68, .146, .34, .101 ;top, bottom, left, right |
123 | 1851 WIN_FRAME_STD .70, .144, .35, .100 |
1852 | |
717 | 1853 call DISP_divemask_color |
0 | 1854 DISPLAYTEXT .143 ; Confirm: |
717 | 1855 call DISP_standard_color |
0 | 1856 DISPLAYTEXT .145 ; Cancel |
1857 DISPLAYTEXT .146 ; OK! | |
1858 | |
1859 movlw d'1' | |
1860 movwf menupos | |
1861 | |
681 | 1862 DISP_confirmbox2: |
204 | 1863 WIN_BOX_BLACK .96, .143, .39, .51 ;top, bottom, left, right |
0 | 1864 |
1865 movff menupos,temp1 | |
1866 movlw d'96' | |
1867 dcfsnz temp1,F | |
1868 movlw d'96' | |
1869 dcfsnz temp1,F | |
1870 movlw d'120' | |
1871 movff WREG,win_top | |
1872 WIN_LEFT .39 | |
1873 WIN_FONT FT_SMALL | |
1874 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1875 call DISP_standard_color |
3 | 1876 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
1877 STRCPY_PRINT "\xB7" ; Cursor |
0 | 1878 |
1879 bcf sleepmode ; clear some flags | |
1880 bcf menubit2 | |
1881 bcf menubit3 | |
1882 bcf switch_right | |
1883 bcf switch_left | |
1884 clrf timeout_counter2 | |
1885 WAITMS d'100' | |
1886 | |
681 | 1887 DISP_confirmbox_loop: |
0 | 1888 call check_switches_logbook |
1889 | |
1890 btfsc menubit3 ; SET/MENU? | |
681 | 1891 bra DISP_confirmbox_move_cursor; Move Cursor |
0 | 1892 btfsc menubit2 ; ENTER? |
681 | 1893 bra DISP_confirmbox_menu_do ; Do task |
0 | 1894 |
1895 btfsc onesecupdate | |
1896 call timeout_surfmode ; timeout | |
1897 | |
1898 btfsc onesecupdate | |
1899 call set_dive_modes ; check, if divemode must be entered | |
1900 bcf onesecupdate ; one second update | |
1901 | |
1902 btfsc sleepmode ; Timeout? | |
681 | 1903 bra DISP_confirmbox_cancel ; back with cancel |
0 | 1904 btfsc divemode |
681 | 1905 bra DISP_confirmbox_cancel ; back with cancel |
1906 | |
1907 bra DISP_confirmbox_loop ; wait for something to do | |
1908 | |
1909 DISP_confirmbox_cancel: | |
0 | 1910 retlw .0 |
681 | 1911 DISP_confirmbox_ok: |
0 | 1912 retlw .1 |
1913 | |
681 | 1914 DISP_confirmbox_menu_do: |
0 | 1915 dcfsnz menupos,F |
681 | 1916 bra DISP_confirmbox_cancel |
0 | 1917 dcfsnz menupos,F |
681 | 1918 bra DISP_confirmbox_ok |
1919 bra DISP_confirmbox_cancel | |
1920 | |
1921 DISP_confirmbox_move_cursor: | |
0 | 1922 incf menupos,F |
1923 movlw d'3' ; number of menu options+1 | |
1924 cpfseq menupos ; =limit? | |
681 | 1925 bra DISP_confirmbox_move_cursor2 ; No! |
0 | 1926 movlw d'1' ; Yes, reset to position 1! |
1927 movwf menupos | |
681 | 1928 DISP_confirmbox_move_cursor2: |
1929 bra DISP_confirmbox2 ; Return to Profile Menu, also updates cursor | |
1930 | |
1931 | |
1932 DISP_depth: | |
529 | 1933 ; ostc_debug 'r' ; Sends debug-information to screen if debugmode active |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1934 SAFE_2BYTE_COPY rel_pressure, lo |
517 | 1935 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
0 | 1936 |
1937 movlw .039 | |
1938 cpfslt hi | |
517 | 1939 bra depth_greater_99_84mtr |
1940 | |
1941 btfsc depth_greater_100m ; Was depth>100m during last call | |
681 | 1942 call DISP_clear_depth ; Yes, clear depth area |
517 | 1943 bcf depth_greater_100m ; Do this once only... |
0 | 1944 |
1945 lfsr FSR2,letter | |
1946 | |
1947 movlw HIGH d'1000' | |
1948 movwf sub_a+1 | |
1949 movlw LOW d'1000' | |
1950 movwf sub_a+0 | |
1951 movff hi,sub_b+1 | |
1952 movff lo,sub_b+0 | |
1953 incf sub_b+0,F | |
1954 movlw d'0' | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
1955 addwfc sub_b+1,F ; Add 1mbar offset |
0 | 1956 call sub16 ; sub_c = sub_a - sub_b |
517 | 1957 btfss neg_flag ; Depth lower then 10m? |
1958 rcall depth_less_10mtr ; Yes, add extra space | |
0 | 1959 |
1960 WIN_TOP .24 | |
1961 WIN_LEFT .0 | |
1962 WIN_FONT FT_LARGE | |
1963 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 1964 DISP_color_code warn_depth ; Color-code the output |
0 | 1965 |
1966 movlw HIGH d'99' | |
1967 movwf sub_a+1 | |
1968 movlw LOW d'99' | |
1969 movwf sub_a+0 | |
1970 movff hi,sub_b+1 | |
1971 movff lo,sub_b+0 | |
1972 call sub16 ; sub_c = sub_a - sub_b | |
517 | 1973 btfss neg_flag ; Depth lower then 1m? |
681 | 1974 bra DISP_depth2 ; Yes, display manual Zero |
0 | 1975 |
1976 bsf leftbind | |
1977 bsf ignore_digit4 | |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
1978 output_16 ; Full meters in Big font |
0 | 1979 bcf leftbind |
681 | 1980 bra DISP_depth3 |
1981 | |
1982 DISP_depth2: | |
123 | 1983 PUTC '0' |
1984 | |
681 | 1985 DISP_depth3: |
0 | 1986 call word_processor |
1987 bcf ignore_digit4 | |
1988 | |
1989 WIN_FONT FT_MEDIUM | |
1990 WIN_TOP .50 | |
1991 WIN_LEFT .40 | |
681 | 1992 DISP_color_code warn_depth ; Color-code the output |
0 | 1993 |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
1994 SAFE_2BYTE_COPY rel_pressure, lo |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
1995 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
123 | 1996 |
1997 STRCPY "." | |
0 | 1998 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
1999 movlw HIGH d'20' ; Display 0.0m if lower then 20cm |
0 | 2000 movwf sub_a+1 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2001 movlw LOW d'20' |
0 | 2002 movwf sub_a+0 |
2003 movff hi,sub_b+1 | |
2004 movff lo,sub_b+0 | |
2005 call sub16 ; sub_c = sub_a - sub_b | |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2006 btfss neg_flag ; Depth lower then 0.3m? |
681 | 2007 bra DISP_depth4 ; Yes, display manual Zero |
0 | 2008 |
2009 movlw d'4' | |
2010 movwf ignore_digits | |
2011 bsf ignore_digit5 | |
2012 output_16dp d'0' | |
681 | 2013 bra DISP_depth5 |
2014 | |
2015 DISP_depth4: | |
123 | 2016 PUTC '0' |
0 | 2017 |
681 | 2018 DISP_depth5: |
0 | 2019 call word_processor ; decimeters in medium font |
2020 bcf ignore_digit5 | |
2021 WIN_FONT FT_SMALL | |
2022 return | |
2023 | |
517 | 2024 depth_greater_99_84mtr: ; Display only in full meters |
2025 btfss depth_greater_100m ; Is depth>100m already? | |
681 | 2026 call DISP_clear_depth ; No, clear depth area and set flag |
0 | 2027 ; Depth is already in hi:lo |
517 | 2028 ; Show depth in Full meters |
0 | 2029 ; That means ignore figure 4 and 5 |
2030 lfsr FSR2,letter | |
2031 WIN_TOP .24 | |
2032 WIN_LEFT .0 | |
2033 WIN_FONT FT_LARGE | |
2034 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 2035 DISP_color_code warn_depth ; Color-code the output |
3 | 2036 |
0 | 2037 bsf ignore_digit4 |
2038 bsf leftbind | |
2039 output_16 | |
2040 bcf leftbind | |
2041 call word_processor | |
2042 bcf ignore_digit4 | |
2043 WIN_FONT FT_SMALL | |
2044 return | |
2045 | |
517 | 2046 depth_less_10mtr: |
123 | 2047 PUTC ' ' |
0 | 2048 return |
2049 | |
681 | 2050 DISP_clear_depth ; No, clear depth area and set flag |
204 | 2051 WIN_BOX_BLACK .24, .90, .0, .90 ;top, bottom, left, right |
517 | 2052 bsf depth_greater_100m ; Set Flag |
0 | 2053 return |
2054 | |
681 | 2055 DISP_desaturation_time: |
140 | 2056 movff int_O_desaturation_time+0,lo |
2057 movff int_O_desaturation_time+1,hi ; Copy | |
2058 tstfsz lo ; =0? | |
681 | 2059 bra DISP_desaturation_time2 ; No! |
140 | 2060 tstfsz hi ; =0? |
681 | 2061 bra DISP_desaturation_time2 ; No! |
140 | 2062 return ; Do not display Desat |
2063 | |
681 | 2064 DISP_desaturation_time2: |
0 | 2065 ostc_debug 'h' |
2066 WIN_TOP .150 | |
56 | 2067 WIN_LEFT .1 |
0 | 2068 WIN_FONT FT_SMALL |
2069 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 2070 call DISP_standard_color |
3 | 2071 |
0 | 2072 lfsr FSR2,letter |
2073 OUTPUTTEXT d'14' ; Desat | |
123 | 2074 PUTC ' ' |
255
1efd59d689f8
small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents:
254
diff
changeset
|
2075 movff desaturation_time_buffer+0,lo ; divide by 60... |
1efd59d689f8
small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents:
254
diff
changeset
|
2076 movff desaturation_time_buffer+1,hi |
254 | 2077 |
0 | 2078 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) |
2079 bsf leftbind | |
2080 movf lo,W | |
2081 movff hi,lo | |
2082 movwf hi ; exchange lo and hi... | |
2083 output_8 ; Hours | |
123 | 2084 PUTC ':' |
402 | 2085 movff hi,lo ; Minutes |
0 | 2086 output_99x |
2087 bcf leftbind | |
402 | 2088 PUTC ' ' |
2089 ; clrf WREG ; Allow up to 5 chars to avoid | |
2090 ; movff WREG,letter+6 ; collision with decotype letters | |
0 | 2091 call word_processor |
2092 return | |
2093 | |
681 | 2094 DISP_nofly_time: |
249 | 2095 movf nofly_time+0,W ; Is nofly null ? |
2096 iorwf nofly_time+1,W | |
681 | 2097 bnz DISP_nofly_time2 ; No... |
140 | 2098 return |
249 | 2099 |
681 | 2100 DISP_nofly_time2: |
0 | 2101 ostc_debug 'g' |
2102 WIN_TOP .125 | |
56 | 2103 WIN_LEFT .1 |
0 | 2104 WIN_FONT FT_SMALL |
2105 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 2106 call DISP_standard_color |
3 | 2107 |
0 | 2108 lfsr FSR2,letter |
2109 OUTPUTTEXT d'35' ; NoFly | |
123 | 2110 PUTC ' ' |
0 | 2111 movff nofly_time+0,lo ; divide by 60... |
2112 movff nofly_time+1,hi | |
249 | 2113 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) |
0 | 2114 bsf leftbind |
2115 movf lo,W | |
2116 movff hi,lo | |
519 | 2117 movwf hi ; exchange lo and hi... |
2118 output_8 ; Hours | |
123 | 2119 PUTC ':' |
0 | 2120 movff hi,lo ; Minutes |
2121 output_99x | |
2122 bcf leftbind | |
402 | 2123 PUTC ' ' |
2124 ; clrf WREG ; Allow up to 5 chars to avoid | |
2125 ; movff WREG,letter+6 ; collision with decotype letters | |
0 | 2126 call word_processor |
2127 return | |
2128 | |
2129 | |
2130 update_surf_press: | |
2131 btfsc premenu ; Do not update when "Menu?" is displayed! | |
2132 return | |
2133 | |
2134 ostc_debug 'b' ; Sends debug-information to screen if debugmode active | |
2135 WIN_TOP .25 | |
56 | 2136 WIN_LEFT .1 |
0 | 2137 WIN_FONT FT_SMALL |
2138 WIN_INVERT .0 ; Init new Wordprocessor | |
239 | 2139 |
410
c6f9eb123b85
remove of red ambient pressure (High altitude mode)
heinrichsweikamp
parents:
408
diff
changeset
|
2140 ; btfss high_altitude_mode ; In high altitude mode? |
681 | 2141 call DISP_standard_color ; No |
410
c6f9eb123b85
remove of red ambient pressure (High altitude mode)
heinrichsweikamp
parents:
408
diff
changeset
|
2142 ; btfsc high_altitude_mode ; In high altitude mode? |
681 | 2143 ; call DISP_warnings_color ; Yes, display ambient pressure in red |
239 | 2144 |
401
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2145 SAFE_2BYTE_COPY amb_pressure, lo |
0 | 2146 lfsr FSR2,letter |
401
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2147 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2148 movff lo,sub_a+0 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2149 movff hi,sub_a+1 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2150 movff last_surfpressure_30min+0,sub_b+0 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2151 movff last_surfpressure_30min+1,sub_b+1 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2152 call sub16 ; sub_c = sub_a - sub_b |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2153 btfsc neg_flag ; Pressure lower? |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2154 rcall update_surf_press2 ; Yes, test threshold |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2155 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2156 tstfsz sub_c+1 ; >255mbar difference? |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2157 bra update_surf_press_common; Yes, display! |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2158 movlw d'5' |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2159 subwf sub_c+0,W |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2160 btfsc STATUS,C |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2161 bra update_surf_press_common; Yes, display! |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2162 ; PUTC '+' ; For debug only |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2163 SAFE_2BYTE_COPY last_surfpressure_30min, lo ; Overwrite with stable value... |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2164 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2165 update_surf_press_common: |
0 | 2166 bsf leftbind |
2167 output_16 | |
2168 bcf leftbind | |
446 | 2169 STRCAT_PRINT TXT_MBAR5 |
681 | 2170 call DISP_standard_color ; Reset color |
0 | 2171 return |
2172 | |
401
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2173 update_surf_press2: |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2174 movff lo,sub_b+0 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2175 movff hi,sub_b+1 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2176 movff last_surfpressure_30min+0,sub_a+0 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2177 movff last_surfpressure_30min+1,sub_a+1 |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2178 call sub16 ; sub_c = sub_a - sub_b |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2179 ; PUTC '-' ; For debug only |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2180 return |
6ed12fad3b97
Ignore 5mbar pressure sensor noise in surface screen
heinrichsweikamp
parents:
400
diff
changeset
|
2181 |
0 | 2182 update_batt_voltage_divemode: |
681 | 2183 call DISP_warnings_color |
141 | 2184 DISPLAYTEXT d'246' ; LowBatt! |
681 | 2185 call DISP_standard_color |
141 | 2186 return |
0 | 2187 |
2188 update_batt_voltage: | |
2189 ostc_debug 'f' | |
2190 | |
2191 GETCUSTOM8 d'31' ; =1 if battery voltage should be visible | |
2192 movwf lo | |
2193 movlw d'1' | |
2194 cpfseq lo ; =1? | |
2195 bra update_batt_voltage2 ; No, show symbol | |
2196 | |
2197 WIN_TOP .175 | |
56 | 2198 WIN_LEFT .1 |
0 | 2199 WIN_FONT FT_SMALL |
2200 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 2201 call DISP_standard_color |
3 | 2202 |
0 | 2203 lfsr FSR2,letter |
2204 movff batt_voltage+0,lo | |
2205 movff batt_voltage+1,hi | |
2206 movlw d'1' | |
2207 movwf ignore_digits | |
2208 bsf ignore_digit5 ; do not display mV | |
2209 bsf leftbind | |
2210 output_16dp d'2' ; e.g. 3.45V | |
2211 bcf leftbind | |
446 | 2212 STRCAT_PRINT TXT_VOLT2 |
0 | 2213 return |
2214 | |
2215 update_batt_voltage2: | |
123 | 2216 WIN_FRAME_STD .174, .194, .1, .32 |
0 | 2217 |
25 | 2218 ; 4100-Vbatt |
2219 movlw LOW d'4100' | |
0 | 2220 movwf sub_a+0 |
25 | 2221 movlw HIGH d'4100' |
0 | 2222 movwf sub_a+1 |
2223 movff batt_voltage+0,sub_b+0 | |
2224 movff batt_voltage+1,sub_b+1 | |
2225 call sub16 ; sub_c = sub_a - sub_b | |
25 | 2226 ; Battery full (>4100mV? |
0 | 2227 btfsc neg_flag |
2228 bra update_batt_voltage2_full | |
2229 | |
25 | 2230 ; Vbatt-3500 |
2231 movlw LOW d'3500' | |
0 | 2232 movwf sub_b+0 |
25 | 2233 movlw HIGH d'3500' |
0 | 2234 movwf sub_b+1 |
2235 movff batt_voltage+0,sub_a+0 | |
2236 movff batt_voltage+1,sub_a+1 | |
2237 call sub16 ; sub_c = sub_a - sub_b | |
25 | 2238 ; Battery lower then 3500mV? |
0 | 2239 btfsc neg_flag |
2240 bra update_batt_voltage2_empty | |
2241 | |
25 | 2242 ; Battery is between 3500 and 4100mV |
0 | 2243 ; sub_c:2 is between 0 and 600 |
2244 movff sub_c+0,xA+0 | |
2245 movff sub_c+1,xA+1 | |
2246 movlw d'20' | |
2247 movwf xB+0 | |
2248 clrf xB+1 | |
2249 call div16x16 ;xA/xB=xC with xA as remainder | |
2250 ; xC is between 0 and 30 | |
2251 movff xC+0,wait_temp ;save value | |
56 | 2252 incf wait_temp,F ; +1 |
2253 | |
2254 movlw d'3' | |
0 | 2255 cpfsgt wait_temp |
56 | 2256 movwf wait_temp ; Minimum = 3 |
0 | 2257 |
2258 update_batt_voltage2a: | |
519 | 2259 WIN_BOX_STD .181, .187, .32, .34 ; Battery nose |
25 | 2260 |
0 | 2261 update_batt_voltage3: |
25 | 2262 GETCUSTOM8 d'34' ; Color battery |
283
4ec488f046f4
Battery sign color coded, work on new uart-started 115200Baud bootloader (Do NOT use yet!)
heinrichsweikamp
parents:
281
diff
changeset
|
2263 btfsc cc_active |
719 | 2264 ; movlw color_yellow ; CC active |
2265 movlw color_orange ; CC active | |
285 | 2266 btfsc charge_done |
2267 movlw color_green ; Charge done. | |
681 | 2268 call DISP_set_color |
123 | 2269 |
519 | 2270 movlw .175 |
2271 movff WREG,win_top ; row top (0-239) | |
2272 movlw .19 | |
2273 movff WREG,win_height | |
2274 movlw .2 | |
2275 movff WREG,win_leftx2 ; column left (0-159) | |
123 | 2276 movff wait_temp,win_width ; column right (0-159) |
681 | 2277 call DISP_box |
2278 call DISP_standard_color | |
0 | 2279 return |
519 | 2280 |
0 | 2281 update_batt_voltage2_empty: |
2282 movlw d'1' | |
2283 movwf wait_temp | |
2284 bra update_batt_voltage2a | |
2285 | |
2286 update_batt_voltage2_full: | |
2287 movlw d'30' | |
2288 movwf wait_temp | |
25 | 2289 bra update_batt_voltage2a |
0 | 2290 |
681 | 2291 DISP_convert_signed_temperature: |
382
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2292 btfss hi,7 ; Negative temperature ? |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2293 return ; No, return |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2294 ; Yes, negative temperature! |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2295 PUTC '-' ; Display "-" |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2296 comf hi ; Then, 16bit sign changes. |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2297 negf lo |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2298 btfsc STATUS,C |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2299 incf hi |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2300 return ; and return |
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
370
diff
changeset
|
2301 |
681 | 2302 DISP_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 |
0 | 2303 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) |
2304 tstfsz EEDATA | |
681 | 2305 bra DISP_convert_date1 |
0 | 2306 |
2307 ; Use MMDDYY | |
2308 movff convert_value_temp+0,lo ;month | |
2309 bsf leftbind | |
2310 output_99x | |
2311 bcf leftbind | |
140 | 2312 PUTC '.' |
0 | 2313 movff convert_value_temp+1,lo ;day |
681 | 2314 bra DISP_convert_date1_common ;year |
2315 | |
2316 DISP_convert_date1: | |
0 | 2317 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) |
2318 decfsz EEDATA,F | |
681 | 2319 bra DISP_convert_date2 |
0 | 2320 |
2321 ; Use DDMMYY | |
2322 movff convert_value_temp+1,lo ;day | |
2323 bsf leftbind | |
2324 output_99x | |
2325 bcf leftbind | |
140 | 2326 PUTC '.' |
0 | 2327 movff convert_value_temp+0,lo ;month |
2328 | |
681 | 2329 DISP_convert_date1_common: |
0 | 2330 bsf leftbind |
2331 output_99x | |
2332 bcf leftbind | |
140 | 2333 PUTC '.' |
0 | 2334 movff convert_value_temp+2,lo ;year |
2335 bsf leftbind | |
2336 output_99x | |
2337 return | |
2338 | |
681 | 2339 DISP_convert_date2: |
0 | 2340 ; Use YYMMDD |
2341 movff convert_value_temp+2,lo ;year | |
2342 bsf leftbind | |
2343 output_99x | |
2344 bcf leftbind | |
140 | 2345 PUTC '.' |
0 | 2346 movff convert_value_temp+0,lo ;month |
2347 bsf leftbind | |
2348 output_99x | |
2349 bcf leftbind | |
140 | 2350 PUTC '.' |
0 | 2351 movff convert_value_temp+1,lo ;day |
2352 bsf leftbind | |
2353 output_99x | |
2354 return | |
2355 | |
681 | 2356 DISP_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2 |
0 | 2357 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) |
2358 tstfsz EEDATA | |
681 | 2359 bra DISP_convert_date_short1 |
0 | 2360 |
2361 ; Use MMDDYY | |
681 | 2362 DISP_convert_date_short_common: |
0 | 2363 movff convert_value_temp+0,lo ;month |
2364 bsf leftbind | |
2365 output_99x | |
2366 bcf leftbind | |
140 | 2367 PUTC '.' |
0 | 2368 movff convert_value_temp+1,lo ;day |
2369 bsf leftbind | |
2370 output_99x | |
2371 bcf leftbind | |
2372 return | |
2373 | |
681 | 2374 DISP_convert_date_short1: |
0 | 2375 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) |
2376 decfsz EEDATA,F | |
681 | 2377 bra DISP_convert_date_short_common ; Use YYMMDD |
0 | 2378 |
2379 ; Use DDMMYY | |
2380 movff convert_value_temp+1,lo ;day | |
2381 bsf leftbind | |
2382 output_99x | |
2383 bcf leftbind | |
140 | 2384 PUTC '.' |
0 | 2385 movff convert_value_temp+0,lo ;month |
2386 bsf leftbind | |
2387 output_99x | |
2388 bcf leftbind | |
2389 return | |
2390 | |
2391 update_date: | |
2392 ostc_debug 'd' | |
2393 WIN_TOP .75 | |
56 | 2394 WIN_LEFT .1 |
0 | 2395 WIN_FONT FT_SMALL |
2396 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 2397 call DISP_standard_color |
3 | 2398 |
0 | 2399 lfsr FSR2,letter |
2400 | |
2401 movff month,convert_value_temp+0 | |
2402 movff day,convert_value_temp+1 | |
2403 movff year,convert_value_temp+2 | |
681 | 2404 call DISP_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 |
0 | 2405 call word_processor |
2406 return | |
2407 | |
681 | 2408 DISP_menu_clear: |
637 | 2409 WIN_BOX_BLACK .0, .26, .50, .100 ;top, bottom, left, right |
0 | 2410 return |
2411 | |
681 | 2412 DISP_max_pressure: |
0 | 2413 ostc_debug 'p' ; Sends debug-information to screen if debugmode active |
75 | 2414 movff max_pressure+0,lo |
2415 movff max_pressure+1,hi | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
2416 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
75 | 2417 |
2418 movlw .039 | |
2419 cpfslt hi | |
517 | 2420 bra maxdepth_greater_99_84mtr |
75 | 2421 |
2422 ; Display normal "xx.y" | |
2423 lfsr FSR2,letter | |
681 | 2424 call DISP_standard_color |
654 | 2425 WIN_TOP .207 |
0 | 2426 WIN_LEFT .0 |
2427 WIN_FONT FT_MEDIUM | |
2428 WIN_INVERT .0 ; Init new Wordprocessor | |
2429 bsf leftbind | |
2430 bsf ignore_digit5 ; do not display 1cm depth | |
2431 output_16dp d'3' | |
2432 bcf leftbind | |
2433 bcf show_last3 | |
2434 call word_processor | |
2435 WIN_FONT FT_SMALL | |
2436 return | |
2437 | |
517 | 2438 maxdepth_greater_99_84mtr: ; Display only in full meters |
2439 btfss maxdepth_greater_100m ; Is max.depth>100m already? | |
681 | 2440 call DISP_clear_maxdepth ; No, clear maxdepth area and set flag |
75 | 2441 ; max Depth is already in hi:lo |
517 | 2442 ; Show max depth in Full meters |
75 | 2443 ; That means ignore figure 4 and 5 |
2444 lfsr FSR2,letter | |
681 | 2445 call DISP_standard_color |
654 | 2446 WIN_TOP .207 |
75 | 2447 WIN_LEFT .0 |
2448 WIN_FONT FT_MEDIUM | |
2449 WIN_INVERT .0 ; Init new Wordprocessor | |
2450 | |
2451 bsf ignore_digit4 | |
2452 bsf leftbind | |
2453 output_16 | |
2454 bcf leftbind | |
2455 call word_processor | |
2456 bcf ignore_digit4 | |
2457 WIN_FONT FT_SMALL | |
2458 return | |
2459 | |
681 | 2460 DISP_clear_maxdepth: |
654 | 2461 WIN_BOX_BLACK .207, .239, .0, .41 ;top, bottom, left, right |
517 | 2462 bsf maxdepth_greater_100m ; Set Flag |
75 | 2463 return |
2464 | |
681 | 2465 DISP_divemins: |
0 | 2466 btfsc menubit ; Divemode menu active? |
2467 return ; Yes, do not update divetime | |
2468 | |
2469 ostc_debug 'A' ; Sends debug-information to screen if debugmode active | |
2470 | |
2471 btfsc gauge_mode ; different display in gauge mode | |
681 | 2472 bra DISP_divemins_gauge |
0 | 2473 |
2474 btfsc FLAG_apnoe_mode ; different display in apnoe mode | |
681 | 2475 bra DISP_divemins_apnoe |
0 | 2476 |
2477 GETCUSTOM8 d'38' ; Show seconds (=1?) | |
2478 movwf lo | |
2479 movlw d'1' | |
2480 cpfseq lo ; =1? | |
681 | 2481 bra DISP_divemins2 ; No, minutes only |
2482 bra DISP_divemins_gauge ; Yes, use Gauge routine | |
0 | 2483 |
681 | 2484 DISP_divemins2: |
0 | 2485 movff divemins+0,lo |
2486 movff divemins+1,hi | |
2487 bcf leftbind | |
2488 lfsr FSR2,letter | |
2489 output_16_3 ; displays only last three figures from a 16Bit value (0-999) | |
2490 WIN_TOP .20 | |
2491 WIN_LEFT .120 | |
2492 WIN_FONT FT_MEDIUM | |
681 | 2493 call DISP_standard_color |
0 | 2494 call word_processor |
2495 WIN_FONT FT_SMALL | |
2496 return | |
2497 | |
681 | 2498 DISP_display_apnoe_surface: |
0 | 2499 btfsc menubit ; Divemode menu active? |
2500 return ; Yes, do not display surface mode timeout | |
2501 | |
681 | 2502 call DISP_divemask_color ; Set Color for Divemode mask |
0 | 2503 DISPLAYTEXT d'140' ; "SURFACE" |
681 | 2504 call DISP_standard_color |
3 | 2505 |
0 | 2506 WIN_TOP .85 |
2507 WIN_LEFT .90 | |
2508 WIN_FONT FT_MEDIUM | |
681 | 2509 call DISP_standard_color |
3 | 2510 |
0 | 2511 |
2512 movff apnoe_surface_mins,lo | |
2513 bcf leftbind | |
2514 lfsr FSR2,letter | |
2515 output_8 | |
123 | 2516 PUTC ':' |
0 | 2517 movff apnoe_surface_secs,lo |
2518 output_99x | |
2519 call word_processor | |
2520 WIN_FONT FT_SMALL | |
2521 return | |
2522 | |
681 | 2523 DISP_apnoe_clear_surface: |
0 | 2524 ; Clear Surface timer.... |
204 | 2525 WIN_BOX_BLACK .60, .119, .90, .159 ;top, bottom, left, right |
0 | 2526 return |
2527 | |
2528 | |
681 | 2529 DISP_display_apnoe_descent: |
400 | 2530 btfsc menubit ; Divemode menu active? |
2531 return ; Yes, do not display/update descent time | |
2532 | |
681 | 2533 call DISP_divemask_color ; Set Color for Divemode mask |
0 | 2534 DISPLAYTEXT d'139' ; "Descent" |
681 | 2535 call DISP_standard_color |
3 | 2536 |
0 | 2537 |
2538 WIN_TOP .145 | |
2539 WIN_LEFT .90 | |
2540 WIN_FONT FT_MEDIUM | |
681 | 2541 call DISP_standard_color |
3 | 2542 |
0 | 2543 |
2544 movff apnoe_mins,lo | |
2545 lfsr FSR2,letter | |
2546 output_8 | |
123 | 2547 PUTC ':' |
0 | 2548 movff apnoe_secs,lo |
2549 output_99x | |
2550 call word_processor | |
2551 WIN_FONT FT_SMALL | |
2552 return | |
2553 | |
681 | 2554 DISP_divemins_apnoe: |
2555 | |
2556 DISP_divemins_gauge: | |
0 | 2557 movff divemins+0,lo |
2558 movff divemins+1,hi | |
2559 bcf leftbind | |
2560 bsf show_last3 | |
2561 lfsr FSR2,letter | |
2562 output_16_3 ;Displays only 0...999 | |
123 | 2563 PUTC ':' |
0 | 2564 movff divesecs,lo |
2565 output_99x | |
2566 WIN_TOP .20 | |
2567 WIN_LEFT .90 | |
2568 WIN_FONT FT_MEDIUM | |
681 | 2569 call DISP_standard_color |
3 | 2570 |
0 | 2571 call word_processor |
2572 bcf show_last3 | |
2573 WIN_FONT FT_SMALL | |
2574 return | |
2575 | |
681 | 2576 DISP_stopwatch_show: |
0 | 2577 ; Stopwatch |
681 | 2578 call DISP_divemask_color ; Set Color for Divemode mask |
87 | 2579 DISPLAYTEXTH d'283' ; Stopwatch |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2580 |
681 | 2581 DISP_stopwatch_show2: |
2582 call DISP_standard_color | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2583 ostc_debug 'V' ; Sends debug-information to screen if debugmode active |
87 | 2584 WIN_TOP .192 |
0 | 2585 WIN_LEFT .110 |
2586 WIN_FONT FT_SMALL | |
681 | 2587 call DISP_standard_color |
3 | 2588 |
0 | 2589 lfsr FSR2,letter |
2590 movff average_divesecs+0,lo ; Stopwatch | |
2591 movff average_divesecs+1,hi ; Stopwatch | |
2592 movlw d'2' | |
2593 subwf lo,F | |
2594 movlw d'0' | |
2595 subwfb hi,F ; Subtract 2 seconds | |
2596 | |
2597 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) | |
2598 | |
2599 movff lo,wait_temp | |
2600 movff hi,lo | |
2601 clrf hi | |
2602 | |
2603 movlw d'0' | |
2604 bcf leftbind | |
2605 bsf show_last3 | |
2606 output_16_3 ;Displays only 0...999 | |
123 | 2607 PUTC ':' |
0 | 2608 movff wait_temp,lo |
2609 output_99x | |
2610 call word_processor | |
2611 | |
2612 ostc_debug 'U' ; Sends debug-information to screen if debugmode active | |
2613 | |
87 | 2614 WIN_TOP .216 |
517 | 2615 WIN_LEFT .110 |
0 | 2616 WIN_FONT FT_SMALL |
681 | 2617 call DISP_standard_color |
3 | 2618 |
0 | 2619 lfsr FSR2,letter |
2620 movff avr_rel_pressure+0,lo | |
2621 movff avr_rel_pressure+1,hi | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
2622 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
0 | 2623 bsf ignore_digit5 ; do not display 1cm depth |
2624 output_16dp d'3' | |
2625 bcf leftbind | |
446 | 2626 STRCAT_PRINT TXT_METER1 |
0 | 2627 return |
2628 | |
681 | 2629 DISP_stopwatch_show_gauge: |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2630 btfsc menubit ; Divemode menu active? |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2631 return ; Yes, return |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2632 ; BIG Stopwatch |
681 | 2633 call DISP_divemask_color ; Set Color for Divemode mask |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2634 DISPLAYTEXTH d'310' ; Stopwatch |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2635 DISPLAYTEXTH d'309' ; Average |
681 | 2636 call DISP_standard_color |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2637 ostc_debug 'V' ; Sends debug-information to screen if debugmode active |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2638 WIN_TOP .80 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2639 WIN_LEFT .90 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2640 WIN_FONT FT_MEDIUM |
681 | 2641 call DISP_standard_color |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2642 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2643 lfsr FSR2,letter |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2644 movff average_divesecs+0,lo ; Stopwatch |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2645 movff average_divesecs+1,hi ; Stopwatch |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2646 movlw d'2' |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2647 subwf lo,F |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2648 movlw d'0' |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2649 subwfb hi,F ; Subtract 2 seconds |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2650 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2651 movff lo,wait_temp |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2652 movff hi,lo |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2653 clrf hi |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2654 movlw d'0' |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2655 bcf leftbind |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2656 bsf show_last3 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2657 output_16_3 ;Displays only 0...999 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2658 PUTC ':' |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2659 movff wait_temp,lo |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2660 output_99x |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2661 call word_processor |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2662 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2663 ostc_debug 'U' ; Sends debug-information to screen if debugmode active |
517 | 2664 WIN_TOP .136 |
2665 WIN_LEFT .90 | |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2666 WIN_FONT FT_MEDIUM |
681 | 2667 call DISP_standard_color |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2668 lfsr FSR2,letter |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2669 movff avr_rel_pressure+0,lo |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2670 movff avr_rel_pressure+1,hi |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
2671 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2672 bsf ignore_digit5 ; do not display 1cm depth |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2673 output_16dp d'3' |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2674 bcf leftbind |
446 | 2675 STRCAT_PRINT TXT_METER1 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2676 WIN_FONT FT_SMALL ; Reset... |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2677 return |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2678 |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
2679 |
681 | 2680 DISP_total_average_show: |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2681 ; Non-Resettable Average |
681 | 2682 call DISP_divemask_color ; Set Color for Divemode mask |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2683 DISPLAYTEXTH d'281' ; Avr.Depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2684 |
681 | 2685 DISP_total_average_show2: |
517 | 2686 WIN_TOP .192 |
2687 WIN_LEFT .110 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2688 WIN_FONT FT_SMALL |
681 | 2689 call DISP_standard_color |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2690 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2691 lfsr FSR2,letter |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2692 movff avr_rel_pressure_total+0,lo |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2693 movff avr_rel_pressure_total+1,hi |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
2694 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2695 bsf ignore_digit5 ; do not display 1cm depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2696 bcf leftbind |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2697 output_16dp d'3' |
446 | 2698 STRCAT_PRINT TXT_METER1 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2699 return |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2700 |
235 | 2701 ;============================================================================= |
2702 ; Writes OSTC #Serial and Firmware version in surfacemode | |
2703 ; | |
681 | 2704 DISP_serial: |
0 | 2705 ostc_debug 'a' ; Sends debug-information to screen if debugmode active |
2706 WIN_TOP .0 | |
56 | 2707 WIN_LEFT .1 |
0 | 2708 WIN_FONT FT_SMALL |
235 | 2709 WIN_INVERT .0 ; Init new Wordprocessor |
2710 | |
2711 ifdef __DEBUG | |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
2712 GETCUSTOM8 d'64' ; Write header in blue when |
681 | 2713 call DISP_set_color ; compiled in DEBUG mode... |
235 | 2714 else |
681 | 2715 call DISP_standard_color |
235 | 2716 endif |
3 | 2717 |
0 | 2718 lfsr FSR2,letter |
607 | 2719 read_int_eeprom d'34' ; Read deco data |
2720 tstfsz EEDATA | |
2721 bra show_decotype_mainscreen2 | |
2722 OUTPUTTEXT .101 ; ZH-L16 OC =0 | |
2723 bra show_decotype_mainscreen8 ; Done. | |
2724 show_decotype_mainscreen2: | |
2725 decfsz EEDATA,F | |
2726 bra show_decotype_mainscreen3 | |
2727 OUTPUTTEXT .102 ; Gauge =1 | |
2728 bra show_decotype_mainscreen8 ; Done. | |
2729 show_decotype_mainscreen3: | |
2730 decfsz EEDATA,F | |
2731 bra show_decotype_mainscreen4 | |
2732 OUTPUTTEXT .104 ; ZH-L16 CC =2 | |
2733 bra show_decotype_mainscreen8 ; Done. | |
2734 show_decotype_mainscreen4: | |
2735 decfsz EEDATA,F | |
2736 bra show_decotype_mainscreen5 | |
2737 OUTPUTTEXT .138 ; Apnoe =3 | |
2738 bra show_decotype_mainscreen8 ; Done. | |
2739 show_decotype_mainscreen5: | |
2740 decfsz EEDATA,F | |
2741 bra show_decotype_mainscreen6 | |
2742 OUTPUTTEXT .152 ; L16-GF OC =4 | |
2743 bra show_decotype_mainscreen8 ; Done. | |
2744 show_decotype_mainscreen6: | |
2745 decfsz EEDATA,F | |
2746 bra show_decotype_mainscreen7 | |
2747 OUTPUTTEXT .236 ; L16-GF CC =5 | |
2748 bra show_decotype_mainscreen8 ; Done. | |
2749 show_decotype_mainscreen7: | |
2750 decfsz EEDATA,F | |
2751 bra show_decotype_mainscreen8 ; Done. | |
2752 OUTPUTTEXT .226 ; pSCR-GF =6 | |
2753 show_decotype_mainscreen8: | |
235 | 2754 STRCAT " \x90\x91 V" ; Scribble logo... |
0 | 2755 movlw softwareversion_x |
2756 movwf lo | |
2757 bsf leftbind | |
2758 output_8 | |
123 | 2759 PUTC '.' |
0 | 2760 movlw softwareversion_y |
2761 movwf lo | |
2762 bsf leftbind | |
2763 output_99x | |
2764 bcf leftbind | |
235 | 2765 |
2766 ifdef __DEBUG | |
2767 STRCAT_PRINT "-Dbg" | |
2768 else | |
0 | 2769 call word_processor |
140 | 2770 |
235 | 2771 movlw softwareversion_beta ; =1: Beta, =0: Release |
140 | 2772 decfsz WREG,F |
235 | 2773 return ; Release version -> Return |
140 | 2774 |
681 | 2775 call DISP_warnings_color |
235 | 2776 DISPLAYTEXT d'243' ; beta |
681 | 2777 call DISP_standard_color |
235 | 2778 endif |
2779 | |
0 | 2780 return |
2781 | |
235 | 2782 ;============================================================================= |
2783 | |
681 | 2784 DISP_divemode_menu_mask_first: ; Write Divemode menu1 mask |
0 | 2785 ostc_debug 'o' ; Sends debug-information to screen if debugmode active |
681 | 2786 call DISP_menu_clear ; clear "Menu?" |
2787 call DISP_standard_color | |
0 | 2788 |
2789 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
681 | 2790 bra DISP_divemode_menu_mask_first2 |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2791 |
0 | 2792 ; in OC Mode |
2793 DISPLAYTEXT .32 ;"Gaslist" | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2794 DISPLAYTEXT .31 ;"Decoplan" |
681 | 2795 bra DISP_divemode_menu_mask_first3 |
2796 | |
2797 DISP_divemode_menu_mask_first2: | |
0 | 2798 ; in CC Mode |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2799 DISPLAYTEXT .238 ;"SetPoint" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2800 DISPLAYTEXT .31 ;"Decoplan" |
0 | 2801 |
681 | 2802 DISP_divemode_menu_mask_first3: |
0 | 2803 ; In all modes |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2804 call customview_menu_entry3 ; Show customview-dependent menu entry |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2805 DISPLAYTEXT .241 ;"Display" |
0 | 2806 DISPLAYTEXT .34 ;"Exit" |
2807 return | |
2808 | |
681 | 2809 DISP_divemode_set_xgas: ; Displayes the "Set Gas" menu |
0 | 2810 WIN_LEFT .100 |
2811 WIN_TOP .0 | |
2812 WIN_FONT FT_SMALL | |
681 | 2813 call DISP_standard_color |
3 | 2814 |
446 | 2815 STRCPY TXT_G6_3 |
0 | 2816 read_int_eeprom d'24' ; Get Gas6 %O2 |
2817 movff EEDATA,lo | |
2818 bcf leftbind | |
2819 output_99 ; outputs into Postinc2! | |
123 | 2820 PUTC '/' |
0 | 2821 read_int_eeprom d'25' ; Get Gas6 %He |
2822 movff EEDATA,lo | |
2823 output_99 ; outputs into Postinc2! | |
2824 call word_processor | |
2825 DISPLAYTEXT .123 ; O2 + | |
2826 DISPLAYTEXT .124 ; O2 - | |
2827 DISPLAYTEXT .125 ; He + | |
2828 DISPLAYTEXT .126 ; He - | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
2829 DISPLAYTEXTH d'300' ; Active? (Enable/Disable Gas underwater) |
0 | 2830 return |
2831 | |
681 | 2832 DISP_divemode_simulator_mask: |
2833 call DISP_standard_color | |
124 | 2834 DISPLAYTEXT .254 ; Close |
2835 DISPLAYTEXT .250 ; + 1m | |
2836 DISPLAYTEXT .251 ; - 1m | |
2837 DISPLAYTEXT .252 ; +10m | |
2838 DISPLAYTEXT .253 ; -10m | |
352
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
342
diff
changeset
|
2839 DISPLAYTEXTH .306 ; Quit Sim |
124 | 2840 return |
0 | 2841 |
123 | 2842 ;----------------------------------------------------------------------------- |
124 | 2843 ; Draw a stop of the deco plan (simulator or dive). |
2844 ; Inputs: lo = depth. Range 3m...93m | |
279
8514588eb6a2
Mark gas-switch stops for decoplans, displayed in yellow.
JeanDo
parents:
277
diff
changeset
|
2845 ; + 80 if this is a switch-gas stop. |
124 | 2846 ; hi = minutes. range 1'..240'. |
2847 ; win_top = line to draw on screen. | |
2848 ; Trashed: hi, lo, win_height, win_leftx2, win_width, win_color*, | |
2849 ; WREG, PROD, TBLPTR TABLAT. | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2850 ; |
681 | 2851 DISP_decoplan_show_stop: |
124 | 2852 ;---- Print depth ---------------------------------------------------- |
2853 WIN_LEFT .100 | |
517 | 2854 |
279
8514588eb6a2
Mark gas-switch stops for decoplans, displayed in yellow.
JeanDo
parents:
277
diff
changeset
|
2855 btfss lo,7 ; Bit set ? |
681 | 2856 bra DISP_decoplan_std_stop ; No : Just an usual stop |
559
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2857 |
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2858 bcf lo,7 ; cleanup depth |
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2859 |
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2860 GETCUSTOM8 d'55' ; Load gas switch [min] in wreg |
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2861 tstfsz WREG ; =0? |
681 | 2862 bra DISP_decoplan_show_stop1; No: Show gas switch stop |
2863 bra DISP_decoplan_std_stop ; Yes: Just an usual stop | |
559
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2864 |
681 | 2865 DISP_decoplan_show_stop1: |
559
c84ea647ff58
do not show gas switch stops in yellow when CF55=0
heinrichsweikamp
parents:
556
diff
changeset
|
2866 movlw color_yellow |
681 | 2867 call DISP_set_color ; Show in yellow for gas switch |
2868 bra DISP_decoplan_nstd_stop | |
2869 | |
2870 DISP_decoplan_std_stop: | |
2871 call DISP_standard_color | |
2872 | |
2873 DISP_decoplan_nstd_stop: | |
124 | 2874 lfsr FSR2,letter |
2875 bsf leftbind | |
2876 output_8 ; outputs into Postinc2! | |
446 | 2877 STRCAT_PRINT TXT_METER2 |
124 | 2878 |
2879 ;---- Print duration ------------------------------------------------- | |
719 | 2880 WIN_LEFT .139 |
124 | 2881 lfsr FSR2,letter |
2882 | |
2883 movf lo,W ; Swap hi & lo | |
2884 movff hi,lo | |
2885 movwf hi | |
2886 | |
719 | 2887 bsf leftbind |
2888 output_99 ; Allow up to 99' | |
2889 STRCAT_PRINT "'" ; 1 to 3 chars for depth. | |
124 | 2890 |
2891 movf lo,W ; Swap back hi & lo | |
2892 movff hi,lo | |
2893 movwf hi | |
2894 | |
2895 ;--------------------------------------------------------------------- | |
2896 ; Draw the bar graph used for deco stops (decoplan in simulator or dive). | |
2897 movff win_top,WREG ; Increment win_top (BANK SAFE) | |
2898 incf WREG | |
2899 movff WREG,win_top | |
2900 movlw d'18'+1 ; 19 --> height (bank safe !) | |
2901 movff WREG,win_height | |
2902 movlw .122 | |
2903 movff WREG,win_leftx2 ; column left (0-159) | |
150 | 2904 movlw .16 |
2905 movff WREG,win_width ; column max width. | |
2906 | |
2907 ; Draw used area (hi = minutes): | |
124 | 2908 movlw d'16' ; Limit length (16min) |
2909 cpfslt hi | |
2910 movwf hi | |
719 | 2911 movff hi,win_bargraph ; Active width, the rest is cleared. |
2912 | |
2913 call DISP_standard_color | |
681 | 2914 call DISP_box |
124 | 2915 |
2916 ; Restore win_top | |
681 | 2917 call DISP_standard_color |
124 | 2918 movff win_top,WREG ; decf win_top (BANK SAFE) |
2919 decf WREG | |
2920 movff WREG,win_top | |
2921 return | |
123 | 2922 |
2923 ;----------------------------------------------------------------------------- | |
719 | 2924 ; Clear unused area below last stop |
124 | 2925 ; Inputs: win_top : last used area... |
681 | 2926 DISP_decoplan_clear_bottom: |
124 | 2927 movff win_top,WREG ; Get back from bank0 |
2928 btfsc divemode ; In dive mode ? | |
150 | 2929 sublw .168 ; Yes: bottom row in divemode |
124 | 2930 btfss divemode ; In dive mode ? |
2931 sublw .240 ; No: bottom row in planning | |
2932 movff WREG,win_height | |
2933 | |
292 | 2934 WIN_LEFT .85 ; Full divemenu width |
683 | 2935 movlw .159-.85 |
124 | 2936 movff WREG,win_width |
2937 | |
2938 clrf WREG ; Fill with black | |
2939 movff WREG,win_color1 | |
2940 movff WREG,win_color2 | |
683 | 2941 movff WREG,win_color3 |
706 | 2942 movff WREG,win_color4 |
2943 movff WREG,win_color5 | |
2944 movff WREG,win_color6 | |
681 | 2945 goto DISP_box |
123 | 2946 |
2947 ;----------------------------------------------------------------------------- | |
124 | 2948 ; Display the decoplan (simulator or divemode) for GF model |
2949 ; Inputs: char_O_deco_table (array of stop times, in minutes) | |
2950 ; decoplan_page = page number. Displays 5 stop by page. | |
2951 ; | |
164 | 2952 #define decoplan_index apnoe_mins ; within each page |
2953 #define decoplan_gindex apnoe_secs ; global index | |
2954 #define decoplan_last apnoe_max_pressure ; Depth of last stop (CF#29) | |
2955 #define decoplan_max apnoe_max_pressure+1; Number of lines per page. 7 in planning, 5 in diving. | |
124 | 2956 |
681 | 2957 DISP_decoplan: |
124 | 2958 ostc_debug 'n' ; Sends debug-information to screen if debugmode active |
2959 | |
2960 WIN_INVERT 0 | |
2961 | |
2962 ;---- Is there deco stops ? ------------------------------------------ | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2963 movff char_O_first_deco_depth,WREG |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2964 iorwf WREG |
681 | 2965 bnz DISP_decoplan_1 |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2966 |
124 | 2967 ;---- No Deco -------------------------------------------------------- |
681 | 2968 call DISP_standard_color |
124 | 2969 DISPLAYTEXT d'239' ;"No Deco" |
2970 bsf last_ceiling_gf_shown | |
2971 return | |
2972 | |
681 | 2973 DISP_decoplan_1: |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2974 lfsr FSR0,char_O_deco_depth ; Initialize indexed addressing. |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2975 lfsr FSR1,char_O_deco_time |
124 | 2976 |
2977 movlw .8 ; 8 lines/page in decoplan | |
2978 btfsc divemode | |
2979 movlw .6 ; 6 lines/page in divemode. | |
2980 movwf decoplan_max | |
2981 | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2982 clrf decoplan_index ; Start with index = 0 |
124 | 2983 clrf WREG |
2984 movff WREG,win_top ; and row = 0 | |
2985 | |
2986 ; Read stop parameters, indexed by decoplan_index and decoplan_page | |
2987 movf decoplan_page,W ; decoplan_gindex = 6*decoplan_page + decoplan_index | |
2988 mulwf decoplan_max | |
2989 movf decoplan_index,W | |
2990 addwf PRODL,W | |
2991 movwf decoplan_gindex ; --> decoplan_gindex | |
2992 | |
2993 bcf last_ceiling_gf_shown ; Not finished yet... | |
2994 | |
681 | 2995 DISP_decoplan_2: |
124 | 2996 btfsc decoplan_gindex,5 ; Reached table length (32) ? |
681 | 2997 bra DISP_decoplan_99 ; YES: finished... |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2998 |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
2999 ; Read stop parameters, indexed by decoplan_index |
124 | 3000 movf decoplan_gindex,W ; index |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3001 movff PLUSW1,hi ; char_O_deco_time [gindex] --> hi |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3002 movff PLUSW0,lo ; char_O_deco_depth[gindex] |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3003 movf lo,W |
681 | 3004 bz DISP_decoplan_99 ; depth == 0 : finished. |
124 | 3005 |
3006 ; Display the stop line | |
681 | 3007 call DISP_decoplan_show_stop |
124 | 3008 |
3009 ; Next | |
3010 movff win_top,WREG ; row: += 24 | |
3011 addlw .24 | |
3012 movff WREG,win_top | |
3013 incf decoplan_index,F ; local index += 1 | |
3014 incf decoplan_gindex,F ; global index += 1 | |
3015 | |
3016 ; Max number of lines/page reached ? | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3017 movf decoplan_max,W ; index+1 == max ? |
124 | 3018 cpfseq decoplan_index |
681 | 3019 bra DISP_decoplan_2 ; NO: loop |
124 | 3020 |
3021 ; Check if next stop if end-of-list ? | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3022 movf decoplan_gindex,W |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3023 movff PLUSW0,WREG ; char_O_deco_depth[gindex] |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
168
diff
changeset
|
3024 iorwf WREG |
681 | 3025 bz DISP_decoplan_99 ; End of list... |
124 | 3026 |
3027 ; Display the message "more..." | |
223 | 3028 bcf last_ceiling_gf_shown ; More page to display... |
3029 | |
681 | 3030 rcall DISP_decoplan_clear_bottom ; Clear from next line |
124 | 3031 |
3032 WIN_LEFT .130 - 7*3 | |
681 | 3033 call DISP_standard_color |
223 | 3034 lfsr FSR2,letter |
3035 OUTPUTTEXT .142 ; More... | |
3036 goto word_processor | |
124 | 3037 |
681 | 3038 DISP_decoplan_99: |
124 | 3039 bsf last_ceiling_gf_shown ; Nothing more in table to display. |
681 | 3040 rcall DISP_decoplan_clear_bottom ; Clear from next line |
124 | 3041 return |
3042 ;----------------------------------------------------------------------------- | |
289 | 3043 ; Toggle gas activity flag during dive. |
3044 ; | |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
289
diff
changeset
|
3045 ; Input: gaslist_active |
289 | 3046 ; Gaslist from eeprom[2...] |
3047 ; | |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
289
diff
changeset
|
3048 ; Output: gaslist_active |
289 | 3049 ; |
3050 ; Note: Gas with a zero depth cannot be used in deco simulation, hence | |
3051 ; should not be displayed as selected here... | |
3052 ; | |
681 | 3053 DISP_de_activelist: ; show (de)active gaslist |
3054 call DISP_standard_color | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3055 DISPLAYTEXT .254 ; Close |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3056 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3057 WIN_LEFT .100 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3058 WIN_FONT FT_SMALL |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3059 bsf leftbind |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3060 |
281 | 3061 movlw d'2' |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3062 movwf wait_temp ; here: stores eeprom address for gas list |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3063 movlw d'0' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3064 movwf waitms_temp ; here: stores row for gas list |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3065 clrf hi ; here: Gas counter |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3066 |
681 | 3067 DISP_de_activelist_loop: |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3068 incf hi,F ; Increase Gas |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3069 movlw d'4' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3070 addwf wait_temp,F ; Increase eeprom address for gas list |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3071 movlw d'25' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3072 addwf waitms_temp,F ; Increase row |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3073 WIN_LEFT .100 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3074 movff waitms_temp,win_top ; Set Row |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3075 |
221 | 3076 lfsr FSR2,letter |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3077 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3078 call read_eeprom ; get byte (stored in EEDATA) |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3079 movff EEDATA,lo ; copy to lo |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3080 output_8 ; outputs into Postinc2! |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3081 PUTC '/' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3082 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3083 call read_eeprom ; get byte (stored in EEDATA) |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3084 movff EEDATA,lo ; copy to lo |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3085 output_8 ; outputs into Postinc2! |
221 | 3086 PUTC '@' |
3087 | |
281 | 3088 movlw d'27' |
221 | 3089 addwf hi,W |
3090 movwf EEADR ; Point to Change depth | |
3091 | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3092 call read_eeprom ; get byte (stored in EEDATA) |
221 | 3093 movff EEDATA,lo ; copy to lo |
3094 output_8 ; outputs into Postinc2! | |
3095 | |
289 | 3096 movf lo,w ; Gas with a zero depth |
681 | 3097 bz DISP_de_activelist_grey ; should be displayed inactive. |
289 | 3098 |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3099 ; Check if gas needs to be greyed-out (inactive) |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
289
diff
changeset
|
3100 movff gaslist_active,EEDATA ; Get flag register |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3101 movff hi,lo ; copy gas number |
681 | 3102 DISP_de_activelist_loop1: |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3103 rrcf EEDATA ; roll flags into carry |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3104 decfsz lo,F ; max. 5 times... |
681 | 3105 bra DISP_de_activelist_loop1 |
3106 bc DISP_de_activelist_white | |
3107 | |
3108 DISP_de_activelist_grey: ; grey out inactive gases! | |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3109 GETCUSTOM8 d'64' ;movlw color_grey |
681 | 3110 call DISP_set_color |
3111 | |
3112 DISP_de_activelist_white: | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3113 call word_processor |
681 | 3114 call DISP_standard_color |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3115 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3116 movlw d'5' ; list all five gases |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3117 cpfseq hi ; All gases shown? |
681 | 3118 bra DISP_de_activelist_loop ; No |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3119 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3120 return ; return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3121 |
681 | 3122 DISP_show_change_depth: ; Yes, show change depth for gas #menupos |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3123 btfsc display_set_setpoint ; In Setpoint list? |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3124 return ; Yes, return. |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3125 movlw color_yellow ; Blink in yellow |
681 | 3126 call DISP_set_color |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3127 WIN_LEFT .95 |
532 | 3128 WIN_TOP .148 |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3129 WIN_FONT FT_SMALL |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3130 |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3131 movlw .6 |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3132 cpfslt menupos ; <6? |
681 | 3133 bra DISP_show_change_depth_clear ; Yes! |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3134 |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3135 bsf leftbind |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3136 STRCPY TXT_GAS1 |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3137 movff menupos,lo |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3138 output_8 ; Show gas number |
532 | 3139 STRCAT TXT_AT4 ; " at " |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3140 decf menupos,W |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3141 addlw d'28' ; offset in memory |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3142 movwf EEADR |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3143 call read_eeprom ; Low-value |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3144 movff EEDATA,lo |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3145 output_8 ; Show gas number |
768
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
3146 STRCAT "m " |
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
3147 clrf WREG |
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
3148 movff WREG,letter+.9 ; Limit to 9 chars |
b23b43d6d50d
BUGFIX: Italian language fix (Divemode menu)
heinrichsweikamp
parents:
765
diff
changeset
|
3149 STRCAT_PRINT "" |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3150 bcf leftbind |
681 | 3151 call DISP_standard_color |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3152 return |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3153 |
681 | 3154 DISP_show_change_depth_clear: |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3155 STRCPY_PRINT " " |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3156 return |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
3157 |
681 | 3158 DISP_diluent_list: |
647 | 3159 ostc_debug 'm' ; Sends debug-information to screen if debugmode active |
3160 WIN_LEFT .100 | |
3161 WIN_FONT FT_SMALL | |
3162 bsf leftbind | |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
3163 movlw d'93' |
647 | 3164 movwf wait_temp ; here: stores eeprom address for diluent list (96-2) |
3165 movlw d'231' | |
3166 movwf waitms_temp ; here: stores row for gas list | |
3167 clrf hi ; here: Diluent counter | |
3168 | |
681 | 3169 DISP_diluent_list_loop: |
647 | 3170 incf hi,F ; Increase Diluent |
685
aebb6d039249
Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents:
683
diff
changeset
|
3171 movlw d'4' |
647 | 3172 addwf wait_temp,F ; Increase eeprom address for gas list |
3173 movlw d'25' | |
3174 addwf waitms_temp,F ; Increase row | |
3175 WIN_LEFT .100 | |
3176 movff waitms_temp,win_top ; Set Row | |
3177 STRCPY TXT_DIL_C | |
3178 movff hi,lo ; copy dil number | |
3179 output_8 ; display dil number | |
3180 PUTC ':' | |
3181 movff wait_temp, EEADR; Dil #hi: %O2 - Set address in internal EEPROM | |
3182 call read_eeprom ; get byte (stored in EEDATA) | |
3183 movff EEDATA,lo ; copy to lo | |
3184 output_8 ; outputs into Postinc2! | |
3185 PUTC '/' | |
3186 incf EEADR,F ; Dil #hi: %He - Set address in internal EEPROM | |
3187 call read_eeprom ; get byte (stored in EEDATA) | |
3188 movff EEDATA,lo ; copy to lo | |
3189 output_8 ; outputs into Postinc2! | |
3190 | |
3191 decf EEADR,F ; Dil #hi: %O2 - Set address in internal EEPROM | |
3192 call read_eeprom ; get byte (stored in EEDATA) | |
681 | 3193 DISP_color_code warn_gas_in_gaslist ; Color-code output (%O2 in "EEDATA") |
647 | 3194 |
3195 call word_processor | |
681 | 3196 call DISP_standard_color |
647 | 3197 |
3198 movlw d'5' ; list all five Diluents | |
3199 cpfseq hi ; All diluents shown? | |
681 | 3200 bra DISP_diluent_list_loop ; No |
647 | 3201 return ; return |
3202 | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3203 |
681 | 3204 DISP_gas_list: |
0 | 3205 ostc_debug 'm' ; Sends debug-information to screen if debugmode active |
3206 | |
3207 WIN_LEFT .100 | |
3208 WIN_FONT FT_SMALL | |
3209 bsf leftbind | |
3210 | |
3211 movlw d'2' | |
3212 movwf wait_temp ; here: stores eeprom address for gas list | |
3213 movlw d'231' | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
3214 movwf waitms_temp ; here: stores row for gas list |
0 | 3215 clrf hi ; here: Gas counter |
3216 | |
681 | 3217 DISP_gas_list_loop: |
0 | 3218 incf hi,F ; Increase Gas |
3219 movlw d'4' | |
3220 addwf wait_temp,F ; Increase eeprom address for gas list | |
3221 movlw d'25' | |
3222 addwf waitms_temp,F ; Increase row | |
3223 WIN_LEFT .100 | |
3224 movff waitms_temp,win_top ; Set Row | |
446 | 3225 STRCPY TXT_GAS1 |
0 | 3226 movff hi,lo ; copy gas number |
3227 output_8 ; display gas number | |
123 | 3228 PUTC ':' |
0 | 3229 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
3230 call read_eeprom ; get byte (stored in EEDATA) | |
3231 movff EEDATA,lo ; copy to lo | |
3232 output_8 ; outputs into Postinc2! | |
123 | 3233 PUTC '/' |
0 | 3234 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
3235 call read_eeprom ; get byte (stored in EEDATA) | |
3236 movff EEDATA,lo ; copy to lo | |
3237 output_8 ; outputs into Postinc2! | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
3238 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
3239 decf EEADR,F ; Gas #hi: %O2 - Set address in internal EEPROM |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
3240 call read_eeprom ; get byte (stored in EEDATA) |
681 | 3241 DISP_color_code warn_gas_in_gaslist ; Color-code output (%O2 in "EEDATA") |
627
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3242 |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3243 ; Check if the "better gas" should be highlighted |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3244 |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3245 WIN_INVERT .0 ; Init new Wordprocessor |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3246 movf better_gas_number,W ; better gas 1-5? |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3247 cpfseq hi ; compare with gas# |
681 | 3248 bra DISP_gas_list_loop2 ; No equal, skip |
627
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3249 |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3250 movlw color_yellow ; Blink in yellow |
681 | 3251 call DISP_set_color |
627
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3252 WIN_INVERT .1 ; Init new Wordprocessor |
8d2dc109ecfc
NEW: Gaslist highlights "better gas" in divemode
heinrichsweikamp
parents:
624
diff
changeset
|
3253 |
681 | 3254 DISP_gas_list_loop2: |
281 | 3255 ; Check if gas needs to be greyed-out (inactive) |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
289
diff
changeset
|
3256 movff gaslist_active, EEDATA ; Work with sorted list |
0 | 3257 movff hi,lo ; copy gas number |
681 | 3258 DISP_gas_list_loop1: |
0 | 3259 rrcf EEDATA ; roll flags into carry |
3260 decfsz lo,F ; max. 5 times... | |
681 | 3261 bra DISP_gas_list_loop1 |
19 | 3262 |
0 | 3263 btfss STATUS,C ; test carry |
681 | 3264 rcall DISP_gas_list_grey |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3265 |
0 | 3266 call word_processor |
681 | 3267 call DISP_standard_color |
0 | 3268 |
3269 movlw d'5' ; list all five gases | |
3270 cpfseq hi ; All gases shown? | |
681 | 3271 bra DISP_gas_list_loop ; No |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3272 |
734 | 3273 WIN_INVERT .0 |
352
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
342
diff
changeset
|
3274 DISPLAYTEXT d'122' ; More |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3275 return ; return (OC mode) |
0 | 3276 |
681 | 3277 DISP_gas_list_grey: |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3278 GETCUSTOM8 d'64' ;movlw color_grey |
681 | 3279 call DISP_set_color ; grey out inactive gases! |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3280 return |
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3281 |
681 | 3282 DISP_splist_start: |
0 | 3283 WIN_LEFT .100 |
3284 WIN_FONT FT_SMALL | |
3285 bsf leftbind | |
681 | 3286 call DISP_standard_color |
0 | 3287 |
3288 ; list three SP in Gaslist | |
3289 movlw d'35' ; 36 = current SP position in EEPROM | |
3290 movwf wait_temp ; here: stores eeprom address for gas list | |
525 | 3291 movlw d'0' |
0 | 3292 movwf waitms_temp ; here: stores row for gas list |
124 | 3293 clrf decoplan_index ; here: SP counter |
0 | 3294 |
681 | 3295 DISP_splist_loop: |
0 | 3296 incf wait_temp,F ; EEPROM address |
124 | 3297 incf decoplan_index,F ; Increase SP |
0 | 3298 |
3299 movlw d'25' | |
3300 addwf waitms_temp,F ; Increase row | |
3301 movff waitms_temp,win_top ; Set Row | |
3302 WIN_LEFT .100 | |
3303 | |
446 | 3304 STRCPY TXT_SP2 |
124 | 3305 movff decoplan_index,lo ; copy gas number |
0 | 3306 output_8 ; display gas number |
123 | 3307 PUTC ':' |
0 | 3308 movff wait_temp, EEADR; SP #hi position |
3309 call read_eeprom ; get byte (stored in EEDATA) | |
3310 movff EEDATA,lo ; copy to lo | |
3311 clrf hi | |
3312 output_16dp d'3' ; outputs into Postinc2! | |
3313 call word_processor | |
3314 | |
3315 movlw d'3' ; list all three SP | |
124 | 3316 cpfseq decoplan_index ; All gases shown? |
681 | 3317 bra DISP_splist_loop ; No |
0 | 3318 |
3319 bcf leftbind | |
3320 return ; no, return | |
3321 | |
681 | 3322 DISP_clear_divemode_menu: |
682 | 3323 WIN_BOX_BLACK .0, .168, .85, .159 ;top, bottom, left, right |
0 | 3324 return |
3325 | |
681 | 3326 DISP_divemenu_cursor: |
0 | 3327 ostc_debug 'l' ; Sends debug-information to screen if debugmode active |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3328 |
204 | 3329 WIN_BOX_BLACK .0, .150, .85, .95 ;top, bottom, left, right |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3330 |
0 | 3331 WIN_TOP .0 |
3332 WIN_LEFT .85 | |
3333 WIN_FONT FT_SMALL | |
3334 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 3335 call DISP_standard_color |
84 | 3336 |
0 | 3337 movff menupos,temp1 |
3338 movlw d'0' | |
3339 dcfsnz temp1,F | |
3340 movlw d'0' | |
3341 dcfsnz temp1,F | |
3342 movlw d'25' | |
3343 dcfsnz temp1,F | |
3344 movlw d'50' | |
3345 dcfsnz temp1,F | |
3346 movlw d'75' | |
3347 dcfsnz temp1,F | |
3348 movlw d'100' | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3349 dcfsnz temp1,F |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3350 movlw d'125' |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
209
diff
changeset
|
3351 |
0 | 3352 movff WREG,win_top |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
3353 STRCPY_PRINT "\xB7" ; Cursor |
0 | 3354 return |
3355 | |
128 | 3356 |
3357 ;============================================================================= | |
3358 ; Draw saturation graph, is surface mode or in dive mode. | |
3359 ; | |
681 | 3360 DISP_tissue_saturation_graph: |
0 | 3361 ostc_debug 'i' ; Sends debug-information to screen if debugmode active |
13 | 3362 |
128 | 3363 ;---- Draw Frame --------------------------------------------------------- |
3364 btfsc divemode | |
681 | 3365 bra DISP_tsg_1 |
128 | 3366 |
3367 WIN_FRAME_STD .25, .120, .82, .159 ; Surfmode | |
681 | 3368 bra DISP_tsg_2 |
3369 DISP_tsg_1: | |
128 | 3370 WIN_FRAME_STD .169, .239, .90, .159 ; Divemode |
681 | 3371 DISP_tsg_2: |
128 | 3372 |
3373 ;---- Draw grid ---------------------------------------------------------- | |
133 | 3374 btfss divemode |
681 | 3375 bra DISP_no_graph_grid |
133 | 3376 |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
3377 GETCUSTOM8 d'64' ;movlw color_grey |
681 | 3378 call DISP_set_color |
128 | 3379 |
3380 movlw .169+.1 ; divemode | |
3381 movff WREG,win_top | |
3382 movlw .239-.169-.1 ; divemode | |
3383 movff WREG,win_height | |
3384 | |
3385 movlw 1 | |
3386 movff WREG,win_width | |
3387 | |
3388 movlw .122 | |
3389 movff WREG,win_leftx2 | |
681 | 3390 call DISP_box |
128 | 3391 movlw .131 |
3392 movff WREG,win_leftx2 | |
681 | 3393 call DISP_box |
128 | 3394 movlw .140 |
3395 movff WREG,win_leftx2 | |
681 | 3396 call DISP_box |
128 | 3397 movlw .149 |
3398 movff WREG,win_leftx2 | |
681 | 3399 call DISP_box |
3400 DISP_no_graph_grid: | |
128 | 3401 |
3402 ;---- Draw N2 Tissues ---------------------------------------------------- | |
339 | 3403 lfsr FSR2, char_O_tissue_N2_saturation |
0 | 3404 movlw d'16' |
128 | 3405 movwf wait_temp ; 16 tissues |
3406 clrf waitms_temp ; Row offset | |
3407 | |
123 | 3408 movlw .1 |
3409 movff WREG,win_height ; row bottom (0-239) | |
128 | 3410 movlw .82+.18 ; surfmode |
3411 btfsc divemode | |
133 | 3412 movlw .90+.18 ; divemode |
123 | 3413 movff WREG,win_leftx2 ; column left (0-159) |
150 | 3414 movlw .57 ; surfmode: max width 57pix |
3415 btfsc divemode | |
3416 movlw .57-8 ; divemode: 8pix less... | |
3417 movff WREG,win_width | |
123 | 3418 |
681 | 3419 DISP_tissue_saturation_graph3: |
3420 call DISP_standard_color ; Reset color foreach iteration | |
150 | 3421 |
128 | 3422 movlw .25+3 ; surfmode: 3pix below top border |
3423 btfsc divemode | |
3424 movlw .169+3 ; divemode | |
0 | 3425 addwf waitms_temp,W |
123 | 3426 movff WREG,win_top ; row top (0-239) |
0 | 3427 |
3428 incf waitms_temp,F | |
3429 incf waitms_temp,F | |
3430 | |
123 | 3431 movf POSTINC2,W |
3432 bcf STATUS,C ; Clear carry | |
3433 rrcf WREG ; And divide by 4 | |
0 | 3434 bcf STATUS,C |
123 | 3435 rrcf WREG |
133 | 3436 movwf temp1 |
3437 | |
150 | 3438 movff win_width,WREG ; Max width. |
133 | 3439 cpfslt temp1 ; skip if 57 (WREG) < win_width |
3440 movwf temp1 | |
150 | 3441 movff temp1,win_bargraph |
0 | 3442 |
681 | 3443 call DISP_box |
0 | 3444 |
3445 decfsz wait_temp,F | |
681 | 3446 bra DISP_tissue_saturation_graph3 |
0 | 3447 |
128 | 3448 ;---- Draw He Tissues ---------------------------------------------------- |
339 | 3449 lfsr FSR2, char_O_tissue_He_saturation |
0 | 3450 movlw d'16' |
128 | 3451 movwf wait_temp ; 16 tissues |
3452 clrf waitms_temp ; Row offset | |
123 | 3453 |
681 | 3454 DISP_tissue_saturation_graph2: |
3455 call DISP_standard_color ; Reset color foreach iteration | |
123 | 3456 |
128 | 3457 movlw .120-.33 ; surfmode : 33pix above bottom border |
3458 btfsc divemode | |
3459 movlw .239-.33 ; divemode | |
0 | 3460 addwf waitms_temp,W |
123 | 3461 movff WREG,win_top ; row top (0-239) |
0 | 3462 |
3463 incf waitms_temp,F | |
3464 incf waitms_temp,F | |
3465 | |
123 | 3466 movf POSTINC2,W |
3467 bcf STATUS,C ; Clear carry | |
3468 rrcf WREG ; And divide by 4 | |
0 | 3469 bcf STATUS,C |
123 | 3470 rrcf WREG |
133 | 3471 movwf temp1 |
150 | 3472 |
3473 movff win_width,WREG ; Max width. | |
133 | 3474 cpfslt temp1 ; skip if 57 (WREG) < win_width |
3475 movwf temp1 | |
150 | 3476 movff temp1,win_bargraph |
0 | 3477 |
681 | 3478 call DISP_box |
0 | 3479 |
3480 decfsz wait_temp,F | |
681 | 3481 bra DISP_tissue_saturation_graph2 |
0 | 3482 |
128 | 3483 ;---- Draw N2/He Text ---------------------------------------------------- |
681 | 3484 call DISP_standard_color ; Reset color after last iterarion. |
150 | 3485 |
128 | 3486 movlw .82+2 ; surfmode: 2pix right of left border |
3487 btfsc divemode | |
3488 movlw .90+2 ; divemode | |
3489 movff WREG,win_leftx2 | |
3490 | |
3491 movlw .25+7 ; surfmode: 7pix below top border | |
3492 btfsc divemode | |
3493 movlw .169+7 ; divemode | |
3494 movff WREG,win_top | |
446 | 3495 STRCPY_PRINT TXT_N2_2 |
123 | 3496 |
128 | 3497 movlw .120-.30 ; surfmode: 30pix above bottom border |
3498 btfsc divemode | |
3499 movlw .239-.30 ; divemode | |
3500 movff WREG,win_top | |
446 | 3501 STRCPY_PRINT TXT_HE2 |
128 | 3502 |
3503 ;---- Draw scale and O2[16]% --------------------------------------------- | |
3504 btfsc divemode | |
3505 return | |
19 | 3506 |
3507 movff char_O_gtissue_no,wait_temp ; used as temp | |
3508 | |
339 | 3509 lfsr FSR1,char_O_tissue_N2_saturation |
3510 movf wait_temp,W ; W <- 0-15 | |
3511 movff PLUSW1,lo ; lo <- FSR1[W] | |
123 | 3512 |
19 | 3513 WIN_TOP .62 |
3514 WIN_FONT FT_SMALL | |
128 | 3515 lfsr FSR2,letter |
3516 bsf leftbind | |
3517 output_8 | |
19 | 3518 bcf leftbind |
3519 | |
128 | 3520 STRCAT_PRINT "% " |
3521 | |
3522 ;---- Draw Scale --------------------------------------------------------- | |
123 | 3523 WIN_BOX_STD .73, .74, .121, .157 |
3524 WIN_BOX_STD .61, .84, .121, .122 | |
3525 WIN_BOX_STD .65, .80, .130, .131 | |
3526 WIN_BOX_STD .65, .80, .139, .140 | |
3527 WIN_BOX_STD .65, .80, .148, .149 | |
3528 WIN_BOX_STD .61, .84, .157, .158 | |
0 | 3529 return |
3530 | |
128 | 3531 ;============================================================================= |
3532 | |
681 | 3533 DISP_startupscreen1: |
717 | 3534 call DISP_divemask_color |
0 | 3535 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" |
717 | 3536 call DISP_standard_color |
0 | 3537 DISPLAYTEXT .68 ; Licence 1/2 |
3538 DISPLAYTEXT .69 | |
3539 DISPLAYTEXT .70 | |
3540 DISPLAYTEXT .71 | |
3541 DISPLAYTEXT .72 | |
3542 DISPLAYTEXT .73 | |
3543 DISPLAYTEXT .74 | |
3544 return | |
3545 | |
681 | 3546 DISP_startupscreen2: |
717 | 3547 call DISP_divemask_color |
0 | 3548 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" |
717 | 3549 call DISP_standard_color |
0 | 3550 DISPLAYTEXT .75 ; Licence 2/2 |
3551 DISPLAYTEXT .76 | |
3552 DISPLAYTEXT .77 | |
3553 DISPLAYTEXT .78 | |
3554 DISPLAYTEXT .79 | |
3555 DISPLAYTEXT .80 | |
3556 DISPLAYTEXT .81 | |
3557 return | |
3558 | |
681 | 3559 DISP_new_cf_warning: |
717 | 3560 call DISP_divemask_color |
0 | 3561 DISPLAYTEXTH .271 ; New CF added! |
717 | 3562 call DISP_standard_color |
0 | 3563 DISPLAYTEXTH .272 ; New CustomFunctions |
3564 DISPLAYTEXTH .273 ; were added! Check | |
3565 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
3566 DISPLAYTEXTH .275 ; for Details! | |
3567 return | |
3568 | |
681 | 3569 DISP_const_ppO2_value: |
0 | 3570 ostc_debug 'j' ; Sends debug-information to screen if debugmode active |
3571 | |
3572 WIN_TOP .168 | |
75 | 3573 WIN_LEFT .50 |
0 | 3574 WIN_FONT FT_SMALL |
3575 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 3576 |
0 | 3577 lfsr FSR2,letter |
3578 movff char_I_const_ppO2,lo | |
3579 | |
3580 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
681 | 3581 bra DISP_const_ppO2_value2 ; No, display Setpoint |
0 | 3582 |
3583 ; Yes, Display "Bail" | |
681 | 3584 call DISP_standard_color |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3585 OUTPUTTEXTH d'263' ;"Bail " |
0 | 3586 call word_processor |
3587 return | |
3588 | |
681 | 3589 DISP_const_ppO2_value2: ; Display SetPoint |
0 | 3590 ;Show fixed SP value |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
3591 SAFE_2BYTE_COPY amb_pressure, xA |
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
3592 |
4 | 3593 movlw d'10' |
3594 movwf xB+0 | |
3595 clrf xB+1 | |
3596 ;xA/xB=xC with xA as remainder | |
3597 call div16x16 ; xC+0=p_amb/10 | |
26 | 3598 |
412 | 3599 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
3600 tstfsz xC+1 ; xC>255 | |
3601 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 3602 |
4 | 3603 movff ppO2_setpoint_store,WREG |
3604 cpfslt xC+0 ; Setpoint value possible? | |
681 | 3605 bra DISP_const_ppO2_value1 ; Yes |
4 | 3606 |
406
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3607 clrf hi ; Reset hi |
4 | 3608 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value |
681 | 3609 bra DISP_const_ppO2_value1a |
3610 | |
3611 DISP_const_ppO2_value1: | |
26 | 3612 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
341
2144f19fa1eb
BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents:
340
diff
changeset
|
3613 SAFE_2BYTE_COPY amb_pressure, xA |
26 | 3614 movlw d'10' |
3615 movwf xB+0 | |
3616 clrf xB+1 | |
3617 call div16x16 ; xC=p_amb/10 | |
3618 movff xC+0,xA+0 | |
3619 movff xC+1,xA+1 | |
3620 movff char_I_O2_ratio,xB+0 | |
3621 clrf xB+1 | |
3622 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
3623 | |
3624 movff xC+0,sub_b+0 | |
3625 movff xC+1,sub_b+1 | |
3626 movff ppO2_setpoint_store,WREG; Setpoint | |
3627 mullw d'100' ; Setpoint*100 | |
3628 movff PRODL,sub_a+0 | |
3629 movff PRODH,sub_a+1 | |
3630 call sub16 ; sub_c = sub_a - sub_b | |
3631 | |
3632 btfss neg_flag | |
681 | 3633 bra DISP_const_ppO2_value11 ; Value in range (lower then fix Setpoint) |
26 | 3634 |
3635 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
3636 | |
406
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3637 movff xC+0,xA+0 ; xC=p_amb/10 |
26 | 3638 movff xC+1,xA+1 |
3639 movlw d'100' | |
3640 movwf xB+0 | |
3641 clrf xB+1 | |
406
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3642 call div16x16 ;xA/xB=xC with xA as remainder |
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3643 |
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3644 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value |
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3645 movff xC+1,hi ; For test if ppO2>2,55bar |
138 | 3646 |
406
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3647 GETCUSTOM8 d'39' ; Adjust fixed SP? |
138 | 3648 dcfsnz WREG,F |
681 | 3649 bra DISP_const_ppO2_value1a ; Yes! |
138 | 3650 ; Do not adjust -> restore original SetPoint |
26 | 3651 |
681 | 3652 DISP_const_ppO2_value11: |
26 | 3653 ; Setpoint in possible limits |
4 | 3654 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3655 clrf hi |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3656 |
681 | 3657 DISP_const_ppO2_value1a: |
4 | 3658 movff char_I_const_ppO2,lo |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3659 |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3660 movff lo,WREG ; copy to WREG |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3661 mullw .100 |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3662 movff PRODH,xC+1 |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3663 movff PRODL,xC+0 ; For color code |
681 | 3664 DISP_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3665 |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3666 tstfsz hi ; >2,55bar? |
681 | 3667 rcall DISP_const_ppO2_too_hi ; Yes |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3668 |
0 | 3669 bsf leftbind |
3670 output_16dp d'3' | |
3671 bcf leftbind | |
406
2534277be060
Bug #52 fixed (ppO2 blinking if setpoint is not physically possible)
heinrichsweikamp
parents:
403
diff
changeset
|
3672 STRCAT_PRINT " " ; Display Setpoint with trailing zero |
681 | 3673 call DISP_standard_color ; Reset color |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3674 return |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3675 |
681 | 3676 DISP_const_ppO2_too_hi: |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
382
diff
changeset
|
3677 PUTC '>' |
325
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3678 setf lo ; show ">2.55" |
4a28d7a1c620
Fixed Setpoint behavior >2,55bar with CF38=ON
heinrichsweikamp
parents:
324
diff
changeset
|
3679 clrf hi ; clear hi |
681 | 3680 call DISP_warnings_color ; Set Warning color |
0 | 3681 return |
3682 | |
307 | 3683 ;============================================================================= |
3684 ; Display EAD/END computed in calc_hauptroutine_update_tissues() every 2sec. | |
3685 ; | |
681 | 3686 DISP_show_end_ead_divemode: |
3687 call DISP_divemask_color ; Set Color for Divemode mask | |
307 | 3688 |
3689 WIN_FONT FT_SMALL | |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3690 WIN_LEFT .95 |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3691 WIN_TOP .192 |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3692 lfsr FSR2,letter |
307 | 3693 OUTPUTTEXTH .299 ; EAD: |
326 | 3694 call word_processor |
307 | 3695 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3696 WIN_TOP .216 |
326 | 3697 lfsr FSR2,letter |
307 | 3698 OUTPUTTEXTH .298 ; END: |
326 | 3699 call word_processor |
3700 | |
681 | 3701 call DISP_standard_color ; Back to white. |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3702 WIN_LEFT .125 |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3703 WIN_TOP .192 |
326 | 3704 lfsr FSR2,letter |
3705 movff char_O_EAD,lo | |
3706 bsf leftbind | |
307 | 3707 output_8 ; Print EAD w/o leading space. |
446 | 3708 STRCAT_PRINT TXT_METER2 |
307 | 3709 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3710 WIN_TOP .216 |
326 | 3711 lfsr FSR2,letter |
3712 movff char_O_END,lo | |
307 | 3713 output_8 ; Print END w/o leading space. |
326 | 3714 bcf leftbind |
446 | 3715 STRCAT_PRINT TXT_METER2 |
326 | 3716 |
3717 ; Show ppO2[Flush] iff in CCR mode & not in Bailout: | |
3718 btfsc is_bailout ; In bailout mode? | |
307 | 3719 return ; Yes: done. |
3720 | |
326 | 3721 btfss FLAG_const_ppO2_mode ; In (true) CCR mode ? |
307 | 3722 return ; No: done. |
3723 | |
301 | 3724 WIN_LEFT .95 |
3725 WIN_TOP .168 | |
681 | 3726 call DISP_divemask_color ; Set Color for Divemode mask |
446 | 3727 STRCPY_PRINT TXT_PPO2_5 ; ppO2 of diluent |
326 | 3728 |
3729 movff char_O_flush_ppO2,WREG ; copy to WREG | |
3730 mullw .100 | |
3731 movff PRODH,xC+1 | |
3732 movff PRODL,xC+0 ; For color code | |
681 | 3733 DISP_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
301 | 3734 |
3735 WIN_LEFT .130 | |
3736 WIN_TOP .168 | |
322 | 3737 |
3738 movff char_O_flush_ppO2, lo | |
3739 incf lo,W ; ppO2 == 2.55 ? | |
681 | 3740 bnz DISP_show_end_ead_divemode_1 |
326 | 3741 |
322 | 3742 STRCPY_PRINT "----" ; YES: mark overflow. |
681 | 3743 goto DISP_standard_color ; Back to white. |
3744 | |
3745 DISP_show_end_ead_divemode_1: | |
301 | 3746 lfsr FSR2,letter |
307 | 3747 clrf hi |
301 | 3748 bsf leftbind |
307 | 3749 output_16dp d'3' ; Show ppO2 w/o leading zero |
301 | 3750 bcf leftbind |
731
87c74962b7e1
show ppO2 of diluent gas in bailout case correctly
heinrichsweikamp
parents:
728
diff
changeset
|
3751 PUTC " " |
87c74962b7e1
show ppO2 of diluent gas in bailout case correctly
heinrichsweikamp
parents:
728
diff
changeset
|
3752 clrf WREG |
87c74962b7e1
show ppO2 of diluent gas in bailout case correctly
heinrichsweikamp
parents:
728
diff
changeset
|
3753 movff WREG,letter+4 ; limit to five chars |
87c74962b7e1
show ppO2 of diluent gas in bailout case correctly
heinrichsweikamp
parents:
728
diff
changeset
|
3754 STRCAT_PRINT "" ; Display ppO2[Diluent] |
681 | 3755 goto DISP_standard_color ; Back to white. |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
3756 |
307 | 3757 ;============================================================================= |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3758 ; Display TTS after extra time at the same depth. |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3759 ; |
681 | 3760 DISP_show_@5: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3761 WIN_FONT FT_SMALL |
701 | 3762 WIN_LEFT .159-.69 ; 10 chars aligned right. |
313 | 3763 WIN_TOP .170 |
681 | 3764 call DISP_divemask_color ; Set Color for Divemode mask |
314 | 3765 lfsr FSR2,letter |
323 | 3766 |
3767 OUTPUTTEXTH .305 ; "Future TTS" | |
314 | 3768 call word_processor |
3769 | |
3770 WIN_LEFT .97 | |
313 | 3771 WIN_TOP .194 |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3772 STRCPY "@" |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3773 GETCUSTOM8 d'58' |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3774 movwf lo |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3775 bsf leftbind |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3776 output_8 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3777 bcf leftbind |
323 | 3778 STRCAT_PRINT "': " |
313 | 3779 |
323 | 3780 WIN_LEFT .97+7*5 ; "@10':" is 5 chars long |
681 | 3781 call DISP_standard_color |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3782 lfsr FSR2,letter |
323 | 3783 |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3784 movff int_O_extra_ascenttime+0,lo |
313 | 3785 movff int_O_extra_ascenttime+1,hi |
3786 movf lo,W | |
323 | 3787 iorwf hi,W ; extra_ascenttime == 0 ? |
681 | 3788 bz DISP_show_@5_nodeco |
323 | 3789 movf lo,W ; extra_ascenttime == 0xFFFF ? |
3790 andwf hi,W | |
3791 incf WREG,w | |
681 | 3792 bz DISP_show_@5_wait |
323 | 3793 |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3794 bsf leftbind |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3795 output_16 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3796 bcf leftbind |
756 | 3797 STRCAT "' " ; From "none" to "1'" we need 2 trailing spaces |
3798 movff WREG,letter+3 ; limit to four chars | |
3799 STRCAT_PRINT "" | |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3800 return |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3801 |
681 | 3802 DISP_show_@5_nodeco: |
3803 DISP_show_@5_wait: | |
323 | 3804 STRCPY_PRINT "--- " |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3805 return |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3806 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
310
diff
changeset
|
3807 ;============================================================================= |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3808 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3809 compute_pscr_ppo2: |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3810 ; (Pressure[mbar]*char_I_O2_ratio)-(100-char_I_O2_ratio)*CF61*CF62*10 |
552 | 3811 movff char_I_O2_ratio,WREG |
3812 sublw .100 ; 100-char_I_O2_ratio -> WREG | |
3813 mullw .10 ; (100-char_I_O2_ratio)*10 -> PROD:2 | |
3814 movff PRODL,xA+0 | |
3815 movff PRODH,xA+1 | |
3816 GETCUSTOM8 d'62' ; O2 Drop | |
3817 movff WREG,xB+0 | |
3818 clrf xB+1 | |
3819 call mult16x16 ;xA*xB=xC -> (100-char_I_O2_ratio)*10*CF61 | |
3820 movff xC+0,xA+0 | |
3821 movff xC+1,xA+1 | |
3822 GETCUSTOM8 d'63' ; Lung ratio | |
3823 movff WREG,xB+0 | |
3824 clrf xB+1 | |
3825 call mult16x16 ;xA*xB=xC -> (100-char_I_O2_ratio)*10*CF61*CF62 | |
3826 | |
3827 movlw .10 | |
3828 movwf xB+0 | |
3829 clrf xB+1 | |
3830 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3831 ; store xC:2 in lo:hi | |
3832 movff xC+0,lo | |
3833 movff xC+1,hi | |
3834 | |
3835 SAFE_2BYTE_COPY amb_pressure, xA | |
3836 movff char_I_O2_ratio,xB+0 | |
3837 clrf xB+1 | |
3838 call mult16x16 ;xA*xB=xC -> xC:4 = Pressure[mbar]*char_I_O2_ratio | |
3839 | |
3840 movlw .10 | |
3841 movwf xB+0 | |
3842 clrf xB+1 | |
3843 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3844 | |
3845 ; store xC:2 in sub_a | |
3846 movff xC+0,sub_a+0 | |
3847 movff xC+1,sub_a+1 | |
3848 ; reload result from lo:hi | |
3849 movff lo,sub_b+0 | |
3850 movff hi,sub_b+1 | |
3851 | |
3852 call subU16 ;sub_c = sub_a - sub_b (with UNSIGNED values) | |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3853 return |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3854 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3855 ; Display pSCR ppO2 |
681 | 3856 DISP_show_pSCR_ppO2: |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3857 WIN_FONT FT_SMALL |
682 | 3858 WIN_LEFT .159-.63 ; 9 chars aligned right. |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3859 WIN_TOP .170 |
681 | 3860 call DISP_divemask_color ; Set Color for Divemode mask |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3861 lfsr FSR2,letter |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
587
diff
changeset
|
3862 OUTPUTTEXTH .266 ; "pSCR Info" |
762 | 3863 call word_processor |
552 | 3864 |
3865 WIN_FONT FT_SMALL | |
3866 WIN_LEFT .95 | |
3867 WIN_TOP .192 | |
3868 lfsr FSR2,letter | |
3869 STRCPY_PRINT TXT_PPO2_5 ; ppO2: | |
762 | 3870 rcall compute_pscr_ppo2 ; pSCR ppO2 into sub_c:2 |
552 | 3871 movff sub_c+0,xC+0 |
3872 movff sub_c+1,xC+1 | |
3873 clrf xC+2 | |
3874 clrf xC+3 ; For color coding | |
681 | 3875 DISP_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
552 | 3876 WIN_LEFT .130 |
3877 WIN_TOP .192 | |
762 | 3878 lfsr FSR2,letter |
3879 movff xC+0,lo | |
3880 movff xC+1,hi | |
552 | 3881 bsf ignore_digit4 |
3882 output_16dp d'1' | |
3883 bcf ignore_digit4 | |
762 | 3884 PUTC " " |
3885 movlw .0 | |
3886 movff WREG,letter+.4 ; Limit to 4chars | |
3887 STRCAT_PRINT "" | |
681 | 3888 call DISP_standard_color ; Back to white. |
552 | 3889 ; Show O2 drop and counter lung ration in second row |
3890 WIN_LEFT .98 | |
3891 WIN_TOP .216 | |
3892 lfsr FSR2,letter | |
3893 GETCUSTOM8 d'62' ; O2 Drop in percent | |
3894 movwf lo | |
3895 bsf leftbind | |
3896 output_8 | |
3897 STRCAT "% 1/" | |
3898 GETCUSTOM8 d'63' ; Counter lung ratio in 1/X | |
3899 movwf lo | |
3900 output_8 | |
3901 bcf leftbind | |
762 | 3902 PUTC " " |
3903 movlw .0 | |
3904 movff WREG,letter+.9 ; Limit to 9chars | |
3905 STRCAT_PRINT "" | |
552 | 3906 return |
3907 | |
3908 ;============================================================================= | |
476 | 3909 ; Display cave consomation prediction (and warning). |
3910 ; | |
681 | 3911 DISP_show_cave_bailout: |
476 | 3912 WIN_FONT FT_SMALL |
728 | 3913 WIN_LEFT .159-.69 ; 10 chars aligned right. |
476 | 3914 WIN_TOP .170 |
681 | 3915 call DISP_divemask_color ; Set Color for Divemode mask |
476 | 3916 lfsr FSR2,letter |
3917 | |
3918 OUTPUTTEXTH .311 ; "Cave Bail." | |
3919 call word_processor | |
3920 | |
3921 ; WIN_TOP .240 - 24 ; DO NOT display liter units, as this | |
3922 ; WIN_LEFT .160 - 7 ; can be Bars also... | |
3923 ; STRCPY_PRINT "l" | |
3924 | |
3925 WIN_FONT FT_MEDIUM | |
3926 WIN_LEFT .90 | |
3927 WIN_TOP .201 ; 170 + 24 + 14/2 + 32 + 14/2 = 240. | |
681 | 3928 call DISP_standard_color |
476 | 3929 lfsr FSR2,letter |
3930 | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
3931 ;---- Retrieve divetime in seconds (since last reset) |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
3932 movff average_divesecs+0,xA+0 |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
3933 movff average_divesecs+1,xA+1 |
476 | 3934 |
478
fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents:
476
diff
changeset
|
3935 ;---- Multiply by SAC, and divide by 60 (SAC inliters per minutes) |
476 | 3936 GETCUSTOM8 d'56' ; Get bottom SAC |
3937 movwf xB+0 | |
3938 clrf xB+1 | |
3939 call mult16x16 ; xC:4=xA:2*xB:2 | |
3940 | |
478
fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents:
476
diff
changeset
|
3941 movlw LOW(.60) |
476 | 3942 movwf xB+0 |
478
fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents:
476
diff
changeset
|
3943 movlw HIGH(.60) |
476 | 3944 movwf xB+1 |
3945 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3946 | |
3947 ;---- Multiply by average pressure [absolute, in bar] | |
3948 movff xC+0,xA+0 ; Get result (in xC+0, noy xC+2 !) into xA | |
3949 movff xC+1,xA+1 | |
3950 | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
3951 movf avr_rel_pressure+0,W ; Add surface pressure to get absolute pressure |
476 | 3952 addwf last_surfpressure_30min+0,W |
3953 movwf xB+0 | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
3954 movf avr_rel_pressure+1,W |
476 | 3955 addwfc last_surfpressure_30min+1,W |
3956 movwf xB+1 ; --> Into xB | |
3957 | |
3958 call mult16x16 ; xC:4=xA:2*xB:2 | |
3959 | |
3960 movlw LOW(.1000) ; Pressure was in milibar, so divide by 1000. | |
3961 movwf xB+0 | |
3962 movlw HIGH(.1000) | |
3963 movwf xB+1 | |
3964 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3965 | |
3966 ;---- Go RED when limit is exceeded | |
3967 movff xC+0,sub_a+0 | |
3968 movff xC+1,sub_a+1 | |
3969 GETCUSTOM15 d'59' ; Get Cave bailout alarm threshold | |
3970 movff lo, sub_b+0 | |
3971 movff hi, sub_b+1 | |
3972 call sub16 ; Computes prediction - limit | |
3973 btfss neg_flag ; Negativ ? | |
681 | 3974 call DISP_warnings_color ; NO: go RED. |
476 | 3975 |
3976 ;---- Then display... | |
3977 movff xC+0,lo | |
3978 movff xC+1,hi | |
3979 | |
3980 bcf leftbind | |
3981 output_16 | |
3982 call word_processor | |
3983 WIN_FONT FT_SMALL | |
3984 return | |
3985 | |
3986 ;============================================================================= | |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
256
diff
changeset
|
3987 |
681 | 3988 DISP_show_leading_tissue: |
3989 call DISP_divemask_color ; Set Color for Divemode mask | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
3990 DISPLAYTEXTH .282 ; L. Tissue: |
681 | 3991 DISP_show_leading_tissue_2: |
116 | 3992 call deco_calc_desaturation_time ; calculate desaturation time |
0 | 3993 movlb b'00000001' ; select ram bank 1 |
3994 | |
123 | 3995 STRCPY "#" |
0 | 3996 movff char_O_gtissue_no,lo |
3997 movff char_O_gtissue_no,wait_temp ; used as temp | |
3998 bsf leftbind | |
3999 output_8 | |
123 | 4000 STRCAT " (" |
0 | 4001 |
4002 movlw d'16' | |
4003 cpfslt wait_temp | |
681 | 4004 bra DISP_show_leading_tissue_he |
446 | 4005 STRCAT TXT_N2_2 |
681 | 4006 bra DISP_show_leading_tissue2 |
4007 | |
4008 DISP_show_leading_tissue_he: | |
446 | 4009 STRCAT TXT_HE2 |
123 | 4010 |
681 | 4011 DISP_show_leading_tissue2: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
4012 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
4013 WIN_TOP .192 |
0 | 4014 WIN_FONT FT_SMALL |
681 | 4015 call DISP_standard_color |
123 | 4016 |
4017 STRCAT_PRINT ") " | |
4018 | |
339 | 4019 lfsr FSR1,char_O_tissue_N2_saturation |
4020 movf wait_temp,W ; W <- 0-15 | |
4021 movff PLUSW1,lo ; lo <- FSR1[W] | |
123 | 4022 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
4023 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
4024 WIN_TOP .216 |
0 | 4025 WIN_FONT FT_SMALL |
123 | 4026 |
4027 lfsr FSR2,letter | |
4028 output_8 | |
4029 STRCAT_PRINT "% " | |
0 | 4030 bcf leftbind |
4031 return | |
4032 | |
681 | 4033 DISP_marker_set: |
674 | 4034 WIN_LEFT .105 |
4035 WIN_TOP .170 | |
4036 WIN_FONT FT_SMALL | |
4037 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 4038 call DISP_divemask_color ; Set Color for Divemode mask |
674 | 4039 SAFE_2BYTE_COPY marker_depth, lo |
4040 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] | |
4041 lfsr FSR2,letter | |
4042 bsf leftbind | |
4043 bsf ignore_digit5 ; do not display 1cm depth | |
4044 output_16dp d'3' | |
4045 PUTC TXT_METER_C | |
4046 bcf show_last3 | |
4047 call word_processor | |
4048 | |
4049 WIN_LEFT .105 | |
4050 WIN_TOP .192 | |
4051 WIN_INVERT .0 ; Init new Wordprocessor | |
4052 movff marker_time+0,lo | |
4053 movff marker_time+1,hi | |
4054 bsf leftbind | |
4055 lfsr FSR2,letter | |
4056 output_16_3 ; displays only last three figures from a 16Bit value (0-999) | |
4057 PUTC ':' | |
4058 movff marker_time+2,lo | |
4059 output_99x | |
4060 call word_processor | |
4061 bcf leftbind | |
681 | 4062 call DISP_standard_color |
674 | 4063 return |
4064 | |
681 | 4065 DISP_topline_box_clear: ; Writes an empty box |
0 | 4066 movlw .0 |
681 | 4067 bra DISP_topline_box2 |
4068 DISP_topline_box: ; Writes a filled box... | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
4069 GETCUSTOM8 d'35' ; ... with the standard color |
681 | 4070 DISP_topline_box2: |
123 | 4071 WIN_BOX_COLOR .0, .26, .0, .159 |
681 | 4072 call DISP_standard_color ; Reset to standard color in case of unreadable color |
0 | 4073 return |
4074 | |
681 | 4075 DISP_display_cns: |
0 | 4076 btfsc gauge_mode ; Do not display in gauge mode |
4077 return | |
4078 | |
4079 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
4080 return | |
4081 | |
681 | 4082 btfsc DISP_velocity_display ; Is velocity displayed?` |
4083 return ; Yes, do not overwrite until DISP_velocity_clear was called | |
0 | 4084 |
4085 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
4086 | |
4087 WIN_TOP .090 | |
4088 WIN_LEFT .0 | |
4089 WIN_FONT FT_SMALL | |
681 | 4090 DISP_color_code warn_cns ; Color-code CNS output |
0 | 4091 |
446 | 4092 STRCPY TXT_CNS4 |
0 | 4093 movff char_O_CNS_fraction,lo |
4094 bsf leftbind | |
4095 output_8 | |
4096 bcf leftbind | |
123 | 4097 STRCAT_PRINT "%" |
0 | 4098 return |
4099 | |
519 | 4100 ;----------------------------------------------------------------------------- |
4101 ; | |
681 | 4102 DISP_display_cns_surface: |
43 | 4103 ; Check if CNS should be displayed |
4104 movff char_O_CNS_fraction,lo ; copy into bank1 | |
4105 GETCUSTOM8 d'15' ; cns_display_high_surfacemode | |
4106 subwf lo,W | |
4107 btfss STATUS,C | |
4108 return ; Do not show... | |
4109 ; Show CNS | |
4110 | |
4111 ostc_debug 'W' ; Sends debug-information to screen if debugmode active | |
4112 | |
4113 WIN_TOP .175 | |
4114 WIN_LEFT .45 | |
4115 WIN_FONT FT_SMALL | |
4116 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 4117 DISP_color_code warn_cns ; Color-code CNS output |
43 | 4118 |
446 | 4119 STRCPY TXT_CNS4 |
43 | 4120 movff char_O_CNS_fraction,lo |
4121 bsf leftbind | |
4122 output_8 | |
4123 bcf leftbind | |
519 | 4124 STRCAT_PRINT "% " |
43 | 4125 return |
4126 | |
519 | 4127 ;----------------------------------------------------------------------------- |
4128 ; Display GF at furface, if > CF8. | |
4129 ; | |
681 | 4130 DISP_display_gf_surface: |
519 | 4131 movff char_O_gradient_factor,lo ; gradient factor |
4132 GETCUSTOM8 d'8' ; threshold for display | |
4133 cpfslt lo ; show value? | |
681 | 4134 bra DISP_display_gf_surf_1 ; YES: do it. |
519 | 4135 return |
4136 | |
681 | 4137 DISP_display_gf_surf_1: |
519 | 4138 WIN_TOP .175 |
4139 WIN_LEFT .45 | |
4140 WIN_FONT FT_SMALL | |
681 | 4141 DISP_color_code warn_gf ; Color-code Output |
519 | 4142 |
4143 STRCPY TXT_GF3 | |
4144 movff char_O_gradient_factor,lo ; gradient factor | |
4145 output_8 | |
4146 STRCAT_PRINT "% " | |
681 | 4147 goto DISP_standard_color |
519 | 4148 |
4149 ;----------------------------------------------------------------------------- | |
43 | 4150 |
681 | 4151 DISP_custom_text: |
0 | 4152 read_int_eeprom d'64' |
4153 movlw d'1' | |
4154 cpfseq EEDATA ; Custom text active? | |
681 | 4155 bra DISP_custom_text_serial ; No, show serial instead |
0 | 4156 WIN_TOP .200 |
62 | 4157 WIN_LEFT .0 |
0 | 4158 WIN_FONT FT_SMALL |
4159 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 4160 call DISP_divemask_color ; Set Color for Divemode mask |
0 | 4161 |
4162 lfsr FSR2,letter | |
4163 movlw d'64' | |
4164 movwf lo | |
4165 movlw d'24' | |
4166 movwf hi ; counter | |
4167 | |
681 | 4168 DISP_custom_text1: |
0 | 4169 incf lo,F |
681 | 4170 call DISP_get_custom_letter ; Get one letter for the custom text |
0 | 4171 movlw '}' ; End marker found? |
4172 cpfseq EEDATA | |
681 | 4173 bra DISP_custom_text2 ; No |
4174 bra DISP_custom_text3 | |
4175 DISP_custom_text2: | |
0 | 4176 movff EEDATA,POSTINC2 ; Copy into Postinc |
4177 | |
4178 decfsz hi,F ; Max. numbers? | |
681 | 4179 bra DISP_custom_text1 ; No, get next letters |
4180 | |
4181 DISP_custom_text3: | |
0 | 4182 call word_processor |
681 | 4183 call DISP_standard_color |
0 | 4184 return |
4185 | |
681 | 4186 DISP_get_custom_letter: |
0 | 4187 movff lo,EEADR ; Address for next custom text letter |
4188 call read_eeprom ; Read letter | |
4189 return | |
4190 | |
681 | 4191 DISP_custom_text_serial: |
0 | 4192 WIN_TOP .200 |
607 | 4193 WIN_LEFT .50 |
4194 WIN_FONT FT_SMALL | |
4195 WIN_INVERT .0 ; Init new Wordprocessor | |
681 | 4196 call DISP_divemask_color ; Set Color for Divemode mask |
607 | 4197 |
4198 lfsr FSR2,letter | |
4199 OUTPUTTEXTH d'262' ; "OSTC " | |
4200 clrf EEADRH | |
4201 clrf EEADR ; Get Serial number LOW | |
4202 call read_eeprom ; read byte | |
4203 movff EEDATA,lo | |
4204 incf EEADR,F ; Get Serial number HIGH | |
4205 call read_eeprom ; read byte | |
4206 movff EEDATA,hi | |
4207 bsf leftbind | |
4208 output_16 | |
4209 call word_processor | |
681 | 4210 call DISP_standard_color |
0 | 4211 return |
4212 | |
681 | 4213 DISP_simdata_screen: ;Display Pre-Dive Screen |
33 | 4214 ; List active gases/Setpoints |
4215 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
681 | 4216 bra DISP_simdata_screen3 ; Yes, display SetPoint/Sensor result list |
4217 | |
4218 DISP_simdata_screen2: | |
33 | 4219 ostc_debug 'm' ; Sends debug-information to screen if debugmode active |
4220 | |
4221 WIN_LEFT .0 | |
4222 WIN_FONT FT_SMALL | |
4223 bsf leftbind | |
4224 | |
4225 movlw d'2' | |
4226 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 4227 movlw d'10' |
33 | 4228 movwf waitms_temp ; here: stores row for gas list |
4229 clrf hi ; here: Gas counter | |
4230 | |
681 | 4231 DISP_simdata_screen2_loop: |
33 | 4232 incf hi,F ; Increase Gas |
4233 movlw d'4' | |
4234 addwf wait_temp,F ; Increase eeprom address for gas list | |
4235 | |
446 | 4236 STRCPY TXT_GAS1 |
33 | 4237 movff hi,lo ; copy gas number |
4238 output_8 ; display gas number | |
123 | 4239 PUTC ':' |
519 | 4240 movff wait_temp, EEADR ; Gas #hi: %O2 - Set address in internal EEPROM |
33 | 4241 call read_eeprom ; get byte (stored in EEDATA) |
4242 movff EEDATA,lo ; copy to lo | |
4243 output_8 ; outputs into Postinc2! | |
123 | 4244 PUTC '/' |
33 | 4245 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
4246 call read_eeprom ; get byte (stored in EEDATA) | |
4247 movff EEDATA,lo ; copy to lo | |
4248 output_8 ; outputs into Postinc2! | |
123 | 4249 PUTC ' ' |
34 | 4250 movf hi,W ; Gas number |
4251 addlw d'27' ; -> Adress of change depth register | |
4252 call read_int_eeprom_1 | |
4253 movff EEDATA,lo ; Change depth in m | |
223 | 4254 movff lo,divemins ; Store for grey-out |
34 | 4255 output_99 ; outputs into Postinc2! |
446 | 4256 PUTC TXT_METER_C |
223 | 4257 |
4258 ; Check if gas is first gas ? | |
4259 read_int_eeprom d'33' ; First gas (1-5)? | |
4260 movf hi,W ; Current gas in WREG | |
4261 cpfseq EEDATA ; Is equal first gas? | |
681 | 4262 bra DISP_simdata_screen2_loop2 ; No : more tests... |
4263 | |
4264 bra DISP_simdata_white ; Yes | |
4265 | |
4266 DISP_simdata_screen2_loop2: | |
223 | 4267 ; Check if gas is inactive ? |
4268 read_int_eeprom d'27' ; read flag register | |
4269 movff hi,lo ; copy gas number | |
681 | 4270 DISP_simdata_screen2_loop1: |
223 | 4271 rrcf EEDATA ; roll flags into carry |
4272 decfsz lo,F ; max. 5 times... | |
681 | 4273 bra DISP_simdata_screen2_loop1 |
181 | 4274 |
223 | 4275 btfss STATUS,C ; test inactive flag |
681 | 4276 bra DISP_simdata_grey ; Is inactive! |
223 | 4277 |
4278 tstfsz divemins ; Test change depth=0? | |
681 | 4279 bra DISP_simdata_white ; Is not zero |
4280 | |
4281 DISP_simdata_grey: | |
587
1b021a280e15
NEW CF64: Configures color for inactive gases
heinrichsweikamp
parents:
576
diff
changeset
|
4282 GETCUSTOM8 d'64' ;movlw color_grey |
681 | 4283 call DISP_set_color ; grey out inactive gases! |
4284 bra DISP_simdata_color_done | |
4285 | |
4286 DISP_simdata_white: | |
4287 call DISP_standard_color | |
4288 | |
4289 DISP_simdata_color_done: | |
33 | 4290 movlw d'25' |
4291 addwf waitms_temp,F ; Increase row | |
4292 WIN_LEFT .0 | |
4293 movff waitms_temp,win_top ; Set Row | |
34 | 4294 call word_processor ; display gas |
33 | 4295 |
681 | 4296 DISP_simdata_screen2b: |
4297 call DISP_standard_color | |
33 | 4298 |
34 | 4299 movlw d'5' ; list all five gases |
33 | 4300 cpfseq hi ; All gases shown? |
681 | 4301 bra DISP_simdata_screen2_loop ; No |
33 | 4302 |
4303 return ; No, return (OC mode) | |
4304 | |
681 | 4305 DISP_simdata_screen3: |
33 | 4306 WIN_LEFT .0 |
4307 WIN_FONT FT_SMALL | |
4308 bsf leftbind | |
4309 | |
4310 ; list three SP in Gaslist | |
4311 movlw d'35' ; 36 = current SP position in EEPROM | |
4312 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 4313 movlw d'10' |
33 | 4314 movwf waitms_temp ; here: stores row for gas list |
124 | 4315 clrf decoplan_index ; here: SP counter |
33 | 4316 |
681 | 4317 DISP_simdata_screen3_loop: |
33 | 4318 incf wait_temp,F ; EEPROM address |
124 | 4319 incf decoplan_index,F ; Increase SP |
33 | 4320 |
4321 movlw d'25' | |
4322 addwf waitms_temp,F ; Increase row | |
4323 WIN_LEFT .0 | |
4324 movff waitms_temp,win_top ; Set Row | |
4325 | |
446 | 4326 STRCPY TXT_SP2 |
124 | 4327 movff decoplan_index,lo ; copy gas number |
33 | 4328 output_8 ; display gas number |
123 | 4329 STRCAT ": " |
33 | 4330 movff wait_temp, EEADR; SP #hi position |
4331 call read_eeprom ; get byte (stored in EEDATA) | |
4332 movff EEDATA,lo ; copy to lo | |
4333 clrf hi | |
4334 output_16dp d'3' ; outputs into Postinc2! | |
4335 call word_processor | |
4336 | |
4337 movlw d'3' ; list all three SP | |
124 | 4338 cpfseq decoplan_index ; All gases shown? |
681 | 4339 bra DISP_simdata_screen3_loop ;no |
33 | 4340 |
657
8dd730d3a5d7
show first diluent in simulator result screen (Instead of first gas)
heinrichsweikamp
parents:
655
diff
changeset
|
4341 ; Show Diluent |
8dd730d3a5d7
show first diluent in simulator result screen (Instead of first gas)
heinrichsweikamp
parents:
655
diff
changeset
|
4342 call get_first_diluent ; Read first diluent into lo(O2) and hi(He) |
33 | 4343 WIN_LEFT .0 |
34 | 4344 WIN_TOP .110 |
446 | 4345 STRCPY TXT_DIL4 |
33 | 4346 output_8 ; O2 Ratio |
123 | 4347 STRCAT "/" |
33 | 4348 movff hi,lo |
4349 output_8 ; He Ratio | |
4350 call word_processor | |
4351 | |
4352 bcf leftbind | |
4353 return ; Return (CC Mode) | |
4354 | |
398
ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents:
396
diff
changeset
|
4355 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mbar] |
0 | 4356 |
4357 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
4358 return | |
4359 | |
4360 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
4361 movff EEDATA, wait_temp ; salinity | |
4362 | |
4363 movlw d'105' ; 105% ? | |
4364 cpfslt wait_temp ; Salinity higher limit | |
4365 return ; Out of limit, do not adjust lo:hi | |
4366 | |
4367 movlw d'99' ; 99% ? | |
4368 cpfsgt wait_temp ; Salinity lower limit | |
4369 return ; Out of limit, do not adjust lo:hi | |
4370 | |
4371 movff lo,xA+0 | |
4372 movff hi,xA+1 | |
4373 | |
419
e671d2018e0f
0.98bar equal 10m depths with salinity set to 1.00kg/l
heinrichsweikamp
parents:
417
diff
changeset
|
4374 movlw d'102' ; 0,98bar/10m |
0 | 4375 movwf xB+0 |
4376 clrf xB+1 | |
4377 | |
4378 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
4379 | |
4380 movff wait_temp,xB+0 ; Salinity | |
4381 clrf xB+1 | |
4382 | |
4383 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
4384 | |
4385 movff xC+0,lo | |
4386 movff xC+1,hi ; restore lo and hi with updated value | |
4387 | |
517 | 4388 return |