changeset 309:efb53af0d62a new_screen_layout

VSIbar #1: layout position changes
author janos_kovacs <kovjanos@gmail.com>
date Sun, 07 Jun 2015 22:07:55 +0200
parents 14719662fb95
children 453a3d13570f
files src/divemode.inc src/tft_outputs.asm
diffstat 2 files changed, 54 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/divemode.inc	Tue Jun 02 23:38:21 2015 +0100
+++ b/src/divemode.inc	Sun Jun 07 22:07:55 2015 +0200
@@ -45,7 +45,7 @@
 #DEFINE    dm_depth_row           dm_offset              ; TOP  - 14 - start position of the detph numbers
 #DEFINE    dm_depth_column        .0                     ; LEFT - 0
 #DEFINE    dm_depth_bot           dm_depth_row+.61       ; 75
-#DEFINE    dm_depth_rgt           dm_depth_column+.61    ; 61
+#DEFINE    dm_depth_rgt           dm_depth_column+.59    ; 59
 #DEFINE    dm_depth_dm_row        dm_depth_row+.25       ; 39 - if metric and d<100, decimeter shown as: ".5"
 #DEFINE    dm_depth_dm_column     dm_depth_column+.40    ; 40 - bottom aligned so it has its own position (2nd content line only)
 ; Ascend rate
@@ -53,31 +53,37 @@
 #DEFINE    dm_velocity_text_column     dm_depth_column              ; 0
 #DEFINE    dm_velocity_text_bot        dm_velocity_text_row+.23     ; 99
 #DEFINE    dm_velocity_text_rgt        dm_depth_rgt                 ; 61
+; Ascend/Descend bar
+#DEFINE    dm_velobar_top          dm_offset           ; 14
+#DEFINE    dm_velobar_lft          dm_depth_rgt+.1     ; 62
+#DEFINE    dm_velobar_bot          dm_offset+.85       ; 99
+#DEFINE    dm_velobar_rgt          .73                 ; 73
 
 ;******* Upper content / content row / 2nd col *******
+#DEFINE    dm_upcnt_2ndcol            .74                       ; 74
 ; Max depth
 #DEFINE    dm_max_depth_row           dm_offset                 ; 14
-#DEFINE    dm_max_depth_column        .64                       ; 64
+#DEFINE    dm_max_depth_column        dm_upcnt_2ndcol           ; 74
 #DEFINE    dm_max_depth_bot           dm_max_depth_row+.34      ; 48
 #DEFINE    dm_max_depth_rgt           dm_max_depth_column+.36   ; 100
 #DEFINE    dm_max_depth_dm_row        dm_max_depth_row+.11      ; 25
 #DEFINE    dm_max_depth_dm_column     dm_max_depth_column+.23   ; 87
 ; Warning area (combined)
 #DEFINE    dm_warning_row             dm_offset+.36             ; 50
-#DEFINE    dm_warning_column          .64                       ; 64
+#DEFINE    dm_warning_column          dm_upcnt_2ndcol           ; 74
 #DEFINE    dm_warning_bot             dm_warning_row+.49        ; 99
-#DEFINE    dm_warning_rgt             dm_warning_column+.68     ; 130
+#DEFINE    dm_warning_rgt             dm_warning_column+.62     ; 136
 #DEFINE    dm_warning_length          .9                        ; total string length
 ; Warning row #1
 #DEFINE    dm_warning1_row            dm_warning_row            ; 36/50
 #DEFINE    dm_warning1_column         dm_warning_column         ; 64
 #DEFINE    dm_warning1_bot            dm_warning1_row+.23       ; 59/73
-#DEFINE    dm_warning1_rgt            dm_warning1_column+.68    ; 130
+#DEFINE    dm_warning1_rgt            dm_warning_rgt            ; 136
 ; Warning row #2
 #DEFINE    dm_warning2_row            dm_warning_row+.24        ; 60/74
 #DEFINE    dm_warning2_column         dm_warning_column         ; 64
 #DEFINE    dm_warning2_bot            dm_warning2_row+.23       ; 83/97
-#DEFINE    dm_warning2_rgt            dm_warning2_column+.68    ; 130
+#DEFINE    dm_warning2_rgt            dm_warning_rgt            ; 136
 
 ;******* Upper content / content row / 3rd col *******
 ; Dive time
@@ -90,7 +96,7 @@
 #DEFINE    dm_divetime_secs_column        dm_divetime_column+.24 ; 139
 ; Warning icon
 #DEFINE    dm_warning_icon_row            dm_offset+.41                ; 55
-#DEFINE    dm_warning_icon_column         .135                         ; 135
+#DEFINE    dm_warning_icon_column         .137                         ; 137
 #DEFINE    dm_warning_icon_bot            dm_warning_icon_row+.38      ; 93
 #DEFINE    dm_warning_icon_rgt            dm_warning_icon_column+.21   ; 156
 ; Apnea dive time
--- a/src/tft_outputs.asm	Tue Jun 02 23:38:21 2015 +0100
+++ b/src/tft_outputs.asm	Sun Jun 07 22:07:55 2015 +0200
@@ -536,6 +536,11 @@
         WIN_TINY            dm_mask_divetime_column,dm_mask_divetime_row
         STRCAT_TEXT_PRINT   tDivetime
     endif
+
+    ; DEBUG !!!
+    movlw       color_blue
+    WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right
+
     call	TFT_standard_color
     return
 
@@ -569,6 +574,11 @@
     ; speed(m/min):    7   8   9  10  11  13   15   17   18   19   20 (warning)
 	; speed(m/min):    5   6   7   8   8  10   12   13   14   15   15 (attention)
 
+    ; w-multip         7   6   5   5   4   3    3    2    2    2    2
+    ; a-multip         6   5   4   3   3   3    2    2    2    2    2
+    ; w-offset         1   2   5   0   6  11    5   16   14   12   10
+    ; a-offset         0   0   2   6   6   0    6    4    2    0    0
+
     bcf     neg_flag_save
     btfsc   neg_flag
     bsf     neg_flag_save
@@ -1593,6 +1603,7 @@
 	call	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	STRCPY	"Int:"
 	movff	surface_interval+0,lo
 	movff	surface_interval+1,hi
@@ -1607,6 +1618,7 @@
     movlw   surf_warning_length         ; No, use surface string length
     call    TFT_fillup_with_spaces      ; Fillup FSR2 with spaces (Total string length in #WREG)
 	STRCAT_PRINT ""
+    call    TFT_warning_set_window_end
 	return
 
     global  TFT_surface_decosettings    ; Show all deco settings
@@ -1683,7 +1695,7 @@
 	call	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
-
+    call    TFT_warning_set_window_com
     call	TFT_standard_color
     STRCPY  0x94                        ; "End of dive" icon
     movlw   LOW     divemode_timeout
@@ -1706,6 +1718,7 @@
     movlw   dm_warning_length             ; Divemode string length
     call    TFT_fillup_with_spaces     ; Fillup FSR2 with spaces (Total string length in #WREG)
 	STRCAT_PRINT ""
+    call    TFT_warning_set_window_end
 	return
 
 	global	TFT_ftts
@@ -1720,6 +1733,7 @@
         call    TFT_warning_set_window		; Sets the row and column for the current warning
         tstfsz  WREG                        ; Is there room for the warning?
         return                              ; No
+        call    TFT_warning_set_window_com
     else
         call    TFT_standard_color
         WIN_SMALL dm_ftts_value_column, dm_ftts_value_row
@@ -1745,6 +1759,7 @@
     movlw   dm_warning_length             ; Divemode string length
     call    TFT_fillup_with_spaces     ; Fillup FSR2 with spaces (Total string length in #WREG)
 	STRCAT_PRINT ""
+    call    TFT_warning_set_window_end
 	return
 
 TFT_ftts2:
@@ -1753,6 +1768,7 @@
     movlw   dm_warning_length             ; Divemode string length
     call    TFT_fillup_with_spaces     ; Fillup FSR2 with spaces (Total string length in #WREG)
     STRCAT_PRINT ""
+    call    TFT_warning_set_window_end
     return
 
 
@@ -2636,6 +2652,7 @@
 
 TFT_max_pressure2_metric:
     WIN_MEDIUM	dm_max_depth_column, dm_max_depth_row
+    call    TFT_standard_color
 
 	movlw	.039
 	cpfslt	hi
@@ -3138,6 +3155,7 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	STRCPY	"Desat:"
 	movff		desaturation_time+0,lo			; divide by 60...
 	movff		desaturation_time+1,hi
@@ -3156,6 +3174,7 @@
     movlw   .0
     movff   WREG,buffer+11
 	STRCAT_PRINT	""
+    call    TFT_warning_set_window_end
 	return
 
 	global	TFT_nofly_time
@@ -3163,6 +3182,7 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	STRCPY	"NoFly:"
 	movff		nofly_time+0,lo			; divide by 60...
 	movff		nofly_time+1,hi
@@ -3181,6 +3201,7 @@
     movlw   .0
     movff   WREG,buffer+11
 	STRCAT_PRINT	""
+    call    TFT_warning_set_window_end
 	return
 
     global  TFT_warning_agf
@@ -3188,12 +3209,14 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
     call	TFT_warnings_color
 	STRCPY_TEXT tDiveaGF_active         ; "aGF!"
     movlw   dm_warning_length              ; Divemode string length
     rcall   TFT_fillup_with_spaces      ; Fillup FSR2 with spaces (Total string length in #WREG)
     STRCAT_PRINT ""
 	call	TFT_standard_color
+    call    TFT_warning_set_window_end
     return
 
     global  TFT_warning_fallback
@@ -3214,6 +3237,7 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	TFT_color_code		warn_gf		; Color-code Output
 	STRCPY  "GF:"
 	movff	char_O_gradient_factor,lo		; gradient factor
@@ -3227,6 +3251,7 @@
     STRCAT_PRINT  ""
     bcf     leftbind
 	call	TFT_standard_color
+    call    TFT_warning_set_window_end
 	return
 
 TFT_warning_set_window:                 ; Sets the row and column for the current warning
@@ -3263,12 +3288,22 @@
     bsf     second_row_warning          ; =1: The second row contains a warning
 	retlw   .0                          ; WREG=0 -> Warning window defined
 
+TFT_warning_set_window_com:
+    if dm_offset == 0
+        bsf     win_invert
+    endif
+    return
+
+TFT_warning_set_window_end:
+    bcf     win_invert
+    return
 
 	global	TFT_update_batt_percent_divemode
 TFT_update_batt_percent_divemode:
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
     movff   batt_percent,lo         ; Get battery percent
     TFT_color_code		warn_battery; Color-code battery percent
     STRCPY  "Batt:"
@@ -3282,9 +3317,9 @@
     rcall   TFT_fillup_with_spaces      ; Fillup FSR2 with spaces (Total string length in #WREG)
 	STRCAT_PRINT	""
 	call	TFT_standard_color
+    call    TFT_warning_set_window_end
 	return
 
-
     global  TFT_gf_mask                         ; Setup Mask
 TFT_gf_mask:
     ; The mask
@@ -3599,6 +3634,7 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	TFT_color_code		warn_cns		; Color-code CNS output
 	STRCPY_TEXT tCNS2                   ; CNS:
 	movff	int_O_CNS_fraction+0,lo
@@ -3613,6 +3649,7 @@
     rcall   TFT_fillup_with_spaces          ; Fillup FSR2 with spaces (Total string length in #WREG)
 	STRCAT_PRINT ""
 	call	TFT_standard_color
+    call    TFT_warning_set_window_end
 	return
 
 	global	TFT_display_ppo2
@@ -3620,6 +3657,7 @@
 	rcall	TFT_warning_set_window		; Sets the row and column for the current warning
     tstfsz  WREG                        ; Is there room for the warning?
     return                              ; No
+    call    TFT_warning_set_window_com
 	TFT_color_code		warn_ppo2		; Color-code output (ppO2 stored in xC)
     STRCPY_TEXT tppO2                   ; ppO2:
 ; Check very high ppO2 manually
@@ -3634,6 +3672,7 @@
     rcall   TFT_fillup_with_spaces      ; Fillup FSR2 with spaces (Total string length in #WREG)
     STRCAT_PRINT ""
 	call	TFT_standard_color
+    call    TFT_warning_set_window_end
 	return
 
 TFT_show_ppO2_3: