Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 119:f24137eb85de
Background debugger now shows STKPTR
author | heinrichsweikamp |
---|---|
date | Sun, 26 Dec 2010 18:34:28 +0100 |
parents | 50a06adabc67 |
children | 4f9f477bb452 |
comparison
equal
deleted
inserted
replaced
118:a5eacfafd37f | 119:f24137eb85de |
---|---|
158 bra divemode_menu3 ; Customview-function | 158 bra divemode_menu3 ; Customview-function |
159 dcfsnz menupos,F | 159 dcfsnz menupos,F |
160 bra divemode_toggle_brightness ; Toggle OLED-Brightness | 160 bra divemode_toggle_brightness ; Toggle OLED-Brightness |
161 dcfsnz menupos,F | 161 dcfsnz menupos,F |
162 bra timeout_divemenu2 ; Quit divemode menu | 162 bra timeout_divemenu2 ; Quit divemode menu |
163 return | 163 bra timeout_divemenu2 ; Quit divemode menu |
164 | 164 |
165 divemode_menu3: | 165 divemode_menu3: |
166 movff menupos3,temp1 ; copy | 166 movff menupos3,temp1 ; copy |
167 dcfsnz temp1,F | 167 dcfsnz temp1,F |
168 bra toggle_stopwatch ; Toggle Stopwatch/Average register | 168 bra toggle_stopwatch ; Toggle Stopwatch/Average register |
173 dcfsnz temp1,F | 173 dcfsnz temp1,F |
174 bra divemode_menu3_nothing ; leading tissue... | 174 bra divemode_menu3_nothing ; leading tissue... |
175 | 175 |
176 divemode_menu3_nothing: | 176 divemode_menu3_nothing: |
177 bra timeout_divemenu2 ; Quit divemode menu | 177 bra timeout_divemenu2 ; Quit divemode menu |
178 return | |
179 | 178 |
180 set_marker: | 179 set_marker: |
181 movlw d'6' ; Type of Alarm (Manual Marker) | 180 movlw d'6' ; Type of Alarm (Manual Marker) |
182 movwf AlarmType ; Copy to Alarm Register | 181 movwf AlarmType ; Copy to Alarm Register |
183 bsf event_occured ; Set Event Flag | 182 bsf event_occured ; Set Event Flag |
244 call PLED_divemenu_cursor ; update cursor | 243 call PLED_divemenu_cursor ; update cursor |
245 return | 244 return |
246 | 245 |
247 divemode_menu_simulator2: | 246 divemode_menu_simulator2: |
248 dcfsnz menupos,F | 247 dcfsnz menupos,F |
249 bra timeout_divemenu2 ; quit underwater menu! | 248 bra timeout_divemenu2 ; close underwater menu! |
250 dcfsnz menupos,F | 249 dcfsnz menupos,F |
251 bra divemode_menu_simulator_p1 ; Adjust +1m | 250 bra divemode_menu_simulator_p1 ; Adjust +1m |
252 dcfsnz menupos,F | 251 dcfsnz menupos,F |
253 bra divemode_menu_simulator_m1 ; Adjust -1m | 252 bra divemode_menu_simulator_m1 ; Adjust -1m |
254 dcfsnz menupos,F | 253 dcfsnz menupos,F |
258 bra timeout_divemenu2 ; quit underwater menu! | 257 bra timeout_divemenu2 ; quit underwater menu! |
259 | 258 |
260 divemode_menu_simulator_common: | 259 divemode_menu_simulator_common: |
261 call PLED_divemode_simulator_mask ; Redraw Simualtor mask | 260 call PLED_divemode_simulator_mask ; Redraw Simualtor mask |
262 | 261 |
263 ; Check limits (140m and 0m) | 262 ; Check limits (130m and 0m) |
264 movlw LOW d'15000' | 263 movlw LOW d'14000' |
265 movwf sub_a+0 | 264 movwf sub_a+0 |
266 movlw HIGH d'15000' | 265 movlw HIGH d'14000' |
267 movwf sub_a+1 | 266 movwf sub_a+1 |
268 movff sim_pressure+0,sub_b+0 | 267 movff sim_pressure+0,sub_b+0 |
269 movff sim_pressure+1,sub_b+1 | 268 movff sim_pressure+1,sub_b+1 |
270 call sub16 ; sub_c = sub_a - sub_b | 269 call sub16 ; sub_c = sub_a - sub_b |
271 btfss neg_flag | 270 btfss neg_flag |
272 bra divemode_menu_simulator_common2 | 271 bra divemode_menu_simulator_common2 |
273 ; Too deep, limit to 140m | 272 ; Too deep, limit to 130m |
274 movlw LOW d'15000' | 273 movlw LOW d'14000' |
275 movwf sim_pressure+0 | 274 movwf sim_pressure+0 |
276 movlw HIGH d'15000' | 275 movlw HIGH d'14000' |
277 movwf sim_pressure+1 | 276 movwf sim_pressure+1 |
278 return | 277 return |
279 | 278 |
280 divemode_menu_simulator_common2: | 279 divemode_menu_simulator_common2: |
281 movlw LOW d'1000' | 280 movlw LOW d'1000' |
614 ; btfss multi_gf_display ; Was the Multi-GF Table displayed? | 613 ; btfss multi_gf_display ; Was the Multi-GF Table displayed? |
615 ; bra timeout_divemenu2a ; No, normal OLED rebuild | 614 ; bra timeout_divemenu2a ; No, normal OLED rebuild |
616 | 615 |
617 ; Restore some outputs | 616 ; Restore some outputs |
618 clrf temp8 ; Page 0-1 of deco list | 617 clrf temp8 ; Page 0-1 of deco list |
618 call PLED_clear_divemode_menu; Clear dive mode menu | |
619 | 619 |
620 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode | 620 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode |
621 bra timeout_divemenu2a ; skip! | 621 bra timeout_divemenu2a ; skip! |
622 btfsc gauge_mode ; Ignore in Gauge mode | 622 btfsc gauge_mode ; Ignore in Gauge mode |
623 bra timeout_divemenu2a ; skip! | 623 bra timeout_divemenu2a ; skip! |
630 timeout_divemenu2a: | 630 timeout_divemenu2a: |
631 bcf multi_gf_display ; Do not display the multi-gf table screen | 631 bcf multi_gf_display ; Do not display the multi-gf table screen |
632 bcf menubit | 632 bcf menubit |
633 bcf premenu ; Yes, clear flags and menu, display dive time and mask again | 633 bcf premenu ; Yes, clear flags and menu, display dive time and mask again |
634 call PLED_active_gas_divemode; Display gas, if required | 634 call PLED_active_gas_divemode; Display gas, if required |
635 call PLED_clear_divemode_menu; Clear dive mode menu | |
636 call PLED_divemode_mask ; Display mask | 635 call PLED_divemode_mask ; Display mask |
637 call PLED_divemins ; Display (new) divetime! | 636 call PLED_divemins ; Display (new) divetime! |
638 call customview_mask ; Redraw current customview mask | 637 call customview_mask ; Redraw current customview mask |
639 clrf timeout_counter3 ; Also clear timeout | 638 clrf timeout_counter3 ; Also clear timeout |
640 bcf display_see_deco ; clear all display flags | 639 bcf display_see_deco ; clear all display flags |