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