changeset 592:cda5b45b953f

NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
author heinrichsweikamp
date Mon, 28 May 2012 17:54:43 +0200
parents 2966548fbe70
children 46e9ccd0eca7
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/customview.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.asm code_part1/OSTC_code_asm_part1/menu_logbook.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/simulator.asm code_part1/OSTC_code_asm_part1/spanish_text.asm code_part1/OSTC_code_asm_part1/start.asm code_part1/OSTC_code_asm_part1/turkish_text.asm docu/ostc_interface_description.odt
diffstat 15 files changed, 266 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Mon May 28 17:54:43 2012 +0200
@@ -1,6 +1,7 @@
 New in 2.23:
 BETA Version - Do NOT use for diving!
 NEW: CF64: Configures color for inactive gases
+NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
 
 New in 2.22:
 BETA Version - Do NOT use for diving!
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Mon May 28 17:54:43 2012 +0200
@@ -405,6 +405,9 @@
 	call	PLED_show_cf32_cf33_cf29			; =4 (L16-GF OC)
 	dcfsnz	temp10,F
 	call	PLED_show_cf32_cf33_cf29			; =5 (L16-GF CC)
+	dcfsnz	temp10,F
+	call	PLED_show_cf32_cf33_cf62_cf63		; =6 (pSCR-GF)
+
 	bra		surfcustomview_toggle_exit	
 
 surfcustomview_toggle_exit:
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Mon May 28 17:54:43 2012 +0200
@@ -279,6 +279,17 @@
     clrf    WREG
     movff   WREG,char_I_step_is_1min    ; Make sure to be in 2sec mode.
 
+	read_int_eeprom d'34'				; Read deco data
+	movlw		.6	
+	cpfseq		EEDATA
+	bra			calc_deko_divemode1a
+	; in PSCR mode
+	call		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
+;    tstfsz      sub_c+1                 ; Is ppO2 > 2.55bar ?
+;    setf        sub_c+0                 ; yes: bound to 2.55... better than wrap around.
+    movff		sub_c+0,char_I_actual_ppO2	; copy last ppO2 to buffer register
+
+calc_deko_divemode1a:
 	call	deco_calc_CNS_fraction		; calculate CNS
 	movlb	b'00000001'					; rambank 1 selected
 
@@ -372,7 +383,7 @@
 ;-----------------------------------------------------------------------------
 ; calculate ppO2 in 0.01bar (e.g. 150 = 1.50 bar ppO2)
 set_actual_ppo2:
-    SAFE_2BYTE_COPY amb_pressure, xA    ; P_amb in milibar (1000 = 1.000 bar).
+    SAFE_2BYTE_COPY amb_pressure, xA    ; P_amb in millibar (1000 = 1.00 bar).
 	movlw		d'10'
 	movwf		xB+0
 	clrf		xB+1
@@ -426,14 +437,48 @@
 	clrf	WREG
 	movff	WREG,char_I_step_is_1min    ; Force 2 second deco mode
 
+	movff	char_I_O2_ratio,lo_temp		; Backup original value for everything
+	movff	char_I_N2_ratio,hi_temp		; Backup original value for everything
+
+	read_int_eeprom d'34'				; Read deco data
+	movlw		.6	
+	cpfseq		EEDATA
+	bra			calc_deko_divemode2a
+	; in PSCR mode, compute fO2 into char_I_O2_ratio
+	call		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
+	movff		sub_c+0,xA+0
+	movff		sub_c+1,xA+1
+	movlw		LOW		.10
+	movwf		xB+0
+	movlw		HIGH	.10
+	movwf		xB+1
+	call		mult16x16		;xA*xB=xC	-> xC:4 = ppO2*10
+	SAFE_2BYTE_COPY amb_pressure, xB
+	call		div32x16	 	; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
+	; xC+0 has O2 in percent
+	movff	xC+0,char_I_O2_ratio
+
+	movff	char_I_He_ratio, wait_temp	; copy into bank1 register
+	bsf		STATUS,C					; Borrow bit
+	movlw	d'100'						; 100%
+	subfwb	wait_temp,W					; minus He
+	bsf		STATUS,C					; Borrow bit
+	subfwb	xC+0,W						; minus O2
+	movff	WREG, char_I_N2_ratio		; = N2!
+	
+calc_deko_divemode2a:
+
 	clrf	TMR3L
 	nop									; See errata DS80284E-page 2
 	clrf	TMR3H						; Reset Timer3
 
 	call	deco_calc_hauptroutine		; calc_tissue
-	movlb	b'00000001'						; rambank 1 selected
+	movlb	b'00000001'					; rambank 1 selected
 	ostc_debug	'C'		; Sends debug-information to screen if debugmode active
 
+	movff	lo_temp,char_I_O2_ratio		; Restore original value for everything
+	movff	hi_temp,char_I_N2_ratio		; Restore original value for everything
+
 	btfss	debug_mode				; Are we in debugmode?
 	bra		calc_deko_divemode4		; No...
 
@@ -826,6 +871,19 @@
 	return
 
 check_ppO2_bail:						; In CC mode but bailout active!
+	read_int_eeprom d'34'				; Read deco data
+	movlw		.6	
+	cpfseq		EEDATA
+	bra			check_ppO2_non_pscr
+	; in PSCR mode
+	call		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
+	movff		sub_c+0,xC+0
+	movff		sub_c+1,xC+1			; copy for comptibility
+	clrf		xC+2
+	clrf		xC+3
+	bra			check_ppO2_check
+
+check_ppO2_non_pscr:
     SAFE_2BYTE_COPY amb_pressure, xA
 	movlw		d'10'
 	movwf		xB+0
@@ -835,8 +893,9 @@
 	movff		xC+1,xA+1
 	movff		char_I_O2_ratio,xB+0
 	clrf		xB+1
-	call		mult16x16				; char_I_O2_ratio * p_amb/10
-
+	call		mult16x16				; char_I_O2_ratio * p_amb/10 -> xC:4
+;	bra			check_ppO2_check
+check_ppO2_check:
 ; Check very high ppO2 manually
 	tstfsz		xC+2					; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar?
 	bra			check_ppO2_bail2		; Yes, display Value!
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -117,7 +117,8 @@
 #DEFINE	TXT_DIL4			 "Dil:"                      ; "Dil:"  
 #DEFINE	TXT_N2_2			 "N2"                        ; "N2"    
 #DEFINE	TXT_HE2				 "He"                        ; "He"    
-                                                                         
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
 #ENDIF                                                                   
 ;=============================================================================
 ;   macro     X     Y        "translation"               ; English original
@@ -360,7 +361,7 @@
     TCODE    .40,   .35,     "unused         "           ;224 unused
 ;
     TCODE    .7,    .2,      "Custom Functions III"      ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -516,14 +517,14 @@
     TCODE    .0,    .155,    "_hi). Check CF32 &"       ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "CF33!Closed Circuit"      ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "with Deep Stops."       	;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Decotype: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "For passive semi-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "closed rebreather."    	;358 closed rebreather.
+    TCODE    .0,    .125,    "Check CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "for gradient factors"    	;360 for gradient factors
+    TCODE    .0,    .185,    "and CF61-CF63 for"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR features."    		;362 pSCR features.
 ;
 
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/french_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/french_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -118,6 +118,8 @@
 #DEFINE	TXT_DIL4			 "Dil:"                      ; "Dil:"  
 #DEFINE	TXT_N2_2			 "N2"                        ; "N2"    
 #DEFINE	TXT_HE2				 "He"                        ; "He"    
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
                                                                          
 #ENDIF                                                                   
 ;=============================================================================
@@ -361,7 +363,7 @@
     TCODE    .40,   .35,     "unused         "           ;224 unused
 ;
 	TCODE    .7,    .2,      "Config Fonctions III"      ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -517,14 +519,14 @@
     TCODE    .0,    .155,    "Vérifiez CF32 & CF33 !"    ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "Pour   Circuit   Fermé"    ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "avec paliers profonds."    ;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Decotype: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "For passive semi-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "closed rebreather."    	;358 closed rebreather.
+    TCODE    .0,    .125,    "Check CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "for gradient factors"    	;360 for gradient factors
+    TCODE    .0,    .185,    "and CF61-CF63 for"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR features."    		;362 pSCR features.
 ;
 
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/german_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/german_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -117,6 +117,8 @@
 #DEFINE	TXT_DIL4			 "Dil:"                      ; "Dil:"  
 #DEFINE	TXT_N2_2			 "N2"                        ; "N2"    
 #DEFINE	TXT_HE2				 "He"                        ; "He"    
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
                                                                          
 #ENDIF                                                                   
 ;=============================================================================
@@ -360,7 +362,7 @@
     TCODE    .40,   .35,     "unbenutzt      "           ;224 unused
 ;
     TCODE    .7,    .2,      "Custom Funktionen III"     ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -515,15 +517,14 @@
     TCODE    .0,    .155,    "die CF32 & CF33 Werte!"    ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "Für geschlossene Sys-"     ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "teme mit Tiefenstopps."    ;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
-
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Dekomodell: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "Für passive halb-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "geschlossene Kreisel."   	;358 closed rebreather.
+    TCODE    .0,    .125,    "Prüfe CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "für Gradienten Faktoren" 	;360 for gradient factors
+    TCODE    .0,    .185,    "und CF61-CF63 für"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR Parameter."    		;362 pSCR features.
 ;
 
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/menu.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu.asm	Mon May 28 17:54:43 2012 +0200
@@ -202,7 +202,7 @@
 	incf	EEDATA,F
 	
 toggle_decotype0:	
-	movlw	d'6'						; number of different modes
+	movlw	d'7'						; number of different modes
 	cpfseq	EEDATA
 	bra		toggle_decotype1
 	clrf	EEDATA
@@ -242,8 +242,13 @@
 	return
 show_decotype6:
 	decfsz	EEDATA,F
+	bra		show_decotype7
+	DISPLAYTEXT	.236			; L16-GF CC	=5
 	return
-	DISPLAYTEXT	.236			; L16-GF CC	=5
+show_decotype7:
+	decfsz	EEDATA,F
+	return
+	DISPLAYTEXT	.226			; pSCR-GF =6
 	return
 
 exit_setup_menu:
@@ -261,7 +266,7 @@
 	read_int_eeprom d'34'		; Read deco data
 
 	movlw	d'7'						; length of description text
-	mulwf	EEDATA						; Multiply with Decomode 0-5 (5=Spare)	
+	mulwf	EEDATA						; Multiply with Decomode 0-6
 	
 	movf	PRODL,W
 	addlw	.314-.256					; Description text offset
--- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Mon May 28 17:54:43 2012 +0200
@@ -1104,6 +1104,8 @@
 	movlw		d'152'						; Textnumber
 	dcfsnz		lo,F						; L16-GF CC?
 	movlw		d'236'						; Textnumber
+	dcfsnz		lo,F						; pSCR-GF?
+	movlw		d'226'						; Textnumber
 	call		displaytext0_low			; Outputs to POSTINC2
 	call		word_processor
 
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Mon May 28 17:54:43 2012 +0200
@@ -859,6 +859,44 @@
 	bcf		leftbind
 	return
 
+PLED_show_cf32_cf33_cf62_cf63:	; Display GF_LOW, GF_HIGH, pSCR ratio and drop in the customview field
+	WIN_TOP		.25
+	WIN_LEFT	.90
+	WIN_FONT 	FT_SMALL
+	WIN_INVERT	.0					; Init new Wordprocessor
+	call	PLED_standard_color
+	GETCUSTOM8	d'32'				; GF_lo
+	movwf	lo
+    STRCPY  TXT_GFLO6
+	bsf		leftbind
+	output_8
+	STRCAT_PRINT  "%"
+
+	WIN_TOP		.50
+	GETCUSTOM8	d'33'				; GF_hi
+	movwf	lo
+    STRCPY  TXT_GFHI6
+	bsf		leftbind
+	output_8
+	STRCAT_PRINT  "%"
+
+	WIN_TOP		.75
+	lfsr        FSR2,letter
+	GETCUSTOM8  d'62'		; O2 Drop in percent
+	movwf		lo
+	bsf			leftbind
+	output_8
+
+	STRCAT		 "% 1/"
+	GETCUSTOM8  d'63'		; Counter lung ratio in 1/X
+	movwf		lo
+	output_8
+	bcf			leftbind
+    STRCAT_PRINT ""
+	return
+
+
+
 PLED_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field
 	WIN_TOP		.25
 	WIN_LEFT	.90
@@ -1040,12 +1078,6 @@
 	return
 
 PLED_show_ppO2:					; Show ppO2 (ppO2 stored in xC)
- 	GETCUSTOM8	d'61'					; Show pSCR ppO2?
-	decfsz		WREG,F					; WREG=1?	
-	bra			PLED_show_ppO2a			; No
-	return								; Do not display ppO2 in pSCR Mode
-
-PLED_show_ppO2a:
 	ostc_debug	't'		; Sends debug-information to screen if debugmode active
 	WIN_TOP		.117
 	WIN_LEFT	.0
@@ -1197,7 +1229,8 @@
 	tstfsz	EEDATA
 	bra		show_decotype_surface2
 
-;ZH-L16
+	;EEDATA=0
+	;ZH-L16-OC
 	WIN_TOP		.125
     STRCPY_PRINT TXT_OC_O1
 
@@ -1209,14 +1242,16 @@
 	decf	EEDATA,F
 	tstfsz	EEDATA
 	bra		show_decotype_surface3
-; Gauge
+	;EEDATA=1
+	;Gauge
 	return
 	
 show_decotype_surface3:
     decf	EEDATA,F
     tstfsz	EEDATA
     bra	show_decotype_surface4
-    ; const. ppO2
+	;EEDATA=2
+	;ZH-L16-CC
     WIN_TOP		.125
     call	PLED_standard_color
     
@@ -1234,15 +1269,18 @@
 	decf	EEDATA,F
 	tstfsz	EEDATA
 	bra		show_decotype_surface5
-; Apnoe
+	;EEDATA=3
+	;Apnoe
 	return
 
 show_decotype_surface5:
-show_decotype_surface6:
     decf	EEDATA,F
     tstfsz	EEDATA
     bra		show_decotype_surface6
-    ; Multi-GF OC
+	;EEDATA=4
+show_decotype_surface5_2:
+	;EEDATA=5
+    ;ZH16-GF OC or ZH16-GF CC
     WIN_TOP		.125
     STRCPY_PRINT TXT_GF_G1
     
@@ -1250,6 +1288,22 @@
     STRCPY_PRINT TXT_GF_F1
     return
 
+show_decotype_surface6:
+    decf	EEDATA,F
+    tstfsz	EEDATA
+    bra		show_decotype_surface7
+	bra		show_decotype_surface5_2
+show_decotype_surface7:
+	;EEDATA=6:
+   	;pSCR-GF  
+    WIN_TOP		.125
+    STRCPY_PRINT TXT_PSCR_P1
+    
+    WIN_TOP		.150
+    STRCPY_PRINT TXT_PSCR_S1
+    return
+
+
 ;-----------------------------------------------------------------------------
 ; Set color to grey when gas is inactive
 ; Inputs: WREG : gas# (0..4)
@@ -3376,17 +3430,9 @@
     return
 
 ;=============================================================================
-; Display pSCR ppO2
-; (Pressure[mbar]*char_I_O2_ratio)-(100-char_I_O2_ratio)*CF61*CF62*10
-PLED_show_pSCR_ppO2:
-	WIN_FONT    FT_SMALL
-    WIN_LEFT    .160-.63                ; 9 chars aligned right.
-    WIN_TOP     .170
-	call		PLED_divemask_color     ; Set Color for Divemode mask
-    lfsr        FSR2,letter
-    OUTPUTTEXTH .266                    ; "pSCR Info"
-    call        word_processor			; pCCR
-
+
+compute_pscr_ppo2:
+; (Pressure[mbar]*char_I_O2_ratio)-(100-char_I_O2_ratio)*CF61*CF62*10	
 	movff	char_I_O2_ratio,WREG
 	sublw	.100			; 100-char_I_O2_ratio -> WREG
 	mullw	.10				; (100-char_I_O2_ratio)*10 -> PROD:2
@@ -3429,6 +3475,19 @@
 	movff	hi,sub_b+1
 
 	call	subU16		;sub_c = sub_a - sub_b (with UNSIGNED values)
+	return
+
+; Display pSCR ppO2
+PLED_show_pSCR_ppO2:
+	WIN_FONT    FT_SMALL
+    WIN_LEFT    .160-.63                ; 9 chars aligned right.
+    WIN_TOP     .170
+	call		PLED_divemask_color     ; Set Color for Divemode mask
+    lfsr        FSR2,letter
+    OUTPUTTEXTH .266                    ; "pSCR Info"
+    call        word_processor			; pCCR
+
+	rcall		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
 
 	WIN_FONT	FT_SMALL
 	WIN_LEFT	.95
--- a/code_part1/OSTC_code_asm_part1/russian_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/russian_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -120,6 +120,8 @@
 #DEFINE	TXT_DIL4			 "Äèë:"                      ; "Dil:"  
 #DEFINE	TXT_N2_2			 "N2"                        ; "N2"    
 #DEFINE	TXT_HE2				 "He"                        ; "He"    
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
 
 #ENDIF
 ;=============================================================================
@@ -363,7 +365,7 @@
     TCODE    .40,   .35,     "unused         "           ;224 unused
 ;
 	TCODE    .12,   .2,      "Äîï. Ïàðàìåòðû III"        ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -517,14 +519,15 @@
     TCODE    .0,    .155,    "âðõ). Óòî÷í. ÄÏ32 &"       ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "ÄÏ33!Çàêðûòûé öèêë,"       ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "ãëóáîêèå îñòàíîâêè."       ;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Decotype: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "For passive semi-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "closed rebreather."    	;358 closed rebreather.
+    TCODE    .0,    .125,    "Check CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "for gradient factors"    	;360 for gradient factors
+    TCODE    .0,    .185,    "and CF61-CF63 for"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR features."    		;362 pSCR features.
+
 ;
 
 ;=============================================================================
\ No newline at end of file
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Mon May 28 17:54:43 2012 +0200
@@ -385,6 +385,30 @@
 	call    set_first_gas               ; Set current N2/He/O2 ratios.
     call    set_actual_ppo2             ; Then configure char_I_actual_ppO2
 
+	read_int_eeprom d'34'				; Read deco data
+	movlw		.6	
+	cpfseq		EEDATA
+	bra			simulator_calc_deco1
+	; in PSCR mode, compute fO2 into char_I_O2_ratio
+	call		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
+	movff		sub_c+0,xA+0
+	movff		sub_c+1,xA+1
+	movlw		LOW		.10
+	movwf		xB+0
+	movlw		HIGH	.10
+	movwf		xB+1
+	call		mult16x16		;xA*xB=xC	-> xC:4 = ppO2*1000
+
+    tstfsz      xA+1                    	; Is ppO2 > 2.55bar ?
+    setf        xA+0                    	; yes: bound to 2.55... better than wrap around.
+    movff		xA+0, char_I_actual_ppO2	; copy last ppO2 to buffer register
+
+	SAFE_2BYTE_COPY amb_pressure, xB
+	call		div32x16	 	; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
+	; xC+0 has O2 in percent
+	movff	xC+0,char_I_O2_ratio
+
+simulator_calc_deco1:
     ; First minute is special: init everything.
 	movlw	d'3'                        ; Begin of deco cycle (reset table).
 	movff	WREG,char_O_deco_status     ; Reset Deco module.
--- a/code_part1/OSTC_code_asm_part1/spanish_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -116,6 +116,8 @@
 #DEFINE	TXT_DIL4			 "Dil:"                      ; "Dil:"  
 #DEFINE	TXT_N2_2			 "N2"                        ; "N2"    
 #DEFINE	TXT_HE2				 "He"                        ; "He"    
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
                                                                          
 #ENDIF                                                                   
 ;=============================================================================
@@ -359,7 +361,7 @@
     TCODE    .40,   .35,     "unused         "           ;224 unused
 ;
 	TCODE    .7,    .2,      "Func.Personaliz. III"      ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -514,14 +516,15 @@
     TCODE    .0,    .155,    "¡Mirar CF32 & CF33!"       ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "CircuitoCerrado con"       ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "Paradas Profundas. "       ;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Decotype: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "For passive semi-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "closed rebreather."    	;358 closed rebreather.
+    TCODE    .0,    .125,    "Check CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "for gradient factors"    	;360 for gradient factors
+    TCODE    .0,    .185,    "and CF61-CF63 for"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR features."    		;362 pSCR features.
+
 ;
 
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/start.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Mon May 28 17:54:43 2012 +0200
@@ -342,7 +342,7 @@
 restart_5_test_gfO2_mode:
 	movlw	d'5'					    ; GF CC mode
 	cpfseq	EEDATA
-	return							    ; Start in Surfacemode
+	bra		restart_5_test_pSCR_mode    ; check for pSCR-GF
 	bsf		FLAG_const_ppO2_mode	    ; Set flag for ppO2 mode
 	movlw	d'1'
 	movff	WREG,char_I_deco_model	    ; Set Flagbyte for GF method
@@ -353,6 +353,20 @@
 	movff		EEDATA,char_I_GF_High_percentage
 	return							    ; start in Surfacemode
 
+restart_5_test_pSCR_mode:
+	movlw	d'6'					    ; pSCR-GF
+	cpfseq	EEDATA
+	return							    ; start in Surfacemode
+	bcf		FLAG_const_ppO2_mode	    ; Clear flag for ppO2 mode
+	movlw	d'1'
+	movff	WREG,char_I_deco_model	    ; Set Flagbyte for GF method
+	; Load GF values into RAM
+	GETCUSTOM8	d'32'                   ; GF low
+	movff		EEDATA,char_I_GF_Low_percentage
+	GETCUSTOM8	d'33'                   ; GF high
+	movff		EEDATA,char_I_GF_High_percentage
+	return							    ; start in Surfacemode
+
 ;=============================================================================
 
 startup_screen1:
--- a/code_part1/OSTC_code_asm_part1/turkish_text.asm	Mon May 28 09:08:43 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/turkish_text.asm	Mon May 28 17:54:43 2012 +0200
@@ -117,6 +117,8 @@
 #DEFINE	TXT_DIL4		     "Dil:"                      ; "Dil:"
 #DEFINE	TXT_N2_2		     "N2"                        ; "N2"
 #DEFINE	TXT_HE2			     "He"                        ; "He"
+#DEFINE	TXT_PSCR_P1			 "p"                         ; "P"
+#DEFINE	TXT_PSCR_S1			 "S"                         ; "S"
                                                                          
 #ENDIF                                                                   
 ;=============================================================================
@@ -362,7 +364,7 @@
     TCODE    .40,   .35,     "unused         "           ;224 unused
 ;
     TCODE    .7,    .2,      "Ozel Fonksiyonlar III"     ;225 Custom Functions III
-    TCODE    .0,    .0,      ""		                   	 ;226 unused
+    TCODE    .85,   .125,    "pSCR-GF  "                 ;226 pSCR-GF
     TCODE    .0,    .0,      ""		                     ;227 unused
     TCODE    .0,    .0,      ""     	                 ;228 unused
     TCODE    .0,    .0,      ""		                   	 ;229 unused
@@ -517,15 +519,14 @@
     TCODE    .0,    .155,    "CF32 & CF33 nolu fonksi"   ;353 _hi). Check CF32 &
     TCODE    .0,    .185,    "yonlari kontrol ediniz."   ;354 CF33!Closed Circuit
     TCODE    .0,    .215,    "                       "   ;355 with Deep Stops.
-; Spare (PSCR?)
-    TCODE    .0,    .35,     ""     ;356
-    TCODE    .0,    .65,     ""     ;357
-    TCODE    .0,    .95,     ""    	;358
-    TCODE    .0,    .125,    ""     ;359
-    TCODE    .0,    .155,    ""    	;360
-    TCODE    .0,    .185,    ""     ;361
-    TCODE    .0,    .215,    ""    	;362
-
+; pSCR-GF mode description
+    TCODE    .0,    .35,     "Decotype: pSCR-GF"     	;356 Decotype: pSCR-GF
+    TCODE    .0,    .65,     "For passive semi-"     	;357 For passive semi-
+    TCODE    .0,    .95,     "closed rebreather."    	;358 closed rebreather.
+    TCODE    .0,    .125,    "Check CF32 & CF33"     	;359 Check CF32 & CF33
+    TCODE    .0,    .155,    "for gradient factors"    	;360 for gradient factors
+    TCODE    .0,    .185,    "and CF61-CF63 for"     	;361 and CF61-CF63 for
+    TCODE    .0,    .215,    "pSCR features."    		;362 pSCR features.
 ;
 
 
Binary file docu/ostc_interface_description.odt has changed