annotate src/tft.asm @ 655:c7b7b8a358cd default tip

hwOS tech 3.22 release
author heinrichsweikamp
date Mon, 29 Apr 2024 13:05:18 +0200
parents 75e90cd0c2c3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
3 ; File tft.asm combined next generation V3.09.4n
0
heinrichsweikamp
parents:
diff changeset
4 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
5 ; low-level Display Outputs
0
heinrichsweikamp
parents:
diff changeset
6 ;
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, heinrichs weikamp gmbh, all right reserved.
0
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code.
heinrichsweikamp
parents:
diff changeset
11
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 225
diff changeset
12 #include "hwos.inc"
0
heinrichsweikamp
parents:
diff changeset
13 #include "wait.inc"
heinrichsweikamp
parents:
diff changeset
14 #include "varargs.inc"
heinrichsweikamp
parents:
diff changeset
15 #include "tft_outputs.inc"
heinrichsweikamp
parents:
diff changeset
16 #include "eeprom_rs232.inc"
heinrichsweikamp
parents:
diff changeset
17
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
18 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
19 ; Basic bit-level macros
heinrichsweikamp
parents:
diff changeset
20
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
21 RD_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
22 bsf tft_rd,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
23 endm
0
heinrichsweikamp
parents:
diff changeset
24
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
25 RD_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
26 bcf tft_rd,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
27 endm
0
heinrichsweikamp
parents:
diff changeset
28
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
29 RS_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
30 bsf tft_rs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
31 endm
0
heinrichsweikamp
parents:
diff changeset
32
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
33 RS_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
34 bcf tft_rs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
35 endm
0
heinrichsweikamp
parents:
diff changeset
36
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
37 NCS_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
38 bsf tft_cs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
39 endm
0
heinrichsweikamp
parents:
diff changeset
40
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
41 NCS_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
42 bcf tft_cs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
43 endm
0
heinrichsweikamp
parents:
diff changeset
44
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
45 WR_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
46 bsf tft_nwr,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
47 endm
0
heinrichsweikamp
parents:
diff changeset
48
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
49 WR_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
50 bcf tft_nwr,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
51 endm
0
heinrichsweikamp
parents:
diff changeset
52
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
53 ;-----------------------------------------------------------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
54 ; Byte-level macros
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
55
0
heinrichsweikamp
parents:
diff changeset
56 Index_out macro low_b
heinrichsweikamp
parents:
diff changeset
57 movlw low_b
heinrichsweikamp
parents:
diff changeset
58 rcall TFT_CmdWrite
heinrichsweikamp
parents:
diff changeset
59 endm
heinrichsweikamp
parents:
diff changeset
60
heinrichsweikamp
parents:
diff changeset
61 Parameter_out macro high_b, low_b
heinrichsweikamp
parents:
diff changeset
62 movlw high_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
63 movwf PORTA ; upper
0
heinrichsweikamp
parents:
diff changeset
64 movlw low_b
heinrichsweikamp
parents:
diff changeset
65 rcall TFT_DataWrite
heinrichsweikamp
parents:
diff changeset
66 endm
heinrichsweikamp
parents:
diff changeset
67
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
68 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
69 tft CODE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
70 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
71
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
72 global TFT_ClearScreen
0
heinrichsweikamp
parents:
diff changeset
73 TFT_ClearScreen:
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
74 btfsc screen_type4 ; screen type 4?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
75 bra TFT_ClearScreen_display4; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
76 btfsc screen_type3 ; screen type 3?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
77 bra TFT_ClearScreen_display3; YES
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
78 btfsc screen_type2 ; screen type 2?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
79 bra TFT_ClearScreen_display2; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
80
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
81 Index_out 0x50 ; window horizontal start address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
82 Parameter_out 0x00, 0x00 ; 0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
83 Index_out 0x51 ; window horizontal end address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
84 Parameter_out 0x00, 0xEF ; 239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
85 Index_out 0x52 ; window vertical start address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
86 Parameter_out 0x00, 0x00 ; 0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
87 Index_out 0x53 ; window vertical end address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
88 Parameter_out 0x01, 0x3F ; 319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
89 Index_out 0x20 ; frame memory horizontal address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
90 Parameter_out 0x00, 0x00 ; 0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
91 Index_out 0x21 ; frame memory vertical address
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
92 Parameter_out 0x01, 0x3F ; 319
0
heinrichsweikamp
parents:
diff changeset
93
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
94 Index_out 0x22 ; frame memory data write start
0
heinrichsweikamp
parents:
diff changeset
95
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
96 RD_H ; not read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
97 RS_H ; data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
98 NCS_L ; not CS
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
99
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
100 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
101 clrf PORTA ; YES, data lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
102 btfss less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
103 clrf PORTH ; NO, data lower
0
heinrichsweikamp
parents:
diff changeset
104
heinrichsweikamp
parents:
diff changeset
105 movlw d'10'
heinrichsweikamp
parents:
diff changeset
106 movwf tft_temp3
heinrichsweikamp
parents:
diff changeset
107 TFT_ClearScreen2:
heinrichsweikamp
parents:
diff changeset
108 movlw d'30'
heinrichsweikamp
parents:
diff changeset
109 movwf tft_temp2
heinrichsweikamp
parents:
diff changeset
110 TFT_ClearScreen3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
111 clrf tft_temp1 ; 30*10*256=76800 pixels -> clear complete 240*320
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
112 bcf INTCON,GIE
0
heinrichsweikamp
parents:
diff changeset
113 TFT_ClearScreen4:
heinrichsweikamp
parents:
diff changeset
114 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
115 WR_H ; tick
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
116 btfss less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
117 bra TFT_ClearScreen5 ; NO
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
118 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
119 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
120 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
121 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
122 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
123 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
124 TFT_ClearScreen5:
0
heinrichsweikamp
parents:
diff changeset
125 decfsz tft_temp1,F
heinrichsweikamp
parents:
diff changeset
126 bra TFT_ClearScreen4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
127 bsf INTCON,GIE
0
heinrichsweikamp
parents:
diff changeset
128 decfsz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
129 bra TFT_ClearScreen3
heinrichsweikamp
parents:
diff changeset
130 decfsz tft_temp3,F
heinrichsweikamp
parents:
diff changeset
131 bra TFT_ClearScreen2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
132
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
133 movlw 0x00 ; NOP, to stop window mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
134 bra TFT_CmdWrite ; and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
135
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
136 TFT_ClearScreen_display2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
137 movlw 0x02 ; column address start
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
138 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
139 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
140 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
141 movlw 0x03
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
142 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
143 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
144 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
145
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
146 movlw 0x04 ; column address end
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
147 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
148 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
149 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
150 movlw 0x05
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
151 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
152 movlw 0xEF
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
153 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
154
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
155 movlw 0x06 ; row address start
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
156 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
157 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
158 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
159 movlw 0x07
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
160 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
161 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
162 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
163
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
164 movlw 0x08 ; row address end
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
165 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
166 movlw 0x01
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
167 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
168 movlw 0x09
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
169 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
170 movlw 0x3F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
171 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
172
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
173 movlw 0x22 ; start writing data to GRAM
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
174 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
175
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
176 movlw .160 ; 160 x 240 x 6 = 230400 ticks
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
177 TFT_ClearScreen_display2_loop0:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
178 bsf tft_rs ; data!
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
179 movwf PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
180 clrf PORTH
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
181 TFT_ClearScreen_display2_loop1:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
182 movlw .240
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
183 movwf PRODL
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
184 TFT_ClearScreen_display2_loop2:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
185 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
186 bsf tft_nwr ; upper
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
187 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
188 bsf tft_nwr ; high
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
189 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
190 bsf tft_nwr ; lower
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
191 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
192 bsf tft_nwr ; upper
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
193 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
194 bsf tft_nwr ; high
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
195 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
196 bsf tft_nwr ; lower
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
197 decfsz PRODL,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
198 bra TFT_ClearScreen_display2_loop2
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
199 decfsz PRODH,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
200 bra TFT_ClearScreen_display2_loop1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
201 return
0
heinrichsweikamp
parents:
diff changeset
202
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
203 TFT_ClearScreen_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
204 movlw 0x35 ; vertical start address HIGH:LOW
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
205 rcall TFT_CmdWrite
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
206 mullw 0
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
207 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
208
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
209 movlw 0x36 ; vertical end address HIGH:LOW
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
210 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
211 movlw 0x01
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
212 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
213 movlw 0x3F
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
214 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
215
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
216 movlw 0x37 ; horizontal address START:END
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
217 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
218 movlw 0x00
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
219 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
220 movlw 0xEF
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
221 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
222
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
223 movlw 0x20 ; start address horizontal (.0 - .239)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
224 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
225 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
226
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
227 movlw 0x21 ; start address vertical (.0 - .319)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
228 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
229 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
230
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
231 movlw 0x22 ; start writing data to GRAM
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
232 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
233
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
234 movlw .107 ; 107 x 240 x 6 = 154080 ticks (153600 would be enough)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
235 bra TFT_ClearScreen_display2_loop0
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
236
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
237 TFT_ClearScreen_display4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
238 ; Column Address start
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
239 movlw 0x2A
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
240 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
241 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
242 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
243 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
244 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
245 ; Column Address end (d'239')
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
246 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
247 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
248 movlw 0xEF
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
249 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
250
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
251 ; Row address start
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
252 movlw 0x2B
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
253 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
254 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
255 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
256 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
257 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
258 ; Row address end (d'319)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
259 movlw 0x01
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
260 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
261 movlw 0x3F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
262 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
263
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
264 movlw 0x2C ; Start Writing Data to GRAM
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
265 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
266
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
267 RD_H ; Not Read
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
268 RS_H ; Data
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
269 NCS_L ; Not CS
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
270 clrf PORTA ; Data Upper
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
271 clrf PORTH ; Data Lower
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
272 bcf INTCON,GIE
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
273 movlw d'10'
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
274 movwf tft_temp3
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
275 TFT_ClearScreen_display4_loop1:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
276 movlw d'30'
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
277 movwf tft_temp2
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
278 TFT_ClearScreen_display4_loop2:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
279 clrf tft_temp1 ; 30*10*256=76800 Pixels -> Clear complete 240*320
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
280 TFT_ClearScreen_display4_loop3:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
281 WR_L
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
282 WR_H ; Tick
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
283 decfsz tft_temp1,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
284 bra TFT_ClearScreen_display4_loop3
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
285 decfsz tft_temp2,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
286 bra TFT_ClearScreen_display4_loop2
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
287 decfsz tft_temp3,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
288 bra TFT_ClearScreen_display4_loop1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
289 bsf INTCON,GIE
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
290 return
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
291
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
292
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
293 global TFT_DisplayOff
0
heinrichsweikamp
parents:
diff changeset
294 TFT_DisplayOff:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
295 bcf lightsen_power ; power-down light sensor
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
296 btfsc screen_type3 ; screen type 3 ?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
297 bra TFT_DisplayOff_display3 ; YES - screen needs special power-down sequence
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
298 clrf CCP1CON ; NO - stop PWM
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
299 bcf PORTC,2 ; - pull PWM out to GND
0
heinrichsweikamp
parents:
diff changeset
300 clrf PORTA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
301 clrf PORTH
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
302 RD_L ; LOW
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
303 RS_L ; LOW
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
304 WR_L
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
305 NCS_L
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
306 bcf tft_nreset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
307 bsf tft_power ; inverted...
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
308 return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
309
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
310 TFT_DisplayOff_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
311 movlw 0x05
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
312 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
313 movlw 0x00
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
314 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
315 movlw 0x00
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
316 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
317 WAITMS d'32'
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
318 clrf CCP1CON ; stop PWM
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
319 bcf PORTC,2 ; pull PWM out to GND
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
320 WAITMS d'32'
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
321 movlw 0x10
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
322 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
323 movlw 0x00
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
324 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
325 movlw 0x01
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
326 rcall TFT_DataWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
327 WAITMS d'100'
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
328 clrf PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
329 bcf tft_nwr
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
330 bcf tft_cs
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
331 bcf tft_nreset
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
332 WAITMS d'10'
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
333 bsf tft_power ; inverted...
0
heinrichsweikamp
parents:
diff changeset
334 return
heinrichsweikamp
parents:
diff changeset
335
heinrichsweikamp
parents:
diff changeset
336 ; -----------------------------
heinrichsweikamp
parents:
diff changeset
337 ; TFT boot
heinrichsweikamp
parents:
diff changeset
338 ; -----------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
339
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
340 global TFT_boot
0
heinrichsweikamp
parents:
diff changeset
341 TFT_boot:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
342 ; switch off backlight
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
343 clrf CCP1CON ; stop PWM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
344 bcf PORTC,2 ; pull PWM out to GND
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
345
0
heinrichsweikamp
parents:
diff changeset
346 clrf PORTA
heinrichsweikamp
parents:
diff changeset
347 clrf PORTH
heinrichsweikamp
parents:
diff changeset
348 RD_L ; LOW
heinrichsweikamp
parents:
diff changeset
349 nop
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
350 WR_L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
351 nop
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
352 NCS_L ; Not CS
0
heinrichsweikamp
parents:
diff changeset
353 nop
heinrichsweikamp
parents:
diff changeset
354 bcf tft_nreset
heinrichsweikamp
parents:
diff changeset
355 WAITMS d'1'
heinrichsweikamp
parents:
diff changeset
356 bcf tft_power ; inverted...
heinrichsweikamp
parents:
diff changeset
357 WAITMS d'1'
heinrichsweikamp
parents:
diff changeset
358 RD_H ; Keep high
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
359 nop
0
heinrichsweikamp
parents:
diff changeset
360 WAITMS d'2'
heinrichsweikamp
parents:
diff changeset
361 bsf tft_nreset
461
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
362 WAITMS d'5'
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
363 bcf tft_nreset
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
364 WAITMS d'5'
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
365 bsf tft_nreset
0
heinrichsweikamp
parents:
diff changeset
366 WAITMS d'150'
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
367 WR_H ; release bus
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
368 bsf lightsen_power ; supply power to light sensor
0
heinrichsweikamp
parents:
diff changeset
369
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
370 btfsc screen_type3 ; display type 3 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
371 bra TFT_boot_screen3 ; YES
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
372
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
373 btfsc screen_type4 ; display type 4 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
374 bra TFT_boot_screen4 ; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
375
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
376 ; Data Transfer Synchronization
0
heinrichsweikamp
parents:
diff changeset
377 Parameter_out 0x00, 0x00
heinrichsweikamp
parents:
diff changeset
378 Parameter_out 0x00, 0x00
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
379
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
380 btfsc screen_type2 ; display type 2 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
381 bra TFT_boot_screen2 ; YES
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
382
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
383 ; Get screen type from Bootloader-Info
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
384 movlw 0x7B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
385 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
386 movlw 0xF7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
387 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
388 movlw 0x01
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
389 movwf TBLPTRU
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
390 TBLRD*+ ; reads 0x6E for cR and USB OSTC3, 0x00 for BLE (2 and 3), and 0x02 for display 1 OSTC
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
391 movlw 0x02 ; coding for display 1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
392 cpfseq TABLAT ; display 1 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
393 bra TFT_boot_0 ; NO - display 0
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
394
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
395 TFT_boot_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
396 ; Init through config table...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
397 movlw 0x74
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
398 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
399 movlw 0xF7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
400 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
401 movlw 0x01
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
402 movwf TBLPTRU
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
403 bsf screen_type1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
404 bra TFT_boot_com
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
405
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 436
diff changeset
406 TFT_boot_0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
407 ; Init through config table...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
408 movlw LOW display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
409 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
410 movlw HIGH display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
411 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
412 movlw UPPER display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
413 movwf TBLPTRU
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
414 btfss less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
415 bcf screen_type1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
416
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
417 TFT_boot_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
418 rcall display0_init_loop
0
heinrichsweikamp
parents:
diff changeset
419
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
420 Index_out 0x03
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
421 btfsc flip_screen ; 180° rotation ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
422 bra TFT_boot2 ; YES
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
423
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
424 btfss screen_type1 ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
425 bra TFT_boot1a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
426 Parameter_out 0x10, 0x00 ; display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
427 bra TFT_boot3
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
428 TFT_boot1a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
429 Parameter_out 0x50, 0x20 ; display0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
430 bra TFT_boot3
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
431 TFT_boot2:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
432 btfss screen_type1 ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
433 bra TFT_boot2a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
434 Parameter_out 0x10, 0x30 ; display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
435 bra TFT_boot3
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
436 TFT_boot2a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
437 Parameter_out 0x50, 0x10 ; display0
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
438 TFT_boot3:
0
heinrichsweikamp
parents:
diff changeset
439 Index_out 0x22
225
31088352ee32 BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents: 152
diff changeset
440 rcall TFT_ClearScreen
0
heinrichsweikamp
parents:
diff changeset
441 Index_out 0x07
312
b2f6a4b01e64 Config table for alternative display
heinrichsweikamp
parents: 275
diff changeset
442 Parameter_out 0x01, 0x33
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
443 return ; done TFT_boot
0
heinrichsweikamp
parents:
diff changeset
444
heinrichsweikamp
parents:
diff changeset
445 display0_config_table:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
446 ; Reg, Dat0, Dat1 or 0xFF,0x00,0x00 for end
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
447 db 0xA4,0x00,0x01,0xFF,.002,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
448 db 0x09,0x00,0x01,0x92,0x04,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
449 db 0x93,0x04,0x02,0x94,0x00,0x02
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
450 db 0x07,0x00,0x00,0x10,0x04,0x30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
451 db 0x11,0x02,0x37,0x12,0x11,0x8D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
452 db 0x13,0x11,0x00,0x01,0x01,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
453 db 0x02,0x02,0x00,0x03,0x50,0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
454 db 0x0A,0x00,0x08,0x0D,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
455 db 0x0E,0x00,0x30,0xFF,.151,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
456 db 0x12,0x11,0xBD,0x20,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
457 db 0x21,0x00,0x00,0x30,0x06,0x02
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
458 db 0x31,0x56,0x0D,0x32,0x05,0x07
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
459 db 0x33,0x06,0x09,0x34,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
460 db 0x35,0x09,0x06,0x36,0x57,0x05
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
461 db 0x37,0x0D,0x06,0x38,0x02,0x06
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
462 db 0x39,0x00,0x00,0xFF,0x00,0x00
0
heinrichsweikamp
parents:
diff changeset
463
heinrichsweikamp
parents:
diff changeset
464 display0_init_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
465 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
466 movlw 0xFF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
467 cpfseq TABLAT
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
468 bra display0_config_write ; write configuration data pair to display
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
469 ; Delay ms or quit (return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
470 TBLRD*+
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
471 tstfsz TABLAT ; end of configuration data?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
472 bra $+4 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
473 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
474 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
475 call WAITMSX ; wait WREG milliseconds
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
476 TBLRD*+ ; dummy read (Third byte of delay command)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
477 bra display0_init_loop ; loop
0
heinrichsweikamp
parents:
diff changeset
478
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
479 display0_config_write: ; with command in WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
480 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
481 rcall TFT_CmdWrite ; write command
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
482 TBLRD*+ ; get config0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
483 movff TABLAT,PORTA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
484 TBLRD*+ ; get config1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
485 movf TABLAT,W
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
486 rcall TFT_DataWrite ; write configuration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
487 bra display0_init_loop ; loop
0
heinrichsweikamp
parents:
diff changeset
488
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
489
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
490 TFT_boot_screen2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
491 rcall display1_init ; initialization sequence
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
492
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
493 btfss flip_screen ; 180° rotation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
494 bra TFT_ClearScreen ; NO - done: clear screen and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
495 ; flip the GRAM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
496 Index_out 0x16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
497 movlw 0x48 ; flip image in the GRAM (very elegant with display 2...)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
498 rcall TFT_DataWrite ; Write configuration
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
499 bra TFT_ClearScreen ; clear screen and return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
500
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
501 TFT_boot_screen3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
502 rcall display1_init ; init sequence
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
503 rcall TFT_ClearScreen
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
504 setf CCPR1L ; duty cycle, 255 is required for OLED
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
505 ; Set brightness
645
070528a88715 3.16 release
heinrichsweikamp
parents: 640
diff changeset
506 movff brightness,PRODL ; =0: Eco, =1:Medium, =2:Full
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
507 incf PRODL,F ; +1
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
508 dcfsnz PRODL,F
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
509 rcall TFT_display3_low
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
510 dcfsnz PRODL,F
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
511 rcall TFT_display3_med
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
512 dcfsnz PRODL,F
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
513 rcall TFT_display3_high
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
514 ; ToDo: Flip....
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
515 return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
516
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
517 display1_init:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
518 movlw LOW (0x1F8BC )
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
519 movwf TBLPTRL
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
520 movlw HIGH (0x1F8BC & 0xFFFF)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
521 movwf TBLPTRH
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
522 movlw UPPER (0x1F8BC )
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
523 movwf TBLPTRU
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
524 display1_init_loop:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
525 TBLRD*+
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
526 movlw 0xFF ; coding for end of configuration or wait step
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
527 cpfseq TABLAT
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
528 bra display1_config_write ; write configuration pair to display
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
529 ; Delay ms or quit (return)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
530 TBLRD*+
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
531 tstfsz TABLAT ; end of configuration?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
532 bra $+4 ; NO - skip return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
533 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
534 movf TABLAT,W ; read waiting time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
535 call WAITMSX ; wait WREG milliseconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
536 bra display1_init_loop ; loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
537 display1_config_write: ; with command in WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
538 movf TABLAT,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
539 rcall TFT_CmdWrite ; write command
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
540 TBLRD*+ ; get configuration
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
541 movf TABLAT,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
542 rcall TFT_DataWrite ; write configuration
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
543 btfss screen_type3 ; screen 3 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
544 bra display1_init_loop ; NO - loop
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
545 ; Screen 3 gets another byte from the table
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
546 TBLRD*+ ; get configuration
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
547 movf TABLAT,W
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
548 rcall TFT_DataWrite ; write configuration
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
549 bra display1_init_loop ; loop
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
550
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
551 TFT_boot_screen4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
552 movlw 0xB0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
553 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
554 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
555 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
556 movlw 0xC4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
557 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
558
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
559 movlw 0xB1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
560 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
561 movlw 0xC0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
562 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
563
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
564 movlw 0x3A
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
565 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
566 movlw 0x55
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
567 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
568
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
569 movlw 0x36 ; x/y mirror, see page 125 of ST7789V datasheet
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
570 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
571 movlw 0x40 ; 0x40 (normal orientation)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
572 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
573
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
574 movlw 0xB0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
575 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
576 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
577 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
578
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
579 movlw 0xB2
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
580 call TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
581 movlw 0x0C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
582 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
583 movlw 0x0C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
584 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
585 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
586 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
587 movlw 0x33
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
588 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
589 movlw 0x33
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
590 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
591
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
592 movlw 0xB7
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
593 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
594 movlw 0x75
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
595 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
596
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
597 movlw 0xBB
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
598 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
599 movlw 0x20
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
600 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
601
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
602 movlw 0xC0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
603 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
604 movlw 0x2C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
605 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
606
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
607 movlw 0xC2
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
608 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
609 movlw 0x01
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
610 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
611
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
612 movlw 0xC3
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
613 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
614 movlw 0x19
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
615 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
616
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
617 movlw 0xC4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
618 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
619 movlw 0x20
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
620 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
621
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
622 movlw 0xC6
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
623 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
624 movlw 0x0F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
625 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
626
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
627 movlw 0xD0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
628 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
629 movlw 0xA7
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
630 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
631 movlw 0xA1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
632 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
633
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
634 movlw 0xBB
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
635 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
636 movlw 0x35
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
637 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
638
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
639 movlw 0xC0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
640 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
641 movlw 0x2C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
642 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
643
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
644 movlw 0xC2
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
645 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
646 movlw 0x01
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
647 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
648
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
649 movlw 0xC3
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
650 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
651 movlw 0x11
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
652 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
653
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
654 movlw 0xC4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
655 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
656 movlw 0x20
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
657 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
658
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
659 movlw 0xC6
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
660 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
661 movlw 0x0F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
662 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
663
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
664 movlw 0xD0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
665 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
666 movlw 0xA7
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
667 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
668 movlw 0xA1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
669 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
670
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
671 movlw 0xBB
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
672 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
673 movlw 0x35
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
674 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
675
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
676 movlw 0xC0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
677 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
678 movlw 0x2C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
679 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
680
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
681 movlw 0x2C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
682 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
683 movlw 0x01
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
684 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
685
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
686 movlw 0xC3
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
687 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
688 movlw 0x11
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
689 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
690
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
691 movlw 0xC4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
692 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
693 movlw 0x20
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
694 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
695
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
696 movlw 0xC6
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
697 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
698 movlw 0x0F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
699 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
700
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
701 movlw 0xD0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
702 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
703 movlw 0xA4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
704 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
705 movlw 0xA1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
706 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
707 ; gamma
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
708 movlw 0x11
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
709 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
710
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
711 movlw 0x21
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
712 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
713 WAITMS d'60'
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
714
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
715 movlw 0x29
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
716 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
717 WAITMS d'50'
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
718 rcall TFT_ClearScreen
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
719 ; ToDo: Flip....
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
720 return ; done TFT_boot
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
721
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
722
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
723 global TFT_CmdWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
724 TFT_CmdWrite:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
725 RS_L ; command
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
726 ; btfsc screen_type2
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
727 ; bra TFT_CmdWrite_screen2
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
728 clrf PORTA ; upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
729 bcf INTCON,GIE
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
730 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
731 bra TFT_CmdWrite_less_io ; YES
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
732 movwf PORTH ; lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
733 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
734 WR_H ; tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
735 bsf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
736 return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
737 ;TFT_CmdWrite_screen2:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
738 ; movwf PORTH ; lower
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
739 ; WR_L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
740 ; WR_H ; tick
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
741 ; return;
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
742
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
743 TFT_CmdWrite_less_io:
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
744 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
745 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
746 movwf PORTA ; lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
747 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
748 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
749 bsf INTCON,GIE
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
750 return
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
751
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
752 global TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
753 TFT_DataWrite:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
754 RS_H ; data
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
755 ; btfsc screen_type2
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
756 ; bra TFT_DataWrite_screen2
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
757 bcf INTCON,GIE
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
758 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
759 bra TFT_DataWrite_less_io ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
760 movwf PORTH ; lower
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
761 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
762 WR_H ; tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
763 bsf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
764 return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
765 ;TFT_DataWrite_screen2:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
766 ; movwf PORTH ; lower
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
767 ; WR_L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
768 ; WR_H ; tick
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
769 ; return
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
770 TFT_DataWrite_less_io:
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
771 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
772 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
773 movwf PORTA ; lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
774 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
775 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
776 bsf INTCON,GIE
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
777 return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
778
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
779
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
780 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
781 ; Smooth lighting-up of the display:
heinrichsweikamp
parents:
diff changeset
782 ;
heinrichsweikamp
parents:
diff changeset
783 ; Trashes: WREG, PRODL
heinrichsweikamp
parents:
diff changeset
784 ; Typical usage:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
785 ; clrf CCPR1L ; backlight off
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
786 ; [draw splash screen]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
787 ; call TFT_DisplayFadeIn
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
788 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
789 global TFT_Display_FadeIn
0
heinrichsweikamp
parents:
diff changeset
790 TFT_Display_FadeIn:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
791 movlw CCP1CON_VALUE ; get configuration
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
792 movwf CCP1CON ; set configuration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
793 bsf tft_is_dimming ; TFT is dimming, ignore ambient sensor
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
794 btfsc screen_type3
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
795 bra TFT_Display_FadeIn_1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
796 clrf CCPR1L ; backlight off - to be sure
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
797 movff max_CCPR1L,PRODL
0
heinrichsweikamp
parents:
diff changeset
798 TFT_Display_FadeIn_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
799 incf CCPR1L,F ; duty cycle
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
800 WAITMS d'2'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
801 decfsz PRODL,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
802 bra TFT_Display_FadeIn_0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
803 bcf tft_is_dimming ; dimming done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
804 return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
805 TFT_Display_FadeIn_1:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
806 setf CCPR1L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
807 return
0
heinrichsweikamp
parents:
diff changeset
808
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
809 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
810 ; Smooth lighting-off of the display:
heinrichsweikamp
parents:
diff changeset
811 ; Trashes: WREG, PRODL
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
812 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
813 global TFT_Display_FadeOut
0
heinrichsweikamp
parents:
diff changeset
814 TFT_Display_FadeOut:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
815 movff max_CCPR1L,PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
816 bsf tft_is_dimming ; TFT is dimming, ignore ambient sensor
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
817 btfsc screen_type3
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
818 return ; Do not fade out screen type 3
0
heinrichsweikamp
parents:
diff changeset
819 TFT_Display_FadeOut_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
820 movff PRODL,CCPR1L ; duty cycle
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
821 WAITMS d'1'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
822 decfsz PRODL,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
823 bra TFT_Display_FadeOut_0
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
824 TFT_Display_FadeOut_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
825 clrf CCPR1L
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
826 return
0
heinrichsweikamp
parents:
diff changeset
827
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
828 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
829 ; OLED brightness control
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
830 ;
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
831 TFT_display3_high: ; 0x01F8F8
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
832 movlw LOW (0x01F8F8 )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
833 movwf TBLPTRL
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
834 movlw HIGH (0x01F8F8 & 0xFFFF)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
835 movwf TBLPTRH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
836 movlw UPPER (0x01F8F8 )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
837 movwf TBLPTRU
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
838 bra display1_init_loop ; and return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
839
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
840 TFT_display3_med: ; 0x01F91C
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
841 movlw LOW (0x01F91C )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
842 movwf TBLPTRL
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
843 movlw HIGH (0x01F91C & 0xFFFF)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
844 movwf TBLPTRH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
845 movlw UPPER (0x01F91C )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
846 movwf TBLPTRU
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
847 bra display1_init_loop ; and return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
848
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
849 TFT_display3_low: ; 0x01F8D4
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
850 movlw LOW (0x01F8D4 )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
851 movwf TBLPTRL
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
852 movlw HIGH (0x01F8D4 & 0xFFFF)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
853 movwf TBLPTRH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
854 movlw UPPER (0x01F8D4 )
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
855 movwf TBLPTRU
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
856 bra display1_init_loop ; and return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
857
0
heinrichsweikamp
parents:
diff changeset
858
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
859 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
860 ; colored (filled) Boxes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
861 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
862 global box_std_block, box_black_block, box_color_block, box_color
0
heinrichsweikamp
parents:
diff changeset
863
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
864 box_std_block: ; use white color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
865 setf WREG
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
866 bra box_color_block
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
867 box_black_block: ; use black color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
868 clrf WREG
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
869 box_color_block: ; use color from WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
870 rcall TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
871 VARARGS_BEGIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
872 VARARGS_GET8 win_top
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
873 VARARGS_GET8 win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
874 VARARGS_GET8 win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
875 VARARGS_GET8 win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
876 VARARGS_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
877 bra TFT_box
0
heinrichsweikamp
parents:
diff changeset
878
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
879 box_color: ; use color from WREG and pre-set coordinates
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
880 rcall TFT_set_color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
881 bra TFT_box
0
heinrichsweikamp
parents:
diff changeset
882
heinrichsweikamp
parents:
diff changeset
883
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
884 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
885 ; colored Frames
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
886 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
887 global box_frame_std, box_frame_color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
888
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
889 box_frame_std: ; use white color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
890 setf WREG
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
891 box_frame_color: ; use color from WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
892 rcall TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
893 VARARGS_BEGIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
894 VARARGS_GET8 win_top
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
895 VARARGS_GET8 win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
896 VARARGS_GET8 win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
897 VARARGS_GET8 win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
898 VARARGS_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
899 bra TFT_frame
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
900
0
heinrichsweikamp
parents:
diff changeset
901
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
902 ; ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
903 ; ; Init for half_pixel_write
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
904 ; ; Set column register on TFT device, and current color.
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
905 ; ; Inputs: win_leftx2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
906 ; ; Outputs: win_color_1/_2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
907 ; ; Trashed: WREG, PROD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
908 ; ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
909 ; ; global init_pixel_write
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
910 ; ;init_pixel_write:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
911 ; ; movf win_leftx2,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
912 ; ; mullw 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
913 ; ; rcall pixel_write_col320 ; start address vertical (.0 - .319)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
914 ; ; setf WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
915 ; ; bra TFT_set_color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
916
0
heinrichsweikamp
parents:
diff changeset
917
heinrichsweikamp
parents:
diff changeset
918 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
919 ; Draw two half-pixels at position (win_top,win_leftx2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
920 ; Inputs: win_leftx2, win_top, win_color_1/_2
0
heinrichsweikamp
parents:
diff changeset
921 ; Trashed: WREG, PROD
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
922 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
923 global pixel_write
0
heinrichsweikamp
parents:
diff changeset
924 pixel_write:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
925 movf win_leftx2,W
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
926 mullw .2 ; win_leftx2 x 2 -> PRODH:PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
927 rcall pixel_write_col320 ; start address vertical (.0 - .319)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
928 rcall half_pixel_write ; write this half-one
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
929
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
930 movf win_leftx2,W ; address of next one
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
931 mullw .2 ; win_leftx2 x 2 -> PRODH:PRODL
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
932 INCI PROD ; PROD++
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
933 rcall pixel_write_col320
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
934 bra half_pixel_write ; and return... note: cmd 0x20 is mandatory, because
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
935 ; of the auto-increment going vertical
0
heinrichsweikamp
parents:
diff changeset
936
heinrichsweikamp
parents:
diff changeset
937 global pixel_write_col320
heinrichsweikamp
parents:
diff changeset
938 pixel_write_col320:
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
939 btfsc screen_type4 ; display type 4 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
940 bra pixel_write_col320_d4 ; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
941 btfsc screen_type3 ; display type 3 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
942 bra pixel_write_col320_d3 ; YES
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
943 btfsc screen_type2 ; display type 2 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
944 bra pixel_write_col320_d2 ; YES
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
945 btfsc screen_type1 ; display type 1 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
946 bra pixel_write_col320_d1 ; YES
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
947 ; NO to all - display type 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
948 btfss flip_screen ; 180° rotation?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
949 bra pixel_write_noflip_H ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
950 bra pixel_write_flip_H ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
951 pixel_write_col320_d1: ; display type 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
952 btfsc flip_screen ; 180° rotation?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
953 bra pixel_write_noflip_H ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
954 pixel_write_flip_H: ; flip d0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
955 movf PRODL,W ; 16 bits 319 - PROD --> PROD
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
956 sublw LOW .319 ; 319-W --> W
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
957 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
958 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
959 btfss STATUS,C ; borrow = /CARRY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
960 incf WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
961 sublw HIGH .319
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
962 movwf PRODH
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
963
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
964 pixel_write_noflip_H:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
965 Index_out 0x21 ; frame memory vertical address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
966 bra TFT_DataWrite_PROD ; and return...
0
heinrichsweikamp
parents:
diff changeset
967
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
968 pixel_write_col320_d2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
969 movlw 0x06
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
970 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
971 movf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
972 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
973 movlw 0x07
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
974 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
975 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
976 rcall TFT_DataWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
977
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
978 incf PRODL,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
979 movlw .0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
980 addwfc PRODH,F ; +1
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
981
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
982 movlw 0x08
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
983 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
984 movf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
985 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
986 movlw 0x09
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
987 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
988 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
989 bra TFT_DataWrite ; ... and return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
990
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
991 pixel_write_col320_d3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
992 movlw 0x21 ; start address vertical (.0 - .319)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
993 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
994 bra TFT_DataWrite_PROD ; and return...
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
995
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
996 pixel_write_col320_d4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
997 movlw 0x2A
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
998 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
999 rcall TFT_DataWrite_PROD
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1000 incf PRODL,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1001 movlw .0
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1002 addwfc PRODH,F ; +1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1003 bra TFT_DataWrite_PROD ; and return...
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1004
0
heinrichsweikamp
parents:
diff changeset
1005 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1006 ; Write one half-pixel at position (win_top,win_leftx2).
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1007 ; Inputs: win_leftx2, win_top, win_color_1/_2
0
heinrichsweikamp
parents:
diff changeset
1008 ; Trashed: WREG, PROD
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1009 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1010 global half_pixel_write
0
heinrichsweikamp
parents:
diff changeset
1011 half_pixel_write:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1012 movf win_top,W ; d'0' ... d'239'
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1013 ; Variant with Y position in WREG
0
heinrichsweikamp
parents:
diff changeset
1014 half_pixel_write_1:
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1015 btfsc screen_type4 ; display type 4 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1016 bra half_pixel_write_1_display4 ; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1017 btfsc screen_type3 ; display type 3 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1018 bra half_pixel_write_1_display3 ; YES
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1019 btfsc screen_type2 ; display type 2 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1020 bra half_pixel_write_1_display2 ; YES
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1021
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1022 half_pixel_write_1_display1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1023 btfss flip_screen ; 180° rotation?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1024 sublw .239 ; 239-Y --> Y
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1025 mullw .1 ; copy row to PRODL (PRODH=0)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1026 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1027 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
1028
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1029 Index_out 0x22 ; frame memory data write start
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1030 RS_H ; data
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1031 bcf INTCON,GIE
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1032 movff win_color1,PORTA ; upper
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1033 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1034 bra half_pixel_write_1_display1_l_io ; YES
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1035 movff win_color2,PORTH ; lower
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1036 WR_L
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1037 WR_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1038 bsf INTCON,GIE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1039 return
0
heinrichsweikamp
parents:
diff changeset
1040
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1041 half_pixel_write_1_display1_l_io:
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1042 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1043 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1044 movff win_color2,PORTA ; lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1045 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1046 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1047 bsf INTCON,GIE
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1048 return
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1049
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1050 half_pixel_write_1_display2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1051 mullw 1 ; copy row to PRODL (PRODH=0)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1052 ; Row address start
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1053 movlw 0x02
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1054 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1055 movlw .0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1056 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1057 movlw 0x03
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1058 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1059 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1060 rcall TFT_DataWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1061
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1062 incf PRODL,F
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1063
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1064 movlw 0x04
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1065 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1066 movlw .0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1067 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1068 movlw 0x05
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1069 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1070 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1071 rcall TFT_DataWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1072
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1073 movff win_color1,PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1074 movff win_color2,PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1075 rcall convert_for_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1076
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1077 movlw 0x22 ; start writing data to GRAM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1078 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1079 RS_H ; data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1080 movff win_color5, PORTH
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1081 WR_L
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1082 WR_H ; tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1083 movff win_color4, PORTH
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1084 WR_L
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1085 WR_H ; tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1086 movff win_color3, PORTH
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1087 WR_L
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1088 WR_H ; tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1089 return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1090
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1091 half_pixel_write_1_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1092 mullw 1 ; copy row to PRODL (PRODH=0)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1093
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1094 movlw 0x20 ; horizontal address START:END
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1095 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1096 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1097
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1098 movlw 0x22 ; start writing data to GRAM
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1099 rcall TFT_CmdWrite
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1100 RS_H ; data
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1101 movff win_color1, PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1102 WR_L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1103 WR_H ; tick
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1104 movff win_color2, PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1105 WR_L
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1106 WR_H ; tick
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1107 return ; done
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1108
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1109 half_pixel_write_1_display4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1110 mullw 1 ; copy row to PRODL (PRODH=0)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1111 ; Row address start
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1112 movlw 0x2B
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1113 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1114 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1115 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1116 movf PRODL,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1117 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1118
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1119 incf PRODL,F ; +1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1120 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1121 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1122 movf PRODL,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1123 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1124
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1125 movlw 0x2C ; Start Writing Data to GRAM
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1126 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1127 RS_H ; data
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1128 movff win_color1,PORTA ; upper
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1129 movff win_color2,PORTH ; lower
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1130 WR_L
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1131 WR_H ; tick
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1132 bsf INTCON,GIE
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1133 return
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1134
0
heinrichsweikamp
parents:
diff changeset
1135 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1136 ; Draw a vertical line of half-pixel at position (win_top,win_leftx2,win_height).
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1137 ; Inputs: win_leftx2, win_top, win_height, win_color_1/_2
0
heinrichsweikamp
parents:
diff changeset
1138 ; Trashed: WREG, PROD, TABLAT, TBLPTRL
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1139 ;
0
heinrichsweikamp
parents:
diff changeset
1140 global half_vertical_line
heinrichsweikamp
parents:
diff changeset
1141 half_vertical_line:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1142 clrf TABLAT ; loop index
0
heinrichsweikamp
parents:
diff changeset
1143
heinrichsweikamp
parents:
diff changeset
1144 half_vertical_line_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1145 movf win_leftx2,W ; init X position
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1146 mullw .2 ; win_leftx2 x 2 -> PRODH:PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1147 movf TABLAT,W ; get loop index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1148 andlw .1 ; just low bit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1149 xorwf PRODL,F ; and use it to jitter current X position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1150 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
1151
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1152 movf win_height,W ; index reached height (bank0 read) ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1153 xorwf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1154 btfsc STATUS,Z ; Equal ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1155 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1156 movf win_top,W ; Y = top + index (bank0 read)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1157 addwf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1158 rcall half_pixel_write_1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1159 incf TABLAT,F ; index++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1160 bra half_vertical_line_loop
0
heinrichsweikamp
parents:
diff changeset
1161
heinrichsweikamp
parents:
diff changeset
1162 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1163 ; Draw a horizontal line of half-pixel at position (win_top,win_leftx2,win_width).
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1164 ; Inputs: win_leftx2, win_top, win_width, win_color_1/_2
0
heinrichsweikamp
parents:
diff changeset
1165 ; Trashed: WREG, PROD, TABLAT, TBLPTRL
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1166 ;
0
heinrichsweikamp
parents:
diff changeset
1167 global half_horizontal_line
heinrichsweikamp
parents:
diff changeset
1168 half_horizontal_line:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1169 clrf TABLAT ; loop index
0
heinrichsweikamp
parents:
diff changeset
1170
heinrichsweikamp
parents:
diff changeset
1171 half_horizontal_line_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1172 movf win_leftx2,W ; init X position
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1173 mullw .2 ; win_leftx2 x 2 -> PRODH:PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1174 rcall pixel_write_col320 ; start address vertical (.0 - .319)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1175 movf win_width,W ; index reached height (bank0 read) ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1176 xorwf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1177 btfsc STATUS,Z ; equal ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1178 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1179 movf win_top,W ; Y = top + index (bank0 read)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1180 addwf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1181 rcall half_pixel_write_1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1182 incf TABLAT,F ; index++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1183 bra half_horizontal_line_loop
0
heinrichsweikamp
parents:
diff changeset
1184
heinrichsweikamp
parents:
diff changeset
1185
heinrichsweikamp
parents:
diff changeset
1186 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1187 ; TFT Data Command
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1188 ;
0
heinrichsweikamp
parents:
diff changeset
1189 TFT_DataWrite_PROD:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1190 ; RD_H ; keep high
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1191 RS_H ; data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1192 btfsc screen_type2 ; screen type 2 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1193 bra TFT_DataWrite_PROD_display2 ; YES
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1194 btfsc screen_type3 ; screen type 3 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1195 bra TFT_DataWrite_PROD_display2 ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1196 bcf INTCON,GIE ; NO -
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1197 movff PRODH,PORTA ; - move high byte to PORTA
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1198 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1199 bra TFT_DataWrite_PROD_less_io ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1200 movff PRODL,PORTH ; - move low byte to PORTH
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1201 WR_L ; - tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1202 WR_H ; - tack
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1203 bsf INTCON,GIE ; -
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1204 return ; - done
0
heinrichsweikamp
parents:
diff changeset
1205
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1206 TFT_DataWrite_PROD_less_io:
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1207 WR_L
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1208 WR_H ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1209 movff PRODL,PORTA ; - move low byte to PORTH
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1210 WR_L ; - tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1211 WR_H ; - tack
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1212 bsf INTCON,GIE ; -
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1213 return ; - done
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1214
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1215 TFT_DataWrite_PROD_display2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1216 movff PRODH,PORTH ; move high byte to PORTH (display 2 is big endian)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1217 WR_L ; tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1218 WR_H ; tack
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1219 movff PRODL,PORTH ; move low byte to PORTH
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1220 WR_L ; tick
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1221 WR_H ; tack
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1222 btfsc screen_type3 ; screen type 3 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1223 return ; YES - done
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1224 movff win_color3,PORTH ; NO - move low(est) byte to PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1225 WR_L ; - tick
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1226 WR_H ; - tack
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1227 return ; - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1228
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1229
0
heinrichsweikamp
parents:
diff changeset
1230 TFT_DataRead_PROD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1231 Index_out 0x22 ; frame memory data read start
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
1232 TFT_CmdRead_PROD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1233 setf TRISA ; port A as input
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1234 setf TRISH ; port H as input
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1235 RS_H ; data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1236 WR_H ; not write
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1237 RD_L ; read
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1238 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1239 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1240 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1241 RD_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1242 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1243 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1244 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1245 RD_L ; read
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1246 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1247 ;nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1248 ;nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1249 movff PORTA,PRODH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1250 movff PORTH,PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1251 RD_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1252 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1253 clrf TRISA ; port A as output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1254 clrf TRISH ; port H as output
0
heinrichsweikamp
parents:
diff changeset
1255 return
heinrichsweikamp
parents:
diff changeset
1256
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1257 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1258 ; Output TFT Window Address commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1259 ; Inputs : win_top, win_leftx2, win_height, win_width
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1260 ; Output : PortA/PortH commands
0
heinrichsweikamp
parents:
diff changeset
1261 ; Trashed: PROD
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1262 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1263 global TFT_box_write
0
heinrichsweikamp
parents:
diff changeset
1264 TFT_box_write:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1265 movf win_leftx2,W ; compute left = 2 * leftx2 --> PROD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1266 mullw .2 ; win_leftx2 x 2 -> PRODH:PRODL
0
heinrichsweikamp
parents:
diff changeset
1267
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1268 btfsc screen_type4 ; screen type 4 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1269 bra TFT_box_write_display4 ; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1270 btfsc screen_type3 ; screen type 3 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1271 bra TFT_box_write_display3 ; YES
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1272 btfsc screen_type2 ; screen type 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1273 bra TFT_box_write_display2 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1274 btfsc screen_type1 ; screen type 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1275 bra TFT_box_write_display1 ; YES
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1276
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1277 ; screen type 0
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1278 TFT_box_write_display0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1279 btfsc flip_screen ; 180° rotation?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1280 bra TFT_box_do_flip_H ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1281 bra TFT_box_no_flip_H ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1282
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1283 ; screen type 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1284 TFT_box_write_display1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1285 btfss flip_screen ; 180° rotation?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1286 bra TFT_box_do_flip_H ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1287 ;bra TFT_box_no_flip_H ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1288
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1289 ;---- Normal horizontal window ---------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1290 TFT_box_no_flip_H:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1291 Index_out 0x52 ; window vertical start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1292 rcall TFT_DataWrite_PROD ; output left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1293 Index_out 0x21 ; frame memory vertical address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1294 rcall TFT_DataWrite_PROD ; output left
0
heinrichsweikamp
parents:
diff changeset
1295
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1296 movf win_width+0,W ; right = left + width - 1
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1297 addwf PRODL,F
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1298 movf win_width+1,W
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1299 addwfc PRODH,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1300 decf PRODL,F ; right--
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1301 btfss STATUS,C
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1302 decf PRODH,F
0
heinrichsweikamp
parents:
diff changeset
1303
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1304 Index_out 0x53 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1305 rcall TFT_DataWrite_PROD
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1306 bra TFT_box_common_H
0
heinrichsweikamp
parents:
diff changeset
1307
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1308 ;---- Flipped horizontal window --------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1309 TFT_box_do_flip_H:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1310 ; calculate new coordinate
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1311 movf PRODL,W ; 16 bits 319 - PROD --> PROD
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1312 sublw LOW .319 ; 319 - WREG --> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1313 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1314 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1315 btfss STATUS,C ; borrow = /CARRY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1316 incf WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1317 sublw HIGH .319
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1318 movwf PRODH
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
1319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1320 Index_out 0x53 ; window vertical start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1321 rcall TFT_DataWrite_PROD ; output left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1322 Index_out 0x21 ; frame memory vertical address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1323 rcall TFT_DataWrite_PROD ; output left
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1324
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1325 ; calculate new coordinate
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1326 movf win_width+0,W ; 16 bits PROD - width --> PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1327 subwf PRODL,F ; PRODL - WREG --> PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1328 movf win_width+1,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1329 subwfb PRODH,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1330 INCI PROD ; PROD++
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1331
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1332 Index_out 0x52 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1333 rcall TFT_DataWrite_PROD
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1334
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1335 TFT_box_common_H:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1336 btfss flip_screen ; 180° rotation ?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1337 bra TFT_box_no_flip_V ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1338 ;bra TFT_box_do_flip_V ; YES
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1339
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1340 ;---- Flipped vertical window -----------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1341 TFT_box_do_flip_V:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1342 ; calculate new coordinate
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1343 movff win_top,PRODH ; top --> PRODH (first byte)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1344 movf win_height,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1345 addwf PRODH,W
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1346 decf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1347 movwf PRODL ; top + height - 1 --> PRODL (second byte)
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1348
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1349 Index_out 0x50 ; window horizontal start address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1350 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1351 rcall TFT_DataWrite ; lower (and tick)
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1352
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1353 Index_out 0x51 ; window horizontal end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1354 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1355 rcall TFT_DataWrite ; lower (and tick)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1356
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1357 Index_out 0x20 ; frame memory horizontal address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1358 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1359 bra TFT_DataWrite ; lower (and tick) and return
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
1360
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1361 ;---- Normal vertical window ----------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1362 TFT_box_no_flip_V:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1363 movff win_top,PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1364 movf win_height,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1365 addwf PRODL,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1366 sublw .240 ; 240 - top - height
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1367 movwf PRODH ; first byte
0
heinrichsweikamp
parents:
diff changeset
1368
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1369 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1370 sublw .239 ; 239 - top
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1371 movwf PRODL ; --> second byte
0
heinrichsweikamp
parents:
diff changeset
1372
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1373 Index_out 0x50 ; window horizontal start address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1374 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1375 rcall TFT_DataWrite ; lower (and tick)
0
heinrichsweikamp
parents:
diff changeset
1376
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1377 Index_out 0x51 ; window horizontal end address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1378 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1379 rcall TFT_DataWrite ; lower (and tick)
0
heinrichsweikamp
parents:
diff changeset
1380
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1381 Index_out 0x20 ; frame memory horizontal address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1382 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1383 bra TFT_DataWrite ; lower (and tick) and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1384
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1385
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1386 TFT_box_write_display2:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1387 ; setup left border
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1388 movlw 0x06
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1389 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1390 movf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1391 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1392 movlw 0x07
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1393 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1394 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1395 rcall TFT_DataWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1396
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1397 movf win_width+0,W ; right = left + width - 1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1398 addwf PRODL,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1399 movf win_width+1,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1400 addwfc PRODH,F
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1401 decf PRODL,F ; decrement result
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1402 btfss STATUS,C
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1403 decf PRODH,F
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1404
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1405 ; setup right border
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1406 movlw 0x08
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1407 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1408 movf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1409 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1410 movlw 0x09
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1411 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1412 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1413 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1414
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1415 ;---- Normal vertical window -----------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1416 ; Output (top) (bottom)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1417 movff win_top,PRODH ; top --> PRODH (first byte)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1418 movf win_height,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1419 addwf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1420 decf WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1421 movwf PRODL ; top+height-1 --> PRODL (second byte)
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1422
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1423 movlw 0x02
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1424 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1425 movlw 0x00
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1426 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1427 movlw 0x03
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1428 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1429 movf PRODH,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1430 rcall TFT_DataWrite
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1431
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1432 movlw 0x04
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1433 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1434 movlw 0x00
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1435 rcall TFT_DataWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1436 movlw 0x05
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1437 rcall TFT_CmdWrite
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1438 movf PRODL,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1439 bra TFT_DataWrite ; ... and return
0
heinrichsweikamp
parents:
diff changeset
1440
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1441 TFT_box_write_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1442 ;---- Normal horizontal window ---------------------------------------
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1443 ; Output 0x35 left,
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1444 ; 0x36 right == left + width - 1.
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1445
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1446 Index_out 0x35 ; window vertical start address
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1447 rcall TFT_DataWrite_PROD ; output left
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1448 Index_out 0x21 ; also the horizontal first pix coordinate
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1449 rcall TFT_DataWrite_PROD ; output left
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1450
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1451 movf win_width+0,W ; right = left + width - 1
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1452 addwf PRODL,F
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1453 movf win_width+1,W
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1454 addwfc PRODH,F
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1455 decf PRODL,F ; decrement result
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1456 btfss STATUS,C
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1457 decf PRODH,F
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1458
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1459 Index_out 0x36 ; write and the right border
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1460 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1461
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1462 ;---- Normal vertical window -----------------------------------------
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1463 ; Output 0x37 (top) (bottom)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1464 movff win_top,PRODH ; top --> PRODH (first byte)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1465 movff win_height,WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1466 addwf PRODH,W
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1467 decf WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1468 movwf PRODL ; top + height - 1 --> PRODL (second byte)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1469
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1470 Index_out 0x37
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1471 rcall TFT_DataWrite_PROD
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1472
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1473 movff PRODH,PRODL
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1474 clrf PRODH ; start pixel V coord == top.
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1475 Index_out 0x20
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1476 bra TFT_DataWrite_PROD ; and return...
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1477
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1478 TFT_box_write_display4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1479 movlw 0x2B
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1480 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1481 movf PRODH,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1482 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1483 movf PRODL,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1484 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1485
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1486 movf win_width+0,W ; right = left + width - 1
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1487 addwf PRODL,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1488 movf win_width+1,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1489 addwfc PRODH,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1490 decf PRODL,F ; decrement result
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1491 btfss STATUS,C
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1492 decf PRODH,F
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1493
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1494 ; setup right border
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1495 movf PRODH,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1496 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1497 movf PRODL,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1498 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1499
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1500 ;---- Normal vertical window -----------------------------------------
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1501 ; Output (top) (bottom)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1502 movff win_top,PRODH ; top --> PRODH (first byte)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1503 movf win_height,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1504 addwf PRODH,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1505 decf WREG
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1506 movwf PRODL ; top+height-1 --> PRODL (second byte)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1507
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1508 movlw 0x2A
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1509 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1510 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1511 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1512 movf PRODH,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1513 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1514
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1515 ; setup bottom border
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1516 movlw 0x00
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1517 rcall TFT_DataWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1518 movf PRODL,W
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1519 bra TFT_DataWrite ; ... and return
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1520
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1521
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1522 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1523 ; TFT_frame : draw a frame around current box with current color
0
heinrichsweikamp
parents:
diff changeset
1524 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2
heinrichsweikamp
parents:
diff changeset
1525 ; Outputs: (none)
heinrichsweikamp
parents:
diff changeset
1526 ; Trashed: WREG, PROD, aa_start:2, aa_end:2
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1527 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1528 global TFT_frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1529 TFT_frame:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1530 movff win_top,tft_save_top ; backup everything
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1531 movff win_height,tft_save_height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1532 movff win_leftx2,tft_save_left
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1533 movff win_width+0,tft_save_width
0
heinrichsweikamp
parents:
diff changeset
1534
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1535 ;---- TOP line -----------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1536 movlw .1 ; row ~ height = 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1537 movwf win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1538 rcall TFT_box
0
heinrichsweikamp
parents:
diff changeset
1539
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1540 ;---- BOTTOM line --------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1541 movff tft_save_top,PRODL ; get back top
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1542 movff tft_save_height,WREG ; get back height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1543 addwf PRODL,W ; top + height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1544 decf WREG ; top + height - 1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1545 movwf win_top ; top + height - 1 --> top
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1546 rcall TFT_box
0
heinrichsweikamp
parents:
diff changeset
1547
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1548 ;---- LEFT column --------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1549 movff tft_save_top,win_top ; restore top/height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1550 movff tft_save_height,win_height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1551 movlw .1 ; column ~ width = 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1552 movwf win_width+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1553 rcall TFT_box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1554
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1555 ;---- RIGHT column -------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1556 movff tft_save_left,WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1557 movff tft_save_width,PRODL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1558 addwf PRODL,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1559 decf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1560 movwf win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1561 rcall TFT_box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1562
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1563 ;---- Restore everything -------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1564 movff tft_save_left,win_leftx2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1565 movff tft_save_width,win_width+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1566 return
0
heinrichsweikamp
parents:
diff changeset
1567
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1568 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1569 ; TFT_box: fills current box with current color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1570 ; Inputs : win_top, win_leftx2, win_height, win_width, win_color1, win_color2
0
heinrichsweikamp
parents:
diff changeset
1571 ; Outputs: (none)
heinrichsweikamp
parents:
diff changeset
1572 ; Trashed: WREG, PROD
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1573 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1574 global TFT_box
0
heinrichsweikamp
parents:
diff changeset
1575 TFT_box:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1576 ;---- Define Window ------------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1577 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1578 rlcf win_width+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1579 rlcf win_width+1,F ; x2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1580 rcall TFT_box_write ; setup box
0
heinrichsweikamp
parents:
diff changeset
1581
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1582 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1583 rrcf win_width+1,F ; width /= 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1584 rrcf win_width+0,F
0
heinrichsweikamp
parents:
diff changeset
1585
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1586 ;---- Fill Window --------------------------------------------------------
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1587 movlw 0x22 ; frame memory data write start
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1588 btfsc screen_type4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1589 movlw 0x2C ; Start Writing Data to GRAM (Display 4)
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1590 rcall TFT_CmdWrite
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1591
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1592 clrf PRODH ; column counter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1593 RS_H ; data
0
heinrichsweikamp
parents:
diff changeset
1594
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1595 btfsc screen_type4 ; display type 4 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1596 bra TFT_box_display4 ; YES
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1597 btfsc screen_type3 ; display type 3 ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1598 bra TFT_box_display3 ; YES
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1599 btfsc screen_type2 ; display type 2 ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1600 bra TFT_box_display2 ; YES
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1601
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1602 TFT_box2: ; loop height times
0
heinrichsweikamp
parents:
diff changeset
1603 movff win_height,PRODL
heinrichsweikamp
parents:
diff changeset
1604
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1605 TFT_box3: ; loop width times
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1606 bcf INTCON,GIE
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1607 movff win_color1,PORTA ; upper
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1608 btfsc less_io_cpu ; less I/O CPU?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1609 bra TFT_box3_less_io ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1610 movff win_color2,PORTH ; lower
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1611 WR_L ; tick
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1612 WR_H ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1613 WR_L ; tick
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1614 WR_H ; ...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1615 bsf INTCON,GIE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1616 decfsz PRODL,F ; row loop finished ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1617 bra TFT_box3 ; NO - continue
0
heinrichsweikamp
parents:
diff changeset
1618
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1619 incf PRODH,F ; column count ++
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1620 movf win_bargraph,W ; get width of active bargraph part
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1621 cpfseq PRODH ; current column == end of active bargraph ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1622 bra TFT_box4 ; NO - just loop
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1623 clrf win_color1 ; YES - switch to black
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1624 clrf win_color2 ; - ...
0
heinrichsweikamp
parents:
diff changeset
1625 TFT_box4:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1626 movf win_width+0,W ; get total bargraph width
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1627 xorwf PRODH,W ; all columns done?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1628 bnz TFT_box2 ; NO - loop
0
heinrichsweikamp
parents:
diff changeset
1629
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1630 movlw 0x00 ; NOP, to stop window mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1631 rcall TFT_CmdWrite
0
heinrichsweikamp
parents:
diff changeset
1632
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1633 ; reset bargraph mode...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1634 setf win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1635 return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1636
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1637 TFT_box3_less_io:
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1638 WR_L ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1639 WR_H ; ...
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1640 movff win_color2,PORTA ; lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1641 WR_L ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1642 WR_H ; ...
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1643 movff win_color1,PORTA ; upper
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1644 WR_L ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1645 WR_H ; ...
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1646 movff win_color2,PORTA ; lower
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1647 WR_L ; tick
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1648 WR_H ; ...
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1649 bsf INTCON,GIE
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1650 decfsz PRODL,F ; row loop finished ?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1651 bra TFT_box3 ; NO - continue
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1652
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1653 incf PRODH,F ; column count ++
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1654 movf win_bargraph,W ; get width of active bargraph part
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1655 cpfseq PRODH ; current column == end of active bargraph ?
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1656 bra TFT_box4 ; NO - just loop
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1657 clrf win_color1 ; YES - switch to black
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1658 clrf win_color2 ; - ...
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1659 bra TFT_box4 ; NO - just loop
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1660
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1661 TFT_box_display2:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1662 ; Screen 2
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1663 movff win_color1,PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1664 movff win_color2,PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1665 rcall convert_for_display2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1666 clrf PRODH ; column counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1667 TFT_box2_display2: ; loop height times
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1668 movff win_height,PRODL
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1669 TFT_box3_display2: ; loop width times
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1670 movff win_color5,PORTH
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1671 bcf tft_nwr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1672 bsf tft_nwr ; upper
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1673 movff win_color4,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1674 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1675 bsf tft_nwr ; high
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1676 movff win_color3,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1677 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1678 bsf tft_nwr ; low
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1679
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1680 movff win_color5,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1681 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1682 bsf tft_nwr ; upper
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1683 movff win_color4,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1684 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1685 bsf tft_nwr ; high
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1686 movff win_color3,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1687 bcf tft_nwr
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1688 bsf tft_nwr ; low
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1689 decfsz PRODL,F ; row loop finished?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1690 bra TFT_box3_display2 ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1691 incf PRODH,F ; YES - column count ++
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1692 movf win_bargraph,W ; - get bargraph width
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1693 cpfseq PRODH ; - current column = bargraph ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1694 bra TFT_box4_display2 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1695 clrf win_color5 ; YES - switch to black
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1696 clrf win_color4 ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1697 clrf win_color3 ; - ...
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1698 TFT_box4_display2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1699 movf win_width+0,W ; get width
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1700 cpfseq PRODH ; width loop finished ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1701 bra TFT_box2_display2 ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1702 setf win_bargraph ; YES - reset bargraph mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1703 return ; - done
0
heinrichsweikamp
parents:
diff changeset
1704
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1705 TFT_box_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1706 ; Screen 3
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1707 TFT_box2_display3: ; loop height times
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1708 movff win_height,PRODL
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1709 TFT_box3_display3: ; loop width times
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1710 movff win_color1,PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1711 bcf tft_nwr
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1712 bsf tft_nwr ; upper
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1713 movff win_color2,PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1714 bcf tft_nwr
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1715 bsf tft_nwr ; high
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1716 movff win_color1,PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1717 bcf tft_nwr
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1718 bsf tft_nwr ; low
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1719 movff win_color2,PORTH
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1720 bcf tft_nwr
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1721 bsf tft_nwr ; upper
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1722 decfsz PRODL,F ; row loop finished?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1723 bra TFT_box3_display3 ; NO - loop
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1724 incf PRODH,F ; YES - column count ++
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1725 movf win_bargraph,W ; - get bargraph width
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1726 cpfseq PRODH ; - current column = bargraph ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1727 bra TFT_box4_display3 ; NO
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1728 clrf win_color1 ; Yes - switch to black
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1729 clrf win_color2 ; - ...
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1730 TFT_box4_display3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1731 movf win_width+0,W ; get width
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1732 cpfseq PRODH ; width loop finished ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1733 bra TFT_box2_display3 ; NO - loop
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1734 setf win_bargraph ; YES - reset bargraph mode
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1735 return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1736
654
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1737 TFT_box_display4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1738 ; Screen 4
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1739 clrf PRODH ; column counter
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1740 TFT_box2_display4: ; loop height times
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1741 movff win_height,PRODL
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1742 TFT_box3_display4: ; loop width times
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1743 movff win_color1,PORTA
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1744 movff win_color2,PORTH
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1745 WR_L ; tick
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1746 WR_H ; ...
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1747 WR_L ; tick
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1748 WR_H ; ...
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1749 decfsz PRODL,F ; row loop finished?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1750 bra TFT_box3_display4 ; NO - loop
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1751 incf PRODH,F ; YES - column count ++
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1752 movf win_bargraph,W ; - get bargraph width
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1753 cpfseq PRODH ; - current column = bargraph ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1754 bra TFT_box4_display4 ; NO
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1755 clrf win_color1 ; Yes - switch to black
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1756 clrf win_color2 ; - ...
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1757 TFT_box4_display4:
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1758 movf win_width+0,W ; get width
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1759 cpfseq PRODH ; width loop finished ?
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1760 bra TFT_box2_display4 ; NO - loop
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1761 setf win_bargraph ; YES - reset bargraph mode
75e90cd0c2c3 hwOS sport 10.77 release
heinrichsweikamp
parents: 648
diff changeset
1762 return ; - done
0
heinrichsweikamp
parents:
diff changeset
1763
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1764 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1765 ; Convert 8 bit RGB b'RRRGGGBB' into 16 bit RGB b'RRRRRGGGGGGBBBBB'
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1766 ; WREG win_color1 win_color2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1767 global TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
1768 TFT_set_color:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1769 movwf tft_temp1 ; get 8 bit RGB b'RRRGGGBB' into tft_temp1...
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1770 movwf tft_temp2 ; ... and tft_temp2
0
heinrichsweikamp
parents:
diff changeset
1771
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1772 ; mask bit 7,6,5,4,3,2
0
heinrichsweikamp
parents:
diff changeset
1773 movlw b'00000011'
heinrichsweikamp
parents:
diff changeset
1774 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1775
heinrichsweikamp
parents:
diff changeset
1776 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1777 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1778 movlw b'01010000'
heinrichsweikamp
parents:
diff changeset
1779 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1780 movlw b'10100000'
heinrichsweikamp
parents:
diff changeset
1781 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1782 movlw b'11111000'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1783 movwf tft_temp3 ; blue done
0
heinrichsweikamp
parents:
diff changeset
1784
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1785 movff tft_temp1,tft_temp2 ; copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1786 ; mask bit 7,6,5,1,0
0
heinrichsweikamp
parents:
diff changeset
1787 movlw b'00011100'
heinrichsweikamp
parents:
diff changeset
1788 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1789 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1790 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1791
heinrichsweikamp
parents:
diff changeset
1792 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1793 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1794 movlw b'00000100'
heinrichsweikamp
parents:
diff changeset
1795 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1796 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
1797 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1798 movlw b'00001100'
heinrichsweikamp
parents:
diff changeset
1799 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1800 movlw b'00010000'
heinrichsweikamp
parents:
diff changeset
1801 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1802 movlw b'00010100'
heinrichsweikamp
parents:
diff changeset
1803 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1804 movlw b'00100000'
heinrichsweikamp
parents:
diff changeset
1805 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1806 movlw b'00111111'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1807 movwf tft_temp4
0
heinrichsweikamp
parents:
diff changeset
1808
heinrichsweikamp
parents:
diff changeset
1809 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1810 rrcf tft_temp3,F
heinrichsweikamp
parents:
diff changeset
1811
heinrichsweikamp
parents:
diff changeset
1812 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1813 rrcf tft_temp3,F
heinrichsweikamp
parents:
diff changeset
1814
heinrichsweikamp
parents:
diff changeset
1815 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1816 rrcf tft_temp3,W ; tft_temp3 (b'GGGBBBBB') done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1817 movwf win_color2 ; set color registers...
0
heinrichsweikamp
parents:
diff changeset
1818
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1819 movff tft_temp1,tft_temp2 ; copy
0
heinrichsweikamp
parents:
diff changeset
1820 clrf tft_temp1
heinrichsweikamp
parents:
diff changeset
1821
heinrichsweikamp
parents:
diff changeset
1822 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1823 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1824
heinrichsweikamp
parents:
diff changeset
1825 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1826 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1827
heinrichsweikamp
parents:
diff changeset
1828 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1829 rrcf tft_temp1,F ; green done
0
heinrichsweikamp
parents:
diff changeset
1830
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1831 ; mask bit 4,3,2,1,0
0
heinrichsweikamp
parents:
diff changeset
1832 movlw b'11100000'
heinrichsweikamp
parents:
diff changeset
1833 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1834
heinrichsweikamp
parents:
diff changeset
1835 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1836 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1837 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1838 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1839 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1840
heinrichsweikamp
parents:
diff changeset
1841 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1842 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1843 movlw b'00000100'
heinrichsweikamp
parents:
diff changeset
1844 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1845 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
1846 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1847 movlw b'00001100'
heinrichsweikamp
parents:
diff changeset
1848 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1849 movlw b'00010000'
heinrichsweikamp
parents:
diff changeset
1850 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1851 movlw b'00010100'
heinrichsweikamp
parents:
diff changeset
1852 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1853 movlw b'00100000'
heinrichsweikamp
parents:
diff changeset
1854 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1855 movlw b'00111111'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1856 movwf tft_temp4
0
heinrichsweikamp
parents:
diff changeset
1857
heinrichsweikamp
parents:
diff changeset
1858 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1859 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1860
heinrichsweikamp
parents:
diff changeset
1861 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1862 rrcf tft_temp1,F
0
heinrichsweikamp
parents:
diff changeset
1863
heinrichsweikamp
parents:
diff changeset
1864 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1865 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1866
heinrichsweikamp
parents:
diff changeset
1867 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1868 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1869
heinrichsweikamp
parents:
diff changeset
1870 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1871 rrcf tft_temp1,W ; red done
648
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1872 ; tft_temp1 (b'RRRRRGGG') done
aeca5717d9eb 3.17 / 10.72 release
heinrichs weikamp
parents: 645
diff changeset
1873 movwf win_color1 ; set color registers...
0
heinrichsweikamp
parents:
diff changeset
1874 return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1875
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1876
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1877 global convert_for_display2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1878 convert_for_display2: ; convert 16 bit RGB b'RRRRRGGG GGGBBBBB' into 24 bit RGB b'RRRRRR00 GGGGGG00 BBBBBB00'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1879 ; PRODH PRODL win_color5 win_color4 win_color3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1880 ; Red
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1881 movff PRODH,win_color5 ; = RRRRRGGG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1882 bcf win_color5,2 ; = RRRRR0GG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1883 btfsc win_color5,7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1884 bsf win_color5,2 ; = RRRRR1GG the lower two bits are ignored by the screen
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1885 ; Blue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1886 movff PRODL,win_color3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1887 rrcf win_color3,F ; = UGGGBBBB and the LSB-blue into carry
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1888 swapf win_color3,F ; = BBBBUGGG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1889 bcf win_color3,3 ; = BBBB0GGG
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1890 btfsc STATUS,C
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1891 bsf win_color3,3 ; = BBBB1GGG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1892 bcf win_color3,2 ; = BBBBB0GG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1893 btfsc win_color3,7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1894 bsf win_color3,2 ; = BBBBB1GG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1895 ; Green
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1896 rrcf PRODH,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1897 rrcf PRODL,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1898 rrcf PRODH,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1899 rrcf PRODL,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1900 rrcf PRODH,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1901 rrcf PRODL,F ; = GGGGGGBB the lower two bits are ignored by the screen
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1902 movff PRODL,win_color4
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1903 return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1904
0
heinrichsweikamp
parents:
diff changeset
1905
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1906 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
1907
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1908 IFDEF _screendump
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1909
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1910 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1911 ; Dump screen contents to the UART
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1912 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1913 global TFT_dump_screen_check
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1914 TFT_dump_screen_check:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1915 btfss vusb_in ; USB (still) plugged in?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1916 bcf screen_dump_avail ; NO - disable screen dump function
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1917
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1918 SERIAL_CC_RECEIVE WREG ; try to read a byte from RS232
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1919 btfsc rs232_rx_timeout ; anything received?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1920 return ; NO - done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1921 xorlw "l" ; YES - exclusive-or with coding of screen dump command
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1922 tstfsz WREG ; - screen dump command received?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1923 return ; NO - return
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1924 ;bra TFT_dump_screen ; YES - serve screen dump request
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1925
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1926 global TFT_dump_screen
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1927 TFT_dump_screen:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1928 btfsc screen_type2 ; is this an OSTC with a screen of type 2?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1929 return ; YES - not supported, abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1930 bsf block_sensor_interrupt ; NO - disable sensor interrupts
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1931 SERIAL_LC_SEND 'l' ; - send command acknowledge
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1932
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1933
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1934 ;---- Send DISPLAY box command for the full screen window -------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1935 Index_out 0x50 ; window horizontal start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1936 Parameter_out 0x00, 0x00 ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1937 Index_out 0x51 ; window horizontal end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1938 Parameter_out 0x00, 0xEF ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1939 Index_out 0x52 ; window vertical start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1940 Parameter_out 0x00, 0x00 ; 0-319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1941 Index_out 0x53 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1942 Parameter_out 0x01, 0x3F ; 0-319
0
heinrichsweikamp
parents:
diff changeset
1943
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1944 clrf ds_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1945 rcall dump_screen_pixel_reset
0
heinrichsweikamp
parents:
diff changeset
1946 dump_screen_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1947 btg LEDr ; LED activity toggle
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1948 ; dump even column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1949 movlw .240 ; 240 lines, once
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1950 movwf ds_line
0
heinrichsweikamp
parents:
diff changeset
1951 dump_screen_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1952 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1953 movff ds_line,WREG ; d'0' ... d'239'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1954 mullw .1 ; copy row to PRODH:L
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1955 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
1956
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1957 movff ds_column,WREG ; initialize X position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1958 mullw .2 ; ds_column x 2 -> PRODH:PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1959 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
1960
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1961 rcall TFT_DataRead_PROD ; read pixel
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1962 rcall dump_screen_pixel
0
heinrichsweikamp
parents:
diff changeset
1963
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1964 decfsz ds_line,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1965 bra dump_screen_2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1966 rcall dump_screen_pixel_flush
0
heinrichsweikamp
parents:
diff changeset
1967
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1968 ; dump odd column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1969 movlw .240 ; 240 lines, twice
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1970 movwf ds_line
0
heinrichsweikamp
parents:
diff changeset
1971 dump_screen_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1972 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1973 movff ds_line,WREG ; d'0' ... d'239'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1974 mullw .1 ; copy row to PRODH:L
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1975 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
1976
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1977 movff ds_column,WREG ; initialize X position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1978 mullw .2 ; ds_column x 2 -> PRODH:PRODL
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1979 INCI PROD ; PROD++
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1980 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
1981
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1982 rcall TFT_DataRead_PROD ; read pixel
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1983 rcall dump_screen_pixel ; compress and send pixel
0
heinrichsweikamp
parents:
diff changeset
1984
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1985 decfsz ds_line,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1986 bra dump_screen_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1987 rcall dump_screen_pixel_flush
0
heinrichsweikamp
parents:
diff changeset
1988
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1989 incf ds_column,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1990 movlw .160
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1991 cpfseq ds_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1992 bra dump_screen_1
0
heinrichsweikamp
parents:
diff changeset
1993
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1994 bcf block_sensor_interrupt ; re-enable sensor interrupts
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1995 clrf RCREG1 ; clear receive buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1996 bcf RCSTA1,CREN ; clear receiver status
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
1997 bsf RCSTA1,CREN ; ...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
1998 bsf screen_dump_avail ; enable screen dump function
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1999 return
0
heinrichsweikamp
parents:
diff changeset
2000
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
2001 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
2002 ; Pixel compression
heinrichsweikamp
parents:
diff changeset
2003 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2004 ; Input : PRODH:L = pixel
0
heinrichsweikamp
parents:
diff changeset
2005 ; Output: Compressed stream on output.
heinrichsweikamp
parents:
diff changeset
2006 ; Compressed format:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2007 ; 0ccccccc : BLACK pixel, repeated ccccccc+1 times (1..128)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2008 ; 11cccccc : WHITE pixel, repeated cccccc+1 times (1.. 64)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2009 ; 10cccccc HIGH LOW : color pixel (H:L) repeated ccccc+1 times (1.. 64)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
2010 ;
0
heinrichsweikamp
parents:
diff changeset
2011 dump_screen_pixel:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2012 movf PRODH,W ; compare pixel-high
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2013 xorwf ds_pixel+1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2014 bnz dump_screen_pixel_1 ; different -> dump
0
heinrichsweikamp
parents:
diff changeset
2015
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2016 movf PRODL,W ; compare pixel-low
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2017 xorwf ds_pixel+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2018 bnz dump_screen_pixel_1 ; different -> dump
0
heinrichsweikamp
parents:
diff changeset
2019
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2020 incf ds_count,F ; same color: just increment
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2021 return
0
heinrichsweikamp
parents:
diff changeset
2022
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2023 dump_screen_pixel_1: ; send (pixel,count) tuple
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2024 movf ds_count,W ; is count zero ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2025 bz dump_screen_pixel_2 ; YES - skip sending
0
heinrichsweikamp
parents:
diff changeset
2026
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2027 movf ds_pixel+1,W ; is this a BLACK pixel ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2028 iorwf ds_pixel+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2029 bz dump_screen_pix_black ; YES
0
heinrichsweikamp
parents:
diff changeset
2030
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2031 movf ds_pixel+1,W ; is this a white pixel ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2032 andwf ds_pixel+0,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2033 incf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2034 bz dump_screen_pix_white ; YES
0
heinrichsweikamp
parents:
diff changeset
2035
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2036 ; No: write the pixel itself...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2037 movlw .64 ; max color pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2038 cpfsgt ds_count ; skip if count > 64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2039 movf ds_count,W ; W <- min(64,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2040 subwf ds_count,F ; ds_count <- ds_count-W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2041 decf WREG ; save as 0..63
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2042 iorlw b'10000000' ; mark as a color pixel
0
heinrichsweikamp
parents:
diff changeset
2043
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2044 SERIAL_CC_SEND WREG ; send byte in WREG
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2045 SERIAL_CC_SEND ds_pixel+1 ; send bytes in ds_pixel, high byte first
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2046 SERIAL_CC_SEND ds_pixel+0 ; low byte last
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2047
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2048 bra dump_screen_pixel_1
0
heinrichsweikamp
parents:
diff changeset
2049
heinrichsweikamp
parents:
diff changeset
2050 dump_screen_pixel_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2051 movff PRODH,ds_pixel+1 ; save new pixel color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2052 movff PRODL,ds_pixel+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2053 movlw 1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2054 movwf ds_count ; and set count=1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2055 return
0
heinrichsweikamp
parents:
diff changeset
2056
heinrichsweikamp
parents:
diff changeset
2057 dump_screen_pix_black:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2058 movlw .128 ; max black pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2059 cpfsgt ds_count ; skip if count > 128
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2060 movf ds_count,W ; W <- min(128,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2061 subwf ds_count,F ; ds_count <- ds_count-W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2062 decf WREG ; save as 0..127
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
2063
0
heinrichsweikamp
parents:
diff changeset
2064 dump_screen_pix_3:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2065 SERIAL_CC_SEND WREG ; send byte in WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2066 bra dump_screen_pixel_1 ; more to dump ?
0
heinrichsweikamp
parents:
diff changeset
2067
heinrichsweikamp
parents:
diff changeset
2068 dump_screen_pix_white:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2069 movlw .64 ; max white pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2070 cpfsgt ds_count ; skip if count > 64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2071 movf ds_count,W ; W <- min(64,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2072 subwf ds_count,F ; ds_count <- ds_count-W
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2073 decf WREG ; save as 0..63
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2074 iorlw b'11000000' ; mark as a compressed white
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
2075 bra dump_screen_pix_3 ; send pixel
0
heinrichsweikamp
parents:
diff changeset
2076
heinrichsweikamp
parents:
diff changeset
2077 dump_screen_pixel_flush:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2078 clrf PRODH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2079 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2080 rcall dump_screen_pixel_1 ; send it
0
heinrichsweikamp
parents:
diff changeset
2081 dump_screen_pixel_reset:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2082 clrf ds_count ; clear count
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2083 return
0
heinrichsweikamp
parents:
diff changeset
2084
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
2085 ENDIF ; _screendump
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 608
diff changeset
2086
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2087 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
2088
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
2089 END