Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 334:d07f7d07e568
Merged new_screen_layout into default
author | Janos Kovacs <kovjanos@gmail.com> |
---|---|
date | Sun, 28 Jun 2015 03:55:08 +0200 |
parents | 14b466f66a7f |
children | 508d7fb98b34 |
comparison
equal
deleted
inserted
replaced
331:8b9b03b70b14 | 334:d07f7d07e568 |
---|---|
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 "." |
3784 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row | 3803 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row |
3785 STRCPY_PRINT "---" | 3804 STRCPY_PRINT "---" |
3786 bcf leftbind | 3805 bcf leftbind |
3787 return | 3806 return |
3788 | 3807 |
3808 global TFT_gf_mask_cGF ; Setup Mask | |
3809 TFT_gf_mask_cGF: | |
3810 ; The mask | |
3811 call TFT_divemask_color | |
3812 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row | |
3813 STRCPY_TEXT_PRINT tGFInfo | |
3814 call TFT_standard_color | |
3815 return | |
3816 | |
3789 global TFT_gf_info ; Show GF informations | 3817 global TFT_gf_info ; Show GF informations |
3790 TFT_gf_info: | 3818 TFT_gf_info: |
3819 call TFT_standard_color | |
3791 ; Show current GF | 3820 ; Show current GF |
3792 movff char_O_gradient_factor,lo ; gradient factor absolute (Non-GF model) | 3821 movff char_O_gradient_factor,lo ; gradient factor absolute (Non-GF model) |
3793 movff char_I_deco_model,hi | 3822 movff char_I_deco_model,hi |
3794 decfsz hi,F ; jump over next line if char_I_deco_model == 1 | 3823 decfsz hi,F ; jump over next line if char_I_deco_model == 1 |
3795 movff char_O_relative_gradient_GF,lo ; gradient factor relative (GF model) | 3824 movff char_O_relative_gradient_GF,lo ; gradient factor relative (GF model) |
4067 STRCAT_PRINT "" | 4096 STRCAT_PRINT "" |
4068 call TFT_standard_color | 4097 call TFT_standard_color |
4069 call TFT_warning_set_window_end | 4098 call TFT_warning_set_window_end |
4070 return | 4099 return |
4071 | 4100 |
4101 global TFT_mask_ppo2 | |
4102 TFT_mask_ppo2: | |
4103 call TFT_divemask_color | |
4104 WIN_TINY dm_custom_ceiling_ppo2_column, dm_custom_ceiling_text_row | |
4105 STRCPY_TEXT_PRINT tppO2 | |
4106 call TFT_standard_color | |
4107 return | |
4108 | |
4109 global TFT_display_ppo2_val | |
4110 TFT_display_ppo2_val: | |
4111 SAFE_2BYTE_COPY amb_pressure, xA | |
4112 movlw d'10' | |
4113 movwf xB+0 | |
4114 clrf xB+1 | |
4115 call div16x16 ; xC=p_amb/10 | |
4116 movff xC+0,xA+0 | |
4117 movff xC+1,xA+1 | |
4118 movff char_I_O2_ratio,xB+0 ; =O2 ratio | |
4119 clrf xB+1 | |
4120 call mult16x16 ; char_I_O2_ratio * p_amb/10 | |
4121 | |
4122 call TFT_standard_color | |
4123 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) | |
4124 WIN_STD dm_custom_ceiling_ppo2_val_col, dm_custom_ceiling_value_row | |
4125 ; hijacking neg_flag_velocity to know where the value is displayed | |
4126 bsf neg_flag_velocity | |
4127 bra TFT_display_ppo2_com | |
4128 | |
4072 global TFT_display_ppo2 | 4129 global TFT_display_ppo2 |
4073 TFT_display_ppo2: ; Show ppO2 (ppO2 stored in xC, in mbar!) | 4130 TFT_display_ppo2: ; Show ppO2 (ppO2 stored in xC, in mbar!) |
4074 rcall TFT_warning_set_window ; Sets the row and column for the current warning | 4131 rcall TFT_warning_set_window ; Sets the row and column for the current warning |
4075 tstfsz WREG ; Is there room for the warning? | 4132 tstfsz WREG ; Is there room for the warning? |
4076 return ; No | 4133 return ; No |
4077 call TFT_warning_set_window_com | 4134 call TFT_warning_set_window_com |
4078 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) | 4135 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
4079 STRCPY_TEXT tppO2 ; ppO2: | 4136 STRCPY_TEXT tppO2 ; ppO2: |
4137 ; hijacking neg_flag_velocity to know where the value is displayed | |
4138 bcf neg_flag_velocity | |
4139 TFT_display_ppo2_com: | |
4080 ; Check very high ppO2 manually | 4140 ; Check very high ppO2 manually |
4081 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? | 4141 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
4082 bra TFT_show_ppO2_3 ; Yes, display fixed Value! | 4142 bra TFT_show_ppO2_3 ; Yes, display fixed Value! |
4083 movff xC+0,lo | 4143 movff xC+0,lo |
4084 movff xC+1,hi | 4144 movff xC+1,hi |
4085 bsf ignore_digit4 | 4145 bsf ignore_digit4 |
4086 output_16dp d'1' | 4146 output_16dp d'1' |
4087 TFT_show_ppO2_2: | 4147 TFT_show_ppO2_2: |
4088 movlw dm_warning_length ; Divemode string length | 4148 movlw dm_warning_length ; Divemode string length |
4149 ; neg_flag_velocity is hijacked, used to toggle the fillup lenght. | |
4150 btfsc neg_flag_velocity | |
4151 movlw .4 | |
4089 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) | 4152 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) |
4090 STRCAT_PRINT "" | 4153 STRCAT_PRINT "" |
4091 call TFT_standard_color | 4154 call TFT_standard_color |
4092 call TFT_warning_set_window_end | 4155 call TFT_warning_set_window_end |
4093 return | 4156 return |