Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 118:abd30446e1cd
show heading with leading zeros
author | heinrichsweikamp |
---|---|
date | Fri, 27 Jun 2014 10:18:41 +0200 |
parents | 6c577737c34e |
children | 3e84e2a64188 |
comparison
equal
deleted
inserted
replaced
117:6c577737c34e | 118:abd30446e1cd |
---|---|
1784 cpfsgt lo | 1784 cpfsgt lo |
1785 return | 1785 return |
1786 TFT_surface_compass_heading2: | 1786 TFT_surface_compass_heading2: |
1787 WIN_STD surf_compass_head_column,surf_compass_head_row | 1787 WIN_STD surf_compass_head_column,surf_compass_head_row |
1788 call TFT_standard_color | 1788 call TFT_standard_color |
1789 TFT_surface_compass_heading_common: ; Show "000° N" | |
1789 lfsr FSR2,buffer | 1790 lfsr FSR2,buffer |
1790 movff compass_heading+0,lo | 1791 movff compass_heading+0,lo |
1791 movff compass_heading+1,hi | 1792 movff compass_heading+1,hi |
1792 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | 1793 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
1793 bsf leftbind | 1794 bsf leftbind |
1794 output_16 | 1795 output_16dp .2 ; Result is "0.000" |
1795 bcf leftbind | 1796 bcf leftbind |
1797 ; rearrange figures to "000" | |
1798 movff buffer+2,buffer+0 | |
1799 movff buffer+3,buffer+1 | |
1800 movff buffer+4,buffer+2 | |
1801 lfsr FSR2,buffer+3 | |
1796 STRCAT "° " | 1802 STRCAT "° " |
1797 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2 | 1803 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2 |
1798 STRCAT_PRINT " " | 1804 STRCAT_PRINT " " |
1799 return | 1805 return |
1800 | 1806 |
1801 global TFT_dive_compass_heading | 1807 global TFT_dive_compass_heading |
1802 TFT_dive_compass_heading: | 1808 TFT_dive_compass_heading: |
1803 rcall compass_heading_common | 1809 rcall compass_heading_common |
1809 cpfsgt lo | 1815 cpfsgt lo |
1810 bra TFT_dive_compass_heading3 ; But update graph always in fast mode | 1816 bra TFT_dive_compass_heading3 ; But update graph always in fast mode |
1811 TFT_dive_compass_heading2: | 1817 TFT_dive_compass_heading2: |
1812 WIN_STD dive_compass_head_column,dive_compass_head_row | 1818 WIN_STD dive_compass_head_column,dive_compass_head_row |
1813 call TFT_standard_color | 1819 call TFT_standard_color |
1814 lfsr FSR2,buffer | 1820 rcall TFT_surface_compass_heading_common ; Show "000° N" |
1815 movff compass_heading+0,lo | |
1816 movff compass_heading+1,hi | |
1817 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required | |
1818 bsf leftbind | |
1819 output_16 | |
1820 bcf leftbind | |
1821 STRCAT "° " | |
1822 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2 | |
1823 STRCAT_PRINT " " | |
1824 TFT_dive_compass_heading3: | 1821 TFT_dive_compass_heading3: |
1825 return ; No graphical output (yet) | 1822 return ; No graphical output (yet) |
1826 | 1823 |
1827 movff compass_heading+0,sub_a+0 | 1824 movff compass_heading+0,sub_a+0 |
1828 movff compass_heading+1,sub_a+1 | 1825 movff compass_heading+1,sub_a+1 |