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