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