diff code_part1/OSTC_code_c_part2/p2_deco.c @ 279:8514588eb6a2

Mark gas-switch stops for decoplans, displayed in yellow.
author JeanDo
date Tue, 19 Apr 2011 03:12:22 +0200
parents 17aab4ca0547
children 9feb224f6871
line wrap: on
line diff
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Tue Apr 19 02:26:41 2011 +0200
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Tue Apr 19 03:12:22 2011 +0200
@@ -829,7 +829,7 @@
 {
     // Copy depth of the first (deepest) stop, because when reversing
     // order, it will be hard to find...    
-    char_O_first_deco_depth = internal_deco_depth[0];
+    char_O_first_deco_depth = internal_deco_depth[0] & 0x7F;
     char_O_first_deco_time  = internal_deco_time [0];
 
     if( read_custom_function(54) & 1 ) //---- Should we reverse table ? ------
@@ -1836,7 +1836,7 @@
         // Make sure deco-stops are recorded in order:
         assert( !internal_deco_depth[x] || temp_depth_limit <= internal_deco_depth[x] );
 
-        if( internal_deco_depth[x] == temp_depth_limit )
+        if( (internal_deco_depth[x] & 0x7F) == temp_depth_limit )
         {
             // Do not overflow (max 255')
 	        if( internal_deco_time[x] < 255 )
@@ -1850,6 +1850,9 @@
         if( internal_deco_depth[x] == 0 )
         {
             internal_deco_depth[x] = temp_depth_limit;
+            if( sim_gas_delay > sim_dive_mins )
+                internal_deco_depth[x] |= 0x80;
+
             internal_deco_time[x]  = 1;
             return;
         }