annotate src/divemenu_tree.asm @ 634:4050675965ea

3.10 stable release
author heinrichsweikamp
date Tue, 28 Apr 2020 17:34:31 +0200
parents 185ba2f91f59
children 8c1f1f334275
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
3 ; File divemenu_tree.asm * combined next generation V3.09.5
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 249
diff changeset
5 ; OSTC dive mode menu
0
heinrichsweikamp
parents:
diff changeset
6 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all rights reserved.
0
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2013-02-02 : [mH] Made out of menu_tree.asm
heinrichsweikamp
parents:
diff changeset
11
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
12
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
13 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
14 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
15 ; ATTENTION
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
16 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
17 ; All Calls made via the Menu Macros need to go to Addresses within 0x0xxxx !
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
18 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
19 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
20
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
21
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
22 #include "hwos.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
23 #include "shared_definitions.h"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
24 #include "menu_processor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
25 #include "tft_outputs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
26 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
27 #include "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
28 #include "calibrate.inc"
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
29 #include "gaslist.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
30 #include "colorschemes.inc"
0
heinrichsweikamp
parents:
diff changeset
31
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
32
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
33 extern diveloop_menu_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
34
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
35 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
36 extern cavemode_turndive_check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
37 extern cavemode_waypoint_set_check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
38 extern cavemode_waypoint_out_check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
39 extern cavemode_waypoint_in_check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
40 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
41
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
42
0
heinrichsweikamp
parents:
diff changeset
43 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
44 dive_menu CODE 0x02000 ; needs to be at 0x0xxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
45 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
46
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
47
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
48 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
49 ; Return to Main Dive Mode Menu
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
50 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
51 do_return_main_divemenu:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
52 call menu_processor_double_pop ; drop exit line and back to last line
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
53 incf selected_item,W ; item numbers start with 0, menu positions with 1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
54 movwf menu_pos_cur ; position cursor where we came from
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
55 bra do_main_divemenu_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
56
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
57
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
58 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
59 ; Entry Point for Main Dive Mode Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
60 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
61 global do_main_divemenu
0
heinrichsweikamp
parents:
diff changeset
62 do_main_divemenu:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
63 movff active_customview,backup_customview ; back up current custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
64 call menu_processor_reset ; restart from first icon
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
65 movlw .1 ; set cursor to first menu item
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
66 movwf menu_pos_cur ; ...
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
67 ;bra do_main_divemenu_common ; continue with common part
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
68
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
69
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
70 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
71 ; Common Part for Main Dive Mode Menu, 1st Layer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
72 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
73 do_main_divemenu_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
74 IFDEF _ccr_pscr
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
75 btfsc FLAG_ccr_mode ; in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
76 bra main_divemenu_loop ; YES - goto CCR / pSCR Menu menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
77 btfsc FLAG_pscr_mode ; in pSCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
78 bra main_divemenu_loop ; YES - goto CCR / pSCR Menu menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
79 ENDIF ; _ccr_pscr
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
80
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
81 main_divemenu_OC:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
82 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
83 bcf is_diluent_menu ; selecting OC gases ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
84 bcf is_bailout_menu ; ... not for bailout reason
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
85 ENDIF ; _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
86
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
87 IFDEF _cave_mode
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
88 TSTOSS opt_cave_mode ; cave mode switched on?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
89 bra main_divemenu_OC_nocave ; NO - use version without cave mode entry
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
90 ;bra main_divemenu_OC_cave ; YES - use version with cave mode entry
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
91
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
92 main_divemenu_OC_cave:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
93 MENU_BEGIN_DIVE .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
94 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
95 MENU_CALL tDivemenu_ResetAvg, do_reset_average
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
96 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
97 MENU_CALL tDivemenu_Marker, do_set_marker
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
98 MENU_CALL tCaveMode, do_main_cavemenu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
99 MENU_CALL tExit, do_exit_divemode_menu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
100 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
101 ENDIF ; _cave_mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
102
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
103 main_divemenu_OC_nocave:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
104 MENU_BEGIN_DIVE .5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
105 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
106 MENU_CALL tDivemenu_ResetAvg, do_reset_average
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
107 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
108 MENU_CALL tDivemenu_Marker, do_set_marker
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
109 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
110 MENU_END
0
heinrichsweikamp
parents:
diff changeset
111
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
112 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
113
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
114 main_divemenu_loop:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
115 bsf is_diluent_menu ; selecting diluents ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
116 bcf is_bailout_menu ; ... (definitely) not for bailout reason
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
117 btfsc FLAG_pscr_mode ; in pSCR mode?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
118 bra main_divemenu_pscr ; YES - show pSCR menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
119
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
120 MENU_BEGIN_DIVE .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
121 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
122 MENU_CALL tDivemenu_Setpoint, do_divemode_splist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
123 MENU_CALL tDivemenu_Diluent, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
124 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
125 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
126 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
127 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
128
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
129
485
18e047102e49 3.14 BETA release
heinrichsweikamp
parents: 437
diff changeset
130 main_divemenu_pscr:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
131 IFDEF _external_sensor
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
132 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
133 bra main_divemenu_pscr_sensors ; YES - do menu with calibration
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
134 btfsc ext_input_optical ; do we have an optical input (OSTC 3)?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
135 bra main_divemenu_pscr_sensors ; YES - do menu with calibration
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
136 ENDIF ; _external_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
137
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
138 main_divemenu_pscr_no_sensors:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
139 MENU_BEGIN_DIVE .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
140 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
141 MENU_CALL tDivemenu_Premix, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
142 MENU_CALL tBackToLoop, do_switch_sp_calc
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
143 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
144 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
145 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
146 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
147
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
148 IFDEF _external_sensor
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
149 main_divemenu_pscr_sensors:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
150 MENU_BEGIN_DIVE .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
151 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
152 MENU_CALL tCCRSensor, do_divemode_setpoint_pscr
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
153 MENU_CALL tDivemenu_Premix, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
154 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
155 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
156 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
157 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
158 ENDIF ; _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
159
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
160
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
161 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
162 ; Call Function - start Bailout Condition
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
163 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
164 do_divemode_gaslist_bail:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
165 bcf is_diluent_menu ; select OC gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
166 bsf is_bailout_menu ; flag it is a bailout action
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
167 bra do_divemode_gaslist ; continue with the gas menu for B/O gas selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
168
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
169
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
170 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
171 ; Call Function - switch to calculated Setpoint (pSCR)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
172 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
173 do_switch_sp_calc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
174 bcf warn_det_sensors_lost ; clear fallback condition (revoke all sensors lost warning)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
175 clrf WREG ; switch to fixed SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
176 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
177 movff WREG,char_I_const_ppO2 ; set setpoint to 0, this forces deco engine to take the computed ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
178 bra do_switch_sp_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
179
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
180 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
181
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
182
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
183 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
184 ; dynamic Title - toggle GF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
185 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
186 dyn_toggle_gf:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
187 movff char_I_model,WREG ; 0 = ZH-L16, 1 = ZH-L16-GF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
188 decfsz WREG,W ; toggle GF only in GF modes - in GF mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
189 bra dyn_toggle_gf_1 ; NO - print in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
190 TSTOSS opt_enable_aGF ; YES - aGF enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
191 dyn_toggle_gf_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
192 FONT_COLOR_DISABLED ; NO - print in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
193 STRCAT_TEXT tDivemenu_ToggleGF ; output label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
194 return ; done
0
heinrichsweikamp
parents:
diff changeset
195
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
196
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
197 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
198 ; Sub-Menu: Toggle GFs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
199 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
200 do_return_toggle_gf:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
201 call menu_processor_pop ; drop selection from menu stack
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
202 bra do_toggle_gf_1 ; re-draw the custom view and enter the menu again
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
203
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
204 do_toggle_gf:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
205 TSTOSS char_I_model ; toggle GF only in GF modes - in GF mode? (0 = ZH-L16, 1 = ZH-L16-GF)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
206 bra do_abort_toggle_gf ; NO - do nothing and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
207 TSTOSS opt_enable_aGF ; aGF enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
208 bra do_abort_toggle_gf ; NO - do nothing and return
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
209 bsf custom_view_locked ; lock custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
210 do_toggle_gf_1:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
211 movlw index_gf_factors ; get number of GF factors custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
212 movwf active_customview ; set custom view number
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
213 call dive_customview_callup ; draw custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
214 movlw .1 ; set to first option in dive mode menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
215 movwf menu_pos_cur ; ...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
216
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
217 MENU_BEGIN_DIVE .2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
218 MENU_CALL tDivemenu_ToggleGF, do_toggle_gf_toggle
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
219 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
220 MENU_END
0
heinrichsweikamp
parents:
diff changeset
221
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
222
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
223 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
224 ; Helper Function - abort toggle GF Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
225 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
226 do_abort_toggle_gf:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
227 call menu_processor_pop ; drop selection from menu stack
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
228 bra do_main_divemenu_common ; back to main menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
229
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
230
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
231 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
232 ; Call Function - toggle GF <-> aGF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
233 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
234 do_toggle_gf_toggle:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
235 bsf request_toggle_GF ; request restart of the deco engine
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
236 btg use_aGF ; toggle normal / alternative GF factor selection
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
237 btfsc use_aGF ; alternative GF factors activated?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
238 bra do_togglegf_agf ; YES - branch to using alternative GF
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
239 ;bra do_togglegf_ngf ; NO - branch to using normal GF
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
240 do_togglegf_ngf:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
241 movff opt_GF_low, char_I_GF_Low_percentage ; use normal GF factor low
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
242 movff opt_GF_high,char_I_GF_High_percentage ; use normal GF factor high
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
243 bra do_return_toggle_gf ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
244 do_togglegf_agf:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
245 movff opt_aGF_low, char_I_GF_Low_percentage ; use alternative GF factor low
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
246 movff opt_aGF_high,char_I_GF_High_percentage ; use alternative GF factor high
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
247 bra do_return_toggle_gf ; back to menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
248
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
249
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
250 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
251 ; Sub-Menu: Reset average Depth & set Marker
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
252 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
253 do_reset_avg_set_mkr:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
254 movlw .1 ; set to first option in dive mode menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
255 movwf menu_pos_cur ; ...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
256
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
257 MENU_BEGIN_DIVE .3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
258 MENU_CALL tDivemenu_ResetAvg, do_reset_average
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
259 MENU_CALL tDivemenu_Marker, do_set_marker
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
260 MENU_CALL tBack, do_return_main_divemenu ; return to main menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
261 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
262
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
263
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
264 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
265 ; Call Function - reset average Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
266 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
267 do_reset_average:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
268 bsf request_reset_avg ; request reset of resettable average depth and dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
269 IFDEF _min_depth_option
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
270 bsf reset_trip_pressure ; request ISR to reset the min and max trip-wise pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
271 ENDIF
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
272 bra do_exit_divemode_menu ; continue exiting the menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
273
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
274
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
275 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
276 ; Call Function - set a Marker in the Dive Profile Recording
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
277 ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
278 do_set_marker:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
279 bsf request_set_marker ; set request flag
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
280 bra do_exit_divemode_menu ; continue exiting the menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
281
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
282
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
283 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
284 ; Sub-Menu: Switch OC / Diluent Selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
285 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
286 do_divemode_gaslist:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
287 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
288 btfsc bailout_mode ; in bailout mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
289 bcf is_diluent_menu ; YES - for safety reasons, redirect to selecting OC (bailout) gases
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
290 ENDIF ; _ccr_pscr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
291 bsf short_gas_descriptions ; do not show "Gas x" etc.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
292 bsf better_gas_hint ; mark the gas which is the best gas/diluent
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
293 bsf color_code_gases ; color-code the gases/diluents by their ppO2 and current depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
294 movf best_gas_number,W ; load number of best gas (1-5)into WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
295 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
296 btfsc is_diluent_menu ; in diluent selection?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
297 movf best_dil_number,W ; YES - overwrite with best diluent (1-5)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
298 ENDIF; _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
299 bnz do_divemode_gaslist_1 ; best gas/dil number = 0 (none available) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
300 movlw .1 ; YES - default to first gas/dil
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
301 btfsc WREG,7 ; best gas/dil number >= 128 (not computed yet) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
302 movlw .1 ; YES - default to first gas/dil
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
303 do_divemode_gaslist_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
304 movwf menu_pos_cur ; position cursor to best gas/dil (or first option if none avail)
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
305
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
306 MENU_BEGIN_DIVE .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
307 MENU_DYNAMIC dyn_strcat_gas_prodl, do_switch_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
308 MENU_DYNAMIC dyn_strcat_gas_prodl, do_switch_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
309 MENU_DYNAMIC dyn_strcat_gas_prodl, do_switch_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
310 MENU_DYNAMIC dyn_strcat_gas_prodl, do_switch_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
311 MENU_DYNAMIC dyn_strcat_gas_prodl, do_switch_gas
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
312 MENU_CALL tDivemenu_LostGas, do_lost_gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
313 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
314
0
heinrichsweikamp
parents:
diff changeset
315
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
316 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
317 ; dynamic Title - print full Gas Description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
318 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
319 dyn_strcat_gas_prodl:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
320 goto gaslist_strcat_gas_PRODL ; code is hosted in gaslist.asm
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
321
403
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
322
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
323 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
324 ; Call Function - initiate Gas Change (will also trigger restart of deco_engine)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
325 ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
326 do_switch_gas:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
327 bsf request_gas_change ; request dive mode to do a gas change
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
328 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
329 btfss is_bailout_menu ; doing a bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
330 bra do_switch_gas_1 ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
331 bsf bailout_mode ; YES - begin bailout mode
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
332 ENDIF ; _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
333 IFDEF _cave_mode
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
334 btfsc cave_mode ; - cave mode switched on?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
335 bsf request_turn_turn ; YES - request to turn the dive
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
336 ENDIF ; _cave_mode
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
337 IFDEF _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
338 do_switch_gas_1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
339 bcf warn_det_sensors_lost ; terminate fallback mode and get rid of its warning if applicable
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
340 call dive_customview_callup ; redraw custom view mask to rewrite "ppO2(Dil)" to "ppO2" or SAC label if applicable
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
341 ENDIF ; _ccr_pscr
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
342 ; revoke staged and lost state on the selected gas
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
343 lfsr FSR1,opt_gas_type ; load base address of gas types
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
344 movff menu_pos_cur,lo ; copy selected gas to lo
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
345 IFDEF _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
346 movlw .5 ; load WREG with diluent offset
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
347 btfsc is_diluent_menu ; operating on diluents?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
348 addwf lo,F ; YES - add diluent offset to shift 1-5 -> 6-10
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
349 ENDIF ; _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
350 decf lo,W ; 1-10 -> 0-4 for gases / 5-9 for diluents with result into WREG
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
351 bcf PLUSW1,gas_lost ; revoke lost state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
352 IFDEF _cave_mode
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
353 bcf PLUSW1,gas_staged ; revoke staged state
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
354 ENDIF ; _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
355 bra do_exit_divemode_menu ; continue exiting the menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
356
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
357
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
358 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
359 ; Sub-Menu: lost / staged Gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
360 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
361 do_lost_gas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
362 movlw .1 ; set to first option in dive mode menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
363 movwf menu_pos_cur ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
364 bcf gas6_or_EXIT ; default to presenting gas6 option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
365 do_lost_gas_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
366 bsf short_gas_descriptions ; do not show "Gas x" etc.
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
367 bcf better_gas_hint ; do not mark the best gas/diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
368 bcf color_code_gases ; do not color-code the gases/diluents by their ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
369
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
370 MENU_BEGIN_DIVE .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
371 MENU_DYNAMIC dyn_strcat_gas_prodl, do_toggle_staged_lost
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
372 MENU_DYNAMIC dyn_strcat_gas_prodl, do_toggle_staged_lost
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
373 MENU_DYNAMIC dyn_strcat_gas_prodl, do_toggle_staged_lost
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
374 MENU_DYNAMIC dyn_strcat_gas_prodl, do_toggle_staged_lost
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
375 MENU_DYNAMIC dyn_strcat_gas_prodl, do_toggle_staged_lost
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
376 MENU_DYNAMIC dyn_gas6_or_exit, do_gas6_or_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
377 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
378
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
379
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
380 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
381 ; dynamic Title - print full Gas Description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
382 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
383 ;dyn_strcat_gas_prodl:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
384 ; goto gaslist_strcat_gas_PRODL ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
385
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
386
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
387 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
388 ; Call Function - toggle a Gas between available, lost and staged
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
389 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
390 do_toggle_staged_lost:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
391 movff menu_pos_cur,lo ; copy selected gas/diluent to lo (1-5)
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
392 movf active_gas,W ; copy currently used gas to WREG (1-5)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
393 IFDEF _ccr_pscr
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
394 btfsc FLAG_oc_mode ; in OC mode?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
395 bra do_toggle_staged_lost_check ; YES - can't be in diluent menu then, check selected gas against gas in use
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
396 btfsc bailout_mode ; NO - in bailout?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
397 bra do_toggle_staged_lost_check ; YES - can't be in diluent menu then, check selected gas against bailout gas in use
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
398 btfss is_diluent_menu ; NO - breathing a diluent then, in diluent menu?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
399 bra do_toggle_staged_lost_exec ; NO - can modify any gas, no need for a check
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
400 movf active_dil,W ; YES - check selected diluent against diluent in use
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
401 ENDIF ; _ccr_pscr
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
402 do_toggle_staged_lost_check:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
403 cpfseq lo ; selected gas/dil = currently used gas/dil?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
404 bra do_toggle_staged_lost_exec ; NO - can set selected gas/dil to lost or staged
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
405 bra do_lost_gas_common ; YES - gas/dil in use, can not set to lost or staged, back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
406 do_toggle_staged_lost_exec:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
407 lfsr FSR1,opt_gas_type ; load base address of gas types
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
408 bcf better_gas_blinking ; clear blinking flag for gases to avoid "leftovers"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
409 IFDEF _ccr_pscr
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
410 bcf better_dil_blinking ; clear blinking flag for diluents to avoid "leftovers"
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
411 movlw .5 ; load WREG with diluent offset
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
412 btfsc is_diluent_menu ; operating on diluents?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
413 addwf lo,F ; YES - add diluent offset to shift 1-5 -> 6-10
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
414 ENDIF ; _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
415 IFDEF _cave_mode
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
416 TSTOSS opt_cave_mode ; cave mode switched on?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
417 bra do_toggle_staged_lost_3 ; NO - just toggle lost state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
418 decf lo,W ; YES - 1-10 -> 0-4 for gases / 5-9 for diluents with result into WREG
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
419 btfsc PLUSW1,gas_staged ; - gas currently set as staged?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
420 bra do_toggle_staged_lost_1 ; YES - set as lost now
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
421 btfsc PLUSW1,gas_lost ; NO - gas currently set as lost?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
422 bra do_toggle_staged_lost_2 ; YES - set as available now
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
423 ;bra do_toggle_staged_lost_0 ; NO - set as staged now
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
424 do_toggle_staged_lost_0:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
425 bsf PLUSW1,gas_staged ; set staged state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
426 bra do_toggle_staged_lost_4 ; continue with restarting deco engine
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
427 do_toggle_staged_lost_1:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
428 bcf PLUSW1,gas_staged ; revoke staged state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
429 bsf PLUSW1,gas_lost ; set lost state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
430 bra do_toggle_staged_lost_4 ; continue with restarting deco engine
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
431 do_toggle_staged_lost_2:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
432 bcf PLUSW1,gas_lost ; revoke lost state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
433 bra do_toggle_staged_lost_4 ; continue with restarting deco engine
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
434 ENDIF ; _cave_mode
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
435 do_toggle_staged_lost_3:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
436 decf lo,W ; 1-10 -> 0-4 for gases / 5-9 for diluents with result into WREG
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
437 btg PLUSW1,gas_lost ; toggle lost state
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
438 do_toggle_staged_lost_4:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
439 bsf request_gas_update ; request to update the gases
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
440 bsf gas6_or_EXIT ; switch 6th menu item from gas6 to exit
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
441 bra do_lost_gas_common ; back to the menu
0
heinrichsweikamp
parents:
diff changeset
442
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
443
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
444 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
445 ; dynamic Title - print Gas 6 Item or Exit Item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
446 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
447 dyn_gas6_or_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
448 btfsc gas6_or_EXIT ; shall print exit?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
449 bra dyn_gas6_or_exit_1 ; YES - print exit label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
450 STRCAT_TEXT tGas6 ; NO - print gas 6 label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
451 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
452 dyn_gas6_or_exit_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
453 STRCAT_TEXT tExit ; print exit label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
454 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
455
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
456
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
457 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
458 ; Sub-Menu: Gas 6 / Menu-Exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
459 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
460 do_gas6_or_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
461 btfsc gas6_or_EXIT ; shall exit?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
462 bra do_exit_divemode_menu ; YES - exit the menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
463 movlw .1 ; NO - select first item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
464 movwf menu_pos_cur ; - set cursor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
465 movff char_I_O2_ratio,opt_gas6_O2_ratio ; - initialize gas6 with currently breathed gas - O2 ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
466 IFDEF _helium
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
467 movff char_I_He_ratio,opt_gas6_He_ratio ; - initialize gas6 with currently breathed gas - He ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
468 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
469 clrf WREG ; - set gas6 helium to zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
470 movff WREG,opt_gas6_He_ratio ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
471 ENDIF ; _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
472 bsf block_option_value ; suspend displaying of option values
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
473
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
474
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
475 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
476 MENU_BEGIN_DIVE .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
477 MENU_OPT_INCS tO2Plus, oGas6O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
478 MENU_OPT_DECS tO2Minus, oGas6O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
479 MENU_OPT_INCS tHePlus, oGas6He
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
480 MENU_OPT_DECS tHeMinus, oGas6He
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
481 MENU_DYNAMIC dyn_show_gas6, do_gas6_switch
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
482 MENU_CALL tExit, do_exit_divemode_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
483 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
484 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
485 MENU_BEGIN_DIVE .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
486 MENU_OPT_INCS tO2Plus, oGas6O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
487 MENU_OPT_DECS tO2Minus, oGas6O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
488 MENU_DYNAMIC dyn_show_gas6, do_gas6_switch
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
489 MENU_CALL tExit, do_exit_divemode_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
490 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
491 ENDIF; _helium
0
heinrichsweikamp
parents:
diff changeset
492
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
493
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
494 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
495 ; dynamic Title: show Gas 6 Mix
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
496 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
497 dyn_show_gas6:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
498 STRCAT_TEXT tTakeGas ; print "take"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
499 PUTC " " ; print one space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
500 movff opt_gas6_O2_ratio,hi ; TFT_color_code_gaslist needs O2 ratio in hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
501 call TFT_color_code_gaslist ; color-code according to O2 ratio and depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
502 movff opt_gas6_O2_ratio,lo ; gaslist_strcat_mix needs O2 ratio in lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
503 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
504 movff opt_gas6_He_ratio,hi ; ... and He ratio in hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
505 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
506 clrf hi ; ... and He ration will be zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
507 ENDIF ; _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
508 goto gaslist_strcat_mix ; print "Nxlo", "Txlo/hi", "Air" or "O2" and return
0
heinrichsweikamp
parents:
diff changeset
509
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
510
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
511 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
512 ; Call Function - switch to Gas 6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
513 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
514 do_gas6_switch:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
515 movlw .6 ; gas 6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
516 movwf menu_pos_cur ; transfer register for selected gas towards gas_switched_common
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
517 bsf event_gas_change_gas6 ; set flag for profile recording
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
518 bra do_switch_gas ; continue with common gas-switched code
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
519
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
520
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
521 IFDEF _ccr_pscr
0
heinrichsweikamp
parents:
diff changeset
522
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
523 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
524 ; Sub Menu - select Setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
525 ;
0
heinrichsweikamp
parents:
diff changeset
526 do_divemode_splist:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
527 bsf short_gas_descriptions ; do not show "SP" etc.
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
528 movlw .1 ; default to first menu item
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
529 movff opt_ccr_mode,lo ; get CCR mode (0: Fixed SP, 1: Sensor, 2: Auto SP)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
530 dcfsnz lo,F ; mode = sensor ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
531 movlw .6 ; YES - load menu item number for 'sensor'
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
532 btfsc warn_det_sensors_lost ; all sensors lost?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
533 movlw .1 ; YES - revert to first menu item
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
534 movwf menu_pos_cur ; set cursor position
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
535
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
536 IFDEF _external_sensor
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
537 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
538 bra do_divemode_splist_sensor ; YES
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
539 btfsc ext_input_optical ; do we have an optical input (OSTC 3)?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
540 bra do_divemode_splist_sensor ; YES
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
541 ENDIF ; _external_sensor
0
heinrichsweikamp
parents:
diff changeset
542
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
543 do_divemode_splist_no_sensor:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
544 MENU_BEGIN_DIVE .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
545 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
546 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
547 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
548 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
549 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
550 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
551
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
552
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
553 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
554
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
555 do_divemode_splist_sensor:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
556 MENU_BEGIN_DIVE .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
557 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
558 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
559 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
560 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
561 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
562 MENU_CALL tCCRSensor, do_divemode_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
563 MENU_END
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
564
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
565 ENDIF ; _external_sensor
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
566
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
567
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
568 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
569 ; dynamic Title - print Setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
570 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
571 dyn_strcat_setpoint_prodl:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
572 goto gaslist_strcat_setpoint_PRODL ; function is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
573
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
574
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
575 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
576 ; Call Function - switch to manually selected Setpoint (CCR)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
577 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
578 do_switch_sp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
579 decf menu_pos_cur,W ; 1-5 -> 0-4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
580 lfsr FSR1,opt_setpoint_cbar ; load base address
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
581 movff PLUSW1,char_I_const_ppO2 ; set selected setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
582 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
583 call transmit_setpoint ; transmit current setpoint from WREG (in cbar) to external electronics
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
584 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
585 bcf warn_det_sensors_lost ; clear fallback condition (revoke all sensors lost warning)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
586 clrf WREG ; switch to fixed SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
587 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
588 ;bra do_switch_sp_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
589
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
590
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
591 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
592 ; Helper Function - common Part of Setpoint Switching
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
593 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
594 do_switch_sp_com: ; common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
595 bsf event_occured ; set global event byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
596 bsf event_SP_change ; set setpoint event flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
597
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
598 ; Clear some flags in case we were in bailout before...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
599 bcf bailout_mode ; end bailout mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
600 bcf better_gas_available ; =1: a better gas is available and a gas change is advised in dive mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
601 bcf better_dil_available ; =1: a better diluent is available and a gas change is advised in dive mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
602 bcf better_gas_blinking ; clear blinking flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
603 bcf better_dil_blinking ; clear blinking flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
604 call dive_customview_callup ; redraw custom view mask to (if applicable) rewrite "ppO2(Dil)" to "ppO2" or SAC label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
605
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
606 bsf request_back_to_loop ; indicate that it is a switchback from OC bailout to CCR/pSCR loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
607 bsf request_gas_change ; initiate reconfiguration to loop mode on last diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
608
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
609 bra do_exit_divemode_menu ; continue exiting the menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
610
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
611
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
612 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
613
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
614
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
615 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
616 ; Return to Sub Menu toggle Sensor Usage / select Sensors from Menu Action
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
617 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
618 do_return_divemode_sensor:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
619 call menu_processor_pop ; drop selection from menu stack
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
620 bra do_return_divemode_common ; back to menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
621
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
622 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
623 ; Sub Menu - toggle Sensor Usage / select Sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
624 ;
0
heinrichsweikamp
parents:
diff changeset
625 do_divemode_sensor:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
626 movlw index_ppo2_sensors ; number of ppO2 sensors custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
627 movwf active_customview ; set the custom view number
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
628 call dive_customview_callup ; call-up the custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
629 movlw .1 ; set to 1st option: use sensors
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
630 movwf menu_pos_cur ; ...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
631
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
632 do_return_divemode_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
633 MENU_BEGIN_DIVE .6
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
634 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
635 MENU_CALL tBack, do_divemode_splist
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
636 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
637 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
638 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
639 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
640 MENU_END
0
heinrichsweikamp
parents:
diff changeset
641
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
642 do_divemode_setpoint_pscr:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
643 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
644 movwf menu_pos_cur ; set to 1st option: use calculated ppO2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
645
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
646 MENU_BEGIN_DIVE .6
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
647 MENU_CALL tCalculated, do_switch_sp_calc
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
648 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
649 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
650 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
651 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
652 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
653 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
654
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
655
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
656 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
657 ; Call Function - switch to using Sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
658 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
659 do_switch_sensor:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
660 movlw .1 ; switch to sensor (0: fixed/ calculated SP, 1: Sensor, 2: AutoSP)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
661 movff WREG,opt_ccr_mode ; ...
0
heinrichsweikamp
parents:
diff changeset
662
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
663 ; check for external HUD/ppO2 Monitor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
664 btfss ext_input_optical ; do we have an optical input?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
665 bra do_switch_sp_com ; NO - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
666 btfsc sensor1_active ; YES - process flags from HUD/ppO2 Monitor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
667 bsf use_O2_sensor1 ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
668 btfsc sensor2_active ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
669 bsf use_O2_sensor2 ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
670 btfsc sensor3_active ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
671 bsf use_O2_sensor3 ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
672 bra do_switch_sp_com ; - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
673
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
674
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
675 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
676 ; Call Function - toggle Sensor Usage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
677 ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
678 do_toggle_sensor:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
679 movf menu_pos_cur,W ; copy position to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
680 addlw -.3 ; skip first 3 menu items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
681 dcfsnz WREG ; cursor on item sensor 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
682 btg use_O2_sensor1 ; YES - toggle sensor 1 state
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
683 dcfsnz WREG ; cursor on item sensor 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
684 btg use_O2_sensor2 ; YES - toggle sensor 2 state
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
685 dcfsnz WREG ; cursor on item sensor 3 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
686 btg use_O2_sensor3 ; YES - toggle sensor 3 state
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
687 bra do_return_divemode_sensor ; back to same menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
688
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
689 ENDIF ; _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
690 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
691
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
692
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
693 IFDEF _cave_mode
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
694
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
695 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
696 ; Return to Cave Mode Main Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
697 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
698 do_return_main_cavemenu:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
699 call menu_processor_pop ; drop selection from menu stack
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
700 incf selected_item,W ; item numbers start with 0, menu positions with 1
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
701 movwf menu_pos_cur ; position cursor where we came from
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
702 bra do_main_cavemenu_common ; continue with common part
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
703
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
704
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
705 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
706 ; Cave Mode Main Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
707 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
708 global do_main_cavemenu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
709 do_main_cavemenu:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
710 bsf custom_view_locked ; lock custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
711 movff active_customview,backup_customview ; back up current custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
712 call menu_processor_reset ; restart from first icon
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
713 movlw .1 ; set cursor to first menu item by default
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
714 btfsc dive_turned ; dive turned ?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
715 movlw .4 ; YES - set cursor on waypoint out item
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
716 btfss cave_mode ; cave mode switched off ?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
717 movlw .3 ; YES - set cursor on cave mode off/on menu item
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
718 movwf menu_pos_cur ; actually set cursor position
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
719 ;bra do_main_cavemenu_common ; continue with common part
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
720
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
721 do_main_cavemenu_common:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
722 movlw index_cave_waypoints ; get number of cave waypoints custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
723 movwf active_customview ; set custom view number
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
724 call dive_customview_callup ; draw custom view
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
725
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
726 MENU_BEGIN_DIVE .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
727 MENU_DYNAMIC dyn_waypoint_set, do_waypoint_set ; 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
728 MENU_DYNAMIC dyn_turndive_toggle, do_turndive_toggle ; 2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
729 MENU_CALL tDivemenu_off_on, do_cavemode_toggle ; 3
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
730 MENU_DYNAMIC dyn_waypoint_out, do_waypoint_out ; 4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
731 MENU_DYNAMIC dyn_waypoint_in, do_waypoint_in ; 5
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
732 MENU_CALL tExit, do_exit_divemode_menu ; 6
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
733 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
734
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
735
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
736 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
737 ; dynamic Title - set a Waypoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
738 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
739 dyn_waypoint_set:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
740 call cavemode_waypoint_set_check ; check if command is allowed to execute
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
741 tstfsz WREG ; command allowed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
742 FONT_COLOR_DISABLED ; NO - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
743 STRCAT_TEXT tDivemenu_wp_set ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
744 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
745
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
746
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
747 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
748 ; dynamic Title - turn the Dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
749 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
750 dyn_turndive_toggle:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
751 call cavemode_turndive_check ; check if command is allowed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
752 tstfsz WREG ; command allowed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
753 FONT_COLOR_DISABLED ; NO - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
754 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
755 bra dyn_turndive_toggle_1 ; NO - print turn dive label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
756 btfss dive_turned ; YES - dive turned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
757 bra dyn_turndive_toggle_1 ; NO - print turn dive label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
758 STRCAT_TEXT tDivemenu_ContDive ; YES - print continue dive label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
759 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
760 dyn_turndive_toggle_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
761 STRCAT_TEXT tDivemenu_TurnDive ; print turn dive label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
762 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
763
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
764
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
765 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
766 ; dynamic Title - navigate one Waypoint outwards
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
767 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
768 dyn_waypoint_out:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
769 call cavemode_waypoint_out_check ; check if command is allowed to execute
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
770 tstfsz WREG ; command allowed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
771 FONT_COLOR_DISABLED ; NO - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
772 STRCAT_TEXT tDivemenu_wp_out ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
773 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
774
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
775
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
776 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
777 ; dynamic Title - navigate one Waypoint inwards
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
778 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
779 dyn_waypoint_in:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
780 call cavemode_waypoint_in_check ; check if command is allowed to execute
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
781 tstfsz WREG ; command allowed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
782 FONT_COLOR_DISABLED ; NO - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
783 STRCAT_TEXT tDivemenu_wp_in ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
784 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
785
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
786
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
787 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
788 ; Call Function - set a Waypoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
789 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
790 do_waypoint_set:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
791 bsf request_waypoint_set ; set request flag
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
792 bra do_return_main_cavemenu ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
793
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
794
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
795 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
796 ; Call Function - turn the dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
797 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
798 do_turndive_toggle:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
799 bsf request_turn_toggle ; set request flag
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
800 bra do_return_main_cavemenu ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
801
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
802
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
803 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
804 ; Call Function - turn Cave Mode on/off
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
805 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
806 do_cavemode_toggle:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
807 bsf request_cave_toggle ; set request flag
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
808 bra do_return_main_cavemenu ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
809
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
810
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
811 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
812 ; Call Function - navigate one Waypoint outwards
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
813 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
814 do_waypoint_out:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
815 bsf request_waypoint_out ; set request flag
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
816 bra do_return_main_cavemenu ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
817
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
818
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
819 ;-------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
820 ; Call Function - navigate one Waypoint inwards
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
821 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
822 do_waypoint_in:
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
823 bsf request_waypoint_in ; set request flag
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
824 bra do_return_main_cavemenu ; back to menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
825
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
826 ENDIF ; _cave_mode
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 623
diff changeset
827
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
828
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
829 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
830 ; Call Function - leave the Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
831 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
832 do_exit_divemode_menu:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
833 bcf block_option_value ; resume displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
834 goto diveloop_menu_exit ; back to the dive loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
835
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
836 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
837
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
838 END