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