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