changeset 532:f5a06b9e2fef

cleanup debug stuff
author heinrichsweikamp
date Sat, 17 Dec 2011 10:28:29 +0100
parents d0f719aa5166
children a2019f310176
files code_part1/OSTC_code_asm_part1/MAIN.ASM code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/english_text.asm code_part1/OSTC_code_asm_part1/french_text.asm code_part1/OSTC_code_asm_part1/german_text.asm code_part1/OSTC_code_asm_part1/menu_gassetup.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_asm_part1/russian_text.asm code_part1/OSTC_code_asm_part1/shared_definitions.h code_part1/OSTC_code_asm_part1/spanish_text.asm code_part1/OSTC_code_asm_part1/turkish_text.asm code_part1/OSTC_code_c_part2/p2_deco.c code_part1/OSTC_code_c_part2/p2_deco.o code_part1/OSTC_code_c_part2/p2_definitions.h
diffstat 14 files changed, 30 insertions(+), 301 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/MAIN.ASM	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/MAIN.ASM	Sat Dec 17 10:28:29 2011 +0100
@@ -28,7 +28,6 @@
 	#include <P18F4685.INC>					;processor specific variable definitions
 
 	#include	definitions.asm				; Defines, I/O Ports and variables
-;    #include    "../OSTC_code_c_part2/shared_definitions.h"
     #include    shared_definitions.h
 
 reset_v code     0x0000
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -722,26 +722,7 @@
 	return
 
 store_dive_decodebug:
-    ; Dump 9 bytes, int_O_DBS_bitfield .. char_O_NDL_at_20mtr
-    lfsr    FSR2, int_O_DBS_bitfield
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
-    movf    POSTINC2,W
-	call	write_external_eeprom		; Store in EEPROM
+	; do something here
 	GETCUSTOM8	d'25'
 	movwf	divisor_deco_debug			; Reload divisor from CF
 	return
@@ -1296,7 +1277,7 @@
 	addwf	temp1,W		; copy to bits 0-3, result in WREG
 	call	write_external_eeprom
 
-	movlw	d'9'		; information size Decodebug
+	movlw	d'0'		; information size Decodebug
 	movwf	temp1		; copy to bits 0-3
 	swapf	temp1,F		; swap nibbels 0-3 with 4-7
 	GETCUSTOM8	d'25'	; Divisor Decodebug
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -86,7 +86,7 @@
 #DEFINE	TXT_HE4			     "He: "                      ; "He: "                 
 #DEFINE	TXT_NX3			     "NX "                       ; "NX "                  
 #DEFINE	TXT_TX3			     "TX "                       ; "TX "                  
-#DEFINE	TXT_IN4			     " in "                      ; " in "                 
+#DEFINE	TXT_AT4			     " at "                      ; " at "
 #DEFINE	TXT_G1_3		     "G1:"                       ; "G1:"                  
 #DEFINE	TXT_G2_3		     "G2:"                       ; "G2:"                  
 #DEFINE	TXT_G3_3		     "G3:"                       ; "G3:"                  
@@ -249,7 +249,7 @@
     TCODE    .0,    .36,     "Lowest at:"                ;119 Lowest at:
     TCODE    .0,    .45,     "Tmin:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmax:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "More"                    	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "More"                    	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_asm_part1/french_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/french_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -86,7 +86,7 @@
 #DEFINE	TXT_HE4			     "He: "                      ; "He: "                 
 #DEFINE	TXT_NX3			     "NX "                       ; "NX "                  
 #DEFINE	TXT_TX3			     "TX "                       ; "TX "                  
-#DEFINE	TXT_IN4			     " in "                      ; " in "                 
+#DEFINE	TXT_AT4			     " in "                      ; " at "
 #DEFINE	TXT_G1_3		     "G1:"                       ; "G1:"                  
 #DEFINE	TXT_G2_3		     "G2:"                       ; "G2:"                  
 #DEFINE	TXT_G3_3		     "G3:"                       ; "G3:"                  
@@ -249,7 +249,7 @@
     TCODE    .0,    .36,     "PlusBas le :"              ;119 Lowest at:
     TCODE    .0,    .45,     "Tmin:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmax:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "Suite"                   	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "Suite"                   	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_asm_part1/german_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/german_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -86,7 +86,7 @@
 #DEFINE	TXT_HE4			     "He: "                      ; "He: "                 
 #DEFINE	TXT_NX3			     "NX "                       ; "NX "                  
 #DEFINE	TXT_TX3			     "TX "                       ; "TX "                  
-#DEFINE	TXT_IN4			     " in "                      ; " in "                 
+#DEFINE	TXT_AT4			     " in "                      ; " at "
 #DEFINE	TXT_G1_3		     "G1:"                       ; "G1:"                  
 #DEFINE	TXT_G2_3		     "G2:"                       ; "G2:"                  
 #DEFINE	TXT_G3_3		     "G3:"                       ; "G3:"                  
@@ -249,7 +249,7 @@
     TCODE    .0,    .36,     "Datum tief:"               ;119 Lowest at:
     TCODE    .0,    .45,     "Tmin:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmax:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "Mehr"                    	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "Mehr"                    	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -160,7 +160,7 @@
 	movff	WREG,win_top
 	lfsr	FSR2,letter
 
-    STRCAT  TXT_IN4
+    STRCAT  TXT_AT4
 	movf	decodata+0,W		; read current value 
 	addlw	d'28'				; offset in memory
 	movwf	EEADR
@@ -1007,7 +1007,7 @@
 	bra 	gassetup_title_bar7
 
 gassetup_title_bar7:
-    STRCAT  TXT_IN4
+    STRCAT  TXT_AT4
 	movf	decodata+0,W		; read current value 
 	addlw	d'28'				; offset in memory
 	movwf	EEADR
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -2851,7 +2851,7 @@
 	movlw	color_yellow			; Blink in yellow
     call	PLED_set_color
 	WIN_LEFT	.95
-	WIN_TOP		.150
+	WIN_TOP		.148
 	WIN_FONT	FT_SMALL
 
 	movlw	.6
@@ -2862,14 +2862,14 @@
 	STRCPY  TXT_GAS1
 	movff	menupos,lo
 	output_8					; Show gas number
-    STRCAT      " in "
+    STRCAT  TXT_AT4				; " at "
 	decf	menupos,W
 	addlw	d'28'				; offset in memory
 	movwf	EEADR
 	call	read_eeprom			; Low-value
 	movff	EEDATA,lo
 	output_8					; Show gas number
-    STRCAT_PRINT  "m "
+    STRCAT_PRINT  TXT_METER2	; "m "
 	bcf		leftbind
 	call	PLED_standard_color
 	return
--- a/code_part1/OSTC_code_asm_part1/russian_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/russian_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -89,7 +89,7 @@
 #DEFINE	TXT_HE4			     "He: "                      ; "He: "      
 #DEFINE	TXT_NX3			     "NX "                       ; "NX "       
 #DEFINE	TXT_TX3			     "TX "                       ; "TX "       
-#DEFINE	TXT_IN4			     " íà "                      ; " in "      
+#DEFINE	TXT_AT4			     " íà "                      ; " at "
 #DEFINE	TXT_G1_3		     "Ã1:"                       ; "G1:"       
 #DEFINE	TXT_G2_3		     "Ã2:"                       ; "G2:"       
 #DEFINE	TXT_G3_3		     "Ã3:"                       ; "G3:"       
@@ -252,7 +252,7 @@
     TCODE    .0,    .36,     "Ìèíèìóì äàòà:"             ;119 Lowest at:
     TCODE    .0,    .45,     "Tmin:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmax:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "Äàëåå"		          	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "Äàëåå"		          	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_asm_part1/shared_definitions.h	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/shared_definitions.h	Sat Dec 17 10:28:29 2011 +0100
@@ -115,12 +115,6 @@
 TAB_UCHAR (char_O_tissue_N2_saturation, NUM_COMP); // Nitrogen compartiment desaturation time, in min.
 TAB_UCHAR (char_O_tissue_He_saturation, NUM_COMP); // Helium compartiment desaturation time, in min.
 
-VAR_UINT  (int_O_DBS_bitfield);             // NOTE: 9 bytes dumped to divelog by store_dive_decodebug
-VAR_UINT  (int_O_DBS2_bitfield);
-VAR_UINT  (int_O_DBG_pre_bitfield);
-VAR_UINT  (int_O_DBG_post_bitfield);
-VAR_UCHAR (char_O_NDL_at_20mtr);
-
 TAB_UINT (int_O_gas_volumes, 5);            // Volumes evaluation for each gas tank, in 0.1 liters.
 
 TAB_UCHAR (char_O_hash, 16);
--- a/code_part1/OSTC_code_asm_part1/spanish_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -248,7 +248,7 @@
     TCODE    .0,    .36,     "Mínimo el:"                ;119 Lowest at:
     TCODE    .0,    .45,     "Tmín:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmáx:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "Más"                    	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "Más"                    	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_asm_part1/turkish_text.asm	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/turkish_text.asm	Sat Dec 17 10:28:29 2011 +0100
@@ -86,7 +86,7 @@
 #DEFINE	TXT_HE4			     "He: "                      ; "He: "                 
 #DEFINE	TXT_NX3			     "NX "                       ; "NX "                  
 #DEFINE	TXT_TX3			     "TX "                       ; "TX "                  
-#DEFINE	TXT_IN4			     " in "                      ; " in "                 
+#DEFINE	TXT_AT4			     " in "                      ; " at "
 #DEFINE	TXT_G1_3		     "G1:"                       ; "G1:"                  
 #DEFINE	TXT_G2_3		     "G2:"                       ; "G2:"                  
 #DEFINE	TXT_G3_3		     "G3:"                       ; "G3:"                  
@@ -250,7 +250,7 @@
     TCODE    .0,    .36,     "En Düsük  :"               ;119 Lowest at:
     TCODE    .0,    .45,     "Tmin:"                     ;120 Tmin:
     TCODE    .0,    .54,     "Tmax:"                     ;121 Tmax:
-    TCODE    .100,  .125,    "Daha"                    	 ;122 More (Gaslist)
+    TCODE    .100,  .124,    "Daha"                    	 ;122 More (Gaslist)
     TCODE    .100,  .25,     "O2 +"                      ;123 O2 +
     TCODE    .100,  .50,     "O2 -"                      ;124 O2 -
     TCODE    .100,  .75,     "He +"                      ;125 He +
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Sat Dec 17 10:28:29 2011 +0100
@@ -8,7 +8,7 @@
 
 //////////////////////////////////////////////////////////////////////////////
 // OSTC - diving computer code
-// Copyright (C) 2008 HeinrichsWeikamp GbR
+// Copyright (C) 2011 HeinrichsWeikamp GbR
 //
 //    This program is free software: you can redistribute it and/or modify
 //    it under the terms of the GNU General Public License as published by
@@ -80,6 +80,7 @@
 // 2011/05/17: [jDG] Various cleanups.
 // 2011/08/08: [jDG] Computes CNS during deco planning ascent.
 // 2011/11/24: [jDG] Slightly faster and better NDL computation.
+// 2011/12/17: [mH] Remove of the useless debug stuff
 //
 // TODO:
 //  + Allow to abort MD2 calculation (have to restart next time).
@@ -236,22 +237,6 @@
 
 static char	  md_state[48];		        // DONT MOVE !! // has to be at the beginning of bank 9 for the asm code!!!
 
-// internal, dbg:
-static unsigned char	DBG_char_I_deco_model;	// new in v.108.
-static unsigned char	DBG_char_I_depth_last_deco;			// new in v.108
-static unsigned char	DBG_deco_gas_change;	// new in v.108
-static unsigned char    DBG_deco_N2_ratio;		// new in v.108
-static unsigned char	DBG_deco_He_ratio;		// new in v.108
-static float			DBG_pres_surface;		// new in v.108
-static float			DBG_GF_low;				// new in v.108
-static float			DBG_GF_high;			// new in v.108
-static float			DBG_const_ppO2;			// new in v.108
-static float			DBG_float_saturation_multiplier;	// new in v.108
-static float			DBG_float_desaturation_multiplier;	// new in v.108
-static float			DBG_float_deco_distance;			// new in v.108
-static float			DBG_N2_ratio;			// new in v.108
-static float			DBG_He_ratio;			// new in v.108
-
 //////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
 ///////////////////////////// THE LOOKUP TABLES //////////////////////////////
@@ -298,177 +283,6 @@
 #pragma code p2_deco = 0x0C000
 
 //////////////////////////////////////////////////////////////////////////////
-// DBS - debug on start of dive
-//
-static void create_dbs_set_dbg_and_ndl20mtr(void)
-{
-    overlay char i;                     // Local loop index.
-
-    //---- Reset DEBUG bit fields --------------------------------------------
-	int_O_DBS_bitfield = 0;
-	int_O_DBS2_bitfield = 0;
-	if(int_O_DBG_pre_bitfield & DBG_RUN)
-		int_O_DBG_pre_bitfield = DBG_RESTART;
-	else
-		int_O_DBG_pre_bitfield = DBG_RUN;
-	int_O_DBG_post_bitfield = 0;
-	
-	//---- Set 20meters ND limit ---------------------------------------------
-	char_O_NDL_at_20mtr = 255;
-
-    //---- Copy all dive parameters ------------------------------------------
-	DBG_N2_ratio = N2_ratio;
-	DBG_He_ratio = He_ratio;
-	DBG_char_I_deco_model = char_I_deco_model;
-	DBG_char_I_depth_last_deco = char_I_depth_last_deco;
-	DBG_pres_surface = pres_surface;
-	DBG_GF_low = GF_low;
-	DBG_GF_high = GF_high;
-	DBG_const_ppO2 = const_ppO2;
-	DBG_deco_N2_ratio = char_I_deco_N2_ratio[0];
-	DBG_deco_He_ratio = char_I_deco_He_ratio[0];
-	DBG_deco_gas_change = deco_gas_change[0];
-	DBG_float_saturation_multiplier = float_saturation_multiplier;
-	DBG_float_desaturation_multiplier = float_desaturation_multiplier;
-	DBG_float_deco_distance = float_deco_distance;
-
-    //---- Setup some error (?) conditions -----------------------------------
-	if(char_I_deco_model)
-		int_O_DBS_bitfield |= DBS_mode;
-	if(const_ppO2)
-		int_O_DBS_bitfield |= DBS_ppO2;
-	for(i = 0; i < NUM_COMP; i++)
-		if(pres_tissue_He[i])
-			int_O_DBS_bitfield |= DBS_HE_sat;
-	if(float_saturation_multiplier < 0.99)
-		int_O_DBS_bitfield |= DBS_SAT2l;
-	if(float_saturation_multiplier > 1.3)
-		int_O_DBS_bitfield |= DBS_SAT2h;
-	if(GF_low < 0.19)
-		int_O_DBS_bitfield |= DBS_GFLOW2l;
-	if(GF_low > 1.01)
-		int_O_DBS_bitfield |= DBS_GFLOW2h;
-	if(GF_high < 0.6)
-		int_O_DBS_bitfield |= DBS_GFHGH2l;
-	if(GF_high > 1.01)
-		int_O_DBS_bitfield |= DBS_GFHGH2h;
-	if((N2_ratio + He_ratio) > 0.95)
-		int_O_DBS_bitfield |= DBS_GASO22l;
-	if((N2_ratio + He_ratio) < 0.05)
-		int_O_DBS_bitfield |= DBS_GASO22h;
-	if(float_deco_distance > 0.25)
-		int_O_DBS_bitfield |= DBS_DIST2h;
-	if(char_I_depth_last_deco > 8)
-		int_O_DBS_bitfield |= DBS_LAST2h;
-	if(DBG_deco_gas_change && ((char_I_deco_N2_ratio[0] + char_I_deco_He_ratio[0]) > 95))
-		int_O_DBS_bitfield |= DBS_DECOO2l;
-	if(DBG_deco_gas_change && ((char_I_deco_N2_ratio[0] + char_I_deco_He_ratio[0]) <  5))
-		int_O_DBS_bitfield |= DBS_DECOO2h;
-	if(pres_respiration > 3.0)
-		int_O_DBS2_bitfield |= DBS2_PRES2h;
-	if(pres_surface - pres_respiration > 0.2)
-		int_O_DBS2_bitfield |= DBS2_PRES2l;
-	if(pres_surface < 0.75)
-		int_O_DBS2_bitfield |= DBS2_SURF2l;
-	if(pres_surface > 1.11)
-		int_O_DBS2_bitfield |= DBS2_SURF2h;
-	if(float_desaturation_multiplier < 0.70)
-		int_O_DBS2_bitfield |= DBS2_DESAT2l;
-	if(float_desaturation_multiplier > 1.01)
-		int_O_DBS2_bitfield |= DBS2_DESAT2h;
-	if(GF_low > GF_high)
-		int_O_DBS2_bitfield |= DBS2_GFDneg;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// DBG - set DBG to end_of_dive
-//
-static void set_dbg_end_of_dive(void)
-{
-	int_O_DBG_pre_bitfield &= (~DBG_RUN);
-	int_O_DBG_post_bitfield &= (~DBG_RUN);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// DBG - NDL at first 20 m. hit
-//
-static void check_ndl(void)
-{
-	if( char_O_NDL_at_20mtr == 255      // Still in NDL mode ?
-	 && int_I_pres_respiration > 3000   // And we hit the 20m limit ?
-	)
-	{
-		char_O_NDL_at_20mtr = char_O_nullzeit;  // change to max bottom time.
-		if( char_O_NDL_at_20mtr == 255)         // and avoid confusion.
-			char_O_NDL_at_20mtr = 254;
-	}
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// DBG - multi main during dive
-//
-static void check_dbg(PARAMETER char is_post_check)
-{
-	overlay unsigned short temp_DBS = 0;
-    overlay unsigned char i;            // Local loop index.
-
-	if( (DBG_N2_ratio != N2_ratio) || (DBG_He_ratio != He_ratio) )
-		temp_DBS |= DBG_c_gas;
-	if(DBG_const_ppO2 != const_ppO2)
-		temp_DBS |= DBG_c_ppO2;
-	if( DBG_float_saturation_multiplier != float_saturation_multiplier
-     || DBG_float_desaturation_multiplier != float_desaturation_multiplier
-    )
-		temp_DBS |= DBG_CdeSAT;
-	if(DBG_char_I_deco_model != char_I_deco_model)
-		temp_DBS |= DBG_C_MODE;
-	if(DBG_pres_surface != pres_surface)
-		temp_DBS |= DBG_C_SURF;
-
-	if( !DBS_HE_sat && !He_ratio)
-		for(i = 0; i < NUM_COMP; i++)
-			if(pres_tissue_He[i])
-				temp_DBS |= DBG_HEwoHE;
-
-	if( DBG_deco_gas_change != deco_gas_change[0]
-	 || DBG_deco_N2_ratio != char_I_deco_N2_ratio[0]
-	 || DBG_deco_He_ratio != char_I_deco_He_ratio[0] )
-		temp_DBS |= DBG_C_DGAS;
-
-	if(DBG_float_deco_distance != float_deco_distance)
-		temp_DBS |= DBG_C_DIST;
-	if(DBG_char_I_depth_last_deco != char_I_depth_last_deco)
-		temp_DBS |= DBG_C_LAST;
-	if( DBG_GF_low != GF_low
-	 || DBG_GF_high != GF_high )
-		temp_DBS |= DBG_C_GF;
-	if(pres_respiration > 13.0)
-		temp_DBS |= DBG_PHIGH;
-	if(pres_surface - pres_respiration > 0.2)
-		temp_DBS |= DBG_PLOW;
-	if(is_post_check)
-		int_O_DBG_post_bitfield |= temp_DBS;
-	else
-		int_O_DBG_pre_bitfield |= temp_DBS;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// DBG - prior to calc. of dive
-//
-static void check_pre_dbg(void)
-{
-	check_dbg(0);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// DBG - after decocalc of dive
-//
-static void check_post_dbg(void)
-{
-	check_dbg(1);
-}
-
-//////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
 ///////////////////////  U T I L I T I E S   /////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
@@ -585,18 +399,6 @@
         var_He_a = *ptr++;
         var_He_b = *ptr++;
     }
-
-    // Check reading consistency:
-	if(	(var_N2_a < 0.231)
-	 || (var_N2_a > 1.27)
-	 || (var_N2_b < 0.504)
-	 || (var_N2_b > 0.966)
-	 || (var_He_a < 0.510)
-	 || (var_He_a > 1.75)
-	 || (var_He_b < 0.423)
-	 || (var_He_b > 0.927)
-    )
-        int_O_DBG_pre_bitfield |= DBG_ZH16ERR;       
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -628,15 +430,6 @@
             var_N2_e = *ptr++;
             var_He_e = *ptr++;
         }
-
-        // Check reading consistency:
-    	if(	(var_N2_e < 0.0000363)
-    	 || (var_N2_e > 0.00577)
-    	 || (var_He_e < 0.0000961)
-    	 || (var_He_e > 0.150)
-        )
-            int_O_DBG_pre_bitfield |= DBG_ZH16ERR;
-
         break;
 
     case 1: //---- 1 min -----------------------------------------------------
@@ -645,15 +438,6 @@
             var_N2_e = *ptr++;
             var_He_e = *ptr++;
         }
-
-        // Check reading consistency:
-    	if(	(var_N2_e < 1.09E-3)
-    	 || (var_N2_e > 0.1592)
-    	 || (var_He_e < 0.00288)
-    	 || (var_He_e > 0.3682)
-        )
-            int_O_DBG_pre_bitfield |= DBG_ZH16ERR;
-
         break;
 
     case 2: //---- 10 min ----------------------------------------------------
@@ -662,15 +446,6 @@
             var_N2_e = *ptr++;
             var_He_e = *ptr++;
         }
-
-        // Check reading consistency:
-    	if(	(var_N2_e < 0.01085)
-    	 || (var_N2_e > 0.82323)
-    	 || (var_He_e < 0.02846)
-    	 || (var_He_e > 0.98986)
-        )
-            int_O_DBG_pre_bitfield |= DBG_ZH16ERR;
-
         break;
 
     default:
@@ -1012,13 +787,6 @@
     calc_dive_interval();
 }
 
-//////////////////////////////////////////////////////////////////////////////
-
-void deco_debug(void)
-{
-    RESET_C_STACK
-}
-
 
 //////////////////////////////////////////////////////////////////////////////
 // Find current gas in the list (if any).
@@ -1202,11 +970,6 @@
 {
     overlay float p;
 	flag_in_divemode = 0;
-	int_O_DBS_bitfield = 0;
-	int_O_DBS2_bitfield = 0;
-	int_O_DBG_pre_bitfield = 0;
-	int_O_DBG_post_bitfield = 0;
-	char_O_NDL_at_20mtr = 255;
 
     // Kludge: the 0.0002 of 0.7902 are missing with standard air.
     N2_ratio = 0.7902;
@@ -1261,14 +1024,6 @@
 
 	calc_hauptroutine_data_input();
 
-	if(!flag_in_divemode)
-	{
-		flag_in_divemode = 1;
-		create_dbs_set_dbg_and_ndl20mtr();
-	}
-	else
-		check_pre_dbg();
-
 	calc_hauptroutine_update_tissues();
 	calc_gradient_factor();
 
@@ -1303,11 +1058,12 @@
         gas_switch_set();                       // setup calc_ratio's
 
     	calc_nullzeit();
-    	check_ndl();
-    	if( char_O_nullzeit > 0 )               // Some NDL time left ?
+    /*	if( char_O_nullzeit > 0 )               // Some NDL time left ?
        	    char_O_deco_status = 0;             // YES: recalc ndl next time.
        	else
        	    char_O_deco_status = 2;             // NO: calc ascent next time.
+	*/
+ 	    char_O_deco_status = 2;		            // calc ascent next time.
     	break;
 
     case 2: //---- Simulate ascent to first stop -----------------------------
@@ -1315,6 +1071,9 @@
         // Check proposed gas at begin of ascent simulation
         sim_dive_mins = int_I_divemins;         // Init current time.
 
+       	gas_switch_find_current();              // Lookup for current gas & time.
+        gas_switch_set();                       // setup calc_ratio's
+
         backup_gas_used  = sim_gas_last_used;   // And save for later simu steps.
         backup_gas_depth = sim_gas_last_depth;  // And save for later simu steps.
         backup_gas_delay = sim_gas_delay;
@@ -1340,7 +1099,6 @@
     	break;
 	}
 
-	check_post_dbg();
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -2172,12 +1930,6 @@
     assert( 100 <= char_I_saturation_multiplier && char_I_saturation_multiplier < 200 );
     assert( 0 < char_I_desaturation_multiplier && char_I_desaturation_multiplier <= 100 );
 
-	if(flag_in_divemode)
-	{
-		flag_in_divemode = 0;
-		set_dbg_end_of_dive();
-	}
-
     N2_ratio = 0.7902; // FIXED, sum lt. buehlmann
     pres_respiration = pres_surface = int_I_pres_surface * 0.001;
     ppN2 = N2_ratio * (pres_respiration - ppWater);
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed
--- a/code_part1/OSTC_code_c_part2/p2_definitions.h	Fri Dec 16 22:41:47 2011 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_definitions.h	Sat Dec 17 10:28:29 2011 +0100
@@ -23,6 +23,7 @@
 // history:
 // 12/25/10 v110: [jDG] split in three files (deco.c, main.c, definitions.h)
 
+/*
 #define	DBG_c_gas	0x0001
 #define	DBG_c_ppO2	0x0002
 #define	DBG_RUN 	0x0004
@@ -72,6 +73,8 @@
 #define DBS2_DESAT2h 0x0020
 #define	DBS2_GFDneg  0x0040
 
+*/
+
 #define	MBAR_REACH_GASCHANGE_AUTO_CHANGE_OFF	150
 
 // *************************
@@ -84,7 +87,7 @@
 extern void deco_calc_percentage(void);
 extern void deco_calc_wo_deco_step_1_min(void);
 extern void deco_calc_dive_interval(void);
-extern void deco_debug(void);
+//extern void deco_debug(void);
 extern void deco_gradient_array(void);
 extern void deco_hash(void);
 extern void deco_calc_desaturation_time(void);