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