annotate src/tft.asm @ 653:8bcd138ab744

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