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