Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 142:8b75ba28d641
Screen-flipping custom function.
- Fix bank safe addressings.
author | JeanDo |
---|---|
date | Fri, 07 Jan 2011 03:01:02 +0100 |
parents | 622da16b768f |
children | e82e0df6d0ea |
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 | |
9 | 31 PLED_divemask_color: |
25 | 32 GETCUSTOM8 d'36' ; Divemask output color |
29 | 33 bra PLED_standard_color_0 |
9 | 34 |
25 | 35 PLED_warnings_color: |
36 GETCUSTOM8 d'37' ; Warnings output color | |
29 | 37 bra PLED_standard_color_0 |
38 | |
39 PLED_standard_color: | |
40 GETCUSTOM8 d'35' ; Standard output color | |
41 PLED_standard_color_0: ; Common entry point | |
42 movwf oled1_temp ; copy | |
43 movlw d'0' | |
44 cpfseq oled1_temp | |
45 bra PLED_standard_color_1 | |
46 bra PLED_standard_color2 | |
47 PLED_standard_color_1: | |
48 movlw d'4' | |
49 cpfseq oled1_temp | |
50 bra PLED_standard_color_2 | |
51 bra PLED_standard_color2 | |
52 PLED_standard_color_2: | |
53 movlw d'8' | |
54 cpfseq oled1_temp | |
55 bra PLED_standard_color_3 | |
56 bra PLED_standard_color2 | |
57 PLED_standard_color_3: | |
58 movlw d'192' | |
59 cpfseq oled1_temp | |
60 bra PLED_standard_color_4 | |
61 bra PLED_standard_color2 | |
62 PLED_standard_color_4: | |
63 movlw d'196' | |
64 cpfseq oled1_temp | |
65 bra PLED_standard_color_5 | |
66 bra PLED_standard_color2 | |
67 PLED_standard_color_5: | |
68 movlw d'200' | |
69 cpfseq oled1_temp | |
70 bra PLED_standard_color_6 | |
71 bra PLED_standard_color2 | |
72 PLED_standard_color_6: | |
73 movf oled1_temp,W ; Color should be OK... | |
74 call PLED_set_color | |
75 return | |
76 PLED_standard_color2: | |
77 | 77 movlw 0xFF ; Force full white. |
25 | 78 call PLED_set_color |
79 return | |
3 | 80 |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
81 PLED_color_code macro color_code_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
82 movlw color_code_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
83 call PLED_color_code1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
84 endm |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
85 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
86 PLED_color_code1: ; Color-codes the output, if required |
142 | 87 dcfsnz WREG |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
88 bra PLED_color_code_depth ; CF43 [mBar], 16Bit |
142 | 89 dcfsnz WREG |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
90 bra PLED_color_code_cns ; CF44 [%] |
142 | 91 dcfsnz WREG |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
92 bra PLED_color_code_gf ; CF45 [%] |
142 | 93 dcfsnz WREG |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
94 bra PLED_color_code_ppo2 ; CF46 [cBar] |
142 | 95 dcfsnz WREG |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
96 bra PLED_color_code_velocity ; CF47 [m/min] |
142 | 97 dcfsnz WREG |
69 | 98 bra PLED_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling |
142 | 99 dcfsnz WREG |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
100 bra PLED_color_code_gaslist ; Color-code current row in Gaslist (%O2 in "EEDATA") |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
101 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
102 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
103 PLED_color_code_gaslist: ; %O2 in "EEDATA" |
74 | 104 ; Check very high ppO2 manually |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
105 movff amb_pressure+0,xA+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
106 movff amb_pressure+1,xA+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
107 movlw d'10' |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
108 movwf xB+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
109 clrf xB+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
110 call div16x16 ; xC=p_amb/10 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
111 movff xC+0,xA+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
112 movff xC+1,xA+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
113 movff EEDATA,xB+0 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
114 clrf xB+1 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
115 call mult16x16 ; EEDATA * p_amb/10 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
116 |
74 | 117 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? |
118 bra PLED_color_code_gaslist1 ; Yes, warn in warning color | |
119 | |
120 movff xC+0,sub_a+0 | |
121 movff xC+1,sub_a+1 | |
122 GETCUSTOM8 d'46' ; color-code ppO2 warning [cBar] | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
123 mullw d'100' ; ppo2_warning_high*100 |
74 | 124 movff PRODL,sub_b+0 |
125 movff PRODH,sub_b+1 | |
126 call sub16 ; sub_c = sub_a - sub_b | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
127 btfss neg_flag |
74 | 128 bra PLED_color_code_gaslist1; too high -> Warning Color! |
129 call PLED_standard_color | |
130 return | |
131 | |
132 PLED_color_code_gaslist1: | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
133 call PLED_warnings_color |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
134 return |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
135 |
69 | 136 |
137 PLED_color_code_ceiling: | |
138 GETCUSTOM8 d'40' ; =1: Warn at all? | |
139 movwf lo | |
140 movlw d'1' | |
141 cpfseq lo ; =1? | |
142 bra PLED_color_code_ceiling1 ; No, Set to default color | |
143 | |
144 movff char_O_array_decodepth+0,lo ; Ceiling in m | |
145 decf lo,F ; -1 | |
146 movff rel_pressure+1,xA+1 | |
147 movff rel_pressure+0,xA+0 | |
148 movlw LOW d'100' | |
149 movwf xB+0 | |
150 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m | |
151 call div16x16 ; xA/xB=xC with xA as remainder | |
152 movf xC+0,W ; Depth in m | |
153 subwf lo,W | |
154 btfsc STATUS,C | |
155 bra PLED_color_code_ceiling2 ; Set to warning color | |
156 PLED_color_code_ceiling1: | |
157 call PLED_standard_color | |
158 return | |
159 PLED_color_code_ceiling2: | |
160 call PLED_warnings_color | |
161 return | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
162 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
163 PLED_color_code_depth: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
164 movff hi,hi_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
165 movff lo,lo_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
166 movff rel_pressure+1,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
167 movff rel_pressure+0,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
168 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
169 movff lo,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
170 movff hi,sub_a+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
171 GETCUSTOM15 d'43' ; Depth warn [mBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
172 movff lo,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
173 movff hi,sub_b+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
174 call sub16 ; sub_c = sub_a - sub_b |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
175 btfss neg_flag |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
176 bra PLED_color_code_depth2; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
177 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
178 movff hi_temp,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
179 movff lo_temp,lo ; Restore hi, lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
180 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
181 PLED_color_code_depth2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
182 call PLED_warnings_color |
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 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
186 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
187 PLED_color_code_cns: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
188 movff char_O_CNS_fraction,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
189 GETCUSTOM8 d'44' ; CNS Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
190 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
191 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
192 bra PLED_color_code_cns2 ; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
193 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
194 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
195 PLED_color_code_cns2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
196 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
197 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
198 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
199 PLED_color_code_gf: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
200 movff char_O_gradient_factor,lo ; gradient factor |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
201 GETCUSTOM8 d'45' ; GF Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
202 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
203 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
204 bra PLED_color_code_gf2 ; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
205 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
206 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
207 PLED_color_code_gf2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
208 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
209 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
210 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
211 PLED_color_code_ppo2: |
74 | 212 ; Check very high ppO2 manually |
213 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? | |
214 bra PLED_color_code_ppo22 ; Yes, warn in warning color | |
215 | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
216 movff xC+0,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
217 movff xC+1,sub_a+1 |
74 | 218 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
|
219 mullw d'100' |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
220 movff PRODL,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
221 movff PRODH,sub_b+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
222 call sub16 ; sub_c = sub_a - sub_b |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
223 btfss neg_flag |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
224 bra PLED_color_code_ppo22; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
225 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
226 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
227 PLED_color_code_ppo22: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
228 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
229 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
230 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
231 PLED_color_code_velocity: |
47 | 232 btfss neg_flag ; Ignore for ascend! |
233 bra PLED_color_code_velocity1 ; Skip check! | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
234 movff divA+0,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
235 GETCUSTOM8 d'47' ; Velocity warn [m/min] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
236 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
237 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
238 bra PLED_color_code_velocity2 ; Set to warning color |
47 | 239 PLED_color_code_velocity1: |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
240 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
241 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
242 PLED_color_code_velocity2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
243 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
244 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
245 |
142 | 246 ostc_debug macro value |
247 movlw value | |
0 | 248 call ostc_debug1 |
249 endm | |
250 | |
251 ostc_debug1: | |
252 movff debug_char+4,debug_char+5 ; Save for background debugger | |
253 movff debug_char+3,debug_char+4 | |
254 movff debug_char+2,debug_char+3 | |
255 movff debug_char+1,debug_char+2 | |
256 movff debug_char+0,debug_char+1 | |
142 | 257 movff WREG,debug_char+0 |
0 | 258 |
259 btfss debug_mode ; Are we in debugmode? | |
260 return ; No, return! | |
261 | |
262 WIN_TOP .200 | |
263 WIN_LEFT .100 | |
264 WIN_FONT FT_SMALL | |
265 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 266 call PLED_standard_color |
0 | 267 lfsr FSR2,letter |
268 movf debug_char+0,W | |
269 movwf POSTINC2 | |
270 movf debug_char+1,W | |
271 movwf POSTINC2 | |
272 movf debug_char+2,W | |
273 movwf POSTINC2 | |
274 movf debug_char+3,W | |
275 movwf POSTINC2 | |
276 movf debug_char+4,W | |
277 movwf POSTINC2 | |
278 movf debug_char+5,W | |
279 movwf POSTINC2 | |
123 | 280 |
281 STRCAT_PRINT " " | |
0 | 282 return |
283 | |
284 | |
285 PLED_resetdebugger: | |
286 call PLED_boot ; PLED boot | |
287 call PLED_ClearScreen ; clean up OLED | |
3 | 288 call PLED_standard_color |
47 | 289 WIN_INVERT .0 ; Init new Wordprocessor |
0 | 290 |
291 DISPLAYTEXT .133 | |
292 DISPLAYTEXT .134 | |
293 DISPLAYTEXT .135 | |
294 DISPLAYTEXT .136 ; Display Debug intro | |
295 | |
296 WIN_TOP .100 | |
297 WIN_LEFT .10 | |
298 WIN_FONT FT_SMALL | |
299 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 300 call PLED_standard_color |
0 | 301 lfsr FSR2,letter |
119 | 302 movff temp10,lo |
303 output_8 | |
304 movlw ' ' | |
305 movwf POSTINC2 | |
0 | 306 movf debug_char+0,W |
307 movwf POSTINC2 | |
308 movf debug_char+1,W | |
309 movwf POSTINC2 | |
310 movf debug_char+2,W | |
311 movwf POSTINC2 | |
312 movf debug_char+3,W | |
313 movwf POSTINC2 | |
314 movf debug_char+4,W | |
315 movwf POSTINC2 | |
316 movf debug_char+5,W | |
317 movwf POSTINC2 | |
123 | 318 STRCAT ". " |
0 | 319 movff flag1,lo |
320 output_8 | |
123 | 321 PUTC ' ' |
0 | 322 movff flag2,lo |
323 output_8 | |
324 call word_processor | |
325 | |
326 WIN_TOP .125 | |
327 WIN_LEFT .10 | |
328 WIN_FONT FT_SMALL | |
329 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 330 call PLED_standard_color |
0 | 331 |
332 lfsr FSR2,letter | |
333 movff flag3,lo | |
334 output_8 | |
123 | 335 PUTC ' ' |
0 | 336 movff flag4,lo |
337 output_8 | |
123 | 338 PUTC ' ' |
0 | 339 movff flag5,lo |
340 output_8 | |
123 | 341 PUTC ' ' |
0 | 342 movff flag6,lo |
343 output_8 | |
123 | 344 PUTC ' ' |
0 | 345 movff flag7,lo |
346 output_8 | |
347 call word_processor | |
348 | |
349 WIN_TOP .150 | |
350 WIN_LEFT .10 | |
351 WIN_FONT FT_SMALL | |
352 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 353 call PLED_standard_color |
0 | 354 |
355 lfsr FSR2,letter | |
356 movff flag8,lo | |
357 output_8 | |
123 | 358 PUTC ' ' |
0 | 359 movff flag9,lo |
360 output_8 | |
123 | 361 PUTC ' ' |
0 | 362 movff flag10,lo |
363 output_8 | |
123 | 364 PUTC ' ' |
0 | 365 movff flag11,lo |
366 output_8 | |
123 | 367 PUTC ' ' |
0 | 368 movff flag12,lo |
369 output_8 | |
370 call word_processor | |
371 | |
119 | 372 bcf switch_left |
0 | 373 PLED_resetdebugger_loop: |
374 btfss switch_left | |
375 bra PLED_resetdebugger_loop ; Loop | |
376 return | |
377 | |
378 PLED_divemode_mask: ; Displays mask in Dive-Mode | |
9 | 379 call PLED_divemask_color ; Set Color for Divemode mask |
75 | 380 DISPLAYTEXTH .267 ; Max. |
0 | 381 DISPLAYTEXT .86 ; Divetime |
382 DISPLAYTEXT .87 ; Depth | |
3 | 383 call PLED_standard_color |
0 | 384 return |
385 | |
87 | 386 PLED_clear_customview_divemode: |
123 | 387 WIN_BOX_BLACK .168, .239, .90, .159 |
87 | 388 return |
389 | |
115 | 390 PLED_clear_customview_surfmode: |
123 | 391 WIN_BOX_BLACK .25, .121, .82, .159 |
107 | 392 return |
393 | |
87 | 394 PLED_clear_decoarea: |
123 | 395 WIN_BOX_BLACK .54, .168, .90, .159 |
0 | 396 return |
397 | |
398 PLED_display_ndl_mask: | |
399 ; Clear Dekostop and Dekosum | |
400 rcall PLED_clear_decoarea | |
401 | |
87 | 402 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 403 DISPLAYTEXT d'84' ; NoStop |
3 | 404 call PLED_standard_color |
0 | 405 |
406 PLED_display_ndl_mask2: | |
407 ; Clears Gradient Factor | |
408 movlw d'8' | |
409 movwf temp1 | |
410 WIN_TOP .145 | |
411 WIN_LEFT .0 | |
412 call PLED_display_clear_common_y1 | |
413 return | |
414 | |
415 PLED_display_ndl: | |
87 | 416 btfsc menubit ; Divemode menu active? |
417 return ; Yes, return | |
0 | 418 |
419 ostc_debug 'z' ; Sends debug-information to screen if debugmode active | |
420 | |
87 | 421 WIN_TOP .136 |
0 | 422 WIN_LEFT .119 |
423 WIN_FONT FT_MEDIUM | |
424 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 425 call PLED_standard_color |
426 | |
0 | 427 lfsr FSR2,letter |
428 movff char_O_nullzeit,lo ; NDL in minutes | |
429 output_8 | |
123 | 430 STRCAT_PRINT "'" |
431 | |
0 | 432 WIN_FONT FT_SMALL |
433 return | |
434 | |
435 PLED_display_deko_mask: | |
124 | 436 rcall PLED_clear_decoarea |
437 ; total deco time word | |
438 call PLED_divemask_color ; Set Color for Divemode mask | |
439 DISPLAYTEXT d'85' ; TTS | |
440 call PLED_standard_color | |
441 return | |
0 | 442 |
443 PLED_display_deko: | |
444 btfsc menubit ; Divemode menu active? | |
87 | 445 bra PLED_display_deko1 ; Yes, do not display deco, only GF (if required) |
0 | 446 |
447 ostc_debug 'y' ; Sends debug-information to screen if debugmode active | |
448 ; deco stop word | |
9 | 449 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 450 DISPLAYTEXT d'82' ; DEKOSTOP |
3 | 451 call PLED_standard_color |
0 | 452 |
87 | 453 WIN_TOP .80 |
0 | 454 WIN_LEFT .94 |
455 WIN_FONT FT_MEDIUM | |
456 WIN_INVERT .0 ; Init new Wordprocessor | |
69 | 457 PLED_color_code warn_ceiling ; Color-code Output |
0 | 458 lfsr FSR2,letter |
459 movff char_O_array_decodepth+0,lo ; Ceiling in m | |
460 output_99 | |
123 | 461 PUTC 'm' |
0 | 462 movff char_O_array_decotime,lo ; length of first stop in m |
463 output_99 | |
123 | 464 STRCAT_PRINT "'" |
0 | 465 WIN_FONT FT_SMALL |
466 | |
87 | 467 ;PLED_display_deko1: |
0 | 468 ostc_debug 'x' ; Sends debug-information to screen if debugmode active |
469 | |
87 | 470 WIN_TOP .136 |
0 | 471 WIN_LEFT .119 |
472 WIN_FONT FT_MEDIUM | |
473 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 474 call PLED_standard_color |
0 | 475 lfsr FSR2,letter |
476 movff char_O_ascenttime,lo ; complete ascend time | |
477 movlw d'199' ; limit display of total ascend time to 99mins.... | |
478 cpfslt lo ; skip if 199 (WREG) > lo | |
479 movwf lo | |
480 bcf leftbind | |
481 output_8 | |
123 | 482 STRCAT_PRINT "'" |
0 | 483 |
87 | 484 PLED_display_deko1: |
0 | 485 movff char_O_gradient_factor,lo ; gradient factor |
486 GETCUSTOM8 d'8' ; threshold for display | |
487 cpfslt lo ; show value? | |
488 bra PLED_display_deko2 ; Yes | |
489 ; No | |
490 bra PLED_display_ndl_mask2 ; Clear gradient factor | |
491 | |
492 PLED_display_deko2: | |
493 ostc_debug 'w' ; Sends debug-information to screen if debugmode active | |
494 ;GF | |
495 WIN_TOP .145 | |
496 WIN_LEFT .0 | |
497 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
498 PLED_color_code warn_gf ; Color-code Output |
123 | 499 |
500 STRCPY "GF:" | |
0 | 501 movff char_O_gradient_factor,lo ; gradient factor |
502 output_8 | |
123 | 503 STRCAT_PRINT "% " |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
504 call PLED_standard_color |
0 | 505 return |
506 | |
507 PLED_simulator_data: | |
508 WIN_TOP .65 | |
509 WIN_LEFT .105 | |
510 WIN_FONT FT_SMALL | |
3 | 511 call PLED_standard_color |
0 | 512 lfsr FSR2,letter |
513 movff logbook_temp1,lo | |
514 bsf leftbind | |
515 output_8 | |
516 bcf leftbind | |
123 | 517 STRCAT_PRINT "min " |
0 | 518 |
519 WIN_TOP .95 | |
520 WIN_LEFT .100 | |
521 WIN_FONT FT_SMALL | |
3 | 522 call PLED_standard_color |
0 | 523 lfsr FSR2,letter |
524 movff logbook_temp2,lo | |
525 bsf leftbind | |
526 output_8 | |
527 bcf leftbind | |
123 | 528 STRCAT_PRINT "m " |
0 | 529 return |
530 | |
531 PLED_display_velocity: | |
532 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
533 return ; Yes, No update and return! | |
534 | |
535 ostc_debug 'v' ; Sends debug-information to screen if debugmode active | |
536 WIN_TOP .90 | |
537 WIN_LEFT .0 | |
538 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
539 PLED_color_code warn_velocity ; Color code output |
0 | 540 lfsr FSR2,letter |
541 movlw '-' | |
542 btfsc neg_flag | |
543 movlw '+' | |
544 movwf POSTINC2 | |
545 movff divA+0,lo | |
546 output_99 | |
547 OUTPUTTEXT d'83' ; m/min | |
548 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
549 call PLED_standard_color |
0 | 550 bsf pled_velocity_display |
551 return | |
552 | |
553 PLED_display_velocity_clear: | |
554 movlw d'8' | |
555 movwf temp1 | |
556 WIN_TOP .90 | |
557 WIN_LEFT .0 | |
558 bcf pled_velocity_display | |
559 bra PLED_display_clear_common_y1 | |
560 | |
561 PLED_display_wait_clear | |
562 movlw d'6' | |
563 movwf temp1 | |
564 WIN_TOP .2 | |
565 WIN_LEFT .115 | |
566 bra PLED_display_clear_common_y1 | |
567 | |
568 PLED_display_clear_common_y2: ; Clears with y-scale=2 | |
569 WIN_FONT FT_MEDIUM | |
570 bra PLED_display_clear_common1 | |
571 | |
572 PLED_display_clear_common_y1: ; Clears with y-scale=1 | |
573 WIN_FONT FT_SMALL | |
574 PLED_display_clear_common1: | |
575 lfsr FSR2,letter | |
576 PLED_display_clear_common2: | |
123 | 577 PUTC ' ' |
0 | 578 decfsz temp1,F |
579 bra PLED_display_clear_common2 | |
580 call word_processor | |
581 WIN_FONT FT_SMALL | |
582 return | |
583 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
584 |
63 | 585 PLED_diveclock: |
119 | 586 call PLED_divemask_color ; Set Color for Divemode mask |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
587 DISPLAYTEXT d'255' ; Clock |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
588 call PLED_standard_color |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
589 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
590 PLED_diveclock2: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
591 WIN_TOP .192 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
592 WIN_LEFT .123 |
63 | 593 WIN_FONT FT_SMALL |
594 WIN_INVERT .0 ; Init new Wordprocessor | |
595 call PLED_standard_color | |
596 lfsr FSR2,letter | |
597 movff hours,lo | |
598 output_99x | |
123 | 599 PUTC ':' |
63 | 600 movff mins,lo |
601 output_99x | |
602 call word_processor | |
603 return | |
604 | |
0 | 605 PLED_clock: |
606 ostc_debug 'c' | |
607 WIN_TOP .50 | |
56 | 608 WIN_LEFT .1 |
0 | 609 WIN_FONT FT_SMALL |
610 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 611 call PLED_standard_color |
0 | 612 lfsr FSR2,letter |
613 movff hours,lo | |
614 output_99x | |
123 | 615 PUTC ':' |
0 | 616 movff mins,lo |
617 output_99x | |
123 | 618 PUTC ':' |
0 | 619 movff secs,lo |
620 output_99x | |
123 | 621 STRCAT_PRINT " " |
0 | 622 return |
623 | |
111 | 624 PLED_interval: |
625 WIN_TOP .75 | |
626 WIN_LEFT .90 | |
627 WIN_FONT FT_SMALL | |
628 WIN_INVERT .0 ; Init new Wordprocessor | |
629 call PLED_standard_color | |
630 lfsr FSR2,letter | |
631 | |
632 movff surface_interval+0,lo | |
633 movff surface_interval+1,hi | |
634 call convert_time ; lo=mins, hi=hours | |
635 | |
636 movf hi,W | |
637 movff lo,hi | |
638 movwf lo ; exchange lo and hi | |
639 output_99x | |
123 | 640 PUTC ':' |
111 | 641 movff hi,lo |
642 output_99x | |
123 | 643 STRCAT_PRINT " " |
111 | 644 return |
645 | |
646 | |
647 PLED_show_cf11_cf12_cf29:; Display saturations/desaturation multiplier and last deco in the customview field | |
648 WIN_TOP .25 | |
649 WIN_LEFT .90 | |
650 WIN_FONT FT_SMALL | |
651 WIN_INVERT .0 ; Init new Wordprocessor | |
652 call PLED_standard_color | |
123 | 653 STRCPY "CF11:" |
654 | |
111 | 655 GETCUSTOM8 d'11' |
656 movwf lo | |
657 bsf leftbind | |
658 output_8 | |
123 | 659 STRCAT_PRINT "%" |
111 | 660 |
661 WIN_TOP .50 | |
123 | 662 STRCPY "CF12:" |
663 | |
111 | 664 GETCUSTOM8 d'12' |
665 movwf lo | |
666 bsf leftbind | |
667 output_8 | |
123 | 668 STRCAT_PRINT "%" |
111 | 669 |
670 PLED_show_cf11_cf12_cf29_2: | |
671 WIN_TOP .75 | |
123 | 672 STRCPY "CF29:" |
111 | 673 GETCUSTOM8 d'29' |
674 movwf lo | |
675 bsf leftbind | |
676 output_8 | |
123 | 677 STRCAT_PRINT "m" |
678 | |
111 | 679 bcf leftbind |
680 return | |
681 | |
682 PLED_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field | |
683 WIN_TOP .25 | |
684 WIN_LEFT .90 | |
685 WIN_FONT FT_SMALL | |
686 WIN_INVERT .0 ; Init new Wordprocessor | |
687 call PLED_standard_color | |
688 GETCUSTOM8 d'32' | |
689 movwf lo | |
123 | 690 |
691 STRCPY "GF_lo:" | |
111 | 692 bsf leftbind |
693 output_8 | |
123 | 694 STRCAT_PRINT "%" |
111 | 695 |
696 WIN_TOP .50 | |
697 GETCUSTOM8 d'33' | |
698 movwf lo | |
123 | 699 STRCPY "GF_hi:" |
111 | 700 bsf leftbind |
701 output_8 | |
123 | 702 STRCAT_PRINT "%" |
111 | 703 |
704 bra PLED_show_cf11_cf12_cf29_2 ; Display CF29 in the third row and RETURN | |
705 | |
706 | |
0 | 707 PLED_logbook_cursor: |
708 | |
709 PLED_menu_cursor: | |
123 | 710 WIN_BOX_BLACK .35, .239, .0, .16 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
711 |
0 | 712 WIN_LEFT .0 |
713 WIN_FONT FT_SMALL | |
714 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 715 call PLED_standard_color |
716 | |
0 | 717 movff menupos,temp1 |
718 dcfsnz temp1,F | |
719 movlw d'35' | |
720 dcfsnz temp1,F | |
721 movlw d'65' | |
722 dcfsnz temp1,F | |
723 movlw d'95' | |
724 dcfsnz temp1,F | |
725 movlw d'125' | |
726 dcfsnz temp1,F | |
727 movlw d'155' | |
728 dcfsnz temp1,F | |
729 movlw d'185' | |
730 | |
731 movff WREG,win_top | |
123 | 732 STRCPY_PRINT "\xB7" |
0 | 733 return |
734 | |
735 PLED_menu_mask: | |
736 call PLED_topline_box | |
737 WIN_INVERT .1 ; Init new Wordprocessor | |
738 DISPLAYTEXT .5 ; Menu: | |
739 WIN_INVERT .0 ; Init new Wordprocessor | |
740 DISPLAYTEXT .6 ; Logbook | |
741 DISPLAYTEXT .7 ; Gas Setup | |
742 DISPLAYTEXT .9 ; Reset all | |
743 DISPLAYTEXT .10 ; Setup... | |
744 DISPLAYTEXT .142 ; More... | |
745 DISPLAYTEXT .11 ; Exit | |
746 return | |
747 | |
748 PLED_setup_menu_mask: | |
749 call PLED_topline_box | |
750 WIN_INVERT .1 ; Init new Wordprocessor | |
751 DISPLAYTEXT .98 ; Setup Menu: | |
752 WIN_INVERT .0 ; Init new Wordprocessor | |
753 DISPLAYTEXT .99 ; Custom FunctionsI | |
754 DISPLAYTEXT .153 ; Custom FunctionsII | |
755 DISPLAYTEXTH .276 ; Salinity: | |
756 DISPLAYTEXT .100 ; Decotype: | |
757 DISPLAYTEXT .142 ; More... | |
758 DISPLAYTEXT .11 ; Exit | |
759 return | |
760 | |
761 PLED_more_setup_menu_mask: | |
762 call PLED_topline_box | |
763 WIN_INVERT .1 ; Init new Wordprocessor | |
764 DISPLAYTEXTH .258 ; Setup Menu 2: | |
765 WIN_INVERT .0 ; Init new Wordprocessor | |
766 DISPLAYTEXTH .257 ; Date format: | |
767 DISPLAYTEXT .129 ; Debug: | |
12 | 768 DISPLAYTEXT .187 ; Show License |
0 | 769 |
770 DISPLAYTEXT .11 ; Exit | |
771 return | |
772 | |
773 PLED_more_menu_mask: | |
774 call PLED_topline_box | |
775 WIN_INVERT .1 ; Init new Wordprocessor | |
776 DISPLAYTEXT .144 ; Menu 2: | |
777 WIN_INVERT .0 ; Init new Wordprocessor | |
778 DISPLAYTEXT .8 ; Set Time | |
779 DISPLAYTEXT .110 ; Const. ppO2 Setup | |
780 DISPLAYTEXT .113 ; Battery Info | |
781 DISPLAYTEXT .247 ; Simulator | |
125 | 782 DISPLAYTEXTH .287 ; Altimeter |
0 | 783 DISPLAYTEXT .11 ; Exit |
784 return | |
785 | |
786 PLED_reset_menu_mask: | |
787 call PLED_topline_box | |
788 WIN_INVERT .1 ; Init new Wordprocessor | |
789 DISPLAYTEXT .28 ; Reset Menu | |
790 WIN_INVERT .0 ; Init new Wordprocessor | |
791 DISPLAYTEXT .21 ; Cancel Reset | |
792 DISPLAYTEXT .245 ; Reset CF,Gases & Deco | |
793 DISPLAYTEXTH .284 ; Reset Logbook | |
794 DISPLAYTEXTH .285 ; Reboot OSTC | |
795 DISPLAYTEXTH .286 ; Reset Decodata | |
796 DISPLAYTEXT .11 ; Exit | |
797 return | |
798 | |
799 PLED_simulator_mask: | |
800 call PLED_topline_box | |
801 WIN_INVERT .1 ; Init new Wordprocessor | |
802 DISPLAYTEXT .248 ; OSTC Simulator | |
803 WIN_INVERT .0 ; Init new Wordprocessor | |
804 DISPLAYTEXT .249 ; Start Dive | |
805 DISPLAYTEXTH .277 ; Bottom Time: | |
806 DISPLAYTEXTH .278 ; Max. Depth: | |
807 DISPLAYTEXTH .279 ; Calculate Deco | |
808 DISPLAYTEXTH .280 ; Show Decoplan | |
809 DISPLAYTEXT .11 ; Exit | |
810 return | |
811 | |
812 PLED_temp_surfmode: | |
813 ostc_debug 'e' | |
814 movff temperature+0,last_temperature+0 | |
815 movff temperature+1,last_temperature+1 | |
816 WIN_TOP .100 | |
56 | 817 WIN_LEFT .1 |
0 | 818 WIN_FONT FT_SMALL |
819 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 820 call PLED_standard_color |
821 | |
0 | 822 lfsr FSR2,letter |
823 movlw '-' | |
824 btfsc neg_temp ; Show "-"? | |
825 movwf POSTINC2 ; Yes | |
826 movff temperature+0,lo | |
827 movff temperature+1,hi | |
828 movlw d'3' | |
829 movwf ignore_digits | |
830 bsf leftbind ; left orientated output | |
831 output_16dp d'2' | |
832 bcf leftbind | |
123 | 833 STRCAT_PRINT "°C " |
0 | 834 return |
835 | |
836 PLED_temp_divemode: | |
837 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
838 return ; Yes, No update and return! | |
839 | |
840 ostc_debug 'u' ; Sends debug-information to screen if debugmode active | |
841 | |
842 ; temperature | |
843 movff temperature+0,last_temperature+0 | |
844 movff temperature+1,last_temperature+1 | |
845 | |
846 WIN_TOP .216 | |
75 | 847 WIN_LEFT .50 |
0 | 848 WIN_FONT FT_SMALL |
849 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 850 call PLED_standard_color |
851 | |
0 | 852 lfsr FSR2,letter |
853 movlw '-' | |
854 btfsc neg_temp ; Show "-"? | |
855 movwf POSTINC2 ; Yes | |
856 movff temperature+0,lo | |
857 movff temperature+1,hi | |
858 movlw d'3' | |
859 movwf ignore_digits | |
860 bsf leftbind ; left orientated output | |
861 output_16dp d'2' | |
862 bcf leftbind | |
135
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
863 STRCAT "° " |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
864 clrf WREG ; Allow up to 5 chars to avoid |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
865 movff WREG,letter+5 ; collision with sat graphs |
5c8569f95d7e
temperature collision with the tissue graph
heinrichsweikamp
parents:
133
diff
changeset
|
866 call word_processor |
0 | 867 return |
868 | |
869 PLED_show_ppO2: ; Show ppO2 | |
870 ostc_debug 't' ; Sends debug-information to screen if debugmode active | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
871 WIN_TOP .119 |
0 | 872 WIN_LEFT .0 |
873 WIN_FONT FT_SMALL | |
74 | 874 PLED_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
3 | 875 |
123 | 876 STRCPY "ppO2:" |
74 | 877 |
878 ; Check very high ppO2 manually | |
879 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? | |
880 bra PLED_show_ppO2_3 ; Yes, display fixed Value! | |
881 | |
0 | 882 movff xC+0,lo |
883 movff xC+1,hi | |
884 bsf ignore_digit4 | |
885 output_16dp d'1' | |
886 bcf ignore_digit4 | |
74 | 887 PLED_show_ppO2_2: |
123 | 888 STRCAT_PRINT " " |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
889 call PLED_standard_color |
0 | 890 return |
891 | |
74 | 892 PLED_show_ppO2_3: |
123 | 893 STRCAT ">6.6" |
74 | 894 bra PLED_show_ppO2_2 |
895 | |
0 | 896 PLED_show_ppO2_clear: ; Clear ppO2 |
897 movlw d'10' | |
898 movwf temp1 | |
899 WIN_TOP .120 | |
900 WIN_LEFT .0 | |
901 call PLED_display_clear_common_y1 | |
902 return | |
903 | |
904 PLED_active_gas_clear: ; clears active gas! | |
905 WIN_TOP .192 | |
75 | 906 WIN_LEFT .50 |
0 | 907 movlw d'5' |
908 movwf temp1 | |
909 bra PLED_display_clear_common_y1; also returns! | |
910 | |
911 PLED_active_gas_divemode: ; Displays current gas (e.g. 40/20) if a) He>0 or b) O2>Custom9 | |
912 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode | |
913 return | |
914 | |
915 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
916 return ; Yes, No update and return! | |
917 | |
25 | 918 WIN_INVERT .0 ; Init new Wordprocessor |
919 call PLED_active_gas_divemode_show ; Show gas (Non-Inverted in all cases) | |
920 | |
921 btfss better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | |
922 return ; Done. | |
923 | |
924 ; Check if Gas Output should blink when a better gas is available... | |
925 GETCUSTOM8 d'42' ; =1 if gas should blink | |
926 movwf lo | |
927 movlw d'1' | |
928 cpfseq lo ; =1? | |
929 return ; No, Done. | |
930 | |
931 btg blinking_better_gas ; Toggle blink bit... | |
932 btfss blinking_better_gas ; blink now? | |
933 return ; No, Done. | |
934 WIN_INVERT .1 ; Init new Wordprocessor | |
935 call PLED_active_gas_divemode_show ; Show gas (Non-Inverted in all cases) | |
936 WIN_INVERT .0 ; Init new Wordprocessor | |
937 return ; Done. | |
938 | |
939 PLED_active_gas_divemode_show: | |
0 | 940 ostc_debug 's' ; Sends debug-information to screen if debugmode active |
941 ; gas | |
942 WIN_TOP .192 | |
75 | 943 WIN_LEFT .50 |
0 | 944 WIN_FONT FT_SMALL |
3 | 945 call PLED_standard_color |
946 | |
0 | 947 movlw d'100' ; 100% in the tank |
948 movff char_I_N2_ratio,lo ; minus N2 | |
949 bsf STATUS,C ; set borrow bit | |
950 subfwb lo,W | |
951 movff char_I_He_ratio,lo ; minus He | |
952 bsf STATUS,C ; set borrow bit | |
953 subfwb lo,F ; =% O2 | |
954 GETCUSTOM8 d'9' ; get oxygen treshold | |
955 movff char_I_He_ratio,hi ; He ratio | |
956 cpfsgt lo | |
957 bra PLED_active_gas_divemode2 ; Check He | |
958 bra PLED_active_gas_divemode3 ; Skip He check, display gas | |
959 | |
960 PLED_active_gas_divemode2: | |
961 tstfsz hi ; He = 0 % | |
962 bra PLED_active_gas_divemode3 ; display gas | |
963 ; O2 below treshold, He=0 -> Skip display! | |
964 movlw d'5' | |
965 movwf temp1 | |
966 bra PLED_display_clear_common_y1 ; also returns! | |
967 | |
968 PLED_active_gas_divemode3: | |
969 movlw d'21' | |
970 cpfseq lo ; Air? (O2=21%) | |
971 bra PLED_active_gas_divemode4 ; No! | |
972 tstfsz hi ; Air? (He=0%) | |
973 bra PLED_active_gas_divemode4 ; No! | |
974 | |
975 ; Yes, display "Air" instead of 21/0 | |
976 lfsr FSR2,letter | |
136 | 977 OUTPUTTEXTH d'264' ;"Air " |
978 clrf WREG | |
8 | 979 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
980 movlw '*' | |
981 movwf POSTINC2 | |
0 | 982 call word_processor |
25 | 983 return |
0 | 984 |
985 PLED_active_gas_divemode4: | |
986 lfsr FSR2,letter | |
987 bsf leftbind ; left orientated output | |
988 output_8 ; O2 ratio is still in "lo" | |
123 | 989 PUTC '/' |
0 | 990 movff char_I_He_ratio,lo ; copy He ratio into lo |
991 output_8 | |
136 | 992 clrf WREG |
8 | 993 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
994 movlw '*' | |
0 | 995 movwf POSTINC2 |
996 bcf leftbind | |
997 call word_processor | |
25 | 998 return |
999 | |
17 | 1000 |
0 | 1001 |
1002 PLED_display_decotype_surface: | |
1003 WIN_LEFT .85 | |
1004 WIN_FONT FT_SMALL | |
1005 WIN_INVERT .0 ; Init new Wordprocessor | |
123 | 1006 call PLED_standard_color |
1007 | |
0 | 1008 clrf EEADRH |
1009 read_int_eeprom d'34' ; Read deco data | |
1010 tstfsz EEDATA | |
1011 bra show_decotype_surface2 | |
1012 | |
1013 ;ZH-L16 | |
1014 WIN_TOP .125 | |
123 | 1015 STRCPY_PRINT "O" |
1016 | |
0 | 1017 WIN_TOP .150 |
123 | 1018 STRCPY_PRINT "C" |
0 | 1019 return |
123 | 1020 |
0 | 1021 show_decotype_surface2: |
1022 decf EEDATA,F | |
1023 tstfsz EEDATA | |
1024 bra show_decotype_surface3 | |
1025 ; Gauge | |
1026 return | |
1027 | |
1028 show_decotype_surface3: | |
123 | 1029 decf EEDATA,F |
1030 tstfsz EEDATA | |
1031 bra show_decotype_surface4 | |
1032 ; const. ppO2 | |
1033 WIN_TOP .125 | |
1034 call PLED_standard_color | |
1035 | |
1036 STRCPY_PRINT "C" | |
1037 | |
1038 WIN_TOP .150 | |
1039 call word_processor ; Twice the same string. | |
1040 return | |
1041 | |
0 | 1042 show_decotype_surface4: |
1043 decf EEDATA,F | |
1044 tstfsz EEDATA | |
1045 bra show_decotype_surface5 | |
1046 ; Apnoe | |
1047 return | |
123 | 1048 |
0 | 1049 show_decotype_surface5: |
1050 show_decotype_surface6: | |
123 | 1051 decf EEDATA,F |
1052 tstfsz EEDATA | |
1053 bra show_decotype_surface6 | |
1054 ; Multi-GF OC | |
1055 WIN_TOP .125 | |
1056 STRCPY_PRINT "G" | |
1057 | |
1058 WIN_TOP .150 | |
1059 STRCPY_PRINT "F" | |
1060 return | |
0 | 1061 |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1062 ;----------------------------------------------------------------------------- |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1063 ; 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
|
1064 ; 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
|
1065 ; Trashes: lo |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1066 ; New v1.44se |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1067 PLED_grey_inactive_gas: |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1068 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
|
1069 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
|
1070 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1071 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
|
1072 movf EEDATA,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1073 subwf lo,W ; Compare with current |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1074 bz PLED_white_gas ; First is always on. |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1075 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1076 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
|
1077 addwf lo,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1078 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
|
1079 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
|
1080 clrf WREG |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1081 cpfsgt EEDATA ; is depth > 0 ? |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1082 bra PLED_grey_gas |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1083 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1084 read_int_eeprom d'27' ; read flag register |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1085 PLED_grey_inactive_gas1: |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1086 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
|
1087 decfsz lo,F ; max. 5 times... |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1088 bra PLED_grey_inactive_gas1 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1089 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1090 bnc PLED_grey_gas ; test carry |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1091 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1092 PLED_white_gas: |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1093 GETCUSTOM8 d'35' ;movlw color_white |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1094 goto PLED_set_color ; grey out inactive gases! |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1095 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1096 PLED_grey_gas: |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1097 movlw color_grey |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1098 goto PLED_set_color ; grey out inactive gases! |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1099 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1100 ;----------------------------------------------------------------------------- |
123 | 1101 ; Display Pre-Dive Screen |
1102 | |
1103 PLED_pre_dive_screen: | |
13 | 1104 ; List active gases/Setpoints |
1105 | |
1106 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
1107 bra PLED_pre_dive_screen3 ; Yes, display SetPoint/Sensor result list | |
1108 | |
1109 PLED_pre_dive_screen2: | |
1110 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
1111 | |
1112 WIN_LEFT .90 | |
1113 WIN_FONT FT_SMALL | |
1114 bsf leftbind | |
1115 | |
1116 movlw d'2' | |
1117 movwf wait_temp ; here: stores eeprom address for gas list | |
1118 movlw d'0' | |
1119 movwf waitms_temp ; here: stores row for gas list | |
1120 clrf hi ; here: Gas counter | |
1121 | |
1122 PLED_pre_dive_screen2_loop: | |
1123 incf hi,F ; Increase Gas | |
1124 movlw d'4' | |
1125 addwf wait_temp,F ; Increase eeprom address for gas list | |
1126 | |
123 | 1127 STRCPY "G" |
13 | 1128 movff hi,lo ; copy gas number |
1129 output_8 ; display gas number | |
123 | 1130 STRCAT ": " |
13 | 1131 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
1132 call read_eeprom ; get byte (stored in EEDATA) | |
1133 movff EEDATA,lo ; copy to lo | |
1134 output_8 ; outputs into Postinc2! | |
123 | 1135 PUTC '/' |
13 | 1136 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
1137 call read_eeprom ; get byte (stored in EEDATA) | |
1138 movff EEDATA,lo ; copy to lo | |
1139 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
|
1140 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1141 decf hi,W ; Gas # in 0..4 |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1142 call PLED_grey_inactive_gas |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
119
diff
changeset
|
1143 |
13 | 1144 read_int_eeprom d'33' ; Read start gas (1-5) |
1145 movf EEDATA,W | |
1146 cpfseq hi ; Current Gas the active gas? | |
1147 bra PLED_pre_dive_screen2a | |
1148 bra PLED_pre_dive_screen2b | |
1149 | |
1150 PLED_pre_dive_screen2a: | |
1151 movlw d'25' | |
1152 addwf waitms_temp,F ; Increase row | |
1153 WIN_LEFT .90 | |
1154 movff waitms_temp,win_top ; Set Row | |
1155 call word_processor ; No, display gas | |
1156 | |
1157 PLED_pre_dive_screen2b: | |
1158 movlw d'5' ; list all four (remaining) gases | |
1159 cpfseq hi ; All gases shown? | |
1160 bra PLED_pre_dive_screen2_loop ; No | |
1161 | |
1162 return ; No, return (OC mode) | |
1163 | |
1164 PLED_pre_dive_screen3: | |
1165 WIN_LEFT .90 | |
1166 WIN_FONT FT_SMALL | |
1167 bsf leftbind | |
127 | 1168 call PLED_standard_color |
13 | 1169 |
1170 ; list three SP in Gaslist | |
1171 movlw d'35' ; 36 = current SP position in EEPROM | |
1172 movwf wait_temp ; here: stores eeprom address for gas list | |
1173 movlw d'0' | |
1174 movwf waitms_temp ; here: stores row for gas list | |
124 | 1175 clrf decoplan_index ; here: SP counter |
13 | 1176 |
1177 PLED_pre_dive_screen3_loop: | |
1178 incf wait_temp,F ; EEPROM address | |
124 | 1179 incf decoplan_index,F ; Increase SP |
13 | 1180 |
1181 movlw d'25' | |
1182 addwf waitms_temp,F ; Increase row | |
1183 WIN_LEFT .90 | |
1184 movff waitms_temp,win_top ; Set Row | |
1185 | |
123 | 1186 STRCPY "SP" |
124 | 1187 movff decoplan_index,lo ; copy gas number |
13 | 1188 output_8 ; display gas number |
123 | 1189 STRCAT ": " |
13 | 1190 movff wait_temp, EEADR; SP #hi position |
1191 call read_eeprom ; get byte (stored in EEDATA) | |
1192 movff EEDATA,lo ; copy to lo | |
1193 clrf hi | |
1194 output_16dp d'3' ; outputs into Postinc2! | |
1195 call word_processor | |
1196 | |
1197 movlw d'3' ; list all three SP | |
124 | 1198 cpfseq decoplan_index ; All gases shown? |
13 | 1199 bra PLED_pre_dive_screen3_loop ;no |
1200 | |
19 | 1201 read_int_eeprom d'33' ; Read byte (stored in EEDATA) |
1202 movff EEDATA,active_gas ; Read start gas (1-5) | |
1203 decf active_gas,W ; Gas 0-4 | |
1204 mullw d'4' | |
1205 movf PRODL,W | |
1206 addlw d'6' ; = address for O2 ratio | |
1207 movwf EEADR | |
127 | 1208 call read_eeprom ; Read O2 ratio |
1209 movff EEDATA, lo ; O2 ratio | |
1210 incf EEADR,F ; = address for He | |
1211 call read_eeprom ; Read He ratio | |
1212 movff EEDATA,hi ; And copy into hold register | |
19 | 1213 |
1214 WIN_LEFT .90 | |
1215 WIN_TOP .100 | |
123 | 1216 STRCPY "Dil:" |
19 | 1217 output_8 ; O2 Ratio |
123 | 1218 PUTC '/' |
19 | 1219 movff hi,lo |
1220 output_8 ; He Ratio | |
1221 call word_processor | |
1222 | |
13 | 1223 bcf leftbind |
1224 return ; Return (CC Mode) | |
1225 | |
0 | 1226 PLED_active_gas_surfmode: ; Displays start gas/SP 1 |
1227 ostc_debug 'q' ; Sends debug-information to screen if debugmode active | |
1228 | |
1229 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
1230 return ; Yes, return | |
1231 | |
1232 btfsc gauge_mode ; In Gauge mode? | |
1233 return ; Yes, return | |
1234 | |
1235 btfss FLAG_const_ppO2_mode ; are we in const. ppO2 mode? | |
1236 bra PLED_active_gas_surfmode2 ; No, display gases | |
1237 | |
1238 ; In CC Mode | |
1239 WIN_TOP .135 | |
1240 WIN_LEFT .90 | |
1241 WIN_FONT FT_SMALL | |
1242 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1243 call PLED_standard_color |
1244 | |
0 | 1245 lfsr FSR2,letter |
1246 read_int_eeprom d'36' | |
1247 movff EEDATA,lo ; copy to lo | |
1248 clrf hi | |
1249 output_16dp d'3' ; outputs into Postinc2! | |
1250 bcf leftbind | |
123 | 1251 |
1252 STRCAT_PRINT "Bar" | |
0 | 1253 bra PLED_active_gas_surfmode_exit |
1254 | |
1255 PLED_active_gas_surfmode2: | |
1256 WIN_TOP .130 | |
1257 WIN_LEFT .100 | |
1258 WIN_FONT FT_MEDIUM | |
1259 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1260 call PLED_standard_color |
1261 | |
0 | 1262 |
1263 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
1264 movff EEDATA,active_gas ; Read start gas (1-5) | |
1265 | |
1266 decf active_gas,W ; Gas 0-4 | |
1267 mullw d'4' | |
1268 movf PRODL,W | |
1269 addlw d'7' ; = address for He ratio | |
1270 movwf EEADR | |
1271 call read_eeprom ; Read He ratio | |
1272 movff EEDATA,char_I_He_ratio ; And copy into hold register | |
1273 | |
1274 decf active_gas,W ; Gas 0-4 | |
1275 mullw d'4' | |
1276 movf PRODL,W | |
1277 addlw d'6' ; = address for O2 ratio | |
1278 movwf EEADR | |
1279 call read_eeprom ; Read O2 ratio | |
1280 movff EEDATA, char_I_O2_ratio ; O2 ratio | |
1281 movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
1282 bsf STATUS,C ; Borrow bit | |
1283 movlw d'100' ; 100% | |
1284 subfwb wait_temp,W ; minus He | |
1285 bsf STATUS,C ; Borrow bit | |
1286 subfwb EEDATA,F ; minus O2 | |
1287 movff EEDATA, char_I_N2_ratio ; = N2! | |
1288 | |
1289 movlw d'100' ; 100% in the tank | |
1290 movff char_I_N2_ratio,lo ; minus N2 | |
1291 bsf STATUS,C ; set borrow bit | |
1292 subfwb lo,W | |
1293 movff char_I_He_ratio,lo ; minus He | |
1294 bsf STATUS,C ; set borrow bit | |
1295 subfwb lo,F ; =% O2 | |
1296 | |
1297 movff char_I_He_ratio,hi ; Copy into Bank1 register | |
1298 | |
1299 movlw d'21' | |
1300 cpfseq lo ; Air? (O2=21%) | |
1301 bra PLED_active_gas_surfmode4 ; No! | |
1302 tstfsz hi ; Air? (He=0%) | |
1303 bra PLED_active_gas_surfmode4 ; No! | |
1304 | |
1305 ; Yes, display "Air" instead of 21/0 | |
1306 DISPLAYTEXTH d'265' ;"Air ", y-scale=2 | |
1307 bra PLED_active_gas_surfmode_exit | |
1308 | |
1309 PLED_active_gas_surfmode4: | |
1310 lfsr FSR2,letter | |
1311 bsf leftbind ; left orientated output | |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
77
diff
changeset
|
1312 output_99 ; O2 ratio is still in "lo" |
123 | 1313 PUTC '/' |
0 | 1314 movff char_I_He_ratio,lo ; copy He ratio into lo |
81
31fa973a70fd
Kludges to emulate inexisting devices when debugged with the MPLAB software SIMulator.
JeanDo
parents:
77
diff
changeset
|
1315 output_99 |
0 | 1316 bcf leftbind |
1317 call word_processor | |
1318 bra PLED_active_gas_surfmode_exit | |
1319 | |
1320 PLED_active_gas_surfmode_exit: | |
123 | 1321 ; WIN_FRAME_BLACK .122, .175, .82, .159 |
0 | 1322 return |
1323 | |
1324 PLED_confirmbox: | |
123 | 1325 WIN_BOX_BLACK .68, .146, .34, .101 |
1326 WIN_FRAME_STD .70, .144, .35, .100 | |
1327 | |
0 | 1328 DISPLAYTEXT .143 ; Confirm: |
1329 DISPLAYTEXT .145 ; Cancel | |
1330 DISPLAYTEXT .146 ; OK! | |
1331 | |
1332 movlw d'1' | |
1333 movwf menupos | |
1334 | |
1335 PLED_confirmbox2: | |
123 | 1336 WIN_BOX_BLACK .96, .143, .39, .51 |
0 | 1337 |
1338 movff menupos,temp1 | |
1339 movlw d'96' | |
1340 dcfsnz temp1,F | |
1341 movlw d'96' | |
1342 dcfsnz temp1,F | |
1343 movlw d'120' | |
1344 movff WREG,win_top | |
1345 WIN_LEFT .39 | |
1346 WIN_FONT FT_SMALL | |
1347 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1348 call PLED_standard_color |
1349 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
1350 STRCPY_PRINT "\xB7" ; Cursor |
0 | 1351 |
1352 bcf sleepmode ; clear some flags | |
1353 bcf menubit2 | |
1354 bcf menubit3 | |
1355 bcf switch_right | |
1356 bcf switch_left | |
1357 clrf timeout_counter2 | |
1358 WAITMS d'100' | |
1359 | |
1360 PLED_confirmbox_loop: | |
1361 call check_switches_logbook | |
1362 | |
1363 btfsc menubit3 ; SET/MENU? | |
1364 bra PLED_confirmbox_move_cursor; Move Cursor | |
1365 btfsc menubit2 ; ENTER? | |
1366 bra PLED_confirmbox_menu_do ; Do task | |
1367 | |
1368 btfsc onesecupdate | |
1369 call timeout_surfmode ; timeout | |
1370 | |
1371 btfsc onesecupdate | |
1372 call set_dive_modes ; check, if divemode must be entered | |
1373 bcf onesecupdate ; one second update | |
1374 | |
1375 btfsc sleepmode ; Timeout? | |
1376 bra PLED_confirmbox_cancel ; back with cancel | |
1377 btfsc divemode | |
1378 bra PLED_confirmbox_cancel ; back with cancel | |
1379 | |
1380 bra PLED_confirmbox_loop ; wait for something to do | |
1381 | |
1382 PLED_confirmbox_cancel: | |
1383 retlw .0 | |
1384 PLED_confirmbox_ok: | |
1385 retlw .1 | |
1386 | |
1387 PLED_confirmbox_menu_do: | |
1388 dcfsnz menupos,F | |
1389 bra PLED_confirmbox_cancel | |
1390 dcfsnz menupos,F | |
1391 bra PLED_confirmbox_ok | |
1392 bra PLED_confirmbox_cancel | |
1393 | |
1394 PLED_confirmbox_move_cursor: | |
1395 incf menupos,F | |
1396 movlw d'3' ; number of menu options+1 | |
1397 cpfseq menupos ; =limit? | |
1398 bra PLED_confirmbox_move_cursor2 ; No! | |
1399 movlw d'1' ; Yes, reset to position 1! | |
1400 movwf menupos | |
1401 PLED_confirmbox_move_cursor2: | |
1402 bra PLED_confirmbox2 ; Return to Profile Menu, also updates cursor | |
1403 | |
1404 | |
1405 PLED_depth: | |
1406 ostc_debug 'r' ; Sends debug-information to screen if debugmode active | |
1407 movff rel_pressure+1,hi | |
1408 movff rel_pressure+0,lo | |
1409 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
1410 | |
1411 movlw .039 | |
1412 cpfslt hi | |
1413 bra depth_greater_99_84mtr | |
1414 | |
1415 btfsc depth_greater_100m ; Was depth>100m during last call | |
1416 call PLED_clear_depth ; Yes, clear depth area | |
1417 bcf depth_greater_100m ; Do this once only... | |
1418 | |
1419 lfsr FSR2,letter | |
1420 | |
1421 movlw HIGH d'1000' | |
1422 movwf sub_a+1 | |
1423 movlw LOW d'1000' | |
1424 movwf sub_a+0 | |
1425 movff hi,sub_b+1 | |
1426 movff lo,sub_b+0 | |
1427 incf sub_b+0,F | |
1428 movlw d'0' | |
1429 addwfc sub_b+1,F ; Add 1mBar offset | |
1430 call sub16 ; sub_c = sub_a - sub_b | |
1431 btfss neg_flag ; Depth lower then 10m? | |
1432 rcall depth_less_10mtr ; Yes, add extra space | |
1433 | |
1434 WIN_TOP .24 | |
1435 WIN_LEFT .0 | |
1436 WIN_FONT FT_LARGE | |
1437 WIN_INVERT .0 ; Init new Wordprocessor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1438 PLED_color_code warn_depth ; Color-code the output |
0 | 1439 |
1440 movlw HIGH d'99' | |
1441 movwf sub_a+1 | |
1442 movlw LOW d'99' | |
1443 movwf sub_a+0 | |
1444 movff hi,sub_b+1 | |
1445 movff lo,sub_b+0 | |
1446 call sub16 ; sub_c = sub_a - sub_b | |
1447 btfss neg_flag ; Depth lower then 1m? | |
1448 bra pled_depth2 ; Yes, display manual Zero | |
1449 | |
1450 bsf leftbind | |
1451 bsf ignore_digit4 | |
1452 output_16 ; Full meters in Big font | |
1453 bcf leftbind | |
1454 bra pled_depth3 | |
1455 | |
1456 pled_depth2: | |
123 | 1457 PUTC '0' |
1458 | |
0 | 1459 pled_depth3: |
1460 call word_processor | |
1461 bcf ignore_digit4 | |
1462 | |
1463 WIN_FONT FT_MEDIUM | |
1464 WIN_TOP .50 | |
1465 WIN_LEFT .40 | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1466 PLED_color_code warn_depth ; Color-code the output |
0 | 1467 |
1468 movff rel_pressure+1,hi | |
1469 movff rel_pressure+0,lo | |
1470 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
123 | 1471 |
1472 STRCPY "." | |
0 | 1473 |
1474 movlw HIGH d'9' | |
1475 movwf sub_a+1 | |
1476 movlw LOW d'9' | |
1477 movwf sub_a+0 | |
1478 movff hi,sub_b+1 | |
1479 movff lo,sub_b+0 | |
1480 call sub16 ; sub_c = sub_a - sub_b | |
1481 btfss neg_flag ; Depth lower then 0.1m? | |
1482 bra pled_depth4 ; Yes, display manual Zero | |
1483 | |
1484 movlw d'4' | |
1485 movwf ignore_digits | |
1486 bsf ignore_digit5 | |
1487 output_16dp d'0' | |
1488 bra pled_depth5 | |
1489 | |
1490 pled_depth4: | |
123 | 1491 PUTC '0' |
0 | 1492 |
1493 pled_depth5: | |
1494 call word_processor ; decimeters in medium font | |
1495 bcf ignore_digit5 | |
1496 WIN_FONT FT_SMALL | |
1497 return | |
1498 | |
1499 depth_greater_99_84mtr: ; Display only in full meters | |
1500 btfss depth_greater_100m ; Is depth>100m already? | |
1501 call PLED_clear_depth ; No, clear depth area and set flag | |
1502 ; Depth is already in hi:lo | |
1503 ; Show depth in Full meters | |
1504 ; That means ignore figure 4 and 5 | |
1505 lfsr FSR2,letter | |
1506 WIN_TOP .24 | |
1507 WIN_LEFT .0 | |
1508 WIN_FONT FT_LARGE | |
1509 WIN_INVERT .0 ; Init new Wordprocessor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1510 PLED_color_code warn_depth ; Color-code the output |
3 | 1511 |
0 | 1512 bsf ignore_digit4 |
1513 bsf leftbind | |
1514 output_16 | |
1515 bcf leftbind | |
1516 call word_processor | |
1517 bcf ignore_digit4 | |
1518 WIN_FONT FT_SMALL | |
1519 return | |
1520 | |
1521 depth_less_10mtr: | |
123 | 1522 PUTC ' ' |
0 | 1523 return |
1524 | |
1525 PLED_clear_depth ; No, clear depth area and set flag | |
123 | 1526 WIN_BOX_BLACK .24, .90, .0, .90 |
0 | 1527 bsf depth_greater_100m ; Set Flag |
1528 return | |
1529 | |
1530 PLED_desaturation_time: | |
140 | 1531 movff int_O_desaturation_time+0,lo |
1532 movff int_O_desaturation_time+1,hi ; Copy | |
1533 tstfsz lo ; =0? | |
1534 bra PLED_desaturation_time2 ; No! | |
1535 tstfsz hi ; =0? | |
1536 bra PLED_desaturation_time2 ; No! | |
1537 return ; Do not display Desat | |
1538 | |
1539 PLED_desaturation_time2: | |
0 | 1540 ostc_debug 'h' |
1541 WIN_TOP .150 | |
56 | 1542 WIN_LEFT .1 |
0 | 1543 WIN_FONT FT_SMALL |
1544 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1545 call PLED_standard_color |
1546 | |
0 | 1547 lfsr FSR2,letter |
1548 OUTPUTTEXT d'14' ; Desat | |
123 | 1549 PUTC ' ' |
0 | 1550 movff int_O_desaturation_time+0,lo ; divide by 60... |
1551 movff int_O_desaturation_time+1,hi | |
1552 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1553 bsf leftbind | |
1554 movf lo,W | |
1555 movff hi,lo | |
1556 movwf hi ; exchange lo and hi... | |
1557 output_8 ; Hours | |
123 | 1558 PUTC ':' |
0 | 1559 movff hi,lo ; Minutes |
1560 output_99x | |
1561 bcf leftbind | |
1562 call word_processor | |
1563 return | |
1564 | |
1565 PLED_nofly_time: | |
140 | 1566 movff nofly_time+0,lo |
1567 movff nofly_time+1,hi ; Copy | |
141 | 1568 movlw d'1' |
1569 cpfseq lo ; =1? | |
140 | 1570 bra PLED_nofly_time2 ; No! |
1571 tstfsz hi ; =0? | |
1572 bra PLED_nofly_time2 ; No! | |
1573 return | |
1574 | |
1575 PLED_nofly_time2: | |
0 | 1576 ostc_debug 'g' |
1577 WIN_TOP .125 | |
56 | 1578 WIN_LEFT .1 |
0 | 1579 WIN_FONT FT_SMALL |
1580 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1581 call PLED_standard_color |
1582 | |
0 | 1583 lfsr FSR2,letter |
1584 OUTPUTTEXT d'35' ; NoFly | |
123 | 1585 PUTC ' ' |
0 | 1586 movff nofly_time+0,lo ; divide by 60... |
1587 movff nofly_time+1,hi | |
1588 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1589 bsf leftbind | |
1590 movf lo,W | |
1591 movff hi,lo | |
1592 movwf hi ; exchange lo and hi... | |
1593 output_8 ; Hours | |
123 | 1594 PUTC ':' |
0 | 1595 movff hi,lo ; Minutes |
1596 decf lo,F | |
1597 btfsc lo,7 ; keep Nofly time | |
1598 clrf lo | |
1599 output_99x | |
1600 bcf leftbind | |
1601 call word_processor | |
1602 return | |
1603 | |
1604 | |
1605 update_surf_press: | |
1606 btfsc premenu ; Do not update when "Menu?" is displayed! | |
1607 return | |
1608 | |
1609 ostc_debug 'b' ; Sends debug-information to screen if debugmode active | |
1610 WIN_TOP .25 | |
56 | 1611 WIN_LEFT .1 |
0 | 1612 WIN_FONT FT_SMALL |
1613 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1614 call PLED_standard_color |
1615 | |
0 | 1616 lfsr FSR2,letter |
1617 movff amb_pressure+0,lo | |
1618 movff amb_pressure+1,hi | |
1619 bsf leftbind | |
1620 output_16 | |
1621 bcf leftbind | |
123 | 1622 STRCAT_PRINT "mbar " |
0 | 1623 return |
1624 | |
1625 update_batt_voltage_divemode: | |
141 | 1626 call PLED_warnings_color |
1627 DISPLAYTEXT d'246' ; LowBatt! | |
1628 call PLED_standard_color | |
1629 return | |
0 | 1630 |
1631 update_batt_voltage: | |
1632 ostc_debug 'f' | |
1633 | |
1634 GETCUSTOM8 d'31' ; =1 if battery voltage should be visible | |
1635 movwf lo | |
1636 movlw d'1' | |
1637 cpfseq lo ; =1? | |
1638 bra update_batt_voltage2 ; No, show symbol | |
1639 | |
1640 WIN_TOP .175 | |
56 | 1641 WIN_LEFT .1 |
0 | 1642 WIN_FONT FT_SMALL |
1643 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1644 call PLED_standard_color |
1645 | |
0 | 1646 lfsr FSR2,letter |
1647 movff batt_voltage+0,lo | |
1648 movff batt_voltage+1,hi | |
1649 movlw d'1' | |
1650 movwf ignore_digits | |
1651 bsf ignore_digit5 ; do not display mV | |
1652 bsf leftbind | |
1653 output_16dp d'2' ; e.g. 3.45V | |
1654 bcf leftbind | |
123 | 1655 STRCAT_PRINT "V " |
0 | 1656 return |
1657 | |
1658 update_batt_voltage2: | |
123 | 1659 WIN_FRAME_STD .174, .194, .1, .32 |
0 | 1660 |
25 | 1661 ; 4100-Vbatt |
1662 movlw LOW d'4100' | |
0 | 1663 movwf sub_a+0 |
25 | 1664 movlw HIGH d'4100' |
0 | 1665 movwf sub_a+1 |
1666 movff batt_voltage+0,sub_b+0 | |
1667 movff batt_voltage+1,sub_b+1 | |
1668 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1669 ; Battery full (>4100mV? |
0 | 1670 btfsc neg_flag |
1671 bra update_batt_voltage2_full | |
1672 | |
25 | 1673 ; Vbatt-3500 |
1674 movlw LOW d'3500' | |
0 | 1675 movwf sub_b+0 |
25 | 1676 movlw HIGH d'3500' |
0 | 1677 movwf sub_b+1 |
1678 movff batt_voltage+0,sub_a+0 | |
1679 movff batt_voltage+1,sub_a+1 | |
1680 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1681 ; Battery lower then 3500mV? |
0 | 1682 btfsc neg_flag |
1683 bra update_batt_voltage2_empty | |
1684 | |
25 | 1685 ; Battery is between 3500 and 4100mV |
0 | 1686 ; sub_c:2 is between 0 and 600 |
1687 movff sub_c+0,xA+0 | |
1688 movff sub_c+1,xA+1 | |
1689 movlw d'20' | |
1690 movwf xB+0 | |
1691 clrf xB+1 | |
1692 call div16x16 ;xA/xB=xC with xA as remainder | |
1693 ; xC is between 0 and 30 | |
1694 movff xC+0,wait_temp ;save value | |
56 | 1695 incf wait_temp,F ; +1 |
1696 | |
1697 movlw d'3' | |
0 | 1698 cpfsgt wait_temp |
56 | 1699 movwf wait_temp ; Minimum = 3 |
0 | 1700 |
1701 update_batt_voltage2a: | |
123 | 1702 WIN_BOX_STD .181, .187, .32, .34 |
25 | 1703 |
0 | 1704 update_batt_voltage3: |
25 | 1705 GETCUSTOM8 d'34' ; Color battery |
123 | 1706 call PLED_set_color |
1707 | |
25 | 1708 movlw .176 |
123 | 1709 movff WREG,win_top ; row top (0-239) |
1710 movlw .192-.176 | |
1711 movff WREG,win_height ; row bottom (0-239) | |
56 | 1712 movlw .2 |
123 | 1713 movff WREG,win_leftx2 ; column left (0-159) |
1714 movff wait_temp,win_width ; column right (0-159) | |
0 | 1715 call PLED_box |
1716 | |
25 | 1717 call PLED_standard_color |
0 | 1718 return |
1719 | |
1720 update_batt_voltage2_empty: | |
1721 movlw d'1' | |
1722 movwf wait_temp | |
1723 bra update_batt_voltage2a | |
1724 | |
1725 update_batt_voltage2_full: | |
1726 movlw d'30' | |
1727 movwf wait_temp | |
25 | 1728 bra update_batt_voltage2a |
0 | 1729 |
1730 PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
1731 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1732 tstfsz EEDATA | |
1733 bra PLED_convert_date1 | |
1734 | |
1735 ; Use MMDDYY | |
1736 movff convert_value_temp+0,lo ;month | |
1737 bsf leftbind | |
1738 output_99x | |
1739 bcf leftbind | |
140 | 1740 PUTC '.' |
0 | 1741 movff convert_value_temp+1,lo ;day |
1742 bra PLED_convert_date1_common ;year | |
1743 | |
1744 PLED_convert_date1: | |
1745 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1746 decfsz EEDATA,F | |
1747 bra PLED_convert_date2 | |
1748 | |
1749 ; Use DDMMYY | |
1750 movff convert_value_temp+1,lo ;day | |
1751 bsf leftbind | |
1752 output_99x | |
1753 bcf leftbind | |
140 | 1754 PUTC '.' |
0 | 1755 movff convert_value_temp+0,lo ;month |
1756 | |
1757 PLED_convert_date1_common: | |
1758 bsf leftbind | |
1759 output_99x | |
1760 bcf leftbind | |
140 | 1761 PUTC '.' |
0 | 1762 movff convert_value_temp+2,lo ;year |
1763 bsf leftbind | |
1764 output_99x | |
1765 return | |
1766 | |
1767 PLED_convert_date2: | |
1768 ; Use YYMMDD | |
1769 movff convert_value_temp+2,lo ;year | |
1770 bsf leftbind | |
1771 output_99x | |
1772 bcf leftbind | |
140 | 1773 PUTC '.' |
0 | 1774 movff convert_value_temp+0,lo ;month |
1775 bsf leftbind | |
1776 output_99x | |
1777 bcf leftbind | |
140 | 1778 PUTC '.' |
0 | 1779 movff convert_value_temp+1,lo ;day |
1780 bsf leftbind | |
1781 output_99x | |
1782 return | |
1783 | |
1784 PLED_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2 | |
1785 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1786 tstfsz EEDATA | |
1787 bra PLED_convert_date_short1 | |
1788 | |
1789 ; Use MMDDYY | |
1790 PLED_convert_date_short_common: | |
1791 movff convert_value_temp+0,lo ;month | |
1792 bsf leftbind | |
1793 output_99x | |
1794 bcf leftbind | |
140 | 1795 PUTC '.' |
0 | 1796 movff convert_value_temp+1,lo ;day |
1797 bsf leftbind | |
1798 output_99x | |
1799 bcf leftbind | |
1800 return | |
1801 | |
1802 PLED_convert_date_short1: | |
1803 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1804 decfsz EEDATA,F | |
1805 bra PLED_convert_date_short_common ; Use YYMMDD | |
1806 | |
1807 ; Use DDMMYY | |
1808 movff convert_value_temp+1,lo ;day | |
1809 bsf leftbind | |
1810 output_99x | |
1811 bcf leftbind | |
140 | 1812 PUTC '.' |
0 | 1813 movff convert_value_temp+0,lo ;month |
1814 bsf leftbind | |
1815 output_99x | |
1816 bcf leftbind | |
1817 return | |
1818 | |
1819 update_date: | |
1820 ostc_debug 'd' | |
1821 WIN_TOP .75 | |
56 | 1822 WIN_LEFT .1 |
0 | 1823 WIN_FONT FT_SMALL |
1824 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1825 call PLED_standard_color |
1826 | |
0 | 1827 lfsr FSR2,letter |
1828 | |
1829 movff month,convert_value_temp+0 | |
1830 movff day,convert_value_temp+1 | |
1831 movff year,convert_value_temp+2 | |
1832 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
1833 call word_processor | |
1834 return | |
1835 | |
1836 PLED_menu_clear: | |
123 | 1837 WIN_BOX_BLACK .0, .26, .65, .100 |
0 | 1838 return |
1839 | |
1840 PLED_max_pressure: | |
1841 ostc_debug 'p' ; Sends debug-information to screen if debugmode active | |
75 | 1842 movff max_pressure+0,lo |
1843 movff max_pressure+1,hi | |
1844 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
1845 | |
1846 movlw .039 | |
1847 cpfslt hi | |
1848 bra maxdepth_greater_99_84mtr | |
1849 | |
1850 ; Display normal "xx.y" | |
1851 lfsr FSR2,letter | |
1852 call PLED_standard_color | |
0 | 1853 WIN_TOP .184 |
1854 WIN_LEFT .0 | |
1855 WIN_FONT FT_MEDIUM | |
1856 WIN_INVERT .0 ; Init new Wordprocessor | |
1857 bsf leftbind | |
1858 bsf ignore_digit5 ; do not display 1cm depth | |
1859 output_16dp d'3' | |
1860 bcf leftbind | |
1861 bcf show_last3 | |
1862 call word_processor | |
1863 WIN_FONT FT_SMALL | |
1864 return | |
1865 | |
75 | 1866 maxdepth_greater_99_84mtr: ; Display only in full meters |
1867 btfss maxdepth_greater_100m ; Is max.depth>100m already? | |
1868 call PLED_clear_maxdepth ; No, clear maxdepth area and set flag | |
1869 ; max Depth is already in hi:lo | |
1870 ; Show max depth in Full meters | |
1871 ; That means ignore figure 4 and 5 | |
1872 lfsr FSR2,letter | |
1873 call PLED_standard_color | |
1874 WIN_TOP .184 | |
1875 WIN_LEFT .0 | |
1876 WIN_FONT FT_MEDIUM | |
1877 WIN_INVERT .0 ; Init new Wordprocessor | |
1878 | |
1879 bsf ignore_digit4 | |
1880 bsf leftbind | |
1881 output_16 | |
1882 bcf leftbind | |
1883 call word_processor | |
1884 bcf ignore_digit4 | |
1885 WIN_FONT FT_SMALL | |
1886 return | |
1887 | |
1888 PLED_clear_maxdepth: | |
123 | 1889 WIN_BOX_BLACK .184, .215, .0, .41 |
75 | 1890 bsf maxdepth_greater_100m ; Set Flag |
1891 return | |
1892 | |
0 | 1893 PLED_divemins: |
1894 btfsc menubit ; Divemode menu active? | |
1895 return ; Yes, do not update divetime | |
1896 | |
1897 ostc_debug 'A' ; Sends debug-information to screen if debugmode active | |
1898 | |
1899 btfsc gauge_mode ; different display in gauge mode | |
1900 bra PLED_divemins_gauge | |
1901 | |
1902 btfsc FLAG_apnoe_mode ; different display in apnoe mode | |
1903 bra PLED_divemins_apnoe | |
1904 | |
1905 GETCUSTOM8 d'38' ; Show seconds (=1?) | |
1906 movwf lo | |
1907 movlw d'1' | |
1908 cpfseq lo ; =1? | |
1909 bra PLED_divemins2 ; No, minutes only | |
1910 bra PLED_divemins_gauge ; Yes, use Gauge routine | |
1911 | |
1912 PLED_divemins2: | |
1913 movff divemins+0,lo | |
1914 movff divemins+1,hi | |
1915 bcf leftbind | |
1916 lfsr FSR2,letter | |
1917 output_16_3 ; displays only last three figures from a 16Bit value (0-999) | |
1918 WIN_TOP .20 | |
1919 WIN_LEFT .120 | |
1920 WIN_FONT FT_MEDIUM | |
3 | 1921 call PLED_standard_color |
0 | 1922 call word_processor |
1923 WIN_FONT FT_SMALL | |
1924 return | |
1925 | |
1926 PLED_display_apnoe_surface: | |
1927 btfsc menubit ; Divemode menu active? | |
1928 return ; Yes, do not display surface mode timeout | |
1929 | |
9 | 1930 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 1931 DISPLAYTEXT d'140' ; "SURFACE" |
3 | 1932 call PLED_standard_color |
1933 | |
0 | 1934 |
1935 WIN_TOP .85 | |
1936 WIN_LEFT .90 | |
1937 WIN_FONT FT_MEDIUM | |
3 | 1938 call PLED_standard_color |
1939 | |
0 | 1940 |
1941 movff apnoe_surface_mins,lo | |
1942 bcf leftbind | |
1943 lfsr FSR2,letter | |
1944 output_8 | |
123 | 1945 PUTC ':' |
0 | 1946 movff apnoe_surface_secs,lo |
1947 output_99x | |
1948 call word_processor | |
1949 WIN_FONT FT_SMALL | |
1950 return | |
1951 | |
1952 PLED_apnoe_clear_surface: | |
1953 ; Clear Surface timer.... | |
123 | 1954 WIN_BOX_BLACK .60, .119, .90, .159 |
0 | 1955 return |
1956 | |
1957 | |
1958 PLED_display_apnoe_descent: | |
9 | 1959 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 1960 DISPLAYTEXT d'139' ; "Descent" |
3 | 1961 call PLED_standard_color |
1962 | |
0 | 1963 |
1964 WIN_TOP .145 | |
1965 WIN_LEFT .90 | |
1966 WIN_FONT FT_MEDIUM | |
3 | 1967 call PLED_standard_color |
1968 | |
0 | 1969 |
1970 movff apnoe_mins,lo | |
1971 lfsr FSR2,letter | |
1972 output_8 | |
123 | 1973 PUTC ':' |
0 | 1974 movff apnoe_secs,lo |
1975 output_99x | |
1976 call word_processor | |
1977 WIN_FONT FT_SMALL | |
1978 return | |
1979 | |
1980 PLED_divemins_apnoe: | |
1981 | |
1982 PLED_divemins_gauge: | |
1983 movff divemins+0,lo | |
1984 movff divemins+1,hi | |
1985 bcf leftbind | |
1986 bsf show_last3 | |
1987 lfsr FSR2,letter | |
1988 output_16_3 ;Displays only 0...999 | |
123 | 1989 PUTC ':' |
0 | 1990 movff divesecs,lo |
1991 output_99x | |
1992 WIN_TOP .20 | |
1993 WIN_LEFT .90 | |
1994 WIN_FONT FT_MEDIUM | |
3 | 1995 call PLED_standard_color |
1996 | |
0 | 1997 call word_processor |
1998 bcf show_last3 | |
1999 WIN_FONT FT_SMALL | |
2000 return | |
2001 | |
2002 PLED_stopwatch_show: | |
2003 ; Stopwatch | |
9 | 2004 call PLED_divemask_color ; Set Color for Divemode mask |
87 | 2005 DISPLAYTEXTH d'283' ; Stopwatch |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2006 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2007 PLED_stopwatch_show2: |
3 | 2008 call PLED_standard_color |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2009 ostc_debug 'V' ; Sends debug-information to screen if debugmode active |
87 | 2010 WIN_TOP .192 |
0 | 2011 WIN_LEFT .110 |
2012 WIN_FONT FT_SMALL | |
3 | 2013 call PLED_standard_color |
2014 | |
0 | 2015 lfsr FSR2,letter |
2016 movff average_divesecs+0,lo ; Stopwatch | |
2017 movff average_divesecs+1,hi ; Stopwatch | |
2018 movlw d'2' | |
2019 subwf lo,F | |
2020 movlw d'0' | |
2021 subwfb hi,F ; Subtract 2 seconds | |
2022 | |
2023 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) | |
2024 | |
2025 movff lo,wait_temp | |
2026 movff hi,lo | |
2027 clrf hi | |
2028 | |
2029 movlw d'0' | |
2030 bcf leftbind | |
2031 bsf show_last3 | |
2032 output_16_3 ;Displays only 0...999 | |
123 | 2033 PUTC ':' |
0 | 2034 movff wait_temp,lo |
2035 output_99x | |
2036 call word_processor | |
2037 | |
2038 ostc_debug 'U' ; Sends debug-information to screen if debugmode active | |
2039 | |
87 | 2040 WIN_TOP .216 |
2041 WIN_LEFT .110 | |
0 | 2042 WIN_FONT FT_SMALL |
3 | 2043 call PLED_standard_color |
2044 | |
0 | 2045 lfsr FSR2,letter |
2046 movff avr_rel_pressure+0,lo | |
2047 movff avr_rel_pressure+1,hi | |
2048 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
2049 bsf ignore_digit5 ; do not display 1cm depth | |
2050 output_16dp d'3' | |
2051 bcf leftbind | |
123 | 2052 STRCAT_PRINT "m" |
0 | 2053 return |
2054 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2055 PLED_total_average_show: |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2056 ; Non-Resettable Average |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2057 call PLED_divemask_color ; Set Color for Divemode mask |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2058 DISPLAYTEXTH d'281' ; Avr.Depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2059 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2060 PLED_total_average_show2: |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2061 WIN_TOP .192 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2062 WIN_LEFT .110 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2063 WIN_FONT FT_SMALL |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2064 call PLED_standard_color |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2065 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2066 lfsr FSR2,letter |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2067 movff avr_rel_pressure_total+0,lo |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2068 movff avr_rel_pressure_total+1,hi |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2069 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2070 bsf ignore_digit5 ; do not display 1cm depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2071 bcf leftbind |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2072 output_16dp d'3' |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2073 STRCAT_PRINT "m" |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2074 return |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2075 |
0 | 2076 |
2077 PLED_serial: ; Writes OSTC #Serial and Firmware version in surfacemode | |
2078 ostc_debug 'a' ; Sends debug-information to screen if debugmode active | |
2079 WIN_TOP .0 | |
56 | 2080 WIN_LEFT .1 |
0 | 2081 WIN_FONT FT_SMALL |
2082 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2083 call PLED_standard_color |
2084 | |
0 | 2085 lfsr FSR2,letter |
107 | 2086 OUTPUTTEXTH d'262' ; "OSTC " |
2087 clrf EEADRH | |
2088 clrf EEADR ; Get Serial number LOW | |
2089 call read_eeprom ; read byte | |
2090 movff EEDATA,lo | |
2091 incf EEADR,F ; Get Serial number HIGH | |
2092 call read_eeprom ; read byte | |
2093 movff EEDATA,hi | |
2094 | |
2095 bsf leftbind | |
2096 output_16 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2097 STRCAT " \x85\x86 V" ; Scribble logo... |
0 | 2098 movlw softwareversion_x |
2099 movwf lo | |
2100 bsf leftbind | |
2101 output_8 | |
123 | 2102 PUTC '.' |
0 | 2103 movlw softwareversion_y |
2104 movwf lo | |
2105 bsf leftbind | |
2106 output_99x | |
2107 bcf leftbind | |
2108 call word_processor | |
140 | 2109 |
2110 movlw softwareversion_beta ; =1: Beta, =0: Release | |
2111 decfsz WREG,F | |
2112 return ; Release version -> Return | |
2113 | |
2114 call PLED_warnings_color | |
2115 DISPLAYTEXT d'243' ; beta | |
2116 call PLED_standard_color | |
0 | 2117 return |
2118 | |
2119 PLED_divemode_menu_mask_first: ; Write Divemode menu1 mask | |
2120 ostc_debug 'o' ; Sends debug-information to screen if debugmode active | |
2121 call PLED_menu_clear ; clear "Menu?" | |
123 | 2122 call PLED_standard_color |
0 | 2123 |
2124 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
2125 bra PLED_divemode_menu_mask_first2 | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2126 |
0 | 2127 ; in OC Mode |
2128 DISPLAYTEXT .32 ;"Gaslist" | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2129 DISPLAYTEXT .31 ;"Decoplan" |
0 | 2130 bra PLED_divemode_menu_mask_first3 |
2131 | |
2132 PLED_divemode_menu_mask_first2: | |
2133 ; in CC Mode | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2134 DISPLAYTEXT .238 ;"SetPoint" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2135 DISPLAYTEXT .31 ;"Decoplan" |
0 | 2136 |
2137 PLED_divemode_menu_mask_first3: | |
2138 ; In all modes | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2139 call customview_menu_entry3 ; Show customview-dependent menu entry |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2140 DISPLAYTEXT .241 ;"Display" |
0 | 2141 DISPLAYTEXT .34 ;"Exit" |
2142 return | |
2143 | |
2144 PLED_divemode_set_xgas: ; Displayes the "Set Gas" menu | |
2145 WIN_LEFT .100 | |
2146 WIN_TOP .0 | |
2147 WIN_FONT FT_SMALL | |
3 | 2148 call PLED_standard_color |
2149 | |
123 | 2150 STRCPY "Sel" |
0 | 2151 read_int_eeprom d'24' ; Get Gas6 %O2 |
2152 movff EEDATA,lo | |
2153 bcf leftbind | |
2154 output_99 ; outputs into Postinc2! | |
123 | 2155 PUTC '/' |
0 | 2156 read_int_eeprom d'25' ; Get Gas6 %He |
2157 movff EEDATA,lo | |
2158 output_99 ; outputs into Postinc2! | |
2159 call word_processor | |
2160 DISPLAYTEXT .123 ; O2 + | |
2161 DISPLAYTEXT .124 ; O2 - | |
2162 DISPLAYTEXT .125 ; He + | |
2163 DISPLAYTEXT .126 ; He - | |
2164 return | |
2165 | |
2166 PLED_divemode_simulator_mask: | |
124 | 2167 call PLED_standard_color |
2168 DISPLAYTEXT .254 ; Close | |
2169 DISPLAYTEXT .250 ; + 1m | |
2170 DISPLAYTEXT .251 ; - 1m | |
2171 DISPLAYTEXT .252 ; +10m | |
2172 DISPLAYTEXT .253 ; -10m | |
2173 return | |
0 | 2174 |
123 | 2175 ;----------------------------------------------------------------------------- |
124 | 2176 ; Draw a stop of the deco plan (simulator or dive). |
2177 ; Inputs: lo = depth. Range 3m...93m | |
2178 ; hi = minutes. range 1'..240'. | |
2179 ; win_top = line to draw on screen. | |
2180 ; Trashed: hi, lo, win_height, win_leftx2, win_width, win_color*, | |
2181 ; WREG, PROD, TBLPTR TABLAT. | |
2182 | |
2183 PLED_decoplan_show_stop: | |
2184 ;---- Print depth ---------------------------------------------------- | |
2185 WIN_LEFT .100 | |
2186 call PLED_standard_color | |
2187 lfsr FSR2,letter | |
2188 bsf leftbind | |
2189 output_8 ; outputs into Postinc2! | |
2190 STRCAT_PRINT "m " | |
2191 | |
2192 ;---- Print duration ------------------------------------------------- | |
2193 WIN_LEFT .140 | |
2194 lfsr FSR2,letter | |
2195 | |
2196 movf lo,W ; Swap hi & lo | |
2197 movff hi,lo | |
2198 movwf hi | |
2199 | |
2200 output_8 ; Allow up to 240' | |
2201 STRCAT_PRINT "' " ; 1 to 3 chars for depth. | |
2202 | |
2203 movf lo,W ; Swap back hi & lo | |
2204 movff hi,lo | |
2205 movwf hi | |
2206 | |
2207 ;--------------------------------------------------------------------- | |
2208 ; Draw the bar graph used for deco stops (decoplan in simulator or dive). | |
2209 movff win_top,WREG ; Increment win_top (BANK SAFE) | |
2210 incf WREG | |
2211 movff WREG,win_top | |
2212 movlw d'18'+1 ; 19 --> height (bank safe !) | |
2213 movff WREG,win_height | |
2214 movlw .122 | |
2215 movff WREG,win_leftx2 ; column left (0-159) | |
2216 | |
2217 ; Draw used area (lo = minutes): | |
2218 call PLED_standard_color | |
2219 movlw d'16' ; Limit length (16min) | |
2220 cpfslt hi | |
2221 movwf hi | |
2222 movff hi,win_width ; Bar width | |
2223 tstfsz hi ; Skip 0-size bar... | |
2224 call PLED_box | |
2225 | |
2226 ; Clear unused area: | |
2227 movlw .0 | |
2228 movff WREG,win_color1 | |
2229 movff WREG,win_color2 | |
2230 movlw .122 ; (width+left-1)+1 | |
2231 addwf hi,W | |
2232 movff WREG,win_leftx2 ; --> left | |
2233 movf hi,W | |
2234 sublw .16 ; 16-left --> width | |
2235 movff WREG,win_width | |
2236 tstfsz WREG ; Skip 0-size bar. | |
2237 call PLED_box | |
2238 | |
2239 ; Restore win_top | |
2240 movff win_top,WREG ; decf win_top (BANK SAFE) | |
2241 decf WREG | |
2242 movff WREG,win_top | |
2243 return | |
123 | 2244 |
2245 ;----------------------------------------------------------------------------- | |
124 | 2246 ; Clear unused area belw last stop |
2247 ; Inputs: win_top : last used area... | |
2248 PLED_decoplan_clear_bottom: | |
2249 movff win_top,WREG ; Get back from bank0 | |
2250 btfsc divemode ; In dive mode ? | |
2251 sublw .170 ; Yes: bottom row in divemode | |
2252 btfss divemode ; In dive mode ? | |
2253 sublw .240 ; No: bottom row in planning | |
2254 movff WREG,win_height | |
2255 | |
2256 WIN_LEFT .82 ; Full divemenu width | |
2257 movlw .160-.82+1 | |
2258 movff WREG,win_width | |
2259 | |
2260 clrf WREG ; Fill with black | |
2261 movff WREG,win_color1 | |
2262 movff WREG,win_color2 | |
2263 | |
2264 goto PLED_box | |
123 | 2265 |
2266 ;----------------------------------------------------------------------------- | |
124 | 2267 ; Display the decoplan (simulator or divemode) for GF model |
2268 ; Inputs: char_O_deco_table (array of stop times, in minutes) | |
2269 ; decoplan_page = page number. Displays 5 stop by page. | |
2270 ; | |
2271 decoplan_index equ apnoe_mins ; within each page | |
2272 decoplan_gindex equ apnoe_secs ; global index | |
2273 decoplan_last equ apnoe_max_pressure ; Depth of last stop (CF#29) | |
2274 decoplan_max equ apnoe_max_pressure+1; Number of lines per page. 7 in planning, 5 in diving. | |
2275 | |
2276 PLED_decoplan_gf: | |
2277 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2278 | |
2279 WIN_INVERT 0 | |
2280 | |
2281 ;---- Is there deco stops ? ------------------------------------------ | |
2282 lfsr FSR1,char_O_deco_table | |
2283 movlw .1 | |
2284 movf PLUSW1,W ; char_O_deco_table[1] --> WREG | |
2285 bnz PLED_decoplan_gf_1 | |
2286 | |
2287 ;---- No Deco -------------------------------------------------------- | |
2288 call PLED_standard_color | |
2289 DISPLAYTEXT d'239' ;"No Deco" | |
2290 bsf last_ceiling_gf_shown | |
2291 return | |
2292 | |
2293 PLED_decoplan_gf_1: | |
2294 GETCUSTOM8 d'29' ; Last decostop depth, in m | |
2295 movwf decoplan_last ; --> decoplan_last | |
2296 | |
2297 movlw .8 ; 8 lines/page in decoplan | |
2298 btfsc divemode | |
2299 movlw .6 ; 6 lines/page in divemode. | |
2300 movwf decoplan_max | |
2301 | |
2302 movlw .1 | |
2303 movwf decoplan_index ; Start with index = 1 | |
2304 clrf WREG | |
2305 movff WREG,win_top ; and row = 0 | |
2306 | |
2307 ; Read stop parameters, indexed by decoplan_index and decoplan_page | |
2308 movf decoplan_page,W ; decoplan_gindex = 6*decoplan_page + decoplan_index | |
2309 mulwf decoplan_max | |
2310 movf decoplan_index,W | |
2311 addwf PRODL,W | |
2312 movwf decoplan_gindex ; --> decoplan_gindex | |
2313 | |
2314 bcf last_ceiling_gf_shown ; Not finished yet... | |
2315 | |
2316 PLED_decoplan_gf_2: | |
2317 btfsc decoplan_gindex,5 ; Reached table length (32) ? | |
2318 bra PLED_decoplan_gf_99 ; YES: finished... | |
2319 | |
2320 ; Compute new depth | |
2321 movf decoplan_gindex,W ; depth = 3 * (global index) | |
2322 mullw .3 ; --> PROD | |
2323 movf decoplan_last,W ; depth < decoplan_last (CF#29) ? | |
2324 cpfslt PRODL | |
2325 movf PRODL,W ; NO: take depth, else keep decoplan_last. | |
2326 movwf lo ; --> lo | |
2327 | |
2328 ; Read deepest depth from other bank. | |
2329 movff char_O_array_decodepth,WREG | |
2330 xorwf lo,W ; This is last stop ? | |
2331 btfsc STATUS,Z | |
2332 bsf last_ceiling_gf_shown ; YES: mark for latter... | |
2333 | |
2334 ; Read stop duration | |
2335 movf decoplan_gindex,W ; index | |
2336 movff PLUSW1,hi ; char_O_deco_table[index] --> hi | |
2337 movf hi,W ; time = zero ? | |
2338 bz PLED_decoplan_gf_4 ; Do not display it: continue. | |
2339 | |
2340 ; Display the stop line | |
2341 call PLED_decoplan_show_stop | |
2342 | |
2343 ; Next | |
2344 movff win_top,WREG ; row: += 24 | |
2345 addlw .24 | |
2346 movff WREG,win_top | |
2347 incf decoplan_index,F ; local index += 1 | |
2348 PLED_decoplan_gf_4: | |
2349 incf decoplan_gindex,F ; global index += 1 | |
2350 | |
2351 btfsc last_ceiling_gf_shown ; Last one done ? | |
2352 bra PLED_decoplan_gf_99 ; YES: finished... | |
2353 | |
2354 ; Max number of lines/page reached ? | |
2355 incf decoplan_max,W ; index+1 == max+1 ? | |
2356 cpfseq decoplan_index | |
2357 bra PLED_decoplan_gf_2 ; NO: loop | |
2358 | |
2359 ; Check if next stop if end-of-list ? | |
2360 movlw .3 ; Next stop is lo + 3m | |
2361 addwf lo,W | |
2362 xorwf decoplan_last,W ; == last stop ? | |
2363 bz PLED_decoplan_gf_99 ; End of list... | |
2364 | |
2365 ; Display the message "more..." | |
2366 rcall PLED_decoplan_clear_bottom ; Clear from next line | |
2367 | |
2368 WIN_LEFT .130 - 7*3 | |
2369 call PLED_standard_color | |
2370 STRCPY_PRINT "more..." | |
2371 bcf last_ceiling_gf_shown ; More page to display... | |
2372 return | |
2373 | |
2374 PLED_decoplan_gf_99: | |
2375 bsf last_ceiling_gf_shown ; Nothing more in table to display. | |
2376 rcall PLED_decoplan_clear_bottom ; Clear from next line | |
2377 return | |
2378 | |
2379 ;----------------------------------------------------------------------------- | |
2380 ; Display the decoplan (simulator or divemode) for ZHL-16c model | |
2381 PLED_decoplan: | |
2382 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2383 | |
2384 WIN_INVERT 0 | |
2385 | |
2386 ;---- Is there deco information -------------------------------------- | |
2387 lfsr FSR0,char_O_array_decodepth | |
2388 lfsr FSR1,char_O_array_decotime | |
2389 | |
2390 movf INDF0,W | |
2391 bnz PLED_decoplan1 | |
2392 | |
2393 ;---- No Deco -------------------------------------------------------- | |
2394 call PLED_standard_color | |
2395 DISPLAYTEXT d'239' ;"No Deco" | |
2396 bsf last_ceiling_gf_shown | |
2397 return | |
0 | 2398 |
2399 PLED_decoplan1: | |
124 | 2400 GETCUSTOM8 d'29' ; Last decostop depth, in m |
2401 movwf decoplan_last ; --> decoplan_last | |
2402 | |
2403 movlw .6 ; Max 6 lines in all modes. | |
2404 movwf decoplan_max | |
2405 | |
2406 clrf decoplan_index ; Starts with index = 0 | |
2407 clrf WREG | |
2408 movff WREG,win_top ; and row = 0 | |
2409 | |
30 | 2410 PLED_decoplan2: |
124 | 2411 ; Read stop parameters, indexed by decoplan_index |
2412 movf decoplan_index,W | |
2413 movff PLUSW0,lo ; array_decodepth[index] | |
2414 movff PLUSW1,hi ; array_decotime[index] | |
2415 | |
2416 ; 0 time == end-of-table. | |
2417 movf hi,w | |
2418 bz PLED_decoplan_0 | |
2419 | |
2420 call PLED_decoplan_show_stop | |
2421 | |
2422 movff win_top,WREG ; row += 24 | |
2423 addlw .24 | |
2424 movff WREG,win_top | |
2425 incf decoplan_index,F ; index += 1 | |
2426 | |
2427 ; 6 Stops max... | |
2428 movf decoplan_max,W | |
2429 cpfseq decoplan_index | |
2430 bra PLED_decoplan2 | |
2431 | |
2432 ;---- Additional time in the decoplan ? ------------------------------ | |
2433 movf decoplan_max,W ; Read array_decotime[6] | |
2434 movf PLUSW1,W ; set Z flag | |
2435 movwf lo ; and copy to lo | |
2436 btfsc STATUS,Z ; Zero: nothing to add. | |
2437 return | |
2438 | |
2439 WIN_LEFT .100 | |
2440 call PLED_standard_color | |
2441 | |
2442 STRCPY "add:" | |
2443 output_8 | |
2444 STRCAT_PRINT "'" | |
2445 return | |
2446 | |
2447 PLED_decoplan_0: | |
2448 ;---- Plan not finished to compute ? --------------------------------- | |
2449 decf decoplan_index,W | |
2450 movf PLUSW0,W ; array_decodepth[index-1] | |
2451 subwf decoplan_last,W ; == last stop depth ? | |
2452 bz PLED_decoplan_99 | |
2453 | |
2454 WIN_LEFT .100 | |
2455 call PLED_standard_color | |
2456 STRCPY_PRINT "..." | |
2457 | |
2458 PLED_decoplan_99: | |
2459 return | |
2460 | |
2461 ;----------------------------------------------------------------------------- | |
0 | 2462 PLED_gas_list: |
2463 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
2464 | |
2465 WIN_LEFT .100 | |
2466 WIN_FONT FT_SMALL | |
2467 bsf leftbind | |
2468 | |
2469 movlw d'2' | |
2470 movwf wait_temp ; here: stores eeprom address for gas list | |
2471 movlw d'231' | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2472 movwf waitms_temp ; here: stores row for gas list |
0 | 2473 clrf hi ; here: Gas counter |
2474 | |
2475 PLED_gas_list_loop: | |
2476 incf hi,F ; Increase Gas | |
2477 movlw d'4' | |
2478 addwf wait_temp,F ; Increase eeprom address for gas list | |
2479 movlw d'25' | |
2480 addwf waitms_temp,F ; Increase row | |
2481 WIN_LEFT .100 | |
2482 movff waitms_temp,win_top ; Set Row | |
2483 | |
123 | 2484 STRCPY "G" |
0 | 2485 movff hi,lo ; copy gas number |
2486 output_8 ; display gas number | |
123 | 2487 PUTC ':' |
0 | 2488 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
2489 call read_eeprom ; get byte (stored in EEDATA) | |
2490 movff EEDATA,lo ; copy to lo | |
2491 output_8 ; outputs into Postinc2! | |
123 | 2492 PUTC '/' |
0 | 2493 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
2494 call read_eeprom ; get byte (stored in EEDATA) | |
2495 movff EEDATA,lo ; copy to lo | |
2496 output_8 ; outputs into Postinc2! | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2497 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2498 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
|
2499 call read_eeprom ; get byte (stored in EEDATA) |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2500 PLED_color_code warn_gas_in_gaslist ; Color-code output (%O2 in "EEDATA") |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2501 ; Check if gas needs to be greyed-out (inactive) |
0 | 2502 read_int_eeprom d'27' ; read flag register |
2503 movff hi,lo ; copy gas number | |
2504 PLED_gas_list_loop1: | |
2505 rrcf EEDATA ; roll flags into carry | |
2506 decfsz lo,F ; max. 5 times... | |
2507 bra PLED_gas_list_loop1 | |
19 | 2508 |
2509 movlw color_grey | |
0 | 2510 btfss STATUS,C ; test carry |
19 | 2511 call PLED_set_color ; grey out inactive gases! |
0 | 2512 |
2513 call word_processor | |
19 | 2514 call PLED_standard_color |
0 | 2515 |
2516 movlw d'5' ; list all five gases | |
2517 cpfseq hi ; All gases shown? | |
2518 bra PLED_gas_list_loop ; No | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2519 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2520 DISPLAYTEXT d'122' ; Gas 6.. |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2521 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2522 return ; return (OC mode) |
0 | 2523 |
2524 PLED_splist_start: | |
2525 WIN_LEFT .100 | |
2526 WIN_FONT FT_SMALL | |
2527 bsf leftbind | |
127 | 2528 call PLED_standard_color |
0 | 2529 |
2530 ; list three SP in Gaslist | |
2531 movlw d'35' ; 36 = current SP position in EEPROM | |
2532 movwf wait_temp ; here: stores eeprom address for gas list | |
2533 movlw d'231' | |
2534 movwf waitms_temp ; here: stores row for gas list | |
124 | 2535 clrf decoplan_index ; here: SP counter |
0 | 2536 |
2537 PLED_splist_loop: | |
2538 incf wait_temp,F ; EEPROM address | |
124 | 2539 incf decoplan_index,F ; Increase SP |
0 | 2540 |
2541 movlw d'25' | |
2542 addwf waitms_temp,F ; Increase row | |
2543 movff waitms_temp,win_top ; Set Row | |
2544 WIN_LEFT .100 | |
2545 | |
123 | 2546 STRCPY "SP" |
124 | 2547 movff decoplan_index,lo ; copy gas number |
0 | 2548 output_8 ; display gas number |
123 | 2549 PUTC ':' |
0 | 2550 movff wait_temp, EEADR; SP #hi position |
2551 call read_eeprom ; get byte (stored in EEDATA) | |
2552 movff EEDATA,lo ; copy to lo | |
2553 clrf hi | |
2554 output_16dp d'3' ; outputs into Postinc2! | |
2555 call word_processor | |
2556 | |
2557 movlw d'3' ; list all three SP | |
124 | 2558 cpfseq decoplan_index ; All gases shown? |
0 | 2559 bra PLED_splist_loop ; No |
2560 | |
2561 bcf leftbind | |
2562 return ; no, return | |
2563 | |
2564 PLED_clear_divemode_menu: | |
128 | 2565 WIN_BOX_BLACK .0, .168, .82, .160 |
0 | 2566 return |
2567 | |
2568 PLED_divemenu_cursor: | |
2569 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
|
2570 |
123 | 2571 WIN_BOX_BLACK .0, .150, .85, .95 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2572 |
0 | 2573 WIN_TOP .0 |
2574 WIN_LEFT .85 | |
2575 WIN_FONT FT_SMALL | |
2576 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2577 call PLED_standard_color |
84 | 2578 |
0 | 2579 movff menupos,temp1 |
2580 movlw d'0' | |
2581 dcfsnz temp1,F | |
2582 movlw d'0' | |
2583 dcfsnz temp1,F | |
2584 movlw d'25' | |
2585 dcfsnz temp1,F | |
2586 movlw d'50' | |
2587 dcfsnz temp1,F | |
2588 movlw d'75' | |
2589 dcfsnz temp1,F | |
2590 movlw d'100' | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2591 dcfsnz temp1,F |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2592 movlw d'125' |
0 | 2593 movff WREG,win_top |
3 | 2594 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2595 STRCPY_PRINT "\xB7" ; Cursor |
0 | 2596 return |
2597 | |
128 | 2598 |
2599 ;============================================================================= | |
2600 ; Draw saturation graph, is surface mode or in dive mode. | |
2601 ; | |
0 | 2602 PLED_tissue_saturation_graph: |
2603 ostc_debug 'i' ; Sends debug-information to screen if debugmode active | |
13 | 2604 |
128 | 2605 ;---- Draw Frame --------------------------------------------------------- |
2606 btfsc divemode | |
2607 bra PLED_tsg_1 | |
2608 | |
2609 WIN_FRAME_STD .25, .120, .82, .159 ; Surfmode | |
2610 bra PLED_tsg_2 | |
2611 PLED_tsg_1: | |
2612 WIN_FRAME_STD .169, .239, .90, .159 ; Divemode | |
2613 PLED_tsg_2: | |
2614 | |
2615 ;---- Draw grid ---------------------------------------------------------- | |
133 | 2616 btfss divemode |
2617 bra PLED_no_graph_grid | |
2618 | |
128 | 2619 movlw color_grey |
2620 call PLED_set_color | |
2621 | |
2622 movlw .169+.1 ; divemode | |
2623 movff WREG,win_top | |
2624 movlw .239-.169-.1 ; divemode | |
2625 movff WREG,win_height | |
2626 | |
2627 movlw 1 | |
2628 movff WREG,win_width | |
2629 | |
2630 movlw .122 | |
2631 movff WREG,win_leftx2 | |
2632 call PLED_box | |
2633 movlw .131 | |
2634 movff WREG,win_leftx2 | |
2635 call PLED_box | |
2636 movlw .140 | |
2637 movff WREG,win_leftx2 | |
2638 call PLED_box | |
2639 movlw .149 | |
2640 movff WREG,win_leftx2 | |
2641 call PLED_box | |
133 | 2642 PLED_no_graph_grid: |
128 | 2643 |
2644 ;---- Draw N2 Tissues ---------------------------------------------------- | |
0 | 2645 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2646 movlw d'16' | |
128 | 2647 movwf wait_temp ; 16 tissues |
2648 clrf waitms_temp ; Row offset | |
2649 | |
2650 call PLED_standard_color | |
123 | 2651 movlw .1 |
2652 movff WREG,win_height ; row bottom (0-239) | |
128 | 2653 movlw .82+.18 ; surfmode |
2654 btfsc divemode | |
133 | 2655 movlw .90+.18 ; divemode |
123 | 2656 movff WREG,win_leftx2 ; column left (0-159) |
2657 | |
0 | 2658 PLED_tissue_saturation_graph3: |
128 | 2659 movlw .25+3 ; surfmode: 3pix below top border |
2660 btfsc divemode | |
2661 movlw .169+3 ; divemode | |
0 | 2662 addwf waitms_temp,W |
123 | 2663 movff WREG,win_top ; row top (0-239) |
0 | 2664 |
2665 incf waitms_temp,F | |
2666 incf waitms_temp,F | |
2667 | |
123 | 2668 movf POSTINC2,W |
2669 bcf STATUS,C ; Clear carry | |
2670 rrcf WREG ; And divide by 4 | |
0 | 2671 bcf STATUS,C |
123 | 2672 rrcf WREG |
133 | 2673 movwf temp1 |
2674 | |
2675 movlw .57 ; surfmode: max 57pix | |
2676 btfsc divemode | |
2677 movlw .57-8 ; divemode: 8pix less...s | |
2678 cpfslt temp1 ; skip if 57 (WREG) < win_width | |
2679 movwf temp1 | |
2680 movff temp1,win_width | |
0 | 2681 |
2682 call PLED_box | |
2683 | |
2684 decfsz wait_temp,F | |
2685 bra PLED_tissue_saturation_graph3 | |
2686 | |
128 | 2687 ;---- Draw He Tissues ---------------------------------------------------- |
0 | 2688 lfsr FSR2, char_O_tissue_saturation+.016 ; He |
2689 movlw d'16' | |
128 | 2690 movwf wait_temp ; 16 tissues |
2691 clrf waitms_temp ; Row offset | |
123 | 2692 |
0 | 2693 PLED_tissue_saturation_graph2: |
123 | 2694 |
128 | 2695 movlw .120-.33 ; surfmode : 33pix above bottom border |
2696 btfsc divemode | |
2697 movlw .239-.33 ; divemode | |
0 | 2698 addwf waitms_temp,W |
123 | 2699 movff WREG,win_top ; row top (0-239) |
0 | 2700 |
2701 incf waitms_temp,F | |
2702 incf waitms_temp,F | |
2703 | |
123 | 2704 movf POSTINC2,W |
2705 bcf STATUS,C ; Clear carry | |
2706 rrcf WREG ; And divide by 4 | |
0 | 2707 bcf STATUS,C |
123 | 2708 rrcf WREG |
133 | 2709 movwf temp1 |
2710 movlw .57 ; surfmode: max 57pix | |
2711 btfsc divemode | |
2712 movlw .57-8 ; divemode: 8pix less...s | |
2713 cpfslt temp1 ; skip if 57 (WREG) < win_width | |
2714 movwf temp1 | |
2715 movff temp1,win_width | |
0 | 2716 |
2717 call PLED_box | |
2718 | |
2719 decfsz wait_temp,F | |
2720 bra PLED_tissue_saturation_graph2 | |
2721 | |
128 | 2722 ;---- Draw N2/He Text ---------------------------------------------------- |
2723 movlw .82+2 ; surfmode: 2pix right of left border | |
2724 btfsc divemode | |
2725 movlw .90+2 ; divemode | |
2726 movff WREG,win_leftx2 | |
2727 | |
2728 movlw .25+7 ; surfmode: 7pix below top border | |
2729 btfsc divemode | |
2730 movlw .169+7 ; divemode | |
2731 movff WREG,win_top | |
123 | 2732 STRCPY_PRINT "N2" |
2733 | |
128 | 2734 movlw .120-.30 ; surfmode: 30pix above bottom border |
2735 btfsc divemode | |
2736 movlw .239-.30 ; divemode | |
2737 movff WREG,win_top | |
123 | 2738 STRCPY_PRINT "He" |
128 | 2739 |
2740 ;---- Draw scale and O2[16]% --------------------------------------------- | |
2741 btfsc divemode | |
2742 return | |
19 | 2743 |
2744 movff char_O_gtissue_no,wait_temp ; used as temp | |
2745 | |
2746 lfsr FSR1,char_O_tissue_saturation+0 | |
2747 incf wait_temp,F ; make 1-16 of 0-15 | |
123 | 2748 |
19 | 2749 PLED_tissue_saturation_graph4: ; point to leading tissue... |
2750 movff POSTINC1,lo ; copy/overwrite to lo register | |
2751 decfsz wait_temp,F ; count until zero | |
2752 bra PLED_tissue_saturation_graph4 ;loop | |
123 | 2753 |
19 | 2754 WIN_TOP .62 |
2755 WIN_FONT FT_SMALL | |
128 | 2756 lfsr FSR2,letter |
2757 bsf leftbind | |
2758 output_8 | |
19 | 2759 bcf leftbind |
2760 | |
128 | 2761 STRCAT_PRINT "% " |
2762 | |
2763 ;---- Draw Scale --------------------------------------------------------- | |
123 | 2764 WIN_BOX_STD .73, .74, .121, .157 |
2765 WIN_BOX_STD .61, .84, .121, .122 | |
2766 WIN_BOX_STD .65, .80, .130, .131 | |
2767 WIN_BOX_STD .65, .80, .139, .140 | |
2768 WIN_BOX_STD .65, .80, .148, .149 | |
2769 WIN_BOX_STD .61, .84, .157, .158 | |
0 | 2770 return |
2771 | |
128 | 2772 ;============================================================================= |
2773 | |
0 | 2774 PLED_startupscreen1: |
2775 call PLED_topline_box | |
2776 WIN_INVERT .1 ; Init new Wordprocessor | |
2777 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
2778 WIN_INVERT .0 ; Init new Wordprocessor | |
2779 DISPLAYTEXT .68 ; Licence 1/2 | |
2780 DISPLAYTEXT .69 | |
2781 DISPLAYTEXT .70 | |
2782 DISPLAYTEXT .71 | |
2783 DISPLAYTEXT .72 | |
2784 DISPLAYTEXT .73 | |
2785 DISPLAYTEXT .74 | |
2786 return | |
2787 | |
2788 PLED_startupscreen2: | |
2789 call PLED_topline_box | |
2790 WIN_INVERT .1 ; Init new Wordprocessor | |
2791 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
2792 WIN_INVERT .0 ; Init new Wordprocessor | |
2793 DISPLAYTEXT .75 ; Licence 2/2 | |
2794 DISPLAYTEXT .76 | |
2795 DISPLAYTEXT .77 | |
2796 DISPLAYTEXT .78 | |
2797 DISPLAYTEXT .79 | |
2798 DISPLAYTEXT .80 | |
2799 DISPLAYTEXT .81 | |
2800 return | |
2801 | |
2802 PLED_new_cf_warning: | |
2803 call PLED_topline_box | |
2804 WIN_INVERT .1 ; Init new Wordprocessor | |
2805 DISPLAYTEXTH .271 ; New CF added! | |
2806 WIN_INVERT .0 ; Init new Wordprocessor | |
2807 DISPLAYTEXTH .272 ; New CustomFunctions | |
2808 DISPLAYTEXTH .273 ; were added! Check | |
2809 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
2810 DISPLAYTEXTH .275 ; for Details! | |
2811 return | |
2812 | |
2813 PLED_const_ppO2_value: | |
2814 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
2815 return ; Yes, No update and return! | |
2816 | |
2817 ostc_debug 'j' ; Sends debug-information to screen if debugmode active | |
2818 | |
2819 WIN_TOP .168 | |
75 | 2820 WIN_LEFT .50 |
0 | 2821 WIN_FONT FT_SMALL |
2822 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 2823 |
0 | 2824 lfsr FSR2,letter |
2825 movff char_I_const_ppO2,lo | |
2826 | |
2827 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
2828 bra PLED_const_ppO2_value2 ; No, display Setpoint | |
2829 | |
2830 ; Yes, Display "Bail" | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2831 call PLED_standard_color |
0 | 2832 OUTPUTTEXTH d'263' ;"Bail" |
2833 call word_processor | |
2834 return | |
2835 | |
2836 PLED_const_ppO2_value2: ; Display SetPoint | |
2837 ;Show fixed SP value | |
4 | 2838 movff amb_pressure+0,xA+0 |
2839 movff amb_pressure+1,xA+1 | |
2840 movlw d'10' | |
2841 movwf xB+0 | |
2842 clrf xB+1 | |
2843 ;xA/xB=xC with xA as remainder | |
2844 call div16x16 ; xC+0=p_amb/10 | |
26 | 2845 |
4 | 2846 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
2847 tstfsz xC+1 ; xC>255 | |
2848 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 2849 |
4 | 2850 movff ppO2_setpoint_store,WREG |
2851 cpfslt xC+0 ; Setpoint value possible? | |
26 | 2852 bra PLED_const_ppO2_value1 ; Yes |
4 | 2853 |
2854 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
2855 bra PLED_const_ppO2_value1a | |
2856 | |
2857 PLED_const_ppO2_value1: | |
26 | 2858 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
2859 movff amb_pressure+0,xA+0 | |
2860 movff amb_pressure+1,xA+1 | |
2861 movlw d'10' | |
2862 movwf xB+0 | |
2863 clrf xB+1 | |
2864 call div16x16 ; xC=p_amb/10 | |
2865 movff xC+0,xA+0 | |
2866 movff xC+1,xA+1 | |
2867 movff char_I_O2_ratio,xB+0 | |
2868 clrf xB+1 | |
2869 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
2870 | |
2871 movff xC+0,sub_b+0 | |
2872 movff xC+1,sub_b+1 | |
2873 movff ppO2_setpoint_store,WREG; Setpoint | |
2874 mullw d'100' ; Setpoint*100 | |
2875 movff PRODL,sub_a+0 | |
2876 movff PRODH,sub_a+1 | |
2877 call sub16 ; sub_c = sub_a - sub_b | |
2878 | |
2879 btfss neg_flag | |
2880 bra PLED_const_ppO2_value11 ; Value in range | |
2881 | |
2882 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
2883 | |
2884 movff xC+0,xA+0 | |
2885 movff xC+1,xA+1 | |
2886 movlw d'100' | |
2887 movwf xB+0 | |
2888 clrf xB+1 | |
2889 call div16x16 ;xA/xB=xC with xA as remainder | |
2890 | |
2891 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
138 | 2892 |
2893 GETCUSTOM8 d'39' ; Adjust fixed SP? | |
2894 dcfsnz WREG,F | |
2895 bra PLED_const_ppO2_value1a ; Yes! | |
2896 ; Do not adjust -> restore original SetPoint | |
26 | 2897 |
2898 PLED_const_ppO2_value11: | |
2899 ; Setpoint in possible limits | |
4 | 2900 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
2901 | |
2902 PLED_const_ppO2_value1a: | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2903 PLED_color_code warn_ppo2 ; Color-code output |
4 | 2904 movff char_I_const_ppO2,lo |
0 | 2905 clrf hi |
2906 bsf leftbind | |
2907 output_16dp d'3' | |
2908 bcf leftbind | |
2909 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2910 call PLED_standard_color |
0 | 2911 return |
2912 | |
2913 PLED_show_leading_tissue: | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2914 call PLED_divemask_color ; Set Color for Divemode mask |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2915 DISPLAYTEXTH .282 ; L. Tissue: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2916 PLED_show_leading_tissue_2: |
116 | 2917 call deco_calc_desaturation_time ; calculate desaturation time |
0 | 2918 movlb b'00000001' ; select ram bank 1 |
2919 | |
123 | 2920 STRCPY "#" |
0 | 2921 movff char_O_gtissue_no,lo |
2922 movff char_O_gtissue_no,wait_temp ; used as temp | |
2923 bsf leftbind | |
2924 output_8 | |
123 | 2925 STRCAT " (" |
0 | 2926 |
2927 movlw d'16' | |
2928 cpfslt wait_temp | |
2929 bra PLED_show_leading_tissue_he | |
123 | 2930 STRCAT "N2" |
0 | 2931 bra PLED_show_leading_tissue2 |
123 | 2932 |
0 | 2933 PLED_show_leading_tissue_he: |
123 | 2934 STRCAT "He" |
2935 | |
0 | 2936 PLED_show_leading_tissue2: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2937 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2938 WIN_TOP .192 |
0 | 2939 WIN_FONT FT_SMALL |
3 | 2940 call PLED_standard_color |
123 | 2941 |
2942 STRCAT_PRINT ") " | |
2943 | |
0 | 2944 lfsr FSR1,char_O_tissue_saturation+0 |
2945 incf wait_temp,F ; make 1-16 of 0-15 | |
2946 PLED_show_leading_tissue3: ; point to leading tissue... | |
2947 movff POSTINC1,lo ; copy/overwrite to lo register | |
2948 decfsz wait_temp,F ; count until zero | |
2949 bra PLED_show_leading_tissue3 ;loop | |
123 | 2950 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2951 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2952 WIN_TOP .216 |
0 | 2953 WIN_FONT FT_SMALL |
123 | 2954 |
2955 lfsr FSR2,letter | |
2956 output_8 | |
2957 STRCAT_PRINT "% " | |
0 | 2958 bcf leftbind |
2959 return | |
2960 | |
2961 PLED_topline_box_clear: ; Writes an empty box | |
2962 movlw .0 | |
2963 bra PLED_topline_box2 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2964 PLED_topline_box: ; Writes a filled box... |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2965 GETCUSTOM8 d'35' ; ... with the standard color |
0 | 2966 PLED_topline_box2: |
123 | 2967 WIN_BOX_COLOR .0, .26, .0, .159 |
0 | 2968 return |
2969 | |
2970 PLED_display_cns: | |
2971 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
2972 return ; Yes, No update and return! | |
2973 | |
2974 btfsc gauge_mode ; Do not display in gauge mode | |
2975 return | |
2976 | |
2977 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
2978 return | |
2979 | |
2980 btfsc pled_velocity_display ; Is velocity displayed?` | |
2981 return ; Yes, do not overwrite until pled_velocity_clear was called | |
2982 | |
2983 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
2984 | |
2985 WIN_TOP .090 | |
2986 WIN_LEFT .0 | |
2987 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2988 PLED_color_code warn_cns ; Color-code CNS output |
0 | 2989 |
123 | 2990 STRCPY "CNS:" |
0 | 2991 movff char_O_CNS_fraction,lo |
2992 bsf leftbind | |
2993 output_8 | |
2994 bcf leftbind | |
123 | 2995 STRCAT_PRINT "%" |
0 | 2996 return |
2997 | |
43 | 2998 PLED_display_cns_surface: |
2999 ; Check if CNS should be displayed | |
3000 movff char_O_CNS_fraction,lo ; copy into bank1 | |
3001 GETCUSTOM8 d'15' ; cns_display_high_surfacemode | |
3002 subwf lo,W | |
3003 btfss STATUS,C | |
3004 return ; Do not show... | |
3005 ; Show CNS | |
3006 | |
3007 ostc_debug 'W' ; Sends debug-information to screen if debugmode active | |
3008 | |
3009 WIN_TOP .175 | |
3010 WIN_LEFT .45 | |
3011 WIN_FONT FT_SMALL | |
3012 WIN_INVERT .0 ; Init new Wordprocessor | |
3013 PLED_color_code warn_cns ; Color-code CNS output | |
3014 | |
123 | 3015 STRCPY "CNS:" |
43 | 3016 movff char_O_CNS_fraction,lo |
3017 bsf leftbind | |
3018 output_8 | |
3019 bcf leftbind | |
123 | 3020 STRCAT_PRINT "%" |
43 | 3021 return |
3022 | |
3023 | |
0 | 3024 PLED_custom_text: |
3025 read_int_eeprom d'64' | |
3026 movlw d'1' | |
3027 cpfseq EEDATA ; Custom text active? | |
3028 bra PLED_clear_custom_text ; No, Delete row | |
3029 WIN_TOP .200 | |
62 | 3030 WIN_LEFT .0 |
0 | 3031 WIN_FONT FT_SMALL |
3032 WIN_INVERT .0 ; Init new Wordprocessor | |
9 | 3033 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 3034 |
3035 lfsr FSR2,letter | |
3036 movlw d'64' | |
3037 movwf lo | |
3038 movlw d'24' | |
3039 movwf hi ; counter | |
3040 | |
3041 PLED_custom_text1: | |
3042 incf lo,F | |
3043 call PLED_get_custom_letter ; Get one letter for the custom text | |
3044 movlw '}' ; End marker found? | |
3045 cpfseq EEDATA | |
3046 bra PLED_custom_text2 ; No | |
3047 bra PLED_custom_text3 | |
3048 PLED_custom_text2: | |
3049 movff EEDATA,POSTINC2 ; Copy into Postinc | |
3050 | |
3051 decfsz hi,F ; Max. numbers? | |
3052 bra PLED_custom_text1 ; No, get next letters | |
3053 | |
3054 PLED_custom_text3: | |
3055 call word_processor | |
3 | 3056 call PLED_standard_color |
0 | 3057 return |
3058 | |
3059 PLED_get_custom_letter: | |
3060 movff lo,EEADR ; Address for next custom text letter | |
3061 call read_eeprom ; Read letter | |
3062 return | |
3063 | |
3064 PLED_clear_custom_text: | |
3065 movlw d'24' | |
3066 movwf temp1 | |
3067 WIN_TOP .200 | |
3068 WIN_LEFT .0 | |
3069 call PLED_display_clear_common_y1 | |
3070 return | |
3071 | |
33 | 3072 PLED_simdata_screen: ;Display Pre-Dive Screen |
3073 ; List active gases/Setpoints | |
3074 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
3075 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list | |
3076 | |
3077 PLED_simdata_screen2: | |
3078 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
3079 | |
3080 WIN_LEFT .0 | |
3081 WIN_FONT FT_SMALL | |
3082 bsf leftbind | |
3083 | |
3084 movlw d'2' | |
3085 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3086 movlw d'10' |
33 | 3087 movwf waitms_temp ; here: stores row for gas list |
3088 clrf hi ; here: Gas counter | |
3089 | |
3090 PLED_simdata_screen2_loop: | |
3091 incf hi,F ; Increase Gas | |
3092 movlw d'4' | |
3093 addwf wait_temp,F ; Increase eeprom address for gas list | |
3094 | |
123 | 3095 STRCPY "G" |
33 | 3096 movff hi,lo ; copy gas number |
3097 output_8 ; display gas number | |
123 | 3098 PUTC ':' |
33 | 3099 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
3100 call read_eeprom ; get byte (stored in EEDATA) | |
3101 movff EEDATA,lo ; copy to lo | |
3102 output_8 ; outputs into Postinc2! | |
123 | 3103 PUTC '/' |
33 | 3104 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
3105 call read_eeprom ; get byte (stored in EEDATA) | |
3106 movff EEDATA,lo ; copy to lo | |
3107 output_8 ; outputs into Postinc2! | |
123 | 3108 PUTC ' ' |
34 | 3109 movf hi,W ; Gas number |
3110 addlw d'27' ; -> Adress of change depth register | |
3111 call read_int_eeprom_1 | |
3112 movff EEDATA,lo ; Change depth in m | |
3113 output_99 ; outputs into Postinc2! | |
123 | 3114 PUTC 'm' |
33 | 3115 read_int_eeprom d'27' ; read flag register |
3116 movff hi,lo ; copy gas number | |
3117 PLED_simdata_screen2_loop1: | |
3118 rrcf EEDATA ; roll flags into carry | |
3119 decfsz lo,F ; max. 5 times... | |
3120 bra PLED_simdata_screen2_loop1 | |
3121 | |
3122 btfsc STATUS,C ; test carry | |
3123 bra PLED_simdata_white | |
3124 | |
3125 movlw color_grey | |
3126 call PLED_set_color ; grey out inactive gases! | |
3127 bra PLED_simdata_color_done | |
3128 | |
3129 PLED_simdata_white: | |
3130 call PLED_standard_color | |
3131 | |
3132 PLED_simdata_color_done: | |
3133 movlw d'25' | |
3134 addwf waitms_temp,F ; Increase row | |
3135 WIN_LEFT .0 | |
3136 movff waitms_temp,win_top ; Set Row | |
34 | 3137 call word_processor ; display gas |
33 | 3138 |
3139 PLED_simdata_screen2b: | |
3140 call PLED_standard_color | |
3141 | |
34 | 3142 movlw d'5' ; list all five gases |
33 | 3143 cpfseq hi ; All gases shown? |
3144 bra PLED_simdata_screen2_loop ; No | |
3145 | |
3146 return ; No, return (OC mode) | |
3147 | |
3148 PLED_simdata_screen3: | |
3149 WIN_LEFT .0 | |
3150 WIN_FONT FT_SMALL | |
3151 bsf leftbind | |
3152 | |
3153 ; list three SP in Gaslist | |
3154 movlw d'35' ; 36 = current SP position in EEPROM | |
3155 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3156 movlw d'10' |
33 | 3157 movwf waitms_temp ; here: stores row for gas list |
124 | 3158 clrf decoplan_index ; here: SP counter |
33 | 3159 |
3160 PLED_simdata_screen3_loop: | |
3161 incf wait_temp,F ; EEPROM address | |
124 | 3162 incf decoplan_index,F ; Increase SP |
33 | 3163 |
3164 movlw d'25' | |
3165 addwf waitms_temp,F ; Increase row | |
3166 WIN_LEFT .0 | |
3167 movff waitms_temp,win_top ; Set Row | |
3168 | |
123 | 3169 STRCPY "SP" |
124 | 3170 movff decoplan_index,lo ; copy gas number |
33 | 3171 output_8 ; display gas number |
123 | 3172 STRCAT ": " |
33 | 3173 movff wait_temp, EEADR; SP #hi position |
3174 call read_eeprom ; get byte (stored in EEDATA) | |
3175 movff EEDATA,lo ; copy to lo | |
3176 clrf hi | |
3177 output_16dp d'3' ; outputs into Postinc2! | |
3178 call word_processor | |
3179 | |
3180 movlw d'3' ; list all three SP | |
124 | 3181 cpfseq decoplan_index ; All gases shown? |
33 | 3182 bra PLED_simdata_screen3_loop ;no |
3183 | |
3184 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
3185 movff EEDATA,active_gas ; Read start gas (1-5) | |
3186 decf active_gas,W ; Gas 0-4 | |
3187 mullw d'4' | |
3188 movf PRODL,W | |
3189 addlw d'7' ; = address for He ratio | |
3190 movwf EEADR | |
3191 call read_eeprom ; Read He ratio | |
3192 movff EEDATA,hi ; And copy into hold register | |
3193 decf active_gas,W ; Gas 0-4 | |
3194 mullw d'4' | |
3195 movf PRODL,W | |
3196 addlw d'6' ; = address for O2 ratio | |
3197 movwf EEADR | |
3198 call read_eeprom ; Read O2 ratio | |
3199 movff EEDATA, lo ; O2 ratio | |
3200 | |
3201 WIN_LEFT .0 | |
34 | 3202 WIN_TOP .110 |
123 | 3203 |
3204 STRCPY "Dil:" | |
33 | 3205 output_8 ; O2 Ratio |
123 | 3206 STRCAT "/" |
33 | 3207 movff hi,lo |
3208 output_8 ; He Ratio | |
3209 call word_processor | |
3210 | |
3211 bcf leftbind | |
3212 return ; Return (CC Mode) | |
3213 | |
0 | 3214 |
3215 | |
3216 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | |
3217 | |
3218 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
3219 return | |
3220 | |
3221 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
3222 movff EEDATA, wait_temp ; salinity | |
3223 | |
3224 movlw d'105' ; 105% ? | |
3225 cpfslt wait_temp ; Salinity higher limit | |
3226 return ; Out of limit, do not adjust lo:hi | |
3227 | |
3228 movlw d'99' ; 99% ? | |
3229 cpfsgt wait_temp ; Salinity lower limit | |
3230 return ; Out of limit, do not adjust lo:hi | |
3231 | |
3232 movff lo,xA+0 | |
3233 movff hi,xA+1 | |
3234 | |
3235 movlw d'100' | |
3236 movwf xB+0 | |
3237 clrf xB+1 | |
3238 | |
3239 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
3240 | |
3241 movff wait_temp,xB+0 ; Salinity | |
3242 clrf xB+1 | |
3243 | |
3244 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3245 | |
3246 movff xC+0,lo | |
3247 movff xC+1,hi ; restore lo and hi with updated value | |
3248 | |
3249 return |