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