Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 332:0ff81ff290ce new_screen_layout
Fix positions if no VSI Bar displayed
author | Janos Kovacs <kovjanos@gmail.com> |
---|---|
date | Sun, 28 Jun 2015 03:30:03 +0200 |
parents | bd7f4c1bdb33 |
children | 14b466f66a7f |
comparison
equal
deleted
inserted
replaced
330:0532cac03ccd | 332:0ff81ff290ce |
---|---|
530 if dm_offset != 0 | 530 if dm_offset != 0 |
531 call TFT_divemask_color | 531 call TFT_divemask_color |
532 WIN_TINY dm_mask_depth_column,dm_mask_depth_row | 532 WIN_TINY dm_mask_depth_column,dm_mask_depth_row |
533 STRCAT_TEXT_PRINT tDepth | 533 STRCAT_TEXT_PRINT tDepth |
534 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row | 534 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row |
535 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
536 WIN_TINY dm_mask_maxdepth_column_nvsi,dm_mask_maxdepth_row | |
535 STRCAT_TEXT_PRINT tMaxDepth | 537 STRCAT_TEXT_PRINT tMaxDepth |
536 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row | 538 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row |
537 STRCAT_TEXT_PRINT tDivetime | 539 STRCAT_TEXT_PRINT tDivetime |
538 endif | 540 endif |
539 | 541 |
540 if dm_offset == 0 | 542 if dm_offset == 0 |
541 movlw color_dark_red | 543 movlw color_dark_red |
542 call TFT_set_color | 544 call TFT_set_color |
545 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
546 bra $+4 | |
543 WIN_FRAME_COLOR16 dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right | 547 WIN_FRAME_COLOR16 dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right |
544 WIN_FRAME_COLOR16 dm_sep_1_2_row, dm_sep_1_2_row, .0, .159 ;top, bottom, left, right | 548 WIN_FRAME_COLOR16 dm_sep_1_2_row, dm_sep_1_2_row, .0, .159 ;top, bottom, left, right |
545 WIN_FRAME_COLOR16 dm_sep_2_3_row, dm_sep_2_3_row, .0, .159 ;top, bottom, left, right | 549 WIN_FRAME_COLOR16 dm_sep_2_3_row, dm_sep_2_3_row, .0, .159 ;top, bottom, left, right |
546 WIN_FRAME_COLOR16 dm_warning_row-.1, dm_warning_row-.1, dm_warning_column, .159 ;top, bottom, left, right | 550 WIN_FRAME_COLOR16 dm_warning_row-.1, dm_warning_row-.1, dm_warning_column, .159 ;top, bottom, left, right |
551 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
552 bra $+4 | |
553 WIN_FRAME_COLOR16 dm_warning_row-.1, dm_warning_row-.1, dm_max_depth_column_nvsi, .159 ;top, bottom, left, right | |
547 call TFT_draw_gassep_line | 554 call TFT_draw_gassep_line |
548 endif | 555 endif |
549 | 556 |
550 call TFT_standard_color | 557 call TFT_standard_color |
551 return | 558 return |
995 call TFT_velocity_VSIbar | 1002 call TFT_velocity_VSIbar |
996 call TFT_standard_color | 1003 call TFT_standard_color |
997 return | 1004 return |
998 | 1005 |
999 TFT_velocity_VSIbar: | 1006 TFT_velocity_VSIbar: |
1007 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
1008 return | |
1009 | |
1000 ; use another logic when descending | 1010 ; use another logic when descending |
1001 btfss neg_flag_velocity | 1011 btfss neg_flag_velocity |
1002 bra TFT_velocity_VSIbar_desc | 1012 bra TFT_velocity_VSIbar_desc |
1003 call TFT_velocity_VSIbar_desc_clr | 1013 call TFT_velocity_VSIbar_desc_clr |
1004 | |
1005 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
1006 return | |
1007 | 1014 |
1008 btfsc velocity_warn | 1015 btfsc velocity_warn |
1009 bra TFT_velocity_VSIbar_warn | 1016 bra TFT_velocity_VSIbar_warn |
1010 ; if all ok or attention, use attn's values | 1017 ; if all ok or attention, use attn's values |
1011 movff xC+1,sub_b+0 ; multiplier | 1018 movff xC+1,sub_b+0 ; multiplier |
1220 call TFT_set_color | 1227 call TFT_set_color |
1221 call TFT_box | 1228 call TFT_box |
1222 return | 1229 return |
1223 | 1230 |
1224 TFT_velocity_VSIbar_clr: ; clears the ascend part of the bar | 1231 TFT_velocity_VSIbar_clr: ; clears the ascend part of the bar |
1232 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
1233 return | |
1225 WIN_BOX_BLACK dm_velobar_top+.1,dm_velobar_top+.63,dm_velobar_lft+.1,dm_velobar_rgt-.1 | 1234 WIN_BOX_BLACK dm_velobar_top+.1,dm_velobar_top+.63,dm_velobar_lft+.1,dm_velobar_rgt-.1 |
1226 if dm_offset == 0 | 1235 if dm_offset == 0 |
1227 movlw color_dark_red | 1236 movlw color_dark_red |
1228 WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right | 1237 WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right |
1229 endif | 1238 endif |
1230 return | 1239 return |
1231 | 1240 |
1232 TFT_velocity_VSIbar_desc_clr: ; clears the descend part of the bar | 1241 TFT_velocity_VSIbar_desc_clr: ; clears the descend part of the bar |
1242 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
1243 return | |
1233 WIN_BOX_BLACK dm_velobar_top+.61,dm_velobar_bot-.1,dm_velobar_lft+.1,dm_velobar_rgt-.1 | 1244 WIN_BOX_BLACK dm_velobar_top+.61,dm_velobar_bot-.1,dm_velobar_lft+.1,dm_velobar_rgt-.1 |
1234 if dm_offset == 0 | 1245 if dm_offset == 0 |
1235 movlw color_dark_red | 1246 movlw color_dark_red |
1236 WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right | 1247 WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right |
1237 endif | 1248 endif |
3060 TSTOSS opt_units ; 0=m, 1=ft | 3071 TSTOSS opt_units ; 0=m, 1=ft |
3061 bra TFT_max_pressure2_metric | 3072 bra TFT_max_pressure2_metric |
3062 ;TFT_max_pressure2_imperial | 3073 ;TFT_max_pressure2_imperial |
3063 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | 3074 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet |
3064 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row | 3075 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row |
3076 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
3077 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row | |
3065 call TFT_standard_color | 3078 call TFT_standard_color |
3066 output_16_3 | 3079 output_16_3 |
3067 STRCAT_PRINT "" | 3080 STRCAT_PRINT "" |
3068 return | 3081 return |
3069 | 3082 |
3070 TFT_max_pressure2_metric: | 3083 TFT_max_pressure2_metric: |
3071 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row | 3084 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row |
3085 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
3086 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row | |
3072 call TFT_standard_color | 3087 call TFT_standard_color |
3073 | 3088 |
3074 movlw .039 | 3089 movlw .039 |
3075 cpfslt hi | 3090 cpfslt hi |
3076 bra max_depth_greater_99_84mtr | 3091 bra max_depth_greater_99_84mtr |
3111 output_16 | 3126 output_16 |
3112 bra tft_max_depth3 | 3127 bra tft_max_depth3 |
3113 | 3128 |
3114 tft_max_depth2: | 3129 tft_max_depth2: |
3115 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row | 3130 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row |
3131 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
3132 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row | |
3116 STRCAT "0" | 3133 STRCAT "0" |
3117 | 3134 |
3118 tft_max_depth3: | 3135 tft_max_depth3: |
3119 call TFT_standard_color | 3136 call TFT_standard_color |
3120 STRCAT_PRINT "" ; Display full meters | 3137 STRCAT_PRINT "" ; Display full meters |
3121 bcf leftbind | 3138 bcf leftbind |
3122 | 3139 |
3123 ; .1m in SMALL font | 3140 ; .1m in SMALL font |
3124 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row | 3141 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row |
3142 TSTOSS opt_vsigraph ; 0=skip, 1=draw | |
3143 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row | |
3125 | 3144 |
3126 SAFE_2BYTE_COPY max_pressure, lo | 3145 SAFE_2BYTE_COPY max_pressure, lo |
3127 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] | 3146 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
3128 | 3147 |
3129 PUTC "." | 3148 PUTC "." |