comparison src/tft_outputs.asm @ 251:3fec179a6220

some cleanup, temporaly disable dive_warning.inc
author heinrichsweikamp
date Wed, 18 Mar 2015 17:39:27 +0100
parents 20e3bad0b0f2
children d912fb71d606
comparison
equal deleted inserted replaced
250:20e3bad0b0f2 251:3fec179a6220
581 global TFT_divemode_warning 581 global TFT_divemode_warning
582 TFT_divemode_warning: 582 TFT_divemode_warning:
583 bsf dive_warning_displayed ; =1: The warning sign is shown 583 bsf dive_warning_displayed ; =1: The warning sign is shown
584 WIN_TOP warning_icon_row 584 WIN_TOP warning_icon_row
585 WIN_LEFT warning_icon_column 585 WIN_LEFT warning_icon_column
586 TFT_WRITE_PROM_IMAGE dive_warning_block ; Show Warning icon 586 ; TFT_WRITE_PROM_IMAGE dive_warning_block ; Show Warning icon
587 ; movlw .3 587 ; movlw .3
588 ; cpfslt warning_counter ; More then two warnings? 588 ; cpfslt warning_counter ; More then two warnings?
589 ; rcall TFT_divemode_warning_counter ; Yes, show the number 589 ; rcall TFT_divemode_warning_counter ; Yes, show the number
590 return 590 return
591 591
1542 ; don't do a clear if we are at 0 (zero) otherwise it will blink 1542 ; don't do a clear if we are at 0 (zero) otherwise it will blink
1543 ; because of the width underflow 1543 ; because of the width underflow
1544 movlw d'0' 1544 movlw d'0'
1545 cpfsgt lo,1 1545 cpfsgt lo,1
1546 bra TFT_dive_compass_ruler_loop_zz 1546 bra TFT_dive_compass_ruler_loop_zz
1547 call TFT_dive_compass_clr_ruler 1547 rcall TFT_dive_compass_clr_ruler
1548 TFT_dive_compass_ruler_loop_zz: 1548 TFT_dive_compass_ruler_loop_zz:
1549 ; 3. Draw the markers @ RM 1549 ; 3. Draw the markers @ RM
1550 call TFT_dive_compass_ruler_print 1550 rcall TFT_dive_compass_ruler_print
1551 ; 4. If D<82 and RM>79: means we put something over the center line 1551 ; 4. If D<82 and RM>79: means we put something over the center line
1552 ; redraw the center line 1552 ; redraw the center line
1553 movlw d'82' 1553 movlw d'82'
1554 cpfslt hi,1 1554 cpfslt hi,1
1555 bra TFT_dive_compass_ruler_loop_zz2 1555 bra TFT_dive_compass_ruler_loop_zz2
1556 movlw d'79' 1556 movlw d'79'
1557 cpfsgt lo,1 1557 cpfsgt lo,1
1558 bra TFT_dive_compass_ruler_loop_zz2 1558 bra TFT_dive_compass_ruler_loop_zz2
1559 call TFT_dive_compass_c_mk 1559 rcall TFT_dive_compass_c_mk
1560 TFT_dive_compass_ruler_loop_zz2: 1560 TFT_dive_compass_ruler_loop_zz2:
1561 ; 5. set D = RM + 2 : position after the 2px tick 1561 ; 5. set D = RM + 2 : position after the 2px tick
1562 movff lo,hi 1562 movff lo,hi
1563 movlw d'2' 1563 movlw d'2'
1564 addwf hi,1 1564 addwf hi,1
1575 bra TFT_dive_compass_ruler_lend2 ; D >= W 1575 bra TFT_dive_compass_ruler_lend2 ; D >= W
1576 ; 9. position left to end of display to clear the remaining area 1576 ; 9. position left to end of display to clear the remaining area
1577 movlw d'160' 1577 movlw d'160'
1578 movwf lo 1578 movwf lo
1579 ; 10. clear it 1579 ; 10. clear it
1580 call TFT_dive_compass_clr_ruler 1580 rcall TFT_dive_compass_clr_ruler
1581 1581
1582 TFT_dive_compass_ruler_lend2: 1582 TFT_dive_compass_ruler_lend2:
1583 ; done with the compass ruler, put the labels on the screen 1583 ; done with the compass ruler, put the labels on the screen
1584 ; get the RD abck to sub_b 1584 ; get the RD abck to sub_b
1585 movff xRD+0,sub_b+0 1585 movff xRD+0,sub_b+0
1596 movwf up ; up stores the width of hte label 1596 movwf up ; up stores the width of hte label
1597 movlw low( d'309' ) ; position of the label 1597 movlw low( d'309' ) ; position of the label
1598 movwf sub_a+0 1598 movwf sub_a+0
1599 movlw high( d'309' ) 1599 movlw high( d'309' )
1600 movwf sub_a+1 1600 movwf sub_a+1
1601 call TFT_dive_compass_label_proc ; check if the label should be on screen 1601 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1602 btfsc print_compass_label ; Yes? 1602 btfss print_compass_label ; Yes?
1603 STRCPY_PRINT "NW" ; yes - print it 1603 bra dcr_1
1604 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1604 STRCPY_TEXT_PRINT tNW ; yes - print it
1605 dcr_1:
1606 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1605 1607
1606 movlw d'6' 1608 movlw d'6'
1607 movwf up ; up stores the width of hte label 1609 movwf up ; up stores the width of hte label
1608 movlw low( d'358' ) ; position of the label 1610 movlw low( d'358' ) ; position of the label
1609 movwf sub_a+0 1611 movwf sub_a+0
1610 movlw high( d'358' ) 1612 movlw high( d'358' )
1611 movwf sub_a+1 1613 movwf sub_a+1
1612 call TFT_dive_compass_label_proc ; check if the label should be on screen 1614 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1613 btfsc print_compass_label ; Yes? 1615 btfss print_compass_label ; Yes?
1614 STRCPY_PRINT "N" ; yes - print it 1616 bra dcr_2
1615 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1617 STRCPY_TEXT_PRINT tN ; yes - print it
1618 dcr_2:
1619 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1616 1620
1617 movlw d'13' 1621 movlw d'13'
1618 movwf up ; up stores the width of hte label 1622 movwf up ; up stores the width of hte label
1619 movlw low( d'399' ) ; position of the label 1623 movlw low( d'399' ) ; position of the label
1620 movwf sub_a+0 1624 movwf sub_a+0
1621 movlw high( d'399' ) 1625 movlw high( d'399' )
1622 movwf sub_a+1 1626 movwf sub_a+1
1623 call TFT_dive_compass_label_proc ; check if the label should be on screen 1627 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1624 btfsc print_compass_label ; Yes? 1628 btfss print_compass_label ; Yes?
1625 STRCPY_PRINT "NE" ; yes - print it 1629 bra dcr_3
1626 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1630 STRCPY_TEXT_PRINT tNE ; yes - print it
1631 dcr_3:
1632 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1627 1633
1628 movlw d'6' 1634 movlw d'6'
1629 movwf up ; up stores the width of hte label 1635 movwf up ; up stores the width of hte label
1630 movlw low( d'448' ) ; position of the label 1636 movlw low( d'448' ) ; position of the label
1631 movwf sub_a+0 1637 movwf sub_a+0
1632 movlw high( d'448' ) 1638 movlw high( d'448' )
1633 movwf sub_a+1 1639 movwf sub_a+1
1634 call TFT_dive_compass_label_proc ; check if the label should be on screen 1640 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1635 btfsc print_compass_label ; Yes? 1641 btfss print_compass_label ; Yes?
1636 STRCPY_PRINT "E" ; yes - print it 1642 bra dcr_4
1637 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1643 STRCPY_TEXT_PRINT tE ; yes - print it
1644 dcr_4:
1645 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1638 1646
1639 movlw d'13' 1647 movlw d'13'
1640 movwf up ; up stores the width of hte label 1648 movwf up ; up stores the width of hte label
1641 movlw low( d'489' ) ; position of the label 1649 movlw low( d'489' ) ; position of the label
1642 movwf sub_a+0 1650 movwf sub_a+0
1643 movlw high( d'489' ) 1651 movlw high( d'489' )
1644 movwf sub_a+1 1652 movwf sub_a+1
1645 call TFT_dive_compass_label_proc ; check if the label should be on screen 1653 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1646 btfsc print_compass_label ; Yes? 1654 btfss print_compass_label ; Yes?
1647 STRCPY_PRINT "SE" ; yes - print it 1655 bra dcr_5
1648 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1656 STRCPY_TEXT_PRINT tSE ; yes - print it
1657 dcr_5:
1658 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1649 1659
1650 movlw d'6' 1660 movlw d'6'
1651 movwf up ; up stores the width of hte label 1661 movwf up ; up stores the width of hte label
1652 movlw low( d'538' ) ; position of the label 1662 movlw low( d'538' ) ; position of the label
1653 movwf sub_a+0 1663 movwf sub_a+0
1654 movlw high( d'538' ) 1664 movlw high( d'538' )
1655 movwf sub_a+1 1665 movwf sub_a+1
1656 call TFT_dive_compass_label_proc ; check if the label should be on screen 1666 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1657 btfsc print_compass_label ; Yes? 1667 btfss print_compass_label ; Yes?
1658 STRCPY_PRINT "S" ; yes - print it 1668 bra dcr_6
1659 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1669 STRCPY_TEXT_PRINT tS ; yes - print it
1670 dcr_6:
1671 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1660 1672
1661 movlw d'14' 1673 movlw d'14'
1662 movwf up ; up stores the width of hte label 1674 movwf up ; up stores the width of hte label
1663 movlw low( d'579' ) ; position of the label 1675 movlw low( d'579' ) ; position of the label
1664 movwf sub_a+0 1676 movwf sub_a+0
1665 movlw high( d'579' ) 1677 movlw high( d'579' )
1666 movwf sub_a+1 1678 movwf sub_a+1
1667 call TFT_dive_compass_label_proc ; check if the label should be on screen 1679 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1668 btfsc print_compass_label ; Yes? 1680 btfss print_compass_label ; Yes?
1669 STRCPY_PRINT "SW" ; yes - print it 1681 bra dcr_7
1670 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1682 STRCPY_TEXT_PRINT tSW ; yes - print it
1683 dcr_7:
1684 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1671 1685
1672 movlw d'7' 1686 movlw d'7'
1673 movwf up ; up stores the width of hte label 1687 movwf up ; up stores the width of hte label
1674 movlw low( d'627' ) ; position of the label 1688 movlw low( d'627' ) ; position of the label
1675 movwf sub_a+0 1689 movwf sub_a+0
1676 movlw high( d'627' ) 1690 movlw high( d'627' )
1677 movwf sub_a+1 1691 movwf sub_a+1
1678 call TFT_dive_compass_label_proc ; check if the label should be on screen 1692 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1679 btfsc print_compass_label ; Yes? 1693 btfss print_compass_label ; Yes?
1680 STRCPY_PRINT "W" ; yes - print it 1694 bra dcr_8
1681 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1695 STRCPY_TEXT_PRINT tW ; yes - print it
1696 dcr_8:
1697 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1682 1698
1683 movlw d'14' 1699 movlw d'14'
1684 movwf up ; up stores the width of hte label 1700 movwf up ; up stores the width of hte label
1685 movlw low( d'669' ) ; position of the label 1701 movlw low( d'669' ) ; position of the label
1686 movwf sub_a+0 1702 movwf sub_a+0
1687 movlw high( d'669' ) 1703 movlw high( d'669' )
1688 movwf sub_a+1 1704 movwf sub_a+1
1689 call TFT_dive_compass_label_proc ; check if the label should be on screen 1705 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1690 btfsc print_compass_label ; Yes? 1706 btfss print_compass_label ; Yes?
1691 STRCPY_PRINT "NW" ; yes - print it 1707 bra dcr_9
1692 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1708 STRCPY_TEXT_PRINT tNW ; yes - print it
1709 dcr_9:
1710 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1693 1711
1694 movlw d'6' 1712 movlw d'6'
1695 movwf up ; up stores the width of hte label 1713 movwf up ; up stores the width of hte label
1696 movlw low( d'718' ) ; position of the label 1714 movlw low( d'718' ) ; position of the label
1697 movwf sub_a+0 1715 movwf sub_a+0
1698 movlw high( d'718' ) 1716 movlw high( d'718' )
1699 movwf sub_a+1 1717 movwf sub_a+1
1700 call TFT_dive_compass_label_proc ; check if the label should be on screen 1718 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1701 btfsc print_compass_label ; Yes? 1719 btfss print_compass_label ; Yes?
1702 STRCPY_PRINT "N" ; yes - print it 1720 bra dcr_10
1703 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1721 STRCPY_TEXT_PRINT tN ; yes - print it
1722 dcr_10:
1723 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1704 1724
1705 movlw d'13' 1725 movlw d'13'
1706 movwf up ; up stores the width of hte label 1726 movwf up ; up stores the width of hte label
1707 movlw low( d'759' ) ; position of the label 1727 movlw low( d'759' ) ; position of the label
1708 movwf sub_a+0 1728 movwf sub_a+0
1709 movlw high( d'759' ) 1729 movlw high( d'759' )
1710 movwf sub_a+1 1730 movwf sub_a+1
1711 call TFT_dive_compass_label_proc ; check if the label should be on screen 1731 rcall TFT_dive_compass_label_proc ; check if the label should be on screen
1712 btfsc print_compass_label ; Yes? 1732 btfss print_compass_label ; Yes?
1713 STRCPY_PRINT "NE" ; yes - print it 1733 bra dcr_11
1714 call TFT_dive_compass_c_mk ; check if label is on the center line or the marker 1734 STRCPY_TEXT_PRINT tNE ; yes - print it
1735 dcr_11:
1736 rcall TFT_dive_compass_c_mk ; check if label is on the center line or the marker
1715 1737
1716 TFT_dive_compass_label_end: 1738 TFT_dive_compass_label_end:
1717 ; restore lo and hi for the final cleanup 1739 ; restore lo and hi for the final cleanup
1718 movff xLO,lo 1740 movff xLO,lo
1719 movff xHI,hi 1741 movff xHI,hi
1723 bra TFT_dive_compass_label_end2 ; D >= 160, no more space 1745 bra TFT_dive_compass_label_end2 ; D >= 160, no more space
1724 ; position left to end of display to clear the remaining area 1746 ; position left to end of display to clear the remaining area
1725 movlw d'160' 1747 movlw d'160'
1726 movff WREG,lo 1748 movff WREG,lo
1727 ; clear it 1749 ; clear it
1728 call TFT_dive_compass_clr_label 1750 rcall TFT_dive_compass_clr_label
1729 call TFT_dive_compass_c_mk ; this is not required until marker implemented... 1751 rcall TFT_dive_compass_c_mk ; this is not required until marker implemented...
1730 TFT_dive_compass_label_end2: 1752 TFT_dive_compass_label_end2:
1731 clrf WREG 1753 clrf WREG
1732 ;TFT_dive_compass_text: 1754 ;TFT_dive_compass_text:
1733 ; Text output 1755 ; Text output
1734 WIN_SMALL dive_compass_head_column,dive_compass_head_row 1756 WIN_SMALL dive_compass_head_column,dive_compass_head_row
1780 ; don't do a clear if we are at 0 (zero) otherwise it will blink 1802 ; don't do a clear if we are at 0 (zero) otherwise it will blink
1781 ; ?because of the width underflow? 1803 ; ?because of the width underflow?
1782 movlw d'0' 1804 movlw d'0'
1783 cpfsgt lo 1805 cpfsgt lo
1784 bra TFT_dive_compass_label_proc_p 1806 bra TFT_dive_compass_label_proc_p
1785 call TFT_dive_compass_clr_label 1807 rcall TFT_dive_compass_clr_label
1786 TFT_dive_compass_label_proc_p: 1808 TFT_dive_compass_label_proc_p:
1787 ; 4. print the SQ on the screen 1809 ; 4. print the SQ on the screen
1788 call TFT_standard_color 1810 call TFT_standard_color
1789 bsf print_compass_label 1811 bsf print_compass_label
1790 call TFT_dive_compass_label_print 1812 rcall TFT_dive_compass_label_print
1791 ; 6. retain the new display positions 1813 ; 6. retain the new display positions
1792 movff hi,divB ; old-hi will be used by the c_mk : clear+marker printing 1814 movff hi,divB ; old-hi will be used by the c_mk : clear+marker printing
1793 movff lo,hi 1815 movff lo,hi
1794 movff up,WREG 1816 movff up,WREG
1795 addwf hi,1 1817 addwf hi,1
1806 return 1828 return
1807 1829
1808 TFT_dive_compass_c_mk: 1830 TFT_dive_compass_c_mk:
1809 ; Common task to draw center line and marker 1831 ; Common task to draw center line and marker
1810 ; until a proper implementation make it simple: 1832 ; until a proper implementation make it simple:
1811 call TFT_dive_compass_cline 1833 rcall TFT_dive_compass_cline
1812 return 1834 return
1813 1835
1814 TFT_dive_compass_clr_label: 1836 TFT_dive_compass_clr_label:
1815 movlw dive_compass_label_row-.2 ; set top & height 1837 movlw dive_compass_label_row-.2 ; set top & height
1816 movff WREG,win_top 1838 movff WREG,win_top
1823 ; top tick 1845 ; top tick
1824 movlw dive_compass_tick_top_top ; set top & height 1846 movlw dive_compass_tick_top_top ; set top & height
1825 movff WREG,win_top 1847 movff WREG,win_top
1826 movlw dive_compass_tick_height 1848 movlw dive_compass_tick_height
1827 movff WREG,win_height 1849 movff WREG,win_height
1828 call TFT_dive_compass_clear 1850 rcall TFT_dive_compass_clear
1829 ;bottom tick 1851 ;bottom tick
1830 movlw dive_compass_tick_bot_top ; set top & height 1852 movlw dive_compass_tick_bot_top ; set top & height
1831 movff WREG,win_top 1853 movff WREG,win_top
1832 movlw dive_compass_tick_height 1854 movlw dive_compass_tick_height
1833 movff WREG,win_height 1855 movff WREG,win_height
1834 call TFT_dive_compass_clear 1856 rcall TFT_dive_compass_clear
1835 return 1857 return
1836 1858
1837 TFT_dive_compass_clear: 1859 TFT_dive_compass_clear:
1838 ; we receive RM in lo and DD in hi 1860 ; we receive RM in lo and DD in hi
1839 ; calculate width = RM-D 1861 ; calculate width = RM-D