comparison src/divemode.asm @ 160:99ac325586ce

BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
author heinrichsweikamp
date Mon, 08 Sep 2014 15:39:41 +0200
parents 19ad15f04f60
children 99065ef2d18e
comparison
equal deleted inserted replaced
159:2eb037f48c3f 160:99ac325586ce
1047 bra check_gas_change_OC_bail; No, check for OC or bailout 1047 bra check_gas_change_OC_bail; No, check for OC or bailout
1048 btfsc is_bailout ; Bailout? 1048 btfsc is_bailout ; Bailout?
1049 bra check_gas_change_OC_bail; Yes, check for OC or bailout 1049 bra check_gas_change_OC_bail; Yes, check for OC or bailout
1050 1050
1051 ; Check Diluents 1051 ; Check Diluents
1052 bsf ccr_diluent_setup ; in CCR menus
1052 movlw .0 1053 movlw .0
1053 rcall check_dil_common ; With Gas 0-4 in WREG 1054 rcall check_dil_common ; With Gas 0-4 in WREG
1054 movlw .1 1055 movlw .1
1055 rcall check_dil_common ; With Gas 0-4 in WREG 1056 rcall check_dil_common ; With Gas 0-4 in WREG
1056 movlw .2 1057 movlw .2
1060 movlw .4 1061 movlw .4
1061 rcall check_dil_common ; With Gas 0-4 in WREG 1062 rcall check_dil_common ; With Gas 0-4 in WREG
1062 bra check_gas_change_exit 1063 bra check_gas_change_exit
1063 1064
1064 check_gas_change_OC_bail: 1065 check_gas_change_OC_bail:
1066 bcf ccr_diluent_setup ; in OC menus
1065 movlw .0 1067 movlw .0
1066 rcall check_gas_common ; With Gas 0-4 in WREG 1068 rcall check_gas_common ; With Gas 0-4 in WREG
1067 movlw .1 1069 movlw .1
1068 rcall check_gas_common ; With Gas 0-4 in WREG 1070 rcall check_gas_common ; With Gas 0-4 in WREG
1069 movlw .2 1071 movlw .2
1197 return ; No, Change depth not deep enough, skip! 1199 return ; No, Change depth not deep enough, skip!
1198 movf xC+0,W ; load depth in m into WREG 1200 movf xC+0,W ; load depth in m into WREG
1199 cpfsgt lo ; gas_change_depth < current depth? 1201 cpfsgt lo ; gas_change_depth < current depth?
1200 return ; No, check next gas 1202 return ; No, check next gas
1201 incf hi,W ; 1-5 1203 incf hi,W ; 1-5
1202 addlw .5 ; 6-10
1203 movwf better_gas_number ; number (1-5) of the "better gas" in divemode, =0: no better gas available 1204 movwf better_gas_number ; number (1-5) of the "better gas" in divemode, =0: no better gas available
1204 movlw better_gas_window_neg 1205 movlw better_gas_window_neg
1205 subwf lo,W ; Change depth-better_gas_window_neg 1206 subwf lo,W ; Change depth-better_gas_window_neg
1206 cpfslt xC+0 ; current depth<Change depth-better_gas_window_neg? 1207 cpfslt xC+0 ; current depth<Change depth-better_gas_window_neg?
1207 bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode 1208 bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode