# HG changeset patch # User heinrichsweikamp # Date 1452421473 -3600 # Node ID 6e60012bb3fcf5e342f9b90214aad7704a5873b7 # Parent a3a0f1fd7fc42666c17b476d5b9141a3bd725b7e NEW: "Lost Gas" feature allows disabling gases during the dive diff -r a3a0f1fd7fc4 -r 6e60012bb3fc src/changelog.txt --- a/src/changelog.txt Sun Jan 10 09:36:47 2016 +0100 +++ b/src/changelog.txt Sun Jan 10 11:24:33 2016 +0100 @@ -2,6 +2,7 @@ - Stable Version - NEW: Logbook marker can be set in dive mode menu (OC only) NEW: Logbook shows markers with small orange boxes in the profile +NEW: "Lost Gas" feature allows disabling gases during the dive [1.94] - Beta Version - diff -r a3a0f1fd7fc4 -r 6e60012bb3fc src/divemenu_tree.asm --- a/src/divemenu_tree.asm Sun Jan 10 09:36:47 2016 +0100 +++ b/src/divemenu_tree.asm Sun Jan 10 11:24:33 2016 +0100 @@ -154,16 +154,63 @@ movwf menupos ; Set to first option in divemode menu do_divemode_gaslist_more: MENU_BEGIN tGaslist, .6 - MENU_DYNAMIC gaslist_strcat_gasx, do_dive_nothing MENU_CALL tO2Plus, do_dive_pO2 MENU_CALL tO2Minus, do_dive_mO2 MENU_CALL tHePlus, do_dive_pHe MENU_CALL tHeMinus, do_dive_mHe - MENU_CALL tExit, do_switch_gas6 + MENU_DYNAMIC gaslist_strcat_gasx, do_switch_gas6 + MENU_CALL tDivemenu_LostGas, do_lost_gas + MENU_END + +do_lost_gas: + movlw .1 + movwf menupos ; Set to first option in divemode menu +do_lost_gas0: + bcf ccr_diluent_setup ; use OC gases + bsf is_bailout_menu ; =1: Bailout + bsf short_gas_decriptions + MENU_BEGIN tDivemenu_LostGas, .6 + MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active + MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active + MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active + MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active + MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active + MENU_CALL tExit, do_exit_divemode_menu MENU_END -do_dive_nothing: - bra do_divemode_gaslist_more +do_toggle_active: + decf menupos,W ; 1-5 -> 0-4 + lfsr FSR1,opt_gas_type+0 + movff PLUSW1,lo + tstfsz lo ; Already disabled? + bra do_toggle_active2 ; No, disable now! + + ; Copy opt_gas_type_backup+W back to opt_gas_type+W + decf menupos,W ; 1-5 -> 0-4 + lfsr FSR1,opt_gas_type_backup+0 + movff PLUSW1,lo + decf menupos,W ; 1-5 -> 0-4 + lfsr FSR1,opt_gas_type+0 + movff lo,PLUSW1 + + ; Copy opt_OC_bail_gas_change_backup+W back to opt_OC_bail_gas_change+W + decf menupos,W ; 1-5 -> 0-4 + lfsr FSR1,opt_OC_bail_gas_change_backup+0 + movff PLUSW1,lo + decf menupos,W ; 1-5 -> 0-4 + lfsr FSR1,opt_OC_bail_gas_change+0 + movff lo,PLUSW1 + + bra do_lost_gas0 ; Return to list and show updated result + +do_toggle_active2: + clrf PLUSW1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + + ; Also delete change depth here to have the menu updated immediately + lfsr FSR1,opt_OC_bail_gas_change+0 + clrf PLUSW1 + + bra do_lost_gas0 ; Return to list and show updated result do_dive_pO2: banksel char_I_O2_ratio diff -r a3a0f1fd7fc4 -r 6e60012bb3fc src/divemode.asm --- a/src/divemode.asm Sun Jan 10 09:36:47 2016 +0100 +++ b/src/divemode.asm Sun Jan 10 11:24:33 2016 +0100 @@ -1491,6 +1491,25 @@ btfsc FLAG_ccr_mode rcall dive_boot_cc + ; Copy opt_dil_types into backup (For "lost gas" feature) + movff opt_dil_type+0,opt_dil_type_backup+0 ; 0=Disabled, 1=First, 2=Normal + movff opt_dil_type+1,opt_dil_type_backup+1 ; 0=Disabled, 1=First, 2=Normal + movff opt_dil_type+2,opt_dil_type_backup+2 ; 0=Disabled, 1=First, 2=Normal + movff opt_dil_type+3,opt_dil_type_backup+3 ; 0=Disabled, 1=First, 2=Normal + movff opt_dil_type+4,opt_dil_type_backup+4 ; 0=Disabled, 1=First, 2=Normal + ; Copy opt_gas_types into backup (For "lost gas" feature) + movff opt_gas_type+0,opt_gas_type_backup+0 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + movff opt_gas_type+1,opt_gas_type_backup+1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + movff opt_gas_type+2,opt_gas_type_backup+2 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + movff opt_gas_type+3,opt_gas_type_backup+3 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + movff opt_gas_type+4,opt_gas_type_backup+4 ; 0=Disabled, 1=First, 2=Travel, 3=Deco + ; Also copy change depths into backup (For "lost gas" feature) + movff opt_OC_bail_gas_change+0,opt_OC_bail_gas_change_backup+0 ; Gas change depths OC/Bailout + movff opt_OC_bail_gas_change+1,opt_OC_bail_gas_change_backup+1 ; Gas change depths OC/Bailout + movff opt_OC_bail_gas_change+2,opt_OC_bail_gas_change_backup+2 ; Gas change depths OC/Bailout + movff opt_OC_bail_gas_change+3,opt_OC_bail_gas_change_backup+3 ; Gas change depths OC/Bailout + movff opt_OC_bail_gas_change+4,opt_OC_bail_gas_change_backup+4 ; Gas change depths OC/Bailout + bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode clrf better_gas_number ; Clear better gas register diff -r a3a0f1fd7fc4 -r 6e60012bb3fc src/hwos.inc --- a/src/hwos.inc Sun Jan 10 09:36:47 2016 +0100 +++ b/src/hwos.inc Sun Jan 10 11:24:33 2016 +0100 @@ -21,7 +21,7 @@ ; Firmware definition #DEFINE softwareversion_x d'2' ; Software version XX.YY #DEFINE softwareversion_y d'00' ; Software version XX.YY -#DEFINE softwareversion_beta 1 ; (and 0 for release) +#DEFINE softwareversion_beta 0 ; (and 0 for release) ; Firmware version will appear in "Change Firmware" style #DEFINE firmware_expire_year .17 #DEFINE firmware_expire_month .1 @@ -528,6 +528,10 @@ start_mins res 1 ; At start of dive (For logbook) old_velocity res 4 ; Strores the last 4 speeds (8 seconds) in m/min +opt_gas_type_backup res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco +opt_dil_type_backup res 5 ; 0=Disabled, 1=First, 2=Normal +opt_OC_bail_gas_change_backup res 5 ; Gas change depths OC/Bailout + ;----------------------------------------------------------------------------- ; Reserve BANK2 for general purpose buffer (strings, images, etc). diff -r a3a0f1fd7fc4 -r 6e60012bb3fc src/text_english.inc --- a/src/text_english.inc Sun Jan 10 09:36:47 2016 +0100 +++ b/src/text_english.inc Sun Jan 10 11:24:33 2016 +0100 @@ -24,6 +24,7 @@ TCODE tDivemenu_UseSensor,"Use Sensor" ; Use Sensor TCODE tDivemenu_ToggleGF, "Toggle GF" ; Toggle GF TCODE tDivemenu_Marker, "Set Marker" ; Set Marker + TCODE tDivemenu_LostGas, "Lost Gas" ; Lost Gas ; Main menu TCODE tNext, "