Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/customview.asm @ 312:b7e4e74c0e17 @5 variant
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
* Added extra deco_status, and sim_extra_time() in p2_deco.c
* Launched by setting char_O_deco_state to 6, result in int_O_extra_ascenttime
* Added 8th divemode customview
* Auto stole every other cycles
* CF58 menu updated (EN,FR,DE,SP)
author | JeanDo |
---|---|
date | Tue, 03 May 2011 00:52:42 +0200 |
parents | 1a15d75702f7 |
children | b7940978edc9 |
comparison
equal
deleted
inserted
replaced
311:91371c7553f5 | 312:b7e4e74c0e17 |
---|---|
73 bra customview_1sec_average ; Update the Average depth | 73 bra customview_1sec_average ; Update the Average depth |
74 dcfsnz WREG,F | 74 dcfsnz WREG,F |
75 bra customview_1sec_graphs ; Update the leading tissue | 75 bra customview_1sec_graphs ; Update the leading tissue |
76 dcfsnz WREG,F | 76 dcfsnz WREG,F |
77 bra customview_1sec_ead_end ; Show END and EAD in divemode | 77 bra customview_1sec_ead_end ; Show END and EAD in divemode |
78 dcfsnz WREG,F | |
79 bra customview_1sec_@5 ; Show TTS for extra time. | |
78 | 80 |
79 ; Menupos3=0, do nothing | 81 ; Menupos3=0, do nothing |
80 return | 82 return |
81 | 83 |
82 customview_1sec_average: | 84 customview_1sec_average: |
83 call PLED_total_average_show2 ; Update the figures only | 85 goto PLED_total_average_show2 ; Update the figures only |
84 return | |
85 | 86 |
86 customview_1sec_stopwatch: | 87 customview_1sec_stopwatch: |
87 bsf menu3_active ; Set Flag | 88 bsf menu3_active ; Set Flag |
88 call PLED_stopwatch_show2 ; Update figures only | 89 goto PLED_stopwatch_show2 ; Update figures only |
89 return | |
90 | 90 |
91 customview_1sec_marker: ; Do nothing extra | 91 customview_1sec_marker: ; Do nothing extra |
92 bsf menu3_active ; Set Flag | 92 bsf menu3_active ; Set Flag |
93 customview_1sec_clock: ; Do nothing extra | 93 customview_1sec_clock: ; Do nothing extra |
94 customview_1sec_lead_tiss: ; Do nothing extra | 94 customview_1sec_lead_tiss: ; Do nothing extra |
100 movlw .10 ; Yes: reset counter. | 100 movlw .10 ; Yes: reset counter. |
101 movwf apnoe_mins | 101 movwf apnoe_mins |
102 | 102 |
103 call deco_calc_desaturation_time ; calculate desaturation time | 103 call deco_calc_desaturation_time ; calculate desaturation time |
104 movlb b'00000001' ; select ram bank 1 | 104 movlb b'00000001' ; select ram bank 1 |
105 call PLED_tissue_saturation_graph | 105 goto PLED_tissue_saturation_graph |
106 return | |
107 | 106 |
108 customview_1sec_ead_end: | 107 customview_1sec_ead_end: |
109 call PLED_show_end_ead_divemode | 108 goto PLED_show_end_ead_divemode |
110 return | 109 |
110 customview_1sec_@5: | |
111 goto PLED_show_@5 | |
111 | 112 |
112 ;============================================================================= | 113 ;============================================================================= |
113 ; Do every-minute tasks for the custom view area | 114 ; Do every-minute tasks for the custom view area |
114 | 115 |
115 customview_minute: | 116 customview_minute: |
125 dcfsnz WREG,F | 126 dcfsnz WREG,F |
126 bra customview_minute_average ; Update the Average depth | 127 bra customview_minute_average ; Update the Average depth |
127 dcfsnz WREG,F | 128 dcfsnz WREG,F |
128 bra customview_minute_graphs ; Update the graphs | 129 bra customview_minute_graphs ; Update the graphs |
129 dcfsnz WREG,F | 130 dcfsnz WREG,F |
130 bra customview_minute_ead_end ; Show END and EAD in divemode | 131 bra customview_minute_ead_end ; Show END and EAD in divemode |
132 dcfsnz WREG,F | |
133 bra customview_minute_@5 ; Show TTS for extra time. | |
131 | 134 |
132 ; Menupos3=0, do nothing | 135 ; Menupos3=0, do nothing |
133 return | 136 return |
134 | 137 |
135 customview_minute_clock: | 138 customview_minute_clock: |
136 call PLED_diveclock2 ; Update the clock | 139 goto PLED_diveclock2 ; Update the clock |
137 return | |
138 | 140 |
139 customview_minute_lead_tiss: | 141 customview_minute_lead_tiss: |
140 call PLED_show_leading_tissue_2 ; Update the leading tissue | 142 goto PLED_show_leading_tissue_2 ; Update the leading tissue |
141 return | 143 |
142 | 144 customview_minute_@5: ; Do nothing extra |
143 customview_minute_ead_end: ; Do nothing extra | 145 customview_minute_ead_end: ; Do nothing extra |
144 customview_minute_marker: ; Do nothing extra | 146 customview_minute_marker: ; Do nothing extra |
145 customview_minute_stopwatch: ; Do nothing extra | 147 customview_minute_stopwatch: ; Do nothing extra |
146 customview_minute_average: ; Do nothing extra | 148 customview_minute_average: ; Do nothing extra |
147 customview_minute_graphs: ; Do nothing extra | 149 customview_minute_graphs: ; Do nothing extra |
148 return | 150 return |
149 | 151 |
150 ;============================================================================= | 152 ;============================================================================= |
151 ; Yes, show next customview (and delete this flag) | 153 ; Show next customview (and delete this flag) |
152 | 154 |
153 customview_toggle: | 155 customview_toggle: |
154 bcf menu3_active ;=1: menu entry three in divemode menu is active | 156 bcf menu3_active ;=1: menu entry three in divemode menu is active |
155 ostc_debug 'X' ; Sends debug-information to screen if debugmode active | 157 ostc_debug 'X' ; Sends debug-information to screen if debugmode active |
156 | 158 |
157 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 159 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
158 bra customview_toggle_exit ; Yes, ignore custom view in divemode completely | 160 bra customview_toggle_exit ; Yes, ignore custom view in divemode completely |
159 | 161 |
160 incf menupos3,F ; Number of customview to show | 162 incf menupos3,F ; Number of customview to show |
161 movlw d'7' ; Max number | 163 movlw d'8' ; Max number |
162 cpfsgt menupos3 ; Max reached? | 164 cpfsgt menupos3 ; Max reached? |
163 bra customview_mask ; No, show | 165 bra customview_mask ; No, show |
164 clrf menupos3 ; Reset to zero (Zero=no custom view) | 166 clrf menupos3 ; Reset to zero (Zero=no custom view) |
167 | |
165 customview_mask: | 168 customview_mask: |
166 call PLED_clear_customview_divemode | 169 call PLED_clear_customview_divemode |
167 movff menupos3,WREG ; Menupos3 holds number of customview function | 170 movff menupos3,WREG ; Menupos3 holds number of customview function |
168 dcfsnz WREG,F | 171 dcfsnz WREG,F |
169 bra customview_init_stopwatch ; Show the Stopwatch | 172 bra customview_init_stopwatch ; Show the Stopwatch |
177 bra customview_init_average ; Show Total average depth | 180 bra customview_init_average ; Show Total average depth |
178 dcfsnz WREG,F | 181 dcfsnz WREG,F |
179 bra customview_init_graphs ; Show the graphs | 182 bra customview_init_graphs ; Show the graphs |
180 dcfsnz WREG,F | 183 dcfsnz WREG,F |
181 bra customview_init_ead_end ; Show END and EAD in divemode | 184 bra customview_init_ead_end ; Show END and EAD in divemode |
185 dcfsnz WREG,F | |
186 bra customview_init_@5 ; Show TTS for extra time. | |
187 bcf tts_extra_time ; Else, CLEAR computation of @5 request. | |
182 | 188 |
183 customview_init_nocustomview: | 189 customview_init_nocustomview: |
184 bra customview_toggle_exit | 190 bra customview_toggle_exit |
185 | 191 |
186 customview_init_average: | 192 customview_init_average: |
220 | 226 |
221 call PLED_show_leading_tissue | 227 call PLED_show_leading_tissue |
222 bra customview_toggle_exit | 228 bra customview_toggle_exit |
223 | 229 |
224 customview_init_ead_end: | 230 customview_init_ead_end: |
231 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | |
232 bra customview_toggle ; Yes, use next Customview! | |
233 | |
225 call PLED_show_end_ead_divemode | 234 call PLED_show_end_ead_divemode |
235 bra customview_toggle_exit | |
236 | |
237 customview_init_@5: | |
238 GETCUSTOM8 d'58' ; Extra time to simulate | |
239 iorwf WREG,F ; Null ? | |
240 bz customview_toggle ; Yes: use next Customview ! | |
241 | |
242 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | |
243 bra customview_toggle ; Yes, use next Customview! | |
244 | |
245 clrf WREG ; Reset extra TTS | |
246 movff WREG,int_O_extra_ascenttime+0 | |
247 movff WREG,int_O_extra_ascenttime+1 | |
248 | |
249 movlw 1 | |
250 movwf apnoe_mins ; Start compute after next cycle. | |
251 bsf tts_extra_time | |
252 call PLED_show_@5 ; Show (wait) | |
253 | |
226 bra customview_toggle_exit | 254 bra customview_toggle_exit |
227 | 255 |
228 customview_init_graphs: ; Show tissue graph | 256 customview_init_graphs: ; Show tissue graph |
229 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) | 257 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) |
230 decfsz WREG,F ; WREG=1? | 258 decfsz WREG,F ; WREG=1? |