Mercurial > public > hwos_code
comparison src/divemenu_tree.asm @ 403:6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
author | heinrichsweikamp |
---|---|
date | Sun, 10 Jan 2016 11:24:33 +0100 |
parents | 7be43d886bb1 |
children | 8f8151bb53bb |
comparison
equal
deleted
inserted
replaced
402:a3a0f1fd7fc4 | 403:6e60012bb3fc |
---|---|
152 do_divemode_gaslist_more0: | 152 do_divemode_gaslist_more0: |
153 movlw .1 | 153 movlw .1 |
154 movwf menupos ; Set to first option in divemode menu | 154 movwf menupos ; Set to first option in divemode menu |
155 do_divemode_gaslist_more: | 155 do_divemode_gaslist_more: |
156 MENU_BEGIN tGaslist, .6 | 156 MENU_BEGIN tGaslist, .6 |
157 MENU_DYNAMIC gaslist_strcat_gasx, do_dive_nothing | |
158 MENU_CALL tO2Plus, do_dive_pO2 | 157 MENU_CALL tO2Plus, do_dive_pO2 |
159 MENU_CALL tO2Minus, do_dive_mO2 | 158 MENU_CALL tO2Minus, do_dive_mO2 |
160 MENU_CALL tHePlus, do_dive_pHe | 159 MENU_CALL tHePlus, do_dive_pHe |
161 MENU_CALL tHeMinus, do_dive_mHe | 160 MENU_CALL tHeMinus, do_dive_mHe |
162 MENU_CALL tExit, do_switch_gas6 | 161 MENU_DYNAMIC gaslist_strcat_gasx, do_switch_gas6 |
163 MENU_END | 162 MENU_CALL tDivemenu_LostGas, do_lost_gas |
164 | 163 MENU_END |
165 do_dive_nothing: | 164 |
166 bra do_divemode_gaslist_more | 165 do_lost_gas: |
166 movlw .1 | |
167 movwf menupos ; Set to first option in divemode menu | |
168 do_lost_gas0: | |
169 bcf ccr_diluent_setup ; use OC gases | |
170 bsf is_bailout_menu ; =1: Bailout | |
171 bsf short_gas_decriptions | |
172 MENU_BEGIN tDivemenu_LostGas, .6 | |
173 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active | |
174 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active | |
175 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active | |
176 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active | |
177 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active | |
178 MENU_CALL tExit, do_exit_divemode_menu | |
179 MENU_END | |
180 | |
181 do_toggle_active: | |
182 decf menupos,W ; 1-5 -> 0-4 | |
183 lfsr FSR1,opt_gas_type+0 | |
184 movff PLUSW1,lo | |
185 tstfsz lo ; Already disabled? | |
186 bra do_toggle_active2 ; No, disable now! | |
187 | |
188 ; Copy opt_gas_type_backup+W back to opt_gas_type+W | |
189 decf menupos,W ; 1-5 -> 0-4 | |
190 lfsr FSR1,opt_gas_type_backup+0 | |
191 movff PLUSW1,lo | |
192 decf menupos,W ; 1-5 -> 0-4 | |
193 lfsr FSR1,opt_gas_type+0 | |
194 movff lo,PLUSW1 | |
195 | |
196 ; Copy opt_OC_bail_gas_change_backup+W back to opt_OC_bail_gas_change+W | |
197 decf menupos,W ; 1-5 -> 0-4 | |
198 lfsr FSR1,opt_OC_bail_gas_change_backup+0 | |
199 movff PLUSW1,lo | |
200 decf menupos,W ; 1-5 -> 0-4 | |
201 lfsr FSR1,opt_OC_bail_gas_change+0 | |
202 movff lo,PLUSW1 | |
203 | |
204 bra do_lost_gas0 ; Return to list and show updated result | |
205 | |
206 do_toggle_active2: | |
207 clrf PLUSW1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco | |
208 | |
209 ; Also delete change depth here to have the menu updated immediately | |
210 lfsr FSR1,opt_OC_bail_gas_change+0 | |
211 clrf PLUSW1 | |
212 | |
213 bra do_lost_gas0 ; Return to list and show updated result | |
167 | 214 |
168 do_dive_pO2: | 215 do_dive_pO2: |
169 banksel char_I_O2_ratio | 216 banksel char_I_O2_ratio |
170 incf char_I_O2_ratio,F ; O2++ | 217 incf char_I_O2_ratio,F ; O2++ |
171 movf char_I_He_ratio,W | 218 movf char_I_He_ratio,W |