diff src/gaslist.asm @ 97:53a99a2dc6a1

CHANGE: Always compute bailout plan based on all active gases CHANGE: Re-select last diluent when returning from bailout to OC
author heinrichsweikamp
date Mon, 28 Apr 2014 16:26:31 +0200
parents 3dfc2b7ced6d
children afa31c815f24
line wrap: on
line diff
--- a/src/gaslist.asm	Mon Apr 28 11:33:00 2014 +0200
+++ b/src/gaslist.asm	Mon Apr 28 16:26:31 2014 +0200
@@ -215,8 +215,12 @@
         rcall   gaslist_strcat_gas_0
 		PUTC	" "
         ; Read switch depth
+        lfsr    FSR1,char_I_dil_change-.5   ; Setup Diluents-5
+        movlw   .4
+        cpfsgt  gaslist_gas                 ; >4? (-> Diluents)
+        lfsr    FSR1,opt_OC_bail_gas_change ; Setup OC Gases
+
         movf    gaslist_gas,W           ; (0-4 for OC/Bailout, 5-9 for Diluents)
-        lfsr    FSR1,char_I_deco_gas_change
         movff   PLUSW1,lo
         rcall   gaslist_calc_mod        ; Compute MOD into WREG
         cpfsgt  lo
@@ -330,7 +334,10 @@
         bra     gaslist_cleanup_list    ; Loop until only one "first gas" is left
 
 gaslist_cleanup_list5:
-        lfsr    FSR1,char_I_deco_gas_change
+        ; Read switch depth
+        lfsr    FSR1,char_I_dil_change-.5   ; Setup Diluents-5
+        btfss   ccr_diluent_setup           ; In CCR-Menu?
+        lfsr    FSR1,opt_OC_bail_gas_change ; No, setup OC Gases
         decf    lo_temp,W
         btfsc   ccr_diluent_setup       ; In CCR-Menu?
         addlw   .5                      ; Yes, adjust offset
@@ -416,8 +423,12 @@
 ; Increment/Decrement switch depth
         global  gaslist_pDepth
 gaslist_pDepth:
+        lfsr    FSR1,char_I_dil_change-.5   ; Setup Diluents-5
+        movlw   .4
+        cpfsgt  gaslist_gas                 ; >4? (-> Diluents)
+        lfsr    FSR1,opt_OC_bail_gas_change ; Setup OC Gases
+
         movf    gaslist_gas,W
-        lfsr    FSR1,char_I_deco_gas_change
         movff   PLUSW1,gaslist_O2       ; Read char_I_deco_gas_change[WREG]
 
         incf    gaslist_O2,F
@@ -433,8 +444,12 @@
         
         global  gaslist_mDepth
 gaslist_mDepth:
+        lfsr    FSR1,char_I_dil_change-.5   ; Setup Diluents-5
+        movlw   .4
+        cpfsgt  gaslist_gas                 ; >4? (-> Diluents)
+        lfsr    FSR1,opt_OC_bail_gas_change ; Setup OC Gases
+
         movf    gaslist_gas,W
-        lfsr    FSR1,char_I_deco_gas_change
         movff   PLUSW1,gaslist_O2       ; Read char_I_deco_gas_change[WREG]
 
         decf    gaslist_O2,F
@@ -608,7 +623,9 @@
         movwf   lo                      ; Copy to lo
 
         movf    gaslist_gas,W           ; Compare to switch depth
-        lfsr    FSR1,char_I_deco_gas_change
+        lfsr    FSR1,char_I_dil_change  ; Setup Diluents mH
+        btfss   ccr_diluent_setup           ; In CCR-Menu?
+        lfsr    FSR1,opt_OC_bail_gas_change ; No, setup OC Gases
         movf   	PLUSW1,W
         cpfslt  lo
         bra     gaslist_strcat_4        ; And return...
@@ -622,7 +639,11 @@
         movwf   gaslist_depth
 
         movf    gaslist_gas,W           ; Read current gas O2 ratio
-        lfsr    FSR1,char_I_deco_gas_change
+
+        lfsr    FSR1,char_I_dil_change      ; Setup Diluents mH
+        btfss   ccr_diluent_setup           ; In CCR-Menu?
+        lfsr    FSR1,opt_OC_bail_gas_change ; No, setup OC Gases
+
         movff   gaslist_depth,PLUSW1    ; And save new change depth
         return
 ;----------------------------------------------------------------------------