comparison src/tft.asm @ 370:67e631aa5b8c

debugging the compass screen
author heinrichsweikamp
date Tue, 18 Aug 2015 22:02:55 +0200
parents 0052a7a654b9
children fec5eec4c8b7
comparison
equal deleted inserted replaced
369:ca32cf2435c6 370:67e631aa5b8c
662 clrf TRISH ; PortH as output 662 clrf TRISH ; PortH as output
663 return 663 return
664 664
665 665
666 666
667 ;TFT_box_check_width:
668 ; tstfsz PRODH ; right border > 256?
669 ; bra TFT_width_check1 ; Yes
670 ; return ; No
671 ;TFT_width_check1:
672 ; movlw .1
673 ; movwf PRODH ; limit to 1
674 ; movlw .64
675 ; cpfsgt PRODL ; right border > 319?
676 ; return
677 ; movwf PRODL ; Yes, limit to 319
678 ; return
679 ;
680 ;TFT_box_check_width_left:
681 ; tstfsz PRODH ; right border > 256?
682 ; bra TFT_width_check_left1 ; Yes
683 ; return
684 ;TFT_width_check_left1:
685 ; movlw .1
686 ; movwf PRODH ; limit to 1
687 ; movlw .64
688 ; cpfsgt PRODL ; right border > 319?
689 ; return
690 ; clrf PRODL ; Yes, set to zero
691 ; clrf PRODH
692 ; return
693
694
667 ;============================================================================= 695 ;=============================================================================
668 ; Output TFT Window Address commands. 696 ; Output TFT Window Address commands.
669 ; Inputs : win_top, win_leftx2, win_height, win_width. 697 ; Inputs : win_top, win_leftx2, win_height, win_width.
670 ; Output : PortA/PortH commands. 698 ; Output : PortA/PortH commands.
671 ; Trashed: PROD 699 ; Trashed: PROD
683 btfsc flip_screen ; 180° rotation? 711 btfsc flip_screen ; 180° rotation?
684 bra DISP_box_flip_H ; Yes 712 bra DISP_box_flip_H ; Yes
685 bra TFT_box_write_16bit_win_left_com ; No 713 bra TFT_box_write_16bit_win_left_com ; No
686 TFT_box_write_16bit_win_left_d1: ; Display1 714 TFT_box_write_16bit_win_left_d1: ; Display1
687 btfss flip_screen ; 180° rotation? 715 btfss flip_screen ; 180° rotation?
688 bra DISP_box_flip_H ; Yes 716 bra DISP_box_flip_H ; No for d1
689 ; No 717 ; Yes for d1
690 TFT_box_write_16bit_win_left_com: 718 TFT_box_write_16bit_win_left_com:
691 ;---- Normal horizontal window --------------------------------------- 719 ;---- Normal horizontal window ---------------------------------------
720 ; rcall TFT_box_check_width_left ; Check the width
692 Index_out 0x52 ; Window Vertical Start Address 721 Index_out 0x52 ; Window Vertical Start Address
693 rcall TFT_DataWrite_PROD ; Output left 722 rcall TFT_DataWrite_PROD ; Output left
694 Index_out 0x21 ; Frame Memory Vertical Address 723 Index_out 0x21 ; Frame Memory Vertical Address
695 rcall TFT_DataWrite_PROD ; Output left 724 rcall TFT_DataWrite_PROD ; Output left
696 725
699 movff win_width+1,WREG 728 movff win_width+1,WREG
700 addwfc PRODH,F 729 addwfc PRODH,F
701 decf PRODL,F ; decrement result 730 decf PRODL,F ; decrement result
702 btfss STATUS,C 731 btfss STATUS,C
703 decf PRODH,F 732 decf PRODH,F
733 ; rcall TFT_box_check_width ; Check the width
704 734
705 Index_out 0x53 ; Window Vertical End Address 735 Index_out 0x53 ; Window Vertical End Address
706 rcall TFT_DataWrite_PROD 736 rcall TFT_DataWrite_PROD
707 bra DISP_box_noflip_H 737 bra DISP_box_noflip_H
708 738
715 btfss STATUS,C ; Borrow = /CARRY 745 btfss STATUS,C ; Borrow = /CARRY
716 incf WREG 746 incf WREG
717 sublw HIGH(.319) 747 sublw HIGH(.319)
718 movwf PRODH 748 movwf PRODH
719 749
750 ; rcall TFT_box_check_width ; Check the width
751
720 Index_out 0x53 ; Window Vertical Start Address 752 Index_out 0x53 ; Window Vertical Start Address
721 rcall TFT_DataWrite_PROD ; Output left 753 rcall TFT_DataWrite_PROD ; Output left
722 Index_out 0x21 ; Frame Memory Vertical Address 754 Index_out 0x21 ; Frame Memory Vertical Address
723 rcall TFT_DataWrite_PROD ; Output left 755 rcall TFT_DataWrite_PROD ; Output left
724 756
726 subwf PRODL,F ; PRODL - WREG --> PRODL 758 subwf PRODL,F ; PRODL - WREG --> PRODL
727 movff win_width+1,WREG 759 movff win_width+1,WREG
728 subwfb PRODH,F 760 subwfb PRODH,F
729 infsnz PRODL ; PROD+1 --> PROD 761 infsnz PRODL ; PROD+1 --> PROD
730 incf PRODH 762 incf PRODH
763
764 ; rcall TFT_box_check_width_left ; Check the width
731 765
732 Index_out 0x52 ; Window Vertical End Address 766 Index_out 0x52 ; Window Vertical End Address
733 rcall TFT_DataWrite_PROD 767 rcall TFT_DataWrite_PROD
734 768
735 DISP_box_noflip_H: 769 DISP_box_noflip_H:
864 TFT_box3: ; loop width times 898 TFT_box3: ; loop width times
865 movff win_color1,PORTA ; Upper 899 movff win_color1,PORTA ; Upper
866 movff win_color2,PORTH ; Lower 900 movff win_color2,PORTH ; Lower
867 WR_L 901 WR_L
868 WR_H ; Tick 902 WR_H ; Tick
869 903 ;
870 movff win_color1,PORTA ; Upper 904 ; movff win_color1,PORTA ; Upper
871 movff win_color2,PORTH ; Lower 905 ; movff win_color2,PORTH ; Lower
872 WR_L 906 WR_L
873 WR_H ; Tick 907 WR_H ; Tick
874 908
875 decfsz PRODL,F ; row loop finished ? 909 decfsz PRODL,F ; row loop finished ?
876 bra TFT_box3 ; No: continue. 910 bra TFT_box3 ; No: continue.