Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 65:5ad68065e4e6
displays 16stops in gf mode
author | heinrichsweikamp |
---|---|
date | Wed, 06 Oct 2010 22:50:58 +0200 |
parents | e8756eba54ee |
children | 6aee3a07f370 |
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 |
0 | 383 DISPLAYTEXT d'85' ; DECOSUM |
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 |
65 | 2439 ;PLED_decoplan_gf_page_current0: |
2440 ; movlw d'1' | |
2441 ; cpfseq temp8 | |
2442 ; bra PLED_decoplan_gf_page_current1 | |
2443 ; bra PLED_decoplan_gf_page2 ; =1: Dispplay Page 2 | |
2444 ;PLED_decoplan_gf_page_current1: | |
2445 ; movlw d'2' | |
2446 ; cpfseq temp8 | |
2447 ; bra PLED_decoplan_gf_page4 ; >2: Display Page 4 | |
2448 ; bra PLED_decoplan_gf_page3 ; =1: Dispplay Page 3 | |
2449 ; | |
64 | 2450 PLED_decoplan_gf_page1: |
2451 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2452 | |
2453 movff char_O_array_decodepth+0,lo ; Get Depth | |
2454 tstfsz lo | |
2455 bra PLED_decoplan_gf_page1x | |
2456 ; No Deco, show "no Deco" | |
2457 DISPLAYTEXT d'239' ;"No Deco" | |
2458 return | |
2459 | |
65 | 2460 ;PLED_decoplan_gf_page4: |
2461 ; ; temp7 holds last displayed depth | |
2462 ; ; temp5 list entry | |
2463 ; movlw .231 | |
2464 ; movwf temp6 ; row | |
2465 ; movff temp5,temp9 ; save | |
2466 ; movff temp7,temp10 ; save | |
2467 ;PLED_decoplan_gf_page4y: | |
2468 ; movlw d'3' | |
2469 ; addwf temp7,F ; Add 3m for next stop | |
2470 ; movlw d'25' | |
2471 ; addwf temp6,F | |
2472 ; incf temp5,F | |
2473 ; call PLED_decoplan_show_stop_gf | |
2474 ; movlw d'23' ; Stops 18-23 | |
2475 ; cpfseq temp5 | |
2476 ; bra PLED_decoplan_gf_page4y | |
2477 ; movff temp9,temp5 ; restore | |
2478 ; movff temp10,temp7 ; restore | |
2479 ; bsf last_ceiling_gf_shown ; Set flag | |
2480 ; return | |
2481 ; | |
2482 ;PLED_decoplan_gf_page3: | |
2483 ; ; temp7 holds last displayed depth | |
2484 ; ; temp5 list entry | |
2485 ; movff temp5,temp9 ; save | |
2486 ; movff temp7,temp10 ; save | |
2487 ; movlw .231 | |
2488 ; movwf temp6 ; row | |
2489 ;PLED_decoplan_gf_page3y: | |
2490 ; movlw d'3' | |
2491 ; addwf temp7,F ; Add 3m for next stop | |
2492 ; movlw d'25' | |
2493 ; addwf temp6,F | |
2494 ; incf temp5,F | |
2495 ; call PLED_decoplan_show_stop_gf | |
2496 ; movlw d'17' ; Stops 12-17 | |
2497 ; cpfseq temp5 | |
2498 ; bra PLED_decoplan_gf_page3y | |
2499 ; movff temp9,temp5 ; restore | |
2500 ; movff temp10,temp7 ; restore | |
2501 ; return | |
64 | 2502 |
2503 PLED_decoplan_gf_page2: | |
2504 ; temp7 holds last displayed depth | |
2505 ; temp5 list entry | |
65 | 2506 ; movff temp5,temp9 ; save |
2507 ; movff temp7,temp10 ; save | |
64 | 2508 movlw .231 |
2509 movwf temp6 ; row | |
2510 PLED_decoplan_gf_page2y: | |
2511 movlw d'3' | |
2512 addwf temp7,F ; Add 3m for next stop | |
2513 movlw d'25' | |
2514 addwf temp6,F | |
2515 incf temp5,F | |
2516 call PLED_decoplan_show_stop_gf | |
65 | 2517 movlw d'15' ; the next 8 Stops... |
64 | 2518 cpfseq temp5 |
2519 bra PLED_decoplan_gf_page2y | |
65 | 2520 ; movff temp9,temp5 ; restore |
2521 ; movff temp10,temp7 ; restore | |
2522 bsf last_ceiling_gf_shown ; Set flag | |
64 | 2523 return |
2524 | |
2525 PLED_decoplan_gf_page1x: | |
2526 clrf temp8 ; Page 0-3 of deco list | |
2527 GETCUSTOM8 d'29' ; Last Deco in m | |
2528 movwf temp7 ; Start with last stop | |
2529 setf temp5 | |
2530 movlw .231 | |
2531 movwf temp6 ; row | |
2532 | |
2533 ; Show last stop manually | |
2534 movlw d'25' | |
2535 addwf temp6,F | |
2536 incf temp5,F | |
2537 call PLED_decoplan_show_stop_gf | |
2538 GETCUSTOM8 d'29' ; Last Deco in m | |
65 | 2539 movlb .1 |
64 | 2540 movwf temp7 ; Last deco |
65 | 2541 movlw d'4' |
2542 cpfslt temp7 ; >=3m? | |
2543 ; cpfslt temp7 ; >=3m? | |
2544 bra PLED_decoplan_gf_page1x_next_6m | |
2545 | |
64 | 2546 movlw d'3' |
2547 movwf temp7 | |
2548 bra PLED_decoplan_gf_page1y | |
2549 | |
2550 PLED_decoplan_gf_page1x_next_6m: | |
2551 movlw d'6' | |
2552 movwf temp7 | |
2553 PLED_decoplan_gf_page1y: | |
2554 movlw d'3' | |
2555 addwf temp7,F ; Add 3m for next stop | |
2556 movlw d'25' | |
2557 addwf temp6,F | |
2558 incf temp5,F | |
2559 call PLED_decoplan_show_stop_gf | |
65 | 2560 movlw d'7' ; the next 7 Stops... |
64 | 2561 cpfseq temp5 |
2562 bra PLED_decoplan_gf_page1y | |
2563 return | |
2564 | |
2565 PLED_decoplan_show_stop_gf: | |
2566 bsf leftbind | |
2567 WIN_LEFT .100 | |
2568 movff temp6,win_top | |
2569 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
2570 | |
2571 movff char_O_array_decodepth+0,WREG ; Ceiling | |
2572 cpfslt temp7 ; Ceiling already displayed? | |
2573 goto PLED_decoplan_delete ; Yes, quit display and RETURN | |
2574 movff temp7,lo ; Decodepth | |
2575 | |
2576 lfsr FSR2,letter | |
2577 output_8 ; outputs into Postinc2! | |
2578 movlw 'm' | |
2579 movwf POSTINC2 | |
2580 call word_processor | |
2581 WIN_LEFT .140 | |
2582 movff temp6,win_top | |
2583 lfsr FSR1,0x251 | |
2584 movf temp5,W ; number of entry | |
2585 movff PLUSW1,lo | |
2586 lfsr FSR2,letter | |
2587 output_99x ; outputs into Postinc2! | |
2588 movlw d'39' ;"'" | |
2589 movwf POSTINC2 | |
2590 call word_processor | |
2591 tstfsz lo ; 0 min "Stop"? | |
2592 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2593 return | |
2594 | |
2595 | |
0 | 2596 PLED_decoplan: ; display the Decoplan |
2597 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2598 | |
2599 movff char_O_array_decodepth+0,lo ; Get Depth | |
2600 tstfsz lo | |
2601 bra PLED_decoplan1 | |
2602 ; No Deco, show "no Deco" | |
64 | 2603 ; call PLED_clear_divemode_menu ; Clear Deco area |
0 | 2604 DISPLAYTEXT d'239' ;"No Deco" |
2605 return | |
2606 | |
2607 PLED_decoplan1: | |
30 | 2608 setf temp5 |
2609 movlw .231 | |
2610 movwf temp6 ; row | |
2611 PLED_decoplan2: | |
2612 movlw d'25' | |
2613 addwf temp6,F | |
2614 incf temp5,F | |
2615 call PLED_decoplan_show_stop | |
2616 movlw d'5' ; 6 Stops... | |
2617 cpfseq temp5 | |
2618 bra PLED_decoplan2 | |
2619 return | |
2620 | |
2621 PLED_decoplan_show_stop: | |
0 | 2622 bsf leftbind |
2623 WIN_LEFT .100 | |
30 | 2624 movff temp6,win_top |
2625 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
2626 | |
2627 lfsr FSR1,char_O_array_decodepth;+0 | |
2628 movf temp5,W ; number of entry | |
2629 movff PLUSW1,lo | |
0 | 2630 movf lo,w |
2631 btfsc STATUS,Z ; =0 | |
2632 goto PLED_decoplan_delete ; Yes, quit display | |
30 | 2633 |
0 | 2634 lfsr FSR2,letter |
2635 output_8 ; outputs into Postinc2! | |
2636 movlw 'm' | |
2637 movwf POSTINC2 | |
2638 call word_processor | |
30 | 2639 |
0 | 2640 WIN_LEFT .140 |
30 | 2641 movff temp6,win_top |
2642 | |
2643 lfsr FSR1,char_O_array_decotime;+0 | |
2644 movf temp5,W ; number of entry | |
2645 movff PLUSW1,lo | |
2646 | |
2647 lfsr FSR2,letter | |
0 | 2648 output_99x ; outputs into Postinc2! |
2649 movlw d'39' ;"'" | |
2650 movwf POSTINC2 | |
2651 call word_processor | |
64 | 2652 tstfsz lo ; 0 min "Stop"? |
2653 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
0 | 2654 return |
2655 | |
64 | 2656 |
0 | 2657 PLED_gas_list: |
2658 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
2659 | |
2660 WIN_LEFT .100 | |
2661 WIN_FONT FT_SMALL | |
2662 bsf leftbind | |
2663 | |
2664 movlw d'2' | |
2665 movwf wait_temp ; here: stores eeprom address for gas list | |
2666 movlw d'231' | |
2667 movwf waitms_temp ; here: stores row for gas list | |
2668 clrf hi ; here: Gas counter | |
2669 | |
2670 PLED_gas_list_loop: | |
2671 incf hi,F ; Increase Gas | |
2672 movlw d'4' | |
2673 addwf wait_temp,F ; Increase eeprom address for gas list | |
2674 movlw d'25' | |
2675 addwf waitms_temp,F ; Increase row | |
2676 WIN_LEFT .100 | |
2677 movff waitms_temp,win_top ; Set Row | |
2678 | |
2679 lfsr FSR2,letter | |
2680 movlw 'G' | |
2681 movwf POSTINC2 | |
2682 movff hi,lo ; copy gas number | |
2683 output_8 ; display gas number | |
2684 movlw ':' | |
2685 movwf POSTINC2 | |
2686 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
2687 call read_eeprom ; get byte (stored in EEDATA) | |
2688 movff EEDATA,lo ; copy to lo | |
2689 output_8 ; outputs into Postinc2! | |
2690 movlw '/' | |
2691 movwf POSTINC2 | |
2692 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
2693 call read_eeprom ; get byte (stored in EEDATA) | |
2694 movff EEDATA,lo ; copy to lo | |
2695 output_8 ; outputs into Postinc2! | |
2696 | |
2697 | |
2698 read_int_eeprom d'27' ; read flag register | |
2699 movff hi,lo ; copy gas number | |
2700 PLED_gas_list_loop1: | |
2701 rrcf EEDATA ; roll flags into carry | |
2702 decfsz lo,F ; max. 5 times... | |
2703 bra PLED_gas_list_loop1 | |
19 | 2704 |
2705 movlw color_grey | |
0 | 2706 btfss STATUS,C ; test carry |
19 | 2707 call PLED_set_color ; grey out inactive gases! |
0 | 2708 |
2709 call word_processor | |
19 | 2710 call PLED_standard_color |
0 | 2711 |
2712 movlw d'5' ; list all five gases | |
2713 cpfseq hi ; All gases shown? | |
2714 bra PLED_gas_list_loop ; No | |
2715 | |
2716 return ; No, return (OC mode) | |
2717 | |
2718 PLED_splist_start: | |
2719 WIN_LEFT .100 | |
2720 WIN_FONT FT_SMALL | |
2721 bsf leftbind | |
2722 | |
2723 ; list three SP in Gaslist | |
2724 movlw d'35' ; 36 = current SP position in EEPROM | |
2725 movwf wait_temp ; here: stores eeprom address for gas list | |
2726 movlw d'231' | |
2727 movwf waitms_temp ; here: stores row for gas list | |
2728 clrf temp5 ; here: SP counter | |
2729 | |
2730 PLED_splist_loop: | |
2731 incf wait_temp,F ; EEPROM address | |
2732 incf temp5,F ; Increase SP | |
2733 | |
2734 movlw d'25' | |
2735 addwf waitms_temp,F ; Increase row | |
2736 movff waitms_temp,win_top ; Set Row | |
2737 WIN_LEFT .100 | |
2738 | |
2739 lfsr FSR2,letter | |
2740 movlw 'S' | |
2741 movwf POSTINC2 | |
2742 movlw 'P' | |
2743 movwf POSTINC2 | |
2744 movff temp5,lo ; copy gas number | |
2745 output_8 ; display gas number | |
2746 movlw ':' | |
2747 movwf POSTINC2 | |
2748 movff wait_temp, EEADR; SP #hi position | |
2749 call read_eeprom ; get byte (stored in EEDATA) | |
2750 movff EEDATA,lo ; copy to lo | |
2751 clrf hi | |
2752 output_16dp d'3' ; outputs into Postinc2! | |
2753 call word_processor | |
2754 | |
2755 movlw d'3' ; list all three SP | |
2756 cpfseq temp5 ; All gases shown? | |
2757 bra PLED_splist_loop ; No | |
2758 | |
2759 bcf leftbind | |
2760 return ; no, return | |
2761 | |
2762 PLED_clear_divemode_menu: | |
2763 movlw .0 | |
2764 movff WREG,box_temp+0 ; Data | |
2765 movlw .0 | |
2766 movff WREG,box_temp+1 ; row top (0-239) | |
30 | 2767 ; movlw .125 |
2768 movlw .185 | |
0 | 2769 movff WREG,box_temp+2 ; row bottom (0-239) |
2770 movlw .082 | |
2771 movff WREG,box_temp+3 ; column left (0-159) | |
2772 movlw .159 | |
2773 movff WREG,box_temp+4 ; column right (0-159) | |
2774 call PLED_box | |
2775 return | |
2776 | |
2777 PLED_divemenu_cursor: | |
2778 ostc_debug 'l' ; Sends debug-information to screen if debugmode active | |
2779 WIN_TOP .0 | |
2780 WIN_LEFT .85 | |
2781 WIN_FONT FT_SMALL | |
2782 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2783 call PLED_standard_color |
0 | 2784 lfsr FSR2,letter |
2785 movlw 0xB8 | |
2786 movwf POSTINC2 | |
2787 call word_processor | |
2788 WIN_TOP .25 | |
2789 WIN_LEFT .85 | |
2790 WIN_FONT FT_SMALL | |
2791 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2792 call PLED_standard_color |
0 | 2793 lfsr FSR2,letter |
2794 movlw 0xB8 | |
2795 movwf POSTINC2 | |
2796 call word_processor | |
2797 WIN_TOP .50 | |
2798 WIN_LEFT .85 | |
2799 WIN_FONT FT_SMALL | |
2800 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2801 call PLED_standard_color |
0 | 2802 lfsr FSR2,letter |
2803 movlw 0xB8 | |
2804 movwf POSTINC2 | |
2805 call word_processor | |
2806 WIN_TOP .75 | |
2807 WIN_LEFT .85 | |
2808 WIN_FONT FT_SMALL | |
2809 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2810 call PLED_standard_color |
0 | 2811 lfsr FSR2,letter |
2812 movlw 0xB8 | |
2813 movwf POSTINC2 | |
2814 call word_processor | |
2815 WIN_TOP .100 | |
2816 WIN_LEFT .85 | |
2817 WIN_FONT FT_SMALL | |
2818 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2819 call PLED_standard_color |
0 | 2820 lfsr FSR2,letter |
2821 movlw 0xB8 | |
2822 movwf POSTINC2 | |
2823 call word_processor | |
2824 | |
2825 movff menupos,temp1 | |
2826 movlw d'0' | |
2827 dcfsnz temp1,F | |
2828 movlw d'0' | |
2829 dcfsnz temp1,F | |
2830 movlw d'25' | |
2831 dcfsnz temp1,F | |
2832 movlw d'50' | |
2833 dcfsnz temp1,F | |
2834 movlw d'75' | |
2835 dcfsnz temp1,F | |
2836 movlw d'100' | |
2837 movff WREG,win_top | |
2838 WIN_LEFT .85 | |
2839 WIN_FONT FT_SMALL | |
2840 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2841 call PLED_standard_color |
2842 | |
0 | 2843 lfsr FSR2,letter |
2844 movlw 0xB7 ; Arrow for menu | |
2845 movwf POSTINC2 | |
2846 call word_processor | |
2847 return | |
2848 | |
33 | 2849 ;PLED_profileview_menu: |
2850 ; DISPLAYTEXT .127 ;"Exit" | |
2851 ; DISPLAYTEXT .128 ;"Delete" | |
2852 ;; DISPLAYTEXT .132 ;"Format" | |
2853 ; return | |
0 | 2854 |
37 | 2855 custom_warn_surfmode: ; With CF in temp1 |
0 | 2856 movlw .0 |
2857 movff WREG,box_temp+0 ; Data | |
2858 movlw .56 | |
2859 movff WREG,box_temp+1 ; row top (0-239) | |
2860 movlw .88 | |
2861 movff WREG,box_temp+2 ; row bottom (0-239) | |
2862 movlw .69 | |
2863 movff WREG,box_temp+3 ; column left (0-159) | |
2864 movlw .115 | |
2865 movff WREG,box_temp+4 ; column right (0-159) | |
2866 call PLED_box | |
2867 | |
9 | 2868 GETCUSTOM8 d'35' ; Standard output color |
0 | 2869 movff WREG,box_temp+0 ; Data |
2870 movlw .58 | |
2871 movff WREG,box_temp+1 ; row top (0-239) | |
2872 movlw .86 | |
2873 movff WREG,box_temp+2 ; row bottom (0-239) | |
2874 movlw .70 | |
2875 movff WREG,box_temp+3 ; column left (0-159) | |
2876 movlw .114 | |
2877 movff WREG,box_temp+4 ; column right (0-159) | |
2878 call PLED_frame | |
2879 ; warning text | |
2880 | |
2881 WIN_TOP .60 | |
2882 WIN_LEFT .71 | |
2883 WIN_FONT FT_SMALL | |
2884 WIN_INVERT .1 ; Init new Wordprocessor | |
37 | 2885 call PLED_warnings_color ; Set Color for Warning |
0 | 2886 lfsr FSR2,letter |
2887 movlw 'C' | |
2888 movwf POSTINC2 | |
2889 movlw 'F' | |
2890 movwf POSTINC2 | |
2891 movff temp1,lo | |
2892 output_8 | |
2893 movlw '!' | |
2894 movwf POSTINC2 | |
2895 call word_processor | |
2896 | |
2897 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2898 call PLED_standard_color |
0 | 2899 return |
2900 | |
2901 PLED_saturation_graph_divemode: | |
2902 ostc_debug 'h' ; Sends debug-information to screen if debugmode active | |
2903 PLED_tissue_saturation_graph: | |
2904 ostc_debug 'i' ; Sends debug-information to screen if debugmode active | |
13 | 2905 |
2906 ; Clear graph area... | |
2907 movlw .0 | |
2908 movff WREG,box_temp+0 ; Data | |
2909 movlw .25 | |
2910 movff WREG,box_temp+1 ; row top (0-239) | |
2911 movlw .120 | |
2912 movff WREG,box_temp+2 ; row bottom (0-239) | |
2913 movlw .82 | |
2914 movff WREG,box_temp+3 ; column left (0-159) | |
2915 movlw .159 | |
2916 movff WREG,box_temp+4 ; column right (0-159) | |
2917 call PLED_box | |
2918 | |
19 | 2919 ; Draw Frame |
9 | 2920 GETCUSTOM8 d'35' ; Standard output color |
0 | 2921 movff WREG,box_temp+0 ; Data |
2922 movlw .25 | |
2923 movff WREG,box_temp+1 ; row top (0-239) | |
2924 movlw .120 | |
2925 movff WREG,box_temp+2 ; row bottom (0-239) | |
2926 movlw .82 | |
2927 movff WREG,box_temp+3 ; column left (0-159) | |
2928 movlw .159 | |
2929 movff WREG,box_temp+4 ; column right (0-159) | |
2930 call PLED_frame | |
2931 | |
19 | 2932 ; Draw N2 Tissues |
0 | 2933 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2934 movlw d'16' | |
2935 movwf wait_temp ; 16 tissues | |
2936 clrf waitms_temp ; Row offset | |
2937 PLED_tissue_saturation_graph3: | |
9 | 2938 GETCUSTOM8 d'35' ; Standard output color |
0 | 2939 movff WREG,box_temp+0 ; Data |
2940 movlw .28 | |
2941 addwf waitms_temp,W | |
2942 movff WREG,box_temp+1 ; row top (0-239) | |
2943 movlw .28 | |
2944 addwf waitms_temp,W | |
2945 movff WREG,box_temp+2 ; row bottom (0-239) | |
2946 | |
2947 incf waitms_temp,F | |
2948 incf waitms_temp,F | |
2949 | |
2950 movlw .100 | |
2951 movff WREG,box_temp+3 ; column left (0-159) | |
2952 | |
2953 movff POSTINC2,box_temp+4 | |
2954 bcf STATUS,C | |
2955 rrcf box_temp+4,F | |
2956 bcf STATUS,C | |
2957 rrcf box_temp+4,F | |
2958 movlw .100 | |
2959 addwf box_temp+4,F ; column right (0-159) | |
2960 | |
2961 movlw d'157' ; limit display | |
2962 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
2963 movwf box_temp+4 | |
2964 | |
2965 call PLED_box | |
2966 | |
2967 decfsz wait_temp,F | |
2968 bra PLED_tissue_saturation_graph3 | |
2969 | |
19 | 2970 ; Draw He Tissues |
0 | 2971 lfsr FSR2, char_O_tissue_saturation+.016 ; He |
2972 movlw d'16' | |
2973 movwf wait_temp ; 16 tissues | |
2974 clrf waitms_temp ; Row offset | |
2975 PLED_tissue_saturation_graph2: | |
9 | 2976 GETCUSTOM8 d'35' ; Standard output color |
0 | 2977 movff WREG,box_temp+0 ; Data |
2978 movlw .86 | |
2979 addwf waitms_temp,W | |
2980 movff WREG,box_temp+1 ; row top (0-239) | |
2981 movlw .86 | |
2982 addwf waitms_temp,W | |
2983 movff WREG,box_temp+2 ; row bottom (0-239) | |
2984 | |
2985 incf waitms_temp,F | |
2986 incf waitms_temp,F | |
2987 | |
2988 movlw .100 | |
2989 movff WREG,box_temp+3 ; column left (0-159) | |
2990 | |
2991 movff POSTINC2,box_temp+4 | |
2992 bcf STATUS,C | |
2993 rrcf box_temp+4,F | |
2994 bcf STATUS,C | |
2995 rrcf box_temp+4,F | |
2996 movlw .100 | |
2997 addwf box_temp+4,F ; column right (0-159) | |
2998 | |
2999 movlw d'157' ; limit display | |
3000 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
3001 movwf box_temp+4 | |
3002 | |
3003 call PLED_box | |
3004 | |
3005 decfsz wait_temp,F | |
3006 bra PLED_tissue_saturation_graph2 | |
3007 | |
19 | 3008 ; Draw Text |
0 | 3009 WIN_LEFT .84 |
3010 WIN_TOP .32 | |
3 | 3011 call PLED_standard_color |
0 | 3012 lfsr FSR2,letter |
3013 movlw 'N' | |
3014 movwf POSTINC2 | |
3015 movlw '2' | |
3016 movwf POSTINC2 | |
3017 call word_processor | |
3018 WIN_LEFT .84 | |
3019 WIN_TOP .90 | |
3 | 3020 call PLED_standard_color |
0 | 3021 lfsr FSR2,letter |
3022 movlw 'H' | |
3023 movwf POSTINC2 | |
3024 movlw 'e' | |
3025 movwf POSTINC2 | |
3026 call word_processor | |
19 | 3027 |
3028 movff char_O_gtissue_no,wait_temp ; used as temp | |
3029 | |
3030 lfsr FSR2,letter | |
3031 lfsr FSR1,char_O_tissue_saturation+0 | |
3032 incf wait_temp,F ; make 1-16 of 0-15 | |
3033 PLED_tissue_saturation_graph4: ; point to leading tissue... | |
3034 movff POSTINC1,lo ; copy/overwrite to lo register | |
3035 decfsz wait_temp,F ; count until zero | |
3036 bra PLED_tissue_saturation_graph4 ;loop | |
3037 output_8 | |
3038 movlw '%' | |
3039 movwf POSTINC2 | |
3040 movlw ' ' | |
3041 movwf POSTINC2 | |
3042 WIN_LEFT .84 | |
3043 WIN_TOP .62 | |
3044 WIN_FONT FT_SMALL | |
3045 call PLED_standard_color | |
3046 call word_processor | |
3047 bcf leftbind | |
3048 | |
3049 ; Draw Scale | |
3050 GETCUSTOM8 d'35' ; Standard output color | |
3051 movff WREG,box_temp+0 ; Data | |
3052 movlw .73 | |
3053 movff WREG,box_temp+1 ; row top (0-239) | |
3054 movlw .74 | |
3055 movff WREG,box_temp+2 ; row bottom (0-239) | |
3056 movlw .121 | |
3057 movff WREG,box_temp+3 ; column left (0-159) | |
3058 movlw .157 | |
3059 movff WREG,box_temp+4 ; column right (0-159) | |
3060 call PLED_frame | |
3061 | |
3062 GETCUSTOM8 d'35' ; Standard output color | |
3063 movff WREG,box_temp+0 ; Data | |
3064 movlw .61 | |
3065 movff WREG,box_temp+1 ; row top (0-239) | |
3066 movlw .84 | |
3067 movff WREG,box_temp+2 ; row bottom (0-239) | |
3068 movlw .121 | |
3069 movff WREG,box_temp+3 ; column left (0-159) | |
3070 movlw .122 | |
3071 movff WREG,box_temp+4 ; column right (0-159) | |
3072 call PLED_box | |
3073 GETCUSTOM8 d'35' ; Standard output color | |
3074 movff WREG,box_temp+0 ; Data | |
3075 movlw .65 | |
3076 movff WREG,box_temp+1 ; row top (0-239) | |
3077 movlw .80 | |
3078 movff WREG,box_temp+2 ; row bottom (0-239) | |
3079 movlw .121+.9 | |
3080 movff WREG,box_temp+3 ; column left (0-159) | |
3081 movlw .122+.9 | |
3082 movff WREG,box_temp+4 ; column right (0-159) | |
3083 call PLED_box | |
3084 GETCUSTOM8 d'35' ; Standard output color | |
3085 movff WREG,box_temp+0 ; Data | |
3086 movlw .65 | |
3087 movff WREG,box_temp+1 ; row top (0-239) | |
3088 movlw .80 | |
3089 movff WREG,box_temp+2 ; row bottom (0-239) | |
3090 movlw .121+.18 | |
3091 movff WREG,box_temp+3 ; column left (0-159) | |
3092 movlw .122+.18 | |
3093 movff WREG,box_temp+4 ; column right (0-159) | |
3094 call PLED_box | |
3095 GETCUSTOM8 d'35' ; Standard output color | |
3096 movff WREG,box_temp+0 ; Data | |
3097 movlw .65 | |
3098 movff WREG,box_temp+1 ; row top (0-239) | |
3099 movlw .80 | |
3100 movff WREG,box_temp+2 ; row bottom (0-239) | |
3101 movlw .121+.27 | |
3102 movff WREG,box_temp+3 ; column left (0-159) | |
3103 movlw .122+.27 | |
3104 movff WREG,box_temp+4 ; column right (0-159) | |
3105 call PLED_box | |
3106 GETCUSTOM8 d'35' ; Standard output color | |
3107 movff WREG,box_temp+0 ; Data | |
3108 movlw .61 | |
3109 movff WREG,box_temp+1 ; row top (0-239) | |
3110 movlw .84 | |
3111 movff WREG,box_temp+2 ; row bottom (0-239) | |
3112 movlw .121+.36 | |
3113 movff WREG,box_temp+3 ; column left (0-159) | |
3114 movlw .122+.36 | |
3115 movff WREG,box_temp+4 ; column right (0-159) | |
3116 call PLED_box | |
3117 | |
0 | 3118 return |
3119 | |
3120 | |
3121 PLED_startupscreen1: | |
3122 call PLED_topline_box | |
3123 WIN_INVERT .1 ; Init new Wordprocessor | |
3124 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3125 WIN_INVERT .0 ; Init new Wordprocessor | |
3126 DISPLAYTEXT .68 ; Licence 1/2 | |
3127 DISPLAYTEXT .69 | |
3128 DISPLAYTEXT .70 | |
3129 DISPLAYTEXT .71 | |
3130 DISPLAYTEXT .72 | |
3131 DISPLAYTEXT .73 | |
3132 DISPLAYTEXT .74 | |
3133 return | |
3134 | |
3135 PLED_startupscreen2: | |
3136 call PLED_topline_box | |
3137 WIN_INVERT .1 ; Init new Wordprocessor | |
3138 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3139 WIN_INVERT .0 ; Init new Wordprocessor | |
3140 DISPLAYTEXT .75 ; Licence 2/2 | |
3141 DISPLAYTEXT .76 | |
3142 DISPLAYTEXT .77 | |
3143 DISPLAYTEXT .78 | |
3144 DISPLAYTEXT .79 | |
3145 DISPLAYTEXT .80 | |
3146 DISPLAYTEXT .81 | |
3147 return | |
3148 | |
3149 PLED_new_cf_warning: | |
3150 call PLED_topline_box | |
3151 WIN_INVERT .1 ; Init new Wordprocessor | |
3152 DISPLAYTEXTH .271 ; New CF added! | |
3153 WIN_INVERT .0 ; Init new Wordprocessor | |
3154 DISPLAYTEXTH .272 ; New CustomFunctions | |
3155 DISPLAYTEXTH .273 ; were added! Check | |
3156 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
3157 DISPLAYTEXTH .275 ; for Details! | |
3158 return | |
3159 | |
3160 PLED_const_ppO2_value: | |
3161 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3162 return ; Yes, No update and return! | |
3163 | |
3164 ostc_debug 'j' ; Sends debug-information to screen if debugmode active | |
3165 | |
3166 WIN_TOP .168 | |
3167 WIN_LEFT .65 | |
3168 WIN_FONT FT_SMALL | |
3169 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 3170 |
0 | 3171 lfsr FSR2,letter |
3172 movff char_I_const_ppO2,lo | |
3173 | |
3174 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
3175 bra PLED_const_ppO2_value2 ; No, display Setpoint | |
3176 | |
3177 ; Yes, Display "Bail" | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3178 call PLED_standard_color |
0 | 3179 OUTPUTTEXTH d'263' ;"Bail" |
3180 call word_processor | |
3181 return | |
3182 | |
3183 PLED_const_ppO2_value2: ; Display SetPoint | |
3184 ;Show fixed SP value | |
4 | 3185 movff amb_pressure+0,xA+0 |
3186 movff amb_pressure+1,xA+1 | |
3187 movlw d'10' | |
3188 movwf xB+0 | |
3189 clrf xB+1 | |
3190 ;xA/xB=xC with xA as remainder | |
3191 call div16x16 ; xC+0=p_amb/10 | |
26 | 3192 |
4 | 3193 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
3194 tstfsz xC+1 ; xC>255 | |
3195 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 3196 |
4 | 3197 movff ppO2_setpoint_store,WREG |
3198 cpfslt xC+0 ; Setpoint value possible? | |
26 | 3199 bra PLED_const_ppO2_value1 ; Yes |
4 | 3200 |
3201 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3202 bra PLED_const_ppO2_value1a | |
3203 | |
3204 PLED_const_ppO2_value1: | |
26 | 3205 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
3206 movff amb_pressure+0,xA+0 | |
3207 movff amb_pressure+1,xA+1 | |
3208 movlw d'10' | |
3209 movwf xB+0 | |
3210 clrf xB+1 | |
3211 call div16x16 ; xC=p_amb/10 | |
3212 movff xC+0,xA+0 | |
3213 movff xC+1,xA+1 | |
3214 movff char_I_O2_ratio,xB+0 | |
3215 clrf xB+1 | |
3216 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
3217 | |
3218 movff xC+0,sub_b+0 | |
3219 movff xC+1,sub_b+1 | |
3220 movff ppO2_setpoint_store,WREG; Setpoint | |
3221 mullw d'100' ; Setpoint*100 | |
3222 movff PRODL,sub_a+0 | |
3223 movff PRODH,sub_a+1 | |
3224 call sub16 ; sub_c = sub_a - sub_b | |
3225 | |
3226 btfss neg_flag | |
3227 bra PLED_const_ppO2_value11 ; Value in range | |
3228 | |
3229 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
3230 | |
3231 movff xC+0,xA+0 | |
3232 movff xC+1,xA+1 | |
3233 movlw d'100' | |
3234 movwf xB+0 | |
3235 clrf xB+1 | |
3236 call div16x16 ;xA/xB=xC with xA as remainder | |
3237 | |
3238 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3239 bra PLED_const_ppO2_value1a | |
3240 | |
3241 PLED_const_ppO2_value11: | |
3242 | |
3243 ; Setpoint in possible limits | |
4 | 3244 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
3245 | |
3246 PLED_const_ppO2_value1a: | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3247 PLED_color_code warn_ppo2 ; Color-code output |
4 | 3248 movff char_I_const_ppO2,lo |
0 | 3249 clrf hi |
3250 bsf leftbind | |
3251 output_16dp d'3' | |
3252 bcf leftbind | |
3253 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3254 call PLED_standard_color |
0 | 3255 return |
3256 | |
3257 PLED_show_leading_tissue: | |
3258 call deco_main_calc_desaturation_time ; calculate desaturation time | |
3259 movlb b'00000001' ; select ram bank 1 | |
3260 | |
3261 DISPLAYTEXTH .282 ; L. Tissue: | |
3262 lfsr FSR2,letter | |
3263 movlw '#' | |
3264 movwf POSTINC2 | |
3265 movff char_O_gtissue_no,lo | |
3266 movff char_O_gtissue_no,wait_temp ; used as temp | |
3267 bsf leftbind | |
3268 output_8 | |
3269 movlw ' ' | |
3270 movwf POSTINC2 | |
3271 movlw '(' | |
3272 movwf POSTINC2 | |
3273 | |
3274 movlw d'16' | |
3275 cpfslt wait_temp | |
3276 bra PLED_show_leading_tissue_he | |
3277 movlw 'N' | |
3278 movwf POSTINC2 | |
3279 movlw '2' | |
3280 movwf POSTINC2 | |
3281 bra PLED_show_leading_tissue2 | |
3282 PLED_show_leading_tissue_he: | |
3283 movlw 'H' | |
3284 movwf POSTINC2 | |
3285 movlw 'e' | |
3286 movwf POSTINC2 | |
3287 PLED_show_leading_tissue2: | |
3288 movlw ')' | |
3289 movwf POSTINC2 | |
3290 movlw ' ' | |
3291 movwf POSTINC2 | |
3292 WIN_LEFT .100 | |
3293 WIN_TOP .25 | |
3294 WIN_FONT FT_SMALL | |
3 | 3295 call PLED_standard_color |
0 | 3296 call word_processor |
3297 | |
3298 lfsr FSR2,letter | |
3299 lfsr FSR1,char_O_tissue_saturation+0 | |
3300 incf wait_temp,F ; make 1-16 of 0-15 | |
3301 PLED_show_leading_tissue3: ; point to leading tissue... | |
3302 movff POSTINC1,lo ; copy/overwrite to lo register | |
3303 decfsz wait_temp,F ; count until zero | |
3304 bra PLED_show_leading_tissue3 ;loop | |
3305 output_8 | |
3306 movlw '%' | |
3307 movwf POSTINC2 | |
3308 movlw ' ' | |
3309 movwf POSTINC2 | |
3310 WIN_LEFT .100 | |
3311 WIN_TOP .50 | |
3312 WIN_FONT FT_SMALL | |
3 | 3313 call PLED_standard_color |
0 | 3314 call word_processor |
3315 bcf leftbind | |
3316 return | |
3317 | |
3318 PLED_topline_box_clear: ; Writes an empty box | |
3319 movlw .0 | |
3320 bra PLED_topline_box2 | |
3321 PLED_topline_box: ; Writes a filled box | |
3 | 3322 GETCUSTOM8 d'35' |
0 | 3323 PLED_topline_box2: |
3324 movff WREG,box_temp+0 ; Data | |
3325 movlw .000 | |
3326 movff WREG,box_temp+1 ; row top (0-239) | |
3327 movlw .026 | |
3328 movff WREG,box_temp+2 ; row bottom (0-239) | |
3329 movlw .000 | |
3330 movff WREG,box_temp+3 ; column left (0-159) | |
3331 movlw .159 | |
3332 movff WREG,box_temp+4 ; column right (0-159) | |
3333 call PLED_box | |
3334 return | |
3335 | |
3336 PLED_display_cns: | |
3337 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3338 return ; Yes, No update and return! | |
3339 | |
3340 btfsc gauge_mode ; Do not display in gauge mode | |
3341 return | |
3342 | |
3343 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
3344 return | |
3345 | |
3346 btfsc pled_velocity_display ; Is velocity displayed?` | |
3347 return ; Yes, do not overwrite until pled_velocity_clear was called | |
3348 | |
3349 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
3350 | |
3351 WIN_TOP .090 | |
3352 WIN_LEFT .0 | |
3353 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3354 PLED_color_code warn_cns ; Color-code CNS output |
0 | 3355 |
3356 lfsr FSR2,letter | |
3357 movlw 'C' | |
3358 movwf POSTINC2 | |
3359 movlw 'N' | |
3360 movwf POSTINC2 | |
3361 movlw 'S' | |
3362 movwf POSTINC2 | |
3363 movlw ':' | |
3364 movwf POSTINC2 | |
3365 movff char_O_CNS_fraction,lo | |
3366 bsf leftbind | |
3367 output_8 | |
3368 bcf leftbind | |
3369 movlw '%' | |
3370 movwf POSTINC2 | |
3371 call word_processor | |
3372 return | |
3373 | |
43 | 3374 PLED_display_cns_surface: |
3375 ; Check if CNS should be displayed | |
3376 movff char_O_CNS_fraction,lo ; copy into bank1 | |
3377 GETCUSTOM8 d'15' ; cns_display_high_surfacemode | |
3378 subwf lo,W | |
3379 btfss STATUS,C | |
3380 return ; Do not show... | |
3381 ; Show CNS | |
3382 | |
3383 ostc_debug 'W' ; Sends debug-information to screen if debugmode active | |
3384 | |
3385 WIN_TOP .175 | |
3386 WIN_LEFT .45 | |
3387 WIN_FONT FT_SMALL | |
3388 WIN_INVERT .0 ; Init new Wordprocessor | |
3389 PLED_color_code warn_cns ; Color-code CNS output | |
3390 | |
3391 lfsr FSR2,letter | |
3392 movlw 'C' | |
3393 movwf POSTINC2 | |
3394 movlw 'N' | |
3395 movwf POSTINC2 | |
3396 movlw 'S' | |
3397 movwf POSTINC2 | |
3398 movlw ':' | |
3399 movwf POSTINC2 | |
3400 movff char_O_CNS_fraction,lo | |
3401 bsf leftbind | |
3402 output_8 | |
3403 bcf leftbind | |
3404 movlw '%' | |
3405 movwf POSTINC2 | |
3406 call word_processor | |
3407 return | |
3408 | |
3409 | |
0 | 3410 PLED_custom_text: |
3411 read_int_eeprom d'64' | |
3412 movlw d'1' | |
3413 cpfseq EEDATA ; Custom text active? | |
3414 bra PLED_clear_custom_text ; No, Delete row | |
3415 WIN_TOP .200 | |
62 | 3416 WIN_LEFT .0 |
0 | 3417 WIN_FONT FT_SMALL |
3418 WIN_INVERT .0 ; Init new Wordprocessor | |
9 | 3419 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 3420 |
3421 lfsr FSR2,letter | |
3422 movlw d'64' | |
3423 movwf lo | |
3424 movlw d'24' | |
3425 movwf hi ; counter | |
3426 | |
3427 PLED_custom_text1: | |
3428 incf lo,F | |
3429 call PLED_get_custom_letter ; Get one letter for the custom text | |
3430 movlw '}' ; End marker found? | |
3431 cpfseq EEDATA | |
3432 bra PLED_custom_text2 ; No | |
3433 bra PLED_custom_text3 | |
3434 PLED_custom_text2: | |
3435 movff EEDATA,POSTINC2 ; Copy into Postinc | |
3436 | |
3437 decfsz hi,F ; Max. numbers? | |
3438 bra PLED_custom_text1 ; No, get next letters | |
3439 | |
3440 PLED_custom_text3: | |
3441 call word_processor | |
3 | 3442 call PLED_standard_color |
0 | 3443 return |
3444 | |
3445 PLED_get_custom_letter: | |
3446 movff lo,EEADR ; Address for next custom text letter | |
3447 call read_eeprom ; Read letter | |
3448 return | |
3449 | |
3450 PLED_clear_custom_text: | |
3451 movlw d'24' | |
3452 movwf temp1 | |
3453 WIN_TOP .200 | |
3454 WIN_LEFT .0 | |
3455 call PLED_display_clear_common_y1 | |
3456 return | |
3457 | |
3458 | |
3459 ;PLED_const_ppO2_DEBUG: | |
3460 ; movlw .007 | |
3461 ; call PLED_SetColumn | |
3462 ; movlw .032 | |
3463 ; call PLED_SetRow | |
3464 ; lfsr FSR2,letter | |
3465 ; movff char_O_diluent,lo | |
3466 ; output_8 | |
3467 ; movlw .001 | |
3468 ; movwf scaleY | |
3469 ; call word_processor | |
3470 ; movlw .007 | |
3471 ; call PLED_SetColumn | |
3472 ; movlw .024 | |
3473 ; call PLED_SetRow | |
3474 ; lfsr FSR2,letter | |
3475 ; movff last_diluent,lo | |
3476 ; output_8 | |
3477 ; movlw .001 | |
3478 ; movwf scaleY | |
3479 ; call word_processor | |
3480 ; movlw .007 | |
3481 ; call PLED_SetColumn | |
3482 ; movlw .016 | |
3483 ; call PLED_SetRow | |
3484 ; lfsr FSR2,letter | |
3485 ; movff char_O_deco_status,lo | |
3486 ; output_8 | |
3487 ; movlw .001 | |
3488 ; movwf scaleY | |
3489 ; call word_processor | |
3490 ; return | |
3491 ; | |
3492 | |
45 | 3493 ;PLED_gaschange_DEBUG: |
3494 ; WIN_LEFT .0 | |
3495 ; WIN_TOP .160 | |
3496 ; lfsr FSR2,letter | |
3497 ; movff char_I_deco_He_ratio,lo | |
3498 ; output_8 | |
3499 ; call word_processor | |
3500 ; | |
3501 ; WIN_LEFT .25 | |
3502 ; WIN_TOP .160 | |
3503 ; call PLED_SetRow | |
3504 ; lfsr FSR2,letter | |
3505 ; movff char_I_deco_N2_ratio,lo | |
3506 ; output_8 | |
3507 ; call word_processor | |
3508 ; | |
3509 ; WIN_LEFT .50 | |
3510 ; WIN_TOP .160 | |
3511 ; lfsr FSR2,letter | |
3512 ; movff char_I_deco_gas_change,lo | |
3513 ; output_8 | |
3514 ; call word_processor | |
3515 ; | |
3516 ; WIN_LEFT .75 | |
3517 ; WIN_TOP .160 | |
3518 ; lfsr FSR2,letter | |
3519 ; movff hi,lo | |
3520 ; output_8 | |
3521 ; call word_processor | |
3522 ; return | |
0 | 3523 |
30 | 3524 ; |
64 | 3525 ;PLED_MultiGF_deco_all: |
3526 ; movff char_O_actual_pointer,wait_temp | |
3527 ; movff char_O_GF_low_pointer,waitms_temp | |
3528 ; movf waitms_temp,F | |
3529 ; bz PLED_MultiGF_no_deco | |
3530 ; call PLED_MultiGF_table ; input wait_temp | |
3531 ; return | |
3532 ; | |
3533 ;PLED_MultiGF_no_deco: | |
3534 ; DISPLAYTEXT d'242' ;"no deco" | |
3535 ; return | |
0 | 3536 ; |
64 | 3537 ;PLED_MultiGF_table: |
3538 ; movlw d'9' | |
3539 ; movwf temp5 ; number of stops | |
3540 ; movlw .231 | |
3541 ; movwf temp6 ; row | |
3542 ; lfsr FSR1,char_IO_deco_table+0 | |
0 | 3543 ; |
64 | 3544 ;PLED_MultiGF_table2: |
3545 ; movlw d'25' | |
3546 ; addwf temp6,F | |
3547 ; call PLED_MultiGF_show_stop | |
3548 ; decfsz temp5,F | |
3549 ; bra PLED_MultiGF_table2 | |
3550 ; return | |
3551 ; | |
3552 ;PLED_MultiGF_show_stop: | |
0 | 3553 ; bsf leftbind |
64 | 3554 ; WIN_LEFT .100 |
3555 ; movff temp6,win_top | |
3556 ; movff temp6,hi ; copy for PLED_decoplan_bargraph | |
3557 ;; call PLED_SetRow ; Set Row | |
0 | 3558 ; |
3559 ; | |
64 | 3560 ; movff POSTINC1,lo ; Get Depth |
3561 ; movf lo,w | |
0 | 3562 ; |
3563 ; lfsr FSR2,letter | |
64 | 3564 ;; btfsc STATUS,Z ; =0 |
3565 ;; goto PLED_decoplan_delete ; Yes, quit display | |
3566 ; output_8 ; outputs into Postinc2! | |
0 | 3567 ; movlw 'm' |
3568 ; movwf POSTINC2 | |
64 | 3569 ; call word_processor |
3570 ; WIN_LEFT .140 | |
3571 ; movff temp6,win_top | |
3572 ; | |
3573 ; movff POSTINC1,lo ; Get length for this stop | |
0 | 3574 ; |
64 | 3575 ; lfsr FSR2,letter |
3576 ; output_99x ; outputs into Postinc2! | |
3577 ; movlw d'39' ;"'" | |
0 | 3578 ; movwf POSTINC2 |
64 | 3579 ; call word_processor |
3580 ;; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
0 | 3581 ; return |
3582 ; | |
64 | 3583 ; |
0 | 3584 ; |
64 | 3585 ;; movlw .043 |
3586 ;; movwf temp5 | |
3587 ;; movlw .48 + .8 | |
3588 ;; movwf temp6 | |
3589 ;; movff char_O_GF_low_pointer,wait_temp | |
3590 ;; | |
3591 ;;PLED_MultiGF_loop: | |
3592 ;; decfsz wait_temp,F | |
3593 ;; bra PLED_MulitGF_nextentry | |
3594 ;; | |
3595 ;; bra PLED_MultiGF_calc_tissue_counter | |
3596 ;;PLED_MGF_lp_calc_tis_counter: | |
3597 ;; | |
3598 ;;PLED_MGF_lp_clear_rem_space: | |
3599 ;; lfsr FSR2,letter | |
3600 ;; movlw ' ' | |
3601 ;; movwf POSTINC2 | |
3602 ;; movlw ' ' | |
3603 ;; movwf POSTINC2 | |
3604 ;; movlw ' ' | |
3605 ;; movwf POSTINC2 | |
3606 ;; movlw ' ' | |
3607 ;; movwf POSTINC2 | |
3608 ;; movlw ' ' | |
3609 ;; movwf POSTINC2 | |
3610 ;; movlw ' ' | |
3611 ;; movwf POSTINC2 | |
3612 ;; movlw .8 | |
3613 ;; subwf temp6,F | |
3614 ;; bnz PLED_MultiGF_column_ok_space | |
3615 ;; movlw .21 | |
3616 ;; subwf temp5,F | |
3617 ;; bc PLED_MultiGF_new_row_space | |
3618 ;; return | |
3619 ;;PLED_MultiGF_new_row_space: | |
3620 ;; movlw .48 | |
3621 ;; movwf temp6 | |
3622 ;;PLED_MultiGF_column_ok_space: | |
3623 ;; movf temp5,W | |
3624 ;; call PLED_SetColumn | |
3625 ;; movlw .8 | |
3626 ;; subwf temp6,W | |
3627 ;; call PLED_SetRow | |
3628 ;; call word_processor | |
3629 ;; bra PLED_MGF_lp_clear_rem_space | |
3630 ;; | |
3631 ;;PLED_MulitGF_nextentry: | |
3632 ;; lfsr FSR2,letter | |
3633 ;; movff wait_temp,lo ; pointer to meter | |
3634 ;; movf lo,W | |
3635 ;; rlncf lo,F | |
3636 ;; addwf lo,F | |
3637 ;; decfsz wait_temp,W | |
3638 ;; bra PLED_MGF_skip_last_deco2 | |
3639 ;; movff char_I_depth_last_deco,lo | |
3640 ;;PLED_MGF_skip_last_deco2: | |
3641 ;; output_99 | |
3642 ;; movlw 0x02 | |
3643 ;; movwf POSTINC2 | |
3644 ;; movlw ':' | |
3645 ;; movwf POSTINC2 | |
3646 ;; movlw 0x02 | |
3647 ;; movwf POSTINC2 | |
3648 ;; lfsr FSR0,0x250 | |
3649 ;; movf wait_temp,W | |
3650 ;; movff PLUSW0,lo | |
3651 ;; movlw d'10' ; gray code | |
3652 ;; tstfsz lo | |
3653 ;; movlw b'00001111' ; gray code | |
3654 ;; movwf grayvalue | |
3655 ;; bsf leftbind | |
3656 ;; output_99 | |
3657 ;; bcf leftbind | |
3658 ;; movlw ' ' | |
3659 ;; movwf POSTINC2 | |
3660 ;; movlw .8 | |
3661 ;; subwf temp6,F | |
3662 ;; bnz PLED_MultiGF_column_ok | |
3663 ;; movlw .21 | |
3664 ;; subwf temp5,F | |
3665 ;; bc PLED_MultiGF_new_row | |
3666 ;; return | |
3667 ;;PLED_MultiGF_new_row: | |
3668 ;; movlw .48 | |
3669 ;; movwf temp6 | |
3670 ;;PLED_MultiGF_column_ok: | |
3671 ;; movf temp5,W | |
3672 ;; call PLED_SetColumn | |
3673 ;; movlw .8 | |
3674 ;; subwf temp6,W | |
3675 ;; call PLED_SetRow | |
3676 ;; call word_processor | |
3677 ;; movlw b'00001111' ; gray code | |
3678 ;; movwf grayvalue | |
3679 ;; bra PLED_MultiGF_loop | |
3680 ;; | |
3681 ;; | |
3682 ;;PLED_MultiGF_depth: | |
3683 ;; lfsr FSR2,letter | |
3684 ;; movff rel_pressure+0,lo | |
3685 ;; movff rel_pressure+1,hi | |
3686 ;; call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
3687 ;; bsf leftbind | |
3688 ;; bsf ignore_digit5 ; do not display 1cm depth | |
3689 ;; output_16dp d'3' | |
3690 ;; bcf leftbind | |
3691 ;; movlw .004 | |
3692 ;; movwf wait_temp | |
3693 ;; movff wait_temp,0x086 ; left | |
3694 ;; movlw .049 | |
3695 ;; movwf wait_temp | |
3696 ;; movff wait_temp,0x087 ; top | |
3697 ;; movlw .015 | |
3698 ;; movwf wait_temp | |
3699 ;; movff wait_temp,0x088 ; heightmax | |
3700 ;; movff dd_oled_brightness_offset,wait_temp | |
3701 ;; movff wait_temp,0x089 ; oled_brightness_offset_const | |
3702 ;; call main_DD2_write_incon24 | |
3703 ;; movlb b'00000001' ; Back to Bank1 | |
3704 ;; return | |
3705 ;; | |
3706 ;;PLED_MultiGF_deco_depth_actual: | |
3707 ;; lfsr FSR2,letter | |
3708 ;; movff char_O_actual_pointer,lo ; pointer to meter | |
3709 ;; movf lo,W | |
3710 ;; rlncf lo,F | |
3711 ;; addwf lo,F | |
3712 ;; movff char_O_actual_pointer,wait_temp ; test last_deco | |
3713 ;; decfsz wait_temp,F | |
3714 ;; bra PLED_MGF_skip_last_deco_depth | |
3715 ;; movff char_I_depth_last_deco,lo | |
3716 ;;PLED_MGF_skip_last_deco_depth: | |
3717 ;; output_99 | |
3718 ;; movlw 'm' | |
3719 ;; movwf POSTINC2 | |
3720 ;; movlw ' ' | |
3721 ;; movwf POSTINC2 | |
3722 ;; movlw .23 | |
3723 ;; call PLED_SetColumn | |
3724 ;; movlw .57 | |
3725 ;; call PLED_SetRow | |
3726 ;; goto word_processor | |
3727 ;; | |
3728 ;;PLED_MultiGF_gradient: | |
3729 ;; lfsr FSR2,letter | |
3730 ;; movff char_O_gradient_factor,lo | |
3731 ;; bsf leftbind | |
3732 ;; output_99 | |
3733 ;; bcf leftbind | |
3734 ;; movlw '%' | |
3735 ;; movwf POSTINC2 | |
3736 ;; movlw ' ' | |
3737 ;; movwf POSTINC2 | |
3738 ;; movlw .23 | |
3739 ;; call PLED_SetColumn | |
3740 ;; movlw .49 | |
3741 ;; call PLED_SetRow | |
3742 ;; goto word_processor | |
3743 ;; | |
3744 ;;PLED_MultiGF_time_at_deco: | |
3745 ;; movlw .045 | |
3746 ;; movwf wait_temp | |
3747 ;; movff wait_temp,0x086 ; left | |
3748 ;; movlw .050 | |
3749 ;; movwf wait_temp | |
3750 ;; movff wait_temp,0x087 ; top | |
3751 ;; movlw .015 | |
3752 ;; movwf wait_temp | |
3753 ;; movff wait_temp,0x088 ; heightmax | |
3754 ;; movff dd_oled_brightness_offset,wait_temp | |
3755 ;; movff wait_temp,0x089 ; oled_brightness_offset_const | |
3756 ;; lfsr FSR2,letter | |
3757 ;; lfsr FSR0,0x250 | |
3758 ;; movff char_O_actual_pointer,lo | |
3759 ;; movf lo,W | |
3760 ;; movff PLUSW0,lo | |
3761 ;; bsf leftbind | |
3762 ;; output_99 | |
3763 ;; movlw '<' ; Textmapping to "'"! | |
3764 ;; movwf POSTINC2 | |
3765 ;; call main_DD2_write_incon24 | |
3766 ;; movlb b'00000001' ; Back to Bank1 | |
3767 ;; return | |
3768 ;; | |
3769 ;;PLED_MultiGF_clear_behind_depth: | |
3770 ;; movlw 0x01 | |
3771 ;; movwf wait_temp | |
3772 ;; movff wait_temp,width ; font select left side before decpoint | |
3773 ;; movff wait_temp,box_temp+5 ; font select right side decpoint and after | |
3774 ;; movlw .063 | |
3775 ;; movwf wait_temp | |
3776 ;; movff wait_temp,box_temp+1 ; bottom row | |
3777 ;; movlw .020 | |
3778 ;; movwf wait_temp | |
3779 ;; movff wait_temp,box_temp+2 ; start column | |
3780 ;; movlw .063 | |
3781 ;; movwf wait_temp | |
3782 ;; movff wait_temp,box_temp+3 ; end column | |
3783 ;; movlw .051 | |
3784 ;; movwf wait_temp | |
3785 ;; movff wait_temp,box_temp+4 ; start column dec point | |
3786 ;; lfsr FSR2,letter | |
3787 ;;; call DD_Main | |
3788 ;; return | |
3789 ;;; movlw 0x31 | |
3790 ;; movwf wait_temp | |
3791 ;; movff wait_temp,box_temp+1 ; row | |
3792 ;; movlw 0x00 | |
3793 ;; movwf wait_temp | |
3794 ;; movff wait_temp,box_temp+0 ; color | |
3795 ;; call DD_hline | |
3796 ;; return | |
3797 ;; | |
0 | 3798 ; |
64 | 3799 ;;PLED_MulitGF_nextentry_tissues: |
3800 ;; lfsr FSR2,letter | |
3801 ;; lfsr FSR0,0x200 | |
3802 ;; rlncf wait_temp,W | |
3803 ;; movff PLUSW0,lo | |
3804 ;; addlw .001 | |
3805 ;; movff PLUSW0,hi | |
3806 ;; output_16 | |
3807 ;; movlw ' ' | |
3808 ;; movwf POSTINC2 | |
3809 ;; movlw .8 | |
3810 ;; subwf temp6,F | |
3811 ;; bnz PLED_MultiGF_column_ok_tissues | |
3812 ;; movlw b'00001111' ; gray code | |
3813 ;; movwf grayvalue | |
3814 ;; movlw .21 | |
3815 ;; subwf temp5,F | |
3816 ;; bc PLED_MultiGF_new_row_tissues | |
3817 ;; return | |
3818 ;;PLED_MultiGF_new_row_tissues: | |
3819 ;; movlw .48 | |
3820 ;; movwf temp6 | |
3821 ;;PLED_MultiGF_column_ok_tissues: | |
3822 ;; movf temp5,W | |
3823 ;; call PLED_SetColumn | |
3824 ;; movlw .8 | |
3825 ;; subwf temp6,W | |
3826 ;; call PLED_SetRow | |
3827 ;; call word_processor | |
3828 ;; bra PLED_MultiGF_loop_tissues | |
3829 ;; | |
3830 ; | |
3831 ;;PLED_MultiGF_uart_out: | |
3832 ;; call rs232_wait_tx | |
3833 ;;; header ff ff | |
3834 ;; movlw 0xff | |
3835 ;; movwf wait_temp | |
3836 ;; movff wait_temp,TXREG | |
3837 ;; call rs232_wait_tx | |
3838 ;; movff wait_temp,TXREG | |
3839 ;; call rs232_wait_tx | |
3840 ;;; 2sec counter | |
3841 ;; movff 0x290,TXREG | |
3842 ;; call rs232_wait_tx | |
3843 ;; movff 0x291,TXREG | |
3844 ;; call rs232_wait_tx | |
3845 ;;; movff ,TXREG | |
3846 ;;; pres_respiration | |
3847 ;; movff amb_pressure,TXREG | |
3848 ;; call rs232_wait_tx | |
3849 ;; movff amb_pressure+1,TXREG | |
3850 ;; call rs232_wait_tx | |
3851 ;;; pres_surface | |
3852 ;; movff last_surfpressure,TXREG | |
3853 ;; call rs232_wait_tx | |
3854 ;; movff last_surfpressure+1,TXREG | |
3855 ;; call rs232_wait_tx | |
3856 ;;; tissue pres | |
3857 ;; lfsr FSR0,0x200 | |
3858 ;; movlw .64 | |
3859 ;; movwf wait_temp | |
3860 ;;pled_multigraf_tissue_uart_loop: | |
3861 ;; movff POSTINC0,TXREG | |
3862 ;; call rs232_wait_tx | |
3863 ;; decfsz wait_temp | |
3864 ;; bra pled_multigraf_tissue_uart_loop | |
3865 ;;; movff ,TXREG | |
3866 ;;; call rs232_wait_tx | |
3867 ;; return | |
0 | 3868 ; |
64 | 3869 ;;PLED_MulitGF_nextentry_debug: |
3870 ;; lfsr FSR2,letter | |
3871 ;; movff wait_temp,lo | |
3872 ;; output_99 | |
3873 ;; movlw 0x02 | |
3874 ;; movwf POSTINC2 | |
3875 ;; movlw ':' | |
3876 ;; movwf POSTINC2 | |
3877 ;; movlw 0x02 | |
3878 ;; movwf POSTINC2 | |
3879 ;; lfsr FSR0,0x300 | |
3880 ;; movf wait_temp,W | |
3881 ;; movff PLUSW0,lo | |
3882 ;; output_99 | |
3883 ;; movlw ' ' | |
3884 ;; movwf POSTINC2 | |
3885 ;; movlw .8 | |
3886 ;; subwf temp6,F | |
3887 ;; bnz PLED_MultiGF_column_ok_debug | |
3888 ;; movlw b'00001111' ; gray code | |
3889 ;; movwf grayvalue | |
3890 ;; movlw .21 | |
3891 ;; subwf temp5,F | |
3892 ;; bc PLED_MultiGF_new_row_debug | |
3893 ;; return | |
3894 ;;PLED_MultiGF_new_row_debug: | |
3895 ;; movlw .48 | |
3896 ;; movwf temp6 | |
3897 ;;PLED_MultiGF_column_ok_debug: | |
3898 ;; movf temp5,W | |
3899 ;; call PLED_SetColumn | |
3900 ;; movlw .8 | |
3901 ;; subwf temp6,W | |
3902 ;; call PLED_SetRow | |
3903 ;; call word_processor | |
3904 ;; bra PLED_MultiGF_loop_debug | |
0 | 3905 ; |
64 | 3906 ;;PLED_MultiGF_calc_tissue_counter: |
3907 ;; movlw d'8' ; gray code | |
3908 ;; movwf grayvalue | |
3909 ;; movff 0x290,lo | |
3910 ;; movff 0x291,hi | |
3911 ;; movlw '(' | |
3912 ;; movwf POSTINC2 | |
3913 ;; output_16 | |
3914 ;; movlw ')' | |
3915 ;; movwf POSTINC2 | |
3916 ;; movlw .8 | |
3917 ;; subwf temp6,F | |
3918 ;; bnz PLED_MGF_ok_col_calc_tis_cter | |
3919 ;; movlw b'00001111' ; gray code | |
3920 ;; movwf grayvalue | |
3921 ;; movlw .21 | |
3922 ;; subwf temp5,F | |
3923 ;; bc PLED_MGF_n_row_calc_tis_cter | |
3924 ;; return | |
3925 ;;PLED_MGF_n_row_calc_tis_cter: | |
3926 ;; movlw .48 | |
3927 ;; movwf temp6 | |
3928 ;;PLED_MGF_ok_col_calc_tis_cter: | |
3929 ;; movf temp5,W | |
3930 ;; call PLED_SetColumn | |
3931 ;; movlw .8 | |
3932 ;; subwf temp6,W | |
3933 ;; call PLED_SetRow | |
3934 ;; call word_processor | |
3935 ;; bra PLED_MGF_lp_calc_tis_counter | |
3936 ;; | |
3937 ; | |
3938 ;;PLED_debug_deko: | |
3939 ;; movlw .009 | |
3940 ;; call PLED_SetColumn | |
3941 ;; movlw .008 | |
3942 ;; call PLED_SetRow | |
3943 ;; lfsr FSR2,letter | |
3944 ;; movff char_O_deco_status,lo | |
3945 ;; output_8 | |
3946 ;; call word_processor | |
3947 ;; | |
3948 ;; movlw .009 | |
3949 ;; call PLED_SetColumn | |
3950 ;; movlw .016 | |
3951 ;; call PLED_SetRow | |
3952 ;; lfsr FSR2,letter | |
3953 ;; movff char_O_array_decodepth+0,lo | |
3954 ;; output_8 | |
3955 ;; call word_processor | |
3956 ;; return | |
3957 ;; | |
3958 ; | |
33 | 3959 PLED_simdata_screen: ;Display Pre-Dive Screen |
3960 ; List active gases/Setpoints | |
3961 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
3962 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list | |
3963 | |
3964 PLED_simdata_screen2: | |
3965 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
3966 | |
3967 WIN_LEFT .0 | |
3968 WIN_FONT FT_SMALL | |
3969 bsf leftbind | |
3970 | |
3971 movlw d'2' | |
3972 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3973 movlw d'10' |
33 | 3974 movwf waitms_temp ; here: stores row for gas list |
3975 clrf hi ; here: Gas counter | |
3976 | |
3977 PLED_simdata_screen2_loop: | |
3978 incf hi,F ; Increase Gas | |
3979 movlw d'4' | |
3980 addwf wait_temp,F ; Increase eeprom address for gas list | |
3981 | |
3982 lfsr FSR2,letter | |
3983 movlw 'G' | |
3984 movwf POSTINC2 | |
3985 movff hi,lo ; copy gas number | |
3986 output_8 ; display gas number | |
3987 movlw ':' | |
3988 movwf POSTINC2 | |
3989 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
3990 call read_eeprom ; get byte (stored in EEDATA) | |
3991 movff EEDATA,lo ; copy to lo | |
3992 output_8 ; outputs into Postinc2! | |
3993 movlw '/' | |
3994 movwf POSTINC2 | |
3995 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
3996 call read_eeprom ; get byte (stored in EEDATA) | |
3997 movff EEDATA,lo ; copy to lo | |
3998 output_8 ; outputs into Postinc2! | |
34 | 3999 movlw ' ' |
4000 movwf POSTINC2 | |
4001 movf hi,W ; Gas number | |
4002 addlw d'27' ; -> Adress of change depth register | |
4003 call read_int_eeprom_1 | |
4004 movff EEDATA,lo ; Change depth in m | |
4005 output_99 ; outputs into Postinc2! | |
4006 movlw 'm' | |
4007 movwf POSTINC2 | |
33 | 4008 read_int_eeprom d'27' ; read flag register |
4009 movff hi,lo ; copy gas number | |
4010 PLED_simdata_screen2_loop1: | |
4011 rrcf EEDATA ; roll flags into carry | |
4012 decfsz lo,F ; max. 5 times... | |
4013 bra PLED_simdata_screen2_loop1 | |
4014 | |
4015 btfsc STATUS,C ; test carry | |
4016 bra PLED_simdata_white | |
4017 | |
4018 movlw color_grey | |
4019 call PLED_set_color ; grey out inactive gases! | |
4020 bra PLED_simdata_color_done | |
4021 | |
4022 PLED_simdata_white: | |
4023 call PLED_standard_color | |
4024 | |
4025 PLED_simdata_color_done: | |
4026 movlw d'25' | |
4027 addwf waitms_temp,F ; Increase row | |
4028 WIN_LEFT .0 | |
4029 movff waitms_temp,win_top ; Set Row | |
34 | 4030 call word_processor ; display gas |
33 | 4031 |
4032 PLED_simdata_screen2b: | |
4033 call PLED_standard_color | |
4034 | |
34 | 4035 movlw d'5' ; list all five gases |
33 | 4036 cpfseq hi ; All gases shown? |
4037 bra PLED_simdata_screen2_loop ; No | |
4038 | |
4039 return ; No, return (OC mode) | |
4040 | |
4041 PLED_simdata_screen3: | |
4042 WIN_LEFT .0 | |
4043 WIN_FONT FT_SMALL | |
4044 bsf leftbind | |
4045 | |
4046 ; list three SP in Gaslist | |
4047 movlw d'35' ; 36 = current SP position in EEPROM | |
4048 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 4049 movlw d'10' |
33 | 4050 movwf waitms_temp ; here: stores row for gas list |
64 | 4051 clrf temp6 ; here: SP counter |
33 | 4052 |
4053 PLED_simdata_screen3_loop: | |
4054 incf wait_temp,F ; EEPROM address | |
64 | 4055 incf temp6,F ; Increase SP |
33 | 4056 |
4057 movlw d'25' | |
4058 addwf waitms_temp,F ; Increase row | |
4059 WIN_LEFT .0 | |
4060 movff waitms_temp,win_top ; Set Row | |
4061 | |
4062 lfsr FSR2,letter | |
4063 movlw 'S' | |
4064 movwf POSTINC2 | |
4065 movlw 'P' | |
4066 movwf POSTINC2 | |
64 | 4067 movff temp6,lo ; copy gas number |
33 | 4068 output_8 ; display gas number |
4069 movlw ':' | |
4070 movwf POSTINC2 | |
4071 movlw ' ' | |
4072 movwf POSTINC2 | |
4073 movff wait_temp, EEADR; SP #hi position | |
4074 call read_eeprom ; get byte (stored in EEDATA) | |
4075 movff EEDATA,lo ; copy to lo | |
4076 clrf hi | |
4077 output_16dp d'3' ; outputs into Postinc2! | |
4078 call word_processor | |
4079 | |
4080 movlw d'3' ; list all three SP | |
64 | 4081 cpfseq temp6 ; All gases shown? |
33 | 4082 bra PLED_simdata_screen3_loop ;no |
4083 | |
4084 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
4085 movff EEDATA,active_gas ; Read start gas (1-5) | |
4086 decf active_gas,W ; Gas 0-4 | |
4087 mullw d'4' | |
4088 movf PRODL,W | |
4089 addlw d'7' ; = address for He ratio | |
4090 movwf EEADR | |
4091 call read_eeprom ; Read He ratio | |
4092 movff EEDATA,hi ; And copy into hold register | |
4093 decf active_gas,W ; Gas 0-4 | |
4094 mullw d'4' | |
4095 movf PRODL,W | |
4096 addlw d'6' ; = address for O2 ratio | |
4097 movwf EEADR | |
4098 call read_eeprom ; Read O2 ratio | |
4099 movff EEDATA, lo ; O2 ratio | |
4100 | |
4101 WIN_LEFT .0 | |
34 | 4102 WIN_TOP .110 |
33 | 4103 lfsr FSR2,letter |
4104 movlw 'D' | |
4105 movwf POSTINC2 | |
4106 movlw 'i' | |
4107 movwf POSTINC2 | |
4108 movlw 'l' | |
4109 movwf POSTINC2 | |
4110 movlw ':' | |
4111 movwf POSTINC2 | |
4112 output_8 ; O2 Ratio | |
4113 movlw '/' | |
4114 movwf POSTINC2 | |
4115 movff hi,lo | |
4116 output_8 ; He Ratio | |
4117 call word_processor | |
4118 | |
4119 bcf leftbind | |
4120 return ; Return (CC Mode) | |
4121 | |
0 | 4122 |
4123 | |
4124 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | |
4125 | |
4126 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
4127 return | |
4128 | |
4129 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
4130 movff EEDATA, wait_temp ; salinity | |
4131 | |
4132 movlw d'105' ; 105% ? | |
4133 cpfslt wait_temp ; Salinity higher limit | |
4134 return ; Out of limit, do not adjust lo:hi | |
4135 | |
4136 movlw d'99' ; 99% ? | |
4137 cpfsgt wait_temp ; Salinity lower limit | |
4138 return ; Out of limit, do not adjust lo:hi | |
4139 | |
4140 movff lo,xA+0 | |
4141 movff hi,xA+1 | |
4142 | |
4143 movlw d'100' | |
4144 movwf xB+0 | |
4145 clrf xB+1 | |
4146 | |
4147 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
4148 | |
4149 movff wait_temp,xB+0 ; Salinity | |
4150 clrf xB+1 | |
4151 | |
4152 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
4153 | |
4154 movff xC+0,lo | |
4155 movff xC+1,hi ; restore lo and hi with updated value | |
4156 | |
4157 return |