changeset 323:b7940978edc9

Fix "Future TTS" display customview. * Display "---" during wait. * Display ascent when there is no stops.
author JeanDo
date Sat, 07 May 2011 00:52:20 +0200
parents 676d18bce8d7
children a86c9d1219ce
files code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_c_part2/p2_deco.c code_part1/OSTC_code_c_part2/p2_deco.o
diffstat 5 files changed, 44 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Sat May 07 00:08:08 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Sat May 07 00:52:20 2011 +0200
@@ -242,7 +242,7 @@
 	btfsc		no_deco_customviews		; no-deco-mode-flag = 1
 	bra			customview_toggle		; Yes, use next Customview!
 
-    clrf        WREG                    ; Reset extra TTS
+    setf        WREG                    ; WAIT marker: display "---"
     movff       WREG,int_O_extra_ascenttime+0
     movff       WREG,int_O_extra_ascenttime+1
     
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sat May 07 00:08:08 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat May 07 00:52:20 2011 +0200
@@ -520,18 +520,8 @@
 	movff	char_O_nullzeit,decodata+1  ; nostop time
 	
 	call	PLED_display_ndl            ; display no deco limit
-	return
 
-calc_deko_divemode3:
-	btfss	dekostop_active             ; Already in deco mode ?
-	call	PLED_display_deko_mask      ; clear nostop time, display decodata
-	bsf		dekostop_active             ; Set flag
-
-	movff	char_O_first_deco_depth,decodata+0	; ceiling
-	movff	char_O_first_deco_time,decodata+1	; length of first stop in minues
-
-	call	PLED_display_deko           ; display decodata
-
+calc_deko_divemode5:
     ; Check if extra cycles are needed to compute @5 variant:
     btfss   tts_extra_time              ; Is @5 displayed ?
 	return                              ; No: don't compute it.
@@ -545,6 +535,17 @@
     movlw   .2                          ; Restart countdown.
     movwf   apnoe_mins
     return
+
+calc_deko_divemode3:
+	btfss	dekostop_active             ; Already in deco mode ?
+	call	PLED_display_deko_mask      ; clear nostop time, display decodata
+	bsf		dekostop_active             ; Set flag
+
+	movff	char_O_first_deco_depth,decodata+0	; ceiling
+	movff	char_O_first_deco_time,decodata+1	; length of first stop in minues
+
+	call	PLED_display_deko           ; display decodata
+    bra     calc_deko_divemode5
     
 ;-----------------------------------------------------------------------------
 
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat May 07 00:08:08 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat May 07 00:52:20 2011 +0200
@@ -3131,13 +3131,13 @@
 ; Display TTS after extra time at the same depth.
 ;
 PLED_show_@5:
-	call		PLED_divemask_color     ; Set Color for Divemode mask
-
 	WIN_FONT    FT_SMALL
     WIN_LEFT    .160-.70                ; 10 chars aligned right.
     WIN_TOP     .170
+	call		PLED_divemask_color     ; Set Color for Divemode mask
     lfsr        FSR2,letter
-    OUTPUTTEXTH .305                    ; "TTS in ..."
+
+    OUTPUTTEXTH .305                    ; "Future TTS"
     call        word_processor
 
     WIN_LEFT	.97
@@ -3148,25 +3148,31 @@
 	bsf         leftbind
 	output_8
 	bcf         leftbind
-	STRCAT_PRINT "':"
+	STRCAT_PRINT "': "
     
-	WIN_LEFT    .97+7*5                ; "@10':" is 5 chars long
+	WIN_LEFT    .97+7*5                 ; "@10':" is 5 chars long
 	call        PLED_standard_color 
-	
 	lfsr        FSR2,letter
+
 	movff       int_O_extra_ascenttime+0,lo
     movff       int_O_extra_ascenttime+1,hi
     movf        lo,W
-	iorwf       hi,W
+	iorwf       hi,W                    ; extra_ascenttime == 0 ?
+	bz          PLED_show_@5_nodeco
+	movf        lo,W                    ; extra_ascenttime == 0xFFFF ?
+	andwf       hi,W
+	incf        WREG,w
 	bz          PLED_show_@5_wait
+
 	bsf         leftbind
 	output_16
 	bcf         leftbind
-	STRCAT_PRINT "'  "                  ; From "999'" to "1'  " we need 2 trailing spaces
+	STRCAT_PRINT "'  "                  ; From "none" to "1'" we need 2 trailing spaces
 	return
 
+PLED_show_@5_nodeco:
 PLED_show_@5_wait:
-    STRCPY_PRINT "xx' "
+    STRCPY_PRINT "--- "
     return
 
 ;=============================================================================
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Sat May 07 00:08:08 2011 +0200
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Sat May 07 00:52:20 2011 +0200
@@ -1247,6 +1247,7 @@
     	clear_deco_table();
     	copy_deco_table();
     	int_O_ascenttime = 0;       // Reset DTR.
+    	int_O_extra_ascenttime = 0;
     	char_O_nullzeit = 0;        // Reset bottom time.
         char_O_deco_status = 0;     // Calc bottom-time/nullzeit next iteration.
 
@@ -1501,7 +1502,7 @@
 
                     calc_ascenttime();
                     char_O_deco_status = 0;     // calc nullzeit next time.
-                    char_O_deco_last_stop = 0;  // Surface reached.
+                    char_O_deco_last_stop = 0;  // Surface reached (to animate menu)
     		        return;
                 }
             }
@@ -1741,27 +1742,22 @@
 // Result in int_O_ascenttime, or int_O_extra_ascenttime if in @+5min variant.
 static void calc_ascenttime(void)
 {
-    if( pres_respiration > pres_surface )
-    {
-        overlay unsigned char x;
-        overlay unsigned short sum;
-
-        // + 0.7 to count 1 minute ascent time from 3 metre to surface
-        overlay float ascent = pres_respiration - pres_surface + 0.7; 
-        if (ascent < 0.0)
-            ascent = 0.0;
-        sum = (unsigned short)(ascent + 0.99);
+    overlay unsigned char x;
+    overlay unsigned short sum;
 
-        for(x=0; x<32 && internal_deco_depth[x]; x++)
-            sum += (unsigned short)internal_deco_time[x];
+    // + 0.7 to count 1 minute ascent time from 3 metre to surface
+    overlay float ascent = pres_respiration - pres_surface + 0.7; 
+    if (ascent < 0.0)
+        ascent = 0.0;
+    sum = (unsigned short)(ascent + 0.99);
 
-        if( char_O_deco_status == 1 )
-            int_O_ascenttime = sum;
-        else
-            int_O_extra_ascenttime = sum;
-    }
+    for(x=0; x<32 && internal_deco_depth[x]; x++)
+        sum += (unsigned short)internal_deco_time[x];
+
+    if( char_O_deco_status == 1 )
+        int_O_ascenttime = sum;
     else
-        int_O_ascenttime = 0;
+        int_O_extra_ascenttime = sum;
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -2161,6 +2157,7 @@
     char_O_deco_status = 3;     // surface new in v.102 : stays in surface state.
     char_O_nullzeit = 0;
     int_O_ascenttime = 0;
+    int_O_extra_ascenttime = 0;
     calc_gradient_factor();
 }
 
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed