comparison src/tft_outputs.asm @ 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
comparison
equal deleted inserted replaced
307:14719662fb95 309:efb53af0d62a
534 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row 534 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row
535 STRCAT_TEXT_PRINT tMaxDepth 535 STRCAT_TEXT_PRINT tMaxDepth
536 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row 536 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row
537 STRCAT_TEXT_PRINT tDivetime 537 STRCAT_TEXT_PRINT tDivetime
538 endif 538 endif
539
540 ; DEBUG !!!
541 movlw color_blue
542 WIN_BOX_COLOR dm_velobar_top+.60, dm_velobar_top+.63, dm_velobar_lft+.1, dm_velobar_rgt-.1 ;top, bottom, left, right
543
539 call TFT_standard_color 544 call TFT_standard_color
540 return 545 return
541 546
542 global TFT_clear_customview_divemode 547 global TFT_clear_customview_divemode
543 TFT_clear_customview_divemode: 548 TFT_clear_customview_divemode:
566 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164 571 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
567 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66 572 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66
568 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50 573 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
569 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning) 574 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning)
570 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention) 575 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention)
576
577 ; w-multip 7 6 5 5 4 3 3 2 2 2 2
578 ; a-multip 6 5 4 3 3 3 2 2 2 2 2
579 ; w-offset 1 2 5 0 6 11 5 16 14 12 10
580 ; a-offset 0 0 2 6 6 0 6 4 2 0 0
571 581
572 bcf neg_flag_save 582 bcf neg_flag_save
573 btfsc neg_flag 583 btfsc neg_flag
574 bsf neg_flag_save 584 bsf neg_flag_save
575 585
1591 global TFT_interval 1601 global TFT_interval
1592 TFT_interval: 1602 TFT_interval:
1593 call TFT_warning_set_window ; Sets the row and column for the current warning 1603 call TFT_warning_set_window ; Sets the row and column for the current warning
1594 tstfsz WREG ; Is there room for the warning? 1604 tstfsz WREG ; Is there room for the warning?
1595 return ; No 1605 return ; No
1606 call TFT_warning_set_window_com
1596 STRCPY "Int:" 1607 STRCPY "Int:"
1597 movff surface_interval+0,lo 1608 movff surface_interval+0,lo
1598 movff surface_interval+1,hi 1609 movff surface_interval+1,hi
1599 call convert_time ; lo=mins, hi=hours 1610 call convert_time ; lo=mins, hi=hours
1600 movf hi,W 1611 movf hi,W
1605 movff hi,lo 1616 movff hi,lo
1606 output_99x 1617 output_99x
1607 movlw surf_warning_length ; No, use surface string length 1618 movlw surf_warning_length ; No, use surface string length
1608 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 1619 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
1609 STRCAT_PRINT "" 1620 STRCAT_PRINT ""
1621 call TFT_warning_set_window_end
1610 return 1622 return
1611 1623
1612 global TFT_surface_decosettings ; Show all deco settings 1624 global TFT_surface_decosettings ; Show all deco settings
1613 TFT_surface_decosettings: 1625 TFT_surface_decosettings:
1614 ; Deco Mode 1626 ; Deco Mode
1681 global TFT_divetimeout ; Show timeout counter 1693 global TFT_divetimeout ; Show timeout counter
1682 TFT_divetimeout: 1694 TFT_divetimeout:
1683 call TFT_warning_set_window ; Sets the row and column for the current warning 1695 call TFT_warning_set_window ; Sets the row and column for the current warning
1684 tstfsz WREG ; Is there room for the warning? 1696 tstfsz WREG ; Is there room for the warning?
1685 return ; No 1697 return ; No
1686 1698 call TFT_warning_set_window_com
1687 call TFT_standard_color 1699 call TFT_standard_color
1688 STRCPY 0x94 ; "End of dive" icon 1700 STRCPY 0x94 ; "End of dive" icon
1689 movlw LOW divemode_timeout 1701 movlw LOW divemode_timeout
1690 movwf sub_a+0 1702 movwf sub_a+0
1691 movlw HIGH divemode_timeout 1703 movlw HIGH divemode_timeout
1704 movff hi,lo 1716 movff hi,lo
1705 output_99x 1717 output_99x
1706 movlw dm_warning_length ; Divemode string length 1718 movlw dm_warning_length ; Divemode string length
1707 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 1719 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
1708 STRCAT_PRINT "" 1720 STRCAT_PRINT ""
1721 call TFT_warning_set_window_end
1709 return 1722 return
1710 1723
1711 global TFT_ftts 1724 global TFT_ftts
1712 TFT_ftts: 1725 TFT_ftts:
1713 movff char_I_extra_time,lo 1726 movff char_I_extra_time,lo
1718 if dm_offset !=0 1731 if dm_offset !=0
1719 incf warning_counter,F ; increase counter 1732 incf warning_counter,F ; increase counter
1720 call TFT_warning_set_window ; Sets the row and column for the current warning 1733 call TFT_warning_set_window ; Sets the row and column for the current warning
1721 tstfsz WREG ; Is there room for the warning? 1734 tstfsz WREG ; Is there room for the warning?
1722 return ; No 1735 return ; No
1736 call TFT_warning_set_window_com
1723 else 1737 else
1724 call TFT_standard_color 1738 call TFT_standard_color
1725 WIN_SMALL dm_ftts_value_column, dm_ftts_value_row 1739 WIN_SMALL dm_ftts_value_column, dm_ftts_value_row
1726 endif 1740 endif
1727 1741
1743 bcf leftbind 1757 bcf leftbind
1744 PUTC "'" 1758 PUTC "'"
1745 movlw dm_warning_length ; Divemode string length 1759 movlw dm_warning_length ; Divemode string length
1746 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 1760 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
1747 STRCAT_PRINT "" 1761 STRCAT_PRINT ""
1762 call TFT_warning_set_window_end
1748 return 1763 return
1749 1764
1750 TFT_ftts2: 1765 TFT_ftts2:
1751 STRCAT "---" 1766 STRCAT "---"
1752 bcf leftbind 1767 bcf leftbind
1753 movlw dm_warning_length ; Divemode string length 1768 movlw dm_warning_length ; Divemode string length
1754 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 1769 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
1755 STRCAT_PRINT "" 1770 STRCAT_PRINT ""
1771 call TFT_warning_set_window_end
1756 return 1772 return
1757 1773
1758 1774
1759 ;============================================================================= 1775 ;=============================================================================
1760 1776
2634 STRCAT_PRINT "" 2650 STRCAT_PRINT ""
2635 return 2651 return
2636 2652
2637 TFT_max_pressure2_metric: 2653 TFT_max_pressure2_metric:
2638 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row 2654 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
2655 call TFT_standard_color
2639 2656
2640 movlw .039 2657 movlw .039
2641 cpfslt hi 2658 cpfslt hi
2642 bra max_depth_greater_99_84mtr 2659 bra max_depth_greater_99_84mtr
2643 2660
3136 global TFT_desaturation_time 3153 global TFT_desaturation_time
3137 TFT_desaturation_time: 3154 TFT_desaturation_time:
3138 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3155 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3139 tstfsz WREG ; Is there room for the warning? 3156 tstfsz WREG ; Is there room for the warning?
3140 return ; No 3157 return ; No
3158 call TFT_warning_set_window_com
3141 STRCPY "Desat:" 3159 STRCPY "Desat:"
3142 movff desaturation_time+0,lo ; divide by 60... 3160 movff desaturation_time+0,lo ; divide by 60...
3143 movff desaturation_time+1,hi 3161 movff desaturation_time+1,hi
3144 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) 3162 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
3145 bsf leftbind 3163 bsf leftbind
3154 movlw surf_warning_length ; Only use surface string length 3172 movlw surf_warning_length ; Only use surface string length
3155 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3173 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3156 movlw .0 3174 movlw .0
3157 movff WREG,buffer+11 3175 movff WREG,buffer+11
3158 STRCAT_PRINT "" 3176 STRCAT_PRINT ""
3177 call TFT_warning_set_window_end
3159 return 3178 return
3160 3179
3161 global TFT_nofly_time 3180 global TFT_nofly_time
3162 TFT_nofly_time: 3181 TFT_nofly_time:
3163 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3182 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3164 tstfsz WREG ; Is there room for the warning? 3183 tstfsz WREG ; Is there room for the warning?
3165 return ; No 3184 return ; No
3185 call TFT_warning_set_window_com
3166 STRCPY "NoFly:" 3186 STRCPY "NoFly:"
3167 movff nofly_time+0,lo ; divide by 60... 3187 movff nofly_time+0,lo ; divide by 60...
3168 movff nofly_time+1,hi 3188 movff nofly_time+1,hi
3169 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) 3189 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
3170 bsf leftbind 3190 bsf leftbind
3179 movlw surf_warning_length ; Only use surface string length 3199 movlw surf_warning_length ; Only use surface string length
3180 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3200 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3181 movlw .0 3201 movlw .0
3182 movff WREG,buffer+11 3202 movff WREG,buffer+11
3183 STRCAT_PRINT "" 3203 STRCAT_PRINT ""
3204 call TFT_warning_set_window_end
3184 return 3205 return
3185 3206
3186 global TFT_warning_agf 3207 global TFT_warning_agf
3187 TFT_warning_agf: 3208 TFT_warning_agf:
3188 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3209 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3189 tstfsz WREG ; Is there room for the warning? 3210 tstfsz WREG ; Is there room for the warning?
3190 return ; No 3211 return ; No
3212 call TFT_warning_set_window_com
3191 call TFT_warnings_color 3213 call TFT_warnings_color
3192 STRCPY_TEXT tDiveaGF_active ; "aGF!" 3214 STRCPY_TEXT tDiveaGF_active ; "aGF!"
3193 movlw dm_warning_length ; Divemode string length 3215 movlw dm_warning_length ; Divemode string length
3194 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3216 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3195 STRCAT_PRINT "" 3217 STRCAT_PRINT ""
3196 call TFT_standard_color 3218 call TFT_standard_color
3219 call TFT_warning_set_window_end
3197 return 3220 return
3198 3221
3199 global TFT_warning_fallback 3222 global TFT_warning_fallback
3200 TFT_warning_fallback: ; Show fallback warning 3223 TFT_warning_fallback: ; Show fallback warning
3201 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3224 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3212 global TFT_warning_gf 3235 global TFT_warning_gf
3213 TFT_warning_gf: ;GF 3236 TFT_warning_gf: ;GF
3214 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3237 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3215 tstfsz WREG ; Is there room for the warning? 3238 tstfsz WREG ; Is there room for the warning?
3216 return ; No 3239 return ; No
3240 call TFT_warning_set_window_com
3217 TFT_color_code warn_gf ; Color-code Output 3241 TFT_color_code warn_gf ; Color-code Output
3218 STRCPY "GF:" 3242 STRCPY "GF:"
3219 movff char_O_gradient_factor,lo ; gradient factor 3243 movff char_O_gradient_factor,lo ; gradient factor
3220 bsf leftbind 3244 bsf leftbind
3221 output_8 3245 output_8
3225 movlw surf_warning_length ; No, use surface string length 3249 movlw surf_warning_length ; No, use surface string length
3226 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3250 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3227 STRCAT_PRINT "" 3251 STRCAT_PRINT ""
3228 bcf leftbind 3252 bcf leftbind
3229 call TFT_standard_color 3253 call TFT_standard_color
3254 call TFT_warning_set_window_end
3230 return 3255 return
3231 3256
3232 TFT_warning_set_window: ; Sets the row and column for the current warning 3257 TFT_warning_set_window: ; Sets the row and column for the current warning
3233 ; ignore warning (now)? 3258 ; ignore warning (now)?
3234 decf warning_counter,W ; -1 3259 decf warning_counter,W ; -1
3261 TFT_warning_set_window4: 3286 TFT_warning_set_window4:
3262 WIN_SMALL surf_warning2_column,surf_warning2_row 3287 WIN_SMALL surf_warning2_column,surf_warning2_row
3263 bsf second_row_warning ; =1: The second row contains a warning 3288 bsf second_row_warning ; =1: The second row contains a warning
3264 retlw .0 ; WREG=0 -> Warning window defined 3289 retlw .0 ; WREG=0 -> Warning window defined
3265 3290
3291 TFT_warning_set_window_com:
3292 if dm_offset == 0
3293 bsf win_invert
3294 endif
3295 return
3296
3297 TFT_warning_set_window_end:
3298 bcf win_invert
3299 return
3266 3300
3267 global TFT_update_batt_percent_divemode 3301 global TFT_update_batt_percent_divemode
3268 TFT_update_batt_percent_divemode: 3302 TFT_update_batt_percent_divemode:
3269 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3303 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3270 tstfsz WREG ; Is there room for the warning? 3304 tstfsz WREG ; Is there room for the warning?
3271 return ; No 3305 return ; No
3306 call TFT_warning_set_window_com
3272 movff batt_percent,lo ; Get battery percent 3307 movff batt_percent,lo ; Get battery percent
3273 TFT_color_code warn_battery; Color-code battery percent 3308 TFT_color_code warn_battery; Color-code battery percent
3274 STRCPY "Batt:" 3309 STRCPY "Batt:"
3275 bsf leftbind 3310 bsf leftbind
3276 output_8 3311 output_8
3280 btfss divemode ; In Divemode? 3315 btfss divemode ; In Divemode?
3281 movlw surf_warning_length ; No, use surface string length 3316 movlw surf_warning_length ; No, use surface string length
3282 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3317 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3283 STRCAT_PRINT "" 3318 STRCAT_PRINT ""
3284 call TFT_standard_color 3319 call TFT_standard_color
3285 return 3320 call TFT_warning_set_window_end
3286 3321 return
3287 3322
3288 global TFT_gf_mask ; Setup Mask 3323 global TFT_gf_mask ; Setup Mask
3289 TFT_gf_mask: 3324 TFT_gf_mask:
3290 ; The mask 3325 ; The mask
3291 call TFT_divemask_color 3326 call TFT_divemask_color
3597 global TFT_display_cns 3632 global TFT_display_cns
3598 TFT_display_cns: 3633 TFT_display_cns:
3599 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3634 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3600 tstfsz WREG ; Is there room for the warning? 3635 tstfsz WREG ; Is there room for the warning?
3601 return ; No 3636 return ; No
3637 call TFT_warning_set_window_com
3602 TFT_color_code warn_cns ; Color-code CNS output 3638 TFT_color_code warn_cns ; Color-code CNS output
3603 STRCPY_TEXT tCNS2 ; CNS: 3639 STRCPY_TEXT tCNS2 ; CNS:
3604 movff int_O_CNS_fraction+0,lo 3640 movff int_O_CNS_fraction+0,lo
3605 movff int_O_CNS_fraction+1,hi 3641 movff int_O_CNS_fraction+1,hi
3606 bsf leftbind 3642 bsf leftbind
3611 btfss divemode ; In Divemode? 3647 btfss divemode ; In Divemode?
3612 movlw surf_warning_length ; No, use surface string length 3648 movlw surf_warning_length ; No, use surface string length
3613 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3649 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3614 STRCAT_PRINT "" 3650 STRCAT_PRINT ""
3615 call TFT_standard_color 3651 call TFT_standard_color
3652 call TFT_warning_set_window_end
3616 return 3653 return
3617 3654
3618 global TFT_display_ppo2 3655 global TFT_display_ppo2
3619 TFT_display_ppo2: ; Show ppO2 (ppO2 stored in xC, in mbar!) 3656 TFT_display_ppo2: ; Show ppO2 (ppO2 stored in xC, in mbar!)
3620 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3657 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3621 tstfsz WREG ; Is there room for the warning? 3658 tstfsz WREG ; Is there room for the warning?
3622 return ; No 3659 return ; No
3660 call TFT_warning_set_window_com
3623 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) 3661 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC)
3624 STRCPY_TEXT tppO2 ; ppO2: 3662 STRCPY_TEXT tppO2 ; ppO2:
3625 ; Check very high ppO2 manually 3663 ; Check very high ppO2 manually
3626 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? 3664 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar?
3627 bra TFT_show_ppO2_3 ; Yes, display fixed Value! 3665 bra TFT_show_ppO2_3 ; Yes, display fixed Value!
3632 TFT_show_ppO2_2: 3670 TFT_show_ppO2_2:
3633 movlw dm_warning_length ; Divemode string length 3671 movlw dm_warning_length ; Divemode string length
3634 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3672 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3635 STRCAT_PRINT "" 3673 STRCAT_PRINT ""
3636 call TFT_standard_color 3674 call TFT_standard_color
3675 call TFT_warning_set_window_end
3637 return 3676 return
3638 3677
3639 TFT_show_ppO2_3: 3678 TFT_show_ppO2_3:
3640 STRCAT ">6.6" 3679 STRCAT ">6.6"
3641 bra TFT_show_ppO2_2 3680 bra TFT_show_ppO2_2