Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 73:2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
author | heinrichsweikamp |
---|---|
date | Sun, 14 Nov 2010 20:45:39 +0100 |
parents | 6beb680a6130 |
children | a1ccb92b59cd |
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 | |
2382 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
2383 bra PLED_divemode_menu_mask_first2 | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2384 |
0 | 2385 ; in OC Mode |
2386 DISPLAYTEXT .32 ;"Gaslist" | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2387 DISPLAYTEXT .31 ;"Decoplan" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2388 DISPLAYTEXT .122 ;"Set Gas" |
0 | 2389 bra PLED_divemode_menu_mask_first3 |
2390 | |
2391 PLED_divemode_menu_mask_first2: | |
2392 ; in CC Mode | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2393 DISPLAYTEXT .238 ;"SetPoint" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2394 DISPLAYTEXT .31 ;"Decoplan" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2395 DISPLAYTEXT .137 ;"Bailout" |
0 | 2396 |
2397 PLED_divemode_menu_mask_first3: | |
2398 ; In all modes | |
2399 DISPLAYTEXT .33 ;"More" | |
2400 DISPLAYTEXT .34 ;"Exit" | |
2401 return | |
2402 | |
2403 PLED_divemode_menu_mask_second: ; Write Divemode menu1 mask | |
2404 ostc_debug 'o' ; Sends debug-information to screen if debugmode active | |
2405 DISPLAYTEXT .240 ;"Graphs" | |
2406 DISPLAYTEXT .241 ;"Display" | |
2407 DISPLAYTEXTH .281 ;"L. Tissue" | |
2408 DISPLAYTEXT .147 ;"Stopwat." | |
2409 DISPLAYTEXT .244 ;"Exit" | |
2410 return | |
2411 | |
2412 PLED_divemode_set_xgas: ; Displayes the "Set Gas" menu | |
2413 WIN_LEFT .100 | |
2414 WIN_TOP .0 | |
2415 WIN_FONT FT_SMALL | |
3 | 2416 call PLED_standard_color |
2417 | |
0 | 2418 lfsr FSR2,letter |
2419 movlw 'S' | |
2420 movwf POSTINC2 | |
2421 movlw 'e' | |
2422 movwf POSTINC2 | |
2423 movlw 'l' | |
2424 movwf POSTINC2 | |
2425 read_int_eeprom d'24' ; Get Gas6 %O2 | |
2426 movff EEDATA,lo | |
2427 bcf leftbind | |
2428 output_99 ; outputs into Postinc2! | |
2429 movlw '/' | |
2430 movwf POSTINC2 | |
2431 read_int_eeprom d'25' ; Get Gas6 %He | |
2432 movff EEDATA,lo | |
2433 output_99 ; outputs into Postinc2! | |
2434 call word_processor | |
2435 DISPLAYTEXT .123 ; O2 + | |
2436 DISPLAYTEXT .124 ; O2 - | |
2437 DISPLAYTEXT .125 ; He + | |
2438 DISPLAYTEXT .126 ; He - | |
2439 return | |
2440 | |
2441 PLED_divemode_simulator_mask: | |
2442 DISPLAYTEXT .254 ; EXIT | |
2443 DISPLAYTEXT .250 ; + 1m | |
2444 DISPLAYTEXT .251 ; - 1m | |
2445 DISPLAYTEXT .252 ; +10m | |
2446 DISPLAYTEXT .253 ; -10m | |
2447 return | |
2448 | |
2449 PLED_decoplan_bargraph: | |
64 | 2450 GETCUSTOM8 d'35' ; Standard output color |
0 | 2451 movff WREG,box_temp+0 ; Data |
65 | 2452 movff hi,win_top |
30 | 2453 incf win_top,F ; +1 |
0 | 2454 movff win_top,box_temp+1 ; row top (0-239) |
2455 movff win_top,box_temp+2 ; | |
30 | 2456 movlw d'18' |
0 | 2457 addwf box_temp+2,F ; row bottom (0-239) |
2458 movlw .122 | |
2459 movff WREG,box_temp+3 ; column left (0-159) | |
2460 addwf lo,F ; Add time offset | |
64 | 2461 btfsc STATUS,C ; >255? |
2462 setf lo ; limit to 255 | |
2463 decf lo,F ; No, minus one | |
0 | 2464 movlw d'138' ; Limit length (16min) |
2465 cpfslt lo | |
2466 movwf lo | |
2467 movff lo,box_temp+4 ; column right (0-159) | |
2468 call PLED_box | |
2469 | |
2470 movlw .0 | |
2471 movff WREG,box_temp+0 ; Data | |
2472 movff win_top,box_temp+1 ; row top (0-239) | |
2473 movff win_top,box_temp+2 ; | |
30 | 2474 movlw d'18' |
0 | 2475 addwf box_temp+2,F ; row bottom (0-239) |
2476 movff lo,box_temp+3 ; | |
2477 incf box_temp+3,F ; column left (0-159) | |
2478 movlw .139 | |
2479 movff WREG,box_temp+4 ; column right (0-159) | |
2480 call PLED_box | |
2481 return | |
2482 | |
70
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2483 PLED_decoplan_delete_gf: ; Delete unused rows |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2484 movlw .238 |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2485 movff WREG,box_temp+2 ; row bottom (0-239) |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2486 bra PLED_decoplan_delete_common |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2487 |
0 | 2488 PLED_decoplan_delete: ; Delete unused rows |
70
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2489 movlw .184 |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2490 movff WREG,box_temp+2 ; row bottom (0-239) |
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2491 PLED_decoplan_delete_common: |
0 | 2492 movlw .0 |
2493 movff WREG,box_temp+0 ; data 00, x0, 0y, xy clear, links, rechts, beide | |
64 | 2494 movff hi,box_temp+1 ; row top (0-239) |
0 | 2495 movlw .100 |
2496 movff WREG,box_temp+3 ; column left (0-159) | |
2497 movlw .159 | |
2498 movff WREG,box_temp+4 ; column right (0-159) | |
2499 call PLED_box | |
64 | 2500 bsf last_ceiling_gf_shown ; Set flag |
0 | 2501 return |
2502 | |
70
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2503 |
64 | 2504 PLED_decoplan_gf_page_current: |
2505 movlw d'0' | |
2506 cpfseq temp8 | |
65 | 2507 bra PLED_decoplan_gf_page2 ; =1: Dispplay Page 2 |
64 | 2508 bra PLED_decoplan_gf_page1 ; =0, Display Page 1 |
66 | 2509 |
64 | 2510 PLED_decoplan_gf_page1: |
2511 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2512 | |
2513 movff char_O_array_decodepth+0,lo ; Get Depth | |
2514 tstfsz lo | |
2515 bra PLED_decoplan_gf_page1x | |
2516 ; No Deco, show "no Deco" | |
2517 DISPLAYTEXT d'239' ;"No Deco" | |
2518 return | |
2519 | |
2520 PLED_decoplan_gf_page2: | |
2521 ; temp7 holds last displayed depth | |
2522 ; temp5 list entry | |
66 | 2523 movff temp5,temp9 ; save |
2524 movff temp7,temp10 ; save | |
64 | 2525 movlw .231 |
2526 movwf temp6 ; row | |
2527 PLED_decoplan_gf_page2y: | |
2528 movlw d'3' | |
2529 addwf temp7,F ; Add 3m for next stop | |
2530 movlw d'25' | |
2531 addwf temp6,F | |
2532 incf temp5,F | |
2533 call PLED_decoplan_show_stop_gf | |
65 | 2534 movlw d'15' ; the next 8 Stops... |
64 | 2535 cpfseq temp5 |
2536 bra PLED_decoplan_gf_page2y | |
66 | 2537 movff temp9,temp5 ; restore |
2538 movff temp10,temp7 ; restore | |
65 | 2539 bsf last_ceiling_gf_shown ; Set flag |
64 | 2540 return |
2541 | |
2542 PLED_decoplan_gf_page1x: | |
2543 clrf temp8 ; Page 0-3 of deco list | |
2544 GETCUSTOM8 d'29' ; Last Deco in m | |
2545 movwf temp7 ; Start with last stop | |
2546 setf temp5 | |
2547 movlw .231 | |
2548 movwf temp6 ; row | |
2549 | |
2550 ; Show last stop manually | |
2551 movlw d'25' | |
2552 addwf temp6,F | |
2553 incf temp5,F | |
2554 call PLED_decoplan_show_stop_gf | |
2555 GETCUSTOM8 d'29' ; Last Deco in m | |
2556 movwf temp7 ; Last deco | |
65 | 2557 movlw d'4' |
2558 cpfslt temp7 ; >=3m? | |
2559 bra PLED_decoplan_gf_page1x_next_6m | |
2560 | |
64 | 2561 movlw d'3' |
2562 movwf temp7 | |
2563 bra PLED_decoplan_gf_page1y | |
2564 | |
2565 PLED_decoplan_gf_page1x_next_6m: | |
2566 movlw d'6' | |
2567 movwf temp7 | |
68 | 2568 incf temp5,F |
64 | 2569 PLED_decoplan_gf_page1y: |
2570 movlw d'3' | |
2571 addwf temp7,F ; Add 3m for next stop | |
2572 movlw d'25' | |
2573 addwf temp6,F | |
2574 incf temp5,F | |
2575 call PLED_decoplan_show_stop_gf | |
65 | 2576 movlw d'7' ; the next 7 Stops... |
64 | 2577 cpfseq temp5 |
2578 bra PLED_decoplan_gf_page1y | |
2579 return | |
2580 | |
67 | 2581 |
64 | 2582 PLED_decoplan_show_stop_gf: |
2583 bsf leftbind | |
2584 WIN_LEFT .100 | |
2585 movff temp6,win_top | |
2586 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
2587 | |
2588 movff char_O_array_decodepth+0,WREG ; Ceiling | |
2589 cpfslt temp7 ; Ceiling already displayed? | |
70
8d8e753d72e3
1.72beta - small output fix in non-GF modes
heinrichsweikamp
parents:
69
diff
changeset
|
2590 goto PLED_decoplan_delete_gf ; Yes, quit display and RETURN |
64 | 2591 movff temp7,lo ; Decodepth |
2592 | |
2593 lfsr FSR2,letter | |
66 | 2594 output_99x ; outputs into Postinc2! |
64 | 2595 movlw 'm' |
2596 movwf POSTINC2 | |
2597 call word_processor | |
2598 WIN_LEFT .140 | |
2599 movff temp6,win_top | |
68 | 2600 ; lfsr FSR1,0x251 |
2601 lfsr FSR1,0x0E1 ; Gf_decolist_copy | |
64 | 2602 movf temp5,W ; number of entry |
68 | 2603 movff PLUSW1,lo ; Stop length |
2604 incf lo,F ; add one dummy minute | |
64 | 2605 lfsr FSR2,letter |
2606 output_99x ; outputs into Postinc2! | |
2607 movlw d'39' ;"'" | |
2608 movwf POSTINC2 | |
2609 call word_processor | |
2610 tstfsz lo ; 0 min "Stop"? | |
2611 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2612 return | |
2613 | |
2614 | |
0 | 2615 PLED_decoplan: ; display the Decoplan |
2616 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2617 | |
2618 movff char_O_array_decodepth+0,lo ; Get Depth | |
2619 tstfsz lo | |
2620 bra PLED_decoplan1 | |
2621 ; No Deco, show "no Deco" | |
64 | 2622 ; call PLED_clear_divemode_menu ; Clear Deco area |
0 | 2623 DISPLAYTEXT d'239' ;"No Deco" |
2624 return | |
2625 | |
2626 PLED_decoplan1: | |
30 | 2627 setf temp5 |
2628 movlw .231 | |
2629 movwf temp6 ; row | |
2630 PLED_decoplan2: | |
2631 movlw d'25' | |
2632 addwf temp6,F | |
2633 incf temp5,F | |
2634 call PLED_decoplan_show_stop | |
2635 movlw d'5' ; 6 Stops... | |
2636 cpfseq temp5 | |
2637 bra PLED_decoplan2 | |
2638 return | |
2639 | |
2640 PLED_decoplan_show_stop: | |
0 | 2641 bsf leftbind |
2642 WIN_LEFT .100 | |
30 | 2643 movff temp6,win_top |
2644 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
2645 | |
2646 lfsr FSR1,char_O_array_decodepth;+0 | |
2647 movf temp5,W ; number of entry | |
2648 movff PLUSW1,lo | |
0 | 2649 movf lo,w |
2650 btfsc STATUS,Z ; =0 | |
2651 goto PLED_decoplan_delete ; Yes, quit display | |
30 | 2652 |
0 | 2653 lfsr FSR2,letter |
2654 output_8 ; outputs into Postinc2! | |
2655 movlw 'm' | |
2656 movwf POSTINC2 | |
2657 call word_processor | |
30 | 2658 |
0 | 2659 WIN_LEFT .140 |
30 | 2660 movff temp6,win_top |
2661 | |
2662 lfsr FSR1,char_O_array_decotime;+0 | |
2663 movf temp5,W ; number of entry | |
2664 movff PLUSW1,lo | |
2665 | |
2666 lfsr FSR2,letter | |
0 | 2667 output_99x ; outputs into Postinc2! |
2668 movlw d'39' ;"'" | |
2669 movwf POSTINC2 | |
2670 call word_processor | |
64 | 2671 tstfsz lo ; 0 min "Stop"? |
2672 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
0 | 2673 return |
2674 | |
64 | 2675 |
0 | 2676 PLED_gas_list: |
2677 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
2678 | |
2679 WIN_LEFT .100 | |
2680 WIN_FONT FT_SMALL | |
2681 bsf leftbind | |
2682 | |
2683 movlw d'2' | |
2684 movwf wait_temp ; here: stores eeprom address for gas list | |
2685 movlw d'231' | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2686 movwf waitms_temp ; here: stores row for gas list |
0 | 2687 clrf hi ; here: Gas counter |
2688 | |
2689 PLED_gas_list_loop: | |
2690 incf hi,F ; Increase Gas | |
2691 movlw d'4' | |
2692 addwf wait_temp,F ; Increase eeprom address for gas list | |
2693 movlw d'25' | |
2694 addwf waitms_temp,F ; Increase row | |
2695 WIN_LEFT .100 | |
2696 movff waitms_temp,win_top ; Set Row | |
2697 | |
2698 lfsr FSR2,letter | |
2699 movlw 'G' | |
2700 movwf POSTINC2 | |
2701 movff hi,lo ; copy gas number | |
2702 output_8 ; display gas number | |
2703 movlw ':' | |
2704 movwf POSTINC2 | |
2705 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
2706 call read_eeprom ; get byte (stored in EEDATA) | |
2707 movff EEDATA,lo ; copy to lo | |
2708 output_8 ; outputs into Postinc2! | |
2709 movlw '/' | |
2710 movwf POSTINC2 | |
2711 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
2712 call read_eeprom ; get byte (stored in EEDATA) | |
2713 movff EEDATA,lo ; copy to lo | |
2714 output_8 ; outputs into Postinc2! | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2715 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2716 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
|
2717 call read_eeprom ; get byte (stored in EEDATA) |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2718 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
|
2719 ; Check if gas needs to be greyed-out (inactive) |
0 | 2720 read_int_eeprom d'27' ; read flag register |
2721 movff hi,lo ; copy gas number | |
2722 PLED_gas_list_loop1: | |
2723 rrcf EEDATA ; roll flags into carry | |
2724 decfsz lo,F ; max. 5 times... | |
2725 bra PLED_gas_list_loop1 | |
19 | 2726 |
2727 movlw color_grey | |
0 | 2728 btfss STATUS,C ; test carry |
19 | 2729 call PLED_set_color ; grey out inactive gases! |
0 | 2730 |
2731 call word_processor | |
19 | 2732 call PLED_standard_color |
0 | 2733 |
2734 movlw d'5' ; list all five gases | |
2735 cpfseq hi ; All gases shown? | |
2736 bra PLED_gas_list_loop ; No | |
2737 | |
2738 return ; No, return (OC mode) | |
2739 | |
2740 PLED_splist_start: | |
2741 WIN_LEFT .100 | |
2742 WIN_FONT FT_SMALL | |
2743 bsf leftbind | |
2744 | |
2745 ; list three SP in Gaslist | |
2746 movlw d'35' ; 36 = current SP position in EEPROM | |
2747 movwf wait_temp ; here: stores eeprom address for gas list | |
2748 movlw d'231' | |
2749 movwf waitms_temp ; here: stores row for gas list | |
2750 clrf temp5 ; here: SP counter | |
2751 | |
2752 PLED_splist_loop: | |
2753 incf wait_temp,F ; EEPROM address | |
2754 incf temp5,F ; Increase SP | |
2755 | |
2756 movlw d'25' | |
2757 addwf waitms_temp,F ; Increase row | |
2758 movff waitms_temp,win_top ; Set Row | |
2759 WIN_LEFT .100 | |
2760 | |
2761 lfsr FSR2,letter | |
2762 movlw 'S' | |
2763 movwf POSTINC2 | |
2764 movlw 'P' | |
2765 movwf POSTINC2 | |
2766 movff temp5,lo ; copy gas number | |
2767 output_8 ; display gas number | |
2768 movlw ':' | |
2769 movwf POSTINC2 | |
2770 movff wait_temp, EEADR; SP #hi position | |
2771 call read_eeprom ; get byte (stored in EEDATA) | |
2772 movff EEDATA,lo ; copy to lo | |
2773 clrf hi | |
2774 output_16dp d'3' ; outputs into Postinc2! | |
2775 call word_processor | |
2776 | |
2777 movlw d'3' ; list all three SP | |
2778 cpfseq temp5 ; All gases shown? | |
2779 bra PLED_splist_loop ; No | |
2780 | |
2781 bcf leftbind | |
2782 return ; no, return | |
2783 | |
2784 PLED_clear_divemode_menu: | |
2785 movlw .0 | |
2786 movff WREG,box_temp+0 ; Data | |
2787 movlw .0 | |
2788 movff WREG,box_temp+1 ; row top (0-239) | |
30 | 2789 ; movlw .125 |
2790 movlw .185 | |
0 | 2791 movff WREG,box_temp+2 ; row bottom (0-239) |
2792 movlw .082 | |
2793 movff WREG,box_temp+3 ; column left (0-159) | |
2794 movlw .159 | |
2795 movff WREG,box_temp+4 ; column right (0-159) | |
2796 call PLED_box | |
2797 return | |
2798 | |
2799 PLED_divemenu_cursor: | |
2800 ostc_debug 'l' ; Sends debug-information to screen if debugmode active | |
2801 WIN_TOP .0 | |
2802 WIN_LEFT .85 | |
2803 WIN_FONT FT_SMALL | |
2804 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2805 call PLED_standard_color |
0 | 2806 lfsr FSR2,letter |
2807 movlw 0xB8 | |
2808 movwf POSTINC2 | |
2809 call word_processor | |
2810 WIN_TOP .25 | |
2811 WIN_LEFT .85 | |
2812 WIN_FONT FT_SMALL | |
2813 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2814 call PLED_standard_color |
0 | 2815 lfsr FSR2,letter |
2816 movlw 0xB8 | |
2817 movwf POSTINC2 | |
2818 call word_processor | |
2819 WIN_TOP .50 | |
2820 WIN_LEFT .85 | |
2821 WIN_FONT FT_SMALL | |
2822 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2823 call PLED_standard_color |
0 | 2824 lfsr FSR2,letter |
2825 movlw 0xB8 | |
2826 movwf POSTINC2 | |
2827 call word_processor | |
2828 WIN_TOP .75 | |
2829 WIN_LEFT .85 | |
2830 WIN_FONT FT_SMALL | |
2831 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2832 call PLED_standard_color |
0 | 2833 lfsr FSR2,letter |
2834 movlw 0xB8 | |
2835 movwf POSTINC2 | |
2836 call word_processor | |
2837 WIN_TOP .100 | |
2838 WIN_LEFT .85 | |
2839 WIN_FONT FT_SMALL | |
2840 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2841 call PLED_standard_color |
0 | 2842 lfsr FSR2,letter |
2843 movlw 0xB8 | |
2844 movwf POSTINC2 | |
2845 call word_processor | |
2846 | |
2847 movff menupos,temp1 | |
2848 movlw d'0' | |
2849 dcfsnz temp1,F | |
2850 movlw d'0' | |
2851 dcfsnz temp1,F | |
2852 movlw d'25' | |
2853 dcfsnz temp1,F | |
2854 movlw d'50' | |
2855 dcfsnz temp1,F | |
2856 movlw d'75' | |
2857 dcfsnz temp1,F | |
2858 movlw d'100' | |
2859 movff WREG,win_top | |
2860 WIN_LEFT .85 | |
2861 WIN_FONT FT_SMALL | |
2862 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2863 call PLED_standard_color |
2864 | |
0 | 2865 lfsr FSR2,letter |
2866 movlw 0xB7 ; Arrow for menu | |
2867 movwf POSTINC2 | |
2868 call word_processor | |
2869 return | |
2870 | |
33 | 2871 ;PLED_profileview_menu: |
2872 ; DISPLAYTEXT .127 ;"Exit" | |
2873 ; DISPLAYTEXT .128 ;"Delete" | |
2874 ;; DISPLAYTEXT .132 ;"Format" | |
2875 ; return | |
0 | 2876 |
37 | 2877 custom_warn_surfmode: ; With CF in temp1 |
0 | 2878 movlw .0 |
2879 movff WREG,box_temp+0 ; Data | |
2880 movlw .56 | |
2881 movff WREG,box_temp+1 ; row top (0-239) | |
2882 movlw .88 | |
2883 movff WREG,box_temp+2 ; row bottom (0-239) | |
2884 movlw .69 | |
2885 movff WREG,box_temp+3 ; column left (0-159) | |
2886 movlw .115 | |
2887 movff WREG,box_temp+4 ; column right (0-159) | |
2888 call PLED_box | |
2889 | |
9 | 2890 GETCUSTOM8 d'35' ; Standard output color |
0 | 2891 movff WREG,box_temp+0 ; Data |
2892 movlw .58 | |
2893 movff WREG,box_temp+1 ; row top (0-239) | |
2894 movlw .86 | |
2895 movff WREG,box_temp+2 ; row bottom (0-239) | |
2896 movlw .70 | |
2897 movff WREG,box_temp+3 ; column left (0-159) | |
2898 movlw .114 | |
2899 movff WREG,box_temp+4 ; column right (0-159) | |
2900 call PLED_frame | |
2901 ; warning text | |
2902 | |
2903 WIN_TOP .60 | |
2904 WIN_LEFT .71 | |
2905 WIN_FONT FT_SMALL | |
2906 WIN_INVERT .1 ; Init new Wordprocessor | |
37 | 2907 call PLED_warnings_color ; Set Color for Warning |
0 | 2908 lfsr FSR2,letter |
2909 movlw 'C' | |
2910 movwf POSTINC2 | |
2911 movlw 'F' | |
2912 movwf POSTINC2 | |
2913 movff temp1,lo | |
2914 output_8 | |
2915 movlw '!' | |
2916 movwf POSTINC2 | |
2917 call word_processor | |
2918 | |
2919 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2920 call PLED_standard_color |
0 | 2921 return |
2922 | |
2923 PLED_saturation_graph_divemode: | |
2924 ostc_debug 'h' ; Sends debug-information to screen if debugmode active | |
2925 PLED_tissue_saturation_graph: | |
2926 ostc_debug 'i' ; Sends debug-information to screen if debugmode active | |
13 | 2927 |
2928 ; Clear graph area... | |
2929 movlw .0 | |
2930 movff WREG,box_temp+0 ; Data | |
2931 movlw .25 | |
2932 movff WREG,box_temp+1 ; row top (0-239) | |
2933 movlw .120 | |
2934 movff WREG,box_temp+2 ; row bottom (0-239) | |
2935 movlw .82 | |
2936 movff WREG,box_temp+3 ; column left (0-159) | |
2937 movlw .159 | |
2938 movff WREG,box_temp+4 ; column right (0-159) | |
2939 call PLED_box | |
2940 | |
19 | 2941 ; Draw Frame |
9 | 2942 GETCUSTOM8 d'35' ; Standard output color |
0 | 2943 movff WREG,box_temp+0 ; Data |
2944 movlw .25 | |
2945 movff WREG,box_temp+1 ; row top (0-239) | |
2946 movlw .120 | |
2947 movff WREG,box_temp+2 ; row bottom (0-239) | |
2948 movlw .82 | |
2949 movff WREG,box_temp+3 ; column left (0-159) | |
2950 movlw .159 | |
2951 movff WREG,box_temp+4 ; column right (0-159) | |
2952 call PLED_frame | |
2953 | |
19 | 2954 ; Draw N2 Tissues |
0 | 2955 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2956 movlw d'16' | |
2957 movwf wait_temp ; 16 tissues | |
2958 clrf waitms_temp ; Row offset | |
2959 PLED_tissue_saturation_graph3: | |
9 | 2960 GETCUSTOM8 d'35' ; Standard output color |
0 | 2961 movff WREG,box_temp+0 ; Data |
2962 movlw .28 | |
2963 addwf waitms_temp,W | |
2964 movff WREG,box_temp+1 ; row top (0-239) | |
2965 movlw .28 | |
2966 addwf waitms_temp,W | |
2967 movff WREG,box_temp+2 ; row bottom (0-239) | |
2968 | |
2969 incf waitms_temp,F | |
2970 incf waitms_temp,F | |
2971 | |
2972 movlw .100 | |
2973 movff WREG,box_temp+3 ; column left (0-159) | |
2974 | |
2975 movff POSTINC2,box_temp+4 | |
2976 bcf STATUS,C | |
2977 rrcf box_temp+4,F | |
2978 bcf STATUS,C | |
2979 rrcf box_temp+4,F | |
2980 movlw .100 | |
2981 addwf box_temp+4,F ; column right (0-159) | |
2982 | |
2983 movlw d'157' ; limit display | |
2984 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
2985 movwf box_temp+4 | |
2986 | |
2987 call PLED_box | |
2988 | |
2989 decfsz wait_temp,F | |
2990 bra PLED_tissue_saturation_graph3 | |
2991 | |
19 | 2992 ; Draw He Tissues |
0 | 2993 lfsr FSR2, char_O_tissue_saturation+.016 ; He |
2994 movlw d'16' | |
2995 movwf wait_temp ; 16 tissues | |
2996 clrf waitms_temp ; Row offset | |
2997 PLED_tissue_saturation_graph2: | |
9 | 2998 GETCUSTOM8 d'35' ; Standard output color |
0 | 2999 movff WREG,box_temp+0 ; Data |
3000 movlw .86 | |
3001 addwf waitms_temp,W | |
3002 movff WREG,box_temp+1 ; row top (0-239) | |
3003 movlw .86 | |
3004 addwf waitms_temp,W | |
3005 movff WREG,box_temp+2 ; row bottom (0-239) | |
3006 | |
3007 incf waitms_temp,F | |
3008 incf waitms_temp,F | |
3009 | |
3010 movlw .100 | |
3011 movff WREG,box_temp+3 ; column left (0-159) | |
3012 | |
3013 movff POSTINC2,box_temp+4 | |
3014 bcf STATUS,C | |
3015 rrcf box_temp+4,F | |
3016 bcf STATUS,C | |
3017 rrcf box_temp+4,F | |
3018 movlw .100 | |
3019 addwf box_temp+4,F ; column right (0-159) | |
3020 | |
3021 movlw d'157' ; limit display | |
3022 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
3023 movwf box_temp+4 | |
3024 | |
3025 call PLED_box | |
3026 | |
3027 decfsz wait_temp,F | |
3028 bra PLED_tissue_saturation_graph2 | |
3029 | |
19 | 3030 ; Draw Text |
0 | 3031 WIN_LEFT .84 |
3032 WIN_TOP .32 | |
3 | 3033 call PLED_standard_color |
0 | 3034 lfsr FSR2,letter |
3035 movlw 'N' | |
3036 movwf POSTINC2 | |
3037 movlw '2' | |
3038 movwf POSTINC2 | |
3039 call word_processor | |
3040 WIN_LEFT .84 | |
3041 WIN_TOP .90 | |
3 | 3042 call PLED_standard_color |
0 | 3043 lfsr FSR2,letter |
3044 movlw 'H' | |
3045 movwf POSTINC2 | |
3046 movlw 'e' | |
3047 movwf POSTINC2 | |
3048 call word_processor | |
19 | 3049 |
3050 movff char_O_gtissue_no,wait_temp ; used as temp | |
3051 | |
3052 lfsr FSR2,letter | |
3053 lfsr FSR1,char_O_tissue_saturation+0 | |
3054 incf wait_temp,F ; make 1-16 of 0-15 | |
3055 PLED_tissue_saturation_graph4: ; point to leading tissue... | |
3056 movff POSTINC1,lo ; copy/overwrite to lo register | |
3057 decfsz wait_temp,F ; count until zero | |
3058 bra PLED_tissue_saturation_graph4 ;loop | |
3059 output_8 | |
3060 movlw '%' | |
3061 movwf POSTINC2 | |
3062 movlw ' ' | |
3063 movwf POSTINC2 | |
3064 WIN_LEFT .84 | |
3065 WIN_TOP .62 | |
3066 WIN_FONT FT_SMALL | |
3067 call PLED_standard_color | |
3068 call word_processor | |
3069 bcf leftbind | |
3070 | |
3071 ; Draw Scale | |
3072 GETCUSTOM8 d'35' ; Standard output color | |
3073 movff WREG,box_temp+0 ; Data | |
3074 movlw .73 | |
3075 movff WREG,box_temp+1 ; row top (0-239) | |
3076 movlw .74 | |
3077 movff WREG,box_temp+2 ; row bottom (0-239) | |
3078 movlw .121 | |
3079 movff WREG,box_temp+3 ; column left (0-159) | |
3080 movlw .157 | |
3081 movff WREG,box_temp+4 ; column right (0-159) | |
3082 call PLED_frame | |
3083 | |
3084 GETCUSTOM8 d'35' ; Standard output color | |
3085 movff WREG,box_temp+0 ; Data | |
3086 movlw .61 | |
3087 movff WREG,box_temp+1 ; row top (0-239) | |
3088 movlw .84 | |
3089 movff WREG,box_temp+2 ; row bottom (0-239) | |
3090 movlw .121 | |
3091 movff WREG,box_temp+3 ; column left (0-159) | |
3092 movlw .122 | |
3093 movff WREG,box_temp+4 ; column right (0-159) | |
3094 call PLED_box | |
3095 GETCUSTOM8 d'35' ; Standard output color | |
3096 movff WREG,box_temp+0 ; Data | |
3097 movlw .65 | |
3098 movff WREG,box_temp+1 ; row top (0-239) | |
3099 movlw .80 | |
3100 movff WREG,box_temp+2 ; row bottom (0-239) | |
3101 movlw .121+.9 | |
3102 movff WREG,box_temp+3 ; column left (0-159) | |
3103 movlw .122+.9 | |
3104 movff WREG,box_temp+4 ; column right (0-159) | |
3105 call PLED_box | |
3106 GETCUSTOM8 d'35' ; Standard output color | |
3107 movff WREG,box_temp+0 ; Data | |
3108 movlw .65 | |
3109 movff WREG,box_temp+1 ; row top (0-239) | |
3110 movlw .80 | |
3111 movff WREG,box_temp+2 ; row bottom (0-239) | |
3112 movlw .121+.18 | |
3113 movff WREG,box_temp+3 ; column left (0-159) | |
3114 movlw .122+.18 | |
3115 movff WREG,box_temp+4 ; column right (0-159) | |
3116 call PLED_box | |
3117 GETCUSTOM8 d'35' ; Standard output color | |
3118 movff WREG,box_temp+0 ; Data | |
3119 movlw .65 | |
3120 movff WREG,box_temp+1 ; row top (0-239) | |
3121 movlw .80 | |
3122 movff WREG,box_temp+2 ; row bottom (0-239) | |
3123 movlw .121+.27 | |
3124 movff WREG,box_temp+3 ; column left (0-159) | |
3125 movlw .122+.27 | |
3126 movff WREG,box_temp+4 ; column right (0-159) | |
3127 call PLED_box | |
3128 GETCUSTOM8 d'35' ; Standard output color | |
3129 movff WREG,box_temp+0 ; Data | |
3130 movlw .61 | |
3131 movff WREG,box_temp+1 ; row top (0-239) | |
3132 movlw .84 | |
3133 movff WREG,box_temp+2 ; row bottom (0-239) | |
3134 movlw .121+.36 | |
3135 movff WREG,box_temp+3 ; column left (0-159) | |
3136 movlw .122+.36 | |
3137 movff WREG,box_temp+4 ; column right (0-159) | |
3138 call PLED_box | |
3139 | |
0 | 3140 return |
3141 | |
3142 | |
3143 PLED_startupscreen1: | |
3144 call PLED_topline_box | |
3145 WIN_INVERT .1 ; Init new Wordprocessor | |
3146 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3147 WIN_INVERT .0 ; Init new Wordprocessor | |
3148 DISPLAYTEXT .68 ; Licence 1/2 | |
3149 DISPLAYTEXT .69 | |
3150 DISPLAYTEXT .70 | |
3151 DISPLAYTEXT .71 | |
3152 DISPLAYTEXT .72 | |
3153 DISPLAYTEXT .73 | |
3154 DISPLAYTEXT .74 | |
3155 return | |
3156 | |
3157 PLED_startupscreen2: | |
3158 call PLED_topline_box | |
3159 WIN_INVERT .1 ; Init new Wordprocessor | |
3160 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3161 WIN_INVERT .0 ; Init new Wordprocessor | |
3162 DISPLAYTEXT .75 ; Licence 2/2 | |
3163 DISPLAYTEXT .76 | |
3164 DISPLAYTEXT .77 | |
3165 DISPLAYTEXT .78 | |
3166 DISPLAYTEXT .79 | |
3167 DISPLAYTEXT .80 | |
3168 DISPLAYTEXT .81 | |
3169 return | |
3170 | |
3171 PLED_new_cf_warning: | |
3172 call PLED_topline_box | |
3173 WIN_INVERT .1 ; Init new Wordprocessor | |
3174 DISPLAYTEXTH .271 ; New CF added! | |
3175 WIN_INVERT .0 ; Init new Wordprocessor | |
3176 DISPLAYTEXTH .272 ; New CustomFunctions | |
3177 DISPLAYTEXTH .273 ; were added! Check | |
3178 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
3179 DISPLAYTEXTH .275 ; for Details! | |
3180 return | |
3181 | |
3182 PLED_const_ppO2_value: | |
3183 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3184 return ; Yes, No update and return! | |
3185 | |
3186 ostc_debug 'j' ; Sends debug-information to screen if debugmode active | |
3187 | |
3188 WIN_TOP .168 | |
3189 WIN_LEFT .65 | |
3190 WIN_FONT FT_SMALL | |
3191 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 3192 |
0 | 3193 lfsr FSR2,letter |
3194 movff char_I_const_ppO2,lo | |
3195 | |
3196 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
3197 bra PLED_const_ppO2_value2 ; No, display Setpoint | |
3198 | |
3199 ; Yes, Display "Bail" | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3200 call PLED_standard_color |
0 | 3201 OUTPUTTEXTH d'263' ;"Bail" |
3202 call word_processor | |
3203 return | |
3204 | |
3205 PLED_const_ppO2_value2: ; Display SetPoint | |
3206 ;Show fixed SP value | |
4 | 3207 movff amb_pressure+0,xA+0 |
3208 movff amb_pressure+1,xA+1 | |
3209 movlw d'10' | |
3210 movwf xB+0 | |
3211 clrf xB+1 | |
3212 ;xA/xB=xC with xA as remainder | |
3213 call div16x16 ; xC+0=p_amb/10 | |
26 | 3214 |
4 | 3215 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
3216 tstfsz xC+1 ; xC>255 | |
3217 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 3218 |
4 | 3219 movff ppO2_setpoint_store,WREG |
3220 cpfslt xC+0 ; Setpoint value possible? | |
26 | 3221 bra PLED_const_ppO2_value1 ; Yes |
4 | 3222 |
3223 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3224 bra PLED_const_ppO2_value1a | |
3225 | |
3226 PLED_const_ppO2_value1: | |
26 | 3227 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
3228 movff amb_pressure+0,xA+0 | |
3229 movff amb_pressure+1,xA+1 | |
3230 movlw d'10' | |
3231 movwf xB+0 | |
3232 clrf xB+1 | |
3233 call div16x16 ; xC=p_amb/10 | |
3234 movff xC+0,xA+0 | |
3235 movff xC+1,xA+1 | |
3236 movff char_I_O2_ratio,xB+0 | |
3237 clrf xB+1 | |
3238 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
3239 | |
3240 movff xC+0,sub_b+0 | |
3241 movff xC+1,sub_b+1 | |
3242 movff ppO2_setpoint_store,WREG; Setpoint | |
3243 mullw d'100' ; Setpoint*100 | |
3244 movff PRODL,sub_a+0 | |
3245 movff PRODH,sub_a+1 | |
3246 call sub16 ; sub_c = sub_a - sub_b | |
3247 | |
3248 btfss neg_flag | |
3249 bra PLED_const_ppO2_value11 ; Value in range | |
3250 | |
3251 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
3252 | |
3253 movff xC+0,xA+0 | |
3254 movff xC+1,xA+1 | |
3255 movlw d'100' | |
3256 movwf xB+0 | |
3257 clrf xB+1 | |
3258 call div16x16 ;xA/xB=xC with xA as remainder | |
3259 | |
3260 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3261 bra PLED_const_ppO2_value1a | |
3262 | |
3263 PLED_const_ppO2_value11: | |
3264 | |
3265 ; Setpoint in possible limits | |
4 | 3266 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
3267 | |
3268 PLED_const_ppO2_value1a: | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3269 PLED_color_code warn_ppo2 ; Color-code output |
4 | 3270 movff char_I_const_ppO2,lo |
0 | 3271 clrf hi |
3272 bsf leftbind | |
3273 output_16dp d'3' | |
3274 bcf leftbind | |
3275 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3276 call PLED_standard_color |
0 | 3277 return |
3278 | |
3279 PLED_show_leading_tissue: | |
3280 call deco_main_calc_desaturation_time ; calculate desaturation time | |
3281 movlb b'00000001' ; select ram bank 1 | |
3282 | |
3283 DISPLAYTEXTH .282 ; L. Tissue: | |
3284 lfsr FSR2,letter | |
3285 movlw '#' | |
3286 movwf POSTINC2 | |
3287 movff char_O_gtissue_no,lo | |
3288 movff char_O_gtissue_no,wait_temp ; used as temp | |
3289 bsf leftbind | |
3290 output_8 | |
3291 movlw ' ' | |
3292 movwf POSTINC2 | |
3293 movlw '(' | |
3294 movwf POSTINC2 | |
3295 | |
3296 movlw d'16' | |
3297 cpfslt wait_temp | |
3298 bra PLED_show_leading_tissue_he | |
3299 movlw 'N' | |
3300 movwf POSTINC2 | |
3301 movlw '2' | |
3302 movwf POSTINC2 | |
3303 bra PLED_show_leading_tissue2 | |
3304 PLED_show_leading_tissue_he: | |
3305 movlw 'H' | |
3306 movwf POSTINC2 | |
3307 movlw 'e' | |
3308 movwf POSTINC2 | |
3309 PLED_show_leading_tissue2: | |
3310 movlw ')' | |
3311 movwf POSTINC2 | |
3312 movlw ' ' | |
3313 movwf POSTINC2 | |
3314 WIN_LEFT .100 | |
3315 WIN_TOP .25 | |
3316 WIN_FONT FT_SMALL | |
3 | 3317 call PLED_standard_color |
0 | 3318 call word_processor |
3319 | |
3320 lfsr FSR2,letter | |
3321 lfsr FSR1,char_O_tissue_saturation+0 | |
3322 incf wait_temp,F ; make 1-16 of 0-15 | |
3323 PLED_show_leading_tissue3: ; point to leading tissue... | |
3324 movff POSTINC1,lo ; copy/overwrite to lo register | |
3325 decfsz wait_temp,F ; count until zero | |
3326 bra PLED_show_leading_tissue3 ;loop | |
3327 output_8 | |
3328 movlw '%' | |
3329 movwf POSTINC2 | |
3330 movlw ' ' | |
3331 movwf POSTINC2 | |
3332 WIN_LEFT .100 | |
3333 WIN_TOP .50 | |
3334 WIN_FONT FT_SMALL | |
3 | 3335 call PLED_standard_color |
0 | 3336 call word_processor |
3337 bcf leftbind | |
3338 return | |
3339 | |
3340 PLED_topline_box_clear: ; Writes an empty box | |
3341 movlw .0 | |
3342 bra PLED_topline_box2 | |
3343 PLED_topline_box: ; Writes a filled box | |
3 | 3344 GETCUSTOM8 d'35' |
0 | 3345 PLED_topline_box2: |
3346 movff WREG,box_temp+0 ; Data | |
3347 movlw .000 | |
3348 movff WREG,box_temp+1 ; row top (0-239) | |
3349 movlw .026 | |
3350 movff WREG,box_temp+2 ; row bottom (0-239) | |
3351 movlw .000 | |
3352 movff WREG,box_temp+3 ; column left (0-159) | |
3353 movlw .159 | |
3354 movff WREG,box_temp+4 ; column right (0-159) | |
3355 call PLED_box | |
3356 return | |
3357 | |
3358 PLED_display_cns: | |
3359 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3360 return ; Yes, No update and return! | |
3361 | |
3362 btfsc gauge_mode ; Do not display in gauge mode | |
3363 return | |
3364 | |
3365 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
3366 return | |
3367 | |
3368 btfsc pled_velocity_display ; Is velocity displayed?` | |
3369 return ; Yes, do not overwrite until pled_velocity_clear was called | |
3370 | |
3371 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
3372 | |
3373 WIN_TOP .090 | |
3374 WIN_LEFT .0 | |
3375 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3376 PLED_color_code warn_cns ; Color-code CNS output |
0 | 3377 |
3378 lfsr FSR2,letter | |
3379 movlw 'C' | |
3380 movwf POSTINC2 | |
3381 movlw 'N' | |
3382 movwf POSTINC2 | |
3383 movlw 'S' | |
3384 movwf POSTINC2 | |
3385 movlw ':' | |
3386 movwf POSTINC2 | |
3387 movff char_O_CNS_fraction,lo | |
3388 bsf leftbind | |
3389 output_8 | |
3390 bcf leftbind | |
3391 movlw '%' | |
3392 movwf POSTINC2 | |
3393 call word_processor | |
3394 return | |
3395 | |
43 | 3396 PLED_display_cns_surface: |
3397 ; Check if CNS should be displayed | |
3398 movff char_O_CNS_fraction,lo ; copy into bank1 | |
3399 GETCUSTOM8 d'15' ; cns_display_high_surfacemode | |
3400 subwf lo,W | |
3401 btfss STATUS,C | |
3402 return ; Do not show... | |
3403 ; Show CNS | |
3404 | |
3405 ostc_debug 'W' ; Sends debug-information to screen if debugmode active | |
3406 | |
3407 WIN_TOP .175 | |
3408 WIN_LEFT .45 | |
3409 WIN_FONT FT_SMALL | |
3410 WIN_INVERT .0 ; Init new Wordprocessor | |
3411 PLED_color_code warn_cns ; Color-code CNS output | |
3412 | |
3413 lfsr FSR2,letter | |
3414 movlw 'C' | |
3415 movwf POSTINC2 | |
3416 movlw 'N' | |
3417 movwf POSTINC2 | |
3418 movlw 'S' | |
3419 movwf POSTINC2 | |
3420 movlw ':' | |
3421 movwf POSTINC2 | |
3422 movff char_O_CNS_fraction,lo | |
3423 bsf leftbind | |
3424 output_8 | |
3425 bcf leftbind | |
3426 movlw '%' | |
3427 movwf POSTINC2 | |
3428 call word_processor | |
3429 return | |
3430 | |
3431 | |
0 | 3432 PLED_custom_text: |
3433 read_int_eeprom d'64' | |
3434 movlw d'1' | |
3435 cpfseq EEDATA ; Custom text active? | |
3436 bra PLED_clear_custom_text ; No, Delete row | |
3437 WIN_TOP .200 | |
62 | 3438 WIN_LEFT .0 |
0 | 3439 WIN_FONT FT_SMALL |
3440 WIN_INVERT .0 ; Init new Wordprocessor | |
9 | 3441 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 3442 |
3443 lfsr FSR2,letter | |
3444 movlw d'64' | |
3445 movwf lo | |
3446 movlw d'24' | |
3447 movwf hi ; counter | |
3448 | |
3449 PLED_custom_text1: | |
3450 incf lo,F | |
3451 call PLED_get_custom_letter ; Get one letter for the custom text | |
3452 movlw '}' ; End marker found? | |
3453 cpfseq EEDATA | |
3454 bra PLED_custom_text2 ; No | |
3455 bra PLED_custom_text3 | |
3456 PLED_custom_text2: | |
3457 movff EEDATA,POSTINC2 ; Copy into Postinc | |
3458 | |
3459 decfsz hi,F ; Max. numbers? | |
3460 bra PLED_custom_text1 ; No, get next letters | |
3461 | |
3462 PLED_custom_text3: | |
3463 call word_processor | |
3 | 3464 call PLED_standard_color |
0 | 3465 return |
3466 | |
3467 PLED_get_custom_letter: | |
3468 movff lo,EEADR ; Address for next custom text letter | |
3469 call read_eeprom ; Read letter | |
3470 return | |
3471 | |
3472 PLED_clear_custom_text: | |
3473 movlw d'24' | |
3474 movwf temp1 | |
3475 WIN_TOP .200 | |
3476 WIN_LEFT .0 | |
3477 call PLED_display_clear_common_y1 | |
3478 return | |
3479 | |
33 | 3480 PLED_simdata_screen: ;Display Pre-Dive Screen |
3481 ; List active gases/Setpoints | |
3482 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
3483 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list | |
3484 | |
3485 PLED_simdata_screen2: | |
3486 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
3487 | |
3488 WIN_LEFT .0 | |
3489 WIN_FONT FT_SMALL | |
3490 bsf leftbind | |
3491 | |
3492 movlw d'2' | |
3493 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3494 movlw d'10' |
33 | 3495 movwf waitms_temp ; here: stores row for gas list |
3496 clrf hi ; here: Gas counter | |
3497 | |
3498 PLED_simdata_screen2_loop: | |
3499 incf hi,F ; Increase Gas | |
3500 movlw d'4' | |
3501 addwf wait_temp,F ; Increase eeprom address for gas list | |
3502 | |
3503 lfsr FSR2,letter | |
3504 movlw 'G' | |
3505 movwf POSTINC2 | |
3506 movff hi,lo ; copy gas number | |
3507 output_8 ; display gas number | |
3508 movlw ':' | |
3509 movwf POSTINC2 | |
3510 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
3511 call read_eeprom ; get byte (stored in EEDATA) | |
3512 movff EEDATA,lo ; copy to lo | |
3513 output_8 ; outputs into Postinc2! | |
3514 movlw '/' | |
3515 movwf POSTINC2 | |
3516 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
3517 call read_eeprom ; get byte (stored in EEDATA) | |
3518 movff EEDATA,lo ; copy to lo | |
3519 output_8 ; outputs into Postinc2! | |
34 | 3520 movlw ' ' |
3521 movwf POSTINC2 | |
3522 movf hi,W ; Gas number | |
3523 addlw d'27' ; -> Adress of change depth register | |
3524 call read_int_eeprom_1 | |
3525 movff EEDATA,lo ; Change depth in m | |
3526 output_99 ; outputs into Postinc2! | |
3527 movlw 'm' | |
3528 movwf POSTINC2 | |
33 | 3529 read_int_eeprom d'27' ; read flag register |
3530 movff hi,lo ; copy gas number | |
3531 PLED_simdata_screen2_loop1: | |
3532 rrcf EEDATA ; roll flags into carry | |
3533 decfsz lo,F ; max. 5 times... | |
3534 bra PLED_simdata_screen2_loop1 | |
3535 | |
3536 btfsc STATUS,C ; test carry | |
3537 bra PLED_simdata_white | |
3538 | |
3539 movlw color_grey | |
3540 call PLED_set_color ; grey out inactive gases! | |
3541 bra PLED_simdata_color_done | |
3542 | |
3543 PLED_simdata_white: | |
3544 call PLED_standard_color | |
3545 | |
3546 PLED_simdata_color_done: | |
3547 movlw d'25' | |
3548 addwf waitms_temp,F ; Increase row | |
3549 WIN_LEFT .0 | |
3550 movff waitms_temp,win_top ; Set Row | |
34 | 3551 call word_processor ; display gas |
33 | 3552 |
3553 PLED_simdata_screen2b: | |
3554 call PLED_standard_color | |
3555 | |
34 | 3556 movlw d'5' ; list all five gases |
33 | 3557 cpfseq hi ; All gases shown? |
3558 bra PLED_simdata_screen2_loop ; No | |
3559 | |
3560 return ; No, return (OC mode) | |
3561 | |
3562 PLED_simdata_screen3: | |
3563 WIN_LEFT .0 | |
3564 WIN_FONT FT_SMALL | |
3565 bsf leftbind | |
3566 | |
3567 ; list three SP in Gaslist | |
3568 movlw d'35' ; 36 = current SP position in EEPROM | |
3569 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3570 movlw d'10' |
33 | 3571 movwf waitms_temp ; here: stores row for gas list |
64 | 3572 clrf temp6 ; here: SP counter |
33 | 3573 |
3574 PLED_simdata_screen3_loop: | |
3575 incf wait_temp,F ; EEPROM address | |
64 | 3576 incf temp6,F ; Increase SP |
33 | 3577 |
3578 movlw d'25' | |
3579 addwf waitms_temp,F ; Increase row | |
3580 WIN_LEFT .0 | |
3581 movff waitms_temp,win_top ; Set Row | |
3582 | |
3583 lfsr FSR2,letter | |
3584 movlw 'S' | |
3585 movwf POSTINC2 | |
3586 movlw 'P' | |
3587 movwf POSTINC2 | |
64 | 3588 movff temp6,lo ; copy gas number |
33 | 3589 output_8 ; display gas number |
3590 movlw ':' | |
3591 movwf POSTINC2 | |
3592 movlw ' ' | |
3593 movwf POSTINC2 | |
3594 movff wait_temp, EEADR; SP #hi position | |
3595 call read_eeprom ; get byte (stored in EEDATA) | |
3596 movff EEDATA,lo ; copy to lo | |
3597 clrf hi | |
3598 output_16dp d'3' ; outputs into Postinc2! | |
3599 call word_processor | |
3600 | |
3601 movlw d'3' ; list all three SP | |
64 | 3602 cpfseq temp6 ; All gases shown? |
33 | 3603 bra PLED_simdata_screen3_loop ;no |
3604 | |
3605 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
3606 movff EEDATA,active_gas ; Read start gas (1-5) | |
3607 decf active_gas,W ; Gas 0-4 | |
3608 mullw d'4' | |
3609 movf PRODL,W | |
3610 addlw d'7' ; = address for He ratio | |
3611 movwf EEADR | |
3612 call read_eeprom ; Read He ratio | |
3613 movff EEDATA,hi ; And copy into hold register | |
3614 decf active_gas,W ; Gas 0-4 | |
3615 mullw d'4' | |
3616 movf PRODL,W | |
3617 addlw d'6' ; = address for O2 ratio | |
3618 movwf EEADR | |
3619 call read_eeprom ; Read O2 ratio | |
3620 movff EEDATA, lo ; O2 ratio | |
3621 | |
3622 WIN_LEFT .0 | |
34 | 3623 WIN_TOP .110 |
33 | 3624 lfsr FSR2,letter |
3625 movlw 'D' | |
3626 movwf POSTINC2 | |
3627 movlw 'i' | |
3628 movwf POSTINC2 | |
3629 movlw 'l' | |
3630 movwf POSTINC2 | |
3631 movlw ':' | |
3632 movwf POSTINC2 | |
3633 output_8 ; O2 Ratio | |
3634 movlw '/' | |
3635 movwf POSTINC2 | |
3636 movff hi,lo | |
3637 output_8 ; He Ratio | |
3638 call word_processor | |
3639 | |
3640 bcf leftbind | |
3641 return ; Return (CC Mode) | |
3642 | |
0 | 3643 |
3644 | |
3645 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | |
3646 | |
3647 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
3648 return | |
3649 | |
3650 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
3651 movff EEDATA, wait_temp ; salinity | |
3652 | |
3653 movlw d'105' ; 105% ? | |
3654 cpfslt wait_temp ; Salinity higher limit | |
3655 return ; Out of limit, do not adjust lo:hi | |
3656 | |
3657 movlw d'99' ; 99% ? | |
3658 cpfsgt wait_temp ; Salinity lower limit | |
3659 return ; Out of limit, do not adjust lo:hi | |
3660 | |
3661 movff lo,xA+0 | |
3662 movff hi,xA+1 | |
3663 | |
3664 movlw d'100' | |
3665 movwf xB+0 | |
3666 clrf xB+1 | |
3667 | |
3668 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
3669 | |
3670 movff wait_temp,xB+0 ; Salinity | |
3671 clrf xB+1 | |
3672 | |
3673 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3674 | |
3675 movff xC+0,lo | |
3676 movff xC+1,hi ; restore lo and hi with updated value | |
3677 | |
3678 return |