changeset 292:ccb93f319e78

ADD (back) Gas Volumes display after decoplanning.
author jDG
date Sat, 30 May 2015 21:34:01 +0200
parents f3df4f291c90
children 6d6b3689b20b
files src/simulator.asm src/tft_outputs.inc
diffstat 2 files changed, 41 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/simulator.asm	Sat May 30 21:33:04 2015 +0200
+++ b/src/simulator.asm	Sat May 30 21:34:01 2015 +0200
@@ -711,9 +711,7 @@
         btfss   decoplan_last_ceiling_shown
         bra     deco_show_plan_1
         ; All stops shown
-        
-        return      ; mH    -  no Gas consumption (yet)
-
+        	
 ;---- In OCR mode, show the gas Usage special page ---------------------------
 simulator_show_decoplan5_0:    
     btfsc   FLAG_ccr_mode             ; =1: CCR mode (Fixed ppO2 or Sensor) active
@@ -721,6 +719,7 @@
 
     ; Make sure to pass first gas
     call    get_first_gas_to_WREG           ; Gets first gas (0-4) into WREG
+    incf    WREG,f                          ; gas 1..5
     movff   WREG,char_I_first_gas           ; Copy for compatibility
 
     ; Compute gas consumption for each tank.
@@ -731,17 +730,22 @@
     ; Clear the complete stop result column:
     WIN_BOX_BLACK   .0, .239, .85, .159		;top, bottom, left, right
 
-	movlw	d'10'
-	movwf	waitms_temp                 ; Row for gas list is .10+.25
-	clrf	wait_temp                   ; Gas counter
+    movlw	.25
+    movwf	waitms_temp                 ; Row for gas list is .25+.25
+    clrf	wait_temp                   ; Gas counter
     lfsr	FSR0,int_O_gas_volumes      ; Initialize indexed addressing.
 
-	WIN_LEFT	.90                     ; Set column
+    WIN_LEFT	.80                     ; Set column
     call    TFT_standard_color   
 
 simulator_show_decoplan5_loop:
     incf    wait_temp,F                 ; Increment gas #
     
+    STRCPY_TEXT tGas                    ; Print Gas number
+    bsf     leftbind
+    movff   wait_temp,lo
+	output_8
+    
 	movlw	.25
 	addwf	waitms_temp,F		        ; Increase row position
 	movff	waitms_temp,win_top         ; Set Row
@@ -750,19 +754,18 @@
     movff   POSTINC0,hi                 ; then high.
     movf    lo,W                        ; Null ?
     iorwf   hi,W
-;    bz      simulator_show_decoplan5_1  ; Skip printing.  mH - Test disabled
 
     movf    lo,W                        ; == 65535 (saturated ?)
     andwf   hi,W
     incf    WREG
     bnz     simulator_show_decoplan5_2
     call    TFT_attention_color
-    STRCPY_PRINT  "= xxxx.x"
+    STRCAT_PRINT  ": xxxx.x"
     call    TFT_standard_color   
     bra     simulator_show_decoplan5_1
     
 simulator_show_decoplan5_2: 
-    STRCPY  "= "
+    STRCAT  ": "
 
     bsf     leftbind
     output_16                           ; No decimal anymore.
@@ -775,20 +778,22 @@
 	cpfseq	wait_temp                   ; All gases shown?
 	bra		simulator_show_decoplan5_loop	; No
 	
-;    call	TFT_divemask_color
-;	DISPLAYTEXTH .301                   ; OCR Gas Usage:
-;    call	TFT_standard_color
+    WIN_COLOR   color_greenish
+    WIN_SMALL   .80,.25
+	STRCPY_TEXT tGasUsage
+    STRCAT_PRINT  ":"
+    call	TFT_standard_color
 
-        call    logbook_preloop_tasks
+    call    logbook_preloop_tasks
 simulator_show_decoplan5_3:
-        btfsc   switch_right
-        return                                  ; Return to simulator menu
-        btfsc   switch_left
-        return                                  ; Return to simulator menu
-        call    log_screendump_and_onesecond    ; Check if we need to make a screenshot and check for new second
-    	btfsc	sleepmode                       ; Timeout?
-        goto    restart
-        bra     simulator_show_decoplan5_3
+    btfsc   switch_right
+    return                                  ; Return to simulator menu
+    btfsc   switch_left
+    return                                  ; Return to simulator menu
+    call    log_screendump_and_onesecond    ; Check if we need to make a screenshot and check for new second
+    btfsc	sleepmode                       ; Timeout?
+    goto    restart
+    bra     simulator_show_decoplan5_3
 
 ;=============================================================================
 ;
--- a/src/tft_outputs.inc	Sat May 30 21:33:04 2015 +0200
+++ b/src/tft_outputs.inc	Sat May 30 21:34:01 2015 +0200
@@ -106,16 +106,17 @@
     extern  TFT_warning_fallback                ; Show fallback warning
 
 ; Misc
-	extern	TFT_standard_color
-    extern  TFT_disabled_color
-    extern  TFT_attention_color
-    extern  TFT_warnings_color
-	extern	adjust_depth_with_salinity          ; computes salinity setting into lo:hi [mbar]
-    extern  adjust_depth_with_salinity_log      ; computes salinity setting (FROM WREG!) into lo:hi [mbar]
-	extern	TFT_convert_date_short
-	extern	TFT_convert_signed_16bit
-	extern	TFT_convert_date
-	extern	TFT_debug_output
-	extern	TFT_show_time_date_menu
-	extern	convert_mbar_to_feet   			; convert value in lo:hi from mbar to feet
-	extern	convert_celsius_to_fahrenheit	; convert value in lo:hi from celsius to fahrenheit
\ No newline at end of file
+    extern	TFT_standard_color
+    extern	TFT_disabled_color
+    extern	TFT_attention_color
+    extern	TFT_warnings_color
+    extern      TFT_divemask_color
+    extern	adjust_depth_with_salinity          ; computes salinity setting into lo:hi [mbar]
+    extern	adjust_depth_with_salinity_log      ; computes salinity setting (FROM WREG!) into lo:hi [mbar]
+    extern	TFT_convert_date_short
+    extern	TFT_convert_signed_16bit
+    extern	TFT_convert_date
+    extern	TFT_debug_output
+    extern	TFT_show_time_date_menu
+    extern	convert_mbar_to_feet   			; convert value in lo:hi from mbar to feet
+    extern	convert_celsius_to_fahrenheit	; convert value in lo:hi from celsius to fahrenheit
\ No newline at end of file