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